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:
Caleb James DeLisle
2017-04-18 12:14:32 +02:00
parent 107e75b287
commit c341fa8e94
48 changed files with 121 additions and 183 deletions

View File

@@ -8,7 +8,6 @@
<link rel="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>

View File

@@ -8,7 +8,6 @@
<link rel="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>

View File

@@ -8,7 +8,6 @@
<link rel="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>

View File

@@ -1,9 +1,8 @@
define([
'jquery',
'/customize/application_config.js',
'/common/cryptpad-common.js',
'/bower_components/jquery/dist/jquery.min.js',
], function (Config, Cryptpad) {
var $ = window.$;
'/common/cryptpad-common.js'
], function ($, Config, Cryptpad) {
var APP = window.APP = {
Cryptpad: Cryptpad,
@@ -191,4 +190,3 @@ define([
console.log("ready");
});
});

View File

@@ -23,12 +23,10 @@ var getLanguage = function () {
};
var language = getLanguage();
var req = ['/customize/translations/messages.js'];
var req = ['jquery', '/customize/translations/messages.js'];
if (language && map[language]) { req.push('/customize/translations/messages.' + language + '.js'); }
req.push('/bower_components/jquery/dist/jquery.min.js');
define(req, function(Default, Language) {
var $ = window.jQuery;
define(req, function($, Default, Language) {
var externalMap = JSON.parse(JSON.stringify(map));

View File

@@ -8,7 +8,6 @@
<link rel="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>

View File

@@ -163,12 +163,8 @@
if (typeof(module) !== 'undefined' && module.exports) {
module.exports = Frame;
}
else if ((typeof(define) !== 'undefined' && define !== null) &&
(define.amd !== null)) {
define([
'/bower_components/jquery/dist/jquery.min.js',
], function () {
} else if (typeof(define) === 'function' && define.amd) {
define(['jquery'], function ($) {
return Frame;
});
} else {

View File

@@ -1,8 +1,7 @@
define([
'/customize/share/frame.js',
'/bower_components/jquery/dist/jquery.min.js',
], function (Frame) {
var $ = window.jQuery;
'jquery',
'/customize/share/frame.js'
], function ($, Frame) {
var domain = 'https://beta.cryptpad.fr';
@@ -123,4 +122,3 @@ define([
}].forEach(runTest);
});
});

View File

@@ -8,7 +8,6 @@
<link rel="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
{{script}}
</head>

View File

@@ -8,7 +8,6 @@
<link rel="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>