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

@@ -1,12 +1,10 @@
require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } });
define([
'/bower_components/jquery/dist/jquery.min.js',
'jquery',
'/bower_components/hyperjson/hyperjson.js',
'/bower_components/textpatcher/TextPatcher.amd.js',
'json.sortify',
'/common/cryptpad-common.js',
], function (jQuery, Hyperjson, TextPatcher, Sortify, Cryptpad) {
var $ = window.jQuery;
], function ($, Hyperjson, TextPatcher, Sortify, Cryptpad) {
window.Hyperjson = Hyperjson;
window.TextPatcher = TextPatcher;
window.Sortify = Sortify;

View File

@@ -1,8 +1,4 @@
define([
'/bower_components/jquery/dist/jquery.min.js',
], function () {
var $ = window.jQuery;
define(['jquery'], function ($) {
$('media').each(function () {
window.alert("media tag selection works!");
});

View File

@@ -1,8 +1,7 @@
define([
'/bower_components/hyperjson/hyperjson.js',
'/bower_components/jquery/dist/jquery.min.js',
], function (Hyperjson) {
var $ = window.jQuery;
'jquery',
'/bower_components/hyperjson/hyperjson.js'
], function ($, Hyperjson) {
var shjson = '["BODY",{"class":"cke_editable cke_editable_themed cke_contents_ltr cke_show_borders","spellcheck":"false"},[["P",{},["This is ",["STRONG",{},["CryptPad"]],", the zero knowledge realtime collaborative editor.",["BR",{},[]],"What you type here is encrypted so only people who have the link can access it.",["BR",{},[]],"Even the server cannot see what you type."]],["P",{},[["SMALL",{},[["I",{},["What you see here, what you hear here, when you leave here, let it stay here"]]]],["BR",{"type":"_moz"},[]]]]]]';
var hjson = JSON.parse(shjson);

View File

@@ -1,9 +1,8 @@
define([
'/bower_components/jquery/dist/jquery.min.js',
'jquery',
'/common/cryptpad-common.js',
'/customize/translations/messages.js',
], function (jQuery, Cryptpad, English) {
var $ = window.jQuery;
], function ($, Cryptpad, English) {
var $body = $('body');