|
|
@ -18,6 +18,15 @@ define([
|
|
|
|
var $iframe = $('#pad-iframe').contents();
|
|
|
|
var $iframe = $('#pad-iframe').contents();
|
|
|
|
var ifrw = $('#pad-iframe')[0].contentWindow;
|
|
|
|
var ifrw = $('#pad-iframe')[0].contentWindow;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $tree = $iframe.find("#tree");
|
|
|
|
|
|
|
|
var $content = $iframe.find("#content");
|
|
|
|
|
|
|
|
var $driveToolbar = $iframe.find("#driveToolbar");
|
|
|
|
|
|
|
|
var $contextMenu = $iframe.find("#treeContextMenu");
|
|
|
|
|
|
|
|
var $contentContextMenu = $iframe.find("#contentContextMenu");
|
|
|
|
|
|
|
|
var $defaultContextMenu = $iframe.find("#defaultContextMenu");
|
|
|
|
|
|
|
|
var $trashTreeContextMenu = $iframe.find("#trashTreeContextMenu");
|
|
|
|
|
|
|
|
var $trashContextMenu = $iframe.find("#trashContextMenu");
|
|
|
|
|
|
|
|
|
|
|
|
Cryptpad.addLoadingScreen();
|
|
|
|
Cryptpad.addLoadingScreen();
|
|
|
|
var onConnectError = function (info) {
|
|
|
|
var onConnectError = function (info) {
|
|
|
|
Cryptpad.errorLoadingScreen(Messages.websocketError);
|
|
|
|
Cryptpad.errorLoadingScreen(Messages.websocketError);
|
|
|
@ -127,8 +136,14 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var setEditable = function (state) {
|
|
|
|
var setEditable = function (state) {
|
|
|
|
APP.editable = state;
|
|
|
|
APP.editable = state;
|
|
|
|
if (!state) { $iframe.find('[draggable="true"]').attr('draggable', false); }
|
|
|
|
if (!state) {
|
|
|
|
else { $iframe.find('[draggable="false"]').attr('draggable', true); }
|
|
|
|
$content.addClass('readonly');
|
|
|
|
|
|
|
|
$iframe.find('[draggable="true"]').attr('draggable', false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
$content.removeClass('readonly');
|
|
|
|
|
|
|
|
$iframe.find('[draggable="false"]').attr('draggable', true);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Icons
|
|
|
|
// Icons
|
|
|
@ -196,16 +211,6 @@ define([
|
|
|
|
var lastSelectTime;
|
|
|
|
var lastSelectTime;
|
|
|
|
var selectedElement;
|
|
|
|
var selectedElement;
|
|
|
|
|
|
|
|
|
|
|
|
var $tree = $iframe.find("#tree");
|
|
|
|
|
|
|
|
var $content = $iframe.find("#content");
|
|
|
|
|
|
|
|
var $driveToolbar = $iframe.find("#driveToolbar");
|
|
|
|
|
|
|
|
var $contextMenu = $iframe.find("#treeContextMenu");
|
|
|
|
|
|
|
|
var $contentContextMenu = $iframe.find("#contentContextMenu");
|
|
|
|
|
|
|
|
var $defaultContextMenu = $iframe.find("#defaultContextMenu");
|
|
|
|
|
|
|
|
var $trashTreeContextMenu = $iframe.find("#trashTreeContextMenu");
|
|
|
|
|
|
|
|
var $trashContextMenu = $iframe.find("#trashContextMenu");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!APP.readOnly) {
|
|
|
|
if (!APP.readOnly) {
|
|
|
|
setEditable(true);
|
|
|
|
setEditable(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1288,7 +1293,10 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var $modeButton = createViewModeButton().appendTo($toolbar.find('.rightside'));
|
|
|
|
var $modeButton = createViewModeButton().appendTo($toolbar.find('.rightside'));
|
|
|
|
var $title = createTitle(path).appendTo($toolbar.find('.rightside'));
|
|
|
|
var $title = createTitle(path).appendTo($toolbar.find('.rightside'));
|
|
|
|
createNewButton(isInRoot).appendTo($toolbar.find('.leftside'));
|
|
|
|
|
|
|
|
|
|
|
|
// NewButton can be undefined if we're in read only mode
|
|
|
|
|
|
|
|
$toolbar.find('.leftside').append(createNewButton(isInRoot));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $folderHeader = getFolderListHeader();
|
|
|
|
var $folderHeader = getFolderListHeader();
|
|
|
|
var $fileHeader = getFileListHeader(true);
|
|
|
|
var $fileHeader = getFileListHeader(true);
|
|
|
|