From: Zachary Vance Date: Sat, 23 May 2015 00:31:31 +0000 (-0700) Subject: Make main page prettier X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=9cbecbd13ccf87b6faab7f8fc8656180491d19ba;p=flowy.git Make main page prettier --- diff --git a/dist/flowy.css b/dist/flowy.css index 1cf2149..d931a52 100644 --- a/dist/flowy.css +++ b/dist/flowy.css @@ -1,6 +1,18 @@ body { background: #f9f9fa; } +.page { + width: 80%; + margin-left: auto; + margin-right: auto; + max-width: 700px; + border: 1px solid #ccc; + padding-top: 60px; + padding-bottom: 10px; + padding-right: 60px; + padding-left: 60px; + background: #ffffff; +} .todo > .text { font-size: 20pt; margin-top: 5px; @@ -18,12 +30,6 @@ body { } #todo-list { width: 80%; - margin: auto; - max-width: 600px; - border: 1px solid #ccc; - padding-top: 60px; - padding-bottom: 10px; - background: #ffffff; } .with-dropshadow { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); @@ -50,13 +56,10 @@ body { } .shortcuts .description { background-color: #efefef; - max-width: 80px; - padding: 0 0 0 7px; -} -.shortcuts .keybinding { - padding: 0 0 0 7px; + max-width: 70px; } .shortcuts td { + padding: 10px; border-top: 0; border-bottom: 1px solid #aaa; } diff --git a/dist/flowy.js b/dist/flowy.js index 42bd5ec..876950d 100644 --- a/dist/flowy.js +++ b/dist/flowy.js @@ -282,8 +282,10 @@ var Shortcut = (function(document, _) { allowRebind: false, // Insert javascript to allow rebinding shortcuts highlightRepeats: true, // Warn about shortcuts which are bound to multiple actions (if user can remap shortcuts) // TODO shortcuts: _.sortBy(this.shortcuts, 'description'), + noDisplay: [], // ids not to display includeElement: true, }); + options.shortcuts = _.reject(options.shortcuts, function(shortcut) { return _.contains(options.noDisplay, shortcut.id); } ); if (options.objectGrouping === "default") { var multipleObjectTypes = _.chain(options.shortcuts).pluck('object').unique().size().value() > 1; options.objectGrouping = multipleObjectTypes; @@ -399,9 +401,12 @@ var TodoView = Backbone.View.extend({ "input > .text": "textChange", "blur > .text": "render", // Because the model shouldn't update the view during active editing, add a re-render at the end "keydown > .text": "keydown", - 'Shortcut("toggleComplete", "Mark an item as complete or not", "ctrl+enter") > .text': "toggleComplete", + 'Shortcut("toggleComplete", "Complete", "ctrl+enter") > .text': "toggleComplete", 'Shortcut("backspace", "Combine an item with the previous item", "backspace") > .text': "backspace", 'Shortcut("delete", "Combine an item with the next item", "del") > .text': "delete", + //'Shortcut("next", "Next", "down") > .text': 'next', + //'Shortcut("previous", "Previous", "previous") > .text': 'previous', + }, initialize: function() { this.childViewPositions = []; @@ -806,7 +811,7 @@ var AppView = Backbone.View.extend({ e.save(); }); }); - Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true}); + Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true, noDisplay: ['backspace', 'delete'] }); this.views = {}; // A list of views for each element in the collection this.list.fetch(); this.render(); diff --git a/dist/flowy.unwrapped.js b/dist/flowy.unwrapped.js index d343520..6ddd069 100644 --- a/dist/flowy.unwrapped.js +++ b/dist/flowy.unwrapped.js @@ -281,8 +281,10 @@ var Shortcut = (function(document, _) { allowRebind: false, // Insert javascript to allow rebinding shortcuts highlightRepeats: true, // Warn about shortcuts which are bound to multiple actions (if user can remap shortcuts) // TODO shortcuts: _.sortBy(this.shortcuts, 'description'), + noDisplay: [], // ids not to display includeElement: true, }); + options.shortcuts = _.reject(options.shortcuts, function(shortcut) { return _.contains(options.noDisplay, shortcut.id); } ); if (options.objectGrouping === "default") { var multipleObjectTypes = _.chain(options.shortcuts).pluck('object').unique().size().value() > 1; options.objectGrouping = multipleObjectTypes; @@ -398,9 +400,12 @@ var TodoView = Backbone.View.extend({ "input > .text": "textChange", "blur > .text": "render", // Because the model shouldn't update the view during active editing, add a re-render at the end "keydown > .text": "keydown", - 'Shortcut("toggleComplete", "Mark an item as complete or not", "ctrl+enter") > .text': "toggleComplete", + 'Shortcut("toggleComplete", "Complete", "ctrl+enter") > .text': "toggleComplete", 'Shortcut("backspace", "Combine an item with the previous item", "backspace") > .text': "backspace", 'Shortcut("delete", "Combine an item with the next item", "del") > .text': "delete", + //'Shortcut("next", "Next", "down") > .text': 'next', + //'Shortcut("previous", "Previous", "previous") > .text': 'previous', + }, initialize: function() { this.childViewPositions = []; @@ -805,7 +810,7 @@ var AppView = Backbone.View.extend({ e.save(); }); }); - Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true}); + Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true, noDisplay: ['backspace', 'delete'] }); this.views = {}; // A list of views for each element in the collection this.list.fetch(); this.render(); diff --git a/dist/index.html b/dist/index.html index 9d38c04..007e18a 100644 --- a/dist/index.html +++ b/dist/index.html @@ -6,8 +6,10 @@
-
+
+
+
diff --git a/src/css/flowy.less b/src/css/flowy.less index 3a00616..5d03024 100644 --- a/src/css/flowy.less +++ b/src/css/flowy.less @@ -2,6 +2,19 @@ body { background: #f9f9fa; } +.page { + width: 80%; + margin-left: auto; + margin-right: auto; + max-width: 700px; + border: 1px solid #ccc; + padding-top: 60px; + padding-bottom: 10px; + padding-right: 60px; + padding-left: 60px; + background: #ffffff; +} + .todo > .text { font-size: 20pt; margin-top: 5px; @@ -24,12 +37,6 @@ body { #todo-list { width: 80%; - margin: auto; - max-width: 600px; - border: 1px solid #ccc; - padding-top: 60px; - padding-bottom: 10px; - background: #ffffff; } .with-dropshadow { @@ -57,13 +64,12 @@ body { width: 100%; .description { background-color: #efefef; - max-width: 80px; - padding: 0 0 0 7px; + max-width: 70px; } .keybinding { - padding: 0 0 0 7px; } td { + padding: 10px; border-top: 0; border-bottom: 1px solid #aaa; } diff --git a/src/index.html b/src/index.html index 9d38c04..007e18a 100644 --- a/src/index.html +++ b/src/index.html @@ -6,8 +6,10 @@
-
+
+
+
diff --git a/src/library/shortcut.js b/src/library/shortcut.js index fd37777..a5bf946 100644 --- a/src/library/shortcut.js +++ b/src/library/shortcut.js @@ -220,8 +220,10 @@ var Shortcut = (function(document, _) { allowRebind: false, // Insert javascript to allow rebinding shortcuts highlightRepeats: true, // Warn about shortcuts which are bound to multiple actions (if user can remap shortcuts) // TODO shortcuts: _.sortBy(this.shortcuts, 'description'), + noDisplay: [], // ids not to display includeElement: true, }); + options.shortcuts = _.reject(options.shortcuts, function(shortcut) { return _.contains(options.noDisplay, shortcut.id); } ); if (options.objectGrouping === "default") { var multipleObjectTypes = _.chain(options.shortcuts).pluck('object').unique().size().value() > 1; options.objectGrouping = multipleObjectTypes; diff --git a/src/views/app.js b/src/views/app.js index eac1db0..ca9cd29 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -79,7 +79,7 @@ var AppView = Backbone.View.extend({ e.save(); }); }); - Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true}); + Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true, noDisplay: ['backspace', 'delete'] }); this.views = {}; // A list of views for each element in the collection this.list.fetch(); this.render(); diff --git a/src/views/todo.js b/src/views/todo.js index e57faf1..03a6a44 100644 --- a/src/views/todo.js +++ b/src/views/todo.js @@ -11,9 +11,12 @@ var TodoView = Backbone.View.extend({ "input > .text": "textChange", "blur > .text": "render", // Because the model shouldn't update the view during active editing, add a re-render at the end "keydown > .text": "keydown", - 'Shortcut("toggleComplete", "Mark an item as complete or not", "ctrl+enter") > .text': "toggleComplete", + 'Shortcut("toggleComplete", "Complete", "ctrl+enter") > .text': "toggleComplete", 'Shortcut("backspace", "Combine an item with the previous item", "backspace") > .text': "backspace", 'Shortcut("delete", "Combine an item with the next item", "del") > .text': "delete", + //'Shortcut("next", "Next", "down") > .text': 'next', + //'Shortcut("previous", "Previous", "previous") > .text': 'previous', + }, initialize: function() { this.childViewPositions = [];