2 //\ overLIB Exclusive Plugin
3 //\ This file requires overLIB 4.10 or later.
5 //\ overLIB 4.05 - You may not remove or change this notice.
6 //\ Copyright Erik Bosrup 1998-2004. All rights reserved.
7 //\ Contributors are listed on the homepage.
8 //\ See http://www.bosrup.com/web/overlib/ for details.
14 // Ignore these lines, configuration is below.
16 if (typeof olInfo == 'undefined' || typeof olInfo.meets == 'undefined' || !olInfo.meets(4.10)) alert('overLIB 4.10 or later is required for the Debug Plugin.');
18 registerCommands('exclusive,exclusivestatus,exclusiveoverride');
19 var olOverrideIsSet; // variable which tells if override is set
23 // DEFAULT CONFIGURATION
24 // Settings you want everywhere are set here. All of this can also be
25 // changed on your html page or through an overLIB call.
27 if (typeof ol_exclusive == 'undefined') var ol_exclusive = 0;
28 if (typeof ol_exclusivestatus == 'undefined') var ol_exclusivestatus = 'Please close open popup first.';
31 // END OF CONFIGURATION
32 // Don't change anything below this line, all configuration is above.
39 // Runtime variables init. Don't change for config!
41 var o3_exclusivestatus = '';
47 // Set runtime variables
48 function setExclusiveVariables() {
49 o3_exclusive = ol_exclusive;
50 o3_exclusivestatus = ol_exclusivestatus;
53 // Parses Exclusive Parameters
54 function parseExclusiveExtras(pf,i,ar) {
57 olOverrideIsSet = false; // a global variable
60 if (ar[k] == EXCLUSIVEOVERRIDE) { if(pf != 'ol_') olOverrideIsSet = true; return k; }
61 if (ar[k] == EXCLUSIVE) { eval(pf + 'exclusive = (' + pf + 'exclusive == 0) ? 1 : 0'); return k; }
62 if (ar[k] == EXCLUSIVESTATUS) { eval(pf + "exclusivestatus = '" + escSglQuote(ar[++k]) + "'"); return k; }
71 // set status message and indicate whether popup is exclusive
72 function isExclusive(args) {
75 if(args != null) rtnVal = hasCommand(args, EXCLUSIVEOVERRIDE);
77 if(rtnVal) return false;
79 self.status = (o3_exclusive) ? o3_exclusivestatus : '';
85 // checks overlib argument list to see if it has a COMMAND argument
86 function hasCommand(args, COMMAND) {
89 for (var i=0; i<args.length; i++) {
90 if (typeof args[i] == 'number' && args[i] == COMMAND) {
99 // makes sure exclusive setting is off
100 function clearExclusive() {
104 function setExclusive() {
105 o3_exclusive = (o3_showingsticky && o3_exclusive);
108 function chkForExclusive() {
109 if (olOverrideIsSet) o3_exclusive = 0; // turn it off in case it's been set.
115 // PLUGIN REGISTRATIONS
117 registerRunTimeFunction(setExclusiveVariables);
118 registerCmdLineFunction(parseExclusiveExtras);
119 registerPostParseFunction(chkForExclusive);
120 registerHook("createPopup",setExclusive,FBEFORE);
121 registerHook("hideObject",clearExclusive,FAFTER);
122 if (olInfo.meets(4.10)) registerNoParameterCommands('exclusive');