Enable import feature in spreadsheets
This commit is contained in:
parent
ea54dd7392
commit
fe0961b24b
@ -259,6 +259,10 @@ define([
|
|||||||
APP.onLocal();
|
APP.onLocal();
|
||||||
APP.realtime.onSettle(function () {
|
APP.realtime.onSettle(function () {
|
||||||
fixSheets();
|
fixSheets();
|
||||||
|
UI.log(Messages.saved);
|
||||||
|
if (ev.callback) {
|
||||||
|
return void ev.callback();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
sframeChan.query('Q_OO_COMMAND', {
|
sframeChan.query('Q_OO_COMMAND', {
|
||||||
cmd: 'UPDATE_HASH',
|
cmd: 'UPDATE_HASH',
|
||||||
@ -266,7 +270,6 @@ define([
|
|||||||
}, function (err, obj) {
|
}, function (err, obj) {
|
||||||
if (err || (obj && obj.error)) { console.error(err || obj.error); }
|
if (err || (obj && obj.error)) { console.error(err || obj.error); }
|
||||||
});
|
});
|
||||||
UI.log(Messages.saved);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -707,19 +710,33 @@ define([
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/*var importFile = function(content) {
|
var importFile = function(content) {
|
||||||
|
// Abort if there is another real user in the channel (history keeper excluded)
|
||||||
|
var m = metadataMgr.getChannelMembers().slice().filter(function (nId) {
|
||||||
|
return nId.length === 32;
|
||||||
|
});
|
||||||
|
if (m.length > 1) {
|
||||||
|
return void UI.alert(Messages.oo_cantUpload);
|
||||||
|
}
|
||||||
var blob = new Blob([content], {type: 'plain/text'});
|
var blob = new Blob([content], {type: 'plain/text'});
|
||||||
var file = getFileType();
|
var file = getFileType();
|
||||||
blob.name = (metadataMgr.getMetadataLazy().title || file.doc) + '.' + file.type;
|
blob.name = (metadataMgr.getMetadataLazy().title || file.doc) + '.' + file.type;
|
||||||
uploadedCallback = function() {
|
var uploadedCallback = function() {
|
||||||
UI.confirm(Messages.oo_newVersion, function (yes) {
|
UI.confirm(Messages.oo_uploaded, function (yes) {
|
||||||
reloadDisplayed = false;
|
try {
|
||||||
|
window.frames[0].editor.setViewModeDisconnect();
|
||||||
|
} catch (e) {}
|
||||||
if (!yes) { return; }
|
if (!yes) { return; }
|
||||||
common.gotoURL();
|
common.gotoURL();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
APP.FM.handleFile(blob);
|
var data = {
|
||||||
}*/
|
hash: ooChannel.lastHash,
|
||||||
|
index: ooChannel.cpIndex,
|
||||||
|
callback: uploadedCallback
|
||||||
|
};
|
||||||
|
APP.FM.handleFile(blob, data);
|
||||||
|
}
|
||||||
|
|
||||||
var loadLastDocument = function () {
|
var loadLastDocument = function () {
|
||||||
var lastCp = getLastCp();
|
var lastCp = getLastCp();
|
||||||
@ -861,8 +878,8 @@ define([
|
|||||||
var $export = common.createButton('export', true, {}, exportFile);
|
var $export = common.createButton('export', true, {}, exportFile);
|
||||||
$export.appendTo($rightside);
|
$export.appendTo($rightside);
|
||||||
|
|
||||||
/*var $import = common.createButton('import', true, {}, importFile);
|
var $import = common.createButton('import', true, {}, importFile);
|
||||||
$import.appendTo($rightside);*/
|
$import.appendTo($rightside);
|
||||||
|
|
||||||
if (common.isLoggedIn()) {
|
if (common.isLoggedIn()) {
|
||||||
common.createButton('hashtag', true).appendTo($rightside);
|
common.createButton('hashtag', true).appendTo($rightside);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user