Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
@@ -10,7 +10,19 @@ CKEDITOR.editorConfig = function( config ) {
|
|||||||
// document itself and causes problems when it's sent across the wire and reflected back
|
// document itself and causes problems when it's sent across the wire and reflected back
|
||||||
config.removePlugins= 'resize';
|
config.removePlugins= 'resize';
|
||||||
config.extraPlugins= 'autolink,colorbutton,colordialog,font,indentblock,justify';
|
config.extraPlugins= 'autolink,colorbutton,colordialog,font,indentblock,justify';
|
||||||
config.toolbarGroups= [{"name":"clipboard","groups":["clipboard","undo"]},{"name":"editing","groups":["find","selection"]},{"name":"links"},{"name":"insert"},{"name":"forms"},{"name":"tools"},{"name":"document","groups":["mode","document","doctools"]},{"name":"others"},{"name":"basicstyles","groups":["basicstyles","cleanup"]},{"name":"paragraph","groups":["list","indent","blocks","align","bidi"]},{"name":"styles"},{"name":"colors"}];
|
config.toolbarGroups= [
|
||||||
|
// {"name":"clipboard","groups":["clipboard","undo"]},
|
||||||
|
//{"name":"editing","groups":["find","selection"]},
|
||||||
|
{"name":"links"},
|
||||||
|
{"name":"insert"},
|
||||||
|
{"name":"forms"},
|
||||||
|
{"name":"tools"},
|
||||||
|
{"name":"document","groups":["mode","document","doctools"]},
|
||||||
|
{"name":"others"},
|
||||||
|
{"name":"basicstyles","groups":["basicstyles","cleanup"]},
|
||||||
|
{"name":"paragraph","groups":["list","indent","blocks","align","bidi"]},
|
||||||
|
{"name":"styles"},
|
||||||
|
{"name":"colors"}];
|
||||||
|
|
||||||
config.font_defaultLabel = 'Arial';
|
config.font_defaultLabel = 'Arial';
|
||||||
config.fontSize_defaultLabel = '16';
|
config.fontSize_defaultLabel = '16';
|
||||||
|
|||||||
@@ -138,7 +138,13 @@ app.get('/api/config', function(req, res){
|
|||||||
var httpServer = httpsOpts ? Https.createServer(httpsOpts, app) : Http.createServer(app);
|
var httpServer = httpsOpts ? Https.createServer(httpsOpts, app) : Http.createServer(app);
|
||||||
|
|
||||||
httpServer.listen(config.httpPort,config.httpAddress,function(){
|
httpServer.listen(config.httpPort,config.httpAddress,function(){
|
||||||
console.log('[%s] listening on port %s', new Date().toISOString(), config.httpPort);
|
var host = config.httpAddress;
|
||||||
|
var hostName = !host.indexOf(':') ? '[' + host + ']' : host;
|
||||||
|
|
||||||
|
var port = config.httpPort;
|
||||||
|
var ps = port === 80? '': ':' + port;
|
||||||
|
|
||||||
|
console.log('\n[%s] server available http://%s%s', new Date().toISOString(), hostName, ps);
|
||||||
});
|
});
|
||||||
|
|
||||||
var wsConfig = { server: httpServer };
|
var wsConfig = { server: httpServer };
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
var href = '/common/feedback.html?' + action + '=' + (+new Date());
|
var href = '/common/feedback.html?' + action + '=' + (+new Date());
|
||||||
console.log('[feedback] %s', href);
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "HEAD",
|
type: "HEAD",
|
||||||
url: href,
|
url: href,
|
||||||
@@ -885,6 +884,21 @@ define([
|
|||||||
common.getPinnedUsage(todo);
|
common.getPinnedUsage(todo);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var getAppSuffix = function () {
|
||||||
|
var parts = window.location.pathname.split('/')
|
||||||
|
.filter(function (x) { return x; });
|
||||||
|
|
||||||
|
if (!parts[0]) { return ''; }
|
||||||
|
return '_' + parts[0].toUpperCase();
|
||||||
|
};
|
||||||
|
|
||||||
|
var prepareFeedback = function (key) {
|
||||||
|
if (typeof(key) !== 'string') { return $.noop; }
|
||||||
|
return function () {
|
||||||
|
feedback(key.toUpperCase() + getAppSuffix());
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
common.createButton = function (type, rightside, data, callback) {
|
common.createButton = function (type, rightside, data, callback) {
|
||||||
var button;
|
var button;
|
||||||
var size = "17px";
|
var size = "17px";
|
||||||
@@ -894,7 +908,7 @@ define([
|
|||||||
title: Messages.exportButtonTitle,
|
title: Messages.exportButtonTitle,
|
||||||
}).append($('<span>', {'class':'fa fa-download', style: 'font:'+size+' FontAwesome'}));
|
}).append($('<span>', {'class':'fa fa-download', style: 'font:'+size+' FontAwesome'}));
|
||||||
if (callback) {
|
if (callback) {
|
||||||
button.click(callback);
|
button.click(prepareFeedback(type)).click(callback);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'import':
|
case 'import':
|
||||||
@@ -902,7 +916,9 @@ define([
|
|||||||
title: Messages.importButtonTitle,
|
title: Messages.importButtonTitle,
|
||||||
}).append($('<span>', {'class':'fa fa-upload', style: 'font:'+size+' FontAwesome'}));
|
}).append($('<span>', {'class':'fa fa-upload', style: 'font:'+size+' FontAwesome'}));
|
||||||
if (callback) {
|
if (callback) {
|
||||||
button.click(UI.importContent('text/plain', function (content, file) {
|
button
|
||||||
|
.click(prepareFeedback(type))
|
||||||
|
.click(UI.importContent('text/plain', function (content, file) {
|
||||||
callback(content, file);
|
callback(content, file);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -913,7 +929,8 @@ define([
|
|||||||
title: Messages.saveTemplateButton,
|
title: Messages.saveTemplateButton,
|
||||||
}).append($('<span>', {'class':'fa fa-bookmark', style: 'font:'+size+' FontAwesome'}));
|
}).append($('<span>', {'class':'fa fa-bookmark', style: 'font:'+size+' FontAwesome'}));
|
||||||
if (data.rt && data.Crypt) {
|
if (data.rt && data.Crypt) {
|
||||||
button.click(function () {
|
button
|
||||||
|
.click(function () {
|
||||||
var title = data.getTitle() || document.title;
|
var title = data.getTitle() || document.title;
|
||||||
var todo = function (val) {
|
var todo = function (val) {
|
||||||
if (typeof(val) !== "string") { return; }
|
if (typeof(val) !== "string") { return; }
|
||||||
@@ -971,7 +988,9 @@ define([
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (callback) {
|
if (callback) {
|
||||||
button.click(function() {
|
button
|
||||||
|
.click(prepareFeedback(type))
|
||||||
|
.click(function() {
|
||||||
var href = window.location.href;
|
var href = window.location.href;
|
||||||
var msg = isLoggedIn() ? Messages.forgetPrompt : Messages.fm_removePermanentlyDialog;
|
var msg = isLoggedIn() ? Messages.forgetPrompt : Messages.fm_removePermanentlyDialog;
|
||||||
common.confirm(msg, function (yes) {
|
common.confirm(msg, function (yes) {
|
||||||
@@ -1027,7 +1046,9 @@ define([
|
|||||||
style: 'font:'+size+' FontAwesome'
|
style: 'font:'+size+' FontAwesome'
|
||||||
});
|
});
|
||||||
if (data.histConfig) {
|
if (data.histConfig) {
|
||||||
button.click(function () {
|
button
|
||||||
|
.click(prepareFeedback(type))
|
||||||
|
.click(function () {
|
||||||
common.getHistory(data.histConfig);
|
common.getHistory(data.histConfig);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1036,7 +1057,8 @@ define([
|
|||||||
button = $('<button>', {
|
button = $('<button>', {
|
||||||
'class': "fa fa-question",
|
'class': "fa fa-question",
|
||||||
style: 'font:'+size+' FontAwesome'
|
style: 'font:'+size+' FontAwesome'
|
||||||
});
|
})
|
||||||
|
.click(prepareFeedback(type));
|
||||||
}
|
}
|
||||||
if (rightside) {
|
if (rightside) {
|
||||||
button.addClass('rightside-button');
|
button.addClass('rightside-button');
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -487,8 +487,14 @@ define([
|
|||||||
var updateIcon = function () {
|
var updateIcon = function () {
|
||||||
$collapse.removeClass('fa-caret-down').removeClass('fa-caret-up');
|
$collapse.removeClass('fa-caret-down').removeClass('fa-caret-up');
|
||||||
var isCollapsed = !$bar.find('.cke_toolbox_main').is(':visible');
|
var isCollapsed = !$bar.find('.cke_toolbox_main').is(':visible');
|
||||||
if (isCollapsed) { $collapse.addClass('fa-caret-down'); }
|
if (isCollapsed) {
|
||||||
else { $collapse.addClass('fa-caret-up'); }
|
if (!initializing) { Cryptpad.feedback('HIDETOOLBAR_PAD'); }
|
||||||
|
$collapse.addClass('fa-caret-down');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!initializing) { Cryptpad.feedback('SHOWTOOLBAR_PAD'); }
|
||||||
|
$collapse.addClass('fa-caret-up');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
updateIcon();
|
updateIcon();
|
||||||
$collapse.click(function () {
|
$collapse.click(function () {
|
||||||
@@ -666,6 +672,19 @@ define([
|
|||||||
onLocal();
|
onLocal();
|
||||||
return test;
|
return test;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$bar.find('.cke_button').click(function () {
|
||||||
|
var e = this;
|
||||||
|
var classString = e.getAttribute('class');
|
||||||
|
var classes = classString.split(' ').filter(function (c) {
|
||||||
|
return /cke_button__/.test(c);
|
||||||
|
});
|
||||||
|
|
||||||
|
var id = classes[0];
|
||||||
|
if (typeof(id) === 'string') {
|
||||||
|
Cryptpad.feedback(id.toUpperCase());
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user