[sword-svn] r190 - in trunk: . layouts
scribe at crosswire.org
scribe at crosswire.org
Mon Mar 7 20:25:13 MST 2005
Author: scribe
Date: 2005-03-07 20:25:13 -0700 (Mon, 07 Mar 2005)
New Revision: 190
Added:
trunk/swordweb.js
Modified:
trunk/blues.css
trunk/init.jsp
trunk/layouts/base-layout.jsp
trunk/parchment.css
trunk/passagestudy.jsp
trunk/preferences.jsp
trunk/sandy.css
Log:
Added support for javascript
Modified: trunk/blues.css
===================================================================
--- trunk/blues.css 2005-03-07 13:39:32 UTC (rev 189)
+++ trunk/blues.css 2005-03-08 03:25:13 UTC (rev 190)
@@ -417,3 +417,32 @@
}
+.word-layer {
+ position:absolute;
+ margin-left : 0;
+ left:50px;
+ top:50px;
+ width:200px;
+ visibility: hidden;
+ background-color: #fff3cf;
+ overflow: visible;
+ z-index:6;
+ filter: Alpha(Opacity=92)
+ layer-background-color: #fff3cf;
+ border: 1px #000000;
+ border-style: solid;
+ padding: 7px 7px 7px 7px;
+ color : #000000;
+ font-size : x-small;
+ font-style : normal;
+ font-weight : normal;
+ font-variant : normal;
+ word-spacing : normal;
+ letter-spacing : normal;
+ vertical-align : baseline;
+ text-transform : none;
+ text-align : left;
+ text-indent : 0;
+ line-height : normal;
+}
+
Modified: trunk/init.jsp
===================================================================
--- trunk/init.jsp 2005-03-07 13:39:32 UTC (rev 189)
+++ trunk/init.jsp 2005-03-08 03:25:13 UTC (rev 190)
@@ -140,6 +140,16 @@
response.addCookie(c);
}
+ String javascript = (String)request.getParameter("Javascript");
+ if (javascript == null)
+ javascript = (String)session.getAttribute("Javascript");
+ else { // set style cookie
+ Cookie c = new Cookie("Javascript", javascript);
+ c.setMaxAge(java.lang.Integer.MAX_VALUE);
+ c.setPath("/");
+ response.addCookie(c);
+ }
+
Vector showTabs = (Vector)session.getAttribute("showTabs");
if (showTabs == null) {
showTabs = new Vector();
@@ -197,6 +207,9 @@
else if (cookies[i].getName().equals("Headings")) {
headings = cookies[i].getValue();
}
+ else if (cookies[i].getName().equals("Javascript")) {
+ javascript = cookies[i].getValue();
+ }
else if (cookies[i].getName().equals("PrefBibles")) {
prefBibles = new Vector();
start = 0;
@@ -254,6 +267,7 @@
session.setAttribute("ParDispModules", parDispModules);
session.setAttribute("PrefStyle", prefStyle);
session.setAttribute("Headings", headings);
+ session.setAttribute("Javascript", javascript);
session.setAttribute("showTabs", showTabs);
/*
// kept around in case we ever need it again
Modified: trunk/layouts/base-layout.jsp
===================================================================
--- trunk/layouts/base-layout.jsp 2005-03-07 13:39:32 UTC (rev 189)
+++ trunk/layouts/base-layout.jsp 2005-03-08 03:25:13 UTC (rev 190)
@@ -23,6 +23,7 @@
<!--For printing stuff -->
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
+ <script type="text/javascript" language="JavaScript" src="swordweb.js"></script>
</head>
<body>
Modified: trunk/parchment.css
===================================================================
(Binary files differ)
Modified: trunk/passagestudy.jsp
===================================================================
--- trunk/passagestudy.jsp 2005-03-07 13:39:32 UTC (rev 189)
+++ trunk/passagestudy.jsp 2005-03-08 03:25:13 UTC (rev 190)
@@ -34,6 +34,7 @@
String showMorph = request.getParameter("showMorph");
mgr.setGlobalOption("Headings", ("Off".equalsIgnoreCase(headings)) ? "Off":"On");
+ mgr.setJavascript(!"Off".equalsIgnoreCase(javascript));
for (int i = 0; i < 2; i++) {
String []nodes = request.getParameterValues((i>0)?"close":"open");
Modified: trunk/preferences.jsp
===================================================================
--- trunk/preferences.jsp 2005-03-07 13:39:32 UTC (rev 189)
+++ trunk/preferences.jsp 2005-03-08 03:25:13 UTC (rev 190)
@@ -154,6 +154,7 @@
<h2 id="misc">Misc Options</h2>
<ul>
<li><a id="headings" href="preferences.jsp?Headings=<%= "Off".equalsIgnoreCase(headings)?"On":"Off" %>#misc" title=<%= "Off".equalsIgnoreCase(headings)?"Show":"Hide" %> Headings in Bibles"><%= "Off".equalsIgnoreCase(headings)?"Show":"Hide" %> Headings in Bibles</a></li>
+ <li><a id="javascript" href="preferences.jsp?Javascript=<%= "Off".equalsIgnoreCase(javascript)?"On":"Off" %>#misc" title=<%= "Off".equalsIgnoreCase(javascript)?"Use":"Don't Use" %> Javascript"><%= "Off".equalsIgnoreCase(javascript)?"Use":"Don't Use" %> Javascript</a></li>
</ul>
</div>
Modified: trunk/sandy.css
===================================================================
--- trunk/sandy.css 2005-03-07 13:39:32 UTC (rev 189)
+++ trunk/sandy.css 2005-03-08 03:25:13 UTC (rev 190)
@@ -619,3 +619,33 @@
border-top: 1px solid #7F673C;
font-weight: bold;
}
+
+.word-layer {
+ position:absolute;
+ margin-left : 0;
+ left:50px;
+ top:50px;
+ width:200px;
+ visibility: hidden;
+ background-color: #fff3cf;
+ overflow: visible;
+ z-index:6;
+ filter: Alpha(Opacity=92)
+ layer-background-color: #fff3cf;
+ border: 1px #000000;
+ border-style: solid;
+ padding: 7px 7px 7px 7px;
+ color : #000000;
+ font-size : x-small;
+ font-style : normal;
+ font-weight : normal;
+ font-variant : normal;
+ word-spacing : normal;
+ letter-spacing : normal;
+ vertical-align : baseline;
+ text-transform : none;
+ text-align : left;
+ text-indent : 0;
+ line-height : normal;
+}
+
Added: trunk/swordweb.js
===================================================================
--- trunk/swordweb.js 2005-03-07 13:39:32 UTC (rev 189)
+++ trunk/swordweb.js 2005-03-08 03:25:13 UTC (rev 190)
@@ -0,0 +1,233 @@
+var isIE4 = false;
+var isNS4 = false;
+
+if (document!=null)
+ isIE4 = (document.all ? true : false);
+if (!isIE4)
+ isNS4 = document.layers ? true : false;
+
+var winW;
+var winH;
+
+
+var refwindow;
+var stevec = 0;
+
+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.
+
+// If NS -- that is, !IE -- then set up for mouse capture
+if (isNS4)
+ document.captureEvents(Event.MOUSEMOVE)
+
+// Set-up to use getMouseXY function onMouseMove
+// if (isIE4)
+document.onmousemove = getMouseXY;
+
+// Temporary variables to hold mouse x-y pos.s
+var tempX = 0
+var tempY = 0
+
+function getMouseXY(e) {
+ if (isIE4) { // grab the x-y pos.s if browser is IE
+ tempX = event.clientX + document.body.scrollLeft
+ tempY = event.clientY + document.body.scrollTop
+ } else { // grab the x-y pos.s if browser is NS
+ tempX = e.pageX
+ tempY = e.pageY
+ }
+ // catch possible negative values in NS4
+ if (tempX < 0){tempX = 0}
+ if (tempY < 0){tempY = 0}
+ return true
+}
+
+
+function note (layer,image){
+ var graphic1 = 'opomba.gif';
+ var graphic2 = 'opomba2.gif';
+
+ showhide(layer,image,graphic1,graphic2);
+}
+
+
+function wordInfo (layer,image){
+ var graphic1 = 'ref.gif';
+ var graphic2 = 'ref2.gif';
+
+ showhide(layer,image,graphic1,graphic2);
+}
+
+
+function showhide (layer,image,graphic1,graphic2){
+// 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 naloen, 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;
+ if (cx + 200 > winW)
+ cx = tempX - 220;
+ if (cx < 5){
+ cx = 5;
+ cy = cy + 20;
+ }
+ if (l.style.visibility == "visible"){
+ l.style.visibility = "hidden";
+ }
+ else{
+ l.style.left = "" + cx + "px";
+ l.style.top = "" + cy + "px";
+ l.style.visibility = "visible";
+ }
+}
+
+
+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