diff --git a/customize.dist/fsStore.js b/customize.dist/fsStore.js index 66ee0a27d..a80fa1b70 100644 --- a/customize.dist/fsStore.js +++ b/customize.dist/fsStore.js @@ -1,12 +1,10 @@ define([ - '/api/config?cb=' + Math.random().toString().slice(2), - '/customize/messages.js?app=fs', '/bower_components/chainpad-listmap/chainpad-listmap.js', '/bower_components/chainpad-crypto/crypto.js?v=0.1.5', '/bower_components/textpatcher/TextPatcher.amd.js', '/common/fileObject.js', '/bower_components/jquery/dist/jquery.min.js', -], function (Config, Messages, Listmap, Crypto, TextPatcher, FO) { +], function (Listmap, Crypto, TextPatcher, FO) { /* This module uses localStorage, which is synchronous, but exposes an asyncronous API. This is so that we can substitute other storage @@ -130,7 +128,7 @@ define([ var onReady = function (f, proxy, Cryptpad, exp) { var fo = FO.init(proxy.drive, { - storageKey: Cryptpad.storageKey + Cryptpad: Cryptpad }); //storeObj = proxy; store = initStore(fo, proxy, exp); @@ -181,7 +179,7 @@ define([ }); Cryptpad.logout(); Cryptpad.addLoadingScreen(); - Cryptpad.errorLoadingScreen(Messages.onLogout, true); + Cryptpad.errorLoadingScreen(Cryptpad.Messages.onLogout, true); if (exp.info) { exp.info.network.disconnect(); } diff --git a/customize.dist/main.js b/customize.dist/main.js index af302e964..4c6d37ae5 100644 --- a/customize.dist/main.js +++ b/customize.dist/main.js @@ -1,16 +1,17 @@ define([ - '/customize/messages.js', '/customize/application_config.js', '/common/cryptpad-common.js', '/bower_components/lil-uri/uri.min.js', '/bower_components/jquery/dist/jquery.min.js', -], function (Messages, Config, Cryptpad, LilUri) { +], function (Config, Cryptpad, LilUri) { var $ = window.$; var APP = window.APP = { Cryptpad: Cryptpad, }; + var Messages = Cryptpad.Messages; + $(function () { var $main = $('#mainBlock'); diff --git a/www/code/main.js b/www/code/main.js index 869a0f8e5..7e44531b4 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -1,6 +1,5 @@ require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); define([ - '/customize/messages.js?app=code', '/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-netflux/chainpad-netflux.js', '/bower_components/textpatcher/TextPatcher.amd.js', @@ -14,9 +13,10 @@ define([ '/common/notify.js', '/bower_components/file-saver/FileSaver.min.js', '/bower_components/jquery/dist/jquery.min.js', -], function (Messages, Crypto, Realtime, TextPatcher, Toolbar, JSONSortify, JsonOT, Cryptpad, Modes, Themes, Visible, Notify) { +], function (Crypto, Realtime, TextPatcher, Toolbar, JSONSortify, JsonOT, Cryptpad, Modes, Themes, Visible, Notify) { var $ = window.jQuery; var saveAs = window.saveAs; + var Messages = Cryptpad.Messages; var module = window.APP = { Cryptpad: Cryptpad, diff --git a/www/common/cryptget.js b/www/common/cryptget.js index 31e48e8ce..d74bcee1d 100644 --- a/www/common/cryptget.js +++ b/www/common/cryptget.js @@ -1,11 +1,11 @@ define([ - '/customize/messages.js?app=cryptget', '/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-netflux/chainpad-netflux.js', '/common/cryptpad-common.js', '/bower_components/textpatcher/TextPatcher.js', '/bower_components/jquery/dist/jquery.min.js', -], function (Messages, Crypto, Realtime, Cryptpad, TextPatcher) { +], function (Crypto, Realtime, Cryptpad, TextPatcher) { + var Messages = Cryptpad.Messages; var noop = function () {}; var finish = function (S, err, doc) { if (S.done) { return; } diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index dc89bcf39..6ca5bb426 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1,6 +1,6 @@ define([ '/api/config?cb=' + Math.random().toString(16).slice(2), - '/customize/messages.js', + '/customize/messages.js?app=' + window.location.pathname.split('/').filter(function (x) { return x; }).join('.'), '/customize/fsStore.js', '/bower_components/chainpad-crypto/crypto.js?v=0.1.5', '/bower_components/alertifyjs/dist/js/alertify.js', diff --git a/www/common/fileObject.js b/www/common/fileObject.js index 5118c7645..4986c1a57 100644 --- a/www/common/fileObject.js +++ b/www/common/fileObject.js @@ -1,19 +1,23 @@ define([ - '/customize/messages.js', '/bower_components/jquery/dist/jquery.min.js', -], function (Messages) { +], function () { var $ = window.jQuery; var module = {}; + var Messages = {}; + var ROOT = "root"; var UNSORTED = "unsorted"; - var FILES_DATA = "filesData"; var TRASH = "trash"; var TEMPLATE = "template"; - var NEW_FOLDER_NAME = Messages.fm_newFolder; var init = module.init = function (files, config) { - FILES_DATA = config.storageKey || FILES_DATA; + var Cryptpad = config.Cryptpad; + Messages = Cryptpad.Messages; + + var FILES_DATA = Cryptpad.storageKey; + var NEW_FOLDER_NAME = Messages.fm_newFolder; + var DEBUG = config.DEBUG || false; var logging = function () { console.log.apply(console, arguments); diff --git a/www/common/toolbar.js b/www/common/toolbar.js index e8badd6ec..e576b0246 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -1,10 +1,11 @@ define([ - '/customize/messages.js', '/customize/application_config.js', '/bower_components/jquery/dist/jquery.min.js' -], function (Messages, Config) { +], function (Config) { var $ = window.jQuery; + var Messages = {}; + var Bar = { constants: {}, }; @@ -503,6 +504,7 @@ define([ config = config || {}; var readOnly = (typeof config.readOnly !== "undefined") ? (config.readOnly ? 1 : 0) : -1; var Cryptpad = config.common; + Messages = Cryptpad.Messages; config.displayed = config.displayed || []; var toolbar = createRealtimeToolbar($container, config.title); diff --git a/www/drive/main.js b/www/drive/main.js index 3f7335c95..e643c0c6a 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -1,19 +1,18 @@ require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); define([ - '/api/config?cb=' + Math.random().toString(16).substring(2), '/bower_components/chainpad-listmap/chainpad-listmap.js', '/bower_components/chainpad-crypto/crypto.js', '/bower_components/textpatcher/TextPatcher.amd.js', - '/customize/messages.js?app=file', 'json.sortify', '/common/cryptpad-common.js', '/common/fileObject.js', '/common/toolbar.js', '/customize/application_config.js', '/common/cryptget.js' -], function (Config, Listmap, Crypto, TextPatcher, Messages, JSONSortify, Cryptpad, FO, Toolbar, AppConfig, Get) { +], function (Listmap, Crypto, TextPatcher, JSONSortify, Cryptpad, FO, Toolbar, AppConfig, Get) { var module = window.MODULE = {}; + var Messages = Cryptpad.Messages; var $ = window.jQuery; var saveAs = window.saveAs; @@ -55,10 +54,7 @@ define([ var LOCALSTORAGE_VIEWMODE = "cryptpad-file-viewMode"; var FOLDER_CONTENT_ID = "folderContent"; - var NEW_FOLDER_NAME = Messages.fm_newFolder; - var config = {}; - config.storageKey = FILES_DATA; var DEBUG = config.DEBUG = true; var debug = config.debug = DEBUG ? function () { console.log.apply(console, arguments); @@ -176,6 +172,7 @@ define([ return files.workgroup === 1; }; config.workgroup = isWorkgroup(); + config.Cryptpad = Cryptpad; var filesOp = FO.init(files, config); filesOp.fixFiles(); diff --git a/www/pad/main.js b/www/pad/main.js index 7ca731462..01603a7c0 100644 --- a/www/pad/main.js +++ b/www/pad/main.js @@ -1,6 +1,5 @@ require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); define([ - '/customize/messages.js?app=pad', '/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-netflux/chainpad-netflux.js', '/bower_components/hyperjson/hyperjson.js', @@ -16,11 +15,12 @@ define([ '/bower_components/file-saver/FileSaver.min.js', '/bower_components/diff-dom/diffDOM.js', '/bower_components/jquery/dist/jquery.min.js', -], function (Messages, Crypto, realtimeInput, Hyperjson, +], function (Crypto, realtimeInput, Hyperjson, Toolbar, Cursor, JsonOT, TypingTest, JSONSortify, TextPatcher, Cryptpad, Visible, Notify) { var $ = window.jQuery; var saveAs = window.saveAs; + var Messages = Cryptpad.Messages; $(function () { diff --git a/www/poll/main.js b/www/poll/main.js index 2af07f0e0..e5679a171 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -1,6 +1,4 @@ define([ - '/api/config?cb=' + Math.random().toString(16).substring(2), - '/customize/messages.js?app=poll', '/bower_components/textpatcher/TextPatcher.js', '/bower_components/chainpad-listmap/chainpad-listmap.js', '/bower_components/chainpad-crypto/crypto.js', @@ -12,9 +10,11 @@ define([ '/common/notify.js', '/bower_components/file-saver/FileSaver.min.js', '/bower_components/jquery/dist/jquery.min.js', -], function (Config, Messages, TextPatcher, Listmap, Crypto, Cryptpad, Hyperjson, Renderer, Toolbar, Visible, Notify) { +], function (TextPatcher, Listmap, Crypto, Cryptpad, Hyperjson, Renderer, Toolbar, Visible, Notify) { var $ = window.jQuery; + var Messages = Cryptpad.Messages; + $(function () { var unlockHTML = ''; diff --git a/www/slide/main.js b/www/slide/main.js index 25c3b22b2..0615c76c0 100644 --- a/www/slide/main.js +++ b/www/slide/main.js @@ -1,6 +1,5 @@ require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); define([ - '/customize/messages.js?app=code', '/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-netflux/chainpad-netflux.js', '/bower_components/textpatcher/TextPatcher.amd.js', @@ -15,10 +14,12 @@ define([ '/slide/slide.js', '/bower_components/file-saver/FileSaver.min.js', '/bower_components/jquery/dist/jquery.min.js', -], function (Messages, Crypto, Realtime, TextPatcher, Toolbar, JSONSortify, JsonOT, Cryptpad, Modes, Themes, Visible, Notify, Slide) { +], function (Crypto, Realtime, TextPatcher, Toolbar, JSONSortify, JsonOT, Cryptpad, Modes, Themes, Visible, Notify, Slide) { var $ = window.jQuery; var saveAs = window.saveAs; + var Messages = Cryptpad.Messages; + var module = window.APP = { Cryptpad: Cryptpad, TextPatcher: TextPatcher,