Better integration of Fork into AssetHelpers, fork startup

This commit is contained in:
Paul Driver 2010-11-08 07:54:47 -06:00
parent bb8753cd2a
commit a4edea1e3c
12 changed files with 162 additions and 160 deletions

View file

@ -3,14 +3,24 @@
(function () {
var ns = YAHOO.namespace('WebGUI.Fork');
ns.redirect = function (redir, after) {
if (!redir) {
return;
ns.redirect = function (params, after) {
var redir, msg, admin, fn;
if (redir = params.redirect) {
fn = function () {
// The idea here is to only allow local redirects
var loc = window.location;
loc.href = loc.protocol + '//' + loc.host + redir;
};
}
else if (msg = params.message) {
fn = function () {
admin = window.parent.admin;
admin.processPlugin({ message: msg });
admin.closeModalDialog();
};
}
if (fn) {
setTimeout(fn, after || 1000);
}
setTimeout(function() {
// The idea here is to only allow local redirects
var loc = window.location;
loc.href = loc.protocol + '//' + loc.host + redir;
}, after || 1000);
};
}());

View file

@ -354,7 +354,8 @@ WebGUI.Admin.prototype.addPasteHandler
*/
WebGUI.Admin.prototype.pasteAsset
= function ( id ) {
var url = appendToUrl( this.currentAssetDef.url, 'func=paste;assetId=' + id );
var url = appendToUrl( this.currentAssetDef.url, 'func=pasteList&assetId=' + id );
console.log(url);
this.gotoAsset( url );
};