From 024e21e0aeae30aac7a5f1b50e5ec5e518da82fc Mon Sep 17 00:00:00 2001 From: James Allen Date: Wed, 4 Jun 2014 16:28:20 +0100 Subject: [PATCH] Upgrade Jade --- services/web/app/views/layout.jade | 12 +-- services/web/app/views/project/editor.jade | 6 +- services/web/app/views/project/list.jade | 4 +- services/web/app/views/templates.jade | 106 +++------------------ services/web/package.json | 4 +- 5 files changed, 24 insertions(+), 108 deletions(-) diff --git a/services/web/app/views/layout.jade b/services/web/app/views/layout.jade index 60fd0b55b8..b21c6f098e 100644 --- a/services/web/app/views/layout.jade +++ b/services/web/app/views/layout.jade @@ -1,8 +1,8 @@ -!!! +doctype html html(itemscope, itemtype='http://schema.org/Product') head - if (typeof(gaExperimentCode) !== "undefined" && gaExperimentCode) - !{gaExperimentCode} + - if (typeof(gaExperimentCode) !== "undefined" && gaExperimentCode) + #{gaExperimentCode} - if (typeof(priority_title) !== "undefined" && priority_title) title= title + ' - Online LaTeX Editor ShareLaTeX' @@ -19,7 +19,7 @@ html(itemscope, itemtype='http://schema.org/Product') block scripts - if (typeof(gaToken) != "undefined") - script(type='text/javascript') + script(type='text/javascript'). (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) @@ -55,7 +55,7 @@ html(itemscope, itemtype='http://schema.org/Product') include modals if !locals.supressDefaultJs - script(type='text/javascript') + script(type='text/javascript'). require = { "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'main.js')}" } @@ -63,7 +63,7 @@ if !locals.supressDefaultJs - if (typeof(tenderUrl) != "undefined") script(src="https://#{tenderUrl}/tender_widget.js" ) - script(type="text/javascript") + script(type="text/javascript"). Tender = { hideToggle: true, widgetToggles: $(".js-tender-widget"), diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index c018162f0f..d2830b40b4 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -30,7 +30,7 @@ block content script(src='/socket.io/socket.io.js') - script(type='text/javascript') + script(type='text/javascript'). window.sharelatex = !{sharelatexObject}; window.userSettings = !{userSettingsObject}; window.user = !{userObject}; @@ -56,7 +56,7 @@ block content } }; - script(type='text/javascript') + script(type='text/javascript'). ga('send', 'event', 'editor-interaction', 'editor-opened') - locals.supressDefaultJs = true @@ -73,7 +73,7 @@ block content ) - if (!anonymous) - script(type="text/javascript") + script(type="text/javascript"). var chatReq = require.config({ context: "chat", baseUrl: "#{chatUrl}/chat" diff --git a/services/web/app/views/project/list.jade b/services/web/app/views/project/list.jade index 903bfcc60b..2d1a307e45 100644 --- a/services/web/app/views/project/list.jade +++ b/services/web/app/views/project/list.jade @@ -92,7 +92,7 @@ block content a(href="/project/archived").pull-right.archived-projects Archived Projects h1 Projects - if (projects.length > 0) - .row-fluid + .row-fluid .span9 form.search input#projectFilter(placeholder='Search Projects', autofocus='autofocus').span6.projectSearch.search-query @@ -130,7 +130,7 @@ block content mixin tag('{{ project_id }}', '{{ tagName }}', true) - locals.supressDefaultJs = true - script + script(type="text/javascript"). window.requirejs = { "paths" : { "moment": "libs/moment" diff --git a/services/web/app/views/templates.jade b/services/web/app/views/templates.jade index 9e04573b65..a20e02d473 100644 --- a/services/web/app/views/templates.jade +++ b/services/web/app/views/templates.jade @@ -269,23 +269,23 @@ th Privileges th tbody - {{#showAdminControls}} + != '{{#showAdminControls}}' form.well.form-inline.addUserForm input(type="email",placeholder="someone@email.com")#newEmail.email.input-large select.privileges.input-medium option(value="readAndWrite") Read and write option(value="readOnly") Read Only button.btn.btn-primary.addUser Add New Collaborator - {{/showAdminControls}} + != '{{/showAdminControls}}' script(type="text/template")#projectMemberListItemTemplate tr.projectMember - td.email {{ email }} - td.privileges {{ privileges }} + td.email!= '{{ email }}' + td.privileges!= '{{ privileges }}' td - {{#showRemove}} + != '{{#showRemove}}' button(href="#").btn.btn-danger.removeUser Remove - {{/showRemove}} + != '{{/showRemove}}' script(type="text/template")#socialSharingTemplate .box @@ -350,99 +350,15 @@ #socialSharing #publishProject - script(type="text/template")#historyPanelTemplate - #revisionHistoryArea.fullEditorArea - - script(type='text/template')#revisionAreaTemplate - #historyAreaWrapper - #historySideBar - .take-snapshot-wrapper - a#take-snapshot.btn.btn-primary Take Snapshot - #versionListArea - #diffViewArea - #enableVersioningMessage - .message History is not yet enabled for this project. - a.btn.btn-primary.btn-large#enableVersioning Enable history - - - script(type='text/template')#snapshotCommentTemplate - input(type="text", placeholder="Snapshot comment")#snapshotComment - - script(type='text/template')#diffTemplate - .diffView - h2 {{ message }} - .date {{ date }} - - script(type='text/template')#fileDiffTemplate - .fileHeader - {{#diff}} - {{^deleted}} - ul.nav.nav-pills.pull-right - li.active - a(href="#diff-{{id}}", data-toggle="pill").diff Diff - li - a(href="#raw-{{id}}", data-toggle="pill").raw Raw - {{/deleted}} - {{/diff}} - h3(class="{{headerClass}}") {{path}} - {{#moved}} - .fileMoved Moved to {{newPath}} - {{/moved}} - {{#diff}} - .tab-content - .tab-pane.active.tab-diff(id="diff-{{id}}") - {{#sections}} - table.sectionDiff - {{#lines}} - tr(class="line {{type}}") - {{#added}} - td.old_line_number - td.new_line_number {{new_number}} - td.symbol + - {{/added}} - {{#removed}} - td.old_line_number {{old_number}} - td.new_line_number - td.symbol - - {{/removed}} - {{#unchanged}} - td.old_line_number {{old_number}} - td.new_line_number {{new_number}} - td.symbol - {{/unchanged}} - td.content {{content}} - {{/lines}} - .sectionSeparator - {{/sections}} - .tab-pane.tab-raw(id="raw-{{id}}") - pre.rawFileContent Loading... - {{/diff}} - {{#binary}} - {{^deleted}} - .binaryFileDiff - a(href="{{url}}",target="_blank").rawFileLink View this version of the file - {{/deleted}} - {{/binary}} - - script(type='text/template')#versionListItemTemplate - a(href="#") - div(class='version-message') {{message}} - div(class='version-date') {{date}} - - script(type='text/template')#versionListTemplate - ul#version-list.nav.nav-pills.nav-stacked - li.loading Loading... - li.empty-message You don't have any versions yet! - script(type='text/template')#fileViewTemplate - {{#image}} + != '{{#image}}' div img(src='{{ previewUrl }}') - {{/image}} - {{^image}} + != '{{/image}}' + != '{{^image}}' .no-preview No preview available :( - {{/image}} - a(href='{{ downloadUrl }}', target="_blank").download.btn.btn-large Download {{ name }} + != '{{/image}}' + a(href='{{ downloadUrl }}', target="_blank").download.btn.btn-large!= 'Download {{ name }}' script(type='text/template')#hotKeysLinkTemplate div diff --git a/services/web/package.json b/services/web/package.json index a7497161be..4f0f17a278 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -8,7 +8,6 @@ "express": "3.3.4", "mongoose": "3.8.8", "mongojs": "0.10.1", - "jade": "0.28.1", "underscore": "1.6.0", "rimraf": "2.2.6", "connect-redis": "1.4.5", @@ -34,7 +33,8 @@ "archiver": "0.9.0", "mocha": "1.17.1", "redback": "0.4.0", - "sanitizer": "0.1.1" + "sanitizer": "0.1.1", + "jade": "~1.3.1" }, "devDependencies": { "chai": "",