Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
ansuz 7 years ago
commit 128d5b2c6d

@ -299,7 +299,6 @@ define([
var MutationObserver = window.MutationObserver; var MutationObserver = window.MutationObserver;
var addTippy = function (el) { var addTippy = function (el) {
if (el.nodeName === 'IFRAME') { return; } if (el.nodeName === 'IFRAME') { return; }
console.log(el);
Tippy(el, { Tippy(el, {
position: 'bottom', position: 'bottom',
distance: 0, distance: 0,

@ -227,7 +227,6 @@ define([
if (!isId) { return; } if (!isId) { return; }
var decryptedMsg = channel.encryptor.decrypt(msg); var decryptedMsg = channel.encryptor.decrypt(msg);
console.log(decryptedMsg);
var parsed = JSON.parse(decryptedMsg); var parsed = JSON.parse(decryptedMsg);
if (parsed[0] !== Types.mapId && parsed[0] !== Types.mapIdAck) { return; } if (parsed[0] !== Types.mapId && parsed[0] !== Types.mapIdAck) { return; }
if (parsed[2] !== sender || !parsed[1]) { return; } if (parsed[2] !== sender || !parsed[1]) { return; }
@ -341,7 +340,7 @@ define([
});*/ });*/
var onKeyDown = function (e) { var onKeyDown = function (e) {
if (e.keyCode === 13) { if (e.keyCode === 13) {
if (e.ctrlKey) { if (e.ctrlKey || e.shiftKey) {
var val = this.value; var val = this.value;
if (typeof this.selectionStart === "number" && typeof this.selectionEnd === "number") { if (typeof this.selectionStart === "number" && typeof this.selectionEnd === "number") {
var start = this.selectionStart; var start = this.selectionStart;

@ -549,7 +549,7 @@ define([
var $templateButton = Cryptpad.createButton('template', true, templateObj); var $templateButton = Cryptpad.createButton('template', true, templateObj);
$rightside.append($templateButton); $rightside.append($templateButton);
} }
console.log('init');
/* add an export button */ /* add an export button */
var $export = Cryptpad.createButton('export', true, {}, exportFile); var $export = Cryptpad.createButton('export', true, {}, exportFile);
$drawer.append($export); $drawer.append($export);

@ -95,7 +95,7 @@ define([
} }
}); });
Slide.setModal(APP, $modal, $content, $pad, ifrw, slideOptions, initialState); Slide.setModal($modal, $content, $pad, ifrw, slideOptions, initialState);
var enterPresentationMode = function (shouldLog) { var enterPresentationMode = function (shouldLog) {
Slide.show(true, editor.getValue()); Slide.show(true, editor.getValue());
@ -282,7 +282,6 @@ define([
// Slide number // Slide number
$('<input>', {type: 'checkbox', id: 'checkNumber', checked: slideOptionsTmp.slide}).on('change', function () { $('<input>', {type: 'checkbox', id: 'checkNumber', checked: slideOptionsTmp.slide}).on('change', function () {
var c = this.checked; var c = this.checked;
console.log(c);
slideOptionsTmp.slide = c; slideOptionsTmp.slide = c;
}).appendTo($p).css('width', 'auto'); }).appendTo($p).css('width', 'auto');
$('<label>', {'for': 'checkNumber'}).text(Messages.printSlideNumber).appendTo($p); $('<label>', {'for': 'checkNumber'}).text(Messages.printSlideNumber).appendTo($p);
@ -350,6 +349,8 @@ define([
}; };
Title = Cryptpad.createTitle(titleCfg, config.onLocal, Cryptpad); Title = Cryptpad.createTitle(titleCfg, config.onLocal, Cryptpad);
Slide.setTitle(Title);
Metadata = Cryptpad.createMetadata(UserList, Title, metadataCfg, Cryptpad); Metadata = Cryptpad.createMetadata(UserList, Title, metadataCfg, Cryptpad);
var configTb = { var configTb = {
@ -472,9 +473,7 @@ define([
//$('body').append(createPrintDialog()); //$('body').append(createPrintDialog());
}).append($('<span>', {'class': 'drawer'}).text(Messages.printText)); }).append($('<span>', {'class': 'drawer'}).text(Messages.printText));
// TODO reenable this when it is working again $drawer.append($printButton);
$printButton = $printButton;
//$drawer.append($printButton);
var $slideOptions = $('<button>', { var $slideOptions = $('<button>', {
title: Messages.slideOptionsTitle, title: Messages.slideOptionsTitle,

@ -9,7 +9,6 @@ define([
content: [], content: [],
changeHandlers: [], changeHandlers: [],
}; };
var APP;
var ifrw; var ifrw;
var $modal; var $modal;
var $content; var $content;
@ -19,6 +18,7 @@ define([
var separator = '<hr data-pewpew="pezpez">'; var separator = '<hr data-pewpew="pezpez">';
var separatorReg = /<hr data\-pewpew="pezpez">/g; var separatorReg = /<hr data\-pewpew="pezpez">/g;
var slideClass = 'slide-frame'; var slideClass = 'slide-frame';
var Title;
Slide.onChange = function (f) { Slide.onChange = function (f) {
if (typeof(f) === 'function') { if (typeof(f) === 'function') {
@ -98,7 +98,7 @@ define([
$('<div>', {'class': 'slideDate'}).text(new Date().toLocaleDateString()).appendTo($(el)); $('<div>', {'class': 'slideDate'}).text(new Date().toLocaleDateString()).appendTo($(el));
} }
if (options.title) { if (options.title) {
$('<div>', {'class': 'slideTitle'}).text(APP.title).appendTo($(el)); $('<div>', {'class': 'slideTitle'}).text(Title.title).appendTo($(el));
} }
}); });
$content.removeClass('transition'); $content.removeClass('transition');
@ -304,17 +304,20 @@ define([
}; };
Slide.setModal = function (appObj, $m, $c, $p, iframe, opt, ph) { Slide.setModal = function ($m, $c, $p, iframe, opt, ph) {
$modal = Slide.$modal = $m; $modal = Slide.$modal = $m;
$content = Slide.$content = $c; $content = Slide.$content = $c;
$pad = Slide.$pad = $p; $pad = Slide.$pad = $p;
ifrw = Slide.ifrw = iframe; ifrw = Slide.ifrw = iframe;
placeholder = Slide.placeholder = ph; placeholder = Slide.placeholder = ph;
options = Slide.options = opt; options = Slide.options = opt;
APP = appObj;
addEvent(); addEvent();
addSwipeEvents(); addSwipeEvents();
}; };
Slide.setTitle = function (titleObj) {
Title = titleObj;
};
return Slide; return Slide;
}); });

@ -63,6 +63,7 @@ body {
display:block; display:block;
} }
html, body { html, body {
height: auto;
max-height: none; max-height: none;
overflow: visible; overflow: visible;
} }
@ -74,6 +75,20 @@ body {
visibility: visible; visibility: visible;
} }
} }
.cp #modal {
display: none !important;
}
.cp {
flex: 1 !important;
overflow: visible !important;
}
.userlist-drawer {
display: none !important;
}
#editorContainer {
height: auto;
display: block;
}
} }
} }
@ -98,30 +113,37 @@ body {
} }
} }
} }
.preview .cp { .preview {
flex: 1; .cp {
overflow: hidden; width: 50vw;
div#modal:not(.shown) { overflow: hidden;
position: relative; div#modal:not(.shown) {
top: auto; position: relative;
left: auto; top: auto;
width: auto; left: auto;
display: block; width: auto;
height: 100%; display: block;
#content { height: 100%;
.slide-container { #content {
width: 100%; .slide-container {
width: 100%;
}
.slide-frame {
width: 50vw;
height: 28.125vw; // height:width ratio = 9/16 = .5625
max-height: ~"calc(100vh - 96px)";
max-width: ~"calc(16 / 9 * (100vh - 96px))";
//max-height: 100vh;
//max-width: 177.78vh; // 16/9 = 1.778
}
} }
.slide-frame { #button_exit {
width: 50vw; visibility: hidden;
height: 28.125vw; // height:width ratio = 9/16 = .5625
max-height: 100vh;
max-width: 177.78vh; // 16/9 = 1.778
} }
} }
#button_exit { }
visibility: hidden; .CodeMirror {
} flex: 1;
} }
} }
.cp { .cp {
@ -156,7 +178,7 @@ body {
.slide-container { .slide-container {
width: 90vw; width: 90vw;
height: 100vh; height: 100vh;
margin: 0vh 5vw; margin: 0vh 5vw !important;
display: flex; display: flex;
&:last-child { &:last-child {
height: ~"calc(100vh - 2px)"; height: ~"calc(100vh - 2px)";

Loading…
Cancel
Save