From e7247e91e9aa9a4e2b83e03de74fc6a8794df85a Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 12 Aug 2015 20:31:40 -0700 Subject: [PATCH] Switch to using leading comma style. --- App.elm | 133 +++++------ Component/Editor.elm | 175 +++++++-------- Component/LeftSidebar.elm | 272 +++++++++++------------ Component/LeftSidebar/CurrentDocView.elm | 29 ++- Component/LeftSidebar/OpenMenuView.elm | 18 +- Component/RightSidebar.elm | 115 +++++----- Dreamwriter.elm | 49 ++-- src/bootstrap-elm.coffee | 2 +- 8 files changed, 363 insertions(+), 430 deletions(-) diff --git a/App.elm b/App.elm index fa759cf..4e07071 100644 --- a/App.elm +++ b/App.elm @@ -55,35 +55,27 @@ updates = type alias AppState = - { - page : Page.Model, - - fullscreen : FullscreenState, - - currentDoc : Maybe Doc, - currentDocId : Maybe Identifier, - currentNote : Maybe Note, - - docs : List Doc, - notes : List Note, - snapshots : Dict.Dict Identifier Snapshot + { page : Page.Model + , fullscreen : FullscreenState + , currentDoc : Maybe Doc + , currentDocId : Maybe Identifier + , currentNote : Maybe Note + , docs : List Doc + , notes : List Note + , snapshots : Dict.Dict Identifier Snapshot } initialState : AppState initialState = - { - page = Page.initialModel, - - fullscreen = False, - - currentDoc = Nothing, - currentDocId = Nothing, - currentNote = Nothing, - - docs = [], - notes = [], - snapshots = Dict.empty + { page = Page.initialModel + , fullscreen = False + , currentDoc = Nothing + , currentDocId = Nothing + , currentNote = Nothing + , docs = [] + , notes = [] + , snapshots = Dict.empty } @@ -99,17 +91,17 @@ transition action state = Page.initialModel page = - { initialPage | - currentDocId <- Just id, - currentDoc <- state.currentDoc, - docs <- state.docs, - notes <- state.notes, - fullscreen <- state.fullscreen + { initialPage + | currentDocId <- Just id + , currentDoc <- state.currentDoc + , docs <- state.docs + , notes <- state.notes + , fullscreen <- state.fullscreen } in - { state | - currentDocId <- Just id, - page <- page + { state + | currentDocId <- Just id + , page <- page } LoadAsCurrentDoc doc -> @@ -143,8 +135,8 @@ transition action state = UpdateChapter chapter -> let updateDoc doc = - { doc | - chapters <- List.map (preferById chapter) doc.chapters + { doc + | chapters <- List.map (preferById chapter) doc.chapters } in updateCurrentDoc updateDoc state @@ -160,9 +152,9 @@ transition action state = SetDescription (description, words) -> let updateDoc doc = - { doc | - description <- description, - descriptionWords <- words + { doc + | description <- description + , descriptionWords <- words } in updateCurrentDoc updateDoc state @@ -171,15 +163,15 @@ transition action state = { state | fullscreen <- enabled } PutSnapshot snapshot -> - { state | - snapshots <- Dict.insert snapshot.id snapshot state.snapshots + { state + | snapshots <- Dict.insert snapshot.id snapshot state.snapshots } SetPage model -> - { state | - page <- model, - currentDocId <- model.currentDocId, - currentNote <- model.currentNote + { state + | page <- model + , currentDocId <- model.currentDocId + , currentNote <- model.currentNote } @@ -218,9 +210,9 @@ updateCurrentDoc transformation state = newDocs = List.map (preferById newCurrentDoc) state.docs in - { state | - currentDoc <- Just newCurrentDoc, - docs <- newDocs + { state + | currentDoc <- Just newCurrentDoc + , docs <- newDocs } @@ -240,18 +232,17 @@ main = userInput : Signal Update userInput = Signal.mergeMany - [ - Signal.map LoadAsCurrentDoc loadAsCurrentDoc, - Signal.map ListDocs listDocs, - Signal.map ListNotes listNotes, - Signal.map SetChapters setChapters, - Signal.map UpdateChapter updateChapter, - Signal.map SetTitle setTitle, - Signal.map SetDescription setDescription, - Signal.map SetFullscreen setFullscreen, - Signal.map PutSnapshot putSnapshot, - Signal.map SetCurrentNote setCurrentNote, - updates.signal + [ Signal.map LoadAsCurrentDoc loadAsCurrentDoc + , Signal.map ListDocs listDocs + , Signal.map ListNotes listNotes + , Signal.map SetChapters setChapters + , Signal.map UpdateChapter updateChapter + , Signal.map SetTitle setTitle + , Signal.map SetDescription setDescription + , Signal.map SetFullscreen setFullscreen + , Signal.map PutSnapshot putSnapshot + , Signal.map SetCurrentNote setCurrentNote + , updates.signal ] @@ -262,19 +253,15 @@ generalizePageUpdate state pageUpdate = modelPage : AppState -> Page.Model modelPage state = - { - leftSidebar = state.page.leftSidebar, - rightSidebar = state.page.rightSidebar, - editor = state.page.editor, - - fullscreen = state.fullscreen, - - currentDocId = state.currentDocId, - currentDoc = state.currentDoc, - currentNote = state.currentNote, - - docs = state.docs, - notes = state.notes + { leftSidebar = state.page.leftSidebar + , rightSidebar = state.page.rightSidebar + , editor = state.page.editor + , fullscreen = state.fullscreen + , currentDocId = state.currentDocId + , currentDoc = state.currentDoc + , currentNote = state.currentNote + , docs = state.docs + , notes = state.notes } scene : AppState -> Html @@ -378,4 +365,4 @@ port execCommand = port remoteSync : Signal () port remoteSync = - signals.remoteSync \ No newline at end of file + signals.remoteSync diff --git a/Component/Editor.elm b/Component/Editor.elm index 427c6d1..fe167f5 100644 --- a/Component/Editor.elm +++ b/Component/Editor.elm @@ -15,25 +15,23 @@ import Json.Encode exposing (string) type alias Addresses a = - { a | - fullscreen : Address FullscreenState, - remoteSync : Address (), - execCommand : Address String + { a + | fullscreen : Address FullscreenState + , remoteSync : Address () + , execCommand : Address String } type alias Model = - { - currentDoc : Doc, - fullscreen : FullscreenState + { currentDoc : Doc + , fullscreen : FullscreenState } initialModel : Model initialModel = - { - currentDoc = emptyDoc, - fullscreen = False + { currentDoc = emptyDoc + , fullscreen = False } @@ -46,14 +44,12 @@ viewEditor : Addresses a -> Doc -> FullscreenState -> Html viewEditor channels currentDoc fullscreen = div [ id "editor-container" ] - [ - div - [ id "editor-frame" ] - [ - viewEditorHeader channels currentDoc fullscreen, - viewOutline channels currentDoc fullscreen, - viewEditorFooter channels currentDoc fullscreen - ] + [ div + [ id "editor-frame" ] + [ viewEditorHeader channels currentDoc fullscreen + , viewOutline channels currentDoc fullscreen + , viewEditorFooter channels currentDoc fullscreen + ] ] @@ -61,35 +57,30 @@ viewEditorHeader : Addresses a -> Doc -> FullscreenState -> Html viewEditorHeader channels currentDoc fullscreen = div [ id "editor-header" ] - [ - div [ class "toolbar-section toolbar-button flaticon-zoom19" ] [], - - div - [ class "toolbar-section" ] - [ - viewFontControl - channels.execCommand - "toggle-bold" - "B" - "bold" - , - - viewFontControl - channels.execCommand - "toggle-italics" - "I" - "italic" - , - - viewFontControl - channels.execCommand - "toggle-strikethrough" - "\xA0S\xA0" - "strikethrough" - ] - , + [ div [ class "toolbar-section toolbar-button flaticon-zoom19" ] [] + + , div + [ class "toolbar-section" ] + [ viewFontControl + channels.execCommand + "toggle-bold" + "B" + "bold" + + , viewFontControl + channels.execCommand + "toggle-italics" + "I" + "italic" + + , viewFontControl + channels.execCommand + "toggle-strikethrough" + "\xA0S\xA0" + "strikethrough" + ] - lazy2 viewFullscreenButton channels.fullscreen fullscreen + , lazy2 viewFullscreenButton channels.fullscreen fullscreen ] @@ -114,28 +105,24 @@ viewEditorFooter channels currentDoc fullscreen = in div [ id "editor-footer" ] - [ - div [ id "doc-word-count" ] [ - text wordCountLabel, - WordGraph.viewWordGraph currentDoc.dailyWords - ], - - div - [ id "dropbox-sync" ] - [ - input - [ - id "toggle-dropbox-sync", - property "type" (string "checkbox"), - onClick channels.remoteSync () - ] - [] - , - - label - [ for "toggle-dropbox-sync" ] - [ text " sync to Dropbox" ] + [ div + [ id "doc-word-count" ] + [ text wordCountLabel + , WordGraph.viewWordGraph currentDoc.dailyWords + ] + , div + [ id "dropbox-sync" ] + [ input + [ id "toggle-dropbox-sync" + , property "type" (string "checkbox") + , onClick channels.remoteSync () ] + [] + + , label + [ for "toggle-dropbox-sync" ] + [ text " sync to Dropbox" ] + ] ] @@ -143,9 +130,8 @@ viewOutline : Addresses a -> Doc -> FullscreenState -> Html viewOutline channels currentDoc fullscreen = let outlineHeadingNodes = - [ - h1 [ id "edit-title" ] [], - div [ id "edit-description" ] [] + [ h1 [ id "edit-title" ] [] + , div [ id "edit-description" ] [] ] outlineChapterNodes = @@ -192,43 +178,38 @@ viewFullscreenButton fullscreenChannel fullscreen = {fullscreenClass, targetMode, fullscreenTitle} = case fullscreen of True -> - { - fullscreenClass = "flaticon-collapsing", - targetMode = False, - fullscreenTitle = "Leave Fullscreen Mode" + { fullscreenClass = "flaticon-collapsing" + , targetMode = False + , fullscreenTitle = "Leave Fullscreen Mode" } False -> - { - fullscreenClass = "flaticon-expand", - targetMode = True, - fullscreenTitle = "Enter Fullscreen Mode" + { fullscreenClass = "flaticon-expand" + , targetMode = True + , fullscreenTitle = "Enter Fullscreen Mode" } in div - [ - class ("toolbar-section toolbar-button " ++ fullscreenClass), - title fullscreenTitle, - onClick fullscreenChannel targetMode + [ class ("toolbar-section toolbar-button " ++ fullscreenClass) + , title fullscreenTitle + , onClick fullscreenChannel targetMode ] [] lazyViewChapter : Identifier -> List Html lazyViewChapter chapterId = - [ - lazy viewChapterHeading chapterId, - lazy viewChapterBody chapterId + [ lazy viewChapterHeading chapterId + , lazy viewChapterBody chapterId ] viewChapterBody : Identifier -> Html viewChapterBody chapterId = div - [ - key ("chapter-body-" ++ chapterId), - id ("edit-chapter-body-" ++ chapterId), - class "chapter-body" + [ key ("chapter-body-" ++ chapterId) + , id ("edit-chapter-body-" ++ chapterId) + , class "chapter-body" ] [] @@ -236,10 +217,9 @@ viewChapterBody chapterId = viewChapterHeading : Identifier -> Html viewChapterHeading chapterId = h2 - [ - key ("chapter-heading-" ++ chapterId), - id ("edit-chapter-heading-" ++ chapterId), - class "chapter-heading" + [ key ("chapter-heading-" ++ chapterId) + , id ("edit-chapter-heading-" ++ chapterId) + , class "chapter-heading" ] [] @@ -247,10 +227,9 @@ viewChapterHeading chapterId = viewFontControl : Address String -> String -> String -> String -> Html viewFontControl execCommandChannel idAttr label command = span - [ - class "font-control toolbar-button toolbar-font-button", - id idAttr, - (property "unselectable" (string "on")), - onClick execCommandChannel command + [ class "font-control toolbar-button toolbar-font-button" + , id idAttr + , (property "unselectable" (string "on")) + , onClick execCommandChannel command ] [ text label ] diff --git a/Component/LeftSidebar.elm b/Component/LeftSidebar.elm index 96f5357..cf1bf25 100644 --- a/Component/LeftSidebar.elm +++ b/Component/LeftSidebar.elm @@ -14,39 +14,39 @@ import Regex import Signal exposing (Address) -type ViewMode = - CurrentDocMode | OpenMenuMode | SettingsMode +type ViewMode + = CurrentDocMode + | OpenMenuMode + | SettingsMode type alias Addresses a = - { a | - print : Address (), - newDoc : Address (), - newChapter : Address (), - openFromFile : Address (), - navigateToTitle : Address (), - navigateToChapterId : Address Identifier, - download : Address DownloadOptions, - update : Address Update + { a + | print : Address () + , newDoc : Address () + , newChapter : Address () + , openFromFile : Address () + , navigateToTitle : Address () + , navigateToChapterId : Address Identifier + , download : Address DownloadOptions + , update : Address Update } type alias Model = - { - viewMode : ViewMode, - docs : List Doc, - currentDocId : Maybe Identifier, - currentDoc : Doc + { viewMode : ViewMode + , docs : List Doc + , currentDocId : Maybe Identifier + , currentDoc : Doc } initialModel : Model initialModel = - { - viewMode = CurrentDocMode, - docs = [], - currentDocId = Nothing, - currentDoc = emptyDoc + { viewMode = CurrentDocMode + , docs = [] + , currentDocId = Nothing + , currentDoc = emptyDoc } @@ -66,9 +66,9 @@ transition update model = { model | viewMode <- mode } OpenDocId id -> - { model | - currentDocId <- Just id, - viewMode <- CurrentDocMode + { model + | currentDocId <- Just id + , viewMode <- CurrentDocMode } @@ -95,75 +95,67 @@ view addresses model = {sidebarHeader, sidebarBody, sidebarFooter} = case model.viewMode of OpenMenuMode -> - { - sidebarHeader = - lazy - viewOpenMenuHeader addresses.update - , - - sidebarBody = - lazy2 - (OpenMenu.view addresses.openFromFile openDoc) - model.docs - model.currentDoc - , - - sidebarFooter = - viewOpenMenuFooter + { sidebarHeader = + lazy + viewOpenMenuHeader addresses.update + + , sidebarBody = + lazy2 + (OpenMenu.view addresses.openFromFile openDoc) + model.docs + model.currentDoc + + , sidebarFooter = + viewOpenMenuFooter } CurrentDocMode -> - { - sidebarHeader = - lazy2 - viewCurrentDocHeader model.currentDoc addresses, - - sidebarBody = - lazy3 - CurrentDoc.view - addresses.navigateToTitle - addresses.navigateToChapterId - model.currentDoc, - - sidebarFooter = - lazy - viewCurrentDocFooter addresses + { sidebarHeader = + lazy2 + viewCurrentDocHeader model.currentDoc addresses + + , sidebarBody = + lazy3 + CurrentDoc.view + addresses.navigateToTitle + addresses.navigateToChapterId + model.currentDoc + + , sidebarFooter = + lazy + viewCurrentDocFooter addresses } SettingsMode -> - { -- TODO make this different than CurrentDocMode - sidebarHeader = - lazy2 - viewCurrentDocHeader + -- TODO make this different than CurrentDocMode + { sidebarHeader = + lazy2 + viewCurrentDocHeader + model.currentDoc + addresses + + , sidebarBody = + lazy3 + CurrentDoc.view + addresses.navigateToTitle + addresses.navigateToChapterId model.currentDoc - addresses - , - - sidebarBody = - lazy3 - CurrentDoc.view - addresses.navigateToTitle - addresses.navigateToChapterId - model.currentDoc - , - - sidebarFooter = - lazy - viewCurrentDocFooter addresses + + , sidebarFooter = + lazy + viewCurrentDocFooter addresses } in div [ id "left-sidebar-container", class "sidebar" ] - [ - sidebarHeader, + [ sidebarHeader - div - [ id "left-sidebar-body", class "sidebar-body" ] - [ sidebarBody ] - , + , div + [ id "left-sidebar-body", class "sidebar-body" ] + [ sidebarBody ] - sidebarFooter + , sidebarFooter ] @@ -184,30 +176,27 @@ viewCurrentDocFooter : Addresses a -> Html viewCurrentDocFooter addresses = div [ id "left-sidebar-footer", class "sidebar-footer" ] - [ - span - [ - id "add-chapter", - title "Add Chapter", - onClick addresses.newChapter (), - class "flaticon-plus81"] [] - ] + [ span + [ id "add-chapter" + , title "Add Chapter" + , onClick addresses.newChapter () + , class "flaticon-plus81" + ] + [] + ] viewOpenMenuHeader updateChannel = div - [ - key "open-menu-header", - id sidebarHeaderId, - class sidebarHeaderClass + [ key "open-menu-header" + , id sidebarHeaderId + , class sidebarHeaderClass ] - [ - span - [ - class "sidebar-header-control", - onClick updateChannel (SetViewMode CurrentDocMode) - ] - [ text "cancel" ] + [ span + [ class "sidebar-header-control" + , onClick updateChannel (SetViewMode CurrentDocMode) + ] + [ text "cancel" ] ] @@ -215,55 +204,44 @@ viewCurrentDocHeader : Doc -> Addresses a -> Html viewCurrentDocHeader currentDoc addresses = let downloadOptions = - { - filename = (legalizeFilename currentDoc.title) ++ ".html", - contentType = downloadContentType - } + { filename = (legalizeFilename currentDoc.title) ++ ".html" + , contentType = downloadContentType + } in menu [ id sidebarHeaderId, class sidebarHeaderClass ] - [ - menuitem - [ - title "New", - class "sidebar-header-control flaticon-add26", - onClick addresses.newDoc () - ] - [] - , - - menuitem - [ - title "Open", - class "sidebar-header-control flaticon-folder63", - onClick addresses.update (SetViewMode OpenMenuMode) - ] - [] - , - - menuitem - [ - title "Download", - class "sidebar-header-control flaticon-cloud134", - onClick addresses.download downloadOptions - ] - [] - , - - menuitem - [ - title "Print", - class "sidebar-header-control flaticon-printer70", - onClick addresses.print () - ] - [] - , - - menuitem - [ - title "Settings", - class "sidebar-header-control flaticon-gear33", - onClick addresses.update (SetViewMode SettingsMode) - ] - [] - ] \ No newline at end of file + [ menuitem + [ title "New" + , class "sidebar-header-control flaticon-add26" + , onClick addresses.newDoc () + ] + [] + + , menuitem + [ title "Open" + , class "sidebar-header-control flaticon-folder63" + , onClick addresses.update (SetViewMode OpenMenuMode) + ] + [] + + , menuitem + [ title "Download" + , class "sidebar-header-control flaticon-cloud134" + , onClick addresses.download downloadOptions + ] + [] + + , menuitem + [ title "Print" + , class "sidebar-header-control flaticon-printer70" + , onClick addresses.print () + ] + [] + + , menuitem + [ title "Settings" + , class "sidebar-header-control flaticon-gear33" + , onClick addresses.update (SetViewMode SettingsMode) + ] + [] + ] diff --git a/Component/LeftSidebar/CurrentDocView.elm b/Component/LeftSidebar/CurrentDocView.elm index 7acd860..bb1ff92 100644 --- a/Component/LeftSidebar/CurrentDocView.elm +++ b/Component/LeftSidebar/CurrentDocView.elm @@ -9,22 +9,29 @@ import Html.Events exposing (..) import List exposing (..) import Signal exposing (Address) + view : Address () -> Address Identifier -> Doc -> Html view navigateToTitle navigateToChapterId currentDoc = - div [key "current-doc-view", id "current-doc-view"] [ - div [id "title", onClick navigateToTitle ()] - [text currentDoc.title], + div + [ key "current-doc-view", id "current-doc-view" ] + [ div + [ id "title", onClick navigateToTitle () ] + [ text currentDoc.title ] + + , viewOutline navigateToChapterId currentDoc.chapters + ] - viewOutline navigateToChapterId currentDoc.chapters - ] viewOutline : Address Identifier -> List Chapter -> Html viewOutline navigateToChapterId chapters = - ul [id "outline"] <| indexedMap (viewChapter navigateToChapterId) chapters + ul [ id "outline" ] <| indexedMap (viewChapter navigateToChapterId) chapters + viewChapter : Address Identifier -> Int -> Chapter -> Html -viewChapter navigateToChapterId index chapter = li [ - key ("chapter" ++ (toString index)), - title chapter.heading, - onClick navigateToChapterId chapter.id - ] [text chapter.heading] \ No newline at end of file +viewChapter navigateToChapterId index chapter = + li + [ key ("chapter" ++ (toString index)) + , title chapter.heading + , onClick navigateToChapterId chapter.id + ] + [text chapter.heading] diff --git a/Component/LeftSidebar/OpenMenuView.elm b/Component/LeftSidebar/OpenMenuView.elm index 75622d8..67eebb3 100644 --- a/Component/LeftSidebar/OpenMenuView.elm +++ b/Component/LeftSidebar/OpenMenuView.elm @@ -22,10 +22,9 @@ view openFromFile openDoc docs currentDoc = openFileNode = div [ class "open-entry from-file", onClick openFromFile () ] - [ - span [] [ text "A " ], - b [] [ text ".html" ], - span [] [ text " file from your computer..." ] + [ span [] [ text "A " ] + , b [] [ text ".html" ] + , span [] [ text " file from your computer..." ] ] in div [ key "open-menu-view", id "open" ] (openFileNode :: docNodes) @@ -41,9 +40,8 @@ viewOpenDocEntryFor openDoc currentDoc doc = "open-entry" in div - [ - key ("#open-doc-" ++ doc.id), - class className, - onClick openDoc doc.id - ] - [ text doc.title ] \ No newline at end of file + [ key ("#open-doc-" ++ doc.id) + , class className + , onClick openDoc doc.id + ] + [ text doc.title ] diff --git a/Component/RightSidebar.elm b/Component/RightSidebar.elm index 22bbdde..f975523 100644 --- a/Component/RightSidebar.elm +++ b/Component/RightSidebar.elm @@ -12,25 +12,23 @@ import List exposing (..) type alias Addresses a = - { a | - newNote : Address (), - searchNotes : Address String, - openNoteId : Address Identifier + { a + | newNote : Address () + , searchNotes : Address String + , openNoteId : Address Identifier } type alias Model = - { - currentNote : Maybe Note, - notes : List Note + { currentNote : Maybe Note + , notes : List Note } initialModel : Model initialModel = - { - currentNote = Nothing, - notes = [] + { currentNote = Nothing + , notes = [] } view : Addresses a -> Model -> Html @@ -39,63 +37,54 @@ view addresses model = {sidebarBody, sidebarFooter} = case model.currentNote of Nothing -> - { - sidebarBody = - lazy2 - viewNoteListings - addresses.openNoteId - model.notes - , - - sidebarFooter = - span [] [] + { sidebarBody = + lazy2 + viewNoteListings + addresses.openNoteId + model.notes + + , sidebarFooter = + span [] [] } Just currentNote -> - { - sidebarBody = - lazy viewCurrentNoteBody currentNote - , - - sidebarFooter = - lazy2 - viewCurrentNoteFooter - addresses currentNote + { sidebarBody = + lazy viewCurrentNoteBody currentNote + + , sidebarFooter = + lazy2 + viewCurrentNoteFooter + addresses currentNote } in div [ id "right-sidebar-container", class "sidebar" ] - [ - div - [ id "right-sidebar-body", class "sidebar-body" ] - [ sidebarBody ] - , + [ div + [ id "right-sidebar-body", class "sidebar-body" ] + [ sidebarBody ] - sidebarFooter + , sidebarFooter ] + viewHeader : Addresses a -> Model -> Html viewHeader addresses model = div [ id "right-sidebar-header", class "sidebar-header" ] - [ - input - [ - id "notes-search-text", - class "sidebar-header-control", - placeholder "search notes", - onInput addresses.searchNotes targetValue - ] - [] - , - - span - [ - id "notes-search-button", - class "sidebar-header-control flaticon-pencil90", - onClick addresses.newNote () - ] - [] + [ input + [ id "notes-search-text" + , class "sidebar-header-control" + , placeholder "search notes" + , onInput addresses.searchNotes targetValue + ] + [] + + , span + [ id "notes-search-button" + , class "sidebar-header-control flaticon-pencil90" + , onClick addresses.newNote () + ] + [] ] @@ -109,13 +98,11 @@ viewNoteListings openNoteIdChannel notes = viewNoteListing : Address Identifier -> Note -> Html viewNoteListing openNoteId note = div - [ - key ("note-" ++ note.id), class "note-listing", - onClick openNoteId note.id + [ key ("note-" ++ note.id), class "note-listing" + , onClick openNoteId note.id ] - [ - div [ class "flaticon-document127 note-listing-icon" ] [], - div [ class "note-listing-title" ] [ text note.title ] + [ div [ class "flaticon-document127 note-listing-icon" ] [] + , div [ class "note-listing-title" ] [ text note.title ] ] @@ -123,13 +110,11 @@ viewCurrentNoteBody : Note -> Html viewCurrentNoteBody note = div [ key ("current-note-" ++ note.id), id "current-note" ] - [ - div - [ id "current-note-title-container" ] - [ div [ id "current-note-title" ] [] ] - , + [ div + [ id "current-note-title-container" ] + [ div [ id "current-note-title" ] [] ] - div [ id "current-note-body" ] [] + , div [ id "current-note-body" ] [] ] diff --git a/Dreamwriter.elm b/Dreamwriter.elm index fec83ca..46385c8 100644 --- a/Dreamwriter.elm +++ b/Dreamwriter.elm @@ -7,20 +7,21 @@ type alias Identifier = String type alias MsSinceEpoch = Int type alias HtmlString = String + type alias DownloadOptions = - { - filename : String, - contentType : String - } + { filename : String + , contentType : String + } + + +type alias Note = + { id : Identifier + , title : String + , snapshotId : HtmlString + , creationTime : MsSinceEpoch + , lastModifiedTime : MsSinceEpoch + } -type alias Note = - { - id : Identifier, - title : String, - snapshotId : HtmlString, - creationTime : MsSinceEpoch, - lastModifiedTime : MsSinceEpoch - } type alias Doc = { @@ -51,14 +52,13 @@ emptyDoc = } type alias Chapter = - { - id : Identifier, - heading : String, - headingWords : Int, - bodyWords : Int, - creationTime : MsSinceEpoch, - lastModifiedTime : MsSinceEpoch, - snapshotId : Identifier + { id : Identifier + , heading : String + , headingWords : Int + , bodyWords : Int + , creationTime : MsSinceEpoch + , lastModifiedTime : MsSinceEpoch + , snapshotId : Identifier } type alias WordsPerDay = @@ -68,9 +68,8 @@ type alias WordsPerDay = } type alias Snapshot = - { - id : Identifier, - html : String, - text : String + { id : Identifier + , html : String + , text : String } - \ No newline at end of file + diff --git a/src/bootstrap-elm.coffee b/src/bootstrap-elm.coffee index 8aa3388..faa54f6 100644 --- a/src/bootstrap-elm.coffee +++ b/src/bootstrap-elm.coffee @@ -390,4 +390,4 @@ DreamSync.connect().done (instance) -> else saveHtmlAndLoadDoc DocImport.introDocHtml - refreshDocList() \ No newline at end of file + refreshDocList()