diff --git a/www/code/main.js b/www/code/main.js
index e9dd9d8e4..869a0f8e5 100644
--- a/www/code/main.js
+++ b/www/code/main.js
@@ -22,15 +22,15 @@ define([
Cryptpad: Cryptpad,
};
- Cryptpad.styleAlerts();
- Cryptpad.addLoadingScreen();
+ $(function () {
+ Cryptpad.styleAlerts();
+ Cryptpad.addLoadingScreen();
- var ifrw = module.ifrw = $('#pad-iframe')[0].contentWindow;
- var stringify = function (obj) {
- return JSONSortify(obj);
- };
+ var ifrw = module.ifrw = $('#pad-iframe')[0].contentWindow;
+ var stringify = function (obj) {
+ return JSONSortify(obj);
+ };
- $(function () {
var toolbar;
var secret = Cryptpad.getSecrets();
diff --git a/www/pad/main.js b/www/pad/main.js
index 15a5abb47..7ca731462 100644
--- a/www/pad/main.js
+++ b/www/pad/main.js
@@ -21,6 +21,9 @@ define([
Visible, Notify) {
var $ = window.jQuery;
var saveAs = window.saveAs;
+
+ $(function () {
+
var ifrw = $('#pad-iframe')[0].contentWindow;
var Ckeditor; // to be initialized later...
var DiffDom = window.diffDOM;
@@ -814,4 +817,6 @@ define([
};
$(first);
+
+ });
});
diff --git a/www/poll/main.js b/www/poll/main.js
index 85ebec555..2af07f0e0 100644
--- a/www/poll/main.js
+++ b/www/poll/main.js
@@ -15,6 +15,8 @@ define([
], function (Config, Messages, TextPatcher, Listmap, Crypto, Cryptpad, Hyperjson, Renderer, Toolbar, Visible, Notify) {
var $ = window.jQuery;
+ $(function () {
+
var unlockHTML = '';
var lockHTML = '';
var HIDE_INTRODUCTION_TEXT = "hide_poll_text";
@@ -786,5 +788,7 @@ define([
onConnectError();
}
});
+
+ });
});
diff --git a/www/slide/main.js b/www/slide/main.js
index f9e9bd8c2..25c3b22b2 100644
--- a/www/slide/main.js
+++ b/www/slide/main.js
@@ -28,9 +28,7 @@ define([
var SLIDE_BACKCOLOR_ID = "cryptpad-backcolor";
var SLIDE_COLOR_ID = "cryptpad-color";
- Cryptpad.styleAlerts();
- Cryptpad.addLoadingScreen();
var stringify = function (obj) {
return JSONSortify(obj);
@@ -45,6 +43,9 @@ define([
};
$(function () {
+ Cryptpad.styleAlerts();
+ Cryptpad.addLoadingScreen();
+
var ifrw = module.ifrw = $('#pad-iframe')[0].contentWindow;
var toolbar;