Merge branch 'staging' into padcsp

pull/1/head
yflory 4 years ago
commit 61a37fb919

@ -19,7 +19,11 @@
@import (reference) "./forms.less";
@import (reference) "./modals-ui-elements.less";
.framework_main(@bg-color, @warn-color, @color) {
.framework_main(
@bg-color: @colortheme_default-bg, // color of the toolbar background
@warn-color: @colortheme_default-warn, // color of the warning text in the toolbar
@color: @colortheme_default-color, // Color of the text for the toolbar
) {
--LessLoader_require: LessLoader_currentFile();
// Set the HTML style for the apps which shouldn't have a body scrollbar
.app-noscroll_main();

@ -1150,6 +1150,7 @@ define([
APP.realtime.onSettle(function () {
APP.getImageURL(name, function(url) {
debug("CRYPTPAD success add " + name);
common.setPadAttribute('atime', +new Date(), null, data.href);
APP.AddImageSuccessCallback({
name: name,
url: url

@ -538,6 +538,7 @@ define([
}
if (!mediaTagEmbedder) { console.log('mediaTagEmbedder missing'); return; }
if (data.type !== 'file') { console.log('unhandled embed type ' + data.type); return; }
common.setPadAttribute('atime', +new Date(), null, data.href);
var privateDat = cpNfInner.metadataMgr.getPrivateData();
var origin = privateDat.fileHost || privateDat.origin;
var src = data.src = data.src.slice(0,1) === '/' ? origin + data.src : data.src;

@ -288,7 +288,15 @@ define([
var newHref;
var expire;
nThen(function (w) {
if (parsed.hashData.key || !parsed.hashData.channel) { return; }
// If we're using an unsafe link, get pad attribute
if (parsed.hashData.key || !parsed.hashData.channel) {
Cryptpad.getPadAttribute('expire', w(function (err, data) {
if (err) { return; }
expire = data;
}));
return;
}
// Otherwise, get pad data from channel id
var edit = parsed.hashData.mode === 'edit';
Cryptpad.getPadDataFromChannel({
channel: parsed.hashData.channel,

@ -4,7 +4,7 @@
// body
&.cp-app-debug {
.tokenfield_main();
.framework_min_main();
.framework_main();
display: flex;
flex-flow: column;

@ -605,7 +605,7 @@ define([
Title = common.createTitle({});
var configTb = {
displayed: ['title', 'useradmin', 'spinner', 'share', 'userlist', 'newpad', 'limit'],
displayed: ['pad'],
title: Title.getTitleConfig(),
metadataMgr: metadataMgr,
readOnly: 1,
@ -633,7 +633,7 @@ define([
};
var $hist = common.createButton('history', true, {histConfig: histConfig});
$hist.addClass('cp-hidden-if-readonly');
toolbar.$rightside.append($hist);
toolbar.$drawer.append($hist);
var $content = common.createButton(null, true, {
icon: 'fa-question',
@ -642,7 +642,7 @@ define([
id: 'cp-app-debug-get-content'
});
$content.click(getContent);
toolbar.$rightside.append($content);
toolbar.$drawer.append($content);
};
config.onReady = function (info) {

@ -1,9 +1,10 @@
define([
'jquery',
'/customize/messages.js',
'/common/common-util.js',
'/common/visible.js',
'/bower_components/dragula.js/dist/dragula.min.js',
], function ($, Messages, Visible, Dragula) {
], function ($, Messages, Util, Visible, Dragula) {
/**
* jKanban
* Vanilla Javascript plugin for manage kanban boards
@ -740,7 +741,6 @@ define([
return self;
};
var todoOnVisible = function () {};
var onVisibleHandler = false;
this.setBoards = function (boards) {
var scroll = {};
@ -750,15 +750,23 @@ define([
// Get horizontal scroll
var $el = $(self.element);
var scrollLeft = $el.scrollLeft();
// Remove all boards
for (var i in this.options.boards.list) {
var boardkey = this.options.boards.list[i];
scroll[boardkey] = $('.kanban-board[data-id="'+boardkey+'"] .kanban-drag').scrollTop();
this.removeBoard(boardkey);
}
// Get existing boards list
var list = Util.clone(this.options.boards.list);
// Update memory
this.options.boards = boards;
todoOnVisible = function () {
// If the tab is not focused but a handler already exists: abort
if (!Visible.currently() && onVisibleHandler) { return; }
var todoOnVisible = function () {
// Remove all boards
for (var i in list) {
var boardkey = list[i];
scroll[boardkey] = $('.kanban-board[data-id="'+boardkey+'"] .kanban-drag').scrollTop();
self.removeBoard(boardkey);
}
// Add all new boards
self.addBoards();
self.options.refresh();
@ -772,7 +780,6 @@ define([
// If the tab is not focused, redraw on focus
if (!Visible.currently()) {
if (onVisibleHandler) { return; }
onVisibleHandler = true;
return void Visible.onChange(function (visible) {
if (!visible) { return; }

@ -1205,6 +1205,7 @@ define([
};
common.openFilePicker(pickerCfg, function (data) {
if (data.type === 'file' && APP.editor) {
common.setPadAttribute('atime', +new Date(), null, data.href);
var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>';
APP.editor.replaceSelection(mt);
return;

@ -114,6 +114,7 @@ define([
var key = Hash.encodeBase64(secret.keys.cryptKey);
sframeChan.event("EV_SECURE_ACTION", {
type: parsed.type,
href: data.url,
src: src,
name: data.name,
key: key

@ -144,15 +144,6 @@ define([
config.onFileUpload(sframeChan, data, cb);
});
sframeChan.on('Q_GET_FILES_LIST', function (types, cb) {
Cryptpad.getSecureFilesList(types, function (err, data) {
cb({
error: err,
data: data
});
});
});
sframeChan.on('EV_SECURE_IFRAME_CLOSE', function () {
config.onClose();
});

Loading…
Cancel
Save