source: products/qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/plugins/plugin.js @ 43

Last change on this file since 43 was 43, checked in by crchemist, 18 years ago

rename file

File size: 1.4 KB
Line 
1
2/* Use onDOMLoad event to initialize kukit
3   earlier then the document is fully loaded,
4   but after the DOM is at its place already.
5
6   This functionality is missing from Plone 2.1,
7   the script is present in >=2.5, but it is not
8   always added to RR - it needs to be added manually.
9
10   If it's present we use it.
11*/
12
13kukit.plonetabs = {};
14
15/* Base kukit plugins for plonetabs */
16
17kukit.actionsGlobalRegistry.register('plonetabs-redirectTo', function(oper) {
18;;; oper.componentName = '[plonetabs-redirectTo] action';
19    var wl = window.location;
20    oper.evaluateParameters([], {'protocol' : wl.protocol,
21                                 'host'     : wl.host,
22                                 'pathname' : wl.pathname,
23                                 'search'   : wl.search,
24                                 'hash'     : wl.hash});
25
26    // normalize parameters
27    var protocol = oper.parms.protocol + (oper.parms.protocol[oper.parms.protocol.length - 1] == ":") ?  "" : ":";
28    var host = oper.parms.host;
29    var pathname = oper.parms.pathname;
30    var search = (oper.parms.search.substr(0, 1) == "?") ? "" : "?" + oper.parms.search;
31    var hash = (oper.parms.hash.length > 1) ? ((oper.parms.hash.substr(0, 1) == "#" ? "" : "#") + oper.parms.hash) : "";
32
33    url = protocol + "//" + host + pathname + search + hash;
34    window.location.replace(url);
35
36});
37kukit.commandsGlobalRegistry.registerFromAction('plonetabs-redirectTo',
38    kukit.cr.makeSelectorCommand);
39
Note: See TracBrowser for help on using the repository browser.