Load messages.js only once, in cryptpad-common

This commit is contained in:
yflory
2017-02-21 14:16:23 +01:00
parent b55ded454b
commit 47b8fefd9e
11 changed files with 35 additions and 32 deletions

View File

@@ -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; }

View File

@@ -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',

View File

@@ -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);

View File

@@ -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);