Remove/fix XXX

pull/1/head
yflory 5 years ago
parent 72ccd55e83
commit 7b82d9dba4

@ -1601,17 +1601,12 @@ define([
.text(Messages.accessButton)) .text(Messages.accessButton))
.click(common.prepareFeedback(type)) .click(common.prepareFeedback(type))
.click(function () { .click(function () {
common.isPadStored(function (err, data) { // XXX not necessary for access modal?
if (!data) {
return void UI.alert(Messages.autostore_notAvailable);
}
require(['/common/inner/access.js'], function (Access) { require(['/common/inner/access.js'], function (Access) {
Access.getAccessModal(common, {}, function (e) { Access.getAccessModal(common, {}, function (e) {
if (e) { console.error(e); } if (e) { console.error(e); }
}); });
}); });
}); });
});
break; break;
case 'properties': case 'properties':
button = $('<button>', { button = $('<button>', {

@ -1000,6 +1000,7 @@ define([
cb = cb || function () {}; cb = cb || function () {};
opts = opts || {}; opts = opts || {};
opts.wide = true; opts.wide = true;
opts.access = true;
var tabs = [{ var tabs = [{
getTab: getAccessTab, getTab: getAccessTab,
title: Messages.access_main, title: Messages.access_main,

@ -1,11 +1,12 @@
define([ define([
'jquery', 'jquery',
'/common/common-util.js', '/common/common-util.js',
'/common/common-hash.js',
'/common/common-interface.js', '/common/common-interface.js',
'/common/common-ui-elements.js', '/common/common-ui-elements.js',
'/customize/messages.js', '/customize/messages.js',
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
], function ($, Util, UI, UIElements, Messages, nThen) { ], function ($, Util, Hash, UI, UIElements, Messages, nThen) {
var Modal = {}; var Modal = {};
Modal.override = function (data, obj) { Modal.override = function (data, obj) {
@ -23,7 +24,7 @@ define([
}, waitFor(function (md) { }, waitFor(function (md) {
if (md && md.error) { return void console.error(md.error); } if (md && md.error) { return void console.error(md.error); }
Modal.override(data, md); Modal.override(data, md);
if (redraw) { Env.evRedrawAll.fire(redraw); } // XXX if (redraw) { Env.evRedrawAll.fire(redraw); }
})); }));
}; };
Modal.getPadData = function (Env, opts, _cb) { Modal.getPadData = function (Env, opts, _cb) {
@ -32,12 +33,22 @@ define([
opts = opts || {}; opts = opts || {};
var data = {}; var data = {};
nThen(function (waitFor) { nThen(function (waitFor) {
var base = common.getMetadataMgr().getPrivateData().origin; var priv = common.getMetadataMgr().getPrivateData();
var base = priv.origin;
common.getPadAttribute('', waitFor(function (err, val) { common.getPadAttribute('', waitFor(function (err, val) {
if (err || !val) { if (err || !val) {
if (opts.access) {
data.password = priv.password;
// Access modal and the pad is not stored: we're not an owner
// so we don't need the correct href, just the type
var h = Hash.createRandomHash(priv.app, priv.password);
data.href = base + priv.pathname + '#' + h;
} else {
waitFor.abort(); waitFor.abort();
return void cb(err || 'EEMPTY'); return void cb(err || 'EEMPTY');
} }
return;
}
if (!val.fileType) { if (!val.fileType) {
delete val.owners; delete val.owners;
delete val.expire; delete val.expire;

@ -103,7 +103,7 @@ define([
sframeChan.on('EV_RT_ERROR', function (err) { sframeChan.on('EV_RT_ERROR', function (err) {
isReady = false; isReady = false;
chainpad.abort(); chainpad.abort();
if (err.type === 'EUNKNOWN') { // XXX if (err.type === 'EUNKNOWN') {
// Recoverable error: make a new chainpad // Recoverable error: make a new chainpad
chainpad = makeChainPad(); chainpad = makeChainPad();
return; return;

Loading…
Cancel
Save