Load messages.js only once, in cryptpad-common
parent
b55ded454b
commit
47b8fefd9e
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 () {
|
||||
|
||||
|
|
|
@ -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 = '<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' } });
|
||||
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,
|
||||
|
|
Loading…
Reference in New Issue