diff --git a/customize.dist/BottomBar.html b/customize.dist/BottomBar.html
new file mode 100644
index 000000000..09028904c
--- /dev/null
+++ b/customize.dist/BottomBar.html
@@ -0,0 +1,78 @@
+
+
diff --git a/customize.dist/DecorateToolbar.js b/customize.dist/DecorateToolbar.js
index 6481966d7..547cc7eff 100644
--- a/customize.dist/DecorateToolbar.js
+++ b/customize.dist/DecorateToolbar.js
@@ -1,7 +1,17 @@
define([
'/bower_components/jquery/dist/jquery.min.js'
-], function ($) {
- var main = function ($toolbar) {
- $toolbar.append('Made With in Paris
')
- Dt.main($('.rtwysiwyg-toolbar-rightside'));
+], function () {
+ var $ = window.jQuery;
+ var main = function () {
+ $.ajax({
+ url: '/customize/BottomBar.html',
+ success: function (ret) {
+ $('iframe').height('96%');
+ $('body').append(ret);
+ }
+ });
+ };
+ return {
+ main: main
+ };
});
diff --git a/customize.dist/fr.png b/customize.dist/fr.png
old mode 100755
new mode 100644
diff --git a/customize.dist/france.png b/customize.dist/france.png
deleted file mode 100644
index 8332c4ec2..000000000
Binary files a/customize.dist/france.png and /dev/null differ
diff --git a/customize.dist/index.html b/customize.dist/index.html
index c0679045c..7d0bb9c75 100644
--- a/customize.dist/index.html
+++ b/customize.dist/index.html
@@ -20,8 +20,8 @@
margin-right: 5px;
margin-left: 5px;
}
- .buttons {
- margin-top: 10px;
+ .buttons h5 {
+ margin-bottom: 10px;
}
.button {
padding: 2px 6px 2px 6px;
@@ -31,6 +31,7 @@
border-left: 1px solid #CCCCCC;
}
+
@@ -56,10 +57,18 @@
the NSA mad enough for them to use an active attack against you, Great Success Highfive, now take
the battery out of your computer before it spawns Agent Smith.
- Try it out!
-
diff --git a/customize.dist/logo-xwiki2.png b/customize.dist/logo-xwiki2.png
new file mode 100644
index 000000000..047c89ea7
Binary files /dev/null and b/customize.dist/logo-xwiki2.png differ
diff --git a/customize.dist/pad.js b/customize.dist/pad.js
index 48d6044d5..a86e6e28f 100644
--- a/customize.dist/pad.js
+++ b/customize.dist/pad.js
@@ -1,6 +1,6 @@
require([
'/customize/DecorateToolbar.js',
'/bower_components/jquery/dist/jquery.min.js'
-], function (Dt, $) {
- Dt.main($('.rtwysiwyg-toolbar-rightside'));
+], function (Dt) {
+ Dt.main(window.$('#bottom-bar'));
});
diff --git a/customize.dist/sheet.js b/customize.dist/sheet.js
new file mode 100644
index 000000000..a86e6e28f
--- /dev/null
+++ b/customize.dist/sheet.js
@@ -0,0 +1,6 @@
+require([
+ '/customize/DecorateToolbar.js',
+ '/bower_components/jquery/dist/jquery.min.js'
+], function (Dt) {
+ Dt.main(window.$('#bottom-bar'));
+});
diff --git a/server.js b/server.js
index f3fe5cab8..ac586d936 100644
--- a/server.js
+++ b/server.js
@@ -24,7 +24,7 @@ if (!Fs.existsSync(__dirname + "/customize")) {
console.log("Cryptpad is customizable, see customize.dist/readme.md for details");
}
app.use("/customize/", Express.static(__dirname + customize));
-app.get("/", function(req, res) { res.sendfile(__dirname + customize + '/index.html'); });
+app.get("/", function(req, res) { res.sendFile(__dirname + customize + '/index.html'); });
var httpsOpts;
if (config.privKeyAndCertFiles) {
diff --git a/www/common/toolbar.js b/www/common/toolbar.js
index a471591ec..039649940 100644
--- a/www/common/toolbar.js
+++ b/www/common/toolbar.js
@@ -48,6 +48,9 @@ define([
' display: inline-block;',
' width: 100%;',
'}',
+ '.' + TOOLBAR_CLS + ' a {',
+ ' float: right;',
+ '}',
'.' + TOOLBAR_CLS + ' div {',
' padding: 0 10px;',
' height: 1.5em;',
@@ -55,6 +58,15 @@ define([
' line-height: 25px;',
' height: 22px;',
'}',
+ '.' + TOOLBAR_CLS + ' div.rtwysiwyg-back {',
+ ' padding: 0;',
+ ' font-weight: bold;',
+ ' cursor: pointer;',
+ ' color: #000;',
+ '}',
+ '.rtwysiwyg-toolbar-leftside div {',
+ ' float: left;',
+ '}',
'.rtwysiwyg-toolbar-leftside {',
' float: left;',
'}',
@@ -79,6 +91,16 @@ define([
return toolbar;
};
+ var createEscape = function ($container) {
+ var id = uid();
+ $container.append('⇐ Back
');
+ var $ret = $container.find('#'+id);
+ $ret.on('click', function () {
+ window.location.href = '/';
+ });
+ return $ret[0];
+ };
+
var createSpinner = function ($container) {
var id = uid();
$container.append('');
@@ -97,7 +119,7 @@ define([
var createUserList = function ($container) {
var id = uid();
- $container.prepend('');
+ $container.append('');
return $container.find('#'+id)[0];
};
@@ -137,6 +159,7 @@ define([
var create = function ($container, myUserName, realtime) {
var toolbar = createRealtimeToolbar($container);
+ createEscape(toolbar.find('.rtwysiwyg-toolbar-leftside'));
var userListElement = createUserList(toolbar.find('.rtwysiwyg-toolbar-leftside'));
var spinner = createSpinner(toolbar.find('.rtwysiwyg-toolbar-rightside'));
var lagElement = createLagElement(toolbar.find('.rtwysiwyg-toolbar-rightside'));
diff --git a/www/pad/index.html b/www/pad/index.html
index b5f3f1d87..685f73398 100644
--- a/www/pad/index.html
+++ b/www/pad/index.html
@@ -3,9 +3,24 @@
+
-
+
diff --git a/www/pad/inner.html b/www/pad/inner.html
new file mode 100644
index 000000000..bf79dcd0d
--- /dev/null
+++ b/www/pad/inner.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/www/pad/main.js b/www/pad/main.js
index 7ab1f8b30..4a9a17673 100644
--- a/www/pad/main.js
+++ b/www/pad/main.js
@@ -4,10 +4,11 @@ define([
'/common/messages.js',
'/common/crypto.js',
'/bower_components/jquery/dist/jquery.min.js',
- '/bower_components/ckeditor/ckeditor.js',
+ '/customize/pad.js'
], function (Config, RTWysiwyg, Messages, Crypto) {
- var Ckeditor = window.CKEDITOR;
var $ = window.jQuery;
+ var ifrw = $('#pad-iframe')[0].contentWindow;
+ var Ckeditor = ifrw.CKEDITOR;
$(function () {
$(window).on('hashchange', function() {
@@ -20,17 +21,19 @@ define([
var key = Crypto.parseKey(window.location.hash.substring(1));
var editor = Ckeditor.replace('editor1', {
removeButtons: 'Source,Maximize',
- // This plugin inserts html crap into the document which is not part of the document
- // itself and causes problems when it's sent across the wire and reflected back.
- removePlugins: 'magicline'
+ // magicline plugin inserts html crap into the document which is not part of the
+ // document itself and causes problems when it's sent across the wire and reflected back
+ removePlugins: 'magicline,resize'
});
editor.on('instanceReady', function () {
editor.execCommand('maximize');
- var ifr = window.ifr = $('iframe')[0];
- ifr.contentDocument.body.innerHTML = Messages.initialState;
+
+ // (contenteditable) iframe in an iframe
+ ifrw.$('iframe')[0].contentDocument.body.innerHTML = Messages.initialState;
var rtw =
- RTWysiwyg.start(Config.websocketURL,
+ RTWysiwyg.start(ifrw,
+ Config.websocketURL,
Crypto.rand64(8),
key.channel,
key.cryptKey);
diff --git a/www/pad/realtime-wysiwyg.js b/www/pad/realtime-wysiwyg.js
index 4553055c1..72e11cc88 100644
--- a/www/pad/realtime-wysiwyg.js
+++ b/www/pad/realtime-wysiwyg.js
@@ -247,10 +247,11 @@ window.ErrorBox = ErrorBox;
return out;
};
- var start = module.exports.start = function (websocketUrl, userName, channel, cryptKey)
+ var start = module.exports.start =
+ function (window, websocketUrl, userName, channel, cryptKey)
{
var passwd = 'y';
- var wysiwygDiv = document.getElementById('cke_1_contents');
+ var wysiwygDiv = window.document.getElementById('cke_1_contents');
var ifr = wysiwygDiv.getElementsByTagName('iframe')[0];
var doc = ifr.contentWindow.document;
var socket = makeWebsocket(websocketUrl);
@@ -303,7 +304,7 @@ console.log(new Error().stack);
{ transformFunction: Otaml.transform });
var toolbar = realtime.toolbar =
- Toolbar.create($('#cke_1_toolbox'), userName, realtime);
+ Toolbar.create(window.$('#cke_1_toolbox'), userName, realtime);
onEvent = function () {
if (isErrorState) { return; }
diff --git a/www/sheet/index.html b/www/sheet/index.html
index 9cad4f2bb..e32ca87cd 100644
--- a/www/sheet/index.html
+++ b/www/sheet/index.html
@@ -4,26 +4,26 @@
-
+