* Re-implemented autosave feature (ie. automatic backup / restore) for stories and comments

* Removed obsolete rescue methods
 * Moved contents of many individual skin files as subskins in the corresponding prototype skin file
 * Moved commentform_macro of Story prototype into compatibility module
This commit is contained in:
Tobi Schäfer 2007-10-16 16:48:14 +00:00
parent ec700a655f
commit 75644bde63
18 changed files with 132 additions and 146 deletions

View file

@ -44,6 +44,8 @@ Root.prototype.getPermission = function(action) {
return User.require(User.PRIVILEGED);
}
switch (action) {
case "backup.js":
return true;
case "create":
return this.getCreationPermission();
case "default.hook":
@ -152,6 +154,25 @@ Root.prototype.list_action = function() {
return;
};
Root.prototype.backup_js_action = function() {
if (req.isPost()) {
session.data.backup = {};
for (var key in req.postParams) {
session.data.backup[key] = req.postParams[key];
}
}
return;
};
Root.restore = function(ref) {
var backup;
if (backup = session.data.backup) {
ref.title = decodeURIComponent(backup.title);
ref.text = decodeURIComponent(backup.text);
}
return ref;
};
Root.prototype.default_hook_action = function() {
var ping = function(data) {
if (data.type !== "Site") {