From e3c0ec29f730463dca3b6fa273b72de049d7f4a3 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Wed, 13 Sep 2017 11:00:00 +0200 Subject: [PATCH 1/6] Hopefully chase out a race in sframe-channel --- www/common/sframe-channel.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/www/common/sframe-channel.js b/www/common/sframe-channel.js index 7277a1bfe..300491e1f 100644 --- a/www/common/sframe-channel.js +++ b/www/common/sframe-channel.js @@ -1,7 +1,8 @@ // This file provides the API for the channel for talking to and from the sandbox iframe. define([ - '/common/sframe-protocol.js' -], function (SFrameProtocol) { + '/common/sframe-protocol.js', + '/common/common-util.js' +], function (SFrameProtocol, Util) { var mkTxid = function () { return Math.random().toString(16).replace('0.', '') + Math.random().toString(16).replace('0.', ''); @@ -9,6 +10,7 @@ define([ var create = function (ow, cb, isSandbox) { var otherWindow; + var evReady = Util.mkEvent(true); var handlers = {}; var queries = {}; @@ -34,11 +36,13 @@ define([ delete queries[txid]; cb(undefined, data.content, msg); }; - otherWindow.postMessage(JSON.stringify({ - txid: txid, - content: content, - q: q - }), '*'); + evReady.reg(function () { + otherWindow.postMessage(JSON.stringify({ + txid: txid, + content: content, + q: q + }), '*'); + }); }; // Fire an event. channel.event('EV_SOMETHING', { args: "whatever" }); @@ -50,7 +54,9 @@ define([ if (e.indexOf('EV_') !== 0) { throw new Error('please only use events (starting with EV_) for event messages'); } - otherWindow.postMessage(JSON.stringify({ content: content, q: e }), '*'); + evReady.reg(function () { + otherWindow.postMessage(JSON.stringify({ content: content, q: e }), '*'); + }); }; // Be notified on query or event. channel.on('EV_SOMETHING', function (args, reply) { ... }); @@ -106,18 +112,14 @@ define([ }, true); // Make sure both iframes are ready - var readyHandlers = []; chan.onReady = function (h) { if (typeof(h) !== "function") { return; } - readyHandlers.push(h); + chan.on('EV_RPC_READY', function () { h(); }); }; chan.ready = function () { chan.whenReg('EV_RPC_READY', function () { chan.event('EV_RPC_READY'); }); - chan.on('EV_RPC_READY', function () { - readyHandlers.forEach(function (h) { h(); }); - }); }; var txid; @@ -129,6 +131,7 @@ define([ //console.log(msg); } else if (!otherWindow) { otherWindow = ow; + evReady.fire(); ow.postMessage(JSON.stringify({ txid: data.txid }), '*'); cb(chan); } else if (typeof(data.q) === 'string' && handlers[data.q]) { @@ -149,6 +152,7 @@ define([ if (isSandbox) { // we're in the sandbox otherWindow = ow; + evReady.fire(); cb(chan); } }; From 63cb5dfc1e3926c891c8e67f4a31f65f6a0f6f5c Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Wed, 13 Sep 2017 12:04:24 +0200 Subject: [PATCH 2/6] Make less loader rewrite urls to use version parameter --- www/common/LessLoader.js | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/www/common/LessLoader.js b/www/common/LessLoader.js index 61cacfbeb..75ad7d693 100644 --- a/www/common/LessLoader.js +++ b/www/common/LessLoader.js @@ -19,8 +19,14 @@ define([ } var fixURL = function (url) { - var mark = (url.indexOf('?') !== -1) ? '&' : '?'; - return url + mark + key; + // data: blob: etc + if (!/^(\/|http)/.test(url)) { return url; } + var ua = url.split('#'); + var mark = (ua[0].indexOf('?') !== -1) ? '&' : '?'; + ua[0] = ua[0] + mark + key; + var out = ua.join('#'); + console.log(url + " --> " + out); + return out; }; var doXHR = Less.FileManager.prototype.doXHR; @@ -48,6 +54,22 @@ define([ localStorage['LESS_CACHE'] = key; }; + var fixAllURLs = function (source) { + var urlRegEx = /@import\s*("([^"]*)"|'([^']*)')|url\s*\(\s*(\s*"([^"]*)"|'([^']*)'|[^\)]*\s*)\s*\)/ig; + var result, url; + + while (!!(result = urlRegEx.exec(source))) { + url = result[3] || result[2] || result[5] || result[6] || result[4]; + var newUrl = fixURL(url); + var quoteLen = result[5] || result[6] ? 1 : 0; + source = source.substr(0, urlRegEx.lastIndex - url.length - quoteLen - 1) + + newUrl + source.substr(urlRegEx.lastIndex - quoteLen - 1); + urlRegEx.lastIndex = urlRegEx.lastIndex + (newUrl.length - url.length); + } + + return source; + }; + module.exports.load = function (url /*:string*/, cb /*:()=>void*/) { checkCache(); if (localStorage['LESS_CACHE|' + key + '|' + url]) { @@ -60,8 +82,11 @@ define([ console.log(err); return; } - localStorage['LESS_CACHE|' + key + '|' + url] = css.css; - inject(css.css, url); + var output = fixAllURLs(css.css); + window.lc = window.lc || {}; + window.lc['LESS_CACHE|' + key + '|' + url] = output; + localStorage['LESS_CACHE|' + key + '|' + url] = output; + inject(output, url); cb(); }, window.less); }; From 244e3ecba72099fb4fb8a76c5827a77d15353692 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 13 Sep 2017 12:32:30 +0200 Subject: [PATCH 3/6] support forefront flag in alert config --- customize.dist/src/less2/include/alertify.less | 10 +++++++--- www/common/common-interface.js | 11 ++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index 16688f179..8bc53a2a0 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -3,6 +3,7 @@ @import (once) "./modal-theme.less"; .alertify_main () { + @max-z-index: 2147483647; @alertify-fore: @colortheme_modal-fg; @alertify-base: @colortheme_modal-bg; @@ -27,7 +28,7 @@ // These show only once .alertify-logs { - z-index:10000; + z-index:10000; // alertify logs @media print { visibility: hidden; } @@ -63,7 +64,10 @@ bottom: 0; width: 100%; height: 100%; - z-index: 99999; + z-index: 99999; // alertify container + &.forefront { + z-index: @max-z-index; // alertify max forefront + } .message { h1, h2, h3, h4, h5, h6 { @@ -236,7 +240,7 @@ .alertify-logs { position: fixed; - z-index: 99999; + z-index: 99999; // alertify logs &.bottom, &:not(.top) { bottom: 16px; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 467cad4ab..2e7b6e640 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -209,7 +209,15 @@ define([ return tagger; }; - UI.alert = function (msg, cb, force) { + UI.alert = function (msg, cb, opt) { + var force = false; + if (typeof(opt) === 'object') { + force = opt.force || false; + } else if (typeof(opt) === 'boolean') { + force = opt; + opt = {}; + } + cb = cb || function () {}; var message; @@ -228,6 +236,7 @@ define([ dialog.nav(ok), ]); + if (opt.forefront) { $(frame).addClass('forefront'); } var listener; var close = Util.once(function () { $(frame).fadeOut(150, function () { $(this).remove(); }); From d46cc8226d716e35c83b6a8ccb76f43e1efa553d Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Wed, 13 Sep 2017 14:46:41 +0200 Subject: [PATCH 4/6] Update LessLoader to be capable of loading CSS as well as less files and properly rewrite the URLs --- www/common/LessLoader.js | 41 +++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/www/common/LessLoader.js b/www/common/LessLoader.js index 75ad7d693..0a8399181 100644 --- a/www/common/LessLoader.js +++ b/www/common/LessLoader.js @@ -18,12 +18,15 @@ define([ localStorage = {}; } - var fixURL = function (url) { + var fixURL = function (url, parent) { // data: blob: etc - if (!/^(\/|http)/.test(url)) { return url; } + if (/^[a-zA-Z0-9]*:/.test(url)) { return url; } var ua = url.split('#'); var mark = (ua[0].indexOf('?') !== -1) ? '&' : '?'; ua[0] = ua[0] + mark + key; + if (ua[0].indexOf(':') === -1 && ua[0].indexOf('/') && parent) { + ua[0] = parent.replace(/\/[^\/]*$/, '/') + ua[0]; + } var out = ua.join('#'); console.log(url + " --> " + out); return out; @@ -54,13 +57,13 @@ define([ localStorage['LESS_CACHE'] = key; }; - var fixAllURLs = function (source) { + var fixAllURLs = function (source, parent) { var urlRegEx = /@import\s*("([^"]*)"|'([^']*)')|url\s*\(\s*(\s*"([^"]*)"|'([^']*)'|[^\)]*\s*)\s*\)/ig; var result, url; while (!!(result = urlRegEx.exec(source))) { url = result[3] || result[2] || result[5] || result[6] || result[4]; - var newUrl = fixURL(url); + var newUrl = fixURL(url, parent); var quoteLen = result[5] || result[6] ? 1 : 0; source = source.substr(0, urlRegEx.lastIndex - url.length - quoteLen - 1) + newUrl + source.substr(urlRegEx.lastIndex - quoteLen - 1); @@ -70,6 +73,24 @@ define([ return source; }; + var loadCSS = function (url, cb) { + var xhr = new window.XMLHttpRequest(); + xhr.open("GET", fixURL(url), true); + xhr.responseType = 'text'; + xhr.onload = function () { + if (/^4/.test('' + this.status)) { return cb("error loading " + url); } + cb(undefined, xhr.response); + }; + xhr.send(null); + }; + + var loadLess = function (url, cb) { + Less.render('@import (multiple) "' + url + '";', {}, function(err, css) { + if (err) { return void cb(err); } + cb(undefined, css.css); + }, window.less); + }; + module.exports.load = function (url /*:string*/, cb /*:()=>void*/) { checkCache(); if (localStorage['LESS_CACHE|' + key + '|' + url]) { @@ -77,18 +98,12 @@ define([ cb(); return; } - Less.render('@import (multiple) "' + url + '";', {}, function(err, css) { - if (err) { - console.log(err); - return; - } - var output = fixAllURLs(css.css); - window.lc = window.lc || {}; - window.lc['LESS_CACHE|' + key + '|' + url] = output; + ((/\.less([\?\#].*)?$/.test(url)) ? loadLess : loadCSS)(url, function (err, css) { + var output = fixAllURLs(css, url); localStorage['LESS_CACHE|' + key + '|' + url] = output; inject(output, url); cb(); - }, window.less); + }); }; return module.exports; From 789a9237925d04d5eb69cfaca9be1785f180cfc5 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Wed, 13 Sep 2017 14:47:50 +0200 Subject: [PATCH 5/6] Change font-awesome to be pulled through LessLoader which will rewrite the font file URLs to use ver= parameter --- customize.dist/template.js | 2 +- www/code/inner.js | 2 +- www/common/LessLoader.js | 2 +- www/contacts/inner.js | 2 +- www/contacts/main.js | 2 +- www/drive/inner.js | 2 +- www/drive/main.js | 2 +- www/file/inner.js | 2 +- www/filepicker/inner.js | 2 +- www/login/main.js | 2 +- www/oldcode/inner.js | 2 +- www/oldcode/main.js | 2 +- www/oldfile/inner.js | 2 +- www/oldfile/main.js | 2 +- www/oldslide/main.js | 2 +- www/pad/inner.js | 2 +- www/poll/main.js | 2 +- www/register/main.js | 2 +- www/settings/main.js | 2 +- www/slide/inner.js | 2 +- www/todo/inner.js | 2 +- www/todo/main.js | 2 +- www/whiteboard/main.js | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/customize.dist/template.js b/customize.dist/template.js index 062be4308..3c6585dce 100644 --- a/customize.dist/template.js +++ b/customize.dist/template.js @@ -4,7 +4,7 @@ define([ '/common/cryptpad-common.js', '/customize/pages.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', ], function ($, h, Cryptpad, Pages) { $(function () { var $body = $('body'); diff --git a/www/code/inner.js b/www/code/inner.js index 53d852ebd..306b57ff5 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -16,7 +16,7 @@ define([ 'cm/lib/codemirror', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less2/main.less', 'css!cm/lib/codemirror.css', diff --git a/www/common/LessLoader.js b/www/common/LessLoader.js index 0a8399181..c7b015655 100644 --- a/www/common/LessLoader.js +++ b/www/common/LessLoader.js @@ -28,7 +28,7 @@ define([ ua[0] = parent.replace(/\/[^\/]*$/, '/') + ua[0]; } var out = ua.join('#'); - console.log(url + " --> " + out); + //console.log(url + " --> " + out); return out; }; diff --git a/www/contacts/inner.js b/www/contacts/inner.js index 556f37ee3..aee04ded1 100644 --- a/www/contacts/inner.js +++ b/www/contacts/inner.js @@ -1,6 +1,6 @@ define([ 'jquery', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/contacts/main.less', 'less!/customize/src/less/toolbar.less', diff --git a/www/contacts/main.js b/www/contacts/main.js index 29583c07e..95642b503 100644 --- a/www/contacts/main.js +++ b/www/contacts/main.js @@ -7,7 +7,7 @@ define([ '/common/common-messenger.js', '/contacts/messenger-ui.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less/cryptpad.less', ], function ($, Crypto, Toolbar, Cryptpad, Messenger, UI) { var Messages = Cryptpad.Messages; diff --git a/www/drive/inner.js b/www/drive/inner.js index da7ddbe1f..e1779778b 100644 --- a/www/drive/inner.js +++ b/www/drive/inner.js @@ -1,5 +1,5 @@ define([ - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/drive/file.less', 'less!/customize/src/less/cryptpad.less', diff --git a/www/drive/main.js b/www/drive/main.js index f415ad49e..a57c0687c 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -11,7 +11,7 @@ define([ '/common/cryptget.js', '/common/mergeDrive.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less/cryptpad.less', ], function ($, Listmap, Crypto, TextPatcher, JSONSortify, Cryptpad, FO, Toolbar, AppConfig, Get, Merge) { var module = window.MODULE = {}; diff --git a/www/file/inner.js b/www/file/inner.js index 1ada1f817..6b8ebfa75 100644 --- a/www/file/inner.js +++ b/www/file/inner.js @@ -13,7 +13,7 @@ define([ '/bower_components/file-saver/FileSaver.min.js', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less2/main.less', ], function ( diff --git a/www/filepicker/inner.js b/www/filepicker/inner.js index d5c655cb8..62b798f8d 100644 --- a/www/filepicker/inner.js +++ b/www/filepicker/inner.js @@ -9,7 +9,7 @@ define([ 'json.sortify', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less2/main.less', ], function ( $, diff --git a/www/login/main.js b/www/login/main.js index ac4baf860..5637fd4a3 100644 --- a/www/login/main.js +++ b/www/login/main.js @@ -3,7 +3,7 @@ define([ '/common/cryptpad-common.js', '/common/login.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less/loading.less', ], function ($, Cryptpad, Login) { $(function () { diff --git a/www/oldcode/inner.js b/www/oldcode/inner.js index d36a7acd2..f6b83beee 100644 --- a/www/oldcode/inner.js +++ b/www/oldcode/inner.js @@ -3,7 +3,7 @@ define([ 'cm/lib/codemirror', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/code/code.less', 'less!/customize/src/less/toolbar.less', diff --git a/www/oldcode/main.js b/www/oldcode/main.js index 5e06572b6..53ca1c5d8 100644 --- a/www/oldcode/main.js +++ b/www/oldcode/main.js @@ -10,7 +10,7 @@ define([ '/common/cryptget.js', '/common/diffMarked.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less/cryptpad.less' ], function ($, Crypto, Realtime, TextPatcher, Toolbar, JSONSortify, JsonOT, Cryptpad, Cryptget, DiffMd) { diff --git a/www/oldfile/inner.js b/www/oldfile/inner.js index 4be0b8483..c476c5108 100644 --- a/www/oldfile/inner.js +++ b/www/oldfile/inner.js @@ -1,6 +1,6 @@ define([ 'jquery', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/file/file.less', 'less!/customize/src/less/cryptpad.less', diff --git a/www/oldfile/main.js b/www/oldfile/main.js index 136702c47..22c9c9051 100644 --- a/www/oldfile/main.js +++ b/www/oldfile/main.js @@ -12,7 +12,7 @@ define([ '/bower_components/file-saver/FileSaver.min.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less/cryptpad.less', ], function ($, Crypto, realtimeInput, Toolbar, Cryptpad, Visible, Notify, FileCrypto, MediaTag) { var Messages = Cryptpad.Messages; diff --git a/www/oldslide/main.js b/www/oldslide/main.js index da133ce46..cffff94e1 100644 --- a/www/oldslide/main.js +++ b/www/oldslide/main.js @@ -10,7 +10,7 @@ define([ '/common/cryptget.js', '/slide/slide.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less/cryptpad.less', ], function ($, Crypto, Realtime, TextPatcher, Toolbar, JSONSortify, JsonOT, Cryptpad, Cryptget, Slide) { var Messages = Cryptpad.Messages; diff --git a/www/pad/inner.js b/www/pad/inner.js index 3bb73d6ad..fde4a04ff 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -38,7 +38,7 @@ define([ '/bower_components/diff-dom/diffDOM.js', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less2/main.less', ], function ( $, diff --git a/www/poll/main.js b/www/poll/main.js index 8a36ecd37..eaadb2114 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -10,7 +10,7 @@ define([ '/common/toolbar2.js', '/bower_components/file-saver/FileSaver.min.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/customize/src/less/toolbar.less', 'less!/customize/src/less/cryptpad.less', diff --git a/www/register/main.js b/www/register/main.js index e8fdb8d22..cc3b6c4f0 100644 --- a/www/register/main.js +++ b/www/register/main.js @@ -5,7 +5,7 @@ define([ '/common/test.js', '/common/credential.js', // preloaded for login.js - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less/loading.less', ], function ($, Login, Cryptpad, Test, Cred) { var Messages = Cryptpad.Messages; diff --git a/www/settings/main.js b/www/settings/main.js index 5fc6e6825..a94cf7141 100644 --- a/www/settings/main.js +++ b/www/settings/main.js @@ -7,7 +7,7 @@ define([ '/bower_components/file-saver/FileSaver.min.js', 'less!/customize/src/less/cryptpad.less', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/customize/src/less/toolbar.less', 'less!/settings/main.less', diff --git a/www/slide/inner.js b/www/slide/inner.js index 80fb3e02d..8233f21f1 100644 --- a/www/slide/inner.js +++ b/www/slide/inner.js @@ -17,7 +17,7 @@ define([ 'cm/lib/codemirror', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less2/main.less', 'css!cm/lib/codemirror.css', diff --git a/www/todo/inner.js b/www/todo/inner.js index 69ef53f73..79ef5783d 100644 --- a/www/todo/inner.js +++ b/www/todo/inner.js @@ -1,6 +1,6 @@ define([ 'jquery', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/todo/todo.less', //'less!/customize/src/less/cryptpad.less', diff --git a/www/todo/main.js b/www/todo/main.js index 4ed134701..abb732661 100644 --- a/www/todo/main.js +++ b/www/todo/main.js @@ -9,7 +9,7 @@ define([ //'/common/media-tag.js', //'/bower_components/file-saver/FileSaver.min.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less/cryptpad.less', ], function ($, Crypto, Listmap, Toolbar, Cryptpad, Todo) { var Messages = Cryptpad.Messages; diff --git a/www/whiteboard/main.js b/www/whiteboard/main.js index 3871337cd..17e929d9b 100644 --- a/www/whiteboard/main.js +++ b/www/whiteboard/main.js @@ -15,7 +15,7 @@ define([ '/bower_components/secure-fabric.js/dist/fabric.min.js', '/bower_components/file-saver/FileSaver.min.js', - 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/customize/src/less/cryptpad.less', 'less!/whiteboard/whiteboard.less', From 710418f42f7b4a2d98a829119feab109dece4098 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Wed, 13 Sep 2017 16:04:01 +0200 Subject: [PATCH 6/6] Make LessLoader able to cache even inside of the sandbox iframe and don't load less compiler unless needed --- www/code/inner.html | 2 +- www/common/LessLoader.js | 92 +++++++++++++++++++++++--------------- www/common/sframe-boot.js | 30 +++++++++++++ www/common/sframe-boot2.js | 11 ----- www/file/inner.html | 2 +- www/filepicker/inner.html | 2 +- www/pad/inner.html | 2 +- www/slide/inner.html | 2 +- 8 files changed, 91 insertions(+), 52 deletions(-) diff --git a/www/code/inner.html b/www/code/inner.html index 6fad16db8..80d1cb707 100644 --- a/www/code/inner.html +++ b/www/code/inner.html @@ -2,7 +2,7 @@ - +