Skip to content

Instantly share code, notes, and snippets.

@brainysmurf
Last active December 25, 2017 04:01
Show Gist options
  • Save brainysmurf/b0d6df8e1cda1139f856de4dbf073d6d to your computer and use it in GitHub Desktop.
Save brainysmurf/b0d6df8e1cda1139f856de4dbf073d6d to your computer and use it in GitHub Desktop.
DbSheets_Temp Adds the ability to use temporary spreadsheets within dbsheets.
(function (global, Factory) {
/*
Build upon dbsheets
*/
if (pkg && pkg.dbsheets && pkg.dbsheets.extend) {
pkg.dbsheets.extend.registerInit(function (dbObj) {
dbObj.makeTemp = function (title) {
title = title || "Temporary";
return dbObj.createWithTitle(title);
};
dbObj.destroyTemp = function (tmp) {
Drive.Files.remove(tmp.getId());
};
dbObj.withTempSpreadsheet = pkg.contextManager()({enter: dbObj.makeTemp, exit: dbObj.destroyTemp});
dbObj.withTempDontDelete = pkg.contextManager()({enter: dbObj.makeTemp});
});
}
})(this,
function Package () {
// nothing
}
);
(function () {
return {
self: {"dbsheets_temp": "b0d6df8e1cda1139f856de4dbf073d6d"},
packages: [
{},
]
};
})();
(function () {
return {
version: 0,
packages: [
{"contextManager": "3d2064f689d3652e6c9bb5631868074b"},
]
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment