resolve merge conflict
This commit is contained in:
commit
0af90ef88d
@ -126,7 +126,8 @@ module.exports = {
|
|||||||
'about',
|
'about',
|
||||||
'contact',
|
'contact',
|
||||||
'what-is-cryptpad',
|
'what-is-cryptpad',
|
||||||
'features'
|
'features',
|
||||||
|
'faq'
|
||||||
],
|
],
|
||||||
|
|
||||||
/* Limits, Donations, Subscriptions and Contact
|
/* Limits, Donations, Subscriptions and Contact
|
||||||
@ -248,6 +249,14 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
pinPath: './pins',
|
pinPath: './pins',
|
||||||
|
|
||||||
|
/* Pads that are not 'pinned' by any registered user can be set to expire
|
||||||
|
* after a configurable number of days of inactivity (default 90 days).
|
||||||
|
* The value can be changed or set to false to remove expiration.
|
||||||
|
* Expired pads can then be removed using a cron job calling the
|
||||||
|
* `delete-inactive.js` script with node
|
||||||
|
*/
|
||||||
|
inactiveTime: 90, // days
|
||||||
|
|
||||||
/* CryptPad allows logged in users to upload encrypted files. Files/blobs
|
/* CryptPad allows logged in users to upload encrypted files. Files/blobs
|
||||||
* are stored in a 'blob-store'. Set its location here.
|
* are stored in a 'blob-store'. Set its location here.
|
||||||
*/
|
*/
|
||||||
|
|||||||
17
customize.dist/faq.html
Normal file
17
customize.dist/faq.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="cp">
|
||||||
|
<!-- If this file is not called customize.dist/src/template.html, it is generated -->
|
||||||
|
<head>
|
||||||
|
<title data-localization="main_title">CryptPad: Zero Knowledge, Collaborative Real Time Editing</title>
|
||||||
|
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
|
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
|
||||||
|
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
|
||||||
|
</head>
|
||||||
|
<body class="html">
|
||||||
|
<noscript>
|
||||||
|
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
|
||||||
|
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
|
||||||
|
</noscript>
|
||||||
|
</html>
|
||||||
|
|
||||||
@ -191,8 +191,10 @@ define([
|
|||||||
window.location.href = '/drive/';
|
window.location.href = '/drive/';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var hashing;
|
||||||
Exports.loginOrRegisterUI = function (uname, passwd, isRegister, shouldImport, testing, test) {
|
Exports.loginOrRegisterUI = function (uname, passwd, isRegister, shouldImport, testing, test) {
|
||||||
var hashing = true;
|
if (hashing) { return void console.log("hashing is already in progress"); }
|
||||||
|
hashing = true;
|
||||||
|
|
||||||
var proceed = function (result) {
|
var proceed = function (result) {
|
||||||
hashing = false;
|
hashing = false;
|
||||||
@ -275,7 +277,7 @@ define([
|
|||||||
|
|
||||||
proceed(result);
|
proceed(result);
|
||||||
});
|
});
|
||||||
}, 0);
|
}, 500);
|
||||||
}, 200);
|
}, 200);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,7 @@ define([
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
h('div.cp-version-footer', "CryptPad v1.26.0 (undefined)")
|
h('div.cp-version-footer', "CryptPad v1.27.0 (null)")
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -373,6 +373,42 @@ define([
|
|||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Pages['/faq.html'] = function () {
|
||||||
|
var categories = [];
|
||||||
|
var faq = Msg.faq;
|
||||||
|
Object.keys(faq).forEach(function (c) {
|
||||||
|
var questions = [];
|
||||||
|
Object.keys(faq[c]).forEach(function (q) {
|
||||||
|
var item = faq[c][q];
|
||||||
|
if (typeof item !== "object") { return; }
|
||||||
|
var answer = h('p.cp-faq-questions-a');
|
||||||
|
var question = h('p.cp-faq-questions-q');
|
||||||
|
$(question).click(function () {
|
||||||
|
if ($(answer).is(':visible')) {
|
||||||
|
return void $(answer).slideUp();
|
||||||
|
}
|
||||||
|
$(answer).slideDown();
|
||||||
|
});
|
||||||
|
questions.push(h('div.cp-faq-questions-items', [
|
||||||
|
setHTML(question, item.q),
|
||||||
|
setHTML(answer, item.a)
|
||||||
|
]));
|
||||||
|
});
|
||||||
|
categories.push(h('div.cp-faq-category', [
|
||||||
|
h('h3', faq[c].title),
|
||||||
|
h('div.cp-faq-category-questions', questions)
|
||||||
|
]));
|
||||||
|
});
|
||||||
|
return h('div#cp-main', [
|
||||||
|
infopageTopbar(),
|
||||||
|
h('div.container.cp-container', [
|
||||||
|
h('center', h('h1', Msg.faq_title)),
|
||||||
|
h('div.cp-faq-container', categories)
|
||||||
|
]),
|
||||||
|
infopageFooter()
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
Pages['/terms.html'] = function () {
|
Pages['/terms.html'] = function () {
|
||||||
return h('div#cp-main', [
|
return h('div#cp-main', [
|
||||||
infopageTopbar(),
|
infopageTopbar(),
|
||||||
@ -720,10 +756,14 @@ define([
|
|||||||
Pages['/whiteboard/'] = Pages['/whiteboard/index.html'] = function () {
|
Pages['/whiteboard/'] = Pages['/whiteboard/index.html'] = function () {
|
||||||
return [
|
return [
|
||||||
appToolbar(),
|
appToolbar(),
|
||||||
h('div#cp-app-whiteboard-canvas-area', h('canvas#cp-app-whiteboard-canvas', {
|
h('div#cp-app-whiteboard-canvas-area',
|
||||||
|
h('div#cp-app-whiteboard-container',
|
||||||
|
h('canvas#cp-app-whiteboard-canvas', {
|
||||||
width: 600,
|
width: 600,
|
||||||
height: 600
|
height: 600
|
||||||
})),
|
})
|
||||||
|
)
|
||||||
|
),
|
||||||
h('div#cp-app-whiteboard-controls', {
|
h('div#cp-app-whiteboard-controls', {
|
||||||
style: {
|
style: {
|
||||||
display: 'block',
|
display: 'block',
|
||||||
@ -783,12 +823,6 @@ define([
|
|||||||
appToolbar(),
|
appToolbar(),
|
||||||
h('div#cp-app-poll-content', [
|
h('div#cp-app-poll-content', [
|
||||||
h('div#cp-app-poll-form', [
|
h('div#cp-app-poll-form', [
|
||||||
h('div#cp-app-poll-help', [
|
|
||||||
h('h1', 'CryptPoll'),
|
|
||||||
setHTML(h('h2'), Msg.poll_subtitle),
|
|
||||||
h('p', Msg.poll_p_save),
|
|
||||||
h('p', Msg.poll_p_encryption)
|
|
||||||
]),
|
|
||||||
h('div.cp-app-poll-realtime', [
|
h('div.cp-app-poll-realtime', [
|
||||||
h('br'),
|
h('br'),
|
||||||
h('div', [
|
h('div', [
|
||||||
|
|||||||
@ -3,28 +3,9 @@
|
|||||||
.cke_reset_all * {
|
.cke_reset_all * {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
#cke_editor1 .cke_inner {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-flow: column;
|
|
||||||
}
|
|
||||||
.cke_toolbox_main {
|
.cke_toolbox_main {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
#cke_1_contents {
|
|
||||||
flex: 1;
|
|
||||||
margin-top: -1px;
|
|
||||||
display: flex;
|
|
||||||
overflow: visible;
|
|
||||||
iframe {
|
|
||||||
min-height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.cke_toolbox .cp-toolbar-history {
|
.cke_toolbox .cp-toolbar-history {
|
||||||
input.gotoInput { // TODO
|
input.gotoInput { // TODO
|
||||||
padding: 3px 3px;
|
padding: 3px 3px;
|
||||||
|
|||||||
@ -44,11 +44,11 @@
|
|||||||
@colortheme_pad-bg: #1c4fa0;
|
@colortheme_pad-bg: #1c4fa0;
|
||||||
@colortheme_pad-color: #fff;
|
@colortheme_pad-color: #fff;
|
||||||
@colortheme_pad-toolbar-bg: #c1e7ff;
|
@colortheme_pad-toolbar-bg: #c1e7ff;
|
||||||
@colortheme_pad-warn: #F83A3A;
|
@colortheme_pad-warn: #ffae00;
|
||||||
|
|
||||||
@colortheme_slide-bg: #e57614;
|
@colortheme_slide-bg: #e57614;
|
||||||
@colortheme_slide-color: #fff;
|
@colortheme_slide-color: #fff;
|
||||||
@colortheme_slide-warn: #58D697;
|
@colortheme_slide-warn: #005868;
|
||||||
|
|
||||||
@colortheme_code-bg: #ffae00;
|
@colortheme_code-bg: #ffae00;
|
||||||
@colortheme_code-color: #000;
|
@colortheme_code-color: #000;
|
||||||
@ -59,7 +59,7 @@
|
|||||||
@colortheme_poll-help-bg: #bbffbb;
|
@colortheme_poll-help-bg: #bbffbb;
|
||||||
@colortheme_poll-th-bg: #005bef;
|
@colortheme_poll-th-bg: #005bef;
|
||||||
@colortheme_poll-th-fg: #fff;
|
@colortheme_poll-th-fg: #fff;
|
||||||
@colortheme_poll-warn: #ffae00;
|
@colortheme_poll-warn: #ffade3;
|
||||||
|
|
||||||
@colortheme_whiteboard-bg: #800080;
|
@colortheme_whiteboard-bg: #800080;
|
||||||
@colortheme_whiteboard-color: #fff;
|
@colortheme_whiteboard-color: #fff;
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
font: @colortheme_app-font;
|
font: @colortheme_app-font;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
outline: none;
|
||||||
& > div {
|
& > div {
|
||||||
width: 60vw;
|
width: 60vw;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@ -75,7 +76,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cp-creation-create {
|
.cp-creation-create, .cp-creation-settings {
|
||||||
button {
|
button {
|
||||||
.tools_unselectable();
|
.tools_unselectable();
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
@ -84,9 +85,14 @@
|
|||||||
margin: 3px 10px;
|
margin: 3px 10px;
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
outline: none;
|
||||||
&:hover {
|
&:hover {
|
||||||
background: darken(@colortheme_loading-bg, 5%);
|
background: darken(@colortheme_loading-bg, 5%);
|
||||||
}
|
}
|
||||||
|
&.cp-creation-button-selected {
|
||||||
|
color: darken(@colortheme_loading-bg, 10%);
|
||||||
|
background: @colortheme_loading-color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,6 +165,9 @@
|
|||||||
color: lighten(#0275d8, 10%);
|
color: lighten(#0275d8, 10%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&> span.fa {
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.cp-creation-deleted {
|
.cp-creation-deleted {
|
||||||
background: #111;
|
background: #111;
|
||||||
|
|||||||
32
customize.dist/src/less2/include/help.less
Normal file
32
customize.dist/src/less2/include/help.less
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
@import (once) "./colortheme-all.less";
|
||||||
|
|
||||||
|
.help_main (@color, @bg-color) {
|
||||||
|
.cp-help-container {
|
||||||
|
position: relative;
|
||||||
|
background-color: lighten(@bg-color, 15%);
|
||||||
|
&.cp-help-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cp-help-close {
|
||||||
|
position: absolute;
|
||||||
|
top: 5px;
|
||||||
|
right: 5px;
|
||||||
|
}
|
||||||
|
.cp-help-text {
|
||||||
|
color: @color;
|
||||||
|
margin: 0;
|
||||||
|
padding: 15px;
|
||||||
|
h1 {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
h3 {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
ul, ol, p { margin: 0; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -25,6 +25,10 @@
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
&.cp-icons-element-selected {
|
||||||
|
background-color: white;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
.fa {
|
.fa {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 64px;
|
font-size: 64px;
|
||||||
|
|||||||
20
customize.dist/src/less2/include/markdown-toolbar.less
Normal file
20
customize.dist/src/less2/include/markdown-toolbar.less
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
@import (once) "./colortheme-all.less";
|
||||||
|
|
||||||
|
.markdownToolbar_main (@color, @bg-color) {
|
||||||
|
.cp-markdown-toolbar {
|
||||||
|
height: @toolbar_line-height;
|
||||||
|
background-color: lighten(@bg-color, 20%);
|
||||||
|
display: none;
|
||||||
|
button {
|
||||||
|
height: @toolbar_line-height !important;
|
||||||
|
outline: 0;
|
||||||
|
color: @color;
|
||||||
|
.toolbar_button;
|
||||||
|
font: normal normal normal 14px/1 FontAwesome;
|
||||||
|
&:hover {
|
||||||
|
background-color: lighten(@bg-color, 8%);
|
||||||
|
}
|
||||||
|
&.cp-markdown-help { float: right; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,6 +8,8 @@
|
|||||||
@import (once) "./tools.less";
|
@import (once) "./tools.less";
|
||||||
@import (once) "./icons.less";
|
@import (once) "./icons.less";
|
||||||
@import (once) "./modal.less";
|
@import (once) "./modal.less";
|
||||||
|
@import (once) "./markdown-toolbar.less";
|
||||||
|
@import (once) "./help.less";
|
||||||
|
|
||||||
.toolbar_main (
|
.toolbar_main (
|
||||||
@color: @colortheme_default-color, // Color of the text for the toolbar
|
@color: @colortheme_default-color, // Color of the text for the toolbar
|
||||||
@ -24,6 +26,8 @@
|
|||||||
.ckeditor_fix();
|
.ckeditor_fix();
|
||||||
.history_main();
|
.history_main();
|
||||||
.iconColors_main();
|
.iconColors_main();
|
||||||
|
.markdownToolbar_main(@color, @bg-color);
|
||||||
|
.help_main(@color, @bg-color);
|
||||||
|
|
||||||
.cp-toolbar-container {
|
.cp-toolbar-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -208,6 +212,7 @@
|
|||||||
width: auto;
|
width: auto;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
label[for="cp-app-toolbar-creation-advanced"] {
|
label[for="cp-app-toolbar-creation-advanced"] {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -238,23 +243,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(cjd) This ought to be in a less file for markdown-based editors
|
|
||||||
.cp-markdown-toolbar {
|
|
||||||
height: @toolbar_line-height;
|
|
||||||
background-color: lighten(@bg-color, 20%);
|
|
||||||
display: none;
|
|
||||||
button {
|
|
||||||
height: @toolbar_line-height !important;
|
|
||||||
outline: 0;
|
|
||||||
color: @color;
|
|
||||||
.toolbar_button;
|
|
||||||
font: normal normal normal 14px/1 FontAwesome;
|
|
||||||
&:hover {
|
|
||||||
background-color: lighten(@bg-color, 8%);
|
|
||||||
}
|
|
||||||
&.cp-markdown-help { float: right; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.cp-toolbar-userlist-drawer {
|
.cp-toolbar-userlist-drawer {
|
||||||
background-color: @bg-color;
|
background-color: @bg-color;
|
||||||
color: @color;
|
color: @color;
|
||||||
@ -356,11 +344,6 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
.cp-toolbar-rightside-button {
|
|
||||||
float: right;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
select {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
@ -422,6 +405,7 @@
|
|||||||
font-size: @colortheme_app-font-size;
|
font-size: @colortheme_app-font-size;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
max-width: none;
|
max-width: none;
|
||||||
|
line-height: calc(@toolbar_line-height - 12px); // padding + border
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -442,13 +426,6 @@
|
|||||||
background-color: @bg-color;
|
background-color: @bg-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cp-toolbar-rightside {
|
|
||||||
@media screen and (max-width: @barWidth) { // 450px
|
|
||||||
flex-wrap: wrap;
|
|
||||||
height: auto;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.cp-toolbar-title-hoverable:hover {
|
.cp-toolbar-title-hoverable:hover {
|
||||||
.cp-toolbar-title-editable, .cp-toolbar-title-edit {
|
.cp-toolbar-title-editable, .cp-toolbar-title-edit {
|
||||||
cursor: text;
|
cursor: text;
|
||||||
@ -505,6 +482,7 @@
|
|||||||
font-size: @colortheme_app-font-size;
|
font-size: @colortheme_app-font-size;
|
||||||
a {
|
a {
|
||||||
font-size: @colortheme_app-font-size;
|
font-size: @colortheme_app-font-size;
|
||||||
|
font-family: @colortheme_font;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: @warn-color;
|
color: @warn-color;
|
||||||
&:hover {
|
&:hover {
|
||||||
@ -593,7 +571,7 @@
|
|||||||
}
|
}
|
||||||
input {
|
input {
|
||||||
max-width: ~"calc(100% - 40px)";
|
max-width: ~"calc(100% - 40px)";
|
||||||
flex: 1;
|
//flex: 1;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
cursor: auto;
|
cursor: auto;
|
||||||
@ -601,6 +579,7 @@
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
padding: 5px 5px;
|
padding: 5px 5px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
line-height: 28px; // padding + border
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cp-toolbar-link, .cp-toolbar-new {
|
.cp-toolbar-link, .cp-toolbar-new {
|
||||||
@ -792,16 +771,41 @@
|
|||||||
}
|
}
|
||||||
.cp-toolbar-share-button {
|
.cp-toolbar-share-button {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cp-toolbar-rightside {
|
.cp-toolbar-rightside {
|
||||||
|
display: flex;
|
||||||
min-height: @toolbar_line-height;
|
min-height: @toolbar_line-height;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@media screen and (max-width: @barWidth) { // 450px
|
||||||
|
flex-wrap: wrap;
|
||||||
|
height: auto;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
&:empty {
|
&:empty {
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
}
|
}
|
||||||
text-align: right;
|
|
||||||
|
.cp-toolbar-rightside-button {
|
||||||
|
cursor: pointer;
|
||||||
|
// UI actions
|
||||||
|
&.cp-toolbar-icon-toggle { order: 1; }
|
||||||
|
&.cp-toolbar-icon-preview { order: 2; }
|
||||||
|
&.cp-toolbar-icon-present { order: 3; }
|
||||||
|
// Content actions
|
||||||
|
&.cp-toolbar-icon-mediatag { order: 10; }
|
||||||
|
order: 11;
|
||||||
|
// Storage actions
|
||||||
|
&.cp-toolbar-icon-hashtag { order: 20; }
|
||||||
|
&.cp-toolbar-icon-template { order: 21; }
|
||||||
|
&.cp-toolbar-icon-forget { order: 22; }
|
||||||
|
// Drawer
|
||||||
|
&.cp-toolbar-drawer-button { order: 30; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.cp-toolbar-drawer-content:empty ~ .cp-toolbar-drawer-button {
|
.cp-toolbar-drawer-content:empty ~ .cp-toolbar-drawer-button {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -820,6 +824,7 @@
|
|||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
}
|
}
|
||||||
&> span {
|
&> span {
|
||||||
|
order: 8;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
min-width: 150px;
|
min-width: 150px;
|
||||||
height: @toolbar_line-height;
|
height: @toolbar_line-height;
|
||||||
@ -834,15 +839,36 @@
|
|||||||
border: 0;
|
border: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
line-height: 1em;
|
line-height: 1em;
|
||||||
|
&.cp-toolbar-button-active {
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
.cp-toolbar-drawer-element {
|
.cp-toolbar-drawer-element {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
display: inline;
|
display: inline;
|
||||||
vertical-align: top;
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
&.fa-info-circle, &.fa-history, &.fa-cog {
|
||||||
|
.cp-toolbar-drawer-element {
|
||||||
|
margin-left: 11px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.fa-question {
|
||||||
|
.cp-toolbar-drawer-element {
|
||||||
|
margin-left: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: @colortheme_dropdown-bg-hover !important;
|
background-color: @colortheme_dropdown-bg-hover !important;
|
||||||
color: @colortheme_dropdown-color;
|
color: @colortheme_dropdown-color;
|
||||||
}
|
}
|
||||||
|
order: 8;
|
||||||
|
&.fa-history { order: 1; }
|
||||||
|
&.fa-download { order: 2; }
|
||||||
|
&.fa-upload { order: 3; }
|
||||||
|
&.fa-print { order: 4; }
|
||||||
|
&.fa-cog { order: 5; }
|
||||||
|
&.fa-info-circle { order: 6; }
|
||||||
|
&.fa-help { order: 7; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ body.cp-page-what-is-cryptpad { @import "./pages/page-what-is-cryptpad.less"; }
|
|||||||
body.cp-page-about { @import "./pages/page-about.less"; }
|
body.cp-page-about { @import "./pages/page-about.less"; }
|
||||||
body.cp-page-privacy { @import "./pages/page-privacy.less"; }
|
body.cp-page-privacy { @import "./pages/page-privacy.less"; }
|
||||||
body.cp-page-features { @import "./pages/page-features.less"; }
|
body.cp-page-features { @import "./pages/page-features.less"; }
|
||||||
|
body.cp-page-faq { @import "./pages/page-faq.less"; }
|
||||||
body.cp-page-terms { @import "./pages/page-terms.less"; }
|
body.cp-page-terms { @import "./pages/page-terms.less"; }
|
||||||
|
|
||||||
// Set the HTML style for the apps which shouldn't have a body scrollbar
|
// Set the HTML style for the apps which shouldn't have a body scrollbar
|
||||||
|
|||||||
30
customize.dist/src/less2/pages/page-faq.less
Normal file
30
customize.dist/src/less2/pages/page-faq.less
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
@import (once) "../include/infopages.less";
|
||||||
|
@import (once) "../include/colortheme-all.less";
|
||||||
|
|
||||||
|
.infopages_main();
|
||||||
|
.infopages_topbar();
|
||||||
|
|
||||||
|
.cp-faq-container {
|
||||||
|
.cp-faq-questions-q {
|
||||||
|
color: #3a84b6;
|
||||||
|
padding: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-top: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
.cp-faq-questions-q:hover {
|
||||||
|
color: #2e688f;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
.cp-faq-questions-a {
|
||||||
|
display: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -714,13 +714,8 @@ define(function () {
|
|||||||
'<p>',
|
'<p>',
|
||||||
'Αυτό είναι <strong>CryptPad</strong>, ο συνεργατικός επεξεργαστής πραγματικού χρόνου Zero Knowledge. Τα πάντα αποθηκεύονται καθώς πληκτρολογείτε.',
|
'Αυτό είναι <strong>CryptPad</strong>, ο συνεργατικός επεξεργαστής πραγματικού χρόνου Zero Knowledge. Τα πάντα αποθηκεύονται καθώς πληκτρολογείτε.',
|
||||||
'<br>',
|
'<br>',
|
||||||
'Μοιραστείτε τον σύνδεσμο σε αυτό το pad για να το επεξεργαστείτε με φίλους ή χρησιμοποιήστε το κουμπί <span class="fa fa-share-alt" style="border: 1px solid black;color:#000;"> Share </span> για να μοιραστείτε ένα κείμενο με δικαιώματα <em>read-only link</em> το οποίο επιτρέπει να το αναγνώσει κάποιος αλλά όχι να το επεξεργαστεί.',
|
'Μοιραστείτε τον σύνδεσμο σε αυτό το pad για να το επεξεργαστείτε με φίλους ή χρησιμοποιήστε το κουμπί <span class="fa fa-share-alt"></span> για να μοιραστείτε ένα κείμενο με δικαιώματα <em>read-only link</em> το οποίο επιτρέπει να το αναγνώσει κάποιος αλλά όχι να το επεξεργαστεί.',
|
||||||
'</p>',
|
'</p>',
|
||||||
|
|
||||||
'<p><em>',
|
|
||||||
'Εμπρός, απλά ξεκινήστε να πληκτρολογείτε...',
|
|
||||||
'</em></p>',
|
|
||||||
'<p> <br></p>'
|
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
out.codeInitialState = [
|
out.codeInitialState = [
|
||||||
@ -732,14 +727,6 @@ define(function () {
|
|||||||
|
|
||||||
out.slideInitialState = [
|
out.slideInitialState = [
|
||||||
'# CryptSlide\n',
|
'# CryptSlide\n',
|
||||||
'* Αυτός είναι ένας συνεργατικός επεξεργαστής πραγματικού χρόνου με τεχνολογία zero knowledge.\n',
|
|
||||||
'* Ό,τι πληκτρολογείτε εδώ είναι κρυπτογραφημένο έτσι ώστε μόνο οι άνθρωποι που έχουν τον σύνδεσμο να μπορούν να έχουν πρόσβαση.\n',
|
|
||||||
'* Ακόμη κι ο διακομιστής δεν μπορεί να δει τι πληκτρολογείτε.\n',
|
|
||||||
'* Ό,τι δείτε εδώ, ό,τι ακούσετε εδώ, όταν φύγετε από εδώ, θα παραμείνει εδώ.\n',
|
|
||||||
'\n',
|
|
||||||
'---',
|
|
||||||
'\n',
|
|
||||||
'# Πως να το χρησιμοποιήσετε\n',
|
|
||||||
'1. Γράψτε τα περιεχόμενα των slides σας χρησιμοποιώντας σύνταξη markdown\n',
|
'1. Γράψτε τα περιεχόμενα των slides σας χρησιμοποιώντας σύνταξη markdown\n',
|
||||||
' - Μάθετε περισσότερα για την σύνταξη markdown [εδώ](http://www.markdowntutorial.com/)\n',
|
' - Μάθετε περισσότερα για την σύνταξη markdown [εδώ](http://www.markdowntutorial.com/)\n',
|
||||||
'2. Διαχωρίστε τα slides σας με ---\n',
|
'2. Διαχωρίστε τα slides σας με ---\n',
|
||||||
|
|||||||
@ -294,17 +294,12 @@ define(function () {
|
|||||||
'<p>',
|
'<p>',
|
||||||
'Esto es <strong>CryptPad</strong>, el editor colaborativo en tiempo real Zero Knowledge. Todo está guardado cuando escribes.',
|
'Esto es <strong>CryptPad</strong>, el editor colaborativo en tiempo real Zero Knowledge. Todo está guardado cuando escribes.',
|
||||||
'<br>',
|
'<br>',
|
||||||
'Comparte el enlace a este pad para editar con amigos o utiliza el botón <span class="fa fa-share-alt" style="border: 1px solid black;color:#000;"> Compartir </span> para obtener un <em>enlace sólo lectura</em> que permite leer pero no escribir.',
|
'Comparte el enlace a este pad para editar con amigos o utiliza el botón <span class="fa fa-share-alt"></span> para obtener un <em>enlace sólo lectura</em> que permite leer pero no escribir.',
|
||||||
'</p>',
|
'</p>',
|
||||||
|
|
||||||
'<p><em>',
|
|
||||||
'Vamos, empieza a escribir...',
|
|
||||||
'</em></p>',
|
|
||||||
'<p> <br></p>'
|
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
out.codeInitialState = "/*\n Esto es CryptPad, el editor colaborativo en tiempo real zero knowledge.\n Lo que escribes aquí está cifrado de manera que sólo las personas con el enlace pueden acceder a ello.\n Incluso el servidor no puede ver lo que escribes.\n Lo que ves aquí, lo que escuchas aquí, cuando sales, se queda aquí\n*/";
|
out.codeInitialState = "/*\n Esto es CryptPad, el editor colaborativo en tiempo real zero knowledge.\n Lo que escribes aquí está cifrado de manera que sólo las personas con el enlace pueden acceder a ello.\n Incluso el servidor no puede ver lo que escribes.\n Lo que ves aquí, lo que escuchas aquí, cuando sales, se queda aquí\n*/";
|
||||||
out.slideInitialState = "# CryptSlide\n* Esto es CryptPad, el editor colaborativo en tiempo real zero knowledge.\n* Lo que escribes aquí está cifrado de manera que sólo las personas con el enlace pueden acceder a ello.\n* Incluso el servidor no puede ver lo que escribes.\n* Lo que ves aquí, lo que escuchas aquí, cuando sales, se queda aquí\n\n---\n# Cómo utilizarlo\n1. Escribe tu contenido en Markdown\n - Puedes aprender más sobre Markdown [aquí](http://www.markdowntutorial.com/)\n2. Separa tus diapositivas con ---\n3. Haz clic en \"Presentar\" para ver el resultado - Tus diapositivas se actualizan en tiempo real";
|
out.slideInitialState = "# CryptSlide\n1. Escribe tu contenido en Markdown\n - Puedes aprender más sobre Markdown [aquí](http://www.markdowntutorial.com/)\n2. Separa tus diapositivas con ---\n3. Haz clic en \"Presentar\" para ver el resultado - Tus diapositivas se actualizan en tiempo real";
|
||||||
out.driveReadmeTitle = "¿Qué es CryptPad?";
|
out.driveReadmeTitle = "¿Qué es CryptPad?";
|
||||||
out.readme_welcome = "¡Bienvenido a CryptPad!";
|
out.readme_welcome = "¡Bienvenido a CryptPad!";
|
||||||
out.readme_p1 = "Bienvenido a CryptPad, aquí podrás anotar cosas solo o con otra gente.";
|
out.readme_p1 = "Bienvenido a CryptPad, aquí podrás anotar cosas solo o con otra gente.";
|
||||||
|
|||||||
@ -29,11 +29,12 @@ define(function () {
|
|||||||
out.typeError = "Ce pad n'est pas compatible avec l'application sélectionnée";
|
out.typeError = "Ce pad n'est pas compatible avec l'application sélectionnée";
|
||||||
out.onLogout = 'Vous êtes déconnecté de votre compte utilisateur, <a href="/" target="_blank">cliquez ici</a> pour vous authentifier<br>ou appuyez sur <em>Échap</em> pour accéder au pad en mode lecture seule.';
|
out.onLogout = 'Vous êtes déconnecté de votre compte utilisateur, <a href="/" target="_blank">cliquez ici</a> pour vous authentifier<br>ou appuyez sur <em>Échap</em> pour accéder au pad en mode lecture seule.';
|
||||||
out.wrongApp = "Impossible d'afficher le contenu de ce document temps-réel dans votre navigateur. Vous pouvez essayer de recharger la page.";
|
out.wrongApp = "Impossible d'afficher le contenu de ce document temps-réel dans votre navigateur. Vous pouvez essayer de recharger la page.";
|
||||||
out.padNotPinned = 'Ce pad va expirer dans 3 mois, {0}connectez-vous{1} ou {2}enregistrez-vous{3} pour le préserver.';
|
out.padNotPinned = 'Ce pad va expirer après 3 mois d\'inactivité, {0}connectez-vous{1} ou {2}enregistrez-vous{3} pour le préserver.';
|
||||||
out.anonymousStoreDisabled = "L'administrateur de cette instance de CryptPad a désactivé le drive pour les utilisateurs non enregistrés. Vous devez vous connecter pour pouvoir utiliser CryptDrive.";
|
out.anonymousStoreDisabled = "L'administrateur de cette instance de CryptPad a désactivé le drive pour les utilisateurs non enregistrés. Vous devez vous connecter pour pouvoir utiliser CryptDrive.";
|
||||||
out.expiredError = "Ce pad a atteint sa date d'expiration est n'est donc plus disponible.";
|
out.expiredError = "Ce pad a atteint sa date d'expiration est n'est donc plus disponible.";
|
||||||
out.expiredErrorCopy = ' Vous pouvez toujours copier son contenu ailleurs en appuyant sur <em>Échap</em>.<br> Dés que vous aurez quitté la page, il sera impossible de le récupérer.';
|
out.expiredErrorCopy = ' Vous pouvez toujours copier son contenu ailleurs en appuyant sur <em>Échap</em>.<br> Dés que vous aurez quitté la page, il sera impossible de le récupérer.';
|
||||||
out.deletedError = 'Ce pad a été supprimé par son propriétaire et n\'est donc plus disponible.';
|
out.deletedError = 'Ce pad a été supprimé par son propriétaire et n\'est donc plus disponible.';
|
||||||
|
out.inactiveError = 'Ce pad a été supprimé en raison de son inactivité. Appuyez sur Échap pour créer un nouveau pad.';
|
||||||
|
|
||||||
out.loading = "Chargement...";
|
out.loading = "Chargement...";
|
||||||
out.error = "Erreur";
|
out.error = "Erreur";
|
||||||
@ -217,6 +218,10 @@ define(function () {
|
|||||||
out.cancelButton = 'Annuler (Échap)';
|
out.cancelButton = 'Annuler (Échap)';
|
||||||
out.doNotAskAgain = "Ne plus demander (Échap)";
|
out.doNotAskAgain = "Ne plus demander (Échap)";
|
||||||
|
|
||||||
|
out.show_help_button = "Afficher l'aide";
|
||||||
|
out.hide_help_button = "Cacher l'aide";
|
||||||
|
out.help_button = "Aide";
|
||||||
|
|
||||||
out.historyText = "Historique";
|
out.historyText = "Historique";
|
||||||
out.historyButton = "Afficher l'historique du document";
|
out.historyButton = "Afficher l'historique du document";
|
||||||
out.history_next = "Voir la version suivante";
|
out.history_next = "Voir la version suivante";
|
||||||
@ -277,9 +282,6 @@ define(function () {
|
|||||||
out.poll_locked = "Verrouillé";
|
out.poll_locked = "Verrouillé";
|
||||||
out.poll_unlocked = "Déverrouillé";
|
out.poll_unlocked = "Déverrouillé";
|
||||||
|
|
||||||
out.poll_show_help_button = "Afficher l'aide";
|
|
||||||
out.poll_hide_help_button = "Cacher l'aide";
|
|
||||||
|
|
||||||
out.poll_bookmark_col = "Marquer cette colonne comme favorite pour qu'elle soit toujours déverouillée et affichée en première position.";
|
out.poll_bookmark_col = "Marquer cette colonne comme favorite pour qu'elle soit toujours déverouillée et affichée en première position.";
|
||||||
out.poll_bookmarked_col = "Voici votre colonne favorite; elle sera toujours dévérouillée et affichée en première position.";
|
out.poll_bookmarked_col = "Voici votre colonne favorite; elle sera toujours dévérouillée et affichée en première position.";
|
||||||
out.poll_total = 'TOTAL';
|
out.poll_total = 'TOTAL';
|
||||||
@ -779,13 +781,8 @@ define(function () {
|
|||||||
'<p>',
|
'<p>',
|
||||||
'Voici <strong>CryptPad</strong>, l\'éditeur collaboratif en temps-réel Zero Knowledge. Tout est sauvegardé dés que vous le tapez.',
|
'Voici <strong>CryptPad</strong>, l\'éditeur collaboratif en temps-réel Zero Knowledge. Tout est sauvegardé dés que vous le tapez.',
|
||||||
'<br>',
|
'<br>',
|
||||||
'Partagez le lien vers ce pad avec des amis ou utilisez le bouton <span class="fa fa-share-alt" style="border: 1px solid black;color:#000;"> Partager </span> pour obtenir le <em>lien de lecture-seule</em>, qui permet la lecture mais non la modification.',
|
'Partagez le lien vers ce pad avec des amis ou utilisez le bouton <span class="fa fa-share-alt"></span> pour obtenir le <em>lien de lecture-seule</em>, qui permet la lecture mais non la modification.',
|
||||||
'</p>',
|
'</p>',
|
||||||
'<p>',
|
|
||||||
'<em>',
|
|
||||||
'Lancez-vous, commencez à taper...',
|
|
||||||
'</em></p>',
|
|
||||||
'<p> <br></p>'
|
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
out.codeInitialState = [
|
out.codeInitialState = [
|
||||||
@ -797,14 +794,6 @@ define(function () {
|
|||||||
|
|
||||||
out.slideInitialState = [
|
out.slideInitialState = [
|
||||||
'# CryptSlide\n',
|
'# CryptSlide\n',
|
||||||
'* Voici CryptPad, l\'éditeur collaboratif en temps-réel Zero Knowledge.\n',
|
|
||||||
'* Ce que vous tapez ici est chiffré de manière que seules les personnes avec le lien peuvent y accéder.\n',
|
|
||||||
'* Même le serveur est incapable de voir ce que vous tapez.\n',
|
|
||||||
'* Ce que vous voyez ici, ce que vous entendez, quand vous partez, ça reste ici.\n',
|
|
||||||
'\n',
|
|
||||||
'---',
|
|
||||||
'\n',
|
|
||||||
'# Comment l\'utiliser\n',
|
|
||||||
'1. Écrivez le contenu de votre présentation avec la syntaxe Markdown\n',
|
'1. Écrivez le contenu de votre présentation avec la syntaxe Markdown\n',
|
||||||
' - Apprenez à utiliser markdown en cliquant [ici](http://www.markdowntutorial.com/)\n',
|
' - Apprenez à utiliser markdown en cliquant [ici](http://www.markdowntutorial.com/)\n',
|
||||||
'2. Séparez vos slides avec ---\n',
|
'2. Séparez vos slides avec ---\n',
|
||||||
@ -869,6 +858,7 @@ define(function () {
|
|||||||
out.creation_createFromTemplate = "Depuis un modèle";
|
out.creation_createFromTemplate = "Depuis un modèle";
|
||||||
out.creation_createFromScratch = "Nouveau pad vide";
|
out.creation_createFromScratch = "Nouveau pad vide";
|
||||||
out.creation_settings = "Préférences des nouveaux pads";
|
out.creation_settings = "Préférences des nouveaux pads";
|
||||||
|
out.creation_saveSettings = "Sauver les préférences";
|
||||||
// Properties about creation data
|
// Properties about creation data
|
||||||
out.creation_owners = "Propriétaires";
|
out.creation_owners = "Propriétaires";
|
||||||
out.creation_ownedByOther = "Possédé par un autre utilisateur";
|
out.creation_ownedByOther = "Possédé par un autre utilisateur";
|
||||||
@ -876,7 +866,8 @@ define(function () {
|
|||||||
out.creation_expiration = "Date d'expiration";
|
out.creation_expiration = "Date d'expiration";
|
||||||
out.creation_propertiesTitle = "Disponibilité";
|
out.creation_propertiesTitle = "Disponibilité";
|
||||||
out.creation_appMenuName = "Mode avancé (Ctrl + E)";
|
out.creation_appMenuName = "Mode avancé (Ctrl + E)";
|
||||||
out.creation_newPadModalDescription = "Cliquez sur un type de pad pour le créer. Vous pouvez cocher la case pour afficher l'écran de création de pads";
|
out.creation_newPadModalDescription = "Cliquez sur un type de pad pour le créer. Vous pouvez aussi appuyer sur <b>Tab</b> pour sélectionner un type et appuyer sur <b>Entrée</b> pour valider.";
|
||||||
|
out.creation_newPadModalDescriptionAdvanced = "Cochez la case si vous souhaitez voir l'écran de création de pads (pour les pads possédés ou à date d'expiration). Vous pouvez appuyer sur <b>Espace</b> pour changer sa valeur.";
|
||||||
out.creation_newPadModalAdvanced = "Afficher l'écran de création de pads";
|
out.creation_newPadModalAdvanced = "Afficher l'écran de création de pads";
|
||||||
|
|
||||||
// New share modal
|
// New share modal
|
||||||
|
|||||||
@ -30,11 +30,12 @@ define(function () {
|
|||||||
out.typeError = "This pad is not compatible with the selected application";
|
out.typeError = "This pad is not compatible with the selected application";
|
||||||
out.onLogout = 'You are logged out, <a href="/" target="_blank">click here</a> to log in<br>or press <em>Escape</em> to access your pad in read-only mode.';
|
out.onLogout = 'You are logged out, <a href="/" target="_blank">click here</a> to log in<br>or press <em>Escape</em> to access your pad in read-only mode.';
|
||||||
out.wrongApp = "Unable to display the content of that realtime session in your browser. Please try to reload that page.";
|
out.wrongApp = "Unable to display the content of that realtime session in your browser. Please try to reload that page.";
|
||||||
out.padNotPinned = 'This pad will expire in 3 months, {0}login{1} or {2}register{3} to preserve it.';
|
out.padNotPinned = 'This pad will expire after 3 months of inactivity, {0}login{1} or {2}register{3} to preserve it.';
|
||||||
out.anonymousStoreDisabled = "The webmaster of this CryptPad instance has disabled the store for anonymous users. You have to log in to be able to use CryptDrive.";
|
out.anonymousStoreDisabled = "The webmaster of this CryptPad instance has disabled the store for anonymous users. You have to log in to be able to use CryptDrive.";
|
||||||
out.expiredError = 'This pad has reached its expiration time and is no longer available.';
|
out.expiredError = 'This pad has reached its expiration time and is no longer available.';
|
||||||
out.expiredErrorCopy = ' You can still copy the content to another location by pressing <em>Esc</em>.<br>Once you leave this page, it will disappear forever!';
|
out.expiredErrorCopy = ' You can still copy the content to another location by pressing <em>Esc</em>.<br>Once you leave this page, it will disappear forever!';
|
||||||
out.deletedError = 'This pad has been deleted by its owner and is no longer available.';
|
out.deletedError = 'This pad has been deleted by its owner and is no longer available.';
|
||||||
|
out.inactiveError = 'This pad has been deleted due to inactivity. Press Esc to create a new pad.';
|
||||||
|
|
||||||
out.loading = "Loading...";
|
out.loading = "Loading...";
|
||||||
out.error = "Error";
|
out.error = "Error";
|
||||||
@ -219,6 +220,10 @@ define(function () {
|
|||||||
out.cancelButton = 'Cancel (esc)';
|
out.cancelButton = 'Cancel (esc)';
|
||||||
out.doNotAskAgain = "Don't ask me again (Esc)";
|
out.doNotAskAgain = "Don't ask me again (Esc)";
|
||||||
|
|
||||||
|
out.show_help_button = "Show help";
|
||||||
|
out.hide_help_button = "Hide help";
|
||||||
|
out.help_button = "Help";
|
||||||
|
|
||||||
out.historyText = "History";
|
out.historyText = "History";
|
||||||
out.historyButton = "Display the document history";
|
out.historyButton = "Display the document history";
|
||||||
out.history_next = "Go to the next version";
|
out.history_next = "Go to the next version";
|
||||||
@ -279,9 +284,6 @@ define(function () {
|
|||||||
out.poll_locked = "Locked";
|
out.poll_locked = "Locked";
|
||||||
out.poll_unlocked = "Unlocked";
|
out.poll_unlocked = "Unlocked";
|
||||||
|
|
||||||
out.poll_show_help_button = "Show help";
|
|
||||||
out.poll_hide_help_button = "Hide help";
|
|
||||||
|
|
||||||
out.poll_bookmark_col = 'Bookmark this column so that it is always unlocked and displayed at the beginning for you';
|
out.poll_bookmark_col = 'Bookmark this column so that it is always unlocked and displayed at the beginning for you';
|
||||||
out.poll_bookmarked_col = 'This is your bookmarked column. It will always be unlocked and displayed at the beginning for you.';
|
out.poll_bookmarked_col = 'This is your bookmarked column. It will always be unlocked and displayed at the beginning for you.';
|
||||||
out.poll_total = 'TOTAL';
|
out.poll_total = 'TOTAL';
|
||||||
@ -759,6 +761,30 @@ define(function () {
|
|||||||
out.features_f_storage_anon = "Pads deleted after 3 months";
|
out.features_f_storage_anon = "Pads deleted after 3 months";
|
||||||
out.features_f_storage_registered = "Free: 50MB<br>Premium: 5GB/20GB/50GB";
|
out.features_f_storage_registered = "Free: 50MB<br>Premium: 5GB/20GB/50GB";
|
||||||
|
|
||||||
|
// faq.html
|
||||||
|
|
||||||
|
out.faq_link = "FAQ";
|
||||||
|
out.faq_title = "Frequently Asked Questions";
|
||||||
|
out.faq = {};
|
||||||
|
out.faq.cat1 = {
|
||||||
|
title: 'Category 1',
|
||||||
|
q1: {
|
||||||
|
q: 'What is a pad?',
|
||||||
|
a: 'A realtime collaborative document...'
|
||||||
|
},
|
||||||
|
q2: {
|
||||||
|
q: 'Question 2?',
|
||||||
|
a: '42'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
out.faq.cat2 = {
|
||||||
|
title: 'Category 2',
|
||||||
|
q1: {
|
||||||
|
q: 'A new question?',
|
||||||
|
a: 'The answer'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// terms.html
|
// terms.html
|
||||||
|
|
||||||
out.tos_title = "CryptPad Terms of Service";
|
out.tos_title = "CryptPad Terms of Service";
|
||||||
@ -791,13 +817,8 @@ define(function () {
|
|||||||
'<p>',
|
'<p>',
|
||||||
'This is <strong>CryptPad</strong>, the Zero Knowledge realtime collaborative editor. Everything is saved as you type.',
|
'This is <strong>CryptPad</strong>, the Zero Knowledge realtime collaborative editor. Everything is saved as you type.',
|
||||||
'<br>',
|
'<br>',
|
||||||
'Share the link to this pad to edit with friends or use the <span class="fa fa-share-alt" style="border: 1px solid black;color:#000;"> Share </span> button to share a <em>read-only link</em> which allows viewing but not editing.',
|
'Share the link to this pad to edit with friends or use the <span class="fa fa-share-alt"></span> button to share a <em>read-only link</em> which allows viewing but not editing.',
|
||||||
'</p>',
|
'</p>',
|
||||||
|
|
||||||
'<p><em>',
|
|
||||||
'Go ahead, just start typing...',
|
|
||||||
'</em></p>',
|
|
||||||
'<p> <br></p>'
|
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
out.codeInitialState = [
|
out.codeInitialState = [
|
||||||
@ -809,14 +830,6 @@ define(function () {
|
|||||||
|
|
||||||
out.slideInitialState = [
|
out.slideInitialState = [
|
||||||
'# CryptSlide\n',
|
'# CryptSlide\n',
|
||||||
'* This is a zero knowledge realtime collaborative editor.\n',
|
|
||||||
'* What you type here is encrypted so only people who have the link can access it.\n',
|
|
||||||
'* Even the server cannot see what you type.\n',
|
|
||||||
'* What you see here, what you hear here, when you leave here, let it stay here.\n',
|
|
||||||
'\n',
|
|
||||||
'---',
|
|
||||||
'\n',
|
|
||||||
'# How to use\n',
|
|
||||||
'1. Write your slides content using markdown syntax\n',
|
'1. Write your slides content using markdown syntax\n',
|
||||||
' - Learn more about markdown syntax [here](http://www.markdowntutorial.com/)\n',
|
' - Learn more about markdown syntax [here](http://www.markdowntutorial.com/)\n',
|
||||||
'2. Separate your slides with ---\n',
|
'2. Separate your slides with ---\n',
|
||||||
@ -883,6 +896,7 @@ define(function () {
|
|||||||
out.creation_createFromTemplate = "From template";
|
out.creation_createFromTemplate = "From template";
|
||||||
out.creation_createFromScratch = "From scratch";
|
out.creation_createFromScratch = "From scratch";
|
||||||
out.creation_settings = "New Pad settings";
|
out.creation_settings = "New Pad settings";
|
||||||
|
out.creation_saveSettings = "Save settings";
|
||||||
// Properties about creation data
|
// Properties about creation data
|
||||||
out.creation_owners = "Owners";
|
out.creation_owners = "Owners";
|
||||||
out.creation_ownedByOther = "Owned by another user";
|
out.creation_ownedByOther = "Owned by another user";
|
||||||
@ -890,7 +904,8 @@ define(function () {
|
|||||||
out.creation_expiration = "Expiration time";
|
out.creation_expiration = "Expiration time";
|
||||||
out.creation_propertiesTitle = "Availability";
|
out.creation_propertiesTitle = "Availability";
|
||||||
out.creation_appMenuName = "Advanced mode (Ctrl + E)";
|
out.creation_appMenuName = "Advanced mode (Ctrl + E)";
|
||||||
out.creation_newPadModalDescription = "Click on a pad type to create it. You can check the box if you want to display the pad creation screen (for owned pads, expiring pads, etc.).";
|
out.creation_newPadModalDescription = "Click on a pad type to create it. You can also press <b>Tab</b> to select the type and press <b>Enter</b> to confirm.";
|
||||||
|
out.creation_newPadModalDescriptionAdvanced = "You can check the box (or press <b>Space</b> to change its value) if you want to display the pad creation screen (for owned pads, expiring pads, etc.).";
|
||||||
out.creation_newPadModalAdvanced = "Display the pad creation screen";
|
out.creation_newPadModalAdvanced = "Display the pad creation screen";
|
||||||
|
|
||||||
// New share modal
|
// New share modal
|
||||||
|
|||||||
@ -486,13 +486,8 @@ define(function () {
|
|||||||
'<p>',
|
'<p>',
|
||||||
'This is <strong>CryptPad</strong>, the Zero Knowledge realtime collaborative editor. Everything is saved as you type.',
|
'This is <strong>CryptPad</strong>, the Zero Knowledge realtime collaborative editor. Everything is saved as you type.',
|
||||||
'<br>',
|
'<br>',
|
||||||
'Share the link to this pad to edit with friends or use the <span style="background-color:#5cb85c;color:#ffffff;"> Share </span> button to share a <em>read-only link</em> which allows viewing but not editing.',
|
'Share the link to this pad to edit with friends or use the <span class="fa fa-share-alt"></span> button to share a <em>read-only link</em> which allows viewing but not editing.',
|
||||||
'</p>',
|
'</p>',
|
||||||
|
|
||||||
'<p><span style="color:#808080;"><em>',
|
|
||||||
'Go ahead, just start typing...',
|
|
||||||
'</em></span></p>',
|
|
||||||
'<p> <br></p>'
|
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
out.codeInitialState = [
|
out.codeInitialState = [
|
||||||
@ -504,14 +499,6 @@ define(function () {
|
|||||||
|
|
||||||
out.slideInitialState = [
|
out.slideInitialState = [
|
||||||
'# CryptSlide\n',
|
'# CryptSlide\n',
|
||||||
'* This is a zero knowledge realtime collaborative editor.\n',
|
|
||||||
'* What you type here is encrypted so only people who have the link can access it.\n',
|
|
||||||
'* Even the server cannot see what you type.\n',
|
|
||||||
'* What you see here, what you hear here, when you leave here, let it stay here.\n',
|
|
||||||
'\n',
|
|
||||||
'---',
|
|
||||||
'\n',
|
|
||||||
'# How to use\n',
|
|
||||||
'1. Write your slides content using markdown syntax\n',
|
'1. Write your slides content using markdown syntax\n',
|
||||||
' - Learn more about markdown syntax [here](http://www.markdowntutorial.com/)\n',
|
' - Learn more about markdown syntax [here](http://www.markdowntutorial.com/)\n',
|
||||||
'2. Separate your slides with ---\n',
|
'2. Separate your slides with ---\n',
|
||||||
|
|||||||
@ -4,16 +4,6 @@ define(function () {
|
|||||||
out.main_title = "CryptPad: Zero Knowledge, Colaborare în timp real";
|
out.main_title = "CryptPad: Zero Knowledge, Colaborare în timp real";
|
||||||
out.main_slogan = "Puterea stă în cooperare - Colaborarea este cheia";
|
out.main_slogan = "Puterea stă în cooperare - Colaborarea este cheia";
|
||||||
|
|
||||||
out.type = {};
|
|
||||||
out.pad = "Rich text";
|
|
||||||
out.code = "Code";
|
|
||||||
out.poll = "Poll";
|
|
||||||
out.slide = "Presentation";
|
|
||||||
out.drive = "Drive";
|
|
||||||
out.whiteboard = "Whiteboard";
|
|
||||||
out.file = "File";
|
|
||||||
out.media = "Media";
|
|
||||||
|
|
||||||
out.button_newpad = "Filă Text Nouă";
|
out.button_newpad = "Filă Text Nouă";
|
||||||
out.button_newcode = "Filă Cod Nouă";
|
out.button_newcode = "Filă Cod Nouă";
|
||||||
out.button_newpoll = "Sondaj Nou";
|
out.button_newpoll = "Sondaj Nou";
|
||||||
@ -330,9 +320,9 @@ define(function () {
|
|||||||
out.header_france = "<a href=\"http://www.xwiki.com/\" target=\"_blank\" rel=\"noopener noreferrer\">With <img class=\"bottom-bar-heart\" src=\"/customize/heart.png\" alt=\"love\" /> from <img class=\"bottom-bar-fr\" src=\"/customize/fr.png\" title=\"Franța\" alt=\"Franța\"/> by <img src=\"/customize/logo-xwiki.png\" alt=\"XWiki SAS\" class=\"bottom-bar-xwiki\"/></a>";
|
out.header_france = "<a href=\"http://www.xwiki.com/\" target=\"_blank\" rel=\"noopener noreferrer\">With <img class=\"bottom-bar-heart\" src=\"/customize/heart.png\" alt=\"love\" /> from <img class=\"bottom-bar-fr\" src=\"/customize/fr.png\" title=\"Franța\" alt=\"Franța\"/> by <img src=\"/customize/logo-xwiki.png\" alt=\"XWiki SAS\" class=\"bottom-bar-xwiki\"/></a>";
|
||||||
out.header_support = "<a href=\"http://ng.open-paas.org/\" title=\"OpenPaaS::ng\" target=\"_blank\" rel=\"noopener noreferrer\"> <img src=\"/customize/openpaasng.png\" alt=\"OpenPaaS-ng\" class=\"bottom-bar-openpaas\" /></a>";
|
out.header_support = "<a href=\"http://ng.open-paas.org/\" title=\"OpenPaaS::ng\" target=\"_blank\" rel=\"noopener noreferrer\"> <img src=\"/customize/openpaasng.png\" alt=\"OpenPaaS-ng\" class=\"bottom-bar-openpaas\" /></a>";
|
||||||
out.header_logoTitle = "Mergi la pagina principală";
|
out.header_logoTitle = "Mergi la pagina principală";
|
||||||
out.initialState = "<p>Acesta este <strong>CryptPad</strong>, editorul colaborativ bazat pe tehnologia Zero Knowledge în timp real. Totul este salvat pe măsură ce scrii.<br>Partajează link-ul către acest pad pentru a edita cu prieteni sau folosește <span class=\"fa fa-share-alt\" style=\"border:1px solid black;color:#000;\"> Share </span> butonul pentru a partaja <em>read-only link</em> permițând vizualizarea dar nu și editarea.</p><p><em>Îndrăznește, începe să scrii...</em></p><p> <br></p>";
|
out.initialState = "<p>Acesta este <strong>CryptPad</strong>, editorul colaborativ bazat pe tehnologia Zero Knowledge în timp real. Totul este salvat pe măsură ce scrii.<br>Partajează link-ul către acest pad pentru a edita cu prieteni sau folosește <span class=\"fa fa-share-alt\"></span> butonul pentru a partaja <em>read-only link</em> permițând vizualizarea dar nu și editarea.</p>";
|
||||||
out.codeInitialState = "/*\n Acesta este editorul colaborativ de cod bazat pe tehnologia Zero Knowledge CryptPad.\n Ce scrii aici este criptat, așa că doar oamenii care au link-ul pot să-l acceseze.\n Poți să alegi ce limbaj de programare pus n evidență și schema de culori UI n dreapta sus.\n*/";
|
out.codeInitialState = "/*\n Acesta este editorul colaborativ de cod bazat pe tehnologia Zero Knowledge CryptPad.\n Ce scrii aici este criptat, așa că doar oamenii care au link-ul pot să-l acceseze.\n Poți să alegi ce limbaj de programare pus n evidență și schema de culori UI n dreapta sus.\n*/";
|
||||||
out.slideInitialState = "# CryptSlide\n* Acesta este un editor colaborativ bazat pe tehnologia Zero Knowledge.\n* Ce scrii aici este criptat, așa că doar oamenii care au link-ul pot să-l acceseze.\n* Nici măcar serverele nu au acces la ce scrii tu.\n* Ce vezi aici, ce auzi aici, atunci când pleci, lași aici.\n\n-\n# Cum se folosește\n1. Scrie-ți conținutul slide-urilor folosind sintaxa markdown\n - Află mai multe despre sintaxa markdown [aici](http://www.markdowntutorial.com/)\n2. Separă-ți slide-urile cu -\n3. Click pe butonul \"Play\" pentru a vedea rezultatele - Slide-urile tale sunt actualizate în timp real.";
|
out.slideInitialState = "# CryptSlide\n1. Scrie-ți conținutul slide-urilor folosind sintaxa markdown\n - Află mai multe despre sintaxa markdown [aici](http://www.markdowntutorial.com/)\n2. Separă-ți slide-urile cu ---\n3. Click pe butonul \"Play\" pentru a vedea rezultatele - Slide-urile tale sunt actualizate în timp real.";
|
||||||
out.driveReadmeTitle = "Ce este CryptPad?";
|
out.driveReadmeTitle = "Ce este CryptPad?";
|
||||||
out.readme_welcome = "Bine ai venit n CryptPad !";
|
out.readme_welcome = "Bine ai venit n CryptPad !";
|
||||||
out.readme_p1 = "Bine ai venit în CryptPad, acesta este locul unde îți poți lua notițe, singur sau cu prietenii.";
|
out.readme_p1 = "Bine ai venit în CryptPad, acesta este locul unde îți poți lua notițe, singur sau cu prietenii.";
|
||||||
|
|||||||
@ -469,13 +469,8 @@ define(function () {
|
|||||||
'<p>',
|
'<p>',
|
||||||
'這是 <strong>CryptPad</strong>, 零知識即時協作編輯平台,當你輸入時一切已即存好。',
|
'這是 <strong>CryptPad</strong>, 零知識即時協作編輯平台,當你輸入時一切已即存好。',
|
||||||
'<br>',
|
'<br>',
|
||||||
'分享這個工作檔案的網址連結給友人或是使用、 <span class="fa fa-share-alt" style="border: 1px solid black;color:#000;"> 分享 </span> 按鈕分享<em>唯讀的連結</em> 其只能看不能編寫。',
|
'分享這個工作檔案的網址連結給友人或是使用、 <span class="fa fa-share-alt"></span> 按鈕分享<em>唯讀的連結</em> 其只能看不能編寫。',
|
||||||
'</p>',
|
'</p>'
|
||||||
|
|
||||||
'<p><em>',
|
|
||||||
'來吧, 開始打字輸入吧...',
|
|
||||||
'</em></p>',
|
|
||||||
'<p> <br></p>'
|
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
out.codeInitialState = [
|
out.codeInitialState = [
|
||||||
@ -487,14 +482,6 @@ define(function () {
|
|||||||
|
|
||||||
out.slideInitialState = [
|
out.slideInitialState = [
|
||||||
'# CryptSlide\n',
|
'# CryptSlide\n',
|
||||||
'* 它是零知識即時協作編輯平台。\n',
|
|
||||||
'* 你所輸入的東西會予以加密,僅有知道此網頁連結者可以接取這份文件。\n',
|
|
||||||
'* 即便是本站伺服器也不知道你輸入了什麼內容。\n',
|
|
||||||
'* 你在這裏看到的、你在這裏聽到的、當你離開本站時,讓它就留在這裏吧。\n',
|
|
||||||
'\n',
|
|
||||||
'---',
|
|
||||||
'\n',
|
|
||||||
'# 如何使用\n',
|
|
||||||
'1. 使用 markdown 語法來寫下你的投影片內容\n',
|
'1. 使用 markdown 語法來寫下你的投影片內容\n',
|
||||||
' - 進一步學習 markdown 語法 [here](http://www.markdowntutorial.com/)\n',
|
' - 進一步學習 markdown 語法 [here](http://www.markdowntutorial.com/)\n',
|
||||||
'2. 利用 --- 來區隔不同的投影片\n',
|
'2. 利用 --- 來區隔不同的投影片\n',
|
||||||
|
|||||||
40
delete-inactive.js
Normal file
40
delete-inactive.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/* jshint esversion: 6, node: true */
|
||||||
|
const Fs = require("fs");
|
||||||
|
const nThen = require("nthen");
|
||||||
|
const Saferphore = require("saferphore");
|
||||||
|
const PinnedData = require('./pinneddata');
|
||||||
|
let config;
|
||||||
|
try {
|
||||||
|
config = require('./config');
|
||||||
|
} catch (e) {
|
||||||
|
config = require('./config.example');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!config.inactiveTime || typeof(config.inactiveTime) !== "number") { return; }
|
||||||
|
|
||||||
|
let inactiveTime = +new Date() - (config.inactiveTime * 24 * 3600 * 1000);
|
||||||
|
let inactiveConfig = {
|
||||||
|
unpinned: true,
|
||||||
|
olderthan: inactiveTime,
|
||||||
|
blobsolderthan: inactiveTime
|
||||||
|
};
|
||||||
|
let toDelete;
|
||||||
|
nThen(function (waitFor) {
|
||||||
|
PinnedData.load(inactiveConfig, waitFor(function (err, data) {
|
||||||
|
if (err) {
|
||||||
|
waitFor.abort();
|
||||||
|
throw new Error(err);
|
||||||
|
}
|
||||||
|
toDelete = data;
|
||||||
|
}));
|
||||||
|
}).nThen(function () {
|
||||||
|
var sem = Saferphore.create(10);
|
||||||
|
toDelete.forEach(function (f) {
|
||||||
|
sem.take(function (give) {
|
||||||
|
Fs.unlink(f.filename, give(function (err) {
|
||||||
|
if (err) { return void console.error(err + " " + f.filename); }
|
||||||
|
console.log(f.filename + " " + f.size + " " + (+f.atime) + " " + (+new Date()));
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -7,7 +7,6 @@ var config;
|
|||||||
try {
|
try {
|
||||||
config = require('./config');
|
config = require('./config');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("You can customize the configuration by copying config.example.js to config.js");
|
|
||||||
config = require('./config.example');
|
config = require('./config.example');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "cryptpad",
|
"name": "cryptpad",
|
||||||
"description": "realtime collaborative visual editor with zero knowlege server",
|
"description": "realtime collaborative visual editor with zero knowlege server",
|
||||||
"version": "1.26.0",
|
"version": "1.27.0",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chainpad-server": "^2.0.0",
|
"chainpad-server": "^2.0.0",
|
||||||
"express": "~4.10.1",
|
"express": "~4.16.0",
|
||||||
"nthen": "~0.1.0",
|
"nthen": "~0.1.0",
|
||||||
"pull-stream": "^3.6.1",
|
"pull-stream": "^3.6.1",
|
||||||
"replify": "^1.2.0",
|
"replify": "^1.2.0",
|
||||||
|
|||||||
@ -47,12 +47,13 @@ const dsFileStats = {};
|
|||||||
const out = [];
|
const out = [];
|
||||||
const pinned = {};
|
const pinned = {};
|
||||||
|
|
||||||
nThen((waitFor) => {
|
module.exports.load = function (config, cb) {
|
||||||
|
nThen((waitFor) => {
|
||||||
Fs.readdir('./datastore', waitFor((err, list) => {
|
Fs.readdir('./datastore', waitFor((err, list) => {
|
||||||
if (err) { throw err; }
|
if (err) { throw err; }
|
||||||
dirList = list;
|
dirList = list;
|
||||||
}));
|
}));
|
||||||
}).nThen((waitFor) => {
|
}).nThen((waitFor) => {
|
||||||
dirList.forEach((f) => {
|
dirList.forEach((f) => {
|
||||||
sema.take((returnAfter) => {
|
sema.take((returnAfter) => {
|
||||||
Fs.readdir('./datastore/' + f, waitFor(returnAfter((err, list2) => {
|
Fs.readdir('./datastore/' + f, waitFor(returnAfter((err, list2) => {
|
||||||
@ -61,13 +62,13 @@ nThen((waitFor) => {
|
|||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}).nThen((waitFor) => {
|
}).nThen((waitFor) => {
|
||||||
|
|
||||||
Fs.readdir('./blob', waitFor((err, list) => {
|
Fs.readdir('./blob', waitFor((err, list) => {
|
||||||
if (err) { throw err; }
|
if (err) { throw err; }
|
||||||
dirList = list;
|
dirList = list;
|
||||||
}));
|
}));
|
||||||
}).nThen((waitFor) => {
|
}).nThen((waitFor) => {
|
||||||
dirList.forEach((f) => {
|
dirList.forEach((f) => {
|
||||||
sema.take((returnAfter) => {
|
sema.take((returnAfter) => {
|
||||||
Fs.readdir('./blob/' + f, waitFor(returnAfter((err, list2) => {
|
Fs.readdir('./blob/' + f, waitFor(returnAfter((err, list2) => {
|
||||||
@ -76,7 +77,7 @@ nThen((waitFor) => {
|
|||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}).nThen((waitFor) => {
|
}).nThen((waitFor) => {
|
||||||
fileList.forEach((f) => {
|
fileList.forEach((f) => {
|
||||||
sema.take((returnAfter) => {
|
sema.take((returnAfter) => {
|
||||||
Fs.stat(f, waitFor(returnAfter((err, st) => {
|
Fs.stat(f, waitFor(returnAfter((err, st) => {
|
||||||
@ -86,12 +87,12 @@ nThen((waitFor) => {
|
|||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}).nThen((waitFor) => {
|
}).nThen((waitFor) => {
|
||||||
Fs.readdir('./pins', waitFor((err, list) => {
|
Fs.readdir('./pins', waitFor((err, list) => {
|
||||||
if (err) { throw err; }
|
if (err) { throw err; }
|
||||||
dirList = list;
|
dirList = list;
|
||||||
}));
|
}));
|
||||||
}).nThen((waitFor) => {
|
}).nThen((waitFor) => {
|
||||||
fileList.splice(0, fileList.length);
|
fileList.splice(0, fileList.length);
|
||||||
dirList.forEach((f) => {
|
dirList.forEach((f) => {
|
||||||
sema.take((returnAfter) => {
|
sema.take((returnAfter) => {
|
||||||
@ -101,14 +102,14 @@ nThen((waitFor) => {
|
|||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}).nThen((waitFor) => {
|
}).nThen((waitFor) => {
|
||||||
fileList.forEach((f) => {
|
fileList.forEach((f) => {
|
||||||
sema.take((returnAfter) => {
|
sema.take((returnAfter) => {
|
||||||
Fs.readFile(f, waitFor(returnAfter((err, content) => {
|
Fs.readFile(f, waitFor(returnAfter((err, content) => {
|
||||||
if (err) { throw err; }
|
if (err) { throw err; }
|
||||||
const hashes = hashesFromPinFile(content.toString('utf8'), f);
|
const hashes = hashesFromPinFile(content.toString('utf8'), f);
|
||||||
const size = sizeForHashes(hashes, dsFileStats);
|
const size = sizeForHashes(hashes, dsFileStats);
|
||||||
if (process.argv.indexOf('--unpinned') > -1) {
|
if (config.unpinned) {
|
||||||
hashes.forEach((x) => { pinned[x] = 1; });
|
hashes.forEach((x) => { pinned[x] = 1; });
|
||||||
} else {
|
} else {
|
||||||
out.push([f, Math.floor(size / (1024 * 1024))]);
|
out.push([f, Math.floor(size / (1024 * 1024))]);
|
||||||
@ -116,34 +117,56 @@ nThen((waitFor) => {
|
|||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}).nThen(() => {
|
}).nThen(() => {
|
||||||
if (process.argv.indexOf('--unpinned') > -1) {
|
if (config.unpinned) {
|
||||||
const ot = process.argv.indexOf('--olderthan');
|
|
||||||
let before = Infinity;
|
let before = Infinity;
|
||||||
if (ot > -1) {
|
if (config.olderthan) {
|
||||||
before = new Date(process.argv[ot+1]);
|
before = config.olderthan;
|
||||||
if (isNaN(before)) {
|
if (isNaN(before)) {
|
||||||
throw new Error('--olderthan error [' + process.argv[ot+1] + '] not a valid date');
|
return void cb('--olderthan error [' + config.olderthan + '] not a valid date');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const bot = process.argv.indexOf('--blobsolderthan');
|
|
||||||
let blobsbefore = before;
|
let blobsbefore = before;
|
||||||
if (bot > -1) {
|
if (config.blobsolderthan) {
|
||||||
blobsbefore = new Date(process.argv[bot+1]);
|
blobsbefore = config.blobsolderthan;
|
||||||
if (isNaN(blobsbefore)) {
|
if (isNaN(blobsbefore)) {
|
||||||
throw new Error('--blobsolderthan error [' + process.argv[bot+1] + '] not a valid date');
|
return void cb('--blobsolderthan error [' + config.blobsolderthan + '] not a valid date');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let files = [];
|
||||||
Object.keys(dsFileStats).forEach((f) => {
|
Object.keys(dsFileStats).forEach((f) => {
|
||||||
if (!(f in pinned)) {
|
if (!(f in pinned)) {
|
||||||
const isBlob = dsFileStats[f].filename.indexOf('.ndjson') === -1;
|
const isBlob = dsFileStats[f].filename.indexOf('.ndjson') === -1;
|
||||||
if ((+dsFileStats[f].mtime) >= ((isBlob) ? blobsbefore : before)) { return; }
|
if ((+dsFileStats[f].atime) >= ((isBlob) ? blobsbefore : before)) { return; }
|
||||||
console.log(dsFileStats[f].filename + " " + dsFileStats[f].size + " " +
|
files.push({
|
||||||
(+dsFileStats[f].mtime));
|
filename: dsFileStats[f].filename,
|
||||||
|
size: dsFileStats[f].size,
|
||||||
|
atime: dsFileStats[f].atime
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
cb(null, files);
|
||||||
} else {
|
} else {
|
||||||
out.sort((a,b) => (a[1] - b[1]));
|
out.sort((a,b) => (a[1] - b[1]));
|
||||||
out.forEach((x) => { console.log(x[0] + ' ' + x[1] + ' MB'); });
|
cb(null, out.slice());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!module.parent) {
|
||||||
|
let config = {};
|
||||||
|
if (process.argv.indexOf('--unpinned') > -1) { config.unpinned = true; }
|
||||||
|
const ot = process.argv.indexOf('--olderthan');
|
||||||
|
config.olderthan = ot > -1 && new Date(process.argv[ot+1]);
|
||||||
|
const bot = process.argv.indexOf('--blobsolderthan');
|
||||||
|
config.blobsolderthan = bot > -1 && new Date(process.argv[bot+1]);
|
||||||
|
module.exports.load(config, function (err, data) {
|
||||||
|
if (err) { throw new Error(err); }
|
||||||
|
if (!Array.isArray(data)) { return; }
|
||||||
|
if (config.unpinned) {
|
||||||
|
data.forEach((f) => { console.log(f.filename + " " + f.size + " " + (+f.atime)); });
|
||||||
|
} else {
|
||||||
|
data.forEach((x) => { console.log(x[0] + ' ' + x[1] + ' MB'); });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@ -74,6 +74,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.markdown_main();
|
.markdown_main();
|
||||||
|
.cp-app-code-preview-empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
&.cp-app-code-preview-isempty {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
#cp-app-code-preview-content {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.cp-app-code-preview-empty {
|
||||||
|
//flex: 1 1 auto;
|
||||||
|
max-height: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
display: block;
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#cp-app-code-preview-content {
|
#cp-app-code-preview-content {
|
||||||
|
|||||||
@ -54,6 +54,7 @@ define([
|
|||||||
|
|
||||||
var MEDIA_TAG_MODES = Object.freeze([
|
var MEDIA_TAG_MODES = Object.freeze([
|
||||||
'markdown',
|
'markdown',
|
||||||
|
'gfm',
|
||||||
'html',
|
'html',
|
||||||
'htmlembedded',
|
'htmlembedded',
|
||||||
'htmlmixed',
|
'htmlmixed',
|
||||||
@ -63,6 +64,31 @@ define([
|
|||||||
'xml',
|
'xml',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
var mkMarkdownTb = function (editor, framework) {
|
||||||
|
var $codeMirrorContainer = $('#cp-app-code-container');
|
||||||
|
var markdownTb = framework._.sfCommon.createMarkdownToolbar(editor);
|
||||||
|
$codeMirrorContainer.prepend(markdownTb.toolbar);
|
||||||
|
|
||||||
|
framework._.toolbar.$rightside.append(markdownTb.button);
|
||||||
|
|
||||||
|
var modeChange = function (mode) {
|
||||||
|
if (['markdown', 'gfm'].indexOf(mode) !== -1) { return void markdownTb.setState(true); }
|
||||||
|
markdownTb.setState(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
modeChange: modeChange
|
||||||
|
};
|
||||||
|
};
|
||||||
|
var mkHelpMenu = function (framework) {
|
||||||
|
var $codeMirrorContainer = $('#cp-app-code-container');
|
||||||
|
var helpMenu = framework._.sfCommon.createHelpMenu();
|
||||||
|
$codeMirrorContainer.prepend(helpMenu.menu);
|
||||||
|
|
||||||
|
$(helpMenu.text).html(DiffMd.render(Messages.codeInitialState));
|
||||||
|
|
||||||
|
framework._.toolbar.$drawer.append(helpMenu.button);
|
||||||
|
};
|
||||||
var mkPreviewPane = function (editor, CodeMirror, framework, isPresentMode) {
|
var mkPreviewPane = function (editor, CodeMirror, framework, isPresentMode) {
|
||||||
var $previewContainer = $('#cp-app-code-preview');
|
var $previewContainer = $('#cp-app-code-preview');
|
||||||
var $preview = $('#cp-app-code-preview-content');
|
var $preview = $('#cp-app-code-preview-content');
|
||||||
@ -70,12 +96,20 @@ define([
|
|||||||
var $codeMirrorContainer = $('#cp-app-code-container');
|
var $codeMirrorContainer = $('#cp-app-code-container');
|
||||||
var $codeMirror = $('.CodeMirror');
|
var $codeMirror = $('.CodeMirror');
|
||||||
|
|
||||||
var markdownTb = framework._.sfCommon.createMarkdownToolbar(editor);
|
$('<img>', {
|
||||||
$codeMirrorContainer.prepend(markdownTb.toolbar);
|
src: '/customize/main-favicon.png',
|
||||||
|
alt: '',
|
||||||
|
class: 'cp-app-code-preview-empty'
|
||||||
|
}).appendTo($previewContainer);
|
||||||
|
|
||||||
var $previewButton = framework._.sfCommon.createButton(null, true);
|
var $previewButton = framework._.sfCommon.createButton('preview', true);
|
||||||
var forceDrawPreview = function () {
|
var forceDrawPreview = function () {
|
||||||
try {
|
try {
|
||||||
|
if (editor.getValue() === '') {
|
||||||
|
$previewContainer.addClass('cp-app-code-preview-isempty');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$previewContainer.removeClass('cp-app-code-preview-isempty');
|
||||||
DiffMd.apply(DiffMd.render(editor.getValue()), $preview);
|
DiffMd.apply(DiffMd.render(editor.getValue()), $preview);
|
||||||
} catch (e) { console.error(e); }
|
} catch (e) { console.error(e); }
|
||||||
};
|
};
|
||||||
@ -85,12 +119,6 @@ define([
|
|||||||
forceDrawPreview();
|
forceDrawPreview();
|
||||||
}, 150);
|
}, 150);
|
||||||
|
|
||||||
$previewButton.removeClass('fa-question').addClass('fa-eye');
|
|
||||||
window.setTimeout(function () {
|
|
||||||
// setTimeout needed for tippy (tooltip), otherwise we have the browser's default
|
|
||||||
// tooltips
|
|
||||||
$previewButton.attr('title', Messages.previewButtonTitle);
|
|
||||||
});
|
|
||||||
var previewTo;
|
var previewTo;
|
||||||
$previewButton.click(function () {
|
$previewButton.click(function () {
|
||||||
clearTimeout(previewTo);
|
clearTimeout(previewTo);
|
||||||
@ -118,7 +146,7 @@ define([
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
framework._.toolbar.$rightside.append($previewButton).append(markdownTb.button);
|
framework._.toolbar.$rightside.append($previewButton);
|
||||||
|
|
||||||
$preview.click(function (e) {
|
$preview.click(function (e) {
|
||||||
if (!e.target) { return; }
|
if (!e.target) { return; }
|
||||||
@ -145,7 +173,6 @@ define([
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
markdownTb.setState(true);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$editorContainer.removeClass('cp-app-code-present');
|
$editorContainer.removeClass('cp-app-code-present');
|
||||||
@ -153,7 +180,6 @@ define([
|
|||||||
$previewContainer.hide();
|
$previewContainer.hide();
|
||||||
$previewButton.removeClass('active');
|
$previewButton.removeClass('active');
|
||||||
$codeMirrorContainer.addClass('cp-app-code-fullpage');
|
$codeMirrorContainer.addClass('cp-app-code-fullpage');
|
||||||
markdownTb.setState(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var isVisible = function () {
|
var isVisible = function () {
|
||||||
@ -252,8 +278,12 @@ define([
|
|||||||
var common = framework._.sfCommon;
|
var common = framework._.sfCommon;
|
||||||
|
|
||||||
var previewPane = mkPreviewPane(editor, CodeMirror, framework, isPresentMode);
|
var previewPane = mkPreviewPane(editor, CodeMirror, framework, isPresentMode);
|
||||||
|
var markdownTb = mkMarkdownTb(editor, framework);
|
||||||
|
mkHelpMenu(framework);
|
||||||
|
|
||||||
var evModeChange = Util.mkEvent();
|
var evModeChange = Util.mkEvent();
|
||||||
evModeChange.reg(previewPane.modeChange);
|
evModeChange.reg(previewPane.modeChange);
|
||||||
|
evModeChange.reg(markdownTb.modeChange);
|
||||||
|
|
||||||
mkIndentSettings(editor, framework._.cpNfInner.metadataMgr);
|
mkIndentSettings(editor, framework._.cpNfInner.metadataMgr);
|
||||||
CodeMirror.init(framework.localChange, framework._.title, framework._.toolbar);
|
CodeMirror.init(framework.localChange, framework._.title, framework._.toolbar);
|
||||||
@ -292,6 +322,8 @@ define([
|
|||||||
framework.setTitleRecommender(CodeMirror.getHeadingText);
|
framework.setTitleRecommender(CodeMirror.getHeadingText);
|
||||||
|
|
||||||
framework.onReady(function (newPad) {
|
framework.onReady(function (newPad) {
|
||||||
|
editor.focus();
|
||||||
|
|
||||||
if (newPad && !CodeMirror.highlightMode) {
|
if (newPad && !CodeMirror.highlightMode) {
|
||||||
CodeMirror.setMode('gfm', evModeChange.fire);
|
CodeMirror.setMode('gfm', evModeChange.fire);
|
||||||
//console.log("%s => %s", CodeMirror.highlightMode, CodeMirror.$language.val());
|
//console.log("%s => %s", CodeMirror.highlightMode, CodeMirror.$language.val());
|
||||||
@ -315,7 +347,7 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
framework.onDefaultContentNeeded(function () {
|
framework.onDefaultContentNeeded(function () {
|
||||||
editor.setValue(Messages.codeInitialState);
|
editor.setValue(''); //Messages.codeInitialState);
|
||||||
});
|
});
|
||||||
|
|
||||||
framework.setFileExporter(CodeMirror.getContentExtension, CodeMirror.fileExporter);
|
framework.setFileExporter(CodeMirror.getContentExtension, CodeMirror.fileExporter);
|
||||||
@ -335,13 +367,9 @@ define([
|
|||||||
|
|
||||||
var getThumbnailContainer = function () {
|
var getThumbnailContainer = function () {
|
||||||
var $preview = $('#cp-app-code-preview-content');
|
var $preview = $('#cp-app-code-preview-content');
|
||||||
var $codeMirror = $('.CodeMirror');
|
|
||||||
if ($preview.length && $preview.is(':visible')) {
|
if ($preview.length && $preview.is(':visible')) {
|
||||||
return $preview[0];
|
return $preview[0];
|
||||||
}
|
}
|
||||||
if ($codeMirror.length) {
|
|
||||||
return $codeMirror[0];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var main = function () {
|
var main = function () {
|
||||||
|
|||||||
@ -555,8 +555,11 @@ define([
|
|||||||
$loading = $('#' + LOADING); //.show();
|
$loading = $('#' + LOADING); //.show();
|
||||||
$loading.css('display', '');
|
$loading.css('display', '');
|
||||||
$loading.removeClass('cp-loading-hidden');
|
$loading.removeClass('cp-loading-hidden');
|
||||||
|
$('.cp-loading-spinner-container').show();
|
||||||
if (loadingText) {
|
if (loadingText) {
|
||||||
$('#' + LOADING).find('p').text(loadingText);
|
$('#' + LOADING).find('p').text(loadingText);
|
||||||
|
} else {
|
||||||
|
$('#' + LOADING).find('p').text('');
|
||||||
}
|
}
|
||||||
$container = $loading.find('.cp-loading-container');
|
$container = $loading.find('.cp-loading-container');
|
||||||
} else {
|
} else {
|
||||||
@ -612,7 +615,10 @@ define([
|
|||||||
if (exitable) {
|
if (exitable) {
|
||||||
$(window).focus();
|
$(window).focus();
|
||||||
$(window).keydown(function (e) {
|
$(window).keydown(function (e) {
|
||||||
if (e.which === 27) { $('#' + LOADING).hide(); }
|
if (e.which === 27) {
|
||||||
|
$('#' + LOADING).hide();
|
||||||
|
if (typeof(exitable) === "function") { exitable(); }
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -662,7 +668,6 @@ define([
|
|||||||
position: 'bottom',
|
position: 'bottom',
|
||||||
distance: 0,
|
distance: 0,
|
||||||
performance: true,
|
performance: true,
|
||||||
dynamicTitle: true,
|
|
||||||
delay: [delay, 0],
|
delay: [delay, 0],
|
||||||
sticky: true
|
sticky: true
|
||||||
});
|
});
|
||||||
@ -672,6 +677,12 @@ define([
|
|||||||
setInterval(UI.clearTooltips, delay);
|
setInterval(UI.clearTooltips, delay);
|
||||||
var checkRemoved = function (x) {
|
var checkRemoved = function (x) {
|
||||||
var out = false;
|
var out = false;
|
||||||
|
var xId = $(x).attr('aria-describedby');
|
||||||
|
if (xId) {
|
||||||
|
if (xId.indexOf('tippy-tooltip-') === 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
$(x).find('[aria-describedby]').each(function (i, el) {
|
$(x).find('[aria-describedby]').each(function (i, el) {
|
||||||
var id = el.getAttribute('aria-describedby');
|
var id = el.getAttribute('aria-describedby');
|
||||||
if (id.indexOf('tippy-tooltip-') !== 0) { return; }
|
if (id.indexOf('tippy-tooltip-') !== 0) { return; }
|
||||||
@ -685,6 +696,9 @@ define([
|
|||||||
mutations.forEach(function(mutation) {
|
mutations.forEach(function(mutation) {
|
||||||
if (mutation.type === "childList") {
|
if (mutation.type === "childList") {
|
||||||
for (var i = 0; i < mutation.addedNodes.length; i++) {
|
for (var i = 0; i < mutation.addedNodes.length; i++) {
|
||||||
|
if ($(mutation.addedNodes[i]).attr('title')) {
|
||||||
|
addTippy(0, mutation.addedNodes[i]);
|
||||||
|
}
|
||||||
$(mutation.addedNodes[i]).find('[title]').each(addTippy);
|
$(mutation.addedNodes[i]).find('[title]').each(addTippy);
|
||||||
}
|
}
|
||||||
for (var j = 0; j < mutation.removedNodes.length; j++) {
|
for (var j = 0; j < mutation.removedNodes.length; j++) {
|
||||||
|
|||||||
@ -177,6 +177,7 @@ define([
|
|||||||
window.html2canvas = undefined;
|
window.html2canvas = undefined;
|
||||||
Thumb.fromDOM = function (opts, cb) {
|
Thumb.fromDOM = function (opts, cb) {
|
||||||
var element = opts.getContainer();
|
var element = opts.getContainer();
|
||||||
|
if (!element) { return; }
|
||||||
var todo = function () {
|
var todo = function () {
|
||||||
if (opts.filter) { opts.filter(element, true); }
|
if (opts.filter) { opts.filter(element, true); }
|
||||||
window.html2canvas(element, {
|
window.html2canvas(element, {
|
||||||
@ -202,8 +203,8 @@ define([
|
|||||||
var mkThumbnail = function () {
|
var mkThumbnail = function () {
|
||||||
var content = opts.getContent();
|
var content = opts.getContent();
|
||||||
if (content === oldThumbnailState) { return; }
|
if (content === oldThumbnailState) { return; }
|
||||||
Thumb.fromDOM(opts, function (err, b64) {
|
|
||||||
oldThumbnailState = content;
|
oldThumbnailState = content;
|
||||||
|
Thumb.fromDOM(opts, function (err, b64) {
|
||||||
Thumb.setPadThumbnail(common, opts.href, b64);
|
Thumb.setPadThumbnail(common, opts.href, b64);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -463,12 +463,11 @@ define([
|
|||||||
UIElements.createButton = function (common, type, rightside, data, callback) {
|
UIElements.createButton = function (common, type, rightside, data, callback) {
|
||||||
var AppConfig = common.getAppConfig();
|
var AppConfig = common.getAppConfig();
|
||||||
var button;
|
var button;
|
||||||
var size = "17px";
|
|
||||||
var sframeChan = common.getSframeChannel();
|
var sframeChan = common.getSframeChannel();
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'export':
|
case 'export':
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
'class': 'fa fa-download',
|
'class': 'fa fa-download cp-toolbar-icon-export',
|
||||||
title: Messages.exportButtonTitle,
|
title: Messages.exportButtonTitle,
|
||||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.exportButton));
|
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.exportButton));
|
||||||
|
|
||||||
@ -479,7 +478,7 @@ define([
|
|||||||
break;
|
break;
|
||||||
case 'import':
|
case 'import':
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
'class': 'fa fa-upload',
|
'class': 'fa fa-upload cp-toolbar-icon-import',
|
||||||
title: Messages.importButtonTitle,
|
title: Messages.importButtonTitle,
|
||||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.importButton));
|
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.importButton));
|
||||||
if (callback) {
|
if (callback) {
|
||||||
@ -525,7 +524,8 @@ define([
|
|||||||
if (!common.isLoggedIn()) { return; }
|
if (!common.isLoggedIn()) { return; }
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
title: Messages.saveTemplateButton,
|
title: Messages.saveTemplateButton,
|
||||||
}).append($('<span>', {'class':'fa fa-bookmark', style: 'font:'+size+' FontAwesome'}));
|
class: 'fa fa-bookmark cp-toolbar-icon-template'
|
||||||
|
});
|
||||||
if (data.rt) {
|
if (data.rt) {
|
||||||
button
|
button
|
||||||
.click(function () {
|
.click(function () {
|
||||||
@ -570,12 +570,10 @@ define([
|
|||||||
break;
|
break;
|
||||||
case 'forget':
|
case 'forget':
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
id: 'cryptpad-forget',
|
|
||||||
title: Messages.forgetButtonTitle,
|
title: Messages.forgetButtonTitle,
|
||||||
'class': "fa fa-trash cryptpad-forget",
|
'class': "fa fa-trash cp-toolbar-icon-forget"
|
||||||
style: 'font:'+size+' FontAwesome'
|
|
||||||
});
|
});
|
||||||
if (callback) {
|
callback = typeof callback === "function" ? callback : function () {};
|
||||||
button
|
button
|
||||||
.click(common.prepareFeedback(type))
|
.click(common.prepareFeedback(type))
|
||||||
.click(function() {
|
.click(function() {
|
||||||
@ -590,17 +588,26 @@ define([
|
|||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'present':
|
case 'present':
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
title: Messages.presentButtonTitle,
|
title: Messages.presentButtonTitle,
|
||||||
'class': "fa fa-play-circle cp-app-slide-present-button", // used in slide.js
|
'class': "fa fa-play-circle cp-toolbar-icon-present", // used in slide.js
|
||||||
style: 'font:'+size+' FontAwesome'
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'preview':
|
||||||
|
button = $('<button>', {
|
||||||
|
title: Messages.previewButtonTitle,
|
||||||
|
'class': "fa fa-eye cp-toolbar-icon-preview",
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'print':
|
||||||
|
button = $('<button>', {
|
||||||
|
title: Messages.printButtonTitle,
|
||||||
|
'class': "fa fa-print cp-toolbar-icon-print",
|
||||||
|
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.printText));
|
||||||
|
break;
|
||||||
case 'history':
|
case 'history':
|
||||||
if (!AppConfig.enableHistory) {
|
if (!AppConfig.enableHistory) {
|
||||||
button = $('<span>');
|
button = $('<span>');
|
||||||
@ -608,7 +615,7 @@ define([
|
|||||||
}
|
}
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
title: Messages.historyButton,
|
title: Messages.historyButton,
|
||||||
'class': "fa fa-history history",
|
'class': "fa fa-history cp-toolbar-icon-history",
|
||||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.historyText));
|
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.historyText));
|
||||||
if (data.histConfig) {
|
if (data.histConfig) {
|
||||||
button
|
button
|
||||||
@ -622,19 +629,25 @@ define([
|
|||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
title: Messages.moreActions,
|
title: Messages.moreActions,
|
||||||
'class': "cp-toolbar-drawer-button fa fa-ellipsis-h",
|
'class': "cp-toolbar-drawer-button fa fa-ellipsis-h",
|
||||||
style: 'font:'+size+' FontAwesome'
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'mediatag':
|
||||||
|
button = $('<button>', {
|
||||||
|
'class': 'fa fa-picture-o cp-toolbar-icon-mediatag',
|
||||||
|
title: Messages.filePickerButton,
|
||||||
|
})
|
||||||
|
.click(common.prepareFeedback(type));
|
||||||
|
break;
|
||||||
case 'savetodrive':
|
case 'savetodrive':
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
'class': 'fa fa-cloud-upload',
|
'class': 'fa fa-cloud-upload cp-toolbar-icon-savetodrive',
|
||||||
title: Messages.canvas_saveToDrive,
|
title: Messages.canvas_saveToDrive,
|
||||||
})
|
})
|
||||||
.click(common.prepareFeedback(type));
|
.click(common.prepareFeedback(type));
|
||||||
break;
|
break;
|
||||||
case 'hashtag':
|
case 'hashtag':
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
'class': 'fa fa-hashtag',
|
'class': 'fa fa-hashtag cp-toolbar-icon-hashtag',
|
||||||
title: Messages.tags_title,
|
title: Messages.tags_title,
|
||||||
})
|
})
|
||||||
.click(common.prepareFeedback(type))
|
.click(common.prepareFeedback(type))
|
||||||
@ -642,7 +655,7 @@ define([
|
|||||||
break;
|
break;
|
||||||
case 'toggle':
|
case 'toggle':
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
'class': 'fa fa-caret-down',
|
'class': 'fa fa-caret-down cp-toolbar-icon-toggle',
|
||||||
})
|
})
|
||||||
.click(common.prepareFeedback(type));
|
.click(common.prepareFeedback(type));
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
@ -657,13 +670,18 @@ define([
|
|||||||
data.element.toggle();
|
data.element.toggle();
|
||||||
var isVisible = data.element.is(':visible');
|
var isVisible = data.element.is(':visible');
|
||||||
if (callback) { callback(isVisible); }
|
if (callback) { callback(isVisible); }
|
||||||
|
if (isVisible) {
|
||||||
|
button.addClass('cp-toolbar-button-active');
|
||||||
|
} else {
|
||||||
|
button.removeClass('cp-toolbar-button-active');
|
||||||
|
}
|
||||||
updateIcon(isVisible);
|
updateIcon(isVisible);
|
||||||
});
|
});
|
||||||
updateIcon(data.element.is(':visible'));
|
updateIcon(data.element.is(':visible'));
|
||||||
break;
|
break;
|
||||||
case 'properties':
|
case 'properties':
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
'class': 'fa fa-info-circle',
|
'class': 'fa fa-info-circle cp-toolbar-icon-properties',
|
||||||
title: Messages.propertiesButtonTitle,
|
title: Messages.propertiesButtonTitle,
|
||||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'})
|
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'})
|
||||||
.text(Messages.propertiesButton))
|
.text(Messages.propertiesButton))
|
||||||
@ -679,11 +697,24 @@ define([
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
data = data || {};
|
||||||
|
var icon = data.icon || "fa-question";
|
||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
'class': "fa fa-question",
|
'class': "fa " + icon,
|
||||||
style: 'font:'+size+' FontAwesome'
|
|
||||||
})
|
})
|
||||||
.click(common.prepareFeedback(type));
|
.click(common.prepareFeedback(type));
|
||||||
|
if (data.title) { button.attr('title', data.title); }
|
||||||
|
if (data.style) { button.attr('style', data.style); }
|
||||||
|
if (data.id) { button.attr('id', data.id); }
|
||||||
|
if (data.hiddenReadOnly) { button.addClass('cp-hidden-if-readonly'); }
|
||||||
|
if (data.name) {
|
||||||
|
button.addClass('cp-toolbar-icon-'+data.name);
|
||||||
|
button.click(common.prepareFeedback(data.name));
|
||||||
|
}
|
||||||
|
if (data.text) {
|
||||||
|
$('<span>', {'class': 'cp-toolbar-drawer-element'}).text(data.text)
|
||||||
|
.appendTo(button);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (rightside) {
|
if (rightside) {
|
||||||
button.addClass('cp-toolbar-rightside-button');
|
button.addClass('cp-toolbar-rightside-button');
|
||||||
@ -855,6 +886,51 @@ define([
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
UIElements.createHelpMenu = function (common) {
|
||||||
|
var type = common.getMetadataMgr().getMetadata().type || 'pad';
|
||||||
|
|
||||||
|
var text = h('p.cp-help-text');
|
||||||
|
var closeButton = h('span.cp-help-close.fa.fa-window-close');
|
||||||
|
var $toolbarButton = common.createButton('', true, {
|
||||||
|
title: Messages.hide_help_button,
|
||||||
|
text: Messages.help_button,
|
||||||
|
name: 'help'
|
||||||
|
}).addClass('cp-toolbar-button-active');
|
||||||
|
var help = h('div.cp-help-container', [
|
||||||
|
closeButton,
|
||||||
|
text
|
||||||
|
]);
|
||||||
|
|
||||||
|
var toggleHelp = function (forceClose) {
|
||||||
|
if ($(help).hasClass('cp-help-hidden')) {
|
||||||
|
if (forceClose) { return; }
|
||||||
|
common.setAttribute(['hideHelp', type], false);
|
||||||
|
$toolbarButton.addClass('cp-toolbar-button-active');
|
||||||
|
$toolbarButton.attr('title', Messages.hide_help_button);
|
||||||
|
return void $(help).removeClass('cp-help-hidden');
|
||||||
|
}
|
||||||
|
$toolbarButton.removeClass('cp-toolbar-button-active');
|
||||||
|
$toolbarButton.attr('title', Messages.show_help_button);
|
||||||
|
$(help).addClass('cp-help-hidden');
|
||||||
|
common.setAttribute(['hideHelp', type], true);
|
||||||
|
};
|
||||||
|
|
||||||
|
$(closeButton).click(function () { toggleHelp(true); });
|
||||||
|
$toolbarButton.click(function () {
|
||||||
|
toggleHelp();
|
||||||
|
});
|
||||||
|
|
||||||
|
common.getAttribute(['hideHelp', type], function (err, val) {
|
||||||
|
if (val === true) { toggleHelp(true); }
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
menu: help,
|
||||||
|
button: $toolbarButton,
|
||||||
|
text: text
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
// Avatars
|
// Avatars
|
||||||
|
|
||||||
// Enable mediatags
|
// Enable mediatags
|
||||||
@ -1489,6 +1565,7 @@ define([
|
|||||||
if (!$blockContainer.length) {
|
if (!$blockContainer.length) {
|
||||||
$blockContainer = $('<div>', {
|
$blockContainer = $('<div>', {
|
||||||
'class': 'cp-modal-container',
|
'class': 'cp-modal-container',
|
||||||
|
tabindex: 1,
|
||||||
'id': cfg.id
|
'id': cfg.id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1520,14 +1597,16 @@ define([
|
|||||||
$body: $('body')
|
$body: $('body')
|
||||||
});
|
});
|
||||||
var $title = $('<h3>').text(Messages.fm_newFile);
|
var $title = $('<h3>').text(Messages.fm_newFile);
|
||||||
var $description = $('<p>').text(Messages.creation_newPadModalDescription);
|
var $description = $('<p>').html(Messages.creation_newPadModalDescription);
|
||||||
$modal.find('.cp-modal').append($title);
|
$modal.find('.cp-modal').append($title);
|
||||||
$modal.find('.cp-modal').append($description);
|
$modal.find('.cp-modal').append($description);
|
||||||
|
|
||||||
var $advanced;
|
var $advanced;
|
||||||
|
|
||||||
var $advancedContainer = $('<div>');
|
var $advancedContainer = $('<div>');
|
||||||
if (common.isLoggedIn()) {
|
var priv = common.getMetadataMgr().getPrivateData();
|
||||||
|
var c = (priv.settings.general && priv.settings.general.creation) || {};
|
||||||
|
if (AppConfig.displayCreationScreen && common.isLoggedIn() && c.skip) {
|
||||||
$advanced = $('<input>', {
|
$advanced = $('<input>', {
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
checked: 'checked',
|
checked: 'checked',
|
||||||
@ -1536,9 +1615,12 @@ define([
|
|||||||
$('<label>', {
|
$('<label>', {
|
||||||
for: 'cp-app-toolbar-creation-advanced'
|
for: 'cp-app-toolbar-creation-advanced'
|
||||||
}).text(Messages.creation_newPadModalAdvanced).appendTo($advancedContainer);
|
}).text(Messages.creation_newPadModalAdvanced).appendTo($advancedContainer);
|
||||||
|
$description.append('<br>');
|
||||||
|
$description.append(Messages.creation_newPadModalDescriptionAdvanced);
|
||||||
}
|
}
|
||||||
|
|
||||||
var $container = $('<div>');
|
var $container = $('<div>');
|
||||||
|
var i = 0;
|
||||||
AppConfig.availablePadTypes.forEach(function (p) {
|
AppConfig.availablePadTypes.forEach(function (p) {
|
||||||
if (p === 'drive') { return; }
|
if (p === 'drive') { return; }
|
||||||
if (p === 'contacts') { return; }
|
if (p === 'contacts') { return; }
|
||||||
@ -1547,7 +1629,8 @@ define([
|
|||||||
if (!common.isLoggedIn() && AppConfig.registeredOnlyTypes &&
|
if (!common.isLoggedIn() && AppConfig.registeredOnlyTypes &&
|
||||||
AppConfig.registeredOnlyTypes.indexOf(p) !== -1) { return; }
|
AppConfig.registeredOnlyTypes.indexOf(p) !== -1) { return; }
|
||||||
var $element = $('<li>', {
|
var $element = $('<li>', {
|
||||||
'class': 'cp-icons-element'
|
'class': 'cp-icons-element',
|
||||||
|
'id': 'cp-newpad-icons-'+ (i++)
|
||||||
}).prepend(UI.getIcon(p)).appendTo($container);
|
}).prepend(UI.getIcon(p)).appendTo($container);
|
||||||
$element.append($('<span>', {'class': 'cp-icons-name'})
|
$element.append($('<span>', {'class': 'cp-icons-name'})
|
||||||
.text(Messages.type[p]));
|
.text(Messages.type[p]));
|
||||||
@ -1555,7 +1638,7 @@ define([
|
|||||||
$element.click(function () {
|
$element.click(function () {
|
||||||
$modal.hide();
|
$modal.hide();
|
||||||
if ($advanced && $advanced.is(':checked')) {
|
if ($advanced && $advanced.is(':checked')) {
|
||||||
common.sessionStorage.put(Constants.displayPadCreationScreen, true, function () {
|
common.sessionStorage.put(Constants.displayPadCreationScreen, true, function (){
|
||||||
common.openURL('/' + p + '/');
|
common.openURL('/' + p + '/');
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -1566,11 +1649,41 @@ define([
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var selected = -1;
|
||||||
|
var next = function () {
|
||||||
|
selected = ++selected % 5;
|
||||||
|
$container.find('.cp-icons-element-selected').removeClass('cp-icons-element-selected');
|
||||||
|
$container.find('#cp-newpad-icons-'+selected).addClass('cp-icons-element-selected');
|
||||||
|
};
|
||||||
|
|
||||||
|
$modal.off('keydown');
|
||||||
|
$modal.keydown(function (e) {
|
||||||
|
if (e.which === 9) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
next();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (e.which === 13) {
|
||||||
|
if ($container.find('.cp-icons-element-selected').length === 1) {
|
||||||
|
$container.find('.cp-icons-element-selected').click();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (e.which === 32 && $advanced) {
|
||||||
|
$advanced.prop('checked', !$advanced.prop('checked'));
|
||||||
|
$modal.focus();
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/*var $content = createNewPadIcons($modal, isInRoot);*/
|
|
||||||
$modal.find('.cp-modal').append($container).append($advancedContainer);
|
$modal.find('.cp-modal').append($container).append($advancedContainer);
|
||||||
window.setTimeout(function () { $modal.show(); });
|
window.setTimeout(function () {
|
||||||
//addNewPadHandlers($modal, isInRoot);
|
$modal.show();
|
||||||
|
$modal.focus();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
UIElements.initFilePicker = function (common, cfg) {
|
UIElements.initFilePicker = function (common, cfg) {
|
||||||
@ -1663,7 +1776,7 @@ define([
|
|||||||
|
|
||||||
var $body = $('body');
|
var $body = $('body');
|
||||||
var $creationContainer = $('<div>', { id: 'cp-creation-container' }).appendTo($body);
|
var $creationContainer = $('<div>', { id: 'cp-creation-container' }).appendTo($body);
|
||||||
var $creation = $('<div>', { id: 'cp-creation' }).appendTo($creationContainer);
|
var $creation = $('<div>', { id: 'cp-creation', tabindex: 1 }).appendTo($creationContainer);
|
||||||
|
|
||||||
var setHTML = function (e, html) {
|
var setHTML = function (e, html) {
|
||||||
e.innerHTML = html;
|
e.innerHTML = html;
|
||||||
@ -1763,7 +1876,7 @@ define([
|
|||||||
UIElements.setExpirationValue(cfg.expire, $creation);
|
UIElements.setExpirationValue(cfg.expire, $creation);
|
||||||
|
|
||||||
// Create the pad
|
// Create the pad
|
||||||
var create = function (template) {
|
var getFormValues = function (template) {
|
||||||
// Type of pad
|
// Type of pad
|
||||||
var ownedVal = parseInt($('input[name="cp-creation-owned"]:checked').val());
|
var ownedVal = parseInt($('input[name="cp-creation-owned"]:checked').val());
|
||||||
// Life time
|
// Life time
|
||||||
@ -1779,12 +1892,16 @@ define([
|
|||||||
expireVal = ($('#cp-creation-expire-val').val() || 0) * unit;
|
expireVal = ($('#cp-creation-expire-val').val() || 0) * unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
common.createPad({
|
return {
|
||||||
owned: ownedVal,
|
owned: ownedVal,
|
||||||
expire: expireVal,
|
expire: expireVal,
|
||||||
template: template
|
template: template
|
||||||
}, function () {
|
};
|
||||||
|
};
|
||||||
|
var create = function (template) {
|
||||||
$creationContainer.remove();
|
$creationContainer.remove();
|
||||||
|
|
||||||
|
common.createPad(getFormValues(template), function () {
|
||||||
cb();
|
cb();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -1829,10 +1946,62 @@ define([
|
|||||||
|
|
||||||
// Settings button
|
// Settings button
|
||||||
var origin = common.getMetadataMgr().getPrivateData().origin;
|
var origin = common.getMetadataMgr().getPrivateData().origin;
|
||||||
$(h('div.cp-creation-settings', h('a', {
|
var $ok = $('<span>', {'class': 'fa fa-check', title: Messages.saved}).hide();
|
||||||
|
var $spinner = $('<span>', {'class': 'fa fa-spinner fa-pulse'}).hide();
|
||||||
|
var okTo;
|
||||||
|
var $saveButton = $('<button>').text(Messages.creation_saveSettings).click(function () {
|
||||||
|
if (okTo) { clearTimeout(okTo); }
|
||||||
|
$ok.hide();
|
||||||
|
$spinner.show();
|
||||||
|
var val = getFormValues();
|
||||||
|
NThen(function (waitFor) {
|
||||||
|
common.setAttribute(['general', 'creation', 'owned'], val.owned, waitFor(function (e) {
|
||||||
|
if (e) { return void console.error(e); }
|
||||||
|
}));
|
||||||
|
common.setAttribute(['general', 'creation', 'expire'], val.expire, waitFor(function (e) {
|
||||||
|
if (e) { return void console.error(e); }
|
||||||
|
}));
|
||||||
|
}).nThen(function () {
|
||||||
|
$spinner.hide();
|
||||||
|
$ok.show();
|
||||||
|
okTo = setTimeout(function () {
|
||||||
|
$ok.hide();
|
||||||
|
}, 5000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$(h('div.cp-creation-settings', [
|
||||||
|
$saveButton[0],
|
||||||
|
h('br'),
|
||||||
|
h('a', {
|
||||||
href: origin + '/settings/#creation',
|
href: origin + '/settings/#creation',
|
||||||
target: '_blank'
|
target: '_blank'
|
||||||
}, Messages.creation_settings))).appendTo($creation);
|
}, Messages.creation_settings),
|
||||||
|
$ok[0],
|
||||||
|
$spinner[0]
|
||||||
|
])).appendTo($creation);
|
||||||
|
|
||||||
|
var selected = -1;
|
||||||
|
var next = function () {
|
||||||
|
selected = ++selected % $creation.find('button').length;
|
||||||
|
$creation.find('button').removeClass('cp-creation-button-selected');
|
||||||
|
$($creation.find('button').get(selected)).addClass('cp-creation-button-selected');
|
||||||
|
};
|
||||||
|
|
||||||
|
$creation.keydown(function (e) {
|
||||||
|
if (e.which === 9) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
next();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (e.which === 13) {
|
||||||
|
if ($creation.find('.cp-creation-button-selected').length === 1) {
|
||||||
|
$creation.find('.cp-creation-button-selected').click();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$creation.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
UIElements.onServerError = function (common, err, toolbar, cb) {
|
UIElements.onServerError = function (common, err, toolbar, cb) {
|
||||||
|
|||||||
@ -116,6 +116,7 @@ define([
|
|||||||
|
|
||||||
/* remove listeners from the DOM */
|
/* remove listeners from the DOM */
|
||||||
var removeListeners = function (root) {
|
var removeListeners = function (root) {
|
||||||
|
if (!root) { return; }
|
||||||
slice(root.attributes).map(function (attr) {
|
slice(root.attributes).map(function (attr) {
|
||||||
if (/^on/i.test(attr.name)) {
|
if (/^on/i.test(attr.name)) {
|
||||||
console.log('removing attribute', attr.name, root.attributes[attr.name]);
|
console.log('removing attribute', attr.name, root.attributes[attr.name]);
|
||||||
@ -171,7 +172,9 @@ define([
|
|||||||
return mt + '</media-tag>';
|
return mt + '</media-tag>';
|
||||||
});
|
});
|
||||||
|
|
||||||
var safe_newHtmlFixed = domFromHTML(unsafe_newHtmlFixed).body.outerHTML;
|
var newDomFixed = domFromHTML(unsafe_newHtmlFixed);
|
||||||
|
if (!newDomFixed || !newDomFixed.body) { return; }
|
||||||
|
var safe_newHtmlFixed = newDomFixed.body.outerHTML;
|
||||||
var $div = $('<div>', {id: id}).append(safe_newHtmlFixed);
|
var $div = $('<div>', {id: id}).append(safe_newHtmlFixed);
|
||||||
|
|
||||||
var Dom = domFromHTML($('<div>').append($div).html());
|
var Dom = domFromHTML($('<div>').append($div).html());
|
||||||
|
|||||||
@ -398,11 +398,7 @@ define([
|
|||||||
'" data-crypto-key="cryptpad:' + data.key + '"></media-tag>'), data);
|
'" data-crypto-key="cryptpad:' + data.key + '"></media-tag>'), data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$embedButton = $('<button>', {
|
$embedButton = common.createButton('mediatag', true).click(function () {
|
||||||
title: Messages.filePickerButton,
|
|
||||||
'class': 'cp-toolbar-rightside-button fa fa-picture-o',
|
|
||||||
style: 'font-size: 17px'
|
|
||||||
}).click(function () {
|
|
||||||
common.openFilePicker({
|
common.openFilePicker({
|
||||||
types: ['file'],
|
types: ['file'],
|
||||||
where: ['root']
|
where: ['root']
|
||||||
@ -426,15 +422,7 @@ define([
|
|||||||
common.getSframeChannel().onReady(waitFor());
|
common.getSframeChannel().onReady(waitFor());
|
||||||
}).nThen(function (waitFor) {
|
}).nThen(function (waitFor) {
|
||||||
Test.registerInner(common.getSframeChannel());
|
Test.registerInner(common.getSframeChannel());
|
||||||
if (!AppConfig.displayCreationScreen) { return; }
|
common.handleNewFile(waitFor);
|
||||||
var priv = common.getMetadataMgr().getPrivateData();
|
|
||||||
if (priv.isNewFile) {
|
|
||||||
var c = (priv.settings.general && priv.settings.general.creation) || {};
|
|
||||||
if (c.skip && !priv.forceCreationScreen) {
|
|
||||||
return void common.createPad(c, waitFor());
|
|
||||||
}
|
|
||||||
common.getPadCreationScreen(c, waitFor());
|
|
||||||
}
|
|
||||||
}).nThen(function (waitFor) {
|
}).nThen(function (waitFor) {
|
||||||
cpNfInner = common.startRealtime({
|
cpNfInner = common.startRealtime({
|
||||||
// really basic operational transform
|
// really basic operational transform
|
||||||
|
|||||||
@ -141,7 +141,6 @@ define([
|
|||||||
mode: defaultMode || "javascript",
|
mode: defaultMode || "javascript",
|
||||||
readOnly: true
|
readOnly: true
|
||||||
});
|
});
|
||||||
//editor.setValue(Messages.codeInitialState);
|
|
||||||
editor.focus();
|
editor.focus();
|
||||||
|
|
||||||
var setMode = exp.setMode = function (mode, cb) {
|
var setMode = exp.setMode = function (mode, cb) {
|
||||||
|
|||||||
@ -187,7 +187,7 @@ define([
|
|||||||
upgradeURL: Cryptpad.upgradeURL
|
upgradeURL: Cryptpad.upgradeURL
|
||||||
},
|
},
|
||||||
isNewFile: isNewFile,
|
isNewFile: isNewFile,
|
||||||
isDeleted: window.location.hash.length > 0,
|
isDeleted: isNewFile && window.location.hash.length > 0,
|
||||||
forceCreationScreen: forceCreationScreen
|
forceCreationScreen: forceCreationScreen
|
||||||
};
|
};
|
||||||
for (var k in additionalPriv) { metaObj.priv[k] = additionalPriv[k]; }
|
for (var k in additionalPriv) { metaObj.priv[k] = additionalPriv[k]; }
|
||||||
@ -666,8 +666,9 @@ define([
|
|||||||
Utils.Feedback.reportAppUsage();
|
Utils.Feedback.reportAppUsage();
|
||||||
|
|
||||||
if (!realtime) { return; }
|
if (!realtime) { return; }
|
||||||
if (isNewFile && Utils.LocalStore.isLoggedIn()
|
if (isNewFile && cfg.useCreationScreen) { return; }
|
||||||
&& AppConfig.displayCreationScreen && cfg.useCreationScreen) { return; }
|
//if (isNewFile && Utils.LocalStore.isLoggedIn()
|
||||||
|
// && AppConfig.displayCreationScreen && cfg.useCreationScreen) { return; }
|
||||||
|
|
||||||
startRealtime();
|
startRealtime();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -90,6 +90,7 @@ define([
|
|||||||
funcs.updateTags = callWithCommon(UIElements.updateTags);
|
funcs.updateTags = callWithCommon(UIElements.updateTags);
|
||||||
funcs.createLanguageSelector = callWithCommon(UIElements.createLanguageSelector);
|
funcs.createLanguageSelector = callWithCommon(UIElements.createLanguageSelector);
|
||||||
funcs.createMarkdownToolbar = callWithCommon(UIElements.createMarkdownToolbar);
|
funcs.createMarkdownToolbar = callWithCommon(UIElements.createMarkdownToolbar);
|
||||||
|
funcs.createHelpMenu = callWithCommon(UIElements.createHelpMenu);
|
||||||
funcs.getPadCreationScreen = callWithCommon(UIElements.getPadCreationScreen);
|
funcs.getPadCreationScreen = callWithCommon(UIElements.getPadCreationScreen);
|
||||||
funcs.createNewPadModal = callWithCommon(UIElements.createNewPadModal);
|
funcs.createNewPadModal = callWithCommon(UIElements.createNewPadModal);
|
||||||
funcs.onServerError = callWithCommon(UIElements.onServerError);
|
funcs.onServerError = callWithCommon(UIElements.onServerError);
|
||||||
@ -167,6 +168,30 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Store
|
// Store
|
||||||
|
funcs.handleNewFile = function (waitFor) {
|
||||||
|
var priv = ctx.metadataMgr.getPrivateData();
|
||||||
|
if (priv.isNewFile) {
|
||||||
|
var c = (priv.settings.general && priv.settings.general.creation) || {};
|
||||||
|
var skip = !AppConfig.displayCreationScreen || (c.skip && !priv.forceCreationScreen);
|
||||||
|
// If this is a new file but we have a hash in the URL and pad creation screen is
|
||||||
|
// not displayed, then display an error...
|
||||||
|
if (priv.isDeleted && (!funcs.isLoggedIn() || skip)) {
|
||||||
|
UI.errorLoadingScreen(Messages.inactiveError, false, function () {
|
||||||
|
UI.addLoadingScreen();
|
||||||
|
return void funcs.createPad({}, waitFor());
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Otherwise, if we don't display the screen, it means it is not a deleted pad
|
||||||
|
// so we can continue and start realtime...
|
||||||
|
if (!funcs.isLoggedIn() || skip) {
|
||||||
|
return void funcs.createPad(c, waitFor());
|
||||||
|
}
|
||||||
|
// If we display the pad creation screen, it will handle deleted pads directly
|
||||||
|
console.log('here');
|
||||||
|
funcs.getPadCreationScreen(c, waitFor());
|
||||||
|
}
|
||||||
|
};
|
||||||
funcs.createPad = function (cfg, cb) {
|
funcs.createPad = function (cfg, cb) {
|
||||||
ctx.sframeChan.query("Q_CREATE_PAD", {
|
ctx.sframeChan.query("Q_CREATE_PAD", {
|
||||||
owned: cfg.owned,
|
owned: cfg.owned,
|
||||||
|
|||||||
@ -318,7 +318,7 @@ define([
|
|||||||
$span.append($rightCol);
|
$span.append($rightCol);
|
||||||
} else {
|
} else {
|
||||||
Common.displayAvatar($span, data.avatar, name, function ($img) {
|
Common.displayAvatar($span, data.avatar, name, function ($img) {
|
||||||
if (data.avatar && $img.length) {
|
if (data.avatar && $img && $img.length) {
|
||||||
avatars[data.avatar] = $img[0].outerHTML;
|
avatars[data.avatar] = $img[0].outerHTML;
|
||||||
}
|
}
|
||||||
$span.append($rightCol);
|
$span.append($rightCol);
|
||||||
@ -377,38 +377,15 @@ define([
|
|||||||
config.$contentContainer.prepend($content);
|
config.$contentContainer.prepend($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
var $ck = config.$container.find('.cke_toolbox_main');
|
|
||||||
var mobile = $('body').width() <= 600;
|
|
||||||
var hide = function () {
|
var hide = function () {
|
||||||
$content.hide();
|
$content.hide();
|
||||||
$button.removeClass('cp-toolbar-button-active');
|
$button.removeClass('cp-toolbar-button-active');
|
||||||
$ck.css({
|
|
||||||
'padding-left': '',
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
var show = function () {
|
var show = function () {
|
||||||
if (Bar.isEmbed) { $content.hide(); return; }
|
if (Bar.isEmbed) { $content.hide(); return; }
|
||||||
$content.show();
|
$content.show();
|
||||||
if (mobile) {
|
|
||||||
$ck.hide();
|
|
||||||
}
|
|
||||||
$button.addClass('cp-toolbar-button-active');
|
$button.addClass('cp-toolbar-button-active');
|
||||||
$ck.css({
|
|
||||||
'padding-left': '175px',
|
|
||||||
});
|
|
||||||
var h = $ck.is(':visible') ? -$ck.height() : 0;
|
|
||||||
$content.css('margin-top', h+'px');
|
|
||||||
};
|
};
|
||||||
$(window).on('cryptpad-ck-toolbar', function () {
|
|
||||||
if (mobile && $ck.is(':visible')) { return void hide(); }
|
|
||||||
if ($content.is(':visible')) { return void show(); }
|
|
||||||
hide();
|
|
||||||
});
|
|
||||||
$(window).on('resize', function () {
|
|
||||||
mobile = $('body').width() <= 600;
|
|
||||||
var h = $ck.is(':visible') ? -$ck.height() : 0;
|
|
||||||
$content.css('margin-top', h+'px');
|
|
||||||
});
|
|
||||||
$closeIcon.click(function () {
|
$closeIcon.click(function () {
|
||||||
Common.setAttribute(['toolbar', 'userlist-drawer'], false);
|
Common.setAttribute(['toolbar', 'userlist-drawer'], false);
|
||||||
hide();
|
hide();
|
||||||
@ -423,7 +400,7 @@ define([
|
|||||||
});
|
});
|
||||||
show();
|
show();
|
||||||
Common.getAttribute(['toolbar', 'userlist-drawer'], function (err, val) {
|
Common.getAttribute(['toolbar', 'userlist-drawer'], function (err, val) {
|
||||||
if (val === false || mobile) { return void hide(); }
|
if (val === false) { return void hide(); }
|
||||||
show();
|
show();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -593,7 +570,7 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
var createUnpinnedWarning0 = function (toolbar, config) {
|
var createUnpinnedWarning0 = function (toolbar, config) {
|
||||||
if (true) { return; } // stub this call since it won't make it into the next release
|
//if (true) { return; } // stub this call since it won't make it into the next release
|
||||||
if (Common.isLoggedIn()) { return; }
|
if (Common.isLoggedIn()) { return; }
|
||||||
var pd = config.metadataMgr.getPrivateData();
|
var pd = config.metadataMgr.getPrivateData();
|
||||||
var o = pd.origin;
|
var o = pd.origin;
|
||||||
@ -633,7 +610,7 @@ define([
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('.cp-toolbar-top').append($msg);
|
$('.cp-toolbar-top').append($msg);
|
||||||
UI.addTooltips();
|
//UI.addTooltips();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -791,7 +768,6 @@ define([
|
|||||||
content: $('<div>').append(UI.getIcon(p)).html() + Messages.type[p]
|
content: $('<div>').append(UI.getIcon(p)).html() + Messages.type[p]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if (Config.displayCreationScreen) {
|
|
||||||
pads_options.push({
|
pads_options.push({
|
||||||
tag: 'a',
|
tag: 'a',
|
||||||
attributes: {
|
attributes: {
|
||||||
@ -801,11 +777,10 @@ define([
|
|||||||
content: '<span class="fa fa-plus-circle"></span> ' + Messages.creation_appMenuName
|
content: '<span class="fa fa-plus-circle"></span> ' + Messages.creation_appMenuName
|
||||||
});
|
});
|
||||||
$(window).keydown(function (e) {
|
$(window).keydown(function (e) {
|
||||||
if (e.which === 69 && e.ctrlKey) {
|
if (e.which === 69 && (e.ctrlKey || (navigator.platform === "MacIntel" && e.metaKey))) {
|
||||||
Common.createNewPadModal();
|
Common.createNewPadModal();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
var dropdownConfig = {
|
var dropdownConfig = {
|
||||||
text: '', // Button initial text
|
text: '', // Button initial text
|
||||||
options: pads_options, // Entries displayed in the menu
|
options: pads_options, // Entries displayed in the menu
|
||||||
|
|||||||
@ -724,7 +724,7 @@ span {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.history {
|
.cp-toolbar-icon-history {
|
||||||
float: right;
|
float: right;
|
||||||
.cp-toolbar-drawer-element {
|
.cp-toolbar-drawer-element {
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@ -41,7 +41,8 @@ define([
|
|||||||
{
|
{
|
||||||
var APP = window.APP = {
|
var APP = window.APP = {
|
||||||
editable: false,
|
editable: false,
|
||||||
mobile: function () { return $('body').width() <= 600; } // Menu and content area are not inline-block anymore for mobiles
|
mobile: function () { return $('body').width() <= 600; }, // Menu and content area are not inline-block anymore for mobiles
|
||||||
|
isMac: navigator.platform === "MacIntel"
|
||||||
};
|
};
|
||||||
|
|
||||||
var stringify = function (obj) {
|
var stringify = function (obj) {
|
||||||
@ -548,6 +549,13 @@ define([
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ctrl+A select all
|
||||||
|
if (e.which === 65 && (e.ctrlKey || (e.metaKey && APP.isMac))) {
|
||||||
|
$content.find('.cp-app-drive-element:not(.cp-app-drive-element-selected)')
|
||||||
|
.addClass('cp-app-drive-element-selected');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// [Left, Up, Right, Down]
|
// [Left, Up, Right, Down]
|
||||||
if ([37, 38, 39, 40].indexOf(e.which) === -1) { return; }
|
if ([37, 38, 39, 40].indexOf(e.which) === -1) { return; }
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -2908,6 +2916,7 @@ define([
|
|||||||
}
|
}
|
||||||
// else move to trash
|
// else move to trash
|
||||||
moveElements(paths, [TRASH], false, refresh);
|
moveElements(paths, [TRASH], false, refresh);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var isCharacterKey = function (e) {
|
var isCharacterKey = function (e) {
|
||||||
|
|||||||
@ -30,6 +30,8 @@ flex-flow: column;
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
flex-flow: column;
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cp-app-file-content.ready {
|
#cp-app-file-content.ready {
|
||||||
@ -134,3 +136,25 @@ media-tag {
|
|||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#cp-app-file-download-view {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
min-height: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-flow: column;
|
||||||
|
media-tag {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
max-width: 100vw;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
&> * {
|
||||||
|
max-height: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@ -100,6 +100,11 @@ define([
|
|||||||
var title = document.title = metadata.name;
|
var title = document.title = metadata.name;
|
||||||
Title.updateTitle(title || Title.defaultTitle);
|
Title.updateTitle(title || Title.defaultTitle);
|
||||||
toolbar.addElement(['pageTitle'], {pageTitle: title});
|
toolbar.addElement(['pageTitle'], {pageTitle: title});
|
||||||
|
toolbar.$rightside.append(common.createButton('forget', true));
|
||||||
|
if (common.isLoggedIn()) {
|
||||||
|
toolbar.$rightside.append(common.createButton('hashtag', true));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
common.setPadAttribute('fileType', metadata.type);
|
common.setPadAttribute('fileType', metadata.type);
|
||||||
|
|
||||||
@ -118,7 +123,6 @@ define([
|
|||||||
$mt.attr('data-crypto-key', 'cryptpad:'+cryptKey);
|
$mt.attr('data-crypto-key', 'cryptpad:'+cryptKey);
|
||||||
|
|
||||||
var rightsideDisplayed = false;
|
var rightsideDisplayed = false;
|
||||||
|
|
||||||
$(window.document).on('decryption', function (e) {
|
$(window.document).on('decryption', function (e) {
|
||||||
var decrypted = e.originalEvent;
|
var decrypted = e.originalEvent;
|
||||||
if (decrypted.callback) {
|
if (decrypted.callback) {
|
||||||
@ -142,13 +146,7 @@ define([
|
|||||||
toolbar.$rightside
|
toolbar.$rightside
|
||||||
.append(common.createButton('export', true, {}, function () {
|
.append(common.createButton('export', true, {}, function () {
|
||||||
saveAs(decrypted.blob, decrypted.metadata.name);
|
saveAs(decrypted.blob, decrypted.metadata.name);
|
||||||
}))
|
|
||||||
.append(common.createButton('forget', true, {}, function () {
|
|
||||||
// not sure what to do here
|
|
||||||
}));
|
}));
|
||||||
if (common.isLoggedIn()) {
|
|
||||||
toolbar.$rightside.append(common.createButton('hashtag', true));
|
|
||||||
}
|
|
||||||
rightsideDisplayed = true;
|
rightsideDisplayed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,12 +53,8 @@ define([
|
|||||||
$('button.login').click();
|
$('button.login').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
var hashing = false;
|
|
||||||
var test;
|
var test;
|
||||||
$('button.login').click(function () {
|
$('button.login').click(function () {
|
||||||
if (hashing) { return void console.log("hashing is already in progress"); }
|
|
||||||
|
|
||||||
hashing = true;
|
|
||||||
var shouldImport = $checkImport[0].checked;
|
var shouldImport = $checkImport[0].checked;
|
||||||
var uname = $uname.val();
|
var uname = $uname.val();
|
||||||
var passwd = $passwd.val();
|
var passwd = $passwd.val();
|
||||||
|
|||||||
@ -13,21 +13,39 @@
|
|||||||
#cke_1_top {
|
#cke_1_top {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
display: flex;
|
|
||||||
}
|
}
|
||||||
#cke_1_toolbox {
|
.cke_toolbox_main {
|
||||||
display: inline-flex;
|
|
||||||
width: 100%;
|
|
||||||
flex-flow: column;
|
|
||||||
background-color: @colortheme_pad-toolbar-bg;
|
background-color: @colortheme_pad-toolbar-bg;
|
||||||
}
|
.cke_toolbar {
|
||||||
#cke_1_toolbox .cke_toolbar {
|
|
||||||
height: 28px;
|
height: 28px;
|
||||||
padding: 2px 0;
|
padding: 2px 0;
|
||||||
}
|
}
|
||||||
.cke_wysiwyg_frame {
|
|
||||||
min-width: 60%;
|
|
||||||
}
|
}
|
||||||
|
.cke_wysiwyg_frame {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#cke_editor1 {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column;
|
||||||
|
height: 100%;
|
||||||
|
border: 0;
|
||||||
|
> .cke_inner {
|
||||||
|
flex: 1;
|
||||||
|
position: unset;
|
||||||
|
display: flex;
|
||||||
|
margin-top: -1px;
|
||||||
|
#cke_1_contents {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column;
|
||||||
|
height: auto !important;
|
||||||
|
iframe {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cke_wysiwyg_frame {
|
.cke_wysiwyg_frame {
|
||||||
|
|||||||
@ -136,6 +136,16 @@ define([
|
|||||||
check();
|
check();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var mkHelpMenu = function (framework) {
|
||||||
|
var $toolbarContainer = $('.cke_toolbox_main');
|
||||||
|
var helpMenu = framework._.sfCommon.createHelpMenu();
|
||||||
|
$toolbarContainer.before(helpMenu.menu);
|
||||||
|
|
||||||
|
$(helpMenu.text).html(Messages.initialState);
|
||||||
|
|
||||||
|
framework._.toolbar.$drawer.append(helpMenu.button);
|
||||||
|
};
|
||||||
|
|
||||||
var mkDiffOptions = function (cursor, readOnly) {
|
var mkDiffOptions = function (cursor, readOnly) {
|
||||||
return {
|
return {
|
||||||
preDiffApply: function (info) {
|
preDiffApply: function (info) {
|
||||||
@ -269,8 +279,6 @@ define([
|
|||||||
element: $bar.find('.cke_toolbox_main')
|
element: $bar.find('.cke_toolbox_main')
|
||||||
};
|
};
|
||||||
var onClick = function (visible) {
|
var onClick = function (visible) {
|
||||||
$(window).trigger('resize');
|
|
||||||
$(window).trigger('cryptpad-ck-toolbar');
|
|
||||||
framework._.sfCommon.setAttribute(['pad', 'showToolbar'], visible);
|
framework._.sfCommon.setAttribute(['pad', 'showToolbar'], visible);
|
||||||
};
|
};
|
||||||
framework._.sfCommon.getAttribute(['pad', 'showToolbar'], function (err, data) {
|
framework._.sfCommon.getAttribute(['pad', 'showToolbar'], function (err, data) {
|
||||||
@ -324,12 +332,12 @@ define([
|
|||||||
var andThen2 = function (editor, Ckeditor, framework) {
|
var andThen2 = function (editor, Ckeditor, framework) {
|
||||||
var mediaTagMap = {};
|
var mediaTagMap = {};
|
||||||
var $bar = $('#cke_1_toolbox');
|
var $bar = $('#cke_1_toolbox');
|
||||||
|
var $contentContainer = $('#cke_1_contents');
|
||||||
var $html = $bar.closest('html');
|
var $html = $bar.closest('html');
|
||||||
var $faLink = $html.find('head link[href*="/bower_components/components-font-awesome/css/font-awesome.min.css"]');
|
var $faLink = $html.find('head link[href*="/bower_components/components-font-awesome/css/font-awesome.min.css"]');
|
||||||
if ($faLink.length) {
|
if ($faLink.length) {
|
||||||
$html.find('iframe').contents().find('head').append($faLink.clone());
|
$html.find('iframe').contents().find('head').append($faLink.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
var ml = Ckeditor.instances.editor1.plugins.magicline.backdoor.that.line.$;
|
var ml = Ckeditor.instances.editor1.plugins.magicline.backdoor.that.line.$;
|
||||||
[ml, ml.parentElement].forEach(function (el) {
|
[ml, ml.parentElement].forEach(function (el) {
|
||||||
el.setAttribute('class', 'non-realtime');
|
el.setAttribute('class', 'non-realtime');
|
||||||
@ -352,6 +360,8 @@ define([
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mkHelpMenu(framework);
|
||||||
|
|
||||||
framework.onEditableChange(function (unlocked) {
|
framework.onEditableChange(function (unlocked) {
|
||||||
if (!framework.isReadOnly()) {
|
if (!framework.isReadOnly()) {
|
||||||
$(inner).attr('contenteditable', '' + Boolean(unlocked));
|
$(inner).attr('contenteditable', '' + Boolean(unlocked));
|
||||||
@ -421,12 +431,14 @@ define([
|
|||||||
|
|
||||||
$bar.find('#cke_1_toolbar_collapser').hide();
|
$bar.find('#cke_1_toolbar_collapser').hide();
|
||||||
if (!framework.isReadOnly()) {
|
if (!framework.isReadOnly()) {
|
||||||
addToolbarHideBtn(framework, $bar);
|
addToolbarHideBtn(framework, $contentContainer);
|
||||||
} else {
|
} else {
|
||||||
$('.cke_toolbox_main').hide();
|
$('.cke_toolbox_main').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
framework.onReady(function (newPad) {
|
framework.onReady(function (newPad) {
|
||||||
|
editor.focus();
|
||||||
|
|
||||||
if (!module.isMaximized) {
|
if (!module.isMaximized) {
|
||||||
module.isMaximized = true;
|
module.isMaximized = true;
|
||||||
$('iframe.cke_wysiwyg_frame').css('width', '');
|
$('iframe.cke_wysiwyg_frame').css('width', '');
|
||||||
@ -434,7 +446,6 @@ define([
|
|||||||
}
|
}
|
||||||
$('body').addClass('app-pad');
|
$('body').addClass('app-pad');
|
||||||
|
|
||||||
editor.focus();
|
|
||||||
if (newPad) {
|
if (newPad) {
|
||||||
cursor.setToEnd();
|
cursor.setToEnd();
|
||||||
} else if (framework.isReadOnly()) {
|
} else if (framework.isReadOnly()) {
|
||||||
@ -464,10 +475,17 @@ define([
|
|||||||
$iframe.find('html').addClass('cke_body_width');
|
$iframe.find('html').addClass('cke_body_width');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
/*setTimeout(function () {
|
||||||
|
$('iframe.cke_wysiwyg_frame').focus();
|
||||||
|
editor.focus();
|
||||||
|
console.log(editor);
|
||||||
|
console.log(editor.focusManager);
|
||||||
|
$(window).trigger('resize');
|
||||||
|
});*/
|
||||||
});
|
});
|
||||||
|
|
||||||
framework.onDefaultContentNeeded(function () {
|
framework.onDefaultContentNeeded(function () {
|
||||||
documentBody.innerHTML = Messages.initialState;
|
inner.innerHTML = '<p></p>';
|
||||||
});
|
});
|
||||||
|
|
||||||
var importMediaTags = function (dom, cb) {
|
var importMediaTags = function (dom, cb) {
|
||||||
@ -561,9 +579,9 @@ define([
|
|||||||
nThen(function (waitFor) {
|
nThen(function (waitFor) {
|
||||||
Framework.create({
|
Framework.create({
|
||||||
toolbarContainer: '#cke_1_toolbox',
|
toolbarContainer: '#cke_1_toolbox',
|
||||||
contentContainer: '#cke_1_contents',
|
contentContainer: '#cke_editor1 > .cke_inner',
|
||||||
patchTransformer: ChainPad.NaiveJSONTransformer,
|
patchTransformer: ChainPad.NaiveJSONTransformer,
|
||||||
thumbnail: {
|
/*thumbnail: {
|
||||||
getContainer: function () { return $('iframe').contents().find('html')[0]; },
|
getContainer: function () { return $('iframe').contents().find('html')[0]; },
|
||||||
filter: function (el, before) {
|
filter: function (el, before) {
|
||||||
if (before) {
|
if (before) {
|
||||||
@ -584,7 +602,7 @@ define([
|
|||||||
var range = module.cursor.makeRange();
|
var range = module.cursor.makeRange();
|
||||||
module.cursor.fixSelection(sel, range);
|
module.cursor.fixSelection(sel, range);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}, waitFor(function (fw) { window.APP.framework = framework = fw; }));
|
}, waitFor(function (fw) { window.APP.framework = framework = fw; }));
|
||||||
|
|
||||||
nThen(function (waitFor) {
|
nThen(function (waitFor) {
|
||||||
@ -608,9 +626,10 @@ define([
|
|||||||
var backColor = AppConfig.appBackgroundColor;
|
var backColor = AppConfig.appBackgroundColor;
|
||||||
var newCss = '.cke_body_width { background: '+ backColor +'; height: 100%; }' +
|
var newCss = '.cke_body_width { background: '+ backColor +'; height: 100%; }' +
|
||||||
'.cke_body_width body {' +
|
'.cke_body_width body {' +
|
||||||
'max-width: 50em; padding: 10px 30px; margin: 0 auto; min-height: 100%;'+
|
'max-width: 50em; padding: 20px 30px; margin: 0 auto; min-height: 100%;'+
|
||||||
'box-sizing: border-box;'+
|
'box-sizing: border-box; overflow: auto;'+
|
||||||
'}';
|
'}' +
|
||||||
|
'.cke_body_width body > *:first-child { margin-top: 0; }';
|
||||||
Ckeditor.addCss(newCss);
|
Ckeditor.addCss(newCss);
|
||||||
Ckeditor.plugins.addExternal('mediatag','/pad/', 'mediatag-plugin.js');
|
Ckeditor.plugins.addExternal('mediatag','/pad/', 'mediatag-plugin.js');
|
||||||
module.ckeditor = editor = Ckeditor.replace('editor1', {
|
module.ckeditor = editor = Ckeditor.replace('editor1', {
|
||||||
@ -624,6 +643,15 @@ define([
|
|||||||
height: Messages.pad_mediatagHeight
|
height: Messages.pad_mediatagHeight
|
||||||
};
|
};
|
||||||
Links.addSupportForOpeningLinksInNewTab(Ckeditor)({editor: editor});
|
Links.addSupportForOpeningLinksInNewTab(Ckeditor)({editor: editor});
|
||||||
|
}).nThen(function () {
|
||||||
|
// Move ckeditor parts to have a structure like the other apps
|
||||||
|
var $toolbarContainer = $('#cke_1_top');
|
||||||
|
var $contentContainer = $('#cke_1_contents');
|
||||||
|
var $mainContainer = $('#cke_editor1');
|
||||||
|
$contentContainer.prepend($toolbarContainer.find('.cke_toolbox_main'));
|
||||||
|
$mainContainer.prepend($toolbarContainer);
|
||||||
|
$contentContainer.find('.cke_toolbox_main').addClass('cke_reset_all');
|
||||||
|
$toolbarContainer.removeClass('cke_reset_all');
|
||||||
}).nThen(waitFor());
|
}).nThen(waitFor());
|
||||||
|
|
||||||
}).nThen(function (/*waitFor*/) {
|
}).nThen(function (/*waitFor*/) {
|
||||||
|
|||||||
@ -14,6 +14,7 @@ define([
|
|||||||
'/common/sframe-common-codemirror.js',
|
'/common/sframe-common-codemirror.js',
|
||||||
'/common/common-thumbnail.js',
|
'/common/common-thumbnail.js',
|
||||||
'/common/common-interface.js',
|
'/common/common-interface.js',
|
||||||
|
'/common/hyperscript.js',
|
||||||
'/customize/messages.js',
|
'/customize/messages.js',
|
||||||
'cm/lib/codemirror',
|
'cm/lib/codemirror',
|
||||||
'/common/test.js',
|
'/common/test.js',
|
||||||
@ -43,6 +44,7 @@ define([
|
|||||||
SframeCM,
|
SframeCM,
|
||||||
Thumb,
|
Thumb,
|
||||||
UI,
|
UI,
|
||||||
|
h,
|
||||||
Messages,
|
Messages,
|
||||||
CMeditor,
|
CMeditor,
|
||||||
Test)
|
Test)
|
||||||
@ -61,8 +63,6 @@ define([
|
|||||||
|
|
||||||
var debug = $.noop; //console.log;
|
var debug = $.noop; //console.log;
|
||||||
|
|
||||||
var HIDE_INTRODUCTION_TEXT = "hide-text";
|
|
||||||
|
|
||||||
var metadataMgr;
|
var metadataMgr;
|
||||||
var Title;
|
var Title;
|
||||||
var common;
|
var common;
|
||||||
@ -628,29 +628,6 @@ define([
|
|||||||
APP.editor.refresh();
|
APP.editor.refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
var updateHelpButton = function () {
|
|
||||||
if (!APP.$helpButton) { return; }
|
|
||||||
var help = $('#cp-app-poll-help').is(':visible');
|
|
||||||
var msg = (help ? Messages.poll_hide_help_button : Messages.poll_show_help_button);
|
|
||||||
APP.$helpButton.attr('title', msg);
|
|
||||||
if (help) {
|
|
||||||
APP.$helpButton.addClass('cp-toolbar-button-active');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
APP.$helpButton.removeClass('cp-toolbar-button-active');
|
|
||||||
};
|
|
||||||
var showHelp = function(help) {
|
|
||||||
if (typeof help === 'undefined') {
|
|
||||||
help = !$('#cp-app-poll-help').is(':visible');
|
|
||||||
}
|
|
||||||
|
|
||||||
var msg = (help ? Messages.poll_hide_help_button : Messages.poll_show_help_button);
|
|
||||||
|
|
||||||
$('#cp-app-poll-help').toggle(help);
|
|
||||||
$('#cp-app-poll-action-help').text(msg);
|
|
||||||
updateHelpButton();
|
|
||||||
};
|
|
||||||
|
|
||||||
var setEditable = function (editable) {
|
var setEditable = function (editable) {
|
||||||
APP.locked = APP.readOnly || !editable;
|
APP.locked = APP.readOnly || !editable;
|
||||||
|
|
||||||
@ -843,6 +820,7 @@ define([
|
|||||||
var checkDeletedCells = function () {
|
var checkDeletedCells = function () {
|
||||||
// faster than forEach?
|
// faster than forEach?
|
||||||
var c;
|
var c;
|
||||||
|
if (!APP.proxy || !APP.proxy.content) { return; }
|
||||||
for (var k in APP.proxy.content.cells) {
|
for (var k in APP.proxy.content.cells) {
|
||||||
c = Render.getCoordinates(k);
|
c = Render.getCoordinates(k);
|
||||||
if (APP.proxy.content.colsOrder.indexOf(c[0]) === -1 ||
|
if (APP.proxy.content.colsOrder.indexOf(c[0]) === -1 ||
|
||||||
@ -1087,7 +1065,7 @@ define([
|
|||||||
setTimeout(waitFor());
|
setTimeout(waitFor());
|
||||||
}).nThen(function (waitFor) {
|
}).nThen(function (waitFor) {
|
||||||
// Switch to non-admin mode
|
// Switch to non-admin mode
|
||||||
$('.cp-toolbar-rightside-button.fa-check').click();
|
$('.cp-toolbar-icon-publish').click();
|
||||||
setTimeout(waitFor());
|
setTimeout(waitFor());
|
||||||
}).nThen(function (waitFor) {
|
}).nThen(function (waitFor) {
|
||||||
$('.cp-app-poll-comments-add-name').val("Mr.Me").keyup();
|
$('.cp-app-poll-comments-add-name').val("Mr.Me").keyup();
|
||||||
@ -1221,15 +1199,26 @@ define([
|
|||||||
var $export = common.createButton('export', true, {}, exportFile);
|
var $export = common.createButton('export', true, {}, exportFile);
|
||||||
$drawer.append($export);
|
$drawer.append($export);
|
||||||
|
|
||||||
var $help = common.createButton('', true).click(function () { showHelp(); })
|
var helpMenu = common.createHelpMenu();
|
||||||
.appendTo($rightside);
|
$('#cp-app-poll-form').prepend(helpMenu.menu);
|
||||||
APP.$helpButton = $help;
|
$drawer.append(helpMenu.button);
|
||||||
updateHelpButton();
|
var setHTML = function (e, html) {
|
||||||
|
e.innerHTML = html;
|
||||||
|
return e;
|
||||||
|
};
|
||||||
|
var help = h('div', [
|
||||||
|
setHTML(h('h1'), Messages.poll_subtitle),
|
||||||
|
h('p', Messages.poll_p_save),
|
||||||
|
h('p', Messages.poll_p_encryption)
|
||||||
|
]);
|
||||||
|
$(helpMenu.text).html($(help).html());
|
||||||
|
|
||||||
if (APP.readOnly) { publish(true); return; }
|
if (APP.readOnly) { publish(true); return; }
|
||||||
var $publish = common.createButton('', true)
|
var $publish = common.createButton('', true, {
|
||||||
.removeClass('fa-question').addClass('fa-check')
|
name: 'publish',
|
||||||
.click(function () { publish(!APP.proxy.published); }).appendTo($rightside);
|
icon: 'fa-check',
|
||||||
|
hiddenReadOnly: true
|
||||||
|
}).click(function () { publish(!APP.proxy.published); }).appendTo($rightside);
|
||||||
APP.$publishButton = $publish;
|
APP.$publishButton = $publish;
|
||||||
updatePublishButton();
|
updatePublishButton();
|
||||||
|
|
||||||
@ -1244,11 +1233,7 @@ define([
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
common.initFilePicker(fileDialogCfg);
|
common.initFilePicker(fileDialogCfg);
|
||||||
APP.$mediaTagButton = $('<button>', {
|
APP.$mediaTagButton = common.createButton('mediatag', true).click(function () {
|
||||||
title: Messages.filePickerButton,
|
|
||||||
'class': 'cp-toolbar-rightside-button fa fa-picture-o',
|
|
||||||
style: 'font-size: 17px'
|
|
||||||
}).click(function () {
|
|
||||||
var pickerCfg = {
|
var pickerCfg = {
|
||||||
types: ['file'],
|
types: ['file'],
|
||||||
where: ['root']
|
where: ['root']
|
||||||
@ -1274,16 +1259,9 @@ define([
|
|||||||
}).nThen(function (waitFor) {
|
}).nThen(function (waitFor) {
|
||||||
common.getSframeChannel().onReady(waitFor());
|
common.getSframeChannel().onReady(waitFor());
|
||||||
}).nThen(function (waitFor) {
|
}).nThen(function (waitFor) {
|
||||||
if (!AppConfig.displayCreationScreen) { return; }
|
common.handleNewFile(waitFor);
|
||||||
var priv = common.getMetadataMgr().getPrivateData();
|
|
||||||
if (priv.isNewFile) {
|
|
||||||
var c = (priv.settings.general && priv.settings.general.creation) || {};
|
|
||||||
if (c.skip && !priv.forceCreationScreen) {
|
|
||||||
return void common.createPad(c, waitFor());
|
|
||||||
}
|
|
||||||
common.getPadCreationScreen(c, waitFor());
|
|
||||||
}
|
|
||||||
}).nThen(function (/* waitFor */) {
|
}).nThen(function (/* waitFor */) {
|
||||||
|
console.log('here');
|
||||||
Test.registerInner(common.getSframeChannel());
|
Test.registerInner(common.getSframeChannel());
|
||||||
var metadataMgr = common.getMetadataMgr();
|
var metadataMgr = common.getMetadataMgr();
|
||||||
APP.locked = APP.readOnly = metadataMgr.getPrivateData().readOnly;
|
APP.locked = APP.readOnly = metadataMgr.getPrivateData().readOnly;
|
||||||
@ -1351,18 +1329,6 @@ define([
|
|||||||
})
|
})
|
||||||
.on('disconnect', onDisconnect)
|
.on('disconnect', onDisconnect)
|
||||||
.on('reconnect', onReconnect);
|
.on('reconnect', onReconnect);
|
||||||
|
|
||||||
common.getAttribute(['poll', HIDE_INTRODUCTION_TEXT], function (e, value) {
|
|
||||||
if (e) { console.error(e); }
|
|
||||||
if (!value) {
|
|
||||||
common.setAttribute(['poll', HIDE_INTRODUCTION_TEXT], "1", function (e) {
|
|
||||||
if (e) { console.error(e); }
|
|
||||||
});
|
|
||||||
showHelp(true);
|
|
||||||
} else {
|
|
||||||
showHelp(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
main();
|
main();
|
||||||
|
|||||||
@ -221,6 +221,16 @@ div#cp-app-slide-modal {
|
|||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
|
.cp-app-slide-isempty {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Navigation buttons */
|
/* Navigation buttons */
|
||||||
.cp-app-slide-modal-button {
|
.cp-app-slide-modal-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@ -9,6 +9,7 @@ define([
|
|||||||
'/common/common-util.js',
|
'/common/common-util.js',
|
||||||
'/common/common-hash.js',
|
'/common/common-hash.js',
|
||||||
'/common/common-interface.js',
|
'/common/common-interface.js',
|
||||||
|
'/common/diffMarked.js',
|
||||||
'/customize/messages.js',
|
'/customize/messages.js',
|
||||||
'cm/lib/codemirror',
|
'cm/lib/codemirror',
|
||||||
|
|
||||||
@ -53,6 +54,7 @@ define([
|
|||||||
Util,
|
Util,
|
||||||
Hash,
|
Hash,
|
||||||
UI,
|
UI,
|
||||||
|
DiffMd,
|
||||||
Messages,
|
Messages,
|
||||||
CMeditor)
|
CMeditor)
|
||||||
{
|
{
|
||||||
@ -71,9 +73,7 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
var mkSlidePreviewPane = function (framework, $contentContainer) {
|
var mkSlidePreviewPane = function (framework, $contentContainer) {
|
||||||
var $previewButton = framework._.sfCommon.createButton(null, true);
|
var $previewButton = framework._.sfCommon.createButton('preview', true);
|
||||||
$previewButton.removeClass('fa-question').addClass('fa-eye');
|
|
||||||
$previewButton.attr('title', Messages.previewButtonTitle);
|
|
||||||
$previewButton.click(function () {
|
$previewButton.click(function () {
|
||||||
var $c = $contentContainer;
|
var $c = $contentContainer;
|
||||||
if ($c.hasClass('cp-app-slide-preview')) {
|
if ($c.hasClass('cp-app-slide-preview')) {
|
||||||
@ -100,19 +100,16 @@ define([
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var mkPrintButton = function (framework, editor, $content, $print, $toolbarDrawer) {
|
var mkPrintButton = function (framework, editor, $content, $print) {
|
||||||
var $printButton = $('<button>', {
|
var $printButton = framework._.sfCommon.createButton('print', true);
|
||||||
title: Messages.printButtonTitle,
|
$printButton.click(function () {
|
||||||
'class': 'cp-toolbar-rightside-button fa fa-print',
|
|
||||||
style: 'font-size: 17px'
|
|
||||||
}).click(function () {
|
|
||||||
Slide.update(editor.getValue(), true);
|
Slide.update(editor.getValue(), true);
|
||||||
$print.html($content.html());
|
$print.html($content.html());
|
||||||
window.focus();
|
window.focus();
|
||||||
window.print();
|
window.print();
|
||||||
framework.feedback('PRINT_SLIDES');
|
framework.feedback('PRINT_SLIDES');
|
||||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.printText));
|
});
|
||||||
$toolbarDrawer.append($printButton);
|
framework._.toolbar.$drawer.append($printButton);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Flag to check if a file from the filepicker is a mediatag for the slides or a background image
|
// Flag to check if a file from the filepicker is a mediatag for the slides or a background image
|
||||||
@ -120,7 +117,7 @@ define([
|
|||||||
isBackground: false
|
isBackground: false
|
||||||
};
|
};
|
||||||
|
|
||||||
var mkSlideOptionsButton = function (framework, slideOptions, $toolbarDrawer) {
|
var mkSlideOptionsButton = function (framework, slideOptions) {
|
||||||
var metadataMgr = framework._.cpNfInner.metadataMgr;
|
var metadataMgr = framework._.cpNfInner.metadataMgr;
|
||||||
var updateSlideOptions = function (newOpt) {
|
var updateSlideOptions = function (newOpt) {
|
||||||
if (JSONSortify(newOpt) !== JSONSortify(slideOptions)) {
|
if (JSONSortify(newOpt) !== JSONSortify(slideOptions)) {
|
||||||
@ -317,14 +314,17 @@ define([
|
|||||||
return $container;
|
return $container;
|
||||||
};
|
};
|
||||||
|
|
||||||
var $slideOptions = $('<button>', {
|
var $optionsButton = framework._.sfCommon.createButton(null, true, {
|
||||||
|
icon: 'fa-cog',
|
||||||
title: Messages.slideOptionsTitle,
|
title: Messages.slideOptionsTitle,
|
||||||
'class': 'cp-toolbar-rightside-button fa fa-cog cp-hidden-if-readonly',
|
hiddenReadOnly: true,
|
||||||
style: 'font-size: 17px'
|
text: Messages.slideOptionsText,
|
||||||
}).click(function () {
|
name: 'options'
|
||||||
|
});
|
||||||
|
$optionsButton.click(function () {
|
||||||
$('body').append(createPrintDialog());
|
$('body').append(createPrintDialog());
|
||||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.slideOptionsText));
|
});
|
||||||
$toolbarDrawer.append($slideOptions);
|
framework._.toolbar.$drawer.append($optionsButton);
|
||||||
|
|
||||||
metadataMgr.onChange(function () {
|
metadataMgr.onChange(function () {
|
||||||
var md = metadataMgr.getMetadata();
|
var md = metadataMgr.getMetadata();
|
||||||
@ -361,17 +361,21 @@ define([
|
|||||||
framework.localChange();
|
framework.localChange();
|
||||||
};
|
};
|
||||||
|
|
||||||
var $back = $('<button>', {
|
var $back = framework._.sfCommon.createButton(null, true, {
|
||||||
id: SLIDE_BACKCOLOR_ID,
|
icon: 'fa-square',
|
||||||
'class': 'fa fa-square cp-toolbar-rightside-button cp-hidden-if-readonly',
|
title: Messages.backgroundButtonTitle,
|
||||||
'style': 'font-family: FontAwesome; color: #000;',
|
hiddenReadOnly: true,
|
||||||
title: Messages.backgroundButtonTitle
|
name: 'background',
|
||||||
|
style: 'color: #000;',
|
||||||
|
id: SLIDE_BACKCOLOR_ID
|
||||||
});
|
});
|
||||||
var $text = $('<button>', {
|
var $text = framework._.sfCommon.createButton(null, true, {
|
||||||
id: SLIDE_COLOR_ID,
|
icon: 'fa-i-cursor',
|
||||||
'class': 'fa fa-i-cursor cp-toolbar-rightside-button cp-hidden-if-readonly',
|
title: Messages.colorButtonTitle,
|
||||||
'style': 'font-family: FontAwesome; font-weight: bold; color: #fff;',
|
hiddenReadOnly: true,
|
||||||
title: Messages.colorButtonTitle
|
name: 'color',
|
||||||
|
style: 'font-weight: bold; color: #FFF;',
|
||||||
|
id: SLIDE_COLOR_ID
|
||||||
});
|
});
|
||||||
var $testColor = $('<input>', { type: 'color', value: '!' });
|
var $testColor = $('<input>', { type: 'color', value: '!' });
|
||||||
var $check = $("#cp-app-slide-colorpicker");
|
var $check = $("#cp-app-slide-colorpicker");
|
||||||
@ -426,6 +430,16 @@ define([
|
|||||||
framework._.toolbar.$rightside.append(markdownTb.button);
|
framework._.toolbar.$rightside.append(markdownTb.button);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var mkHelpMenu = function (framework) {
|
||||||
|
var $codeMirrorContainer = $('#cp-app-slide-editor-container');
|
||||||
|
var helpMenu = framework._.sfCommon.createHelpMenu();
|
||||||
|
$codeMirrorContainer.prepend(helpMenu.menu);
|
||||||
|
|
||||||
|
$(helpMenu.text).html(DiffMd.render(Messages.slideInitialState));
|
||||||
|
|
||||||
|
framework._.toolbar.$drawer.append(helpMenu.button);
|
||||||
|
};
|
||||||
|
|
||||||
var activateLinks = function ($content, framework) {
|
var activateLinks = function ($content, framework) {
|
||||||
$content.click(function (e) {
|
$content.click(function (e) {
|
||||||
if (!e.target) { return; }
|
if (!e.target) { return; }
|
||||||
@ -459,12 +473,13 @@ define([
|
|||||||
|
|
||||||
activateLinks($content, framework);
|
activateLinks($content, framework);
|
||||||
Slide.setModal(framework._.sfCommon, $modal, $content, slideOptions, Messages.slideInitialState);
|
Slide.setModal(framework._.sfCommon, $modal, $content, slideOptions, Messages.slideInitialState);
|
||||||
mkPrintButton(framework, editor, $content, $print, $toolbarDrawer);
|
mkPrintButton(framework, editor, $content, $print);
|
||||||
mkSlideOptionsButton(framework, slideOptions, $toolbarDrawer);
|
mkSlideOptionsButton(framework, slideOptions, $toolbarDrawer);
|
||||||
mkColorConfiguration(framework, $modal);
|
mkColorConfiguration(framework, $modal);
|
||||||
mkFilePicker(framework, editor);
|
mkFilePicker(framework, editor);
|
||||||
mkSlidePreviewPane(framework, $contentContainer);
|
mkSlidePreviewPane(framework, $contentContainer);
|
||||||
mkMarkdownToolbar(framework, editor);
|
mkMarkdownToolbar(framework, editor);
|
||||||
|
mkHelpMenu(framework);
|
||||||
|
|
||||||
CodeMirror.configureTheme(common);
|
CodeMirror.configureTheme(common);
|
||||||
|
|
||||||
@ -489,6 +504,8 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
framework.onReady(function (/*newPad*/) {
|
framework.onReady(function (/*newPad*/) {
|
||||||
|
editor.focus();
|
||||||
|
|
||||||
CodeMirror.setMode('markdown', function () { });
|
CodeMirror.setMode('markdown', function () { });
|
||||||
Slide.onChange(function (o, n, l) {
|
Slide.onChange(function (o, n, l) {
|
||||||
var slideNumber = '';
|
var slideNumber = '';
|
||||||
@ -519,7 +536,7 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
framework.onDefaultContentNeeded(function () {
|
framework.onDefaultContentNeeded(function () {
|
||||||
CodeMirror.contentUpdate({ content: Messages.slideInitialState });
|
CodeMirror.contentUpdate({ content: '' });
|
||||||
});
|
});
|
||||||
|
|
||||||
Slide.setTitle(framework._.title);
|
Slide.setTitle(framework._.title);
|
||||||
@ -539,14 +556,10 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
var getThumbnailContainer = function () {
|
var getThumbnailContainer = function () {
|
||||||
var $codeMirror = $('.CodeMirror');
|
|
||||||
var $c = $('#cp-app-slide-editor');
|
var $c = $('#cp-app-slide-editor');
|
||||||
if ($c.hasClass('cp-app-slide-preview')) {
|
if ($c.hasClass('cp-app-slide-preview')) {
|
||||||
return $('.cp-app-slide-frame').first()[0];
|
return $('.cp-app-slide-frame').first()[0];
|
||||||
}
|
}
|
||||||
if ($codeMirror.length) {
|
|
||||||
return $codeMirror[0];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var main = function () {
|
var main = function () {
|
||||||
|
|||||||
@ -75,6 +75,20 @@ define([
|
|||||||
if (typeof(Slide.content) !== 'string') { return; }
|
if (typeof(Slide.content) !== 'string') { return; }
|
||||||
|
|
||||||
var c = Slide.content;
|
var c = Slide.content;
|
||||||
|
|
||||||
|
if (c === '') {
|
||||||
|
var $empty = $('<img>', {
|
||||||
|
src: '/customize/main-favicon.png',
|
||||||
|
alt: '',
|
||||||
|
class: 'cp-app-code-preview-empty'
|
||||||
|
});
|
||||||
|
$content.html('').append($empty);
|
||||||
|
$content.addClass('cp-app-slide-isempty');
|
||||||
|
return;
|
||||||
|
//c = $('<div>').append($empty).html();
|
||||||
|
}
|
||||||
|
$content.removeClass('cp-app-slide-isempty');
|
||||||
|
|
||||||
var mediatagBg = '';
|
var mediatagBg = '';
|
||||||
if (options.background && options.background.mt) {
|
if (options.background && options.background.mt) {
|
||||||
mediatagBg = options.background.mt;
|
mediatagBg = options.background.mt;
|
||||||
@ -125,7 +139,6 @@ define([
|
|||||||
|
|
||||||
change(null, Slide.index);
|
change(null, Slide.index);
|
||||||
Common.setPresentUrl(true);
|
Common.setPresentUrl(true);
|
||||||
$('.cp-app-slide-present-button').hide();
|
|
||||||
updateFontSize();
|
updateFontSize();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -133,8 +146,6 @@ define([
|
|||||||
Common.setTabTitle(); // Remove the slide number from the title
|
Common.setTabTitle(); // Remove the slide number from the title
|
||||||
Common.setPresentUrl(false);
|
Common.setPresentUrl(false);
|
||||||
change(Slide.index, null);
|
change(Slide.index, null);
|
||||||
$('.cp-app-slide-present-button').show();
|
|
||||||
$('.cp-app-slide-source-button').hide();
|
|
||||||
$modal.removeClass('cp-app-slide-shown');
|
$modal.removeClass('cp-app-slide-shown');
|
||||||
updateFontSize();
|
updateFontSize();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -147,6 +147,8 @@ define([
|
|||||||
$span.text($input.val().trim());
|
$span.text($input.val().trim());
|
||||||
$span.show();
|
$span.show();
|
||||||
}
|
}
|
||||||
|
}).on('click mousedown', function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
}).appendTo($taskDiv);
|
}).appendTo($taskDiv);
|
||||||
|
|
||||||
$span.text(entry.task)
|
$span.text(entry.task)
|
||||||
|
|||||||
@ -31,10 +31,24 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cp-toolbar-rightside {
|
||||||
|
.cp-toolbar-icon-savetodrive { order: 13; }
|
||||||
|
.cp-toolbar-icon-embedImage { order: 12; }
|
||||||
|
.cp-toolbar-icon-mediatag { order: 11; }
|
||||||
|
.cp-toolbar-icon-color { order: 10; }
|
||||||
|
}
|
||||||
|
|
||||||
#cp-app-whiteboard-media-hidden {
|
#cp-app-whiteboard-media-hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#cp-app-whiteboard-container {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
// created in the html
|
// created in the html
|
||||||
#cp-app-whiteboard-canvas-area {
|
#cp-app-whiteboard-canvas-area {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@ -44,6 +58,8 @@
|
|||||||
.cp-app-whiteboard-canvas-container {
|
.cp-app-whiteboard-canvas-container {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background: white;
|
background: white;
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
& > canvas {
|
& > canvas {
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
@ -64,7 +80,7 @@
|
|||||||
border-top: 1px solid black;
|
border-top: 1px solid black;
|
||||||
background: white;
|
background: white;
|
||||||
|
|
||||||
padding: 1em;
|
padding: 10px;
|
||||||
|
|
||||||
& > * + * {
|
& > * + * {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -120,7 +136,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
padding: 1em;
|
padding: 10px;
|
||||||
|
|
||||||
span.cp-app-whiteboard-palette-color {
|
span.cp-app-whiteboard-palette-color {
|
||||||
height: 4vw;
|
height: 4vw;
|
||||||
|
|||||||
@ -312,12 +312,13 @@ define([
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var $color = APP.$color = $('<button>', {
|
var $color = APP.$color = common.createButton(null, true, {
|
||||||
id: "cp-app-whiteboard-color-picker",
|
icon: 'fa-square',
|
||||||
title: Messages.canvas_chooseColor,
|
title: Messages.canvas_chooseColor,
|
||||||
'class': "fa fa-square cp-toolbar-rightside-button",
|
name: 'color',
|
||||||
})
|
id: 'cp-app-whiteboard-color-picker'
|
||||||
.on('click', function () {
|
});
|
||||||
|
$color.on('click', function () {
|
||||||
pickColor($color.css('background-color'), function (color) {
|
pickColor($color.css('background-color'), function (color) {
|
||||||
setColor(color);
|
setColor(color);
|
||||||
});
|
});
|
||||||
@ -453,6 +454,14 @@ define([
|
|||||||
var $properties = common.createButton('properties', true);
|
var $properties = common.createButton('properties', true);
|
||||||
toolbar.$drawer.append($properties);
|
toolbar.$drawer.append($properties);
|
||||||
|
|
||||||
|
if (Messages.whiteboardHelp) {
|
||||||
|
var $appContainer = $('#cp-app-whiteboard-container');
|
||||||
|
var helpMenu = common.createHelpMenu();
|
||||||
|
$appContainer.prepend(helpMenu.menu);
|
||||||
|
$(helpMenu.text).html(Messages.whiteboardHelp);
|
||||||
|
toolbar.$drawer.append(helpMenu.button);
|
||||||
|
}
|
||||||
|
|
||||||
if (!readOnly) {
|
if (!readOnly) {
|
||||||
makeColorButton($rightside);
|
makeColorButton($rightside);
|
||||||
|
|
||||||
@ -469,10 +478,11 @@ define([
|
|||||||
};
|
};
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
};
|
};
|
||||||
common.createButton('', true)
|
common.createButton('', true, {
|
||||||
.attr('title', Messages.canvas_imageEmbed)
|
title: Messages.canvas_imageEmbed,
|
||||||
.removeClass('fa-question').addClass('fa-file-image-o')
|
icon: 'fa-file-image-o',
|
||||||
.click(function () {
|
name: 'embedImage'
|
||||||
|
}).click(function () {
|
||||||
$('<input>', {type:'file'}).on('change', onUpload).click();
|
$('<input>', {type:'file'}).on('change', onUpload).click();
|
||||||
}).appendTo($rightside);
|
}).appendTo($rightside);
|
||||||
|
|
||||||
@ -493,11 +503,7 @@ define([
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
common.initFilePicker(fileDialogCfg);
|
common.initFilePicker(fileDialogCfg);
|
||||||
APP.$mediaTagButton = $('<button>', {
|
APP.$mediaTagButton = common.createButton('mediatag', true).click(function () {
|
||||||
title: Messages.filePickerButton,
|
|
||||||
'class': 'cp-toolbar-rightside-button fa fa-picture-o',
|
|
||||||
style: 'font-size: 17px'
|
|
||||||
}).click(function () {
|
|
||||||
var pickerCfg = {
|
var pickerCfg = {
|
||||||
types: ['file'],
|
types: ['file'],
|
||||||
where: ['root'],
|
where: ['root'],
|
||||||
@ -662,15 +668,7 @@ define([
|
|||||||
}).nThen(function (waitFor) {
|
}).nThen(function (waitFor) {
|
||||||
common.getSframeChannel().onReady(waitFor());
|
common.getSframeChannel().onReady(waitFor());
|
||||||
}).nThen(function (waitFor) {
|
}).nThen(function (waitFor) {
|
||||||
if (!AppConfig.displayCreationScreen) { return; }
|
common.handleNewFile(waitFor);
|
||||||
var priv = common.getMetadataMgr().getPrivateData();
|
|
||||||
if (priv.isNewFile) {
|
|
||||||
var c = (priv.settings.general && priv.settings.general.creation) || {};
|
|
||||||
if (c.skip && !priv.forceCreationScreen) {
|
|
||||||
return void common.createPad(c, waitFor());
|
|
||||||
}
|
|
||||||
common.getPadCreationScreen(c, waitFor());
|
|
||||||
}
|
|
||||||
}).nThen(function (/*waitFor*/) {
|
}).nThen(function (/*waitFor*/) {
|
||||||
andThen(common);
|
andThen(common);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user