|
|
|
@ -1029,15 +1029,18 @@ define([
|
|
|
|
|
return ret;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var openFile = function (el, href) {
|
|
|
|
|
if (!href) {
|
|
|
|
|
var openFile = function (el, isRo) {
|
|
|
|
|
var data = manager.getFileData(el);
|
|
|
|
|
if (!data || (!data.href && !data.roHref)) {
|
|
|
|
|
return void logError("Missing data for the file", el, data);
|
|
|
|
|
}
|
|
|
|
|
href = data.href || data.roHref;
|
|
|
|
|
}
|
|
|
|
|
window.open(APP.origin + href);
|
|
|
|
|
var href = data.href || data.roHref;
|
|
|
|
|
var parsed = Hash.parsePadUrl(href);
|
|
|
|
|
var secret = Hash.getSecrets(parsed.type, parsed.hash, data.password);
|
|
|
|
|
var hash = Hash.getHiddenHashFromKeys(parsed.type, secret);
|
|
|
|
|
var hiddenHref = Hash.hashToHref(hash, parsed.type);
|
|
|
|
|
// XXX hidden hash: use settings
|
|
|
|
|
window.open(APP.origin + hiddenHref);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var refresh = APP.refresh = function () {
|
|
|
|
@ -3034,7 +3037,7 @@ define([
|
|
|
|
|
$icon.append(getFileIcon(r.id));
|
|
|
|
|
$type.text(Messages.type[parsed.type] || parsed.type);
|
|
|
|
|
$title.click(function () {
|
|
|
|
|
openFile(null, r.data.href);
|
|
|
|
|
openFile(r.id);
|
|
|
|
|
});
|
|
|
|
|
$atimeName.text(Messages.fm_lastAccess);
|
|
|
|
|
$atime.text(new Date(r.data.atime).toLocaleString());
|
|
|
|
@ -3944,15 +3947,12 @@ define([
|
|
|
|
|
// ANON_SHARED_FOLDER
|
|
|
|
|
el = manager.find(paths[0].path.slice(1), APP.newSharedFolder);
|
|
|
|
|
}
|
|
|
|
|
var href;
|
|
|
|
|
if (manager.isPathIn(p.path, [FILES_DATA])) {
|
|
|
|
|
href = el.roHref;
|
|
|
|
|
el = p.path[1];
|
|
|
|
|
} else {
|
|
|
|
|
if (!el || manager.isFolder(el)) { return; }
|
|
|
|
|
var data = manager.getFileData(el);
|
|
|
|
|
href = data.roHref;
|
|
|
|
|
}
|
|
|
|
|
openFile(null, href);
|
|
|
|
|
openFile(el, true);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else if ($this.hasClass('cp-app-drive-context-openincode')) {
|
|
|
|
|