Load messages.js only once, in cryptpad-common

pull/1/head
yflory 8 years ago
parent b55ded454b
commit 47b8fefd9e

@ -1,12 +1,10 @@
define([ define([
'/api/config?cb=' + Math.random().toString().slice(2),
'/customize/messages.js?app=fs',
'/bower_components/chainpad-listmap/chainpad-listmap.js', '/bower_components/chainpad-listmap/chainpad-listmap.js',
'/bower_components/chainpad-crypto/crypto.js?v=0.1.5', '/bower_components/chainpad-crypto/crypto.js?v=0.1.5',
'/bower_components/textpatcher/TextPatcher.amd.js', '/bower_components/textpatcher/TextPatcher.amd.js',
'/common/fileObject.js', '/common/fileObject.js',
'/bower_components/jquery/dist/jquery.min.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 This module uses localStorage, which is synchronous, but exposes an
asyncronous API. This is so that we can substitute other storage asyncronous API. This is so that we can substitute other storage
@ -130,7 +128,7 @@ define([
var onReady = function (f, proxy, Cryptpad, exp) { var onReady = function (f, proxy, Cryptpad, exp) {
var fo = FO.init(proxy.drive, { var fo = FO.init(proxy.drive, {
storageKey: Cryptpad.storageKey Cryptpad: Cryptpad
}); });
//storeObj = proxy; //storeObj = proxy;
store = initStore(fo, proxy, exp); store = initStore(fo, proxy, exp);
@ -181,7 +179,7 @@ define([
}); });
Cryptpad.logout(); Cryptpad.logout();
Cryptpad.addLoadingScreen(); Cryptpad.addLoadingScreen();
Cryptpad.errorLoadingScreen(Messages.onLogout, true); Cryptpad.errorLoadingScreen(Cryptpad.Messages.onLogout, true);
if (exp.info) { if (exp.info) {
exp.info.network.disconnect(); exp.info.network.disconnect();
} }

@ -1,16 +1,17 @@
define([ define([
'/customize/messages.js',
'/customize/application_config.js', '/customize/application_config.js',
'/common/cryptpad-common.js', '/common/cryptpad-common.js',
'/bower_components/lil-uri/uri.min.js', '/bower_components/lil-uri/uri.min.js',
'/bower_components/jquery/dist/jquery.min.js', '/bower_components/jquery/dist/jquery.min.js',
], function (Messages, Config, Cryptpad, LilUri) { ], function (Config, Cryptpad, LilUri) {
var $ = window.$; var $ = window.$;
var APP = window.APP = { var APP = window.APP = {
Cryptpad: Cryptpad, Cryptpad: Cryptpad,
}; };
var Messages = Cryptpad.Messages;
$(function () { $(function () {
var $main = $('#mainBlock'); var $main = $('#mainBlock');

@ -1,6 +1,5 @@
require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } });
define([ define([
'/customize/messages.js?app=code',
'/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js', '/bower_components/chainpad-netflux/chainpad-netflux.js',
'/bower_components/textpatcher/TextPatcher.amd.js', '/bower_components/textpatcher/TextPatcher.amd.js',
@ -14,9 +13,10 @@ define([
'/common/notify.js', '/common/notify.js',
'/bower_components/file-saver/FileSaver.min.js', '/bower_components/file-saver/FileSaver.min.js',
'/bower_components/jquery/dist/jquery.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 $ = window.jQuery;
var saveAs = window.saveAs; var saveAs = window.saveAs;
var Messages = Cryptpad.Messages;
var module = window.APP = { var module = window.APP = {
Cryptpad: Cryptpad, Cryptpad: Cryptpad,

@ -1,11 +1,11 @@
define([ define([
'/customize/messages.js?app=cryptget',
'/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js', '/bower_components/chainpad-netflux/chainpad-netflux.js',
'/common/cryptpad-common.js', '/common/cryptpad-common.js',
'/bower_components/textpatcher/TextPatcher.js', '/bower_components/textpatcher/TextPatcher.js',
'/bower_components/jquery/dist/jquery.min.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 noop = function () {};
var finish = function (S, err, doc) { var finish = function (S, err, doc) {
if (S.done) { return; } if (S.done) { return; }

@ -1,6 +1,6 @@
define([ define([
'/api/config?cb=' + Math.random().toString(16).slice(2), '/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', '/customize/fsStore.js',
'/bower_components/chainpad-crypto/crypto.js?v=0.1.5', '/bower_components/chainpad-crypto/crypto.js?v=0.1.5',
'/bower_components/alertifyjs/dist/js/alertify.js', '/bower_components/alertifyjs/dist/js/alertify.js',

@ -1,19 +1,23 @@
define([ define([
'/customize/messages.js',
'/bower_components/jquery/dist/jquery.min.js', '/bower_components/jquery/dist/jquery.min.js',
], function (Messages) { ], function () {
var $ = window.jQuery; var $ = window.jQuery;
var module = {}; var module = {};
var Messages = {};
var ROOT = "root"; var ROOT = "root";
var UNSORTED = "unsorted"; var UNSORTED = "unsorted";
var FILES_DATA = "filesData";
var TRASH = "trash"; var TRASH = "trash";
var TEMPLATE = "template"; var TEMPLATE = "template";
var NEW_FOLDER_NAME = Messages.fm_newFolder;
var init = module.init = function (files, config) { 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 DEBUG = config.DEBUG || false;
var logging = function () { var logging = function () {
console.log.apply(console, arguments); console.log.apply(console, arguments);

@ -1,10 +1,11 @@
define([ define([
'/customize/messages.js',
'/customize/application_config.js', '/customize/application_config.js',
'/bower_components/jquery/dist/jquery.min.js' '/bower_components/jquery/dist/jquery.min.js'
], function (Messages, Config) { ], function (Config) {
var $ = window.jQuery; var $ = window.jQuery;
var Messages = {};
var Bar = { var Bar = {
constants: {}, constants: {},
}; };
@ -503,6 +504,7 @@ define([
config = config || {}; config = config || {};
var readOnly = (typeof config.readOnly !== "undefined") ? (config.readOnly ? 1 : 0) : -1; var readOnly = (typeof config.readOnly !== "undefined") ? (config.readOnly ? 1 : 0) : -1;
var Cryptpad = config.common; var Cryptpad = config.common;
Messages = Cryptpad.Messages;
config.displayed = config.displayed || []; config.displayed = config.displayed || [];
var toolbar = createRealtimeToolbar($container, config.title); var toolbar = createRealtimeToolbar($container, config.title);

@ -1,19 +1,18 @@
require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } });
define([ define([
'/api/config?cb=' + Math.random().toString(16).substring(2),
'/bower_components/chainpad-listmap/chainpad-listmap.js', '/bower_components/chainpad-listmap/chainpad-listmap.js',
'/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-crypto/crypto.js',
'/bower_components/textpatcher/TextPatcher.amd.js', '/bower_components/textpatcher/TextPatcher.amd.js',
'/customize/messages.js?app=file',
'json.sortify', 'json.sortify',
'/common/cryptpad-common.js', '/common/cryptpad-common.js',
'/common/fileObject.js', '/common/fileObject.js',
'/common/toolbar.js', '/common/toolbar.js',
'/customize/application_config.js', '/customize/application_config.js',
'/common/cryptget.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 module = window.MODULE = {};
var Messages = Cryptpad.Messages;
var $ = window.jQuery; var $ = window.jQuery;
var saveAs = window.saveAs; var saveAs = window.saveAs;
@ -55,10 +54,7 @@ define([
var LOCALSTORAGE_VIEWMODE = "cryptpad-file-viewMode"; var LOCALSTORAGE_VIEWMODE = "cryptpad-file-viewMode";
var FOLDER_CONTENT_ID = "folderContent"; var FOLDER_CONTENT_ID = "folderContent";
var NEW_FOLDER_NAME = Messages.fm_newFolder;
var config = {}; var config = {};
config.storageKey = FILES_DATA;
var DEBUG = config.DEBUG = true; var DEBUG = config.DEBUG = true;
var debug = config.debug = DEBUG ? function () { var debug = config.debug = DEBUG ? function () {
console.log.apply(console, arguments); console.log.apply(console, arguments);
@ -176,6 +172,7 @@ define([
return files.workgroup === 1; return files.workgroup === 1;
}; };
config.workgroup = isWorkgroup(); config.workgroup = isWorkgroup();
config.Cryptpad = Cryptpad;
var filesOp = FO.init(files, config); var filesOp = FO.init(files, config);
filesOp.fixFiles(); filesOp.fixFiles();

@ -1,6 +1,5 @@
require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } });
define([ define([
'/customize/messages.js?app=pad',
'/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js', '/bower_components/chainpad-netflux/chainpad-netflux.js',
'/bower_components/hyperjson/hyperjson.js', '/bower_components/hyperjson/hyperjson.js',
@ -16,11 +15,12 @@ define([
'/bower_components/file-saver/FileSaver.min.js', '/bower_components/file-saver/FileSaver.min.js',
'/bower_components/diff-dom/diffDOM.js', '/bower_components/diff-dom/diffDOM.js',
'/bower_components/jquery/dist/jquery.min.js', '/bower_components/jquery/dist/jquery.min.js',
], function (Messages, Crypto, realtimeInput, Hyperjson, ], function (Crypto, realtimeInput, Hyperjson,
Toolbar, Cursor, JsonOT, TypingTest, JSONSortify, TextPatcher, Cryptpad, Toolbar, Cursor, JsonOT, TypingTest, JSONSortify, TextPatcher, Cryptpad,
Visible, Notify) { Visible, Notify) {
var $ = window.jQuery; var $ = window.jQuery;
var saveAs = window.saveAs; var saveAs = window.saveAs;
var Messages = Cryptpad.Messages;
$(function () { $(function () {

@ -1,6 +1,4 @@
define([ define([
'/api/config?cb=' + Math.random().toString(16).substring(2),
'/customize/messages.js?app=poll',
'/bower_components/textpatcher/TextPatcher.js', '/bower_components/textpatcher/TextPatcher.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js', '/bower_components/chainpad-listmap/chainpad-listmap.js',
'/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-crypto/crypto.js',
@ -12,9 +10,11 @@ define([
'/common/notify.js', '/common/notify.js',
'/bower_components/file-saver/FileSaver.min.js', '/bower_components/file-saver/FileSaver.min.js',
'/bower_components/jquery/dist/jquery.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 $ = window.jQuery;
var Messages = Cryptpad.Messages;
$(function () { $(function () {
var unlockHTML = '<i class="fa fa-unlock" aria-hidden="true"></i>'; var unlockHTML = '<i class="fa fa-unlock" aria-hidden="true"></i>';

@ -1,6 +1,5 @@
require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } });
define([ define([
'/customize/messages.js?app=code',
'/bower_components/chainpad-crypto/crypto.js', '/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js', '/bower_components/chainpad-netflux/chainpad-netflux.js',
'/bower_components/textpatcher/TextPatcher.amd.js', '/bower_components/textpatcher/TextPatcher.amd.js',
@ -15,10 +14,12 @@ define([
'/slide/slide.js', '/slide/slide.js',
'/bower_components/file-saver/FileSaver.min.js', '/bower_components/file-saver/FileSaver.min.js',
'/bower_components/jquery/dist/jquery.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 $ = window.jQuery;
var saveAs = window.saveAs; var saveAs = window.saveAs;
var Messages = Cryptpad.Messages;
var module = window.APP = { var module = window.APP = {
Cryptpad: Cryptpad, Cryptpad: Cryptpad,
TextPatcher: TextPatcher, TextPatcher: TextPatcher,

Loading…
Cancel
Save