From: Zachary Vance Date: Wed, 3 Jun 2015 23:15:58 +0000 (-0700) Subject: Show/hide completed X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=288da4824bf1fdb9c2927dc5f12cbccc26ca09c2;p=flowy.git Show/hide completed --- diff --git a/README.md b/README.md index 9dac6a9..2a002c1 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,5 @@ Differences from workflowy: - Single-user (one pad only, no sharing, no simultaneous editing) - No authentication - No stars + +Special thanks to [hackflowy](https://github.com/abhshkdz/HackFlowy) and [vimflowy](https://github.com/WuTheFWasThat/vimflowy) for speeding up development. diff --git a/dist/flowy.js b/dist/flowy.js index 5594612..52463c0 100644 --- a/dist/flowy.js +++ b/dist/flowy.js @@ -998,13 +998,6 @@ var FlowyDocModel = Backbone.Collection.extend({ comparator: 'id', }); -/** - * @depend ../views/todo.js - * @depend ../models/flowyDoc.js - * @depend ../models/todo.js - * @depend ../library/viewShortcuts.js - */ - var testTodos = [ new TodoModel({ parent: null, @@ -1055,8 +1048,18 @@ var testTodos = [ }), ]; + +/** + * @depend ../views/todo.js + * @depend ../models/flowyDoc.js + * @depend ../models/todo.js + * @depend ../library/viewShortcuts.js + * @depend ../views/testTodos.js + */ + var todos = new FlowyDocModel({ -rootId: 0}); + rootId: 0 +}); var appDefaults = { list: todos }; var AppView = Backbone.View.extend({ @@ -1064,7 +1067,7 @@ var AppView = Backbone.View.extend({ shortcutObject: "global", events: { 'Shortcut("toggleShortcuts", "Keyboard Shortcuts", "ctrl+shift+/") > .text': 'toggleShortcuts', - 'Shortcut("toggleShowCompleted", "Not Done - Show/hide completed", "ctrl+o") > .text': 'toggleShowCompleted', + 'Shortcut("toggleShowCompleted", "Show/hide completed", "ctrl+o") > .text': 'toggleShowCompleted', 'Shortcut("search", "Not Done - Search", "esc") > .text': 'search', }, initialize: function(options) { @@ -1108,9 +1111,11 @@ var AppView = Backbone.View.extend({ }, toggleShortcuts: function() { this.$(".shortcuts").toggle(); + return false; }, toggleShowCompleted: function() { - console.log("Toggling show/hide not yet implemented"); // TODO + this.$(".completed").toggle(); + return false; }, search: function() { console.log("Search not yet implemented"); // TODO diff --git a/dist/flowy.unwrapped.js b/dist/flowy.unwrapped.js index ae7f181..e6babb8 100644 --- a/dist/flowy.unwrapped.js +++ b/dist/flowy.unwrapped.js @@ -997,13 +997,6 @@ var FlowyDocModel = Backbone.Collection.extend({ comparator: 'id', }); -/** - * @depend ../views/todo.js - * @depend ../models/flowyDoc.js - * @depend ../models/todo.js - * @depend ../library/viewShortcuts.js - */ - var testTodos = [ new TodoModel({ parent: null, @@ -1054,8 +1047,18 @@ var testTodos = [ }), ]; + +/** + * @depend ../views/todo.js + * @depend ../models/flowyDoc.js + * @depend ../models/todo.js + * @depend ../library/viewShortcuts.js + * @depend ../views/testTodos.js + */ + var todos = new FlowyDocModel({ -rootId: 0}); + rootId: 0 +}); var appDefaults = { list: todos }; var AppView = Backbone.View.extend({ @@ -1063,7 +1066,7 @@ var AppView = Backbone.View.extend({ shortcutObject: "global", events: { 'Shortcut("toggleShortcuts", "Keyboard Shortcuts", "ctrl+shift+/") > .text': 'toggleShortcuts', - 'Shortcut("toggleShowCompleted", "Not Done - Show/hide completed", "ctrl+o") > .text': 'toggleShowCompleted', + 'Shortcut("toggleShowCompleted", "Show/hide completed", "ctrl+o") > .text': 'toggleShowCompleted', 'Shortcut("search", "Not Done - Search", "esc") > .text': 'search', }, initialize: function(options) { @@ -1107,9 +1110,11 @@ var AppView = Backbone.View.extend({ }, toggleShortcuts: function() { this.$(".shortcuts").toggle(); + return false; }, toggleShowCompleted: function() { - console.log("Toggling show/hide not yet implemented"); // TODO + this.$(".completed").toggle(); + return false; }, search: function() { console.log("Search not yet implemented"); // TODO diff --git a/src/README.md b/src/README.md new file mode 100644 index 0000000..3e40e1a --- /dev/null +++ b/src/README.md @@ -0,0 +1,34 @@ +Flowy +--- +A reverse-engineered workflowy clone. In pre-alpha. + +Demo at: https://za3k.com/~flowy + +Features: + +- Keyboard Shortcuts + - Reference display + - User-reconfigurable and persisted +- Hierarchical to-do list + - Zoom in and out + - Indent / Outdent + - Move todos up and down using the keyboard + - Drag and drog todos to any location + - Collapse/expand todos + - Lazily loaded so Flowy can support any list size +- Undo/redo support + - Infinite undo/redo since browser session started +- Full-text search +- Settings + - Show/hide keyboard shortcuts + - Show/hide completed items + - Offline mode (local storage) +- Import/export + - Workflowy-compatible for migrations to and from + - HTML (to paste elsewhere) + - Plain text +- Autosaving + +Features workflowy has that flowy will not: + + - Flowy is single user with no authentication diff --git a/src/views/app.js b/src/views/app.js index 1fca40c..ebbd4a2 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -3,60 +3,12 @@ * @depend ../models/flowyDoc.js * @depend ../models/todo.js * @depend ../library/viewShortcuts.js + * @depend ../views/testTodos.js */ -var testTodos = [ - new TodoModel({ - parent: null, - id: 0, - text: "Root (will be invisible in final, DO NOT EDIT)", - bullets: [1, 5], - }), - new TodoModel({ - parent: 0, - id: 1, - text: "Daily todos", - bullets: [2,3,4], - }), - new TodoModel({ - parent: 1, - id: 2, - text: "Shave", - completed: true - }), - new TodoModel({ - parent: 1, - id: 3, - text: "Check t-mail", - completed: true - }), - new TodoModel({ - parent: 1, - id: 4, - text: "Eat green eggs and ham", - }), - new TodoModel({ - parent: 0, - id: 5, - text: "To do this year", - collapsed: false, - bullets: [6], - }), - new TodoModel({ - parent: 5, - id: 6, - text: "Save the world", - bullets: [7], - }), - new TodoModel({ - parent: 6, - id: 7, - text: "Save California", - }), -]; - var todos = new FlowyDocModel({ -rootId: 0}); + rootId: 0 +}); var appDefaults = { list: todos }; var AppView = Backbone.View.extend({ @@ -64,7 +16,7 @@ var AppView = Backbone.View.extend({ shortcutObject: "global", events: { 'Shortcut("toggleShortcuts", "Keyboard Shortcuts", "ctrl+shift+/") > .text': 'toggleShortcuts', - 'Shortcut("toggleShowCompleted", "Not Done - Show/hide completed", "ctrl+o") > .text': 'toggleShowCompleted', + 'Shortcut("toggleShowCompleted", "Show/hide completed", "ctrl+o") > .text': 'toggleShowCompleted', 'Shortcut("search", "Not Done - Search", "esc") > .text': 'search', }, initialize: function(options) { @@ -108,9 +60,11 @@ var AppView = Backbone.View.extend({ }, toggleShortcuts: function() { this.$(".shortcuts").toggle(); + return false; }, toggleShowCompleted: function() { - console.log("Toggling show/hide not yet implemented"); // TODO + this.$(".completed").toggle(); + return false; }, search: function() { console.log("Search not yet implemented"); // TODO diff --git a/src/views/testTodos.js b/src/views/testTodos.js new file mode 100644 index 0000000..cf04c4f --- /dev/null +++ b/src/views/testTodos.js @@ -0,0 +1,50 @@ +var testTodos = [ + new TodoModel({ + parent: null, + id: 0, + text: "Root (will be invisible in final, DO NOT EDIT)", + bullets: [1, 5], + }), + new TodoModel({ + parent: 0, + id: 1, + text: "Daily todos", + bullets: [2,3,4], + }), + new TodoModel({ + parent: 1, + id: 2, + text: "Shave", + completed: true + }), + new TodoModel({ + parent: 1, + id: 3, + text: "Check t-mail", + completed: true + }), + new TodoModel({ + parent: 1, + id: 4, + text: "Eat green eggs and ham", + }), + new TodoModel({ + parent: 0, + id: 5, + text: "To do this year", + collapsed: false, + bullets: [6], + }), + new TodoModel({ + parent: 5, + id: 6, + text: "Save the world", + bullets: [7], + }), + new TodoModel({ + parent: 6, + id: 7, + text: "Save California", + }), +]; +