diff --git a/www/slide/index.html b/www/slide/index.html
index 1e66e73fc..af2d9d473 100644
--- a/www/slide/index.html
+++ b/www/slide/index.html
@@ -4,30 +4,41 @@
+
+
-
diff --git a/www/slide/main.js b/www/slide/main.js
index e84acf255..3d2cb52b3 100644
--- a/www/slide/main.js
+++ b/www/slide/main.js
@@ -1,14 +1,17 @@
define([
'/api/config?cb=' + Math.random().toString(16).substring(2),
+ '/customize/messages.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/textpatcher/TextPatcher.amd.js',
'/common/cryptpad-common.js',
'/slide/slide.js',
+ '/bower_components/file-saver/FileSaver.min.js',
'/bower_components/jquery/dist/jquery.min.js',
'/customize/pad.js'
-], function (Config, Realtime, Crypto, TextPatcher, Cryptpad, Slide) {
+], function (Config, Messages, Realtime, Crypto, TextPatcher, Cryptpad, Slide) {
var $ = window.jQuery;
+ var saveAs = window.saveAs;
/*
TODO
@@ -21,6 +24,8 @@ define([
* ui hint for escaping presentation mode
*/
+ Cryptpad.styleAlerts();
+
var secret = Cryptpad.getSecrets();
var module = window.APP = {
@@ -28,20 +33,26 @@ define([
Slide: Slide,
};
- var userName = module.userName = Crypto.rand64(8);
-
var initializing = true;
var $textarea = $('textarea');
+ var suggestName = function () {
+ var title = '';
+ var patt = /^#\s+(.*)\s*$/;
+ $textarea.val().split("\n").some(function (line) {
+ if (!patt.test(line)) { return; }
+ line.replace(patt, function (a, b) {
+ title = b;
+ });
+ return true;
+ });
+ return title;
+ };
+
var $modal = $('#modal');
var $content = $('#content');
Slide.setModal($modal, $content);
- var $present = $('#present').click(function () {
- Slide.show(true, $textarea.val());
- Cryptpad.log("Hit ESC to exit presentation mode");
- });
-
var config = module.config = {
initialState: '',
websocketURL: Config.websocketURL,
@@ -54,6 +65,17 @@ define([
setEditable(false);
+ var onLocal = config.onLocal = function () {
+ if (initializing) { return; }
+ var content = canonicalize($textarea.val());
+ module.patchText(content);
+ Slide.update(content);
+ };
+
+ var Button = function (opt) {
+ return $('