Add properties to the files not in the trash

pull/1/head
yflory 8 years ago
parent 61d33f2dd6
commit 7afde2309d

@ -1517,9 +1517,10 @@ define([
common.alert = function (msg, cb, force) { common.alert = function (msg, cb, force) {
cb = cb || function () {}; cb = cb || function () {};
if (force !== true) { msg = fixHTML(msg); } if (force !== true) { msg = fixHTML(msg); }
var keyHandler = listenForKeys(function (e) { // yes var close = function (e) {
findOKButton().click(); findOKButton().click();
}); };
var keyHandler = listenForKeys(close, close);
Alertify.alert(msg, function (ev) { Alertify.alert(msg, function (ev) {
cb(ev); cb(ev);
stopListening(keyHandler); stopListening(keyHandler);

@ -1844,16 +1844,12 @@ define([
if (!filesOp.isFile(el)) { return; } if (!filesOp.isFile(el)) { return; }
var base = window.location.origin; var base = window.location.origin;
var $d = $('<div>'); var $d = $('<div>');
$('<strong>').text('PROPERTIES').appendTo($d); $('<strong>').text(Messages.fc_prop).appendTo($d);
$('<br>').appendTo($d); $('<br>').appendTo($d);
$('<br>').appendTo($d); $('<label>', {'for': 'propLink'}).text(Messages.editShare).appendTo($d);
$('<label>', {'for': 'propLink'}).text("LINK").appendTo($d); $('<input>', {'id': 'propLink', 'value': base + el}).appendTo($d);
$('<br>').appendTo($d); $('<label>', {'for': 'propROLink'}).text(Messages.viewShare).appendTo($d);
$('<input>', {'id': 'propLink', 'disabled': 'disabled', 'value': base + el}).appendTo($d); $('<input>', {'id': 'propROLink', 'value': getReadOnlyUrl(base + el)}).appendTo($d);
$('<br>').appendTo($d);
$('<label>', {'for': 'propROLink'}).text("RO LINK").appendTo($d);
$('<br>').appendTo($d);
$('<input>', {'id': 'propROLink', 'disabled': 'disabled'}).val(getReadOnlyUrl(base + el)).appendTo($d);
return $d.html(); return $d.html();
}; };
@ -1901,10 +1897,12 @@ define([
} }
else if ($(this).hasClass("properties")) { else if ($(this).hasClass("properties")) {
if (paths.length !== 1) { return; } if (paths.length !== 1) { return; }
console.log(paths[0].path);
var el = filesOp.findElement(files, paths[0].path); var el = filesOp.findElement(files, paths[0].path);
var prop = getProperties(el); var prop = getProperties(el);
Cryptpad.alert(prop, undefined, true); Cryptpad.alert('', undefined, true);
$('.alertify .msg').html(prop);
$('#propLink').click(function () { $(this).select(); });
$('#propROLink').click(function () { $(this).select(); });
} }
module.hideMenu(); module.hideMenu();
}); });
@ -1937,6 +1935,15 @@ define([
paths.forEach(function (p) { pathsList.push(p.path); }); paths.forEach(function (p) { pathsList.push(p.path); });
moveElements(pathsList, [TRASH], false, refresh); moveElements(pathsList, [TRASH], false, refresh);
} }
else if ($(this).hasClass("properties")) {
if (paths.length !== 1) { return; }
var el = filesOp.findElement(files, paths[0].path);
var prop = getProperties(el);
Cryptpad.alert('', undefined, true);
$('.alertify .msg').html(prop);
$('#propLink').click(function () { $(this).select(); });
$('#propROLink').click(function () { $(this).select(); });
}
module.hideMenu(); module.hideMenu();
}); });

Loading…
Cancel
Save