diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..a8aae6f Binary files /dev/null and b/.DS_Store differ diff --git a/elm-todo/Todo.elm b/elm-todo/Todo.elm index 3a07b24..117a56e 100755 --- a/elm-todo/Todo.elm +++ b/elm-todo/Todo.elm @@ -45,7 +45,6 @@ type alias Model = type alias Entry = { description : String , completed : Bool - , editing : Bool , id : Int } @@ -62,7 +61,6 @@ newEntry : String -> Int -> Entry newEntry desc id = { description = desc , completed = False - , editing = False , id = id } @@ -76,8 +74,6 @@ to them. -} type Msg = UpdateNewEntryField String - | EditingEntry Int Bool - | UpdateEntry Int String | Add | Delete Int | DeleteAllCompleted @@ -102,29 +98,6 @@ update msg model = UpdateNewEntryField str -> { model | newEntryField = str } - EditingEntry id isEditing -> - let - updateEntry t = - if t.id == id then - { t | editing = isEditing } - else - t - - focus = - Dom.focus ("todo-" ++ toString id) - in - { model | entries = List.map updateEntry model.entries } - - UpdateEntry id task -> - let - updateEntry t = - if t.id == id then - { t | description = task } - else - t - in - { model | entries = List.map updateEntry model.entries } - Check id isCompleted -> let updateEntry t = @@ -229,7 +202,7 @@ viewKeyedEntry todo = viewEntry : Entry -> Html Msg viewEntry todo = li - [ classList [ ( "completed", todo.completed ), ( "editing", todo.editing ) ] ] + [ classList [ ( "completed", todo.completed ) ] ] [ div [ class "view" ] [ input @@ -239,8 +212,7 @@ viewEntry todo = , onClick (Check todo.id (not todo.completed)) ] [] - , label - [ onDoubleClick (EditingEntry todo.id True) ] + , label [] [ text todo.description ] , button [ class "destroy" @@ -253,9 +225,6 @@ viewEntry todo = , value todo.description , name "title" , id ("todo-" ++ toString todo.id) - , onInput (UpdateEntry todo.id) - , onBlur (EditingEntry todo.id False) - , onEnter (EditingEntry todo.id False) ] [] ] @@ -313,8 +282,7 @@ viewControlsClear entriesCompleted = infoFooter : Html msg infoFooter = footer [ class "info" ] - [ p [] [ text "Double-click to edit a todo" ] - , p [] + [ p [] [ text "Written by " , a [ href "https://github.com/evancz" ] [ text "Evan Czaplicki" ] ] diff --git a/ruby-todo/.DS_Store b/ruby-todo/.DS_Store new file mode 100644 index 0000000..f278239 Binary files /dev/null and b/ruby-todo/.DS_Store differ diff --git a/ruby-todo/.idea/.rakeTasks b/ruby-todo/.idea/.rakeTasks new file mode 100644 index 0000000..54e8039 --- /dev/null +++ b/ruby-todo/.idea/.rakeTasks @@ -0,0 +1,7 @@ + + diff --git a/ruby-todo/.idea/inspectionProfiles/Project_Default.xml b/ruby-todo/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..b0db9b0 --- /dev/null +++ b/ruby-todo/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ruby-todo/.idea/misc.xml b/ruby-todo/.idea/misc.xml new file mode 100644 index 0000000..42cb086 --- /dev/null +++ b/ruby-todo/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ruby-todo/.idea/modules.xml b/ruby-todo/.idea/modules.xml new file mode 100644 index 0000000..f6178b4 --- /dev/null +++ b/ruby-todo/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/ruby-todo/.idea/ruby-todo.iml b/ruby-todo/.idea/ruby-todo.iml new file mode 100644 index 0000000..6d597c0 --- /dev/null +++ b/ruby-todo/.idea/ruby-todo.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruby-todo/.idea/workspace.xml b/ruby-todo/.idea/workspace.xml new file mode 100644 index 0000000..369bff1 --- /dev/null +++ b/ruby-todo/.idea/workspace.xml @@ -0,0 +1,430 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + skip + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +