Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
@@ -155,9 +155,11 @@ define(req, function(Default, Language) {
|
|||||||
$('#pad-iframe').contents().find('[data-localization-title]').each(translateTitle);
|
$('#pad-iframe').contents().find('[data-localization-title]').each(translateTitle);
|
||||||
};
|
};
|
||||||
|
|
||||||
messages.driveReadme = '["BODY",{"class":"cke_editable cke_editable_themed cke_contents_ltr cke_show_borders","contenteditable":"true","spellcheck":"false","style":"color: rgb(51, 51, 51);"},' +
|
/*messages.driveReadme = '["BODY",{"class":"cke_editable cke_editable_themed cke_contents_ltr cke_show_borders","contenteditable":"true","spellcheck":"false","style":"color: rgb(51, 51, 51);"},' +
|
||||||
'[["H1",{},["' + messages.driveReadme_h1 + '",["BR",{},[]]]],["UL",{},[["LI",{},["' + messages.driveReadme_li1 + '",["BR",{},[]],["UL",{},[["LI",{},["' + messages.driveReadme_li1_1 + '",["BR",{},[]]]]]]]]]]],' +
|
'[["H1",{},["' + messages.driveReadme_h1 + '",["BR",{},[]]]],["UL",{},[["LI",{},["' + messages.driveReadme_li1 + '",["BR",{},[]],["UL",{},[["LI",{},["' + messages.driveReadme_li1_1 + '",["BR",{},[]]]]]]]]]]],' +
|
||||||
'{"metadata":{"defaultTitle":"' + messages.driveReadmeTitle + '","title":"' + messages.driveReadmeTitle + '"}}]';
|
'{"metadata":{"defaultTitle":"' + messages.driveReadmeTitle + '","title":"' + messages.driveReadmeTitle + '"}}]';
|
||||||
|
*/
|
||||||
|
messages.driveReadme = '[["H1",{},["'+messages.readme_welcome+'"]],["P",{},["'+messages.readme_p1+'"]],["P",{},["'+messages.readme_p2+'"]],["HR",{},[]],["H2",{},["'+messages.readme_cat1+'",["BR",{},[]]]],["UL",{},[["LI",{},["'+messages._getKey("readme_cat1_l1", ['",["STRONG",{},["'+messages.newButton+'"]],"', '",["STRONG",{},["'+messages.type.pad+'"]],"'])+'"]],["LI",{},["'+messages.readme_cat1_l2+'"]],["LI",{},["'+messages._getKey("readme_cat1_l3", ['",["STRONG",{},["'+messages.unsortedName+'"]],"'])+'",["UL",{},[["LI",{},["You can click and drag files into folders in the ",["STRONG",{},["Documents"]]," section of your drive and make new folders."]],["LI",{},["Remember to try right clicking on icons because there are often additional menus."]]]]]],["LI",{},["Put old pads in the trash: You can click and drag your pads into the ",["STRONG",{},["Trash"]]," the same way you drag them into folders.",["BR",{},[]]]]]],["P",{},[["BR",{},[]]]],["H2",{},["Make pads like a pro",["BR",{},[]]]],["UL",{},[["LI",{},["The ",["STRONG",{},["Share"]]," button in your pad allows you to give access to collaborators to either ",["STRONG",{},["edit"]]," or to ",["STRONG",{},["view"]]," the pad."]],["LI",{},["Change the title of the pad by clicking on the pencil"]]]],["P",{},[["BR",{},[]]]],["H2",{},["Discover CryptPad apps"]],["UL",{},[["LI",{},["With CryptPad code editor, you can collaborate on code like Javascript and markdown like HTML and Markdown"]],["LI",{},["With CryptPad slide editor, you can make quick presentations using Markdown"]],["LI",{},["With CryptPoll you can take quick votes, especially for scheduling meetings which fit with everybody\'s calander",["BR",{},[]]]]]]]';
|
||||||
|
|
||||||
return messages;
|
return messages;
|
||||||
|
|
||||||
|
|||||||
@@ -391,5 +391,13 @@ define(function () {
|
|||||||
out.driveReadme_li1 = "CryptDrive : all your pads sorted in one place";
|
out.driveReadme_li1 = "CryptDrive : all your pads sorted in one place";
|
||||||
out.driveReadme_li1_1 = "Tree, trash, unsorted files, etc.";
|
out.driveReadme_li1_1 = "Tree, trash, unsorted files, etc.";
|
||||||
|
|
||||||
|
out.readme_welcome = "Welcome to CryptPad !";
|
||||||
|
out.readme_p1 = "Welcome to CryptPad, this is where you can take note of things alone and with friends.";
|
||||||
|
out.readme_p2 = "This pad will give you a quick walk through of how you can use CryptPad to take notes, keep them organized and work together on them.";
|
||||||
|
out.readme_cat1 = "Get to know your CryptDrive";
|
||||||
|
out.readme_cat1_l1 = "Make a pad: In your CryptDrive, click {0} then {1} and you can make a pad.";
|
||||||
|
out.readme_cat1_l2 = "Open Pads from your CryptDrive: double-click on a pad icon to open it.";
|
||||||
|
out.readme_cat1_l3 = "Organize your pads: When you are logged in, every pad you access will be shown as in the {0} section of your drive.";
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ define([
|
|||||||
var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox');
|
var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox');
|
||||||
var parsedHash = Cryptpad.parsePadUrl(window.location.href);
|
var parsedHash = Cryptpad.parsePadUrl(window.location.href);
|
||||||
var defaultName = Cryptpad.getDefaultName(parsedHash);
|
var defaultName = Cryptpad.getDefaultName(parsedHash);
|
||||||
|
var initialState = Messages.codeInitialState;
|
||||||
|
|
||||||
var editor = module.editor = CMeditor.fromTextArea($textarea[0], {
|
var editor = module.editor = CMeditor.fromTextArea($textarea[0], {
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
@@ -68,7 +69,7 @@ define([
|
|||||||
mode: "javascript",
|
mode: "javascript",
|
||||||
readOnly: true
|
readOnly: true
|
||||||
});
|
});
|
||||||
editor.setOption('placeholder', Messages.codeInitialState);
|
editor.setValue(Messages.codeInitialState);
|
||||||
|
|
||||||
var setMode = module.setMode = function (mode, $select) {
|
var setMode = module.setMode = function (mode, $select) {
|
||||||
module.highlightMode = mode;
|
module.highlightMode = mode;
|
||||||
@@ -84,8 +85,6 @@ define([
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
editor.setValue('');
|
|
||||||
|
|
||||||
var setTheme = module.setTheme = (function () {
|
var setTheme = module.setTheme = (function () {
|
||||||
var path = '/common/theme/';
|
var path = '/common/theme/';
|
||||||
|
|
||||||
@@ -562,7 +561,9 @@ define([
|
|||||||
// Update the user list (metadata) from the hyperjson
|
// Update the user list (metadata) from the hyperjson
|
||||||
updateMetadata(userDoc);
|
updateMetadata(userDoc);
|
||||||
|
|
||||||
editor.setValue(newDoc || '');
|
if (newDoc) {
|
||||||
|
editor.setValue(newDoc);
|
||||||
|
}
|
||||||
|
|
||||||
if (Cryptpad.initialName && document.title === defaultName) {
|
if (Cryptpad.initialName && document.title === defaultName) {
|
||||||
updateTitle(Cryptpad.initialName);
|
updateTitle(Cryptpad.initialName);
|
||||||
|
|||||||
@@ -70,10 +70,16 @@ define([
|
|||||||
TextPatcher.create({
|
TextPatcher.create({
|
||||||
realtime: realtime,
|
realtime: realtime,
|
||||||
})(doc);
|
})(doc);
|
||||||
realtime.sync();
|
|
||||||
realtime.abort();
|
|
||||||
|
|
||||||
|
var to = window.setTimeout(function () {
|
||||||
|
cb(new Error("Timeout"));
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
|
Cryptpad.whenRealtimeSyncs(realtime, function () {
|
||||||
|
window.clearTimeout(to);
|
||||||
|
realtime.abort();
|
||||||
finish(Session, void 0);
|
finish(Session, void 0);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
overwrite(config, opt);
|
overwrite(config, opt);
|
||||||
|
|
||||||
|
|||||||
@@ -1903,9 +1903,11 @@ define([
|
|||||||
var createReadme = function (proxy, cb) {
|
var createReadme = function (proxy, cb) {
|
||||||
if (proxy.initializing) {
|
if (proxy.initializing) {
|
||||||
var hash = Cryptpad.createRandomHash();
|
var hash = Cryptpad.createRandomHash();
|
||||||
|
console.log(Messages.driveReadme);
|
||||||
Get.put(hash, Messages.driveReadme, function (e) {
|
Get.put(hash, Messages.driveReadme, function (e) {
|
||||||
if (e) { console.error(e); }
|
if (e) { console.error(e); }
|
||||||
var href = '/pad/#' + hash;
|
var href = '/pad/#' + hash;
|
||||||
|
console.log(href);
|
||||||
proxy.drive[UNSORTED].push(href);
|
proxy.drive[UNSORTED].push(href);
|
||||||
proxy.drive[FILES_DATA].push({
|
proxy.drive[FILES_DATA].push({
|
||||||
href: href,
|
href: href,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
||||||
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
|
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
|
||||||
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
|
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
|
||||||
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
|
|
||||||
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
|
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
|
||||||
<script src="/bower_components/ckeditor/ckeditor.js"></script>
|
<script src="/bower_components/ckeditor/ckeditor.js"></script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ define([
|
|||||||
$(inner).css({
|
$(inner).css({
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
});
|
});
|
||||||
documentBody.innerHTML = Messages.initialState;
|
//documentBody.innerHTML = Messages.initialState;
|
||||||
|
|
||||||
var cursor = window.cursor = Cursor(inner);
|
var cursor = window.cursor = Cursor(inner);
|
||||||
|
|
||||||
@@ -367,7 +367,8 @@ define([
|
|||||||
|
|
||||||
var realtimeOptions = {
|
var realtimeOptions = {
|
||||||
// provide initialstate...
|
// provide initialstate...
|
||||||
initialState: stringifyDOM(inner) || '{}',
|
//initialState: stringifyDOM(inner) || '{}',
|
||||||
|
initialState: '[]',
|
||||||
|
|
||||||
// the websocket URL
|
// the websocket URL
|
||||||
websocketURL: Cryptpad.getWebsocketURL(),
|
websocketURL: Cryptpad.getWebsocketURL(),
|
||||||
@@ -675,6 +676,11 @@ define([
|
|||||||
module.realtime = info.realtime;
|
module.realtime = info.realtime;
|
||||||
|
|
||||||
var shjson = info.realtime.getUserDoc();
|
var shjson = info.realtime.getUserDoc();
|
||||||
|
|
||||||
|
var newPad = false;
|
||||||
|
if (shjson === '[]') { newPad = true; }
|
||||||
|
|
||||||
|
if (!newPad) {
|
||||||
applyHjson(shjson);
|
applyHjson(shjson);
|
||||||
|
|
||||||
// Update the user list (metadata) from the hyperjson
|
// Update the user list (metadata) from the hyperjson
|
||||||
@@ -697,10 +703,14 @@ define([
|
|||||||
throw new Error();
|
throw new Error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
updateMetadata(shjson);
|
||||||
|
documentBody.innerHTML = Messages.initialState;
|
||||||
|
}
|
||||||
|
|
||||||
Cryptpad.getLastName(function (err, lastName) {
|
Cryptpad.getLastName(function (err, lastName) {
|
||||||
console.log("Unlocking editor");
|
console.log("Unlocking editor");
|
||||||
setEditable(true);
|
setEditable(!readOnly);
|
||||||
initializing = false;
|
initializing = false;
|
||||||
Cryptpad.removeLoadingScreen(emitResize);
|
Cryptpad.removeLoadingScreen(emitResize);
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ define([
|
|||||||
var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox');
|
var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox');
|
||||||
var parsedHash = Cryptpad.parsePadUrl(window.location.href);
|
var parsedHash = Cryptpad.parsePadUrl(window.location.href);
|
||||||
var defaultName = Cryptpad.getDefaultName(parsedHash);
|
var defaultName = Cryptpad.getDefaultName(parsedHash);
|
||||||
|
var initialState = Messages.slideInitialState;
|
||||||
|
|
||||||
var editor = module.editor = CMeditor.fromTextArea($textarea[0], {
|
var editor = module.editor = CMeditor.fromTextArea($textarea[0], {
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
@@ -88,7 +89,7 @@ define([
|
|||||||
mode: "javascript",
|
mode: "javascript",
|
||||||
readOnly: true
|
readOnly: true
|
||||||
});
|
});
|
||||||
editor.setOption('placeholder', Messages.slideInitialState);
|
editor.setValue(initialState);
|
||||||
|
|
||||||
var setMode = module.setMode = function (mode, $select) {
|
var setMode = module.setMode = function (mode, $select) {
|
||||||
module.highlightMode = mode;
|
module.highlightMode = mode;
|
||||||
@@ -102,8 +103,6 @@ define([
|
|||||||
};
|
};
|
||||||
setMode('markdown');
|
setMode('markdown');
|
||||||
|
|
||||||
editor.setValue('');
|
|
||||||
|
|
||||||
var setTheme = module.setTheme = (function () {
|
var setTheme = module.setTheme = (function () {
|
||||||
var path = '/common/theme/';
|
var path = '/common/theme/';
|
||||||
|
|
||||||
@@ -136,7 +135,7 @@ define([
|
|||||||
var $modal = $pad.contents().find('#modal');
|
var $modal = $pad.contents().find('#modal');
|
||||||
var $content = $pad.contents().find('#content');
|
var $content = $pad.contents().find('#content');
|
||||||
|
|
||||||
Slide.setModal($modal, $content, $pad, ifrw, Messages.slideInitialState);
|
Slide.setModal($modal, $content, $pad, ifrw, initialState);
|
||||||
|
|
||||||
var enterPresentationMode = function (shouldLog) {
|
var enterPresentationMode = function (shouldLog) {
|
||||||
Slide.show(true, $textarea.val());
|
Slide.show(true, $textarea.val());
|
||||||
@@ -634,7 +633,7 @@ define([
|
|||||||
// Update the user list (metadata) from the hyperjson
|
// Update the user list (metadata) from the hyperjson
|
||||||
updateMetadata(userDoc);
|
updateMetadata(userDoc);
|
||||||
|
|
||||||
editor.setValue(newDoc || '');
|
editor.setValue(newDoc || initialState);
|
||||||
Slide.update(newDoc);
|
Slide.update(newDoc);
|
||||||
|
|
||||||
if (Cryptpad.initialName && APP.title === defaultName) {
|
if (Cryptpad.initialName && APP.title === defaultName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user