2 //\ overLIB Exclusive Plugin
3 //\ This file requires overLIB 4.00 or later.
5 //\ overLIB 4.00 - 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' || olInfo.simpleversion < 400) alert('overLIB 4.00 or later is required for the Debug Plugin.');
17 registerCommands('exclusive,exclusivestatus,exclusiveoverride');
18 var olOverrideIsSet; // variable which tells if override is set
22 // DEFAULT CONFIGURATION
23 // Settings you want everywhere are set here. All of this can also be
24 // changed on your html page or through an overLIB call.
26 if (typeof ol_exclusive == 'undefined') var ol_exclusive = 0;
27 if (typeof ol_exclusivestatus == 'undefined') var ol_exclusivestatus = 'Please close open popup first.';
30 // END OF CONFIGURATION
31 // Don't change anything below this line, all configuration is above.
38 // Runtime variables init. Don't change for config!
40 var o3_exclusivestatus = '';
46 // Set runtime variables
47 function setExclusiveVariables() {
48 o3_exclusive = ol_exclusive;
49 o3_exclusivestatus = ol_exclusivestatus;
52 // Parses Exclusive Parameters
53 function parseExclusiveExtras(pf,i,ar) {
56 olOverrideIsSet = false; // a global variable
59 if (ar[k] == EXCLUSIVEOVERRIDE) { if(pf != 'ol_') olOverrideIsSet = true; return k; }
60 if (ar[k] == EXCLUSIVE) { eval(pf + 'exclusive = (' + pf + 'exclusive == 0) ? 1 : 0'); return k; }
61 if (ar[k] == EXCLUSIVESTATUS) { eval(pf + "exclusivestatus = '" + escSglQuote(ar[++k]) + "'"); return k; }
70 // set status message and indicate whether popup is exclusive
71 function isExclusive(args) {
74 if(args != null) rtnVal = hasCommand(args, EXCLUSIVEOVERRIDE);
76 if(rtnVal) return false;
78 self.status = (o3_exclusive) ? o3_exclusivestatus : '';
84 // checks overlib argument list to see if it has a COMMAND argument
85 function hasCommand(args, COMMAND) {
88 for (var i=0; i<args.length; i++) {
89 if (typeof args[i] == 'number' && args[i] == COMMAND) {
98 // makes sure exclusive setting is off
99 function clearExclusive() {
103 function setExclusive() {
104 o3_exclusive = (o3_showingsticky && o3_exclusive);
107 function chkForExclusive() {
108 if (olOverrideIsSet) o3_exclusive = 0; // turn it off in case it's been set.
114 // PLUGIN REGISTRATIONS
116 registerRunTimeFunction(setExclusiveVariables);
117 registerCmdLineFunction(parseExclusiveExtras);
118 registerPostParseFunction(chkForExclusive);
119 registerHook("createPopup",setExclusive,FBEFORE);
120 registerHook("hideObject",clearExclusive,FAFTER);