reorganized javascript in dm
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Sat, 24 Nov 2012 23:11:33 +0000
changeset 4944 45f319296024
parent 4943 124073f24635
child 4945 92f515a19e0b
reorganized javascript in dm
model/prov-dm.html
model/prov-magic.js
model/releases/CR-prov-dm-20121211/Overview.html
--- a/model/prov-dm.html	Sat Nov 24 23:07:10 2012 +0000
+++ b/model/prov-dm.html	Sat Nov 24 23:11:33 2012 +0000
@@ -15,7 +15,45 @@
 
 <script src="provbib.js" class="remove"></script>
 
+<!-- javascript for button to hide examples -->
 <script type="text/javascript">
+/*
+	Written by Jonathan Snook, http://www.snook.ca/jonathan
+	Add-ons by Robert Nyman, http://www.robertnyman.com
+	Author says "The credit comment is all it takes, no license. Go crazy "
+	From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
+*/
+
+function getElementsByClassName(oElm, strTagName, oClassNames){
+    var arrElements = (! (! (strTagName == "*") || ! (oElm.all)))? oElm.all : oElm.getElementsByTagName(strTagName);
+    var arrReturnElements = new Array();
+    var arrRegExpClassNames = new Array();
+    if(typeof oClassNames == "object"){
+	for(var i=0; !(i>=oClassNames.length); i++){ /*>*/
+	    arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames[i].replace(/\-/g, "\-") + "(\s|$)"));
+	}
+    }
+    else{
+	arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames.replace(/\-/g, "\-") + "(\s|$)"));
+    }
+    var oElement;
+    var bMatchesAll;
+    for(var j=0; !(j>=arrElements.length); j++){ /*>*/
+	oElement = arrElements[j];
+	bMatchesAll = true;
+	for(var k=0; !(k>=arrRegExpClassNames.length); k++){ /*>*/
+	    if(!arrRegExpClassNames[k].test(oElement.className)){
+		bMatchesAll = false;
+		break;
+	    }
+	}
+	if(bMatchesAll){
+	    arrReturnElements.push(oElement);
+	}
+    }
+    return (arrReturnElements)
+}
+
 function set_display_by_class(el, cls, newValue) {
     var e = getElementsByClassName(document, el, cls);
     if (e != null) {
--- a/model/prov-magic.js	Sat Nov 24 23:07:10 2012 +0000
+++ b/model/prov-magic.js	Sat Nov 24 23:11:33 2012 +0000
@@ -1,9 +1,3 @@
-/*
-	Written by Jonathan Snook, http://www.snook.ca/jonathan
-	Add-ons by Robert Nyman, http://www.robertnyman.com
-	Author says "The credit comment is all it takes, no license. Go crazy "
-	From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
-*/
 
 function setContributors () {
     $('dt').each(function(index) {
@@ -26,36 +20,6 @@
 }
 
 
-function getElementsByClassName(oElm, strTagName, oClassNames){
-    var arrElements = (! (! (strTagName == "*") || ! (oElm.all)))? oElm.all : oElm.getElementsByTagName(strTagName);
-    var arrReturnElements = new Array();
-    var arrRegExpClassNames = new Array();
-    if(typeof oClassNames == "object"){
-	for(var i=0; !(i>=oClassNames.length); i++){ /*>*/
-	    arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames[i].replace(/\-/g, "\-") + "(\s|$)"));
-	}
-    }
-    else{
-	arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames.replace(/\-/g, "\-") + "(\s|$)"));
-    }
-    var oElement;
-    var bMatchesAll;
-    for(var j=0; !(j>=arrElements.length); j++){ /*>*/
-	oElement = arrElements[j];
-	bMatchesAll = true;
-	for(var k=0; !(k>=arrRegExpClassNames.length); k++){ /*>*/
-	    if(!arrRegExpClassNames[k].test(oElement.className)){
-		bMatchesAll = false;
-		break;
-	    }
-	}
-	if(bMatchesAll){
-	    arrReturnElements.push(oElement);
-	}
-    }
-    return (arrReturnElements)
-}
-
 
 function updateGlossaryRefs() {
     $('.glossary-ref').each(function(index) {
--- a/model/releases/CR-prov-dm-20121211/Overview.html	Sat Nov 24 23:07:10 2012 +0000
+++ b/model/releases/CR-prov-dm-20121211/Overview.html	Sat Nov 24 23:11:33 2012 +0000
@@ -14,7 +14,45 @@
 
 
 
+<!-- javascript for button to hide examples -->
 <script type="text/javascript">
+/*
+	Written by Jonathan Snook, http://www.snook.ca/jonathan
+	Add-ons by Robert Nyman, http://www.robertnyman.com
+	Author says "The credit comment is all it takes, no license. Go crazy "
+	From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
+*/
+
+function getElementsByClassName(oElm, strTagName, oClassNames){
+    var arrElements = (! (! (strTagName == "*") || ! (oElm.all)))? oElm.all : oElm.getElementsByTagName(strTagName);
+    var arrReturnElements = new Array();
+    var arrRegExpClassNames = new Array();
+    if(typeof oClassNames == "object"){
+	for(var i=0; !(i>=oClassNames.length); i++){ /*>*/
+	    arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames[i].replace(/\-/g, "\-") + "(\s|$)"));
+	}
+    }
+    else{
+	arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames.replace(/\-/g, "\-") + "(\s|$)"));
+    }
+    var oElement;
+    var bMatchesAll;
+    for(var j=0; !(j>=arrElements.length); j++){ /*>*/
+	oElement = arrElements[j];
+	bMatchesAll = true;
+	for(var k=0; !(k>=arrRegExpClassNames.length); k++){ /*>*/
+	    if(!arrRegExpClassNames[k].test(oElement.className)){
+		bMatchesAll = false;
+		break;
+	    }
+	}
+	if(bMatchesAll){
+	    arrReturnElements.push(oElement);
+	}
+    }
+    return (arrReturnElements)
+}
+
 function set_display_by_class(el, cls, newValue) {
     var e = getElementsByClassName(document, el, cls);
     if (e != null) {