Bug #2867 - Trimming trailing whitespace in all (system range) javascript files.

skala
Ivan Tcholakov 16 years ago
parent ac78f29f83
commit 760d14b72e
  1. 2
      main/admin/calendar_tbl_change.js
  2. 2
      main/blog/tbl_change.js
  3. 2
      main/calendar/tbl_change.js
  4. 142
      main/inc/lib/asciimath/ASCIIMathML.js
  5. 122
      main/inc/lib/javascript/jquery.autocomplete.js
  6. 144
      main/inc/lib/javascript/jquery.customselect.js
  7. 8
      main/inc/lib/javascript/jquery.js
  8. 4
      main/inc/lib/javascript/jquery.tabs.js
  9. 102
      main/inc/lib/javascript/thickbox.js
  10. 16
      main/inc/lib/javascript/upload.js
  11. 4
      main/inc/lib/mediaplayer/swfobject.js
  12. 4
      main/inc/lib/swfobject/swfobject.js
  13. 128
      main/inc/lib/swfobject/swfobject_source/swfobject_source.js
  14. 92
      main/inc/lib/xajax/xajax_js/xajax_uncompressed.js
  15. 52
      main/messages/cookies.js
  16. 6
      main/newscorm/dtree.js
  17. 14
      main/newscorm/js/api_wrapper.js
  18. 24
      main/plugin/hotspot/JavaScriptFlashGateway.js
  19. 16
      main/plugin/hotspot/hotspot.js
  20. 2
      main/plugin/hotspot/jsmethods.js

@ -60,7 +60,7 @@ function initCalendar() {
if (!year && !month && !day) {
day = window.opener.day;
month = window.opener.month;
year = window.opener.year;
year = window.opener.year;
if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
dt = new Date();
year = dt.getFullYear();

@ -60,7 +60,7 @@ function initCalendar() {
if (!year && !month && !day) {
day = window.opener.day;
month = window.opener.month;
year = window.opener.year;
year = window.opener.year;
if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
dt = new Date();
year = dt.getFullYear();

@ -60,7 +60,7 @@ function initCalendar() {
if (!year && !month && !day) {
day = window.opener.day;
month = window.opener.month;
year = window.opener.year;
year = window.opener.year;
if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
dt = new Date();
year = dt.getFullYear();

@ -3,8 +3,8 @@ ASCIIMathML.js
==============
This file contains JavaScript functions to convert ASCII math notation
and LaTeX to Presentation MathML. Simple graphics commands are also
translated to SVG images. The conversion is done while the (X)HTML
page loads, and should work with Firefox/Mozilla/Netscape 7+ and Internet
translated to SVG images. The conversion is done while the (X)HTML
page loads, and should work with Firefox/Mozilla/Netscape 7+ and Internet
Explorer 6/7 + MathPlayer (http://www.dessci.com/en/products/mathplayer/) +
Adobe SVGview 3.03 (http://www.adobe.com/svg/viewer/install/).
@ -28,22 +28,22 @@ it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
(at http://www.gnu.org/licences/lgpl.html) for more details.
*/
var mathcolor = "blue"; // change it to "" (to inherit) or another color
//var mathfontsize = "1em"; // change to e.g. 1.2em for larger math
var mathfontsize = "1.2em"; // Modified by Ivan Tcholakov, 10-AUG-2009.
var mathfontfamily = "serif"; // change to "" to inherit (works in IE)
var mathfontfamily = "serif"; // change to "" to inherit (works in IE)
// or another family (e.g. "arial")
var automathrecognize = false; // writing "amath" on page makes this true
var checkForMathML = true; // check if browser can display MathML
var notifyIfNoMathML = true; // display note at top if no MathML capability
var alertIfNoMathML = false; // show alert box if no MathML capability
var translateOnLoad = true; // set to false to do call translators from js
var translateOnLoad = true; // set to false to do call translators from js
var translateLaTeX = true; // false to preserve $..$, $$..$$
var translateLaTeXformatting = true; // false to preserve \emph,\begin{},\end{}
var translateASCIIMath = true; // false to preserve `..`
@ -59,7 +59,7 @@ var dsvglocation = ""; // path to d.svg (blank if same as ASCIIMathML.js loc)
var isIE = document.createElementNS==null;
if (document.getElementById==null)
if (document.getElementById==null)
alert("This webpage requires a recent browser such as\
\nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer")
@ -79,7 +79,7 @@ function AMnoMathMLNote() {
an.appendChild(document.createTextNode("ASCIIMathML"));
an.setAttribute("href","http://www.chapman.edu/~jipsen/asciimath.html");
nd.appendChild(an);
nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));
nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));
an = AMcreateElementXHTML("a");
an.appendChild(document.createTextNode("MathPlayer"));
an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
@ -90,7 +90,7 @@ function AMnoMathMLNote() {
}
function AMisMathMLavailable() {
if (navigator.appName.slice(0,8)=="Netscape")
if (navigator.appName.slice(0,8)=="Netscape")
if (navigator.appVersion.slice(0,1)>="5") return null;
else return AMnoMathMLNote();
else if (navigator.appName.slice(0,9)=="Microsoft")
@ -121,7 +121,7 @@ var AMcal = [0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF
var AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128];
var AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8,
LEFTRIGHT = 9, TEXT = 10; // token types
@ -358,8 +358,8 @@ var AMnames = []; //list of input symbols
function AMinitSymbols() {
var texsymbols = [], i;
for (i=0; i<AMsymbols.length; i++)
if (AMsymbols[i].tex)
texsymbols[texsymbols.length] = {input:AMsymbols[i].tex,
if (AMsymbols[i].tex)
texsymbols[texsymbols.length] = {input:AMsymbols[i].tex,
tag:AMsymbols[i].tag, output:AMsymbols[i].output, ttype:AMsymbols[i].ttype};
AMsymbols = AMsymbols.concat(texsymbols);
AMsymbols.sort(compareNames);
@ -382,7 +382,7 @@ function AMcreateMmlNode(t,frag) {
}
function define(oldstr,newstr) {
AMsymbols = AMsymbols.concat([{input:oldstr, tag:"mo", output:newstr,
AMsymbols = AMsymbols.concat([{input:oldstr, tag:"mo", output:newstr,
tex:null, ttype:DEFINITION}]);
AMsymbols.sort(compareNames);
for (i=0; i<AMsymbols.length; i++) AMnames[i] = AMsymbols[i].input;
@ -391,14 +391,14 @@ function define(oldstr,newstr) {
function AMremoveCharsAndBlanks(str,n) {
//remove n characters and any following blanks
var st;
if (str.charAt(n)=="\\" && str.charAt(n+1)!="\\" && str.charAt(n+1)!=" ")
if (str.charAt(n)=="\\" && str.charAt(n+1)!="\\" && str.charAt(n+1)!=" ")
st = str.slice(n+1);
else st = str.slice(n);
for (var i=0; i<st.length && st.charCodeAt(i)<=32; i=i+1);
return st.slice(i);
}
function AMposition(arr, str, n) {
function AMposition(arr, str, n) {
// return position >=n where str appears or would be inserted
// assumes arr is sorted
if (n==0) {
@ -439,7 +439,7 @@ function AMgetSymbol(str) {
AMpreviousSymbol=AMcurrentSymbol;
if (match!=""){
AMcurrentSymbol=AMsymbols[mk].ttype;
return AMsymbols[mk];
return AMsymbols[mk];
}
// if str[0] is a digit or - return maxsubstring of digits.digits
AMcurrentSymbol=CONST;
@ -510,21 +510,21 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
return [null,str];
}
if (symbol.ttype == DEFINITION) {
str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length);
str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length);
symbol = AMgetSymbol(str);
}
switch (symbol.ttype) {
case UNDEROVER:
case CONST:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
str = AMremoveCharsAndBlanks(str,symbol.input.length);
return [AMcreateMmlNode(symbol.tag, //its a constant
document.createTextNode(symbol.output)),str];
case LEFTBRACKET: //read (expr+)
AMnestingDepth++;
str = AMremoveCharsAndBlanks(str,symbol.input.length);
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMparseExpr(str,true);
AMnestingDepth--;
if (typeof symbol.invisible == "boolean" && symbol.invisible)
if (typeof symbol.invisible == "boolean" && symbol.invisible)
node = AMcreateMmlNode("mrow",result[0]);
else {
node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
@ -556,7 +556,7 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
str = AMremoveCharsAndBlanks(str,i+1);
return [AMcreateMmlNode("mrow",newFrag),str];
case UNARY:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMparseSexpr(str);
if (result[0]==null) return [AMcreateMmlNode(symbol.tag,
document.createTextNode(symbol.output)),str];
@ -602,7 +602,7 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
return [node,result[1]];
}
case BINARY:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMparseSexpr(str);
if (result[0]==null) return [AMcreateMmlNode("mo",
document.createTextNode(symbol.input)),str];
@ -611,16 +611,16 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
if (result2[0]==null) return [AMcreateMmlNode("mo",
document.createTextNode(symbol.input)),str];
AMremoveBrackets(result2[0]);
if (symbol.input=="root" || symbol.input=="stackrel")
if (symbol.input=="root" || symbol.input=="stackrel")
newFrag.appendChild(result2[0]);
newFrag.appendChild(result[0]);
if (symbol.input=="frac") newFrag.appendChild(result2[0]);
return [AMcreateMmlNode(symbol.tag,newFrag),result2[1]];
case INFIX:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
str = AMremoveCharsAndBlanks(str,symbol.input.length);
return [AMcreateMmlNode("mo",document.createTextNode(symbol.output)),str];
case SPACE:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
str = AMremoveCharsAndBlanks(str,symbol.input.length);
node = AMcreateElementMathML("mspace");
node.setAttribute("width","1ex");
newFrag.appendChild(node);
@ -633,7 +633,7 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
case LEFTRIGHT:
// if (rightvert) return [null,str]; else rightvert = true;
AMnestingDepth++;
str = AMremoveCharsAndBlanks(str,symbol.input.length);
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMparseExpr(str,false);
AMnestingDepth--;
var st = "";
@ -651,7 +651,7 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
}
default:
//alert("default");
str = AMremoveCharsAndBlanks(str,symbol.input.length);
str = AMremoveCharsAndBlanks(str,symbol.input.length);
return [AMcreateMmlNode(symbol.tag, //its a constant
document.createTextNode(symbol.output)),str];
}
@ -719,9 +719,9 @@ function AMparseExpr(str,rightbracket) {
node.appendChild(result[0]);
newFrag.appendChild(node);
symbol = AMgetSymbol(str);
}
}
else if (node!=undefined) newFrag.appendChild(node);
} while ((symbol.ttype != RIGHTBRACKET &&
} while ((symbol.ttype != RIGHTBRACKET &&
(symbol.ttype != LEFTRIGHT || rightbracket)
|| AMnestingDepth == 0) && symbol!=null && symbol.output!="");
if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {
@ -733,7 +733,7 @@ function AMparseExpr(str,rightbracket) {
var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue;
if (right==")" || right=="]") {
var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue;
if (left=="(" && right==")" && symbol.output != "}" ||
if (left=="(" && right==")" && symbol.output != "}" ||
left=="[" && right=="]") {
var pos = []; // positions of commas
var matrix = true;
@ -741,12 +741,12 @@ function AMparseExpr(str,rightbracket) {
for (i=0; matrix && i<m; i=i+2) {
pos[i] = [];
node = newFrag.childNodes[i];
if (matrix) matrix = node.nodeName=="mrow" &&
(i==m-1 || node.nextSibling.nodeName=="mo" &&
if (matrix) matrix = node.nodeName=="mrow" &&
(i==m-1 || node.nextSibling.nodeName=="mo" &&
node.nextSibling.firstChild.nodeValue==",")&&
node.firstChild.firstChild.nodeValue==left &&
node.lastChild.firstChild.nodeValue==right;
if (matrix)
if (matrix)
for (var j=0; j<node.childNodes.length; j++)
if (node.childNodes[j].firstChild.nodeValue==",")
pos[i][pos[i].length]=j;
@ -891,7 +891,7 @@ function AMprocessNodeR(n, linebreaks) {
checkForMathML = false;
var nd = AMisMathMLavailable();
AMnoMathML = nd != null;
if (AMnoMathML && notifyIfNoMathML)
if (AMnoMathML && notifyIfNoMathML)
if (alertIfNoMathML)
alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\n\
or Firefox/Mozilla/Netscape");
@ -1037,7 +1037,7 @@ function LMnoMathMLNote() {
an.appendChild(document.createTextNode("LaTeXMathML"));
an.setAttribute("href","http://www.maths.nott.ac.uk/personal/drw/lm.html");
nd.appendChild(an);
nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));
nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));
an = LMcreateElementXHTML("a");
an.appendChild(document.createTextNode("MathPlayer"));
an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
@ -1067,7 +1067,7 @@ var LMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF
var LMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
//var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
// RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8, TEXT = 10,
// RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8, TEXT = 10,
var BIG = 11, LONG = 12, STRETCHY = 13, MATRIX = 14; // token types
var LMsqrt = {input:"\\sqrt", tag:"msqrt", output:"sqrt", ttype:UNARY},
@ -2126,10 +2126,10 @@ function LMprocessNode(n, linebreaks, spanclassLM) {
st = n.innerHTML;
} catch(err) {}
var am = /amath|agraph/i.test(st);
if ((st==null || st.indexOf("\$ ")!=-1 || st.indexOf("\$<")!=-1 ||
if ((st==null || st.indexOf("\$ ")!=-1 || st.indexOf("\$<")!=-1 ||
st.indexOf("\\begin")!=-1 || am || st.slice(-1)=="$" ||
st.indexOf("\$\n")!=-1)&& !/edit-content|HTMLArea|wikiedit/.test(st)){
if (!avoidinnerHTML && translateLaTeXformatting)
if (!avoidinnerHTML && translateLaTeXformatting)
st = simpleLaTeXformatting(st);
if (st!=null && am && !avoidinnerHTML) {
//alert(st)
@ -2189,10 +2189,10 @@ it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License (at http://www.gnu.org/license/lgpl.html)
General Public License (at http://www.gnu.org/license/lgpl.html)
for more details.*/
// you can change these
@ -2246,7 +2246,7 @@ var aboveleft = "aboveleft";
var aboveright = "aboveright";
var belowleft = "belowleft";
var belowright = "belowright";
var xmin, xmax, ymin, ymax, xscl, yscl,
var xmin, xmax, ymin, ymax, xscl, yscl,
xgrid, ygrid, xtick, ytick, initialized;
var strokewidth, strokedasharray, stroke, fill, strokeopacity, fillopacity;
var fontstyle, fontfamily, fontsize, fontweight, fontstroke, fontfill;
@ -2268,7 +2268,7 @@ var arccsc = function(x) { return arcsin(1/x) };
var arccot = function(x) { return arctan(1/x) };
var sinh = function(x) { return (Math.exp(x)-Math.exp(-x))/2 };
var cosh = function(x) { return (Math.exp(x)+Math.exp(-x))/2 };
var tanh =
var tanh =
function(x) { return (Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x)) };
var sech = function(x) { return 1/cosh(x) };
var csch = function(x) { return 1/sinh(x) };
@ -2359,7 +2359,7 @@ function isSVGavailable() {
an.setAttribute("href",
"http://www.chapman.edu/~jipsen/svg/svgenabledmozillafirefox.html");
nd.appendChild(an);
if (navigator.appName.slice(0,8)=="Netscape")
if (navigator.appName.slice(0,8)=="Netscape")
if (window['SVGElement']) return null;
else return nd;
else if (navigator.appName.slice(0,9)=="Microsoft")
@ -2391,7 +2391,7 @@ function getY(evt) { // return mouse y-coord in user coordinate system
function translateandeval(src) { //modify user input to JavaScript syntax
var errstr;
// replace plot(f(x),...) with plot("f(x)",...)
// replace plot(f(x),...) with plot("f(x)",...)
src = src.replace(/plot\(\x20*([^\"f\[][^\n\r;]+?)\,/g,"plot\(\"$1\",");
src = src.replace(/plot\(\x20*([^\"f\[][^\n\r;]+)\)/g,"plot(\"$1\")");
@ -2406,7 +2406,7 @@ function translateandeval(src) { //modify user input to JavaScript syntax
with (Math) eval(src); // here the svgpicture object is created
} catch(err) {
if (err!="wait") {
if (typeof err=="object")
if (typeof err=="object")
errstr = err.name+" "+err.message+" "+err.number+" "+err.description;
else errstr = err;
alert(errstr+"\n"+src)
@ -2437,7 +2437,7 @@ use Firefox 2.0 or later");
}
if (nd == null) {
for (index = 0; index < len; index++) {
width = null; height = null;
width = null; height = null;
xmin = null; xmax = null; ymin = null; ymax = null;
xscl = null; xgrid = null; yscl = null; ygrid = null;
initialized = false;
@ -2468,7 +2468,7 @@ use Firefox 2.0 or later");
}
if (ht==null) ht ="";
// if (ht!="") defaultborder = 25;
if (ht=="" || src=="")
if (ht=="" || src=="")
if (document.getElementById("picture"+(index+1)+"input")==null) {
node = myCreateElementXHTML("textarea");
arr = src.split("\n");
@ -2566,7 +2566,7 @@ function changepicturesize(evt,factor) {
updatePicture(name);
}
var sinceFirstClick = 0; // ondblclick simulation from
var sinceFirstClick = 0; // ondblclick simulation from
var dblClkTimer; // http://www.enja.org/david/?cat=13 Thanks!
function timer() {
if(sinceFirstClick<60) {
@ -2589,7 +2589,7 @@ function mClick(evt) {
clearTimeout(dblClkTimer);
sinceFirstClick = 0;
dblClkTimer = setTimeout("timer()",10);
}
}
} else {
sinceFirstClick = 0;
dblClkTimer = setTimeout("timer()",10);
@ -2622,9 +2622,9 @@ function initPicture(x_min,x_max,y_min,y_max) { // set up the graph
if (y_max!=null) ymax = y_max;
if (xmin==null) xmin = defaultxmin;
if (xmax==null) xmax = defaultxmax;
if (typeof xmin != "number" || typeof xmax != "number" || xmin >= xmax)
if (typeof xmin != "number" || typeof xmax != "number" || xmin >= xmax)
alert("Picture requires at least two numbers: xmin < xmax");
else if (y_max != null && (typeof y_min != "number" ||
else if (y_max != null && (typeof y_min != "number" ||
typeof y_max != "number" || y_min >= y_max))
alert("initPicture(xmin,xmax,ymin,ymax) requires numbers ymin < ymax");
else {
@ -2633,7 +2633,7 @@ function initPicture(x_min,x_max,y_min,y_max) { // set up the graph
if (width==null || width=="") width=defaultwidth;
}
picture.setAttribute("width",width);
if (height==null) {
if (height==null) {
height = picture.getAttribute("height");
if (height==null || height=="") height=defaultheight;
}
@ -2661,15 +2661,15 @@ function initPicture(x_min,x_max,y_min,y_max) { // set up the graph
throw "wait";
}
svgpicture = picture.getSVGDocument().getElementById("root");
while (svgpicture.childNodes.length>0)
svgpicture.removeChild(svgpicture.lastChild);
while (svgpicture.childNodes.length>0)
svgpicture.removeChild(svgpicture.lastChild);
svgpicture.setAttribute("width",width);
svgpicture.setAttribute("height",height);
svgpicture.setAttribute("name",picture.getAttribute("id"));
doc = picture.getSVGDocument();
var nd = document.getElementById(picture.getAttribute("id")+"mml");
if (nd!=null) // clear out MathML layer
while (nd.childNodes.length>0) nd.removeChild(nd.lastChild);
while (nd.childNodes.length>0) nd.removeChild(nd.lastChild);
} else {
var qnode = document.createElementNS("http://www.w3.org/2000/svg","svg");
qnode.setAttribute("id",picture.getAttribute("id"));
@ -2729,7 +2729,7 @@ function line(p,q,id,endpts) { // segment connecting points p,q (coordinates in
(height-p[1]*yunitlength-origin[1])+" "+
(q[0]*xunitlength+origin[0])+","+(height-q[1]*yunitlength-origin[1]));
node.setAttribute("stroke-width", strokewidth);
if (strokedasharray!=null)
if (strokedasharray!=null)
node.setAttribute("stroke-dasharray", strokedasharray);
node.setAttribute("stroke", stroke);
node.setAttribute("fill", fill);
@ -2771,7 +2771,7 @@ function path(plist,id,c,endpts) {
}
node.setAttribute("d", st);
node.setAttribute("stroke-width", strokewidth);
if (strokedasharray!=null)
if (strokedasharray!=null)
node.setAttribute("stroke-dasharray", strokedasharray);
node.setAttribute("stroke", stroke);
node.setAttribute("fill", fill);
@ -2818,11 +2818,11 @@ function circle(center,radius,id) { // coordinates in units
node.setAttribute("fill-opacity", fillopacity);
}
function loop(p,d,id) {
function loop(p,d,id) {
// d is a direction vector e.g. [1,0] means loop starts in that direction
if (d==null) d=[1,0];
path([p,[p[0]+d[0],p[1]+d[1]],[p[0]-d[1],p[1]+d[0]],p],id,"C");
if (marker=="arrow" || marker=="arrowdot")
if (marker=="arrow" || marker=="arrowdot")
arrowhead([p[0]+Math.cos(1.4)*d[0]-Math.sin(1.4)*d[1],
p[1]+Math.sin(1.4)*d[0]+Math.cos(1.4)*d[1]],p);
}
@ -2925,7 +2925,7 @@ function text(p,st,pos,id,fontsty) {
node.style.position = "absolute";
dnode.appendChild(node);
}
while (node.childNodes.length>0) node.removeChild(node.lastChild);
while (node.childNodes.length>0) node.removeChild(node.lastChild);
node.appendChild(document.createTextNode(st));
// node.lastChild.nodeValue = st;
node.style.left = ""+(p[0]*xunitlength+origin[0])+"px";
@ -2958,7 +2958,7 @@ function text(p,st,pos,id,fontsty) {
svgpicture.appendChild(node);
node.appendChild(doc.createTextNode(st));
}
while (node.childNodes.length>1) node.removeChild(node.lastChild);
while (node.childNodes.length>1) node.removeChild(node.lastChild);
// node.appendChild(document.createTextNode("\xA0"+st+"\xA0"));
//alert("here");
node.lastChild.nodeValue = "\xA0"+st+"\xA0";
@ -3075,7 +3075,7 @@ function dot(center, typ, label, pos, id) {
node.setAttribute("fill", (typ=="open"?"white":
(typ=="closed"?stroke:markerfill)));
}
if (label!=null)
if (label!=null)
text(center,label,(pos==null?"below":pos),(id==null?id:id+"label"))
}
@ -3099,7 +3099,7 @@ function arrowhead(p,q) { // draw arrowhead at q (in units) add size param
node.setAttribute("fill", stroke); /*was arrowfill*/
node.setAttribute("stroke-opacity", strokeopacity);
node.setAttribute("fill-opacity", fillopacity);
svgpicture.appendChild(node);
svgpicture.appendChild(node);
}
}
@ -3253,7 +3253,7 @@ function mathjs(st) {
j--;
while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z")
j--;
} else {
} else {
return "Error: incorrect syntax in "+st+" at position "+j;
}
//find right argument
@ -3280,7 +3280,7 @@ function mathjs(st) {
k++;
while (k<st.length && (ch=st.charAt(k))>="a" && ch<="z" ||
ch>="A" && ch<="Z") k++;
} else {
} else {
return "Error: incorrect syntax in "+st+" at position "+k;
}
st = st.slice(0,j+1)+"Math.pow("+st.slice(j+1,i)+","+st.slice(i+1,k)+")"+
@ -3313,7 +3313,7 @@ function mathjs(st) {
j--;
while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z")
j--;
} else {
} else {
return "Error: incorrect syntax in "+st+" at position "+j;
}
st = st.slice(0,j+1)+"factorial("+st.slice(j+1,i)+")"+st.slice(i+1);
@ -3325,7 +3325,7 @@ function plot(fun,x_min,x_max,points,id,endpts) {
var pth = [];
var f = function(x) { return x }, g = fun;
var name = null;
if (typeof fun=="string")
if (typeof fun=="string")
eval("g = function(x){ with(Math) return "+mathjs(fun)+" }");
else if (typeof fun=="object") {
eval("f = function(t){ with(Math) return "+mathjs(fun[0])+" }");
@ -3353,7 +3353,7 @@ function plot(fun,x_min,x_max,points,id,endpts) {
function slopefield(fun,dx,dy) {
var g = fun;
if (typeof fun=="string")
if (typeof fun=="string")
eval("g = function(x,y){ with(Math) return "+mathjs(fun)+" }");
var gxy,x,y,u,v,dz;
if (dx==null) dx=1;
@ -3427,8 +3427,8 @@ function calculate(inputId,outputId) {
} catch(e) {
err = "syntax incomplete";
}
if (!isNaN(res) && res!="Infinity")
str = "`"+str+" =` "+(Math.abs(res-Math.round(res*1000000)/1000000)<1e-15?Math.round(res*1000000)/1000000:res)+err;
if (!isNaN(res) && res!="Infinity")
str = "`"+str+" =` "+(Math.abs(res-Math.round(res*1000000)/1000000)<1e-15?Math.round(res*1000000)/1000000:res)+err;
else if (str!="") str = "`"+str+"` = undefined"; //debug:+mathjs(str);
var outnode = document.getElementById(outputId);
var n = outnode.childNodes.length;

@ -12,7 +12,7 @@
*/
;(function($) {
$.fn.extend({
autocomplete: function(urlOrData, options) {
var isUrl = typeof urlOrData == "string";
@ -22,13 +22,13 @@ $.fn.extend({
delay: isUrl ? $.Autocompleter.defaults.delay : 10,
max: options && !options.scroll ? 10 : 150
}, options);
// if highlight is set to false, replace it with a do-nothing function
options.highlight = options.highlight || function(value) { return value; };
// if the formatMatch option is not specified, then use formatItem for backwards compatibility
options.formatMatch = options.formatMatch || options.formatItem;
return this.each(function() {
new $.Autocompleter(this, options);
});
@ -77,9 +77,9 @@ $.Autocompleter = function(input, options) {
mouseDownOnSelect: false
};
var select = $.Autocompleter.Select(options, input, selectCurrent, config);
var blockSubmit;
// prevent form submit in opera when selecting with return key
$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
if (blockSubmit) {
@ -87,13 +87,13 @@ $.Autocompleter = function(input, options) {
return false;
}
});
// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
// track last key pressed
lastKeyPressCode = event.keyCode;
switch(event.keyCode) {
case KEY.UP:
event.preventDefault();
if ( select.visible() ) {
@ -102,7 +102,7 @@ $.Autocompleter = function(input, options) {
onChange(0, true);
}
break;
case KEY.DOWN:
event.preventDefault();
if ( select.visible() ) {
@ -111,7 +111,7 @@ $.Autocompleter = function(input, options) {
onChange(0, true);
}
break;
case KEY.PAGEUP:
event.preventDefault();
if ( select.visible() ) {
@ -120,7 +120,7 @@ $.Autocompleter = function(input, options) {
onChange(0, true);
}
break;
case KEY.PAGEDOWN:
event.preventDefault();
if ( select.visible() ) {
@ -129,7 +129,7 @@ $.Autocompleter = function(input, options) {
onChange(0, true);
}
break;
// matches also semicolon
case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
case KEY.TAB:
@ -141,11 +141,11 @@ $.Autocompleter = function(input, options) {
return false;
}
break;
case KEY.ESC:
select.hide();
break;
default:
clearTimeout(timeout);
timeout = setTimeout(onChange, options.delay);
@ -196,16 +196,16 @@ $.Autocompleter = function(input, options) {
$input.unbind();
$(input.form).unbind(".autocomplete");
});
function selectCurrent() {
var selected = select.selected();
if( !selected )
return false;
var v = selected.result;
previousValue = v;
if ( options.multiple ) {
var words = trimWords($input.val());
if ( words.length > 1 ) {
@ -213,26 +213,26 @@ $.Autocompleter = function(input, options) {
}
v += options.multipleSeparator;
}
$input.val(v);
hideResultsNow();
$input.trigger("result", [selected.data, selected.value]);
return true;
}
function onChange(crap, skipPrevCheck) {
if( lastKeyPressCode == KEY.DEL ) {
select.hide();
return;
}
var currentValue = $input.val();
if ( !skipPrevCheck && currentValue == previousValue )
return;
previousValue = currentValue;
currentValue = lastWord(currentValue);
if ( currentValue.length >= options.minChars) {
$input.addClass(options.loadingClass);
@ -244,7 +244,7 @@ $.Autocompleter = function(input, options) {
select.hide();
}
};
function trimWords(value) {
if ( !value ) {
return [""];
@ -257,14 +257,14 @@ $.Autocompleter = function(input, options) {
});
return result;
}
function lastWord(value) {
if ( !options.multiple )
return value;
var words = trimWords(value);
return words[words.length - 1];
}
// fills in the input box w/the first match (assumed to be the best match)
// q: the term entered
// sValue: the first matching result
@ -330,14 +330,14 @@ $.Autocompleter = function(input, options) {
success(term, data);
// if an AJAX url has been supplied, try loading the data now
} else if( (typeof options.url == "string") && (options.url.length > 0) ){
var extraParams = {
timestamp: +new Date()
};
$.each(options.extraParams, function(key, param) {
extraParams[key] = typeof param == "function" ? param() : param;
});
$.ajax({
// try to leverage ajaxQueue plugin to abort previous requests
mode: "abort",
@ -361,7 +361,7 @@ $.Autocompleter = function(input, options) {
failure(term);
}
};
function parse(data) {
var parsed = [];
var rows = data.split("\n");
@ -416,25 +416,25 @@ $.Autocompleter.Cache = function(options) {
var data = {};
var length = 0;
function matchSubset(s, sub) {
if (!options.matchCase)
if (!options.matchCase)
s = s.toLowerCase();
var i = s.indexOf(sub);
if (i == -1) return false;
return i == 0 || options.matchContains;
};
function add(q, value) {
if (length > options.cacheLength){
flush();
}
if (!data[q]){
if (!data[q]){
length++;
}
data[q] = value;
}
function populate(){
if( !options.data ) return false;
// track the matches
@ -443,23 +443,23 @@ $.Autocompleter.Cache = function(options) {
// no url was specified, we need to adjust the cache length to make sure it fits the local data store
if( !options.url ) options.cacheLength = 1;
// track all options for minChars = 0
stMatchSets[""] = [];
// loop through the array and create a lookup structure
for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
var rawValue = options.data[i];
// if rawValue is a string, make an array otherwise just reference the array
rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
var value = options.formatMatch(rawValue, i+1, options.data.length);
if ( value === false )
continue;
var firstChar = value.charAt(0).toLowerCase();
// if no lookup array for this character exists, look it up now
if( !stMatchSets[firstChar] )
if( !stMatchSets[firstChar] )
stMatchSets[firstChar] = [];
// if the match is a string
@ -468,7 +468,7 @@ $.Autocompleter.Cache = function(options) {
data: rawValue,
result: options.formatResult && options.formatResult(rawValue) || value
};
// push the current match into the set list
stMatchSets[firstChar].push(row);
@ -486,15 +486,15 @@ $.Autocompleter.Cache = function(options) {
add(i, value);
});
}
// populate any existing data
setTimeout(populate, 25);
function flush(){
data = {};
length = 0;
}
return {
flush: flush,
add: add,
@ -502,7 +502,7 @@ $.Autocompleter.Cache = function(options) {
load: function(q) {
if (!options.cacheLength || !length)
return null;
/*
/*
* if dealing w/local data and matchContains than we must make sure
* to loop through all the data collections looking for matches
*/
@ -522,9 +522,9 @@ $.Autocompleter.Cache = function(options) {
}
});
}
}
}
return csub;
} else
} else
// if the exact item exists, use it
if (data[q]){
return data[q];
@ -552,7 +552,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
var CLASSES = {
ACTIVE: "ac_over"
};
var listItems,
active = -1,
data,
@ -560,7 +560,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
needsInit = true,
element,
list;
// Create results
function init() {
if (!needsInit)
@ -570,11 +570,11 @@ $.Autocompleter.Select = function (options, input, select, config) {
.addClass(options.resultsClass)
.css("position", "absolute")
.appendTo(document.body);
list = $("<ul/>").appendTo(element).mouseover( function(event) {
if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
$(target(event)).addClass(CLASSES.ACTIVE);
$(target(event)).addClass(CLASSES.ACTIVE);
}
}).click(function(event) {
$(target(event)).addClass(CLASSES.ACTIVE);
@ -587,13 +587,13 @@ $.Autocompleter.Select = function (options, input, select, config) {
}).mouseup(function() {
config.mouseDownOnSelect = false;
});
if( options.width > 0 )
element.css("width", options.width);
needsInit = false;
}
}
function target(event) {
var element = event.target;
while(element && element.tagName != "LI")
@ -620,7 +620,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
}
}
};
function movePosition(step) {
active += step;
if (active < 0) {
@ -629,13 +629,13 @@ $.Autocompleter.Select = function (options, input, select, config) {
active = 0;
}
}
function limitNumberOfItems(available) {
return options.max && options.max < available
? options.max
: available;
}
function fillList() {
list.empty();
var max = limitNumberOfItems(data.length);
@ -657,7 +657,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
if ( $.fn.bgiframe )
list.bgiframe();
}
return {
display: function(d, q) {
init();
@ -709,7 +709,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
maxHeight: options.scrollHeight,
overflow: 'auto'
});
if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
var listHeight = 0;
listItems.each(function() {
@ -722,7 +722,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
}
}
}
},
selected: function() {

@ -3,201 +3,201 @@
;(function($){
$.fn.extend({
//計算文字Byte數,並回傳
getByteLength: function(strIN){
var i, cnt=0;
for (i=0; i<strIN.length; i++){
for (i=0; i<strIN.length; i++){
if (escape(strIN.charAt(i)).length >= 4) cnt+=2;
else cnt++;
}
else cnt++;
}
return cnt;
}
}
});
$.fn.extend({
//檢查文字的Byte數,超<EFBFBD>?<EFBFBD>limit指定的個數的話,就回傳true 和 未超<EFBFBD>?<EFBFBD><EFBFBD>?的文字index
getIndexByByte: function(strIN,limit){
var i, cnt=0;
for (i=0; i<strIN.length; i++){
for (i=0; i<strIN.length; i++){
if (escape(strIN.charAt(i)).length >= 4) cnt+=2;
else cnt++;
else cnt++;
if(cnt>limit)
{
return [true,i];
}
}
}
return false;
}
}
});
$.fn.extend({
finalselect: function(options) {
var settings =
{
{
id:null,
animalSpeed:100,
selectWidth:"190px",
selectWidth:"190px",
selectImage:"image/select.png",
selectText:"My friend",
zIndex: 0,
zIndex: 0,
viewHeight:"100px",
viewWidth:"300px",
viewMouseoverColor:"#cfdfff",//#dcdcdc
viewTop:"28px",//top,bottom
viewLeft:" -1px"//left,right
};
if (typeof(options)!='undefined')
{
//將整批options的值assign給settings
jQuery.extend(settings, options);
}
var tmp='<div id="'+settings.id+'-select" style="cursor:default;font-size:12px;z-index:'+settings.zIndex+';border: solid 0px #999; padding: 0px; width: 180px; position: relative;">'
tmp+='<div id="'+settings.id+'-Text" style="background: url('+settings.selectImage+') no-repeat 0 0; width: '+settings.selectWidth+'; height: 21px; color: Black; padding: 0 0 0 0;">';
tmp+='<div class="textshow" style="padding: 0px;">'+settings.selectText+'</div><div class="valueshow" style="display:none;"></div></div><div id="'+settings.id+'-selectshow" style="overflow-y:auto; overflow-x:hidden; height:'+settings.viewHeight+';width:'+settings.viewWidth+'; display:none; position: absolute; left:'+settings.viewLeft+'; top:'+settings.viewTop+'; border: solid 1px #999; background: white;"></div></div>';
var _handler = function() {
// 從這裡開始
$(this).html(tmp);
bindArrowClick();
bindSelectMouseover();
bindSelectMouseleave();
};
var bindArrowClick=function(){
var tmp=$('#'+settings.id+'-Text');
$("#"+settings.id+'-Text').bind("click", function(e){
$("#"+settings.id+'-Text').bind("click", function(e){
var obj=$('#'+settings.id+'-selectshow');
if(obj.css('display')=='none')
{
// obj.slide();
obj.slideDown(settings.animalSpeed,function(){
obj.show();
// obj.slide();
obj.slideDown(settings.animalSpeed,function(){
obj.show();
obj.css('overflow','auto');
obj.css('overflow-x','hidden');
});
}
else
{
obj.slideUp(settings.animalSpeed,function(){
obj.slideUp(settings.animalSpeed,function(){
obj.hide();
});
}
});
};
var bindItemMouseover=function(){
var inx=0;
while($(".selectitem",$("#"+settings.id+"-selectshow")).get(inx)!=null)
{
var item=$(".selectitem",$("#"+settings.id+"-selectshow")).get(inx);
$(item).bind("mouseover", function(e){
$(this).css('background-color',settings.viewMouseoverColor);
});
$(item).bind("mouseout", function(e){
$(this).css('background-color','#fff');
});
$(item).bind("click", function(e){
var tmpstr=$(".thistext",$(this)).html();
var arr=$().getIndexByByte(tmpstr,30);
var tmpstr=$(".thistext",$(this)).html();
var arr=$().getIndexByByte(tmpstr,30);
if(arr[0]==true)
tmpstr=tmpstr.substring(0,arr[1])+'...';
tmpstr=tmpstr.substring(0,arr[1])+'...';
$(".textshow",$("#"+settings.id+"-Text")).html(tmpstr);
document.getElementById(settings.id+'-selectshow').style.display="none";
$(".valueshow",$("#"+settings.id+"-Text")).html($(".selectvalue",$(this)).html());
});
inx++;
}
}
var bindSelectMouseover=function(){
$('#'+settings.id+'-Text').bind("mouseover",function(){
if($.browser.msie==false)
$('#'+settings.id+'-Text').css("background-position","0 -21px");
});
}
var bindSelectMouseleave=function(){
$('#'+settings.id+'-Text').bind("mouseout",function(){
if($.browser.msie==false)
$('#'+settings.id+'-Text').css("background-position","0 0px");
});
}
this.setViewTop = function(top){
$('#'+settings.id+'-selectshow').css('top',top+'px');
}
}
this.setViewLeft = function(left){
$('#'+settings.id+'-selectshow').css('left',left+'px');
}
}
this.getLength = function(){
return $('.selectitem',$('#'+settings.id+'-selectshow')).length;
}
}
//add item到select裡<EFBFBD>?<EFBFBD>
//在傳itemtext時,用<span class="thistext"></span>包起<EFBFBD>?顯示的 "文字"
//例如:<span class="thistext">哇哈哈</span>,這樣select<EFBFBD>?<EFBFBD>擇後,就會顯示 "哇哈哈"
this.addItem = function(itemtext,itemvalue){
this.addItem = function(itemtext,itemvalue){
var itemhtml='<div class="selectitem"><div class="selecttext">'+itemtext
+'</div><div class="selectvalue" style=" display:none;">'+itemvalue+'</div></div><div class="selectborder"><div>';
$("#"+settings.id+'-selectshow').html($("#"+settings.id+'-selectshow').html()+itemhtml);
bindItemMouseover();
$("#"+settings.id+'-selectshow').html($("#"+settings.id+'-selectshow').html()+itemhtml);
bindItemMouseover();
};
this.removeItem = function(index){
if($('.selectitem',$('#'+settings.id+'-selectshow')).length>index)
$($('.selectitem',$('#'+settings.id+'-selectshow')).get(index)).remove();
if($('.selectborder',$('#'+settings.id+'-selectshow')).length>index)
$($('.selectborder',$('#'+settings.id+'-selectshow')).get(index)).remove();
}
this.getValue = function(){
return $('.valueshow',$('#'+settings.id+'-Text')).html();
}
this.getText = function(){
return $('.textshow',$('#'+settings.id+'-Text')).html();
}
return this.each(_handler);
return this.each(_handler);
}
});

@ -582,7 +582,7 @@ jQuery.extend = jQuery.fn.extend = function() {
// Recurse if we're merging object values
if ( deep && copy && typeof copy == "object" && !copy.nodeType )
target[ name ] = jQuery.extend( deep,
target[ name ] = jQuery.extend( deep,
// Never move original objects, clone them
src || ( copy.length != null ? [ ] : { } )
, copy );
@ -2882,7 +2882,7 @@ jQuery.extend({
if ( xml && data.documentElement.tagName == "parsererror" )
throw "parsererror";
// Allow a pre-filtering function to sanitize the response
if( filter )
data = filter( data, type );
@ -3469,7 +3469,7 @@ jQuery.fn.extend({
parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
// Subtract element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
offset.top -= num( this, 'marginTop' );
offset.left -= num( this, 'marginLeft' );
@ -3500,7 +3500,7 @@ jQuery.fn.extend({
// Create scrollLeft and scrollTop methods
jQuery.each( ['Left', 'Top'], function(i, name) {
var method = 'scroll' + name;
jQuery.fn[ method ] = function(val) {
if (!this[0]) return;

@ -470,7 +470,7 @@ $.fn.tabs = function(initial, settings) {
if (!$.browser.msie) { // not in IE to prevent ClearType font issue
resetCSS['opacity'] = '';
}
// switch tab, animation prevents browser scrolling to the fragment
function switchTab() {
if (settings.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
@ -478,7 +478,7 @@ $.fn.tabs = function(initial, settings) {
}
toHide.animate(hideAnim, hideSpeed, function() { //
$(clicked).parents('li:eq(0)').addClass(settings.selectedClass).siblings().removeClass(settings.selectedClass);
toHide.addClass(settings.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
toHide.addClass(settings.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
if (typeof onHide == 'function') {
onHide(clicked, toShow[0], toHide[0]);
}

@ -4,13 +4,13 @@
* Copyright (c) 2007 cody lindley
* Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
var tb_pathToImage = "main/img/loadingAnimation.gif";
/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
//on page load call tb_init
$(document).ready(function(){
$(document).ready(function(){
tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
imgLoader = new Image();// preload image
imgLoader.src = tb_pathToImage;
@ -18,7 +18,7 @@ $(document).ready(function(){
//
function load_thick (hrefinfo,textinfo) {
imgLoader = new Image();// preload image
imgLoader.src = tb_pathToImage;
imgLoader.src = tb_pathToImage;
name_user=textinfo.replace(/\+/g," ");
tb_show(name_user,hrefinfo, '');
}
@ -50,29 +50,29 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
$("#TB_overlay").click(tb_remove);
}
}
if(tb_detectMacXFF()){
$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
}else{
$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
}
if(caption===null){caption="";}
$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
$('#TB_load').show();//show loader
var baseURL;
if(url.indexOf("?")!==-1){ //ff there is a query string involved
baseURL = url.substr(0, url.indexOf("?"));
}else{
}else{
baseURL = url;
}
var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
var urlType = baseURL.toLowerCase().match(urlString);
if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
TB_PrevCaption = "";
TB_PrevURL = "";
TB_PrevHTML = "";
@ -85,7 +85,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
TB_TempArray = $("a[@rel="+imageGroup+"]").get();
for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
if (!(TB_TempArray[TB_Counter].href == url)) {
if (!(TB_TempArray[TB_Counter].href == url)) {
if (TB_FoundURL) {
TB_NextCaption = TB_TempArray[TB_Counter].title;
TB_NextURL = TB_TempArray[TB_Counter].href;
@ -97,15 +97,15 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
}
} else {
TB_FoundURL = true;
TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);
TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);
}
}
}
imgPreloader = new Image();
imgPreloader.onload = function(){
imgPreloader.onload = function(){
imgPreloader.onload = null;
// Resizing large images - orginal by Christian Montoya edited by me.
var pagesize = tb_getPageSize();
var x = pagesize[0] - 150;
@ -113,51 +113,51 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
var imageWidth = imgPreloader.width;
var imageHeight = imgPreloader.height;
if (imageWidth > x) {
imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
if (imageHeight > y) {
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
if (imageHeight > y) {
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
}
} else if (imageHeight > y) {
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
if (imageWidth > x) {
imageHeight = imageHeight * (x / imageWidth);
} else if (imageHeight > y) {
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
if (imageWidth > x) {
imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
}
}
// End Resizing
TB_WIDTH = imageWidth + 30;
TB_HEIGHT = imageHeight + 60;
$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");
$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");
$("#TB_closeWindowButton").click(tb_remove);
if (!(TB_PrevHTML === "")) {
function goPrev(){
if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
$("#TB_window").remove();
$("body").append("<div id='TB_window'></div>");
tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
return false;
return false;
}
$("#TB_prev").click(goPrev);
}
if (!(TB_NextHTML === "")) {
if (!(TB_NextHTML === "")) {
function goNext(){
$("#TB_window").remove();
$("body").append("<div id='TB_window'></div>");
tb_show(TB_NextCaption, TB_NextURL, imageGroup);
return false;
tb_show(TB_NextCaption, TB_NextURL, imageGroup);
return false;
}
$("#TB_next").click(goNext);
}
document.onkeydown = function(e){
document.onkeydown = function(e){
if (e == null) { // ie
keycode = event.keyCode;
} else { // mozilla
@ -175,18 +175,18 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
document.onkeydown = "";
goPrev();
}
}
}
};
tb_position();
$("#TB_load").remove();
$("#TB_ImageOff").click(tb_remove);
$("#TB_window").css({display:"block"}); //for safari using css instead of show
};
imgPreloader.src = url;
}else{//code to show html
var queryString = url.replace(/^[^\?]+\??/,'');
var params = tb_parseQuery( queryString );
@ -194,8 +194,8 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
ajaxContentW = TB_WIDTH - 30;
ajaxContentH = TB_HEIGHT - 45;
if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window
if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window
urlNoQuery = url.split('TB_');
$("#TB_iframeContent").remove();
if(params['modal'] != "true"){//iframe no modal
@ -210,7 +210,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
}else{//ajax modal
$("#TB_overlay").unbind();
$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
}
}else{//this means the window is already up, we are just loading new content via ajax
$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
@ -219,17 +219,17 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
$("#TB_ajaxWindowTitle").html(caption);
}
}
$("#TB_closeWindowButton").click(tb_remove);
if(url.indexOf('TB_inline') != -1){
if(url.indexOf('TB_inline') != -1){
$("#TB_ajaxContent").append($('#' + params['inlineId']).children());
$("#TB_window").unload(function () {
$('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished
});
tb_position();
$("#TB_load").remove();
$("#TB_window").css({display:"block"});
$("#TB_window").css({display:"block"});
}else if(url.indexOf('TB_iframe') != -1){
tb_position();
if($.browser.safari){//safari needs help because it will not fire iframe onload
@ -244,11 +244,11 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
$("#TB_window").css({display:"block"});
});
}
}
if(!params['modal']){
document.onkeyup = function(e){
document.onkeyup = function(e){
if (e == null) { // ie
keycode = event.keyCode;
} else { // mozilla
@ -256,10 +256,10 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
}
if(keycode == 27){ // close
tb_remove();
}
}
};
}
} catch(e) {
//nothing here
}
@ -325,10 +325,10 @@ function tb_detectMacXFF() {
function TB_special(pi_href){
// get caption: either title or name attribute
var caption = this.title || this.name || "";
// get rel attribute for image groups
var group = this.rel || false;
// display the box for the elements href
TB_show(caption, pi_href, group);
}

@ -6,10 +6,10 @@
* Upload class. Used to pack functions into one practical object.
* Call like this: var myUpload = new upload(5);
*/
function upload(latency){
function upload(latency){
/**
* Starts the timer
* Call like this:
* Call like this:
* @param string Name of the DOM element we need to update
* @param string Loading image to display
* @return true
@ -21,7 +21,7 @@ function upload(latency){
__progress_bar_interval = setTimeout(__display_progress_bar,latency,__progress_bar_text);
__upload_form_domid = formid;
}
/**
* Starts the timer of the real upload progress
*/
@ -30,22 +30,22 @@ function upload(latency){
__progress_bar_uploadid = upload_id;
__progress_bar_waitAfterUpload = waitAfterUpload;
__upload_form_domid = formid;
__progress_bar_interval = setInterval(__refreshUpload,latency);
__progress_bar_interval = setInterval(__refreshUpload,latency);
document.getElementById(domid+'_container').style.display = 'block';
if(waitAfterUpload){
document.getElementById(domid+'_waiter_container').style.display = 'block';
}
}
/**
* Function called by a timer to update every x seconds the progress bar
*/
function __refreshUpload(){
xajax_updateProgress(__progress_bar_domid, __progress_bar_uploadid, __progress_bar_waitAfterUpload);
}
/**
* Displays the progress bar in the given DOM element
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -22,22 +22,22 @@
* production scripts are merged.
*
* Links:
* http://blog.deconcept.com/swfobject/
* http://blog.deconcept.com/swfobject/
* http://code.google.com/p/swfobject/
*
* License:
* The MIT License - http://www.opensource.org/licenses/mit-license.php
*
* Authors:
* Authors:
* (c) 2007 Geoff Stearns (SWFObject 1.5)
* For SWFObject 2.2, a list of the authors may be seen at:
* http://code.google.com/p/swfobject/people/list
* http://code.google.com/p/swfobject/people/list
*
* This hybrid solution has been prepared by Ivan Tcholakov, July 2009.
*
*/
/******************************************************************************/
@ -279,12 +279,12 @@ var SWFObject = deconcept.SWFObject;
/******************************************************************************/
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject = function() {
var UNDEF = "undefined",
OBJECT = "object",
SHOCKWAVE_FLASH = "Shockwave Flash",
@ -292,11 +292,11 @@ var swfobject = function() {
FLASH_MIME_TYPE = "application/x-shockwave-flash",
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
ON_READY_STATE_CHANGE = "onreadystatechange",
win = window,
doc = document,
nav = navigator,
plugin = false,
domLoadFnArr = [main],
regObjArr = [],
@ -311,11 +311,11 @@ var swfobject = function() {
dynamicStylesheet,
dynamicStylesheetMedia,
autoHideShow = true,
/* Centralized function for browser feature detection
- User agent string detection is only used when no good alternative is possible
- Is executed directly for optimal performance
*/
*/
ua = function() {
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
u = nav.userAgent.toLowerCase(),
@ -353,21 +353,21 @@ var swfobject = function() {
}
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
}(),
/* Cross-browser onDomLoad
- Will fire an event as soon as the DOM of a web page is loaded
- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
- Regular onload serves as fallback
*/
*/
onDomLoad = function() {
if (!ua.w3) { return; }
if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
callDomLoadFunctions();
}
if (!isDomLoaded) {
if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
}
}
if (ua.ie && ua.win) {
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
if (doc.readyState == "complete") {
@ -402,7 +402,7 @@ var swfobject = function() {
addLoadEvent(callDomLoadFunctions);
}
}();
function callDomLoadFunctions() {
if (isDomLoaded) { return; }
try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
@ -416,19 +416,19 @@ var swfobject = function() {
domLoadFnArr[i]();
}
}
function addDomLoadEvent(fn) {
if (isDomLoaded) {
fn();
}
else {
else {
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
}
}
/* Cross-browser onload
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
- Will fire an event as soon as a web page including all of its assets are loaded
- Will fire an event as soon as a web page including all of its assets are loaded
*/
function addLoadEvent(fn) {
if (typeof win.addEventListener != UNDEF) {
@ -451,11 +451,11 @@ var swfobject = function() {
win.onload = fn;
}
}
/* Main function
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
*/
function main() {
function main() {
if (plugin) {
testPlayerVersion();
}
@ -463,7 +463,7 @@ var swfobject = function() {
matchVersions();
}
}
/* Detect the Flash Player version for non-Internet Explorer browsers
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
a. Both release and build numbers can be detected
@ -500,7 +500,7 @@ var swfobject = function() {
matchVersions();
}
}
/* Perform Flash Player and SWF version matching; static publishing only
*/
function matchVersions() {
@ -549,7 +549,7 @@ var swfobject = function() {
setVisibility(id, true);
if (cb) {
var o = getObjectById(id); // test whether there is an HTML object element or not
if (o && typeof o.SetVariable != UNDEF) {
if (o && typeof o.SetVariable != UNDEF) {
cbObj.success = true;
cbObj.ref = o;
}
@ -559,7 +559,7 @@ var swfobject = function() {
}
}
}
function getObjectById(objectIdStr) {
var r = null;
var o = getElementById(objectIdStr);
@ -576,7 +576,7 @@ var swfobject = function() {
}
return r;
}
/* Requirements for Adobe Express Install
- only one instance can be active at a time
- fp 6.0.65 or higher
@ -586,7 +586,7 @@ var swfobject = function() {
function canExpressInstall() {
return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
}
/* Show the Adobe Express Install dialog
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
*/
@ -636,7 +636,7 @@ var swfobject = function() {
createSWF(att, par, replaceElemIdStr);
}
}
/* Functions to abstract and display alternative content
*/
function displayAltContent(obj) {
@ -659,7 +659,7 @@ var swfobject = function() {
else {
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
}
}
}
function abstractAltContent(obj) {
var ac = createElement("div");
@ -682,7 +682,7 @@ var swfobject = function() {
}
return ac;
}
/* Cross-browser dynamic SWF creation
*/
function createSWF(attObj, parObj, id) {
@ -715,7 +715,7 @@ var swfobject = function() {
}
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
r = getElementById(attObj.id);
r = getElementById(attObj.id);
}
else { // well-behaving browsers
var o = createElement(OBJECT);
@ -741,14 +741,14 @@ var swfobject = function() {
}
return r;
}
function createObjParam(el, pName, pValue) {
var p = createElement("param");
p.setAttribute("name", pName);
p.setAttribute("name", pName);
p.setAttribute("value", pValue);
el.appendChild(p);
}
/* Cross-browser SWF removal
- Especially needed to safely and completely remove a SWF in Internet Explorer
*/
@ -771,7 +771,7 @@ var swfobject = function() {
}
}
}
function removeObjectInIE(id) {
var obj = getElementById(id);
if (obj) {
@ -783,7 +783,7 @@ var swfobject = function() {
obj.parentNode.removeChild(obj);
}
}
/* Functions to optimize JavaScript compression
*/
function getElementById(id) {
@ -794,19 +794,19 @@ var swfobject = function() {
catch (e) {}
return el;
}
function createElement(el) {
return doc.createElement(el);
}
/* Updated attachEvent function for Internet Explorer
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
*/
*/
function addListener(target, eventType, fn) {
target.attachEvent(eventType, fn);
listenersArr[listenersArr.length] = [target, eventType, fn];
}
/* Flash Player and SWF content version matching
*/
function hasPlayerVersion(rv) {
@ -816,10 +816,10 @@ var swfobject = function() {
v[2] = parseInt(v[2], 10) || 0;
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
}
/* Cross-browser dynamic CSS creation
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
*/
*/
function createCSS(sel, decl, media, newStyle) {
if (ua.ie && ua.mac) { return; }
var h = doc.getElementsByTagName("head")[0];
@ -829,7 +829,7 @@ var swfobject = function() {
dynamicStylesheet = null;
dynamicStylesheetMedia = null;
}
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
// create dynamic stylesheet + get a global reference to it
var s = createElement("style");
s.setAttribute("type", "text/css");
@ -852,7 +852,7 @@ var swfobject = function() {
}
}
}
function setVisibility(id, isVisible) {
if (!autoHideShow) { return; }
var v = isVisible ? "visible" : "hidden";
@ -871,7 +871,7 @@ var swfobject = function() {
var hasBadChars = regex.exec(s) != null;
return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
}
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
*/
var cleanup = function() {
@ -899,11 +899,11 @@ var swfobject = function() {
});
}
}();
return {
/* Public API
- Reference: http://code.google.com/p/swfobject/wiki/documentation
*/
*/
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
if (ua.w3 && objectIdStr && swfVersionStr) {
var regObj = {};
@ -918,13 +918,13 @@ var swfobject = function() {
callbackFn({success:false, id:objectIdStr});
}
},
getObjectById: function(objectIdStr) {
if (ua.w3) {
return getObjectById(objectIdStr);
}
},
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
var callbackObj = {success:false, id:replaceElemIdStr};
if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
@ -941,7 +941,7 @@ var swfobject = function() {
att.data = swfUrlStr;
att.width = widthStr;
att.height = heightStr;
var par = {};
var par = {};
if (parObj && typeof parObj === OBJECT) {
for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
par[j] = parObj[j];
@ -978,19 +978,19 @@ var swfobject = function() {
}
else if (callbackFn) { callbackFn(callbackObj); }
},
switchOffAutoHideShow: function() {
autoHideShow = false;
},
ua: ua,
getFlashPlayerVersion: function() {
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
},
hasFlashPlayerVersion: hasPlayerVersion,
createSWF: function(attObj, parObj, replaceElemIdStr) {
if (ua.w3) {
return createSWF(attObj, parObj, replaceElemIdStr);
@ -999,29 +999,29 @@ var swfobject = function() {
return undefined;
}
},
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
if (ua.w3 && canExpressInstall()) {
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
}
},
removeSWF: function(objElemIdStr) {
if (ua.w3) {
removeSWF(objElemIdStr);
}
},
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
if (ua.w3) {
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
}
},
addDomLoadEvent: addDomLoadEvent,
addLoadEvent: addLoadEvent,
getQueryParamValue: function(param) {
var q = doc.location.search || doc.location.hash;
if (q) {
@ -1038,7 +1038,7 @@ var swfobject = function() {
}
return "";
},
// For internal usage only
expressInstallCallback: function() {
if (isExpressInstallActive) {
@ -1052,7 +1052,7 @@ var swfobject = function() {
if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
}
isExpressInstallActive = false;
}
}
}
};
}();

@ -27,11 +27,11 @@ function Xajax()
alert("Xajax Debug:\n " + text);
}
};
this.workId = 'xajaxWork'+ new Date().getTime();
this.depth = 0;
this.responseErrorsForAlert = ["400","401","402","403","404","500","501","502","503"];
//Get the XMLHttpRequest Object
this.getRequestObject = function()
{
@ -65,9 +65,9 @@ function Xajax()
}
if(!req && window.createRequest)
req = window.createRequest();
if (!req) this.DebugMessage("Request Object Instantiation failed.");
return req;
}
@ -86,7 +86,7 @@ function Xajax()
}
return returnObj;
}
// xajax.include(sFileName) dynamically includes an external javascript file
this.include = function(sFileName)
{
@ -96,7 +96,7 @@ function Xajax()
objScript.src = sFileName;
objHead[0].appendChild(objScript);
}
this.stripOnPrefix = function(sEventName)
{
sEventName = sEventName.toLowerCase();
@ -104,10 +104,10 @@ function Xajax()
{
sEventName = sEventName.replace(/on/,'');
}
return sEventName;
}
this.addOnPrefix = function(sEventName)
{
sEventName = sEventName.toLowerCase();
@ -115,10 +115,10 @@ function Xajax()
{
sEventName = 'on' + sEventName;
}
return sEventName;
}
// xajax.addHandler adds an event handler to an element
this.addHandler = function(sElementId, sEvent, sFunctionName)
{
@ -133,7 +133,7 @@ function Xajax()
eval("this.$('"+sElementId+"').attachEvent('"+sAltEvent+"',"+sFunctionName+",false);");
}
}
// xajax.removeHandler removes an event handler from an element
this.removeHandler = function(sElementId, sEvent, sFunctionName)
{
@ -148,7 +148,7 @@ function Xajax()
eval("this.$('"+sElementId+"').detachEvent('"+sAltEvent+"',"+sFunctionName+",false);");
}
}
// xajax.create creates a new child node under a parent
this.create = function(sParentId, sTag, sId)
{
@ -158,7 +158,7 @@ function Xajax()
if (objParent)
objParent.appendChild(objElement);
}
// xajax.insert inserts a new node before another node
this.insert = function(sBeforeId, sTag, sId)
{
@ -176,7 +176,7 @@ function Xajax()
objElement.setAttribute('id',sId);
objSibling.parentNode.insertBefore(objElement, objSibling.nextSibling);
}
this.getInput = function(sType, sName, sId)
{
var Obj;
@ -193,7 +193,7 @@ function Xajax()
}
return Obj;
}
// xajax.createInput creates a new input node under a parent
this.createInput = function(sParentId, sType, sName, sId)
{
@ -202,7 +202,7 @@ function Xajax()
if (objParent && objElement)
objParent.appendChild(objElement);
}
// xajax.insertInput creates a new input node before another node
this.insertInput = function(sBeforeId, sType, sName, sId)
{
@ -221,7 +221,7 @@ function Xajax()
objSibling.parentNode.insertBefore(objElement, objSibling.nextSibling);
}
}
// xajax.remove deletes an element
this.remove = function(sId)
{
@ -231,16 +231,16 @@ function Xajax()
objElement.parentNode.removeChild(objElement);
}
}
//xajax.replace searches for text in an attribute of an element and replaces it
//with a different text
this.replace = function(sId,sAttribute,sSearch,sReplace)
{
var bFunction = false;
if (sAttribute == "innerHTML")
sSearch = this.getBrowserHTML(sSearch);
eval("var txt=this.$('"+sId+"')."+sAttribute);
if (typeof txt == "function")
{
@ -267,7 +267,7 @@ function Xajax()
}
}
}
// xajax.getFormValues() builds a query string XML message from the elements of a form object
// * The first argument is the id of the form
// * The second argument (optional) can be set to true if you want to submit disabled elements
@ -282,7 +282,7 @@ function Xajax()
var prefix="";
if(arguments.length > 2)
prefix = arguments[2];
if (typeof(frm) == "string")
objForm = this.$(frm);
else
@ -318,15 +318,15 @@ function Xajax()
{
sXml += name+"="+encodeURIComponent(formElements[i].value);
}
}
}
}
}
sXml +="</q></xjxquery>";
return sXml;
}
// Generates an XML message that xajax can understand from a javascript object
this.objectToXML = function(obj)
{
@ -339,7 +339,7 @@ function Xajax()
continue;
if (obj[i] && typeof(obj[i]) == 'function')
continue;
var key = i;
var value = obj[i];
if (value && typeof(value)=="object" && this.depth <= 50)
@ -348,9 +348,9 @@ function Xajax()
value = this.objectToXML(value);
this.depth--;
}
sXml += "<e><k>"+key+"</k><v>"+value+"</v></e>";
}
catch(e)
{
@ -358,7 +358,7 @@ function Xajax()
}
}
sXml += "</xjxobj>";
return sXml;
}
@ -394,7 +394,7 @@ function Xajax()
}
}
return data;
}
}
}
this.loadingFunction = function(){};
@ -473,7 +473,7 @@ function Xajax()
{
if (r.readyState != 4)
return;
if (r.status==200)
{
if (xajaxDebug) xajax.DebugMessage("Received:\n" + r.responseText);
@ -488,7 +488,7 @@ function Xajax()
errorString += "\nYou have whitespace in your response.";
alert(errorString);
document.body.style.cursor = 'default';
if (xajaxStatusMessages == true) window.status = 'Invalid XML response error';
if (xajaxStatusMessages == true) window.status = 'Invalid XML response error';
}
}
else {
@ -498,9 +498,9 @@ function Xajax()
alert(errorString);
}
document.body.style.cursor = 'default';
if (xajaxStatusMessages == true) window.status = 'Invalid XML response error';
if (xajaxStatusMessages == true) window.status = 'Invalid XML response error';
}
delete r;
r = null;
}
@ -510,7 +510,7 @@ function Xajax()
delete r;
return true;
}
//Gets the text as it would be if it were being retrieved from
//the innerHTML property in the current browser
this.getBrowserHTML = function(html)
@ -526,11 +526,11 @@ function Xajax()
}
tmpXajax.innerHTML = html;
var browserHTML = tmpXajax.innerHTML;
tmpXajax.innerHTML = '';
tmpXajax.innerHTML = '';
return browserHTML;
}
// Tests if the new Data is the same as the extant data
this.willChange = function(element, attribute, newData)
{
@ -544,7 +544,7 @@ function Xajax()
}
elementObject = this.$(element);
if (elementObject) {
var oldData;
var oldData;
eval("oldData=this.$('"+element+"')."+attribute);
if (newData !== oldData)
return true;
@ -552,13 +552,13 @@ function Xajax()
return false;
}
//Returns the source code of the page after it's been modified by xajax
this.viewSource = function()
{
return "<html>"+document.getElementsByTagName("HTML")[0].innerHTML+"</html>";
}
//Process XML xajaxResponses returned from the request
this.processResponse = function(xml)
{
@ -569,7 +569,7 @@ function Xajax()
xml = xml.documentElement;
if (xml == null)
return;
var skipCommands = 0;
for (var i=0; i<xml.childNodes.length; i++)
{
@ -633,7 +633,7 @@ function Xajax()
} else {
var internalData = xml.childNodes[i].childNodes[j].firstChild.nodeValue;
}
if (xml.childNodes[i].childNodes[j].nodeName == "s")
{
search = internalData;
@ -648,7 +648,7 @@ function Xajax()
data = xml.childNodes[i].firstChild.nodeValue;
else
data = "";
if (objElement != "XJX_SKIP") objElement = this.$(id);
var cmdFullname;
try
@ -782,7 +782,7 @@ function Xajax()
delete internalData;
delete j;
delete k;
}
}
}
delete xml;
delete i;

@ -16,7 +16,7 @@ function Set_Cookie( name, value, expires, path, domain, secure ) {
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
( ( path ) ? ";path=" + path : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
@ -42,15 +42,15 @@ function set_url(ref)
}
function mostrar_aviso()
{
document.getElementById("box").style.visibility="visible";
}
function ocultar_aviso()
{
document.getElementById("box").style.visibility="hidden";
}
function notificar()
@ -60,22 +60,22 @@ function notificar()
}
function vernuevos()
{
{
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
}
function stateChanged()
{
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("nuevos").innerHTML=xmlHttp.responseText
document.getElementById("nuevos").innerHTML=xmlHttp.responseText
if(Get_Cookie("nuevos")==null || xmlHttp.responseText-Get_Cookie("nuevos")>0 )
{
mostrar_aviso()
setTimeout("ocultar_aviso()",7000);
}
@ -84,39 +84,39 @@ function stateChanged()
}
function GetXmlHttpObject(handler)
{
{
var objXmlHttp=null
if (navigator.userAgent.indexOf("Opera")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler
objXmlHttp.onerror=handler
return objXmlHttp
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{
{
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
}
}
try
{
{
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler
objXmlHttp.onreadystatechange=handler
return objXmlHttp
}
}
catch(e)
{
alert("Error. Scripting for ActiveX might be disabled")
return
}
}
{
alert("Error. Scripting for ActiveX might be disabled")
return
}
}
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler
objXmlHttp.onerror=handler
return objXmlHttp
}
}
}
}

@ -81,11 +81,11 @@ function dTree(objName) {
inOrder : false
}
this.icon = {
root : '../img/lp.gif',
folder : '../img/folder.gif',
folderOpen : '../img/folderopen.gif',
@ -523,7 +523,7 @@ dTree.prototype.closeAllChildren = function(node) {
this.aNodes[n]._io = false;
this.closeAllChildren(this.aNodes[n]);
this.closeAllChildren(this.aNodes[n]);
}

@ -7,7 +7,7 @@
* @package scorm.js
*/
/**
* Initialisation of the SCORM API section.
* Initialisation of the SCORM API section.
* Find the SCO functions (startTimer, computeTime, etc in the second section)
* Find the Dokeos-proper functions (checkAnswers, etc in the third section)
*/
@ -215,7 +215,7 @@ function doLMSSetValue(name, value)
function doLMSCommit()
{
if(API == null)
{
{
alert(errMsgLocate +"\nLMSCommit was not successful.");
return "false";
}
@ -329,7 +329,7 @@ function convertTotalSeconds(ts)
var strSec = new String(sec);
var strWholeSec = strSec;
var strFractionSec = "";
if (strSec.indexOf(".") != -1)
{
strWholeSec = strSec.substring(0, strSec.indexOf("."));
@ -361,7 +361,7 @@ function convertTotalSeconds(ts)
* Handles the use of the back button (saves data and closes SCO)
*/
function doBack()
{
{
checkAnswers(true);
doLMSSetValue( "cmi.core.exit", "suspend" );
computeTime();
@ -451,7 +451,7 @@ function checkAnswers(interrupted)
{
interactionAnswers += idAnswer+'__|';// changed by isaac flores
myScore +=questions_answers_ponderation[idQuestion][idAnswer];
/*for(k=0;k<questions_answers_correct[idQuestion].length;k++)
{
if(questions_answers_correct[idQuestion][k] == idAnswer)
@ -641,8 +641,8 @@ function checkAnswers(interrupted)
doLMSSetValue('cmi.interactions.'+idQuestion+'.student_response',interactionAnswers);
doLMSSetValue('cmi.interactions.'+idQuestion+'.result',interactionScore);
//correct responses work by pattern, see SCORM Runtime Env Doc
//doLMSSetValue('cmi.interactions.'+idQuestion+'.correct_responses',questions_answers_correct[idQuestion]);
//doLMSSetValue('cmi.interactions.'+idQuestion+'.correct_responses',interactionCorrectResponses);
//doLMSSetValue('cmi.interactions.'+idQuestion+'.correct_responses',questions_answers_correct[idQuestion]);
//doLMSSetValue('cmi.interactions.'+idQuestion+'.correct_responses',interactionCorrectResponses);
}
}
doLMSSetValue('cmi.core.score.min',0);

@ -74,7 +74,7 @@ function Exception(name, message)
}
/**
* Set the name of the exception.
* Set the name of the exception.
*/
Exception.prototype.setName = function(name)
{
@ -82,7 +82,7 @@ Exception.prototype.setName = function(name)
}
/**
* Get the exception's name.
* Get the exception's name.
*/
Exception.prototype.getName = function()
{
@ -90,7 +90,7 @@ Exception.prototype.getName = function()
}
/**
* Set a message on the exception.
* Set a message on the exception.
*/
Exception.prototype.setMessage = function(msg)
{
@ -98,7 +98,7 @@ Exception.prototype.setMessage = function(msg)
}
/**
* Get the exception message.
* Get the exception message.
*/
Exception.prototype.getMessage = function()
{
@ -153,7 +153,7 @@ FlashTag.prototype.setBgcolor = function(bgc)
}
/**
* Sets any variables to be passed into the Flash content.
* Sets any variables to be passed into the Flash content.
*/
FlashTag.prototype.setFlashvars = function(fv)
{
@ -161,7 +161,7 @@ FlashTag.prototype.setFlashvars = function(fv)
}
/**
* Get the Flash tag as a string.
* Get the Flash tag as a string.
*/
FlashTag.prototype.toString = function()
{
@ -189,7 +189,7 @@ FlashTag.prototype.toString = function()
else
{
flashTag += '<embed src="'+this.src+'" ';
flashTag += 'quality="high" ';
flashTag += 'quality="high" ';
flashTag += 'bgcolor="#'+this.bgcolor+'" ';
flashTag += 'width="'+this.width+'" ';
flashTag += 'height="'+this.height+'" ';
@ -209,7 +209,7 @@ FlashTag.prototype.toString = function()
}
/**
* Write the Flash tag out. Pass in a reference to the document to write to.
* Write the Flash tag out. Pass in a reference to the document to write to.
*/
FlashTag.prototype.write = function(doc)
{
@ -218,7 +218,7 @@ FlashTag.prototype.write = function(doc)
/**
* The FlashSerializer serializes JavaScript variables of types object, array, string,
* number, date, boolean, null or undefined into XML.
* number, date, boolean, null or undefined into XML.
*/
/**
@ -296,9 +296,9 @@ FlashSerializer.prototype.serialize = function(args)
FlashSerializer.prototype._serializeXML = function(obj)
{
var doc = new Object();
doc.xml = '<fp>';
doc.xml = '<fp>';
this._serializeNode(obj, doc, null);
doc.xml += '</fp>';
doc.xml += '</fp>';
return doc.xml;
}
@ -401,7 +401,7 @@ function FlashProxy(uid, proxySwfName)
* Call a function in your Flash content. Arguments should be:
* 1. ActionScript function name to call,
* 2. any number of additional arguments of type object,
* array, string, number, boolean, date, null, or undefined.
* array, string, number, boolean, date, null, or undefined.
*/
FlashProxy.prototype.call = function()
{

@ -10,11 +10,11 @@ function validateFlashVar(counter, lang_1, lang_2)
return true;
//alert(counter);
//alert(flashVar);
if(counter != flashVar)
{
alert(lang_1 + counter + lang_2);
return false;
}
else
@ -36,20 +36,20 @@ function updateFlashVar()
* @param int ID of the area (square or ellipse)
* @param int Whether the answer is correct or not
* @param int X-coordinate (horizontal) of the answer point
* @param int Y-coordinate (vertical) of the answer point
* @param int Y-coordinate (vertical) of the answer point
*/
function saveHotspot(question_id, hotspot_id, answer, hotspot_x, hotspot_y)
{
newHotspot = document.createElement("input");
newHotspot.type = "hidden";
newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]";
newHotspot.value = hotspot_x + ";" + hotspot_y;
newHotspot.value = hotspot_x + ";" + hotspot_y;
document.frm_exercise.appendChild(newHotspot);
newHotspot = document.createElement("input");
newHotspot.type = "hidden";
newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]";
newHotspot.value = answer;
newHotspot.value = answer;
document.frm_exercise.appendChild(newHotspot);
}
/*
@ -67,11 +67,11 @@ function saveDelineationUserAnswer(question_id, hotspot_id, answer, coordinates)
newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]";
newHotspot.value = coordinates;
document.frm_exercise.appendChild(newHotspot);
newHotspot = document.createElement("input");
newHotspot.type = "hidden";
newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]";
newHotspot.value = answer;
newHotspot.value = answer;
document.frm_exercise.appendChild(newHotspot);
}

@ -7,7 +7,7 @@ var requiredMinorVersion = 0;
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
//
//
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;

Loading…
Cancel
Save