Merge branch 'code2' of github.com:xwiki-labs/cryptpad into code2
This commit is contained in:
@@ -280,28 +280,13 @@ define([
|
||||
};
|
||||
};
|
||||
|
||||
var $fileIcon = $('<span>', {"class": "fa fa-file-text-o file icon"});
|
||||
var $fileAppIcon = $('<span>', {"class": "fa fa-file-text-o file icon fileColor"});
|
||||
var $padIcon = $('<span>', {"class": "fa fa-file-word-o file icon padColor"});
|
||||
var $codeIcon = $('<span>', {"class": "fa fa-file-code-o file icon codeColor"});
|
||||
var $slideIcon = $('<span>', {"class": "fa fa-file-powerpoint-o file icon slideColor"});
|
||||
var $pollIcon = $('<span>', {"class": "fa fa-calendar file icon pollColor"});
|
||||
var $whiteboardIcon = $('<span>', {"class": "fa fa-paint-brush whiteboardColor"});
|
||||
var $todoIcon = $('<span>', {"class": "fa fa-tasks todoColor"});
|
||||
var $contactsIcon = $('<span>', {"class": "fa fa-users friendsColor"});
|
||||
var $defaultIcon = $('<span>', {"class": "fa fa-file-text-o"});
|
||||
UI.getIcon = function (type) {
|
||||
var $icon;
|
||||
var $icon = $defaultIcon.clone();
|
||||
|
||||
switch(type) {
|
||||
case 'pad': $icon = $padIcon.clone(); break;
|
||||
case 'file': $icon = $fileAppIcon.clone(); break;
|
||||
case 'code': $icon = $codeIcon.clone(); break;
|
||||
case 'slide': $icon = $slideIcon.clone(); break;
|
||||
case 'poll': $icon = $pollIcon.clone(); break;
|
||||
case 'whiteboard': $icon = $whiteboardIcon.clone(); break;
|
||||
case 'todo': $icon = $todoIcon.clone(); break;
|
||||
case 'contacts': $icon = $contactsIcon.clone(); break;
|
||||
default: $icon = $fileIcon.clone();
|
||||
if (AppConfig.applicationsIcon && AppConfig.applicationsIcon[type]) {
|
||||
var appClass = ' cp-icon-color-'+type;
|
||||
$icon = $('<span>', {'class': 'fa ' + AppConfig.applicationsIcon[type] + appClass});
|
||||
}
|
||||
|
||||
return $icon;
|
||||
|
||||
@@ -1444,12 +1444,8 @@ define([
|
||||
var href = data.href;
|
||||
if (!href) { return $icon; }
|
||||
|
||||
if (href.indexOf('/pad/') !== -1) { $icon = common.getIcon('pad'); }
|
||||
else if (href.indexOf('/code/') !== -1) { $icon = common.getIcon('code'); }
|
||||
else if (href.indexOf('/slide/') !== -1) { $icon = common.getIcon('slide'); }
|
||||
else if (href.indexOf('/poll/') !== -1) { $icon = common.getIcon('poll'); }
|
||||
else if (href.indexOf('/whiteboard/') !== -1) { $icon = common.getIcon('whiteboard'); }
|
||||
else if (href.indexOf('/file/') !== -1) { $icon = common.getIcon('file'); }
|
||||
var type = common.parsePadUrl(href).type;
|
||||
$icon = common.getIcon(type);
|
||||
|
||||
return $icon;
|
||||
};
|
||||
@@ -1558,7 +1554,7 @@ define([
|
||||
// Container
|
||||
var $container = $(config.container);
|
||||
var containerConfig = {
|
||||
'class': 'dropdown-bar'
|
||||
'class': 'cp-dropdown-container'
|
||||
};
|
||||
if (config.buttonTitle) {
|
||||
containerConfig.title = config.buttonTitle;
|
||||
@@ -1571,14 +1567,14 @@ define([
|
||||
// Button
|
||||
var $button = $('<button>', {
|
||||
'class': ''
|
||||
}).append($('<span>', {'class': 'buttonTitle'}).html(config.text || ""));
|
||||
}).append($('<span>', {'class': 'cp-dropdown-button-title'}).html(config.text || ""));
|
||||
/*$('<span>', {
|
||||
'class': 'fa fa-caret-down',
|
||||
}).appendTo($button);*/
|
||||
|
||||
// Menu
|
||||
var $innerblock = $('<div>', {'class': 'cryptpad-dropdown dropdown-bar-content'});
|
||||
if (config.left) { $innerblock.addClass('left'); }
|
||||
var $innerblock = $('<div>', {'class': 'cp-dropdown-content'});
|
||||
if (config.left) { $innerblock.addClass('cp-dropdown-left'); }
|
||||
|
||||
config.options.forEach(function (o) {
|
||||
if (!isValidOption(o)) { return; }
|
||||
@@ -1591,8 +1587,8 @@ define([
|
||||
|
||||
var setActive = function ($el) {
|
||||
if ($el.length !== 1) { return; }
|
||||
$innerblock.find('.active').removeClass('active');
|
||||
$el.addClass('active');
|
||||
$innerblock.find('.cp-dropdown-element-active').removeClass('cp-dropdown-element(active');
|
||||
$el.addClass('cp-dropdown-element-active');
|
||||
var scroll = $el.position().top + $innerblock.scrollTop();
|
||||
if (scroll < $innerblock.scrollTop()) {
|
||||
$innerblock.scrollTop(scroll);
|
||||
@@ -1607,7 +1603,7 @@ define([
|
||||
|
||||
var show = function () {
|
||||
$innerblock.show();
|
||||
$innerblock.find('.active').removeClass('active');
|
||||
$innerblock.find('.cp-dropdown-element-active').removeClass('cp-dropdown-element-active');
|
||||
if (config.isSelect && value) {
|
||||
var $val = $innerblock.find('[data-value="'+value+'"]');
|
||||
setActive($val);
|
||||
@@ -1619,10 +1615,10 @@ define([
|
||||
$container.click(function (e) {
|
||||
e.stopPropagation();
|
||||
var state = $innerblock.is(':visible');
|
||||
$('.dropdown-bar-content').hide();
|
||||
$('.cp-dropdown-content').hide();
|
||||
try {
|
||||
$('iframe').each(function (idx, ifrw) {
|
||||
$(ifrw).contents().find('.dropdown-bar-content').hide();
|
||||
$(ifrw).contents().find('.cp-dropdown-content').hide();
|
||||
});
|
||||
} catch (er) {
|
||||
// empty try catch in case this iframe is problematic (cross-origin)
|
||||
@@ -1638,7 +1634,7 @@ define([
|
||||
var pressed = '';
|
||||
var to;
|
||||
$container.keydown(function (e) {
|
||||
var $value = $innerblock.find('[data-value].active');
|
||||
var $value = $innerblock.find('[data-value].cp-dropdown-element-active');
|
||||
if (e.which === 38) { // Up
|
||||
if ($value.length) {
|
||||
var $prev = $value.prev();
|
||||
@@ -1679,7 +1675,7 @@ define([
|
||||
value = val;
|
||||
var $val = $innerblock.find('[data-value="'+val+'"]');
|
||||
var textValue = name || $val.html() || val;
|
||||
$button.find('.buttonTitle').html(textValue);
|
||||
$button.find('.cp-dropdown-button-title').html(textValue);
|
||||
};
|
||||
$container.getValue = function () {
|
||||
return value || '';
|
||||
@@ -1826,7 +1822,7 @@ define([
|
||||
|
||||
var oldUrl;
|
||||
if (account && !config.static && store) {
|
||||
var $avatar = $userAdmin.find('.buttonTitle');
|
||||
var $avatar = $userAdmin.find('.cp-dropdown-button-title');
|
||||
var updateButton = function (newName) {
|
||||
var profile = store.getProfile();
|
||||
var url = profile && profile.avatar;
|
||||
|
||||
@@ -1,47 +1,50 @@
|
||||
@import (once) '../customize/src/less2/include/colortheme.less';
|
||||
@import '../customize/src/less2/include/modal.less';
|
||||
|
||||
#fileDialog {
|
||||
.cp-modal {
|
||||
.fileContainer {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.element {
|
||||
@darker: darken(@colortheme_modal-fg, 30%);
|
||||
|
||||
width: 200px;
|
||||
min-width: 200px;
|
||||
height: 1em;
|
||||
padding: 0.5em;
|
||||
margin: 5px;
|
||||
box-sizing: content-box;
|
||||
|
||||
text-align: left;
|
||||
line-height: 1em;
|
||||
cursor: pointer;
|
||||
|
||||
background-color: #111;
|
||||
color: @darker;
|
||||
|
||||
transition: all 0.1s;
|
||||
|
||||
&:hover {
|
||||
color: @colortheme_modal-fg;
|
||||
.fileDialog_main () {
|
||||
#fileDialog {
|
||||
display: none;
|
||||
.cp-modal {
|
||||
.fileContainer {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
.element {
|
||||
@darker: darken(@colortheme_modal-fg, 30%);
|
||||
|
||||
align-items: center;
|
||||
width: 200px;
|
||||
min-width: 200px;
|
||||
height: 1em;
|
||||
padding: 0.5em;
|
||||
margin: 5px;
|
||||
box-sizing: content-box;
|
||||
|
||||
.fa {
|
||||
text-align: left;
|
||||
line-height: 1em;
|
||||
cursor: pointer;
|
||||
margin-right: 0.5em;
|
||||
|
||||
background-color: #111;
|
||||
color: @darker;
|
||||
|
||||
transition: all 0.1s;
|
||||
|
||||
&:hover {
|
||||
color: @colortheme_modal-fg;
|
||||
}
|
||||
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
align-items: center;
|
||||
|
||||
.fa {
|
||||
cursor: pointer;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ define([
|
||||
};
|
||||
|
||||
var uid = function () {
|
||||
return 'file-' + String(Math.random()).substring(2);
|
||||
return 'cp-fileupload-element-' + String(Math.random()).substring(2);
|
||||
};
|
||||
|
||||
var $table = File.$table = $('<table>', { id: 'uploadStatus' });
|
||||
var $table = File.$table = $('<table>', { id: 'cp-fileupload-table' });
|
||||
var $thead = $('<tr>').appendTo($table);
|
||||
$('<td>').text(Messages.upload_name).appendTo($thead);
|
||||
$('<td>').text(Messages.upload_size).appendTo($thead);
|
||||
@@ -46,7 +46,7 @@ define([
|
||||
$('<td>').text(Messages.cancel).appendTo($thead);
|
||||
|
||||
var createTableContainer = function ($body) {
|
||||
File.$container = $('<div>', { id: 'uploadStatusContainer' }).append($table).appendTo($body);
|
||||
File.$container = $('<div>', { id: 'cp-fileupload' }).append($table).appendTo($body);
|
||||
return File.$container;
|
||||
};
|
||||
|
||||
@@ -74,11 +74,11 @@ define([
|
||||
|
||||
var $row = $table.find('tr[id="'+id+'"]');
|
||||
|
||||
$row.find('.upCancel').html('-');
|
||||
var $pv = $row.find('.progressValue');
|
||||
var $pb = $row.find('.progressContainer');
|
||||
var $pc = $row.find('.upProgress');
|
||||
var $link = $row.find('.upLink');
|
||||
$row.find('.cp-fileupload-table-cancel').html('-');
|
||||
var $pv = $row.find('.cp-fileupload-table-progress-value');
|
||||
var $pb = $row.find('.cp-fileupload-table-progress-container');
|
||||
var $pc = $row.find('.cp-fileupload-table-progress');
|
||||
var $link = $row.find('.cp-fileupload-table-link');
|
||||
|
||||
var sframeChan = common.getSframeChannel();
|
||||
|
||||
@@ -180,27 +180,27 @@ define([
|
||||
$table.show();
|
||||
var estimate = FileCrypto.computeEncryptedSize(obj.blob.byteLength, obj.metadata);
|
||||
|
||||
var $progressBar = $('<div>', {'class':'progressContainer'});
|
||||
var $progressValue = $('<span>', {'class':'progressValue'}).text(Messages.upload_pending);
|
||||
var $progressBar = $('<div>', {'class':'cp-fileupload-table-progress-container'});
|
||||
var $progressValue = $('<span>', {'class':'cp-fileupload-table-progress-value'}).text(Messages.upload_pending);
|
||||
|
||||
var $tr = $('<tr>', {id: id}).appendTo($table);
|
||||
|
||||
var $cancel = $('<span>', {'class': 'cancel fa fa-times'}).click(function () {
|
||||
var $cancel = $('<span>', {'class': 'cp-fileupload-table-cancel-button fa fa-times'}).click(function () {
|
||||
queue.queue = queue.queue.filter(function (el) { return el.id !== id; });
|
||||
$cancel.remove();
|
||||
$tr.find('.upCancel').text('-');
|
||||
$tr.find('.progressValue').text(Messages.upload_cancelled);
|
||||
$tr.find('.cp-fileupload-table-cancel').text('-');
|
||||
$tr.find('.cp-fileupload-table-progress-value').text(Messages.upload_cancelled);
|
||||
});
|
||||
|
||||
var $link = $('<a>', {
|
||||
'class': 'upLink',
|
||||
'class': 'cp-fileupload-table-link',
|
||||
'rel': 'noopener noreferrer'
|
||||
}).text(obj.metadata.name);
|
||||
|
||||
$('<td>').append($link).appendTo($tr);
|
||||
$('<td>').text(prettySize(estimate)).appendTo($tr);
|
||||
$('<td>', {'class': 'upProgress'}).append($progressBar).append($progressValue).appendTo($tr);
|
||||
$('<td>', {'class': 'upCancel'}).append($cancel).appendTo($tr);
|
||||
$('<td>', {'class': 'cp-fileupload-table-progress'}).append($progressBar).append($progressValue).appendTo($tr);
|
||||
$('<td>', {'class': 'cp-fileupload-table-cancel'}).append($cancel).appendTo($tr);
|
||||
|
||||
queue.next();
|
||||
};
|
||||
@@ -253,14 +253,14 @@ define([
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
counter++;
|
||||
$hoverArea.addClass('hovering');
|
||||
$hoverArea.addClass('cp-fileupload-hovering');
|
||||
})
|
||||
.on('dragleave', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
counter--;
|
||||
if (counter <= 0) {
|
||||
$hoverArea.removeClass('hovering');
|
||||
$hoverArea.removeClass('cp-fileupload-hovering');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -274,7 +274,7 @@ define([
|
||||
|
||||
var dropped = e.originalEvent.dataTransfer.files;
|
||||
counter = 0;
|
||||
$hoverArea.removeClass('hovering');
|
||||
$hoverArea.removeClass('cp-fileupload-hovering');
|
||||
onFileDrop(dropped, e);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -81,9 +81,9 @@ define([
|
||||
var states = [];
|
||||
var c = states.length - 1;
|
||||
|
||||
var $hist = $toolbar.find('.cryptpad-toolbar-history');
|
||||
var $left = $toolbar.find('.cryptpad-toolbar-leftside');
|
||||
var $right = $toolbar.find('.cryptpad-toolbar-rightside');
|
||||
var $hist = $toolbar.find('.cp-toolbar-history');
|
||||
var $left = $toolbar.find('.cp-toolbar-leftside');
|
||||
var $right = $toolbar.find('.cp-toolbar-rightside');
|
||||
var $cke = $toolbar.find('.cke_toolbox_main');
|
||||
|
||||
$hist.html('').show();
|
||||
@@ -111,9 +111,9 @@ define([
|
||||
var val = states[i].getContent().doc;
|
||||
c = i;
|
||||
if (typeof onUpdate === "function") { onUpdate(); }
|
||||
$hist.find('.next, .previous').css('visibility', '');
|
||||
if (c === states.length - 1) { $hist.find('.next').css('visibility', 'hidden'); }
|
||||
if (c === 0) { $hist.find('.previous').css('visibility', 'hidden'); }
|
||||
$hist.find('.cp-toolbar-history-next, .cp-toolbar-history-previous').css('visibility', '');
|
||||
if (c === states.length - 1) { $hist.find('.cp-toolbar-history-next').css('visibility', 'hidden'); }
|
||||
if (c === 0) { $hist.find('.cp-toolbar-history-previous').css('visibility', 'hidden'); }
|
||||
return val || '';
|
||||
};
|
||||
|
||||
@@ -128,18 +128,18 @@ define([
|
||||
var display = function () {
|
||||
$hist.html('');
|
||||
var $prev =$('<button>', {
|
||||
'class': 'previous fa fa-step-backward buttonPrimary',
|
||||
'class': 'cp-toolbar-history-previous fa fa-step-backward buttonPrimary',
|
||||
title: Messages.history_prev
|
||||
}).appendTo($hist);
|
||||
var $nav = $('<div>', {'class': 'goto'}).appendTo($hist);
|
||||
var $nav = $('<div>', {'class': 'cp-toolbar-history-goto'}).appendTo($hist);
|
||||
var $next = $('<button>', {
|
||||
'class': 'next fa fa-step-forward buttonPrimary',
|
||||
'class': 'cp-toolbar-history-next fa fa-step-forward buttonPrimary',
|
||||
title: Messages.history_next
|
||||
}).appendTo($hist);
|
||||
|
||||
$('<label>').text(Messages.history_version).appendTo($nav);
|
||||
var $cur = $('<input>', {
|
||||
'class' : 'gotoInput',
|
||||
'class' : 'cp-toolbar-history-goto-input',
|
||||
'type' : 'number',
|
||||
'min' : '1',
|
||||
'max' : states.length
|
||||
@@ -150,11 +150,11 @@ define([
|
||||
var $label2 = $('<label>').text(' / '+ states.length).appendTo($nav);
|
||||
$('<br>').appendTo($nav);
|
||||
var $close = $('<button>', {
|
||||
'class':'closeHistory',
|
||||
'class':'cp-toolbar-history-close',
|
||||
title: Messages.history_closeTitle
|
||||
}).text(Messages.history_closeTitle).appendTo($nav);
|
||||
var $rev = $('<button>', {
|
||||
'class':'revertHistory buttonSuccess',
|
||||
'class':'cp-toolbar-history-revert buttonSuccess',
|
||||
title: Messages.history_restoreTitle
|
||||
}).text(Messages.history_restore).appendTo($nav);
|
||||
if (History.readOnly) { $rev.hide(); }
|
||||
@@ -170,6 +170,7 @@ define([
|
||||
$left.show();
|
||||
$right.show();
|
||||
$cke.show();
|
||||
$(window).trigger('resize');
|
||||
};
|
||||
|
||||
// Buttons actions
|
||||
@@ -203,6 +204,7 @@ define([
|
||||
|
||||
// Display the latest content
|
||||
render(get(c));
|
||||
$(window).trigger('resize');
|
||||
};
|
||||
|
||||
// Load all the history messages into a new chainpad object
|
||||
|
||||
@@ -39,7 +39,7 @@ define([
|
||||
var MutationObserver = window.MutationObserver;
|
||||
var displayDefault = function () {
|
||||
var text = Cryptpad.getFirstEmojiOrCharacter(name);
|
||||
var $avatar = $('<span>', {'class': 'default'}).text(text);
|
||||
var $avatar = $('<span>', {'class': 'cp-avatar-default'}).text(text);
|
||||
$container.append($avatar);
|
||||
if (cb) { cb(); }
|
||||
};
|
||||
@@ -207,7 +207,7 @@ define([
|
||||
|
||||
var $displayName = $userAdmin.find('.'+displayNameCls);
|
||||
|
||||
var $avatar = $userAdmin.find('.buttonTitle');
|
||||
var $avatar = $userAdmin.find('.cp-dropdown-button-title');
|
||||
var oldUrl;
|
||||
var updateButton = function () {
|
||||
var myData = metadataMgr.getUserData();
|
||||
@@ -220,7 +220,7 @@ define([
|
||||
UI.displayAvatar(Common, $avatar, url, newName, function ($img) {
|
||||
oldUrl = url;
|
||||
if ($img) {
|
||||
$userAdmin.find('button').addClass('avatar');
|
||||
$userAdmin.find('button').addClass('cp-avatar');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -271,7 +271,7 @@ define([
|
||||
};
|
||||
// Create modal
|
||||
var $blockContainer = Cryptpad.createModal({
|
||||
id: 'fileDialog',
|
||||
id: 'cp-filepicker-dialog',
|
||||
$body: cfg.$body,
|
||||
onClose: hideFileDialog
|
||||
}).show();
|
||||
@@ -283,7 +283,7 @@ define([
|
||||
var to;
|
||||
$('<input>', {
|
||||
type: 'text',
|
||||
'class': 'filter',
|
||||
'class': 'cp-filepicker-filter',
|
||||
'placeholder': Messages.filePicker_filter
|
||||
}).appendTo($filter).on('keypress', function () {
|
||||
if (to) { window.clearTimeout(to); }
|
||||
@@ -292,11 +292,11 @@ define([
|
||||
$filter.append(common.createButton('upload', false, cfg.data, function () {
|
||||
hideFileDialog();
|
||||
}));
|
||||
var $container = $('<span>', {'class': 'fileContainer'}).appendTo($block);
|
||||
var $container = $('<span>', {'class': 'cp-filepicker-content'}).appendTo($block);
|
||||
// Update the files list when needed
|
||||
updateContainer = function () {
|
||||
$container.html('');
|
||||
var filter = $filter.find('.filter').val().trim();
|
||||
var filter = $filter.find('.cp-filepicker-filter').val().trim();
|
||||
var todo = function (err, list) {
|
||||
if (err) { return void console.error(err); }
|
||||
Object.keys(list).forEach(function (id) {
|
||||
@@ -306,7 +306,7 @@ define([
|
||||
return;
|
||||
}
|
||||
var $span = $('<span>', {
|
||||
'class': 'element',
|
||||
'class': 'cp-filepicker-content-element',
|
||||
'title': name,
|
||||
}).appendTo($container);
|
||||
$span.append(Cryptpad.getFileIcon(data));
|
||||
|
||||
@@ -62,7 +62,7 @@ define(['jquery'], function ($) {
|
||||
|
||||
metadataMgr.onChange(function () {
|
||||
var md = metadataMgr.getMetadata();
|
||||
$title.find('span.title').text(md.title || md.defaultTitle);
|
||||
$title.find('span.cp-toolbar-title-value').text(md.title || md.defaultTitle);
|
||||
$title.find('input').val(md.title || md.defaultTitle);
|
||||
exp.title = md.title;
|
||||
//exp.updateTitle(md.title || md.defaultTitle);
|
||||
|
||||
@@ -182,7 +182,7 @@ define([
|
||||
button = $('<button>', {
|
||||
'class': 'fa fa-download',
|
||||
title: Messages.exportButtonTitle,
|
||||
}).append($('<span>', {'class': 'drawer'}).text(Messages.exportButton));
|
||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.exportButton));
|
||||
|
||||
button.click(prepareFeedback(type));
|
||||
if (callback) {
|
||||
@@ -193,7 +193,7 @@ define([
|
||||
button = $('<button>', {
|
||||
'class': 'fa fa-upload',
|
||||
title: Messages.importButtonTitle,
|
||||
}).append($('<span>', {'class': 'drawer'}).text(Messages.importButton));
|
||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.importButton));
|
||||
if (callback) {
|
||||
button
|
||||
.click(prepareFeedback(type))
|
||||
@@ -281,7 +281,7 @@ define([
|
||||
style: 'font:'+size+' FontAwesome'
|
||||
});
|
||||
if (!isStrongestStored()) {
|
||||
button.addClass('hidden');
|
||||
button.addClass('cp-toolbar-hidden');
|
||||
}
|
||||
if (callback) {
|
||||
button
|
||||
@@ -310,7 +310,7 @@ define([
|
||||
button = $('<button>', {
|
||||
title: Messages.historyButton,
|
||||
'class': "fa fa-history history",
|
||||
}).append($('<span>', {'class': 'drawer'}).text(Messages.historyText));
|
||||
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.historyText));
|
||||
if (data.histConfig) {
|
||||
button
|
||||
.click(prepareFeedback(type))
|
||||
@@ -322,7 +322,7 @@ define([
|
||||
case 'more':
|
||||
button = $('<button>', {
|
||||
title: Messages.moreActions || 'TODO',
|
||||
'class': "drawer-button fa fa-ellipsis-h",
|
||||
'class': "cp-toolbar-drawer-button fa fa-ellipsis-h",
|
||||
style: 'font:'+size+' FontAwesome'
|
||||
});
|
||||
break;
|
||||
@@ -334,7 +334,7 @@ define([
|
||||
.click(prepareFeedback(type));
|
||||
}
|
||||
if (rightside) {
|
||||
button.addClass('rightside-button');
|
||||
button.addClass('cp-toolbar-rightside-button');
|
||||
}
|
||||
return button;
|
||||
};
|
||||
|
||||
@@ -64,8 +64,8 @@ define([
|
||||
'class': USER_CLS
|
||||
}).appendTo($topContainer);
|
||||
$('<span>', {'class': LIMIT_CLS}).hide().appendTo($userContainer);
|
||||
$('<span>', {'class': NEWPAD_CLS + ' dropdown-bar'}).hide().appendTo($userContainer);
|
||||
$('<span>', {'class': USERADMIN_CLS + ' dropdown-bar'}).hide().appendTo($userContainer);
|
||||
$('<span>', {'class': NEWPAD_CLS + ' cp-dropdown-container'}).hide().appendTo($userContainer);
|
||||
$('<span>', {'class': USERADMIN_CLS + ' cp-dropdown-container'}).hide().appendTo($userContainer);
|
||||
|
||||
$toolbar.append($topContainer)
|
||||
.append($('<div>', {'class': LEFTSIDE_CLS}))
|
||||
@@ -75,7 +75,7 @@ define([
|
||||
var $rightside = $toolbar.find('.'+RIGHTSIDE_CLS);
|
||||
if (!config.hideDrawer) {
|
||||
var $drawerContent = $('<div>', {
|
||||
'class': DRAWER_CLS,// + ' dropdown-bar-content cryptpad-dropdown'
|
||||
'class': DRAWER_CLS,
|
||||
'tabindex': 1
|
||||
}).appendTo($rightside).hide();
|
||||
var $drawer = Cryptpad.createButton('more', true).appendTo($rightside);
|
||||
@@ -270,7 +270,7 @@ define([
|
||||
var fa_editusers = '<span class="fa fa-users"></span>';
|
||||
var fa_viewusers = '<span class="fa fa-eye"></span>';
|
||||
var $spansmall = $('<span>').html(fa_editusers + ' ' + numberOfEditUsers + ' ' + fa_viewusers + ' ' + numberOfViewUsers);
|
||||
$userButtons.find('.buttonTitle').html('').append($spansmall);
|
||||
$userButtons.find('.cp-dropdown-button-title').html('').append($spansmall);
|
||||
|
||||
updateDisplayName(toolbar, config);
|
||||
};
|
||||
@@ -311,7 +311,7 @@ define([
|
||||
var $container = $('<span>', {id: 'userButtons', title: Messages.userListButton});
|
||||
|
||||
var $button = $('<button>').appendTo($container);
|
||||
$('<span>',{'class': 'buttonTitle'}).appendTo($button);
|
||||
$('<span>',{'class': 'cp-dropdown-button-title'}).appendTo($button);
|
||||
|
||||
toolbar.$leftside.prepend($container);
|
||||
|
||||
@@ -444,7 +444,7 @@ define([
|
||||
};
|
||||
var $shareBlock = Cryptpad.createDropdown(dropdownConfigShare);
|
||||
//$shareBlock.find('button').attr('id', 'shareButton');
|
||||
$shareBlock.find('.dropdown-bar-content').addClass(SHARE_CLS).addClass(EDITSHARE_CLS).addClass(VIEWSHARE_CLS);
|
||||
$shareBlock.find('.cp-dropdown-content').addClass(SHARE_CLS).addClass(EDITSHARE_CLS).addClass(VIEWSHARE_CLS);
|
||||
$shareBlock.addClass('shareButton');
|
||||
$shareBlock.find('button').attr('title', Messages.shareButton);
|
||||
|
||||
@@ -731,9 +731,6 @@ define([
|
||||
};
|
||||
|
||||
var createNewPad = function (toolbar) {
|
||||
/*var $newPad = $('<span>', {
|
||||
'class': NEWPAD_CLS + " dropdown-bar"
|
||||
}).appendTo(toolbar.$top);*/
|
||||
var $newPad = toolbar.$top.find('.'+NEWPAD_CLS).show();
|
||||
|
||||
var pads_options = [];
|
||||
@@ -822,7 +819,7 @@ define([
|
||||
// Events
|
||||
var initClickEvents = function (toolbar, config) {
|
||||
var removeDropdowns = function () {
|
||||
toolbar.$toolbar.find('.cryptpad-dropdown').hide();
|
||||
toolbar.$toolbar.find('.cp-dropdown-content').hide();
|
||||
};
|
||||
var cancelEditTitle = function (e) {
|
||||
// Now we want to apply the title even if we click somewhere else
|
||||
|
||||
@@ -14,36 +14,37 @@ define([
|
||||
var SPINNER_DISAPPEAR_TIME = 1000;
|
||||
|
||||
// Toolbar parts
|
||||
var TOOLBAR_CLS = Bar.constants.toolbar = 'cryptpad-toolbar';
|
||||
var TOP_CLS = Bar.constants.top = 'cryptpad-toolbar-top';
|
||||
var LEFTSIDE_CLS = Bar.constants.leftside = 'cryptpad-toolbar-leftside';
|
||||
var RIGHTSIDE_CLS = Bar.constants.rightside = 'cryptpad-toolbar-rightside';
|
||||
var DRAWER_CLS = Bar.constants.drawer = 'drawer-content';
|
||||
var HISTORY_CLS = Bar.constants.history = 'cryptpad-toolbar-history';
|
||||
var TOOLBAR_CLS = Bar.constants.toolbar = 'cp-toolbar';
|
||||
var TOP_CLS = Bar.constants.top = 'cp-toolbar-top';
|
||||
var LEFTSIDE_CLS = Bar.constants.leftside = 'cp-toolbar-leftside';
|
||||
var RIGHTSIDE_CLS = Bar.constants.rightside = 'cp-toolbar-rightside';
|
||||
var DRAWER_CLS = Bar.constants.drawer = 'cp-toolbar-drawer-content';
|
||||
var HISTORY_CLS = Bar.constants.history = 'cp-toolbar-history';
|
||||
|
||||
// Userlist
|
||||
var USERLIST_CLS = Bar.constants.userlist = "cryptpad-dropdown-users";
|
||||
var EDITSHARE_CLS = Bar.constants.editShare = "cryptpad-dropdown-editShare";
|
||||
var VIEWSHARE_CLS = Bar.constants.viewShare = "cryptpad-dropdown-viewShare";
|
||||
var SHARE_CLS = Bar.constants.viewShare = "cryptpad-dropdown-share";
|
||||
var USERLIST_CLS = Bar.constants.userlist = "cp-toolbar-users";
|
||||
var EDITSHARE_CLS = Bar.constants.editShare = "cp-toolbar-share-edit";
|
||||
var VIEWSHARE_CLS = Bar.constants.viewShare = "cp-toolbar-share-view";
|
||||
var SHARE_CLS = Bar.constants.viewShare = "cp-toolbar-share";
|
||||
|
||||
// Top parts
|
||||
var USER_CLS = Bar.constants.userAdmin = "cryptpad-user";
|
||||
var SPINNER_CLS = Bar.constants.spinner = 'cryptpad-spinner';
|
||||
var LIMIT_CLS = Bar.constants.lag = 'cryptpad-limit';
|
||||
var TITLE_CLS = Bar.constants.title = "cryptpad-title";
|
||||
var NEWPAD_CLS = Bar.constants.newpad = "cryptpad-new";
|
||||
var USER_CLS = Bar.constants.userAdmin = "cp-toolbar-user";
|
||||
var SPINNER_CLS = Bar.constants.spinner = 'cp-toolbar-spinner';
|
||||
var LIMIT_CLS = Bar.constants.limit = 'cp-toolbar-limit';
|
||||
var TITLE_CLS = Bar.constants.title = "cp-toolbar-title";
|
||||
var NEWPAD_CLS = Bar.constants.newpad = "cp-toolbar-new";
|
||||
var LINK_CLS = Bar.constants.link = "cp-toolbar-link";
|
||||
|
||||
// User admin menu
|
||||
var USERADMIN_CLS = Bar.constants.user = 'cryptpad-user-dropdown';
|
||||
var USERNAME_CLS = Bar.constants.username = 'cryptpad-toolbar-username';
|
||||
/*var READONLY_CLS = */Bar.constants.readonly = 'cryptpad-readonly';
|
||||
var USERBUTTON_CLS = Bar.constants.changeUsername = "cryptpad-change-username";
|
||||
var USERADMIN_CLS = Bar.constants.user = 'cp-toolbar-user-dropdown';
|
||||
var USERNAME_CLS = Bar.constants.username = 'cp-toolbar-user-name';
|
||||
/*var READONLY_CLS = */Bar.constants.readonly = 'cp-toolbar-readonly';
|
||||
var USERBUTTON_CLS = Bar.constants.changeUsername = "cp-toolbar-user-rename";
|
||||
|
||||
// Create the toolbar element
|
||||
|
||||
var uid = function () {
|
||||
return 'cryptpad-uid-' + String(Math.random()).substring(2);
|
||||
return 'cp-toolbar-uid-' + String(Math.random()).substring(2);
|
||||
};
|
||||
|
||||
var createRealtimeToolbar = function (config) {
|
||||
@@ -54,21 +55,14 @@ define([
|
||||
id: uid(),
|
||||
});
|
||||
|
||||
// TODO iframe
|
||||
// var parsed = Cryptpad.parsePadUrl(window.location.href);
|
||||
var parsed = { type:'pad' };
|
||||
if (typeof parsed.type === "string") {
|
||||
config.$container.parents('body').addClass('app-' + parsed.type);
|
||||
}
|
||||
|
||||
var $topContainer = $('<div>', {'class': TOP_CLS});
|
||||
$('<span>', {'class': 'filler'}).appendTo($topContainer);
|
||||
$('<span>', {'class': 'cp-toolbar-top-filler'}).appendTo($topContainer);
|
||||
var $userContainer = $('<span>', {
|
||||
'class': USER_CLS
|
||||
}).appendTo($topContainer);
|
||||
$('<span>', {'class': LIMIT_CLS}).hide().appendTo($userContainer);
|
||||
$('<span>', {'class': NEWPAD_CLS + ' dropdown-bar'}).hide().appendTo($userContainer);
|
||||
$('<span>', {'class': USERADMIN_CLS + ' dropdown-bar'}).hide().appendTo($userContainer);
|
||||
$('<span>', {'class': NEWPAD_CLS + ' cp-dropdown-container'}).hide().appendTo($userContainer);
|
||||
$('<span>', {'class': USERADMIN_CLS + ' cp-dropdown-container'}).hide().appendTo($userContainer);
|
||||
|
||||
$toolbar.append($topContainer)
|
||||
.append($('<div>', {'class': LEFTSIDE_CLS}))
|
||||
@@ -78,27 +72,27 @@ define([
|
||||
var $rightside = $toolbar.find('.'+RIGHTSIDE_CLS);
|
||||
if (!config.hideDrawer) {
|
||||
var $drawerContent = $('<div>', {
|
||||
'class': DRAWER_CLS,// + ' dropdown-bar-content cryptpad-dropdown'
|
||||
'class': DRAWER_CLS,
|
||||
'tabindex': 1
|
||||
}).appendTo($rightside).hide();
|
||||
var $drawer = Cryptpad.createButton('more', true).appendTo($rightside);
|
||||
var $drawer = Common.createButton('more', true).appendTo($rightside);
|
||||
$drawer.click(function () {
|
||||
$drawerContent.toggle();
|
||||
$drawer.removeClass('active');
|
||||
$drawer.removeClass('cp-toolbar-button-active');
|
||||
if ($drawerContent.is(':visible')) {
|
||||
$drawer.addClass('active');
|
||||
$drawer.addClass('cp-toolbar-button-active');
|
||||
$drawerContent.focus();
|
||||
}
|
||||
});
|
||||
var onBlur = function (e) {
|
||||
if (e.relatedTarget) {
|
||||
if ($(e.relatedTarget).is('.drawer-button')) { return; }
|
||||
if ($(e.relatedTarget).is('.cp-toolbar-drawer-button')) { return; }
|
||||
if ($(e.relatedTarget).parents('.'+DRAWER_CLS).length) {
|
||||
$(e.relatedTarget).blur(onBlur);
|
||||
return;
|
||||
}
|
||||
}
|
||||
$drawer.removeClass('active');
|
||||
$drawer.removeClass('cp-toolbar-button-active');
|
||||
$drawerContent.hide();
|
||||
};
|
||||
$drawerContent.blur(onBlur);
|
||||
@@ -106,7 +100,7 @@ define([
|
||||
|
||||
// The 'notitle' class removes the line added for the title with a small screen
|
||||
if (!config.title || typeof config.title !== "object") {
|
||||
$toolbar.addClass('notitle');
|
||||
$toolbar.addClass('cp-toolbar-notitle');
|
||||
}
|
||||
|
||||
$container.prepend($toolbar);
|
||||
@@ -185,15 +179,15 @@ define([
|
||||
var $editUsers = $userlistContent.find('.' + USERLIST_CLS).html('');
|
||||
Cryptpad.clearTooltips();
|
||||
|
||||
var $editUsersList = $('<div>', {'class': 'userlist-others'});
|
||||
var $editUsersList = $('<div>', {'class': 'cp-toolbar-userlist-others'});
|
||||
|
||||
// Editors
|
||||
var pendingFriends = Common.getPendingFriends();
|
||||
editUsersNames.forEach(function (data) {
|
||||
var name = data.name || Messages.anonymous;
|
||||
var $span = $('<span>', {'class': 'avatar'});
|
||||
var $rightCol = $('<span>', {'class': 'right-col'});
|
||||
var $nameSpan = $('<span>', {'class': 'name'}).text(name).appendTo($rightCol);
|
||||
var $span = $('<span>', {'class': 'cp-avatar'});
|
||||
var $rightCol = $('<span>', {'class': 'cp-toolbar-userlist-rightcol'});
|
||||
var $nameSpan = $('<span>', {'class': 'cp-toolbar-userlist-name'}).text(name).appendTo($rightCol);
|
||||
var isMe = data.curvePublic === user.curvePublic;
|
||||
if (Common.isLoggedIn() && data.curvePublic) {
|
||||
if (isMe) {
|
||||
@@ -203,11 +197,11 @@ define([
|
||||
$nameSpan.text(name);
|
||||
} else if (!friends[data.curvePublic]) {
|
||||
if (pendingFriends.indexOf(data.netfluxId) !== -1) {
|
||||
$('<span>', {'class': 'friend'}).text(Messages.userlist_pending)
|
||||
$('<span>', {'class': 'cp-toolbar-userlist-friend'}).text(Messages.userlist_pending)
|
||||
.appendTo($rightCol);
|
||||
} else {
|
||||
$('<span>', {
|
||||
'class': 'fa fa-user-plus friend',
|
||||
'class': 'fa fa-user-plus cp-toolbar-userlist-friend',
|
||||
'title': Messages._getKey('userlist_addAsFriendTitle', [
|
||||
name
|
||||
])
|
||||
@@ -219,7 +213,7 @@ define([
|
||||
}
|
||||
}
|
||||
if (data.profile) {
|
||||
$span.addClass('clickable');
|
||||
$span.addClass('cp-userlist-clickable');
|
||||
$span.click(function () {
|
||||
window.open(origin+'/profile/#' + data.profile);
|
||||
});
|
||||
@@ -242,7 +236,7 @@ define([
|
||||
|
||||
// Viewers
|
||||
if (numberOfViewUsers > 0) {
|
||||
var viewText = '<div class="viewer">';
|
||||
var viewText = '<div class="cp-toolbar-userlist-viewer">';
|
||||
var viewerText = numberOfViewUsers !== 1 ? Messages.viewers : Messages.viewer;
|
||||
viewText += numberOfViewUsers + ' ' + viewerText + '</div>';
|
||||
$editUsers.append(viewText);
|
||||
@@ -252,7 +246,7 @@ define([
|
||||
var fa_editusers = '<span class="fa fa-users"></span>';
|
||||
var fa_viewusers = '<span class="fa fa-eye"></span>';
|
||||
var $spansmall = $('<span>').html(fa_editusers + ' ' + numberOfEditUsers + ' ' + fa_viewusers + ' ' + numberOfViewUsers);
|
||||
$userButtons.find('.buttonTitle').html('').append($spansmall);
|
||||
$userButtons.find('.cp-dropdown-button-title').html('').append($spansmall);
|
||||
};
|
||||
|
||||
var initUserList = function (toolbar, config) {
|
||||
@@ -278,21 +272,21 @@ define([
|
||||
if (!config.metadataMgr) {
|
||||
throw new Error("You must provide a `metadataMgr` to display the userlist");
|
||||
}
|
||||
var $content = $('<div>', {'class': 'userlist-drawer'});
|
||||
var $content = $('<div>', {'class': 'cp-toolbar-userlist-drawer'});
|
||||
$content.on('drop dragover', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
});
|
||||
var $closeIcon = $('<span>', {"class": "fa fa-window-close close"}).appendTo($content);
|
||||
var $closeIcon = $('<span>', {"class": "fa fa-window-close cp-toolbar-userlist-drawer-close"}).appendTo($content);
|
||||
$('<h2>').text(Messages.users).appendTo($content);
|
||||
$('<p>', {'class': USERLIST_CLS}).appendTo($content);
|
||||
|
||||
toolbar.userlistContent = $content;
|
||||
|
||||
var $container = $('<span>', {id: 'userButtons', title: Messages.userListButton});
|
||||
var $container = $('<span>', {id: 'cp-toolbar-userlist-drawer-open', title: Messages.userListButton});
|
||||
|
||||
var $button = $('<button>').appendTo($container);
|
||||
$('<span>',{'class': 'buttonTitle'}).appendTo($button);
|
||||
$('<span>',{'class': 'cp-dropdown-button-title'}).appendTo($button);
|
||||
|
||||
toolbar.$leftside.prepend($container);
|
||||
|
||||
@@ -304,7 +298,7 @@ define([
|
||||
var mobile = $('body').width() <= 600;
|
||||
var hide = function () {
|
||||
$content.hide();
|
||||
$button.removeClass('active');
|
||||
$button.removeClass('cp-toolbar-button-active');
|
||||
$ck.css({
|
||||
'padding-left': '',
|
||||
});
|
||||
@@ -314,7 +308,7 @@ define([
|
||||
if (mobile) {
|
||||
$ck.hide();
|
||||
}
|
||||
$button.addClass('active');
|
||||
$button.addClass('cp-toolbar-button-active');
|
||||
$ck.css({
|
||||
'padding-left': '175px',
|
||||
});
|
||||
@@ -370,7 +364,7 @@ define([
|
||||
if (hashes.editHash) {
|
||||
options.push({
|
||||
tag: 'a',
|
||||
attributes: {title: Messages.editShareTitle, 'class': 'editShare'},
|
||||
attributes: {title: Messages.editShareTitle, 'class': 'cp-toolbar-share-edit-copy'},
|
||||
content: '<span class="fa fa-users"></span> ' + Messages.editShare
|
||||
});
|
||||
if (readOnly) {
|
||||
@@ -379,7 +373,7 @@ define([
|
||||
tag: 'a',
|
||||
attributes: {
|
||||
title: Messages.editOpenTitle,
|
||||
'class': 'editOpen',
|
||||
'class': 'cp-toolbar-share-edit-open',
|
||||
href: origin + pathname + '#' + hashes.editHash,
|
||||
target: '_blank'
|
||||
},
|
||||
@@ -391,7 +385,7 @@ define([
|
||||
if (hashes.viewHash) {
|
||||
options.push({
|
||||
tag: 'a',
|
||||
attributes: {title: Messages.viewShareTitle, 'class': 'viewShare'},
|
||||
attributes: {title: Messages.viewShareTitle, 'class': 'cp-toolbar-share-view-copy'},
|
||||
content: '<span class="fa fa-eye"></span> ' + Messages.viewShare
|
||||
});
|
||||
if (!readOnly) {
|
||||
@@ -400,7 +394,7 @@ define([
|
||||
tag: 'a',
|
||||
attributes: {
|
||||
title: Messages.viewOpenTitle,
|
||||
'class': 'viewOpen',
|
||||
'class': 'cp-toolbar-share-view-open',
|
||||
href: origin + pathname + '#' + hashes.viewHash,
|
||||
target: '_blank'
|
||||
},
|
||||
@@ -414,12 +408,12 @@ define([
|
||||
feedback: 'SHARE_MENU',
|
||||
};
|
||||
var $shareBlock = Cryptpad.createDropdown(dropdownConfigShare);
|
||||
$shareBlock.find('.dropdown-bar-content').addClass(SHARE_CLS).addClass(EDITSHARE_CLS).addClass(VIEWSHARE_CLS);
|
||||
$shareBlock.addClass('shareButton');
|
||||
$shareBlock.find('.cp-dropdown-content').addClass(SHARE_CLS).addClass(EDITSHARE_CLS).addClass(VIEWSHARE_CLS);
|
||||
$shareBlock.addClass('cp-toolbar-share-button');
|
||||
$shareBlock.find('button').attr('title', Messages.shareButton);
|
||||
|
||||
if (hashes.editHash) {
|
||||
$shareBlock.find('a.editShare').click(function () {
|
||||
$shareBlock.find('a.cp-toolbar-share-edit-copy').click(function () {
|
||||
/*Common.storeLinkToClipboard(false, function (err) {
|
||||
if (!err) { Cryptpad.log(Messages.shareSuccess); }
|
||||
});*/
|
||||
@@ -429,7 +423,7 @@ define([
|
||||
});
|
||||
}
|
||||
if (hashes.viewHash) {
|
||||
$shareBlock.find('a.viewShare').click(function () {
|
||||
$shareBlock.find('a.cp-toolbar-share-view-copy').click(function () {
|
||||
/*Common.storeLinkToClipboard(true, function (err) {
|
||||
if (!err) { Cryptpad.log(Messages.shareSuccess); }
|
||||
});*/
|
||||
@@ -451,7 +445,7 @@ define([
|
||||
}
|
||||
var $shareIcon = $('<span>', {'class': 'fa fa-share-alt'});
|
||||
var $button = $('<button>', {'title': Messages.shareButton}).append($shareIcon);
|
||||
$button.addClass('shareButton');
|
||||
$button.addClass('cp-toolbar-share-button');
|
||||
$button.click(function () {
|
||||
var url = window.location.href;
|
||||
var success = Cryptpad.Clipboard.copy(url);
|
||||
@@ -464,11 +458,10 @@ define([
|
||||
|
||||
var createTitle = function (toolbar, config) {
|
||||
var $titleContainer = $('<span>', {
|
||||
id: 'toolbarTitle',
|
||||
'class': TITLE_CLS
|
||||
}).appendTo(toolbar.$top);
|
||||
|
||||
var $hoverable = $('<span>', {'class': 'hoverable'}).appendTo($titleContainer);
|
||||
var $hoverable = $('<span>', {'class': 'cp-toolbar-title-hoverable'}).appendTo($titleContainer);
|
||||
|
||||
if (typeof config.title !== "object") {
|
||||
console.error("config.title", config);
|
||||
@@ -480,18 +473,18 @@ define([
|
||||
|
||||
// Buttons
|
||||
var $text = $('<span>', {
|
||||
'class': 'title'
|
||||
'class': 'cp-toolbar-title-value'
|
||||
}).appendTo($hoverable);
|
||||
var $pencilIcon = $('<span>', {
|
||||
'class': 'pencilIcon',
|
||||
'class': 'cp-toolbar-title-edit',
|
||||
'title': Messages.clickToEdit
|
||||
});
|
||||
var $saveIcon = $('<span>', {
|
||||
'class': 'saveIcon',
|
||||
'class': 'cp-toolbar-title-save',
|
||||
'title': Messages.saveTitle
|
||||
}).hide();
|
||||
if (config.readOnly === 1) {
|
||||
$titleContainer.append($('<span>', {'class': 'readOnly'})
|
||||
$titleContainer.append($('<span>', {'class': 'cp-toolbar-title-readonly'})
|
||||
.text('('+Messages.readonly+')'));
|
||||
}
|
||||
if (config.readOnly === 1 || typeof(Cryptpad) === "undefined") { return $titleContainer; }
|
||||
@@ -501,14 +494,14 @@ define([
|
||||
}).appendTo($hoverable).hide();
|
||||
if (config.readOnly !== 1) {
|
||||
$text.attr("title", Messages.clickToEdit);
|
||||
$text.addClass("editable");
|
||||
$text.addClass("cp-toolbar-title-editable");
|
||||
var $icon = $('<span>', {
|
||||
'class': 'fa fa-pencil readonly',
|
||||
'class': 'fa fa-pencil cp-toolbar-title-icon-readonly',
|
||||
style: 'font-family: FontAwesome;'
|
||||
});
|
||||
$pencilIcon.append($icon).appendTo($hoverable);
|
||||
var $icon2 = $('<span>', {
|
||||
'class': 'fa fa-check readonly',
|
||||
'class': 'fa fa-check cp-toolbar-title-icon-readonly',
|
||||
style: 'font-family: FontAwesome;'
|
||||
});
|
||||
$saveIcon.append($icon2).appendTo($hoverable);
|
||||
@@ -571,23 +564,22 @@ define([
|
||||
var createPageTitle = function (toolbar, config) {
|
||||
if (config.title || !config.pageTitle) { return; }
|
||||
var $titleContainer = $('<span>', {
|
||||
id: 'toolbarTitle',
|
||||
'class': TITLE_CLS
|
||||
}).appendTo(toolbar.$top);
|
||||
|
||||
toolbar.$top.find('.filler').hide();
|
||||
|
||||
var $hoverable = $('<span>', {'class': 'hoverable'}).appendTo($titleContainer);
|
||||
var $hoverable = $('<span>', {'class': 'cp-toolbar-title-hoverable'}).appendTo($titleContainer);
|
||||
|
||||
// Buttons
|
||||
$('<span>', {
|
||||
'class': 'title pageTitle'
|
||||
'class': 'cp-toolbar-title-value cp-toolbar-title-value-page'
|
||||
}).appendTo($hoverable).text(config.pageTitle);
|
||||
};
|
||||
|
||||
var createLinkToMain = function (toolbar, config) {
|
||||
var $linkContainer = $('<span>', {
|
||||
'class': "cryptpad-link"
|
||||
'class': LINK_CLS
|
||||
}).appendTo(toolbar.$top);
|
||||
|
||||
// We need to override the "a" tag action here because it is inside the iframe!
|
||||
@@ -601,7 +593,7 @@ define([
|
||||
var $aTag = $('<a>', {
|
||||
href: href,
|
||||
title: buttonTitle,
|
||||
'class': "cryptpad-logo"
|
||||
'class': "cp-toolbar-link-logo"
|
||||
}).append($('<img>', {
|
||||
src: '/customize/images/logo_white.png?' + ApiConfig.requireConf.urlArgs
|
||||
}));
|
||||
@@ -784,7 +776,7 @@ define([
|
||||
var initClickEvents = function (toolbar, config) {
|
||||
var removeDropdowns = function () {
|
||||
window.setTimeout(function () {
|
||||
toolbar.$toolbar.find('.cryptpad-dropdown').hide();
|
||||
toolbar.$toolbar.find('.cp-dropdown-content').hide();
|
||||
});
|
||||
};
|
||||
var cancelEditTitle = function (e) {
|
||||
|
||||
Reference in New Issue
Block a user