summaryrefslogtreecommitdiffstats
path: root/htdocs/scripts/tabtastic/attachevent.js
diff options
context:
space:
mode:
authorot <ot@localhost>2007-02-20 01:56:44 +0000
committerot <ot@localhost>2007-02-20 01:56:44 +0000
commitbacb5bf79a2812503dba77a76c680f1400e93bb0 (patch)
treefa3142724977935f66eaa9a93743b93f1fc7f425 /htdocs/scripts/tabtastic/attachevent.js
parent6add6d112a2eaba7047def553a2a33191efd4068 (diff)
downloadmarkup-validator-bacb5bf79a2812503dba77a76c680f1400e93bb0.zip
markup-validator-bacb5bf79a2812503dba77a76c680f1400e93bb0.tar.gz
markup-validator-bacb5bf79a2812503dba77a76c680f1400e93bb0.tar.bz2
[work in progress]
revamping home page UI based on work made for CSS validator and Unicorn: - usage of tabtastic for the method (uri, upload) choice - usage ot toggle scripting for extended options - menu moved to bottom of page, giving most important page real estate to form interface
Diffstat (limited to 'htdocs/scripts/tabtastic/attachevent.js')
-rw-r--r--htdocs/scripts/tabtastic/attachevent.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/htdocs/scripts/tabtastic/attachevent.js b/htdocs/scripts/tabtastic/attachevent.js
new file mode 100644
index 0000000..eaad7b8
--- /dev/null
+++ b/htdocs/scripts/tabtastic/attachevent.js
@@ -0,0 +1,34 @@
+//*** This code is copyright 2003 by Gavin Kistner, gavin@refinery.com
+//*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt
+//*** Reuse or modification is free provided you abide by the terms of that license.
+//*** (Including the first two lines above in your source code satisfies the conditions.)
+
+
+//***Cross browser attach event function. For 'evt' pass a string value with the leading "on" omitted
+//***e.g. AttachEvent(window,'load',MyFunctionNameWithoutParenthesis,false);
+
+function AttachEvent(obj,evt,fnc,useCapture){
+ if (!useCapture) useCapture=false;
+ if (obj.addEventListener){
+ obj.addEventListener(evt,fnc,useCapture);
+ return true;
+ } else if (obj.attachEvent) return obj.attachEvent("on"+evt,fnc);
+ else{
+ MyAttachEvent(obj,evt,fnc);
+ obj['on'+evt]=function(){ MyFireEvent(obj,evt) };
+ }
+}
+
+//The following are for browsers like NS4 or IE5Mac which don't support either
+//attachEvent or addEventListener
+function MyAttachEvent(obj,evt,fnc){
+ if (!obj.myEvents) obj.myEvents={};
+ if (!obj.myEvents[evt]) obj.myEvents[evt]=[];
+ var evts = obj.myEvents[evt];
+ evts[evts.length]=fnc;
+}
+function MyFireEvent(obj,evt){
+ if (!obj || !obj.myEvents || !obj.myEvents[evt]) return;
+ var evts = obj.myEvents[evt];
+ for (var i=0,len=evts.length;i<len;i++) evts[i]();
+}