diff --git a/app.css b/app.css index 4b0853c1b..9a0d428d8 100644 --- a/app.css +++ b/app.css @@ -80,9 +80,9 @@ table { border-collapse: collapse; border-spacing:0; } @font-face { font-family:'Prose'; - src:url('fonts/prose-80081ddd6bb627b0784ec9094fabb857.eot'); - src:url('fonts/prose-80081ddd6bb627b0784ec9094fabb857.eot?#iefix') format('embedded-opentype'), - url('fonts/prose-80081ddd6bb627b0784ec9094fabb857.woff') format('woff'); + src:url('fonts/prose-129b77953cd92a716f7e5224f4de015e.eot'); + src:url('fonts/prose-129b77953cd92a716f7e5224f4de015e.eot?#iefix') format('embedded-opentype'), + url('fonts/prose-129b77953cd92a716f7e5224f4de015e.woff') format('woff'); font-weight:700; font-style:normal; } @@ -285,22 +285,22 @@ textarea#code { border-width:1px; } -::-webkit-input-placeholder { color:#d4d7d9; } -::-moz-placeholder { color:#d4d7d9; } -:-ms-input-placeholder { color:#d4d7d9; } -input:-moz-placeholder { color:#d4d7d9; } +::-webkit-input-placeholder { color:#a8afb2; } +::-moz-placeholder { color:#a8afb2; } +:-ms-input-placeholder { color:#a8afb2; } +input:-moz-placeholder { color:#a8afb2; } -.filepath::-webkit-input-placeholder { font-style:italic; } -.filepath::-moz-placeholder { font-style:italic; } -.filepath:-ms-input-placeholder { font-style:italic; } -.filepath:-moz-placeholder { font-style:italic; } +.filepath::-webkit-input-placeholder { color:#d4d7d9; font-style:italic; } +.filepath::-moz-placeholder { color:#d4d7d9; font-style:italic; } +.filepath:-ms-input-placeholder { color:#d4d7d9; font-style:italic; } +.filepath:-moz-placeholder { color:#d4d7d9; font-style:italic; } strong { font-weight:700; } em { font-style:italic; } /* For Diff Viewing */ del { - color:#d4d7d9; + color:#516066; padding:1px 0; } ins { @@ -483,7 +483,7 @@ ins { width:60px; height:30px; bottom:0; - right:0; + right:-30px; } .heading .filepath:focus, .heading .filepath:hover { @@ -557,6 +557,7 @@ ins { left:0; width:100%; padding:15px; + color:#3d494e; } .loading .loading-icon { background:transparent url('img/loader@33x33.gif') no-repeat; @@ -585,9 +586,10 @@ ins { z-index:5000; width:60px; height:100%; + border-left:1px solid #fff; } .open .vert { - border-left:1px solid #d4d7d9; + border-color:#d4d7d9; } .vert ul { @@ -690,18 +692,12 @@ ins { .published .ico.checkmark, .ico.checkmark, .ico.added { color:#90bb74; } - -.vert .ico.logout { color:#db6f6f; } - .ico.modified { color:#2099aa; } .ico.removed { color:#d35252; } - .ico.error { color:#db6f6f; } .ico.renamed { color:#bb9f1a; } .ico.private { color:#deb400; } -.vert .ico.logout:hover { background-color:#db6f6f; color:#fff; } - .ico { font-family:'Prose'; font-size:22px; @@ -735,12 +731,12 @@ ins { .ico.picture:before { content: "\f116"; } .ico.private:before { content: "\f117"; } .ico.question:before { content: "\f118"; } -.ico.quick-save:before { content: "\f119"; } -.ico.quote:before { content: "\f11a"; } -.ico.removed:before { content: "\f11b"; } -.ico.renamed:before { content: "\f11c"; } -.ico.repos:before { content: "\f11d"; } -.ico.rubbish:before { content: "\f11e"; } +.ico.quote:before { content: "\f119"; } +.ico.removed:before { content: "\f11a"; } +.ico.renamed:before { content: "\f11b"; } +.ico.repos:before { content: "\f11c"; } +.ico.rubbish:before { content: "\f11d"; } +.ico.save:before { content: "\f11e"; } .ico.saving:before { content: "\f11f"; } .ico.search:before { content: "\f120"; } .ico.sprocket:before { content: "\f121"; } @@ -1706,31 +1702,17 @@ ins { .sidebar .commit { position:relative; bottom:-4px; - display:none; } - .sidebar .commit .cancel { - position:absolute; - z-index:10; - top:30px; - right:5px; - display:block; - } - .cancel:hover { - color:#DB6F6F; - } - .sidebar .commit textarea { - padding-right:25px; - margin:8px 0 -2px; - display:block; - position:relative; - z-index:1; - height:90px; - resize:none; - -webkit-border-radius:4px 4px 0 0; - border-radius:4px 4px 0 0; - } - .sidebar .commit.active { + .sidebar .commit textarea { + padding-right:25px; + margin:8px 0 -2px; display:block; + position:relative; + z-index:1; + height:115px; + resize:none; + -webkit-border-radius:4px 4px 0 0; + border-radius:4px 4px 0 0; } /* ------------------------------------------ diff --git a/fonts/prose-80081ddd6bb627b0784ec9094fabb857.eot b/fonts/prose-129b77953cd92a716f7e5224f4de015e.eot similarity index 73% rename from fonts/prose-80081ddd6bb627b0784ec9094fabb857.eot rename to fonts/prose-129b77953cd92a716f7e5224f4de015e.eot index e07e4fd35..19ef37eea 100644 Binary files a/fonts/prose-80081ddd6bb627b0784ec9094fabb857.eot and b/fonts/prose-129b77953cd92a716f7e5224f4de015e.eot differ diff --git a/fonts/prose-129b77953cd92a716f7e5224f4de015e.woff b/fonts/prose-129b77953cd92a716f7e5224f4de015e.woff new file mode 100644 index 000000000..1c378de22 Binary files /dev/null and b/fonts/prose-129b77953cd92a716f7e5224f4de015e.woff differ diff --git a/fonts/prose-80081ddd6bb627b0784ec9094fabb857.woff b/fonts/prose-80081ddd6bb627b0784ec9094fabb857.woff deleted file mode 100644 index 1545a47f9..000000000 Binary files a/fonts/prose-80081ddd6bb627b0784ec9094fabb857.woff and /dev/null differ diff --git a/src/prose/models.js b/src/prose/models.js index 7234ca0cf..6888f7dbe 100644 --- a/src/prose/models.js +++ b/src/prose/models.js @@ -845,7 +845,7 @@ module.exports = { q.await((function() { cb(err, _.extend(post, { 'default_metadata': defaultMetadata, - 'markdown': _.markdown(file), + 'markdown': _.markdown(file.split('?')[0]), 'repo': repo, 'path': path, 'file': file.split('?')[0], diff --git a/src/prose/views/app.js b/src/prose/views/app.js index aa0e8db5b..2db6beb57 100644 --- a/src/prose/views/app.js +++ b/src/prose/views/app.js @@ -14,9 +14,7 @@ module.exports = Backbone.View.extend({ 'click .logout': 'logout', 'click a.item.removed': 'restoreFile', 'click a.save': 'save', - 'click a.save.confirm': 'updateFile', - 'click a.quick-save': 'updateFile', - 'click a.cancel': 'cancelSave', + 'click a.confirm': 'updateFile', 'click a.delete': 'deleteFile', 'click a.translate': 'translate', 'click .mobile-menu .toggle': 'toggleMobileClass', @@ -75,6 +73,7 @@ module.exports = Backbone.View.extend({ var errorPage = false; var hideInterface = false; // Flag for unauthenticated landing this.noMenu = false; // Prevents a mobile toggle from appearing when nto required. + this.viewing = app.state.mode; if (options) { if (options.hideInterface) hideInterface = options.hideInterface; @@ -98,10 +97,8 @@ module.exports = Backbone.View.extend({ // When the sidebar should be open. // Fix this in re-factor, could be much tighter - if (app.state.mode === 'tree') { - $('#prose').toggleClass('open', true); - $('#prose').toggleClass('mobile', false); - } else if (app.state.mode === '' && window.authenticated && app.state.user !== '') { + if (app.state.mode === 'tree' || + app.state.mode === '' && window.authenticated && app.state.user) { $('#prose').toggleClass('open', true); $('#prose').toggleClass('mobile', false); } else { @@ -122,8 +119,12 @@ module.exports = Backbone.View.extend({ }, headerContext: function(data, alterable) { - var view = this; var heading = _(window.app.templates.heading).template(); + + if (data.writable) this.writable = true; + if (data.lang) this.lang = data.lang; + if (data.metadata) this.metadata = data.metadata; + $('#heading').empty().append(heading(_.extend(data, { alterable: alterable ? true : false }))); @@ -134,23 +135,20 @@ module.exports = Backbone.View.extend({ }, sidebarContext: function(data) { - var sidebarTmpl; - if (app.state.mode === 'tree') { - sidebarTmpl = _(app.templates.sidebarProject).template(); - } else if (data.file) { - this.writable = data.writable; - sidebarTmpl = _(app.templates.settings).template(); + var tmpl = _(app.templates.sidebarProject).template(); + + // Branch Switching + _.defer(function() { + $('.chzn-select', this.el).chosen().change(function() { + router.navigate($(this).val(), true); + }); + }); + + $('#drawer', this.el) + .empty() + .append(tmpl(data)); } - - $('#drawer', this.el) - .empty() - .append(sidebarTmpl(data)); - - // Branch Switching - $('.chzn-select', this.el).chosen().change(function() { - router.navigate($(this).val(), true); - }); }, recentFiles: function(data) { @@ -185,16 +183,27 @@ module.exports = Backbone.View.extend({ }, settings: function(e) { - $navItems = $('.navigation a', this.el); - if (!this.viewing) this.viewing = app.state.mode; + var tmpl = _(app.templates.settings).template(); + var $navItems = $('.navigation a', this.el); if ($(e.target, this.el).hasClass('active')) { $navItems.removeClass('active'); $('.navigation .' + this.viewing, this.el).addClass('active'); $('#prose').toggleClass('open mobile', false); + + this.cancelSave(); } else { $navItems.removeClass('active'); $(e.target, this.el).addClass('active'); + + $('#drawer', this.el) + .empty() + .append(tmpl({ + lang: this.lang, + writable: this.writable, + metadata: this.metadata + })); + $('#prose').toggleClass('open mobile', true); } @@ -258,31 +267,46 @@ module.exports = Backbone.View.extend({ }, save: function(e) { + var tmpl = _(app.templates.sidebarSave).template(); this.eventRegister.trigger('save', e); + $navItems = $('.navigation a', this.el); - var $message = $('.commit-message', this.el); - var filepath = $('input.filepath').val(); - var filename = _.extractFilename(filepath)[1]; - var placeholder = 'Updated ' + filename; - if (app.state.mode === 'new') placeholder = 'Created ' + filename; + if ($(e.target, this.el).hasClass('active')) { + $navItems.removeClass('active'); + $('.navigation .' + this.viewing, this.el).addClass('active'); + $('#prose').toggleClass('open mobile', false); + this.cancelSave(); + } else { + $navItems.removeClass('active'); + $(e.target, this.el).addClass('active'); + + $('#drawer', this.el) + .empty() + .append(tmpl({ + writable: this.writable + })); - $('.commit', this.el).toggleClass('active', true); - $('.button.save', this.el).toggleClass('confirm', true); + $('#prose').toggleClass('open mobile', true); + + var $message = $('.commit-message', this.el); + var filepath = $('input.filepath').val(); + var filename = _.extractFilename(filepath)[1]; + var placeholder = 'Updated ' + filename; + if (app.state.mode === 'new') placeholder = 'Created ' + filename; - $('.button.save', this.el) - .html($('.button.save', this.el) - .hasClass('confirm') ? - (this.writable ? 'Commit' : 'Send Change Request') : - (this.writable ? 'Save' : 'Submit Change')); + $('.confirm', this.el) + .html($('.button.save', this.el) + .hasClass('confirm') ? + (this.writable ? 'Commit' : 'Send Change Request') : + (this.writable ? 'Save' : 'Submit Change')); - $message.attr('placeholder', placeholder).focus(); + $message.attr('placeholder', placeholder).focus(); + } return false; }, cancelSave: function(e) { - $('.commit', this.el).toggleClass('active', false); - $('.button.save', this.el).toggleClass('confirm', false); this.eventRegister.trigger('cancelSave', e); return false; }, diff --git a/src/prose/views/post.js b/src/prose/views/post.js index 017c2aef3..8c1f4d2e2 100644 --- a/src/prose/views/post.js +++ b/src/prose/views/post.js @@ -89,7 +89,6 @@ module.exports = Backbone.View.extend({ this.eventRegister.bind('remove', this.remove); this.eventRegister.bind('cancelSave', this.cancelSave); - this.eventRegister.trigger('sidebarContext', this.data); this.renderHeading(); var tmpl = _(window.app.templates.post).template(); @@ -143,7 +142,9 @@ module.exports = Backbone.View.extend({ title: _.filepath(this.data.path, this.data.file), writable: this.model.writable, alterable: true, - translate: this.data.translate + translate: this.data.translate, + lang: this.data.lang, + metadata: this.data.metadata }; this.eventRegister.trigger('headerContext', this.header, true); @@ -470,11 +471,6 @@ module.exports = Backbone.View.extend({ view.model.persisted = true; view.model.file = filename; - if (app.state.mode === 'new') { - app.state.mode = 'edit'; - view.eventRegister.trigger('sidebarContext', view.data); - } - view.renderHeading(); view.updateURL(); view.prevFile = filecontent; diff --git a/templates/app.html b/templates/app.html index 5341c1429..f0d05e933 100644 --- a/templates/app.html +++ b/templates/app.html @@ -52,7 +52,7 @@
  • - + Save
  • diff --git a/templates/settings.html b/templates/settings.html index 1bc2438f3..ff5398493 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -1,20 +1,8 @@ <% if (window.authenticated) { %>
    -

    Post Settings

    +

    Post Options

    -
    -

    Describe you changes

    - - - Cancel - -
    - - - <%= writable ? 'Save' : 'Submit Change' %> - - <% if (app.state.config && app.state.config.languages && lang !== 'yaml') { %> <% _(app.state.config.languages).each(function(lang) { %> <% if (lang.value && (metadata && metadata.lang !== lang.value)) { %> diff --git a/templates/sidebarSave.html b/templates/sidebarSave.html new file mode 100644 index 000000000..c827e28df --- /dev/null +++ b/templates/sidebarSave.html @@ -0,0 +1,12 @@ +<% if (window.authenticated) { %> +
    +

    Describe your Changes

    +
    +
    +
    + +
    + + Save +
    +<% } %>