[sword-svn] r196 - trunk

scribe at crosswire.org scribe at crosswire.org
Mon Mar 14 12:39:36 MST 2005


Author: scribe
Date: 2005-03-14 12:39:35 -0700 (Mon, 14 Mar 2005)
New Revision: 196

Modified:
   trunk/swordweb.js
Log:
Removed some of the spurious code and gave credit to Matej.


Modified: trunk/swordweb.js
===================================================================
--- trunk/swordweb.js	2005-03-11 12:32:03 UTC (rev 195)
+++ trunk/swordweb.js	2005-03-14 19:39:35 UTC (rev 196)
@@ -1,3 +1,8 @@
+/*
+Special thanks to Matej from Biblija.net for much of the
+inspiration, ideas, and direct plagerism below.
+*/
+
 var isIE4 = false;
 var isNS4 = false;
 
@@ -13,6 +18,7 @@
 var refwindow;
 var stevec = 0;
 
+var lastword = "";
 
 var xmlhttp=false;
 /*@cc_on @*/
@@ -33,167 +39,6 @@
   xmlhttp = new XMLHttpRequest();
 }
 
-var lastword = "";
-
-function p(mod, key, wordnum, extratext) {
-
-	/* check for aliases */
-	if (mod == "G") mod = "StrongsGreek";
-	if (mod == "H") mod = "StrongsHebrew";
-
-	xmlhttp.open("GET", "fetchdata.jsp?mod="+mod+"&key="+key,true);
-	xmlhttp.onreadystatechange=function() {
-		if (xmlhttp.readyState==4) {
-			b=document.getElementById("onlywlayer");
-			if (b==null) {
-				b=document.createElement("div");
-				b.id="onlywlayer";
-				b.className="word-layer";
-				document.body.appendChild(b);
-				b.style.visibility = "hidden";
-			}
-			b.innerHTML=xmlhttp.responseText + "<br/>"+extratext;
-			if ((wordnum == lastword) && (b.style.visibility == "visible")) {
-				showhide("onlywlayer", "hidden");
-			}
-			else {
-				showhide("onlywlayer", "visible");
-			}
-			lastword = wordnum;
-		}
-	}
-	xmlhttp.send(null)
-}
-
-
-function openref(url) {
-		stevec++;
-		var ime = "okno" + stevec;
-		var   opcije = "width=600,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1,dependent=true,alwaysRaised=true,titlebar=false,z-lock=true";
-//		alert ("Odprl bom okno" + ime);
-		if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1)
-				window.open(url + "&nobar=1&t=1",ime, opcije);
-}
-
-function getObject(field) {
-	var ret  = false;
-	eval ("ret = window.document.biblija." + field + ";");
-	return ret;
-}
-
-
-function setValue(field, content){
-	var ret  = getObject (field);
-	if (ret)
-		ret.value = content;
-	else
-		alert ("Your browser is old and has no so called 'Document Object Model' required by BIBLIJA.net.\nPlease upgrade it to some newer version to use it with BIBLIJA.net!");
-	return ret;
-}
-
-
-function mygoto (field, content){
-	var ret  = setValue (field, content);
-	if (ret)
-		document.biblija.submit();
-}
-
-
-function validate()
-{
-  var result = 1;
-  window.document.biblija.qids.value = "";
-  for (var i = 0; i<window.document.ids.elements.length;i++){
-	var e = window.document.ids.elements[i];
-	if (e.value >= 256 ){
-		if (result>=128){
-			window.document.biblija.qids.value = window.document.biblija.qids.value + result.toString(16);
-			result=1;
-		}
-		result *=2;
-		result += e.checked ? 1 : 0;
-	};
-  }
-  if (result!=2)
-	window.document.biblija.qids.value = window.document.biblija.qids.value + result.toString(16);
-  window.document.biblija.qall.value = window.document.ids.qall.checked ? 1 : 0;
-  return (true);
-}
-
-
-  function izberi(id, level)
-  {
-	var myref;
-	var mycnt = 0;
-	for (var i = 0; i<window.document.ids.elements.length;i++)
-		if (window.document.ids.elements[i].value % 256 == id){
-			myref=window.document.ids.elements[i];
-			mycnt = i;
-		}
-		 var  koncaj = false;
-	for (var i=mycnt+1;!koncaj;)
-    {
-		var e = window.document.ids.elements[i];
-		if (e.value / 256 > level + 1 )
-			e.checked = myref.checked;
-		else
-			koncaj=1;
-		i++;
-    if (i==window.document.ids.elements.length)
-		koncaj=true;
-    }
-  }
-
-  function izberi2(id, level)
-  {
-	var myref;
-	var mycnt = 0;
-	var total = window.document.ids.length;
-	for (var i = 0; i<total;i++){
-			// value: zgornji byte le level, spodnji id
-			if (window.document.ids.elements[i].value % 256  == id){
-				myref=window.document.ids.elements[i];
-				mycnt = i;
-			}
-	}
-	var	koncaj = false;
-	if (myref.checked)
-		  myref.checked = false;
-	 else
-		 myref.checked = true;
-	 izberi(id,level);
-
-  }
-
-  function revert(id)
-  {
-    myref=window.document.ids.elements[id];
-   if (myref.checked)
-	myref.checked = false;
-   else
-	myref.checked = true;
-  }
-
-
-  function izberivse(change)
- {
-	if (change )
-		if (window.document.ids.qall.checked)
-			window.document.ids.qall.checked = false;
-		else
-			window.document.ids.qall.checked = true;
-
-	for (var i=0;i<window.document.ids.elements.length;i++)
-		window.document.ids.elements[i].checked = window.document.ids.qall.checked;
-}
-
-
-
-////////// funkcije za Layerje - opombe
-////////// naredi jih še za Netscape
-
-
-
 // Detect if the browser is IE or not.
 // If it is not IE, we assume that the browser is NS.
 
@@ -223,32 +68,42 @@
   return true
 }
 
+function p(mod, key, wordnum, extratext) {
 
-function note (layer,image){
-  var graphic1 = 'opomba.gif';
-  var graphic2 = 'opomba2.gif';
+	/* check for aliases */
+	if (mod == "G") mod = "StrongsGreek";
+	if (mod == "H") mod = "StrongsHebrew";
 
-  showhide(layer);
+	xmlhttp.open("GET", "fetchdata.jsp?mod="+mod+"&key="+key,true);
+	xmlhttp.onreadystatechange=function() {
+		if (xmlhttp.readyState==4) {
+			b=document.getElementById("onlywlayer");
+			if (b==null) {
+				b=document.createElement("div");
+				b.id="onlywlayer";
+				b.className="word-layer";
+				document.body.appendChild(b);
+				b.style.visibility = "hidden";
+			}
+			b.innerHTML=xmlhttp.responseText + "<br/>"+extratext;
+			if ((wordnum == lastword) && (b.style.visibility == "visible")) {
+				showhide("onlywlayer", "hidden");
+			}
+			else {
+				showhide("onlywlayer", "visible");
+			}
+			lastword = wordnum;
+		}
+	}
+	xmlhttp.send(null)
 }
 
 
-function wordInfo (layer,image){
-  var graphic1 = 'ref.gif';
-  var graphic2 = 'ref2.gif';
 
-  showhide(layer);
-}
-
-
 function showhide (layer, vis) {
-//	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1)
-//	alert ("stanje od " + num + ": " + document.all[num].style.visibility + ", kaj= " + kaj);
-
 	// to ne sme biti na zaèetku, ker mora biti body že naložen, kar na zaèetku še ni
 	winW = isNS4 ? window.innerWidth-16 : document.body.offsetWidth-20;
 	winH = isNS4 ? window.innerHeight : document.body.offsetHeight;
-//	if (!document.all)
-//		return;
 	var l = document.getElementById(layer);
 	var cx = tempX + 10;
 	var cy = tempY - 10;
@@ -266,20 +121,3 @@
 	l.style.visibility = vis;
 }
 
-
-function wapme(){
-	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1)
-		wapwindow = window.open('http://gelon.net/cgi-bin/wapalizenokia6210.cgi?url=http://wap.biblija.net','nokia6210','width=200,height=430,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0');
-	else
-		alert('Žal!\nNepoznan brkljalnik...\n.');
-}
-
-function popup(lang){
-	var url = '/translations.' + lang + '.html';
-	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1)
-		infowindow = window.open(url,'infowindow','width=500,height=550,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
-	else
-		alert('Žal!\nNepoznan brkljalnik...\n.');
-}
-
-



More information about the sword-cvs mailing list