Pull jquery using require.js rather than as a script tag and fix require to pass jquery as a parameter
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
// This is stage 1, it can be changed but you must bump the version of the project.
|
||||
define([], function () {
|
||||
// fix up locations so that relative urls work.
|
||||
require.config({ baseUrl: window.location.pathname });
|
||||
require.config({
|
||||
baseUrl: window.location.pathname,
|
||||
paths: {
|
||||
// jquery declares itself as literally "jquery" so it cannot be pulled by path :(
|
||||
"jquery": "/bower_components/jquery/dist/jquery.min",
|
||||
// json.sortify same
|
||||
"json.sortify": "/bower_components/json.sortify/dist/JSON.sortify"
|
||||
}
|
||||
});
|
||||
require([document.querySelector('script[data-bootload]').getAttribute('data-bootload')]);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
define([
|
||||
'/bower_components/jquery/dist/jquery.min.js',
|
||||
], function () {
|
||||
var $ = window.jQuery;
|
||||
define(['jquery'], function ($) {
|
||||
var Clipboard = {};
|
||||
|
||||
// copy arbitrary text to the clipboard
|
||||
@@ -13,7 +10,7 @@ define([
|
||||
|
||||
$('body').append($ta);
|
||||
|
||||
if (!($ta.length && $ta[0].select)) {
|
||||
if (!($ta.length && $ta[0].select)) {
|
||||
// console.log("oops");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
define([
|
||||
'jquery',
|
||||
'/customize/messages.js',
|
||||
'/common/common-util.js',
|
||||
'/customize/application_config.js',
|
||||
'/bower_components/alertifyjs/dist/js/alertify.js',
|
||||
'/bower_components/jquery/dist/jquery.min.js',
|
||||
], function (Messages, Util, AppConfig, Alertify) {
|
||||
var $ = window.jQuery;
|
||||
'/bower_components/alertifyjs/dist/js/alertify.js'
|
||||
], function ($, Messages, Util, AppConfig, Alertify) {
|
||||
|
||||
var UI = {};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
define([
|
||||
'jquery',
|
||||
'/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 (Crypto, Realtime, Cryptpad, TextPatcher) {
|
||||
'/bower_components/textpatcher/TextPatcher.js'
|
||||
], function ($, Crypto, Realtime, Cryptpad, TextPatcher) {
|
||||
var Messages = Cryptpad.Messages;
|
||||
var noop = function () {};
|
||||
var finish = function (S, err, doc) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
define([
|
||||
'jquery',
|
||||
'/api/config',
|
||||
'/customize/messages.js',
|
||||
'/common/fsStore.js',
|
||||
@@ -8,17 +9,15 @@ define([
|
||||
|
||||
'/common/clipboard.js',
|
||||
'/common/pinpad.js',
|
||||
'/customize/application_config.js',
|
||||
'/customize/application_config.js'
|
||||
], function ($, Config, Messages, Store, Util, Hash, UI, Clipboard, Pinpad, AppConfig) {
|
||||
|
||||
'/bower_components/jquery/dist/jquery.min.js',
|
||||
], function (Config, Messages, Store, Util, Hash, UI, Clipboard, Pinpad, AppConfig) {
|
||||
/* This file exposes functionality which is specific to Cryptpad, but not to
|
||||
any particular pad type. This includes functions for committing metadata
|
||||
about pads to your local storage for future use and improved usability.
|
||||
|
||||
Additionally, there is some basic functionality for import/export.
|
||||
*/
|
||||
var $ = window.jQuery;
|
||||
|
||||
var common = window.Cryptpad = {
|
||||
Messages: Messages,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
define([
|
||||
'/bower_components/jquery/dist/jquery.min.js',
|
||||
], function () {
|
||||
var $ = window.jQuery;
|
||||
'jquery',
|
||||
], function ($) {
|
||||
var module = {};
|
||||
|
||||
var Messages = {};
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
define([
|
||||
'jquery',
|
||||
'/bower_components/chainpad-listmap/chainpad-listmap.js',
|
||||
'/bower_components/chainpad-crypto/crypto.js?v=0.1.5',
|
||||
'/bower_components/textpatcher/TextPatcher.amd.js',
|
||||
'/common/userObject.js',
|
||||
'/bower_components/jquery/dist/jquery.min.js',
|
||||
], function (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
|
||||
@@ -13,7 +13,6 @@ define([
|
||||
To override these methods, create another file at:
|
||||
/customize/storage.js
|
||||
*/
|
||||
var $ = window.jQuery;
|
||||
|
||||
var Store = {};
|
||||
var store;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
define([
|
||||
'jquery',
|
||||
'/bower_components/chainpad-listmap/chainpad-listmap.js',
|
||||
'/bower_components/chainpad-crypto/crypto.js',
|
||||
'/common/cryptpad-common.js',
|
||||
'/common/credential.js',
|
||||
'/bower_components/tweetnacl/nacl-fast.min.js',
|
||||
'/bower_components/scrypt-async/scrypt-async.min.js', // better load speed
|
||||
'/bower_components/jquery/dist/jquery.min.js',
|
||||
], function (Listmap, Crypto, Cryptpad, Cred) {
|
||||
], function ($, Listmap, Crypto, Cryptpad, Cred) {
|
||||
var Exports = {
|
||||
Cred: Cred,
|
||||
};
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } });
|
||||
define([
|
||||
'/common/cryptpad-common.js',
|
||||
'/common/cryptget.js',
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
define([
|
||||
'jquery',
|
||||
'/customize/application_config.js',
|
||||
'/api/config',
|
||||
'/bower_components/jquery/dist/jquery.min.js'
|
||||
], function (Config, ApiConfig) {
|
||||
var $ = window.jQuery;
|
||||
'/api/config'
|
||||
], function ($, Config, ApiConfig) {
|
||||
|
||||
var Messages = {};
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
define([
|
||||
'/bower_components/jquery/dist/jquery.min.js',
|
||||
], function () {
|
||||
var $ = window.jQuery;
|
||||
'jquery',
|
||||
], function ($) {
|
||||
var module = {};
|
||||
|
||||
var ROOT = module.ROOT = "root";
|
||||
@@ -897,4 +896,3 @@ define([
|
||||
|
||||
return module;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user