Merge branch 'soon' into staging
This commit is contained in:
@@ -141,7 +141,7 @@ define([
|
|||||||
};
|
};
|
||||||
var getPadProperties = function (common, data, cb) {
|
var getPadProperties = function (common, data, cb) {
|
||||||
var $d = $('<div>');
|
var $d = $('<div>');
|
||||||
if (!data || !data.href) { return void cb(void 0, $d); }
|
if (!data || (!data.href && !data.roHref)) { return void cb(void 0, $d); }
|
||||||
|
|
||||||
if (data.href) {
|
if (data.href) {
|
||||||
$('<label>', {'for': 'cp-app-prop-link'}).text(Messages.editShare).appendTo($d);
|
$('<label>', {'for': 'cp-app-prop-link'}).text(Messages.editShare).appendTo($d);
|
||||||
|
|||||||
@@ -104,9 +104,13 @@ define([
|
|||||||
fd.owners && fd.owners.indexOf(edPublic) !== -1 && channelId) {
|
fd.owners && fd.owners.indexOf(edPublic) !== -1 && channelId) {
|
||||||
removeOwnedChannel(channelId, function (obj) {
|
removeOwnedChannel(channelId, function (obj) {
|
||||||
if (obj && obj.error) {
|
if (obj && obj.error) {
|
||||||
console.error(obj.error);
|
// If the error is that the file is already removed, nothing to
|
||||||
|
// report, it's a normal behavior (pad expired probably)
|
||||||
|
if (obj.error.code === 'ENOENT') { return; }
|
||||||
|
|
||||||
// RPC may not be responding
|
// RPC may not be responding
|
||||||
// Send a report that can be handled manually
|
// Send a report that can be handled manually
|
||||||
|
console.error(obj.error);
|
||||||
Feedback.send('ERROR_DELETING_OWNED_PAD=' + channelId, true);
|
Feedback.send('ERROR_DELETING_OWNED_PAD=' + channelId, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -331,17 +331,27 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
sframeChan.on('Q_GET_PAD_ATTRIBUTE', function (data, cb) {
|
sframeChan.on('Q_GET_PAD_ATTRIBUTE', function (data, cb) {
|
||||||
|
var href;
|
||||||
|
if (readOnly && hashes.editHash) {
|
||||||
|
// If we have a stronger hash, use it for pad attributes
|
||||||
|
href = window.location.pathname + '#' + hashes.editHash;
|
||||||
|
}
|
||||||
Cryptpad.getPadAttribute(data.key, function (e, data) {
|
Cryptpad.getPadAttribute(data.key, function (e, data) {
|
||||||
cb({
|
cb({
|
||||||
error: e,
|
error: e,
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
});
|
}, href);
|
||||||
});
|
});
|
||||||
sframeChan.on('Q_SET_PAD_ATTRIBUTE', function (data, cb) {
|
sframeChan.on('Q_SET_PAD_ATTRIBUTE', function (data, cb) {
|
||||||
|
var href;
|
||||||
|
if (readOnly && hashes.editHash) {
|
||||||
|
// If we have a stronger hash, use it for pad attributes
|
||||||
|
href = window.location.pathname + '#' + hashes.editHash;
|
||||||
|
}
|
||||||
Cryptpad.setPadAttribute(data.key, data.value, function (e) {
|
Cryptpad.setPadAttribute(data.key, data.value, function (e) {
|
||||||
cb({error:e});
|
cb({error:e});
|
||||||
});
|
}, href);
|
||||||
});
|
});
|
||||||
|
|
||||||
sframeChan.on('Q_GET_ATTRIBUTE', function (data, cb) {
|
sframeChan.on('Q_GET_ATTRIBUTE', function (data, cb) {
|
||||||
|
|||||||
Reference in New Issue
Block a user