rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after", true);
var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after", false, true);
paste : function (obj, position) { if(this.locked) return this.error("LOCKED"); var root = false; if(obj == -1) { root = true; obj = this.container; } else obj = obj ? this.get_node(obj) : this.selected; if(!root && (!obj || !obj.size())) return this.error("PASTE: NO NODE SELECTED"); if(!tree_component.cut_copy.copy_nodes && !tree_component.cut_copy.cut_nodes) return this.error("PASTE: NOTHING TO DO"); var _this = this; var pos = position; if(position == "before") { position = obj.parent().children().index(obj); obj = obj.parents("li:eq(0)"); } else if(position == "after") { position = obj.parent().children().index(obj) + 1; obj = obj.parents("li:eq(0)"); } else if((typeof position).toLowerCase() == "undefined" || position == "inside") { position = (this.settings.rules.createat == "top") ? 0 : obj.children("ul:eq(0)").children("li").size(); } if(!root && obj.size() == 0) { root = true; obj = this.container; } if(tree_component.cut_copy.copy_nodes && tree_component.cut_copy.copy_nodes.size()) { var ok = true; if(!root && !this.check_move(tree_component.cut_copy.copy_nodes, obj.children("a:eq(0)"), "inside")) return false; if(obj.children("ul").size() == 0 || (root == true && obj.children("ul").children("li").size() == 0) ) { if(!root) var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("a:eq(0)"),"inside", true); else var a = this.moved(tree_component.cut_copy.copy_nodes,this.container.children("ul:eq(0)"),"inside", true); } else if(pos == "before" && obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before", true); else if(pos == "after" && obj.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").size()) var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").children("a:eq(0)"),"after", true); else if(obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before", true); else var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after", true); tree_component.cut_copy.copy_nodes = false; } if(tree_component.cut_copy.cut_nodes && tree_component.cut_copy.cut_nodes.size()) { var ok = true; obj.parents().andSelf().each(function () { if(tree_component.cut_copy.cut_nodes.index(this) != -1) { ok = false; return false; } }); if(!ok) return this.error("Invalid paste"); if(!root && !this.check_move(tree_component.cut_copy.cut_nodes, obj.children("a:eq(0)"), "inside")) return false; if(obj.children("ul").size() == 0 || (root == true && obj.children("ul").children("li").size() == 0) ) { if(!root) var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("a:eq(0)"),"inside"); else var a = this.moved(tree_component.cut_copy.cut_nodes,this.container.children("ul:eq(0)"),"inside"); } else if(pos == "before" && obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before"); else if(pos == "after" && obj.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").size()) var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").children("a:eq(0)"),"after"); else if(obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before"); else var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after"); tree_component.cut_copy.cut_nodes = false; } },
32&&a.keyCode<125:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};this.px=function(a,b){return G(w(a,b))};this.pxself=function(a,b){return G(a.style[b])};this.pctself=function(a,b){return U(a.style[b],0)};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.IEwidth=function(a,b,f){if(a.parentNode){var l=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-
if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||g.isIE?true:g.isOpera?a.keyCode==13||a.keyCode==27||a.keyCode>=32&&a.keyCode<125:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};this.px=function(a,b){return G(w(a,b))};this.pxself=function(a,b){return G(a.style[b])};this.pctself=function(a,b){return U(a.style[b],0)};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!=
32&&a.keyCode<125:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};this.px=function(a,b){return G(w(a,b))};this.pxself=function(a,b){return G(a.style[b])};this.pctself=function(a,b){return U(a.style[b],0)};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.IEwidth=function(a,b,f){if(a.parentNode){var l=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-
a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,e){if(a.parentNode){var k=a.parentNode.clientWidth-h.px(a,"marginLeft")-h.px(a,"marginRight")-h.px(a,"borderLeftWidth")-h.px(a,"borderRightWidth")-h.px(a.parentNode,"paddingLeft")-h.px(a.parentNode,"paddingRight"),i=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(b);b=(i=i&&i.length==
a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,e){if(a.parentNode){var j=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-g.px(a,"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,"paddingRight"),i=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(b);b=(i=i&&i.length==
a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,e){if(a.parentNode){var k=a.parentNode.clientWidth-h.px(a,"marginLeft")-h.px(a,"marginRight")-h.px(a,"borderLeftWidth")-h.px(a,"borderRightWidth")-h.px(a.parentNode,"paddingLeft")-h.px(a.parentNode,"paddingRight"),i=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(b);b=(i=i&&i.length==
this.px=function(a,b){a=w(a,b);if(a=="auto"||a==null)return 0;return X.test(a)?parseFloat(a):0};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&& a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,e){if(a.parentNode){var k=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-g.px(a,"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,"paddingRight"),i=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(b);b=(i=i&&i.length==2?i[1]:"0")?parseFloat(i):0;e=(i=(i=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(e))&&i.length==2?i[1]:"100000")?parseFloat(i):1E5;return k<b?b-1:k>e?e+1:a.style.styleFloat!=
this.px=function(a,b){a=w(a,b);if(a=="auto"||a==null)return 0;return X.test(a)?parseFloat(a):0};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?h.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&& a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,e){if(a.parentNode){var k=a.parentNode.clientWidth-h.px(a,"marginLeft")-h.px(a,"marginRight")-h.px(a,"borderLeftWidth")-h.px(a,"borderRightWidth")-h.px(a.parentNode,"paddingLeft")-h.px(a.parentNode,"paddingRight"),i=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(b);b=(i=i&&i.length==2?i[1]:"0")?parseFloat(i):0;e=(i=(i=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(e))&&i.length==2?i[1]:"100000")?parseFloat(i):1E5;return k<b?b-1:k>e?e+1:a.style.styleFloat!=
this.px=function(a,b){a=w(a,b);if(a=="auto"||a==null)return 0;return X.test(a)?parseFloat(a):0};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,e){if(a.parentNode){var k=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-g.px(a,"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,"paddingRight"),i=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(b);b=(i=i&&i.length==2?i[1]:"0")?parseFloat(i):0;e=(i=(i=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(e))&&i.length==2?i[1]:"100000")?parseFloat(i):1E5;return k<b?b-1:k>e?e+1:a.style.styleFloat!=
if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,f){if(a.parentNode){var h=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-g.px(a,"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,
function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,f){if(a.parentNode){var h=
if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,f){if(a.parentNode){var h=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-g.px(a,"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,
2?a[1]:"0")?parseFloat(f):0};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?k.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a): 0};this.IEwidth=function(a,b,f){if(a.parentNode){var m=a.parentNode.clientWidth-k.px(a,"marginLeft")-k.px(a,"marginRight")-k.px(a,"borderLeftWidth")-k.px(a,"borderRightWidth")-k.px(a.parentNode,"paddingLeft")-k.px(a.parentNode,"paddingRight"),l=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(b);b=(l=l&&l.length==2?l[1]:"0")?parseFloat(l):0;f=(l=(l=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(f))&&l.length==2?l[1]:"100000")?parseFloat(l):1E5;return m<b?b-1:m>f?f+1:a.style.styleFloat!=""?b-1:"auto"}else return"auto"};
"none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?k.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,f){if(a.parentNode){var m=a.parentNode.clientWidth-
2?a[1]:"0")?parseFloat(f):0};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?k.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.IEwidth=function(a,b,f){if(a.parentNode){var m=a.parentNode.clientWidth-k.px(a,"marginLeft")-k.px(a,"marginRight")-k.px(a,"borderLeftWidth")-k.px(a,"borderRightWidth")-k.px(a.parentNode,"paddingLeft")-k.px(a.parentNode,"paddingRight"),l=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(b);b=(l=l&&l.length==2?l[1]:"0")?parseFloat(l):0;f=(l=(l=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(f))&&l.length==2?l[1]:"100000")?parseFloat(l):1E5;return m<b?b-1:m>f?f+1:a.style.styleFloat!=""?b-1:"auto"}else return"auto"};
$("persistent_url").update("http:
$("persistent_url").innerHTML = "http:
function pickTuneAndPdf(pdf_id, folder, abc_file){ var sel = abc_contents_output[abc_file]; $("persistent_url").update("http://" + window.location.host + "/comparison?tune=" + abc_file); var filename = abc_file.substring(0, abc_file.lastIndexOf('.')); var pdf_file = "/testdata/" + folder + '/' + filename.gsub('\\+', '%2B') + '.ps'; $("abcm2ps_output").update(sel.out.gsub(' ', '&nbsp;').gsub('\n', '<br />')); editArea.set(sel.abc); abc_keystroke(); var pdf = $(pdf_id); pdf.innerHTML = "<embed src='" + pdf_file + "' height='100%' width='100%'>";}
$("abcm2ps_output").update(sel.out.gsub(' ', '&nbsp;').gsub('\n', '<br />'));
$("abcm2ps_output").innerHTML = sel.out.gsub(' ', '&nbsp;').gsub('\n', '<br />');
function pickTuneAndPdf(pdf_id, folder, abc_file){ var sel = abc_contents_output[abc_file]; $("persistent_url").update("http://" + window.location.host + "/comparison?tune=" + abc_file); var filename = abc_file.substring(0, abc_file.lastIndexOf('.')); var pdf_file = "/testdata/" + folder + '/' + filename.gsub('\\+', '%2B') + '.ps'; $("abcm2ps_output").update(sel.out.gsub(' ', '&nbsp;').gsub('\n', '<br />')); editArea.set(sel.abc); abc_keystroke(); var pdf = $(pdf_id); pdf.innerHTML = "<embed src='" + pdf_file + "' height='100%' width='100%'>";}
play: function() {
play: function() {http:
play: function() { // do not start additional timer if already exists if (timer) { return; } // onBeforePlay var e = $.Event("onBeforePlay"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } stopped = false; // construct new timer timer = setInterval(tabs.next, conf.interval); // onPlay fire.trigger("onPlay"); tabs.next(); },
api.next();
api.play = function() { // do not start additional timer if already exists if (timer) { return; } stopped = false; // construct new timer timer = setInterval(function() { api.next(); }, opts.interval); api.next(); };
var t = editArea.get(); if (abcParser === null) abcParser = new AbcParse(); abcParser.parse(t); playEmbedded.play(abcParser.getTune());
function play(){ var t = editArea.get(); if (abcParser === null) abcParser = new AbcParse(); abcParser.parse(t); //selection = editArea.getSelection(); playEmbedded.play(abcParser.getTune());}
var translation = this.lookup(scope, options);
var translation; try { translation = this.lookup(scope, options); } catch (error) {} if (!translation) { return this.missingTranslation(scope); }
I18n.pluralize = function(count, scope, options) { var translation = this.lookup(scope, options); var message; options = this.prepareOptions(options); options["count"] = count.toString(); switch(Math.abs(count)) { case 0: message = translation["zero"] || translation["none"] || translation["other"] || this.missingTranslation(scope, "zero"); break; case 1: message = translation["one"] || this.missingTranslation(scope, "one");; break; default: message = translation["other"] || this.missingTranslation(scope, "other");; } return this.interpolate(message, options);};
message = translation["one"] || this.missingTranslation(scope, "one");;
message = translation["one"] || this.missingTranslation(scope, "one");
I18n.pluralize = function(count, scope, options) { var translation = this.lookup(scope, options); var message; options = this.prepareOptions(options); options["count"] = count.toString(); switch(Math.abs(count)) { case 0: message = translation["zero"] || translation["none"] || translation["other"] || this.missingTranslation(scope, "zero"); break; case 1: message = translation["one"] || this.missingTranslation(scope, "one");; break; default: message = translation["other"] || this.missingTranslation(scope, "other");; } return this.interpolate(message, options);};
message = translation["other"] || this.missingTranslation(scope, "other");;
message = translation["other"] || this.missingTranslation(scope, "other");
I18n.pluralize = function(count, scope, options) { var translation = this.lookup(scope, options); var message; options = this.prepareOptions(options); options["count"] = count.toString(); switch(Math.abs(count)) { case 0: message = translation["zero"] || translation["none"] || translation["other"] || this.missingTranslation(scope, "zero"); break; case 1: message = translation["one"] || this.missingTranslation(scope, "one");; break; default: message = translation["other"] || this.missingTranslation(scope, "other");; } return this.interpolate(message, options);};
timer = pollDoScroll.defer();
timer = setTimeout(pollDoScroll, 10);
function pollDoScroll() { try { document.documentElement.doScroll('left'); } catch(e) { timer = pollDoScroll.defer(); return; } fireContentLoadedEvent(); }
var fullPoll=false;
var fullPoll=0;
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) {
var pollRequest; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest = new ServerReq('poll.php', function(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); } if (fullPoll == 2) { pollRequest.transmit.delay(2000,pollRequest,{'lid':nextLid}); } else { fullPoll = 0; } }); } else { pollRequest = new Request.JSON({url:'read.php',link:'ignore',onComplete:function (r,t) { readComplete.delay(10,this,[r,t]); }}); } var readComplete = function(response,errorMessage) {
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
nextLid = response.lastlid + 1;
if(response.lastlid) nextLid = response.lastlid + 1;
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
displayErrorMessage("read.php failure:"+errorMessage);
if(errorMessage != '') displayErrorMessage("read.php failure:"+errorMessage);
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); }});
if (fullPoll == 2) { pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); } else { fullPoll = 0; } }
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true;
init : function (lid,presenceInterval) { lastId = lid; pollInterval = presenceInterval; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); MBchat.updateables.poller.start();
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; }
lastId = (lastId > lid)? lid : lastId;
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); }
if (fullPoll < 2) { fullPoll= 2; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest.transmit({'lid':lastId+1}); } else { pollRequest.post($merge(myRequestOptions,{'lid':lastId+1})); } }
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
lastId = (lastId < lid)? lid : lastId; if ( fullPoll) MBchat.updateables.processMessage(item);
if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1)); } lastId = lid; } } else { lastId = lid; } if ( fullPoll == 2) MBchat.updateables.processMessage(item);
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
fullPoll=false;
fullPoll=1;
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=false; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if (fullPoll < 2) { fullPoll= 2;
if (fullPoll == 0) {
poller : function() { var pollerId; var lastId = null; var fullPoll=0; //0 = polling stopped, 1=polling requested to stop, but not yet done so, 2= polling running var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'ignore',onComplete:function (r,t) { readComplete.delay(10,this,[r,t]); }}); var readComplete = function(response,errorMessage) { if(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; // MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { if(errorMessage) displayErrorMessage("read.php failure:"+errorMessage); //Final Logout is a null message } if (fullPoll == 2) { pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) } else { fullPoll = 0; //If stop was pending, it has now finished } } var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (lid,presenceInterval) { lastId = lid; pollInterval = presenceInterval; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); MBchat.updateables.poller.start(); }, setLastId : function(lid) { lastId = (lastId > lid)? lid : lastId; //set to earliest value }, getLastId: function() { return lastId; }, start : function () { if (fullPoll < 2) { fullPoll= 2; pollRequest.post($merge(myRequestOptions,{'lid':lastId+1})); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll == 2) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=1; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
fullPoll= 2;
poller : function() { var pollerId; var lastId = null; var fullPoll=0; //0 = polling stopped, 1=polling requested to stop, but not yet done so, 2= polling running var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'ignore',onComplete:function (r,t) { readComplete.delay(10,this,[r,t]); }}); var readComplete = function(response,errorMessage) { if(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; // MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { if(errorMessage) displayErrorMessage("read.php failure:"+errorMessage); //Final Logout is a null message } if (fullPoll == 2) { pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) } else { fullPoll = 0; //If stop was pending, it has now finished } } var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (lid,presenceInterval) { lastId = lid; pollInterval = presenceInterval; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); MBchat.updateables.poller.start(); }, setLastId : function(lid) { lastId = (lastId > lid)? lid : lastId; //set to earliest value }, getLastId: function() { return lastId; }, start : function () { if (fullPoll < 2) { fullPoll= 2; pollRequest.post($merge(myRequestOptions,{'lid':lastId+1})); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll == 2) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=1; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest = new ServerReq('poll.php', function(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); } if (fullPoll == 2) { pollRequest.transmit.delay(2000,pollRequest,{'lid':nextLid}); } else { fullPoll = 0; } }); } else { pollRequest = new Request.JSON({url:'read.php',link:'ignore',onComplete:function (r,t) { readComplete.delay(10,this,[r,t]); }}); }
var pollRequest = new Request.JSON({url:'read.php',link:'ignore',onComplete:function (r,t) { readComplete.delay(10,this,[r,t]); }});
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=0; //0 = polling stopped, 1=polling requested to stop, but not yet done so, 2= polling running var wid; var nextLid; var pollRequest; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest = new ServerReq('poll.php', function(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; // MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } if (fullPoll == 2) { pollRequest.transmit.delay(2000,pollRequest,{'lid':nextLid}); } else { fullPoll = 0; //If stop was pending, it has now finished } }); } else { pollRequest = new Request.JSON({url:'read.php',link:'ignore',onComplete:function (r,t) { readComplete.delay(10,this,[r,t]); }}); } var readComplete = function(response,errorMessage) { if(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; // MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { if(errorMessage) displayErrorMessage("read.php failure:"+errorMessage); //Final Logout is a null message } if (fullPoll == 2) { pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) } else { fullPoll = 0; //If stop was pending, it has now finished } } var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (lid,presenceInterval) { lastId = lid; pollInterval = presenceInterval; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); MBchat.updateables.poller.start(); }, setLastId : function(lid) { lastId = (lastId > lid)? lid : lastId; //set to earliest value }, getLastId: function() { return lastId; }, start : function () { if (fullPoll < 2) { fullPoll= 2; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest.transmit({'lid':lastId+1}); } else { pollRequest.post($merge(myRequestOptions,{'lid':lastId+1})); } } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll == 2) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=1; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if (fullPoll < 2) { fullPoll= 2; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest.transmit({'lid':lastId+1}); } else { pollRequest.post($merge(myRequestOptions,{'lid':lastId+1})); }
if (fullPoll == 0) { pollRequest.post($merge(myRequestOptions,{'lid':lastId+1}));
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=0; //0 = polling stopped, 1=polling requested to stop, but not yet done so, 2= polling running var wid; var nextLid; var pollRequest; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest = new ServerReq('poll.php', function(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; // MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } if (fullPoll == 2) { pollRequest.transmit.delay(2000,pollRequest,{'lid':nextLid}); } else { fullPoll = 0; //If stop was pending, it has now finished } }); } else { pollRequest = new Request.JSON({url:'read.php',link:'ignore',onComplete:function (r,t) { readComplete.delay(10,this,[r,t]); }}); } var readComplete = function(response,errorMessage) { if(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; // MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { if(errorMessage) displayErrorMessage("read.php failure:"+errorMessage); //Final Logout is a null message } if (fullPoll == 2) { pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) } else { fullPoll = 0; //If stop was pending, it has now finished } } var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (lid,presenceInterval) { lastId = lid; pollInterval = presenceInterval; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); MBchat.updateables.poller.start(); }, setLastId : function(lid) { lastId = (lastId > lid)? lid : lastId; //set to earliest value }, getLastId: function() { return lastId; }, start : function () { if (fullPoll < 2) { fullPoll= 2; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest.transmit({'lid':lastId+1}); } else { pollRequest.post($merge(myRequestOptions,{'lid':lastId+1})); } } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll == 2) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=1; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
fullPoll= 2;
poller : function() { var pollInterval; var pollerId; var lastId = null; var fullPoll=0; //0 = polling stopped, 1=polling requested to stop, but not yet done so, 2= polling running var wid; var nextLid; var pollRequest; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest = new ServerReq('poll.php', function(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; // MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } if (fullPoll == 2) { pollRequest.transmit.delay(2000,pollRequest,{'lid':nextLid}); } else { fullPoll = 0; //If stop was pending, it has now finished } }); } else { pollRequest = new Request.JSON({url:'read.php',link:'ignore',onComplete:function (r,t) { readComplete.delay(10,this,[r,t]); }}); } var readComplete = function(response,errorMessage) { if(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; // MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { if(errorMessage) displayErrorMessage("read.php failure:"+errorMessage); //Final Logout is a null message } if (fullPoll == 2) { pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); //Should chain (we are in previous still) } else { fullPoll = 0; //If stop was pending, it has now finished } } var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (lid,presenceInterval) { lastId = lid; pollInterval = presenceInterval; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); MBchat.updateables.poller.start(); }, setLastId : function(lid) { lastId = (lastId > lid)? lid : lastId; //set to earliest value }, getLastId: function() { return lastId; }, start : function () { if (fullPoll < 2) { fullPoll= 2; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest.transmit({'lid':lastId+1}); } else { pollRequest.post($merge(myRequestOptions,{'lid':lastId+1})); } } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll == 2) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=1; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
var fullPoll=false;
var fullPoll=0;
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) {
var nextLid; var pollRequest; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest = new ServerReq('poll.php', function(response) { if(response.messages) { if(response.lastlid) nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); } if (fullPoll == 2) { pollRequest.transmit.delay(2000,pollRequest,{'lid':nextLid}); } else { fullPoll = 0; } }); } else { pollRequest = new Request.JSON({url:'read.php',link:'ignore',onComplete:function (r,t) { readComplete.delay(10,this,[r,t]); }}); } var readComplete = function(response,errorMessage) {
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
nextLid = response.lastlid + 1;
if(response.lastlid) nextLid = response.lastlid + 1;
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
displayErrorMessage("read.php failure:"+errorMessage);
if(errorMessage != '') displayErrorMessage("read.php failure:"+errorMessage);
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); }});
if (fullPoll == 2) { pollRequest.post($merge(myRequestOptions,{'lid':nextLid})); } else { fullPoll = 0; } }
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true;
init : function (lid,presenceInterval) { lastId = lid; pollInterval = presenceInterval; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); MBchat.updateables.poller.start();
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; }
lastId = (lastId > lid)? lid : lastId;
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); }
if (fullPoll < 2) { fullPoll= 2; if(Browser.Engine.trident && Browser.Engine.version == 5) { pollRequest.transmit({'lid':lastId+1}); } else { pollRequest.post($merge(myRequestOptions,{'lid':lastId+1})); } }
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
if ( fullPoll) MBchat.updateables.processMessage(item);
if ( fullPoll == 2) MBchat.updateables.processMessage(item);
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
fullPoll=false;
fullPoll=1;
poller : function() { var pollerId; var lastId = null; var fullPoll=false; var pollInterval; var wid; var nextLid; var pollRequest = new Request.JSON({url:'read.php',link:'chain',onComplete: function(response,errorMessage) { if(response) { if(response.messages) { nextLid = response.lastlid + 1; MBchat.updateables.poller.pollResponse(response.messages); //only process valid messages } } else { displayErrorMessage("read.php failure:"+errorMessage); } if (fullPoll) pollRequest.post.delay(1,this,($merge(myRequestOptions,{'lid':nextLid}))); //Should chain (we are in previous still) }}); var presenceReq = new ServerReq('presence.php', function(r) {}); var pollPresence = function () { presenceReq.transmit({}); //say here (also timeout others) }; return { init : function (presenceInterval) { pollInterval = presenceInterval; fullPoll=true; }, setLastId : function(lid) { if (!lastId) { lastId = lid; pollerId = pollPresence.periodical(pollInterval,MBchat.updateables); if (fullPoll) pollRequest.post(myRequestOptions); } else { lastId = (lastId > lid)? lid : lastId; //set to earliest value } }, getLastId: function() { return lastId; }, start : function () { if (!fullPoll) { fullPoll=true; pollRequest.post(myRequestOptions); } }, pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); }, stop : function() { fullPoll=false; }, logout: function() { MBchat.updateables.poller.stop(); $clear(pollerId); } }; }(),
lastId = (lastId < lid)? lid : lastId; if ( fullPoll) MBchat.updateables.processMessage(item);
if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1)); } lastId = lid; } } else { lastId = lid; } if ( fullPoll == 2) MBchat.updateables.processMessage(item);
pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; lastId = (lastId < lid)? lid : lastId; //This should throw away messages if lastId is null if ( fullPoll) MBchat.updateables.processMessage(item); }); },
if ( fullPoll) MBchat.updateables.processMessage(item);
if ( fullPoll == 2) MBchat.updateables.processMessage(item);
pollResponse : function(messages) { messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); var lid = item.lid; if(lastId) { if (lid >= lastId) { if(lid > lastId+1) { displayErrorMessage("missed a log id, was "+lid+" expecting "+(lastId+1));//we've missed one? } lastId = lid; } } else { lastId = lid; //wasn't there before, so now this message is the first one to set lastId } if ( fullPoll) MBchat.updateables.processMessage(item); }); },
this.whendone(true);
this.whendone(true,this.result);
poplevel: function() { if(this.stack.length > 0) { this.currentContext = this.stack.pop(); return true; } else { $clear(this.timerid); this.whendone(true); //signal done return false; } }.protect(),
return q;},function(){window.netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');var q=window.Components.classes['@mozilla.org/widget/clipboard;1'].getService(window.Components.interfaces.nsIClipboard),r=window.Components.classes['@mozilla.org/widget/transferable;1'].createInstance(window.Components.interfaces.nsITransferable);r.addDataFlavor('text/unicode');q.getData(r,q.kGlobalClipboard);var s={},t={},u;r.getTransferData('text/unicode',s,t);s=s.value.QueryInterface(window.Components.interfaces.nsISupportsString);u=s.data.substring(0,t.value/2);return u;});if(!p){o.openDialog('pastetext');return false;}else o.fire('paste',{text:p});return true;}};function m(o,p){if(c){var q=o.selection;if(q.type=='Control')q.clear();q.createRange().pasteHTML(p);}else o.execCommand('inserthtml',false,p);};j.add('pastetext',{init:function(o){var p='pastetext',q=o.addCommand(p,l);o.ui.addButton('PasteText',{label:o.lang.pasteText.button,command:p});a.dialog.add(p,a.getUrl(this.path+'dialogs/pastetext.js'));if(o.config.forcePasteAsPlainText)o.on('beforeCommandExec',function(r){if(r.data.name=='paste'){o.execCommand('pastetext');r.cancel();}},null,null,0);},requires:['clipboard']});function n(o,p,q,r){while(q--)j.enterkey[p==2?'enterBr':'enterBlock'](o,p,null,r);};a.editor.prototype.insertText=function(o){this.focus();this.fire('saveSnapshot');var p=this.getSelection().getStartElement().hasAscendant('pre',true)?2:this.config.enterMode,q=p==2,r=this.document.$,s=this,t;o=e.htmlEncode(o.replace(/\r\n|\r/g,'\n'));var u=0;o.replace(/\n+/g,function(v,w){t=o.substring(u,w);u=w+v.length;t.length&&m(r,t);var x=v.length,y=q?0:Math.floor(x/2),z=q?x:x%2;n(s,p,y);n(s,2,z,q?false:true);});t=o.substring(u,o.length);t.length&&m(r,t);this.fire('saveSnapshot');};})();j.add('popup');e.extend(a.editor.prototype,{popup:function(l,m,n){m=m||'80%';n=n||'70%';if(typeof m=='string'&&m.length>1&&m.substr(m.length-1,1)=='%')m=parseInt(window.screen.width*parseInt(m,10)/100,10);if(typeof n=='string'&&n.length>1&&n.substr(n.length-1,1)=='%')n=parseInt(window.screen.height*parseInt(n,10)/100,10);if(m<640)m=640;if(n<420)n=420;var o=parseInt((window.screen.height-n)/2,10),p=parseInt((window.screen.width-m)/2,10),q='location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,width='+m+',height='+n+',top='+o+',left='+p,r=window.open('',null,q,true);if(!r)return false;try{r.moveTo(p,o);r.resizeTo(m,n);r.focus();r.location.href=l;}catch(s){r=window.open(l,null,q,true); }return true;}});(function(){var l={modes:{wysiwyg:1,source:1},canUndo:false,exec:function(n){var o,p=n.config,q=p.baseHref?'<base href="'+p.baseHref+'"/>':'',r=b.isCustomDomain();if(p.fullPage)o=n.getData().replace(/<head>/,'$&'+q).replace(/[^>]*(?=<\/title>)/,n.lang.preview);else{var s='<body ',t=n.document&&n.document.getBody();if(t){if(t.getAttribute('id'))s+='id="'+t.getAttribute('id')+'" ';if(t.getAttribute('class'))s+='class="'+t.getAttribute('class')+'" ';}s+='>';o=n.config.docType+'<html dir="'+n.config.contentsLangDirection+'">'+'<head>'+q+'<title>'+n.lang.preview+'</title>'+e.buildStyleHtml(n.config.contentsCss)+'</head>'+s+n.getData()+'</body></html>';}var u=640,v=420,w=80;try{var x=window.screen;u=Math.round(x.width*0.8);v=Math.round(x.height*0.7);w=Math.round(x.width*0.1);}catch(A){}var y='';if(r){window._cke_htmlToLoad=o;y='javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.opener._cke_htmlToLoad );'+'document.close();'+'window.opener._cke_htmlToLoad = null;'+'})() )';}var z=window.open(y,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+u+',height='+v+',left='+w);if(!r){z.document.open();z.document.write(o);z.document.close();}}},m='preview';j.add(m,{init:function(n){n.addCommand(m,l);n.ui.addButton('Preview',{label:n.lang.preview,command:m});}});})();j.add('print',{init:function(l){var m='print',n=l.addCommand(m,j.print);l.ui.addButton('Print',{label:l.lang.print,command:m});}});j.print={exec:function(l){if(b.opera)return;else if(b.gecko)l.window.$.print();else l.document.$.execCommand('Print');},canUndo:false,modes:{wysiwyg:!b.opera}};j.add('removeformat',{requires:['selection'],init:function(l){l.addCommand('removeFormat',j.removeformat.commands.removeformat);l.ui.addButton('RemoveFormat',{label:l.lang.removeFormat,command:'removeFormat'});}});j.removeformat={commands:{removeformat:{exec:function(l){var m=l._.removeFormatRegex||(l._.removeFormatRegex=new RegExp('^(?:'+l.config.removeFormatTags.replace(/,/g,'|')+')$','i')),n=l._.removeAttributes||(l._.removeAttributes=l.config.removeFormatAttributes.split(',')),o=l.getSelection().getRanges();for(var p=0,q;q=o[p];p++){if(q.collapsed)continue;q.enlarge(1);var r=q.createBookmark(),s=r.startNode,t=r.endNode,u=function(x){var y=new d.elementPath(x),z=y.elements;for(var A=1,B;B=z[A];A++){if(B.equals(y.block)||B.equals(y.blockLimit))break;if(m.test(B.getName()))x.breakParent(B);}};u(s);u(t);var v=s.getNextSourceNode(true,1);
if(l.execCommand('paste')===false)l.on('dialogHide',function(o){o.removeListener();n();});else n();}});l.ui.addButton('PasteFromWord',{label:l.lang.pastefromword.toolbar,command:'pastefromword'});l.on('paste',function(o){var p=o.data,q;if((q=p.html)&&(m||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(q))){var r=this.loadFilterRules(function(){if(r)l.fire('paste',p);else if(!l.config.pasteFromWordPromptCleanup||m||confirm(l.lang.pastefromword.confirmCleanup))p.html=a.cleanWord(q,l);});r&&o.cancel();}},this);},loadFilterRules:function(l){var m=a.cleanWord;if(m)l();else{var n=a.getUrl(i.pasteFromWordCleanupFile||this.path+'filter/default.js');a.scriptLoader.load(n,l,null,false,true);}return!m;}});})();(function(){var l={exec:function(o){var p=e.tryThese(function(){var q=window.clipboardData.getData('Text');if(!q)throw 0;return q;});if(!p){o.openDialog('pastetext');return false;}else o.fire('paste',{text:p});return true;}};function m(o,p){if(c){var q=o.selection;if(q.type=='Control')q.clear();q.createRange().pasteHTML(p);}else o.execCommand('inserthtml',false,p);};j.add('pastetext',{init:function(o){var p='pastetext',q=o.addCommand(p,l);o.ui.addButton('PasteText',{label:o.lang.pasteText.button,command:p});a.dialog.add(p,a.getUrl(this.path+'dialogs/pastetext.js'));if(o.config.forcePasteAsPlainText)o.on('beforeCommandExec',function(r){if(r.data.name=='paste'){o.execCommand('pastetext');r.cancel();}},null,null,0);},requires:['clipboard']});function n(o,p,q,r){while(q--)j.enterkey[p==2?'enterBr':'enterBlock'](o,p,null,r);};a.editor.prototype.insertText=function(o){this.focus();this.fire('saveSnapshot');var p=this.getSelection().getStartElement().hasAscendant('pre',true)?2:this.config.enterMode,q=p==2,r=this.document.$,s=this,t;o=e.htmlEncode(o.replace(/\r\n|\r/g,'\n'));var u=0;o.replace(/\n+/g,function(v,w){t=o.substring(u,w);u=w+v.length;t.length&&m(r,t);var x=v.length,y=q?0:Math.floor(x/2),z=q?x:x%2;n(s,p,y);n(s,2,z,q?false:true);});t=o.substring(u,o.length);t.length&&m(r,t);this.fire('saveSnapshot');};})();j.add('popup');e.extend(a.editor.prototype,{popup:function(l,m,n,o){m=m||'80%';n=n||'70%';if(typeof m=='string'&&m.length>1&&m.substr(m.length-1,1)=='%')m=parseInt(window.screen.width*parseInt(m,10)/100,10);if(typeof n=='string'&&n.length>1&&n.substr(n.length-1,1)=='%')n=parseInt(window.screen.height*parseInt(n,10)/100,10);if(m<640)m=640;if(n<420)n=420;var p=parseInt((window.screen.height-n)/2,10),q=parseInt((window.screen.width-m)/2,10);o=(o||'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes')+',width='+m+',height='+n+',top='+p+',left='+q; var r=window.open('',null,o,true);if(!r)return false;try{r.moveTo(q,p);r.resizeTo(m,n);r.focus();r.location.href=l;}catch(s){r=window.open(l,null,o,true);}return true;}});(function(){var l={modes:{wysiwyg:1,source:1},canUndo:false,exec:function(n){var o,p=n.config,q=p.baseHref?'<base href="'+p.baseHref+'"/>':'',r=b.isCustomDomain();if(p.fullPage)o=n.getData().replace(/<head>/,'$&'+q).replace(/[^>]*(?=<\/title>)/,n.lang.preview);else{var s='<body ',t=n.document&&n.document.getBody();if(t){if(t.getAttribute('id'))s+='id="'+t.getAttribute('id')+'" ';if(t.getAttribute('class'))s+='class="'+t.getAttribute('class')+'" ';}s+='>';o=n.config.docType+'<html dir="'+n.config.contentsLangDirection+'">'+'<head>'+q+'<title>'+n.lang.preview+'</title>'+e.buildStyleHtml(n.config.contentsCss)+'</head>'+s+n.getData()+'</body></html>';}var u=640,v=420,w=80;try{var x=window.screen;u=Math.round(x.width*0.8);v=Math.round(x.height*0.7);w=Math.round(x.width*0.1);}catch(A){}var y='';if(r){window._cke_htmlToLoad=o;y='javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.opener._cke_htmlToLoad );'+'document.close();'+'window.opener._cke_htmlToLoad = null;'+'})() )';}var z=window.open(y,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+u+',height='+v+',left='+w);if(!r){z.document.open();z.document.write(o);z.document.close();}}},m='preview';j.add(m,{init:function(n){n.addCommand(m,l);n.ui.addButton('Preview',{label:n.lang.preview,command:m});}});})();j.add('print',{init:function(l){var m='print',n=l.addCommand(m,j.print);l.ui.addButton('Print',{label:l.lang.print,command:m});}});j.print={exec:function(l){if(b.opera)return;else if(b.gecko)l.window.$.print();else l.document.$.execCommand('Print');},canUndo:false,modes:{wysiwyg:!b.opera}};j.add('removeformat',{requires:['selection'],init:function(l){l.addCommand('removeFormat',j.removeformat.commands.removeformat);l.ui.addButton('RemoveFormat',{label:l.lang.removeFormat,command:'removeFormat'});l._.removeFormat={filters:[]};}});j.removeformat={commands:{removeformat:{exec:function(l){var m=l._.removeFormatRegex||(l._.removeFormatRegex=new RegExp('^(?:'+l.config.removeFormatTags.replace(/,/g,'|')+')$','i')),n=l._.removeAttributes||(l._.removeAttributes=l.config.removeFormatAttributes.split(',')),o=j.removeformat.filter,p=l.getSelection().getRanges(true),q=p.createIterator(),r;while(r=q.getNextRange()){if(r.collapsed)continue;r.enlarge(1);var s=r.createBookmark(),t=s.startNode,u=s.endNode,v=function(y){var z=new d.elementPath(y),A=z.elements;
return q;},function(){window.netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');var q=window.Components.classes['@mozilla.org/widget/clipboard;1'].getService(window.Components.interfaces.nsIClipboard),r=window.Components.classes['@mozilla.org/widget/transferable;1'].createInstance(window.Components.interfaces.nsITransferable);r.addDataFlavor('text/unicode');q.getData(r,q.kGlobalClipboard);var s={},t={},u;r.getTransferData('text/unicode',s,t);s=s.value.QueryInterface(window.Components.interfaces.nsISupportsString);u=s.data.substring(0,t.value/2);return u;});if(!p){o.openDialog('pastetext');return false;}else o.fire('paste',{text:p});return true;}};function m(o,p){if(c){var q=o.selection;if(q.type=='Control')q.clear();q.createRange().pasteHTML(p);}else o.execCommand('inserthtml',false,p);};j.add('pastetext',{init:function(o){var p='pastetext',q=o.addCommand(p,l);o.ui.addButton('PasteText',{label:o.lang.pasteText.button,command:p});a.dialog.add(p,a.getUrl(this.path+'dialogs/pastetext.js'));if(o.config.forcePasteAsPlainText)o.on('beforeCommandExec',function(r){if(r.data.name=='paste'){o.execCommand('pastetext');r.cancel();}},null,null,0);},requires:['clipboard']});function n(o,p,q,r){while(q--)j.enterkey[p==2?'enterBr':'enterBlock'](o,p,null,r);};a.editor.prototype.insertText=function(o){this.focus();this.fire('saveSnapshot');var p=this.getSelection().getStartElement().hasAscendant('pre',true)?2:this.config.enterMode,q=p==2,r=this.document.$,s=this,t;o=e.htmlEncode(o.replace(/\r\n|\r/g,'\n'));var u=0;o.replace(/\n+/g,function(v,w){t=o.substring(u,w);u=w+v.length;t.length&&m(r,t);var x=v.length,y=q?0:Math.floor(x/2),z=q?x:x%2;n(s,p,y);n(s,2,z,q?false:true);});t=o.substring(u,o.length);t.length&&m(r,t);this.fire('saveSnapshot');};})();j.add('popup');e.extend(a.editor.prototype,{popup:function(l,m,n){m=m||'80%';n=n||'70%';if(typeof m=='string'&&m.length>1&&m.substr(m.length-1,1)=='%')m=parseInt(window.screen.width*parseInt(m,10)/100,10);if(typeof n=='string'&&n.length>1&&n.substr(n.length-1,1)=='%')n=parseInt(window.screen.height*parseInt(n,10)/100,10);if(m<640)m=640;if(n<420)n=420;var o=parseInt((window.screen.height-n)/2,10),p=parseInt((window.screen.width-m)/2,10),q='location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,width='+m+',height='+n+',top='+o+',left='+p,r=window.open('',null,q,true);if(!r)return false;try{r.moveTo(p,o);r.resizeTo(m,n);r.focus();r.location.href=l;}catch(s){r=window.open(l,null,q,true);}return true;}});(function(){var l={modes:{wysiwyg:1,source:1},canUndo:false,exec:function(n){var o,p=n.config,q=p.baseHref?'<base href="'+p.baseHref+'"/>':'',r=b.isCustomDomain();if(p.fullPage)o=n.getData().replace(/<head>/,'$&'+q).replace(/[^>]*(?=<\/title>)/,n.lang.preview);else{var s='<body ',t=n.document&&n.document.getBody();if(t){if(t.getAttribute('id'))s+='id="'+t.getAttribute('id')+'" ';if(t.getAttribute('class'))s+='class="'+t.getAttribute('class')+'" ';}s+='>';o=n.config.docType+'<html dir="'+n.config.contentsLangDirection+'">'+'<head>'+q+'<title>'+n.lang.preview+'</title>'+e.buildStyleHtml(n.config.contentsCss)+'</head>'+s+n.getData()+'</body></html>';}var u=640,v=420,w=80;try{var x=window.screen;u=Math.round(x.width*0.8);v=Math.round(x.height*0.7);w=Math.round(x.width*0.1);}catch(A){}var y='';if(r){window._cke_htmlToLoad=o;y='javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.opener._cke_htmlToLoad );'+'document.close();'+'window.opener._cke_htmlToLoad = null;'+'})() )';}var z=window.open(y,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+u+',height='+v+',left='+w);if(!r){z.document.open();z.document.write(o);z.document.close();}}},m='preview';j.add(m,{init:function(n){n.addCommand(m,l);n.ui.addButton('Preview',{label:n.lang.preview,command:m});}});})();j.add('print',{init:function(l){var m='print',n=l.addCommand(m,j.print);l.ui.addButton('Print',{label:l.lang.print,command:m});}});j.print={exec:function(l){if(b.opera)return;else if(b.gecko)l.window.$.print();else l.document.$.execCommand('Print');},canUndo:false,modes:{wysiwyg:!b.opera}};j.add('removeformat',{requires:['selection'],init:function(l){l.addCommand('removeFormat',j.removeformat.commands.removeformat);l.ui.addButton('RemoveFormat',{label:l.lang.removeFormat,command:'removeFormat'});}});j.removeformat={commands:{removeformat:{exec:function(l){var m=l._.removeFormatRegex||(l._.removeFormatRegex=new RegExp('^(?:'+l.config.removeFormatTags.replace(/,/g,'|')+')$','i')),n=l._.removeAttributes||(l._.removeAttributes=l.config.removeFormatAttributes.split(',')),o=l.getSelection().getRanges();for(var p=0,q;q=o[p];p++){if(q.collapsed)continue;q.enlarge(1);var r=q.createBookmark(),s=r.startNode,t=r.endNode,u=function(x){var y=new d.elementPath(x),z=y.elements;for(var A=1,B;B=z[A];A++){if(B.equals(y.block)||B.equals(y.blockLimit))break;if(m.test(B.getName()))x.breakParent(B);}};u(s);u(t);var v=s.getNextSourceNode(true,1);
e,h);e={top:b.top-h.top+k,left:b.left-h.left+l};"using"in b?b.using.call(a,e):g.css(e)}};d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),e=this.offset(),g=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();e.top-=parseFloat(d.curCSS(a,"marginTop",true))||0;e.left-=parseFloat(d.curCSS(a,"marginLeft",true))||0;g.top+=parseFloat(d.curCSS(b[0],"borderTopWidth",true))||0;g.left+=parseFloat(d.curCSS(b[0],"borderLeftWidth",true))||0;return{top:e.top- g.top,left:e.left-g.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||r.body;a&&!/^body|html$/i.test(a.nodeName)&&d.css(a,"position")==="static";)a=a.offsetParent;return a})}});d.each(["Left","Top"],function(a,b){var e="scroll"+b;d.fn[e]=function(g){var h=this[0],k;if(!h)return null;if(g!==v)return this.each(function(){if(k=ba(this))k.scrollTo(!a?g:d(k).scrollLeft(),a?g:d(k).scrollTop());else this[e]=g});else return(k=ba(h))?"pageXOffset"in k?k[a?"pageYOffset":
e,h);e={top:b.top-h.top+k,left:b.left-h.left+l};"using"in b?b.using.call(a,e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),e=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();e.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;e.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:e.top- f.top,left:e.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||r.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var e="scroll"+b;c.fn[e]=function(f){var h=this[0],k;if(!h)return null;if(f!==v)return this.each(function(){if(k=ba(this))k.scrollTo(!a?f:c(k).scrollLeft(),a?f:c(k).scrollTop());else this[e]=f});else return(k=ba(h))?"pageXOffset"in k?k[a?"pageYOffset":
e,h);e={top:b.top-h.top+k,left:b.left-h.left+l};"using"in b?b.using.call(a,e):g.css(e)}};d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),e=this.offset(),g=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();e.top-=parseFloat(d.curCSS(a,"marginTop",true))||0;e.left-=parseFloat(d.curCSS(a,"marginLeft",true))||0;g.top+=parseFloat(d.curCSS(b[0],"borderTopWidth",true))||0;g.left+=parseFloat(d.curCSS(b[0],"borderLeftWidth",true))||0;return{top:e.top-g.top,left:e.left-g.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||r.body;a&&!/^body|html$/i.test(a.nodeName)&&d.css(a,"position")==="static";)a=a.offsetParent;return a})}});d.each(["Left","Top"],function(a,b){var e="scroll"+b;d.fn[e]=function(g){var h=this[0],k;if(!h)return null;if(g!==v)return this.each(function(){if(k=ba(this))k.scrollTo(!a?g:d(k).scrollLeft(),a?g:d(k).scrollTop());else this[e]=g});else return(k=ba(h))?"pageXOffset"in k?k[a?"pageYOffset":
a.style.display="";g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility= ""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k,
g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=
a.style.display="";g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k,
g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=
l]]="";a.style[r[n]]=f+"px";a.style[r[1-n]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight; o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();
g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=
function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,k){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),o;if(k){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b)};this.hasFocus=function(a){return a==
function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,k){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),o;if(k){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b); a.style.visibility=""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var l,q;q=location.href;l=q.indexOf("#");return l>=0?q.substr(l+1):null}function b(){w.value=G+"|"+C;if(v)w.value+="|"+M.join(",")}function f(l){if(l){if(!l||C!==l){C=l||G;H(unescape(C))}}else{C=G;H(unescape(C))}}function k(l){var q;l='<html><body><div id="state">'+l+"</div></body></html>";try{q=F.contentWindow.document;q.open();q.write(l);q.close();return true}catch(r){return false}}
function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,k){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),o;if(k){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b)};this.hasFocus=function(a){return a==
""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var g,p;p=location.href;g=p.indexOf("#");return g>=0?p.substr(g+1):null}function b(){J.value=L+"|"+C;if(u)J.value+="|"+D.join(",")}function e(g){if(g){if(!g||C!==g){C=g||L;E(unescape(C))}}else{C=L;E(unescape(C))}}function j(g){var p;g='<html><body><div id="state">'+g+"</div></body></html>";try{p=I.contentWindow.document;p.open();p.write(g);p.close();return true}catch(r){return false}}function l(){var g,
""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var g,p;p=location.href;g=p.indexOf("#");return g>=0?p.substr(g+1):null}function b(){K.value=L+"|"+C;if(u)K.value+="|"+D.join(",")}function e(g){if(g){if(!g||C!==g){C=g||L;E(unescape(C))}}else{C=L;E(unescape(C))}}function j(g){var p;g='<html><body><div id="state">'+g+"</div></body></html>";try{p=I.contentWindow.document;p.open();p.write(g);p.close();return true}catch(r){return false}}function l(){var g,
a.style.display="";h.isHidden(a)||h.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e,j){a=h.getElement(a);b=h.getElement(b);var l=h.widgetPageCoordinates(b),n;if(j){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(e==h.Horizontal){e=l.x+b.offsetWidth;j=l.y;n=l.x;b=l.y+b.offsetHeight}else{e=l.x;j=l.y+b.offsetHeight;n=l.x+b.offsetWidth;b=l.y}h.fitToWindow(a,e,j,n,b);a.style.visibility=""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var g,p;p=location.href;g=p.indexOf("#");return g>=0?p.substr(g+1):null}function b(){J.value=L+"|"+C;if(u)J.value+="|"+D.join(",")}function e(g){if(g){if(!g||C!==g){C=g||L;E(unescape(C))}}else{C=L;E(unescape(C))}}function j(g){var p;g='<html><body><div id="state">'+g+"</div></body></html>";try{p=I.contentWindow.document;p.open();p.write(g);p.close();return true}catch(r){return false}}function l(){var g,
""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+N.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k,
""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k,
a.style.display="";g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+N.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k,
k=0}if(e+F>u+n.y){if(i>u+n.y)i=u+n.y;i-=q.y;e=a.offsetParent.offsetHeight-(i+h.px(a,"marginBottom"));i=1}else{e-=q.y;e-=h.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=h.getElement(a);h.isHidden(a)||h.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=h.getElement(a);b=h.getElement(b);var k=h.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==h.Horizontal){e= k.x+b.offsetWidth;i=k.y;n=k.x;b=k.y+b.offsetHeight}else{e=k.x;i=k.y+b.offsetHeight;n=k.x+b.offsetWidth;b=k.y}h.fitToWindow(a,e,i,n,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var l,p;p=location.href;l=p.indexOf("#");return l>=0?p.substr(l+1):null}function b(){F.value=L+"|"+E;if(u)F.value+="|"+M.join(",")}function e(l){if(l){if(!l||E!==l){E=l||L;N(unescape(E))}}else{E=L;N(unescape(E))}}function k(l){var p;l='<html><body><div id="state">'+l+"</div></body></html>";
j=1}else{b-=q.x;b-=g.px(a,"marginLeft");j=0}if(e+E>u+n.y){if(i>u+n.y)i=u+n.y;i-=q.y;e=a.offsetParent.offsetHeight-(i+g.px(a,"marginBottom"));i=1}else{e-=q.y;e-=g.px(a,"marginTop");i=0}a.style[C[j]]=b+"px";a.style[C[1-j]]="";a.style[w[i]]=e+"px";a.style[w[1-i]]=""};this.positionXY=function(a,b,e){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=g.getElement(a);b=g.getElement(b);var j=g.widgetPageCoordinates(b),i,n; a.style.display="block";if(e==g.Horizontal){e=j.x+b.offsetWidth;i=j.y;n=j.x;b=j.y+b.offsetHeight}else{e=j.x;i=j.y+b.offsetHeight;n=j.x+b.offsetWidth;b=j.y}g.fitToWindow(a,e,i,n,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var l,p;p=location.href;l=p.indexOf("#");return l>=0?p.substr(l+1):null}function b(){E.value=K+"|"+D;if(u)E.value+="|"+L.join(",")}function e(l){if(l){if(!l||D!==l){D=l||K;M(unescape(D))}}else{D=K;M(unescape(D))}}function j(l){var p;
k=0}if(e+F>u+n.y){if(i>u+n.y)i=u+n.y;i-=q.y;e=a.offsetParent.offsetHeight-(i+h.px(a,"marginBottom"));i=1}else{e-=q.y;e-=h.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=h.getElement(a);h.isHidden(a)||h.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=h.getElement(a);b=h.getElement(b);var k=h.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==h.Horizontal){e=k.x+b.offsetWidth;i=k.y;n=k.x;b=k.y+b.offsetHeight}else{e=k.x;i=k.y+b.offsetHeight;n=k.x+b.offsetWidth;b=k.y}h.fitToWindow(a,e,i,n,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var l,p;p=location.href;l=p.indexOf("#");return l>=0?p.substr(l+1):null}function b(){F.value=L+"|"+E;if(u)F.value+="|"+M.join(",")}function e(l){if(l){if(!l||E!==l){E=l||L;N(unescape(E))}}else{E=L;N(unescape(E))}}function k(l){var p;l='<html><body><div id="state">'+l+"</div></body></html>";
(i+g.px(a,"marginBottom"));i=1}else{e-=q.y;e-=g.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=g.getElement(a);b=g.getElement(b);var k=g.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==g.Horizontal){e=k.x+b.offsetWidth;i=k.y;n=k.x;b=k.y+b.offsetHeight}else{e=k.x;i=k.y+ b.offsetHeight;n=k.x+b.offsetWidth;b=k.y}g.fitToWindow(a,e,i,n,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var l,p;p=location.href;l=p.indexOf("#");return l>=0?p.substr(l+1):null}function b(){F.value=L+"|"+E;if(u)F.value+="|"+M.join(",")}function e(l){if(l){if(!l||E!==l){E=l||L;N(unescape(E))}}else{E=L;N(unescape(E))}}function k(l){var p;l='<html><body><div id="state">'+l+"</div></body></html>";try{p=A.contentWindow.document;p.open();p.write(l);
(i+h.px(a,"marginBottom"));i=1}else{e-=q.y;e-=h.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=h.getElement(a);h.isHidden(a)||h.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=h.getElement(a);b=h.getElement(b);var k=h.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==h.Horizontal){e=k.x+b.offsetWidth;i=k.y;n=k.x;b=k.y+b.offsetHeight}else{e=k.x;i=k.y+ b.offsetHeight;n=k.x+b.offsetWidth;b=k.y}h.fitToWindow(a,e,i,n,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var l,p;p=location.href;l=p.indexOf("#");return l>=0?p.substr(l+1):null}function b(){F.value=L+"|"+E;if(u)F.value+="|"+M.join(",")}function e(l){if(l){if(!l||E!==l){E=l||L;N(unescape(E))}}else{E=L;N(unescape(E))}}function k(l){var p;l='<html><body><div id="state">'+l+"</div></body></html>";try{p=A.contentWindow.document;p.open();p.write(l);
(i+g.px(a,"marginBottom"));i=1}else{e-=q.y;e-=g.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=g.getElement(a);b=g.getElement(b);var k=g.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==g.Horizontal){e=k.x+b.offsetWidth;i=k.y;n=k.x;b=k.y+b.offsetHeight}else{e=k.x;i=k.y+b.offsetHeight;n=k.x+b.offsetWidth;b=k.y}g.fitToWindow(a,e,i,n,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var l,p;p=location.href;l=p.indexOf("#");return l>=0?p.substr(l+1):null}function b(){F.value=L+"|"+E;if(u)F.value+="|"+M.join(",")}function e(l){if(l){if(!l||E!==l){E=l||L;N(unescape(E))}}else{E=L;N(unescape(E))}}function k(l){var p;l='<html><body><div id="state">'+l+"</div></body></html>";try{p=A.contentWindow.document;p.open();p.write(l);
a.offsetHeight;if(b+F>E+o.x){h-=r.x;b=a.offsetParent.offsetWidth-(h+g.px(a,"marginRight"));h=1}else{b-=r.x;b-=g.px(a,"marginLeft");h=0}if(f+v>u+o.y){if(k>u+o.y)k=u+o.y;k-=r.y;f=a.offsetParent.offsetHeight-(k+g.px(a,"marginBottom"));k=1}else{f-=r.y;f-=g.px(a,"marginTop");k=0}a.style[y[h]]=b+"px";a.style[y[1-h]]="";a.style[x[k]]=f+"px";a.style[x[1-k]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget= function(a,b,f){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),k,o;a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var l,p;p=location.href;l=p.indexOf("#");return l>=0?p.substr(l+1):null}function b(){v.value=G+"|"+C;if(u)v.value+="|"+M.join(",")}function f(l){if(l){if(!l||
h]]="";a.style[x[k]]=f+"px";a.style[x[1-k]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),k,o;a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b)};this.hasFocus=function(a){return a==
a.offsetHeight;if(b+F>E+o.x){h-=r.x;b=a.offsetParent.offsetWidth-(h+g.px(a,"marginRight"));h=1}else{b-=r.x;b-=g.px(a,"marginLeft");h=0}if(f+v>u+o.y){if(k>u+o.y)k=u+o.y;k-=r.y;f=a.offsetParent.offsetHeight-(k+g.px(a,"marginBottom"));k=1}else{f-=r.y;f-=g.px(a,"marginTop");k=0}a.style[y[h]]=b+"px";a.style[y[1-h]]="";a.style[x[k]]=f+"px";a.style[x[1-k]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),k,o;a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var l,p;p=location.href;l=p.indexOf("#");return l>=0?p.substr(l+1):null}function b(){v.value=G+"|"+C;if(u)v.value+="|"+M.join(",")}function f(l){if(l){if(!l||
if(b+a.offsetWidth>B+o.x)b=m-a.offsetWidth-k.px(a,"marginRight");else b-=k.px(a,"marginLeft");if(f+a.offsetHeight>r+o.y){if(l>r+o.y)l=r+o.y;f=l-a.offsetHeight-k.px(a,"marginBottom")}else f-=k.px(a,"marginTop");if(b<B)b=B+o.x-a.offsetWidth-3;if(f<r)f=r+o.y-a.offsetHeight-3;m=k.widgetPageCoordinates(a.offsetParent);a.style.left=b-m.x+"px";a.style.top=f-m.y+"px"};this.positionXY=function(a,b,f){a=k.getElement(a);k.isHidden(a)||k.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget= function(a,b,f){a=k.getElement(a);b=k.getElement(b);var m=k.widgetPageCoordinates(b),l,o;a.style.display="block";if(f==k.Horizontal){f=m.x+b.offsetWidth;l=m.y;o=m.x;b=m.y+b.offsetHeight}else{f=m.x;l=m.y+b.offsetHeight;o=m.x+b.offsetWidth;b=m.y}k.fitToWindow(a,f,l,o,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var g,p;p=location.href;g=p.indexOf("#");return g>=0?p.substr(g+1):null}function b(){H.value=I+"|"+z;if(r)H.value+="|"+A.join(",")}function f(g){if(g){if(!g||
q+n.y)l=q+n.y;f=l-a.offsetHeight-k.px(a,"marginBottom")}else f-=k.px(a,"marginTop");if(b<E)b=E+n.x-a.offsetWidth-3;if(f<q)f=q+n.y-a.offsetHeight-3;m=k.widgetPageCoordinates(a.offsetParent);a.style.left=b-m.x+"px";a.style.top=f-m.y+"px"};this.positionXY=function(a,b,f){a=k.getElement(a);k.isHidden(a)||k.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f){a=k.getElement(a);b=k.getElement(b);var m=k.widgetPageCoordinates(b),l,n;a.style.display="block";if(f== k.Horizontal){f=m.x+b.offsetWidth;l=m.y;n=m.x;b=m.y+b.offsetHeight}else{f=m.x;l=m.y+b.offsetHeight;n=m.x+b.offsetWidth;b=m.y}k.fitToWindow(a,f,l,n,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var g,o;o=location.href;g=o.indexOf("#");return g>=0?o.substr(g+1):null}function b(){L.value=I+"|"+y;if(q)L.value+="|"+N.join(",")}function f(g){if(g){if(!g||y!==g){y=g||I;S(unescape(y))}}else{y=I;S(unescape(y))}}function m(g){var o;g='<html><body><div id="state">'+
if(b+a.offsetWidth>B+o.x)b=m-a.offsetWidth-k.px(a,"marginRight");else b-=k.px(a,"marginLeft");if(f+a.offsetHeight>r+o.y){if(l>r+o.y)l=r+o.y;f=l-a.offsetHeight-k.px(a,"marginBottom")}else f-=k.px(a,"marginTop");if(b<B)b=B+o.x-a.offsetWidth-3;if(f<r)f=r+o.y-a.offsetHeight-3;m=k.widgetPageCoordinates(a.offsetParent);a.style.left=b-m.x+"px";a.style.top=f-m.y+"px"};this.positionXY=function(a,b,f){a=k.getElement(a);k.isHidden(a)||k.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f){a=k.getElement(a);b=k.getElement(b);var m=k.widgetPageCoordinates(b),l,o;a.style.display="block";if(f==k.Horizontal){f=m.x+b.offsetWidth;l=m.y;o=m.x;b=m.y+b.offsetHeight}else{f=m.x;l=m.y+b.offsetHeight;o=m.x+b.offsetWidth;b=m.y}k.fitToWindow(a,f,l,o,b)};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var g,p;p=location.href;g=p.indexOf("#");return g>=0?p.substr(g+1):null}function b(){H.value=I+"|"+z;if(r)H.value+="|"+A.join(",")}function f(g){if(g){if(!g||
console.log("global" + global);
function positionPopup(edit) { console.log("global" + global); WT.positionAtWidget(el.id, edit.id, WT.Vertical, global); }
a.style.display="";g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=
g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=
B=["left","right"],r=["top","bottom"],C=g.px(a,"maxWidth")||a.offsetWidth,J=g.px(a,"maxHeight")||a.offsetHeight;if(b+C>L+o.x){l-=q.x;b=a.offsetParent.offsetWidth-(l+g.px(a,"marginRight"));l=1}else{b-=q.x;b-=g.px(a,"marginLeft");l=0}if(f+J>u+o.y){if(n>u+o.y)n=u+o.y;n-=q.y;f=a.offsetParent.offsetHeight-(n+g.px(a,"marginBottom"));n=1}else{f-=q.y;f-=g.px(a,"marginTop");n=0}a.style[B[l]]=b+"px";a.style[B[1-l]]="";a.style[r[n]]=f+"px";a.style[r[1-n]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);a.style.display="";g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=
B=["left","right"],r=["top","bottom"],C=g.px(a,"maxWidth")||a.offsetWidth,J=g.px(a,"maxHeight")||a.offsetHeight;if(b+C>L+o.x){l-=q.x;b=a.offsetParent.offsetWidth-(l+g.px(a,"marginRight"));l=1}else{b-=q.x;b-=g.px(a,"marginLeft");l=0}if(f+J>u+o.y){if(n>u+o.y)n=u+o.y;n-=q.y;f=a.offsetParent.offsetHeight-(n+g.px(a,"marginBottom"));n=1}else{f-=q.y;f-=g.px(a,"marginTop");n=0}a.style[B[l]]=b+"px";a.style[B[1-l]]="";a.style[r[n]]=f+"px";a.style[r[1-n]]=""};this.positionXY=function(a,b,f){a=g.getElement(a); g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=
l]]="";a.style[r[n]]=f+"px";a.style[r[1-n]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;
B=["left","right"],r=["top","bottom"],C=g.px(a,"maxWidth")||a.offsetWidth,J=g.px(a,"maxHeight")||a.offsetHeight;if(b+C>L+o.x){l-=q.x;b=a.offsetParent.offsetWidth-(l+g.px(a,"marginRight"));l=1}else{b-=q.x;b-=g.px(a,"marginLeft");l=0}if(f+J>u+o.y){if(n>u+o.y)n=u+o.y;n-=q.y;f=a.offsetParent.offsetHeight-(n+g.px(a,"marginBottom"));n=1}else{f-=q.y;f-=g.px(a,"marginTop");n=0}a.style[B[l]]=b+"px";a.style[B[1-l]]="";a.style[r[n]]=f+"px";a.style[r[1-n]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=
s=g.widgetPageCoordinates(a.offsetParent),z=["left","right"],x=["top","bottom"],F=g.px(a,"maxWidth")||a.offsetWidth,v=g.px(a,"maxHeight")||a.offsetHeight;if(b+F>E+o.x){k-=s.x;b=a.offsetParent.offsetWidth-(k+g.px(a,"marginRight"));k=1}else{b-=s.x;b-=g.px(a,"marginLeft");k=0}if(f+v>u+o.y){if(h>u+o.y)h=u+o.y;h-=s.y;f=a.offsetParent.offsetHeight-(h+g.px(a,"marginBottom"));h=1}else{f-=s.y;f-=g.px(a,"marginTop");h=0}a.style[z[k]]=b+"px";a.style[z[1-k]]="";a.style[x[h]]=f+"px";a.style[x[1-h]]=""};this.positionXY= function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,k){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),o;if(k){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b)};this.hasFocus=function(a){return a==
s=g.widgetPageCoordinates(a.offsetParent),z=["left","right"],y=["top","bottom"],F=g.px(a,"maxWidth")||a.offsetWidth,w=g.px(a,"maxHeight")||a.offsetHeight;if(b+F>E+o.x){k-=s.x;b=a.offsetParent.offsetWidth-(k+g.px(a,"marginRight"));k=1}else{b-=s.x;b-=g.px(a,"marginLeft");k=0}if(f+w>v+o.y){if(h>v+o.y)h=v+o.y;h-=s.y;f=a.offsetParent.offsetHeight-(h+g.px(a,"marginBottom"));h=1}else{f-=s.y;f-=g.px(a,"marginTop");h=0}a.style[z[k]]=b+"px";a.style[z[1-k]]="";a.style[y[h]]=f+"px";a.style[y[1-h]]=""};this.positionXY= function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,k){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),o;if(k){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b);
s=g.widgetPageCoordinates(a.offsetParent),z=["left","right"],x=["top","bottom"],F=g.px(a,"maxWidth")||a.offsetWidth,v=g.px(a,"maxHeight")||a.offsetHeight;if(b+F>E+o.x){k-=s.x;b=a.offsetParent.offsetWidth-(k+g.px(a,"marginRight"));k=1}else{b-=s.x;b-=g.px(a,"marginLeft");k=0}if(f+v>u+o.y){if(h>u+o.y)h=u+o.y;h-=s.y;f=a.offsetParent.offsetHeight-(h+g.px(a,"marginBottom"));h=1}else{f-=s.y;f-=g.px(a,"marginTop");h=0}a.style[z[k]]=b+"px";a.style[z[1-k]]="";a.style[x[h]]=f+"px";a.style[x[1-h]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,k){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),o;if(k){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b)};this.hasFocus=function(a){return a==
s=["left","right"],y=["top","bottom"],I=h.px(a,"maxWidth")||a.offsetWidth,J=h.px(a,"maxHeight")||a.offsetHeight;if(b+I>H+n.x){j-=q.x;b=a.offsetParent.offsetWidth-(j+h.px(a,"marginRight"));j=1}else{b-=q.x;b-=h.px(a,"marginLeft");j=0}if(e+J>u+n.y){if(l>u+n.y)l=u+n.y;l-=q.y;e=a.offsetParent.offsetHeight-(l+h.px(a,"marginBottom"));l=1}else{e-=q.y;e-=h.px(a,"marginTop");l=0}a.style[s[j]]=b+"px";a.style[s[1-j]]="";a.style[y[l]]=e+"px";a.style[y[1-l]]=""};this.positionXY=function(a,b,e){a=h.getElement(a);
s=["left","right"],y=["top","bottom"],I=h.px(a,"maxWidth")||a.offsetWidth,K=h.px(a,"maxHeight")||a.offsetHeight;if(b+I>H+n.x){j-=q.x;b=a.offsetParent.offsetWidth-(j+h.px(a,"marginRight"));j=1}else{b-=q.x;b-=h.px(a,"marginLeft");j=0}if(e+K>u+n.y){if(l>u+n.y)l=u+n.y;l-=q.y;e=a.offsetParent.offsetHeight-(l+h.px(a,"marginBottom"));l=1}else{e-=q.y;e-=h.px(a,"marginTop");l=0}a.style[s[j]]=b+"px";a.style[s[1-j]]="";a.style[y[l]]=e+"px";a.style[y[1-l]]=""};this.positionXY=function(a,b,e){a=h.getElement(a);
s=["left","right"],y=["top","bottom"],I=h.px(a,"maxWidth")||a.offsetWidth,J=h.px(a,"maxHeight")||a.offsetHeight;if(b+I>H+n.x){j-=q.x;b=a.offsetParent.offsetWidth-(j+h.px(a,"marginRight"));j=1}else{b-=q.x;b-=h.px(a,"marginLeft");j=0}if(e+J>u+n.y){if(l>u+n.y)l=u+n.y;l-=q.y;e=a.offsetParent.offsetHeight-(l+h.px(a,"marginBottom"));l=1}else{e-=q.y;e-=h.px(a,"marginTop");l=0}a.style[s[j]]=b+"px";a.style[s[1-j]]="";a.style[y[l]]=e+"px";a.style[y[1-l]]=""};this.positionXY=function(a,b,e){a=h.getElement(a);a.style.display="";h.isHidden(a)||h.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e,j){a=h.getElement(a);b=h.getElement(b);var l=h.widgetPageCoordinates(b),n;if(j){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(e==h.Horizontal){e=l.x+b.offsetWidth;j=l.y;n=l.x;b=l.y+b.offsetHeight}else{e=l.x;j=l.y+b.offsetHeight;n=l.x+b.offsetWidth;b=l.y}h.fitToWindow(a,e,j,n,b);a.style.visibility=
w.style.display = '';
this.positionXY = function(id, x, y) { var w = WT.getElement(id); w.style.display = ''; if (!WT.isHidden(w)) WT.fitToWindow(w, x, y, x, y);};
k=0}if(e+F>u+n.y){if(i>u+n.y)i=u+n.y;i-=q.y;e=a.offsetParent.offsetHeight-(i+h.px(a,"marginBottom"));i=1}else{e-=q.y;e-=h.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=h.getElement(a);h.isHidden(a)||h.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=h.getElement(a);b=h.getElement(b);var k=h.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==h.Horizontal){e=
j=1}else{b-=q.x;b-=g.px(a,"marginLeft");j=0}if(e+E>u+n.y){if(i>u+n.y)i=u+n.y;i-=q.y;e=a.offsetParent.offsetHeight-(i+g.px(a,"marginBottom"));i=1}else{e-=q.y;e-=g.px(a,"marginTop");i=0}a.style[C[j]]=b+"px";a.style[C[1-j]]="";a.style[w[i]]=e+"px";a.style[w[1-i]]=""};this.positionXY=function(a,b,e){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=g.getElement(a);b=g.getElement(b);var j=g.widgetPageCoordinates(b),i,n;
k=0}if(e+F>u+n.y){if(i>u+n.y)i=u+n.y;i-=q.y;e=a.offsetParent.offsetHeight-(i+h.px(a,"marginBottom"));i=1}else{e-=q.y;e-=h.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=h.getElement(a);h.isHidden(a)||h.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=h.getElement(a);b=h.getElement(b);var k=h.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==h.Horizontal){e=
(i+g.px(a,"marginBottom"));i=1}else{e-=q.y;e-=g.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=g.getElement(a);b=g.getElement(b);var k=g.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==g.Horizontal){e=k.x+b.offsetWidth;i=k.y;n=k.x;b=k.y+b.offsetHeight}else{e=k.x;i=k.y+
(i+h.px(a,"marginBottom"));i=1}else{e-=q.y;e-=h.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=h.getElement(a);h.isHidden(a)||h.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=h.getElement(a);b=h.getElement(b);var k=h.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==h.Horizontal){e=k.x+b.offsetWidth;i=k.y;n=k.x;b=k.y+b.offsetHeight}else{e=k.x;i=k.y+
(i+g.px(a,"marginBottom"));i=1}else{e-=q.y;e-=g.px(a,"marginTop");i=0}a.style[D[k]]=b+"px";a.style[D[1-k]]="";a.style[x[i]]=e+"px";a.style[x[1-i]]=""};this.positionXY=function(a,b,e){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e){a=g.getElement(a);b=g.getElement(b);var k=g.widgetPageCoordinates(b),i,n;a.style.display="block";if(e==g.Horizontal){e=k.x+b.offsetWidth;i=k.y;n=k.x;b=k.y+b.offsetHeight}else{e=k.x;i=k.y+
a.offsetHeight;if(b+F>E+o.x){h-=r.x;b=a.offsetParent.offsetWidth-(h+g.px(a,"marginRight"));h=1}else{b-=r.x;b-=g.px(a,"marginLeft");h=0}if(f+v>u+o.y){if(k>u+o.y)k=u+o.y;k-=r.y;f=a.offsetParent.offsetHeight-(k+g.px(a,"marginBottom"));k=1}else{f-=r.y;f-=g.px(a,"marginTop");k=0}a.style[y[h]]=b+"px";a.style[y[1-h]]="";a.style[x[k]]=f+"px";a.style[x[1-k]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=
h]]="";a.style[x[k]]=f+"px";a.style[x[1-k]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f){a=g.getElement(a);b=g.getElement(b);var h=g.widgetPageCoordinates(b),k,o;a.style.display="block";if(f==g.Horizontal){f=h.x+b.offsetWidth;k=h.y;o=h.x;b=h.y+b.offsetHeight}else{f=h.x;k=h.y+b.offsetHeight;o=h.x+b.offsetWidth;b=h.y}g.fitToWindow(a,f,k,o,b)};this.hasFocus=function(a){return a==
a.offsetHeight;if(b+F>E+o.x){h-=r.x;b=a.offsetParent.offsetWidth-(h+g.px(a,"marginRight"));h=1}else{b-=r.x;b-=g.px(a,"marginLeft");h=0}if(f+v>u+o.y){if(k>u+o.y)k=u+o.y;k-=r.y;f=a.offsetParent.offsetHeight-(k+g.px(a,"marginBottom"));k=1}else{f-=r.y;f-=g.px(a,"marginTop");k=0}a.style[y[h]]=b+"px";a.style[y[1-h]]="";a.style[x[k]]=f+"px";a.style[x[1-k]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=
if(b+a.offsetWidth>B+o.x)b=m-a.offsetWidth-k.px(a,"marginRight");else b-=k.px(a,"marginLeft");if(f+a.offsetHeight>r+o.y){if(l>r+o.y)l=r+o.y;f=l-a.offsetHeight-k.px(a,"marginBottom")}else f-=k.px(a,"marginTop");if(b<B)b=B+o.x-a.offsetWidth-3;if(f<r)f=r+o.y-a.offsetHeight-3;m=k.widgetPageCoordinates(a.offsetParent);a.style.left=b-m.x+"px";a.style.top=f-m.y+"px"};this.positionXY=function(a,b,f){a=k.getElement(a);k.isHidden(a)||k.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=
q+n.y)l=q+n.y;f=l-a.offsetHeight-k.px(a,"marginBottom")}else f-=k.px(a,"marginTop");if(b<E)b=E+n.x-a.offsetWidth-3;if(f<q)f=q+n.y-a.offsetHeight-3;m=k.widgetPageCoordinates(a.offsetParent);a.style.left=b-m.x+"px";a.style.top=f-m.y+"px"};this.positionXY=function(a,b,f){a=k.getElement(a);k.isHidden(a)||k.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f){a=k.getElement(a);b=k.getElement(b);var m=k.widgetPageCoordinates(b),l,n;a.style.display="block";if(f==
if(b+a.offsetWidth>B+o.x)b=m-a.offsetWidth-k.px(a,"marginRight");else b-=k.px(a,"marginLeft");if(f+a.offsetHeight>r+o.y){if(l>r+o.y)l=r+o.y;f=l-a.offsetHeight-k.px(a,"marginBottom")}else f-=k.px(a,"marginTop");if(b<B)b=B+o.x-a.offsetWidth-3;if(f<r)f=r+o.y-a.offsetHeight-3;m=k.widgetPageCoordinates(a.offsetParent);a.style.left=b-m.x+"px";a.style.top=f-m.y+"px"};this.positionXY=function(a,b,f){a=k.getElement(a);k.isHidden(a)||k.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=
alert("Error " + ajax.status + ":\n" + ajax.responseText);
window.alert("Error " + ajax.status + ":\n" + ajax.responseText);
function post_to_server(server_URL, message, ajax, handler, extra_data) { ///TODO: Consider whether GET could be better than POST. ajax.open("POST", server_URL); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.onreadystatechange = function () { if (ajax.readyState == 4) { if (ajax.status == 200) { /// This is run when the results are returned properly. ///NOTE: JSON.parse() is at least currently (November 2009) twice as slow as eval(), and it does not work because of problems parsing the character combination slash plus single quote (\'). Two slashes may work. ///TODO: Add error handling for parsing. handler(eval("(" + ajax.responseText + ")"), extra_data); } else { /// Was the abort unintentional? if (ajax.status !== 0) { ///FIXME: Do meaningful error handling. alert("Error " + ajax.status + ":\n" + ajax.responseText); } } } }; ajax.send(message); }
if (ajax.status != 0) {
if (ajax.status !== 0) {
function post_to_server(server_URL, message, ajax, handler) { ///TODO: Consider whether GET could be better than POST. ajax.open("POST", server_URL, true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.onreadystatechange = function () { if (ajax.readyState == 4) { if (ajax.status == 200) { /// This is run when the results are returned properly. ///NOTE: JSON.parse() is at least currently (November 2009) twice as slow as eval(), and it does not work because of problems parsing the character combination slash plus single quote (\'). Two slashes may work. ///TODO: Add error handling for parsing. handler(eval(ajax.responseText)); } else { /// Was the abort unintentional? if (ajax.status != 0) { ///FIXME: Do meaningful error handling. alert("Error " + ajax.status + ":\n" + ajax.responseText); } } } }; ajax.send(message); }
case "signon.rememberSignons": if (promptService.confirm(window, "Password management", "The KeeFox extension may not work correctly if you allow" + " Firefox to manage your passwords. Should KeeFox disable" + " the built-in Firefox password manager?")) { Application.prefs.setValue("signon.rememberSignons", false); } break; case "browser.sessionstore.enabled": promptService.alert(window, "Password management", "The KeeFox extension will not work correctly if you disable" + " browser.sessionstore. KeeFox will now enable" + " browser.sessionstore. If you must set browser." + "sessionstore.enabled to false, please disable or" + " uninstall KeeFox first."); Application.prefs.setValue("browser.sessionstore.enabled", true); break;
preferenceChangeHandler: function(event) { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); // get a reference to the prompt service component. var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); switch (event.data) { case "notifyBarWhenLoggedOut": break; case "notifyBarWhenKeePassRPCInactive": break; case "rememberMRUDB": if (this._keeFoxExtension.prefs.getValue("rememberMRUDB",false)) keeFoxInst._keeFoxExtension.prefs.setValue("keePassMRUDB",""); break; default: break; } },
case "signon.rememberSignons": if (promptService.confirm(window, "Password management", "The KeeFox extension may not work correctly if you allow" + " Firefox to manage your passwords. Should KeeFox disable" + " the built-in Firefox password manager?")) { Application.prefs.setValue("signon.rememberSignons", false); } break; case "browser.sessionstore.enabled": promptService.alert(window, "Password management", "The KeeFox extension will not work correctly if you disable" + " browser.sessionstore. KeeFox will now enable" + " browser.sessionstore. If you must set browser." + "sessionstore.enabled to false, please disable or" + " uninstall KeeFox first."); Application.prefs.setValue("browser.sessionstore.enabled", true); break;
preferenceChangeHandler: function(event) { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var window = wm.getMostRecentWindow("navigator:browser"); // get a reference to the prompt service component. var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); switch (event.data) { case "notifyBarWhenLoggedOut": break; case "notifyBarWhenKeePassRPCInactive": break; case "rememberMRUDB": if (this._keeFoxExtension.prefs.getValue("rememberMRUDB",false)) keeFoxInst._keeFoxExtension.prefs.setValue("keePassMRUDB",""); break; case "signon.rememberSignons": if (promptService.confirm(window, "Password management", "The KeeFox extension may not work correctly if you allow" + " Firefox to manage your passwords. Should KeeFox disable" + " the built-in Firefox password manager?")) { Application.prefs.setValue("signon.rememberSignons", false); } break; case "browser.sessionstore.enabled": promptService.alert(window, "Password management", "The KeeFox extension will not work correctly if you disable" + " browser.sessionstore. KeeFox will now enable" + " browser.sessionstore. If you must set browser." + "sessionstore.enabled to false, please disable or" + " uninstall KeeFox first."); Application.prefs.setValue("browser.sessionstore.enabled", true); break; default: break; } },
prefToArg: function (pref) { pref = pref.replace(/.*\./, ""); return util.Array.toObject(Sanitizer.prefArgList)[pref] || pref; },
prefToArg: function (pref) pref.toLowerCase().replace(/.*\./, "") }, {
prefToArg: function (pref) { pref = pref.replace(/.*\./, ""); return util.Array.toObject(Sanitizer.prefArgList)[pref] || pref; },
var img = new Image(); img.src = $(this).css('background-image').replace(/url\((.+)\)/, '$1'); })
var img = new Image(); img.src = $(this).css('background-image').replace(/^url\(\"?/, "").replace(/\"?\)$/, ""); });
function preloadImages(){ //TODO preload prev/next ? $('#facybox').find('.n, .close , .s, .w, .e, .nw, ne, sw, se').each(function() { var img = new Image(); img.src = $(this).css('background-image').replace(/url\((.+)\)/, '$1'); }) // var img = new Image(); // img.src = 'images/loading.gif'; /* TODO: remove and load preloader from filament group */ }
search_terms_arr = lang.filter_terms_for_highlighter(search_terms)
search_terms_arr = lang.filter_terms_for_highlighter(search_terms);
function prepare_highlighter(search_terms) { var count = 0, i, j, len_before, len_after, no_morph, term, stemmed_arr = [], search_terms_arr, stemmed_word; highlight_re = []; search_terms_arr = lang.filter_terms_for_highlighter(search_terms) first_loop:for (i in search_terms_arr) { term = search_terms_arr[i]; len_before = term.length; ///FIXME: Move this to the language specific file because it is language dependent. /// Fix special/unique words that the stemmer won't stem correctly. switch (term) { case "does": case "doth": case "do": case "doeth": case "doest": stemmed_word = "do[esth]*"; no_morph = true; break; case "haste": case "hasted": stemmed_word = "haste"; no_morph = false; break; case "shalt": case "shall": stemmed_word = "shal[lt]"; no_morph = true; break; case "wilt": case "will": stemmed_word = "wil[lt]"; no_morph = true; break; case "have": case "hast": case "hath": stemmed_word = "ha[vesth]+"; no_morph = true; break; case "the": stemmed_word = "the"; no_morph = true; break; case "for": stemmed_word = "for"; no_morph = true; break; case "not": stemmed_word = "not"; no_morph = true; break; default: /// Does the word contain a wildcard symbol (*)? if (term.indexOf("*") != -1) { /// Don't stem; change it to a regex compatible form. ///NOTE: Word breaks are found by looking for tag openings (<) or closings (>). stemmed_word = term.replace(/\*/g, "[^<>]*"); no_morph = true; } else { /// A normal word without a wildcard gets stemmed. stemmed_word = lang.stem_word(term); no_morph = false; } } len_after = stemmed_word.length; /// Skip words that are the same after stemming or regexing. for (j = 0; j < count; ++j) { if (stemmed_word == stemmed_arr[j]) continue first_loop; ///NOTE: This is the same as "continue 2" in PHP. } stemmed_arr[count] = stemmed_word; ///NOTE: [<-] finds either the beginning of the close tag (</b>) or a hyphen (-). /// The hyphen is to highlight hyphenated words that would otherwise be missed (matching first word only) (i.e., "Beth"). /// ([^>]+-)? finds words where the match is not the first of a hyphenated word (i.e., "Maachah"). /// The current English version (KJV) does not use square brackets ([]). ///FIXME: The punctuation ,.?!;:)( could be considered language specific. ///TODO: Bench mark different regex (creation and testing). if (no_morph || (len_after == len_before && len_after < 3)) { highlight_re[count++] = new RegExp("=([0-9]+)>\\(*(?:" + stemmed_word + "|[^<]+-" + stemmed_word + ")[),.?!;:]*[<-]", "i"); } else { /// Find most words based on stem morphology, but also can have false hits. ///TODO: Compare different regexes. //highlight_re[count++] = new RegExp("id=([0-9]+)>[(]*([^<]+-)?" + stemmed_word + "[a-z']{0,7}[),.?!;:]*[<-]", "i"); highlight_re[count++] = new RegExp("=([0-9]+)>\\(*(?:" + stemmed_word + "|[^<]+-" + stemmed_word + ")[^<]{0,7}[),.?!;:]*[<-]", "i"); } } }
if (raw_search_terms != last_search && last_type != MORPHOLOGICAL_SEARCH) {
if (raw_search_terms != last_search) {
function prepare_new_search(){ var raw_search_terms = q_obj.value, verse_id, last_search_prepared; waiting_for_first_search = true; last_search_prepared = prepare_search(raw_search_terms); if (last_search_prepared.length == 0) return false; /// Stop any old requests since we have a new one. /// Is readyState > 0 and < 4? (Anything 1-3 needs to be aborted.) if (ajax_additional.readyState % 4) ajax_additional.abort(); if (ajax_previous.readyState % 4) ajax_previous.abort(); /// Determine if the user is preforming a search or looking up a verse. verse_id = determine_reference(last_search_prepared); /// Is the user looking up a verse? (verse_id is false when the user is preforming a search.) if (verse_id !== false) { /// To get the titles of Psalms, select verse 0 instead of verse 1. if (verse_id < 19145002 && verse_id > 19003000 && verse_id % 1000 == 1) --verse_id; last_type = VERSE_LOOKUP; /// NOTE: Subtract 1 because run_search() adds one. bottom_id = verse_id - 1; } else {/// The user is submitting a search request. var search_type_array = determine_search_type(last_search_prepared); last_type = search_type_array[0]; if (last_type == MORPHOLOGICAL_SEARCH) { last_search_prepared = search_type_array[1]; } last_search_encoded = encodeURIComponent(last_search_prepared); bottom_id = 0; } run_search(ADDITIONAL); /// Prepare for the new results. if (last_type == VERSE_LOOKUP) { scroll_maxed_top = false; scroll_maxed_bottom = false; } else { scroll_maxed_top = true; scroll_maxed_bottom = false; /// We immediately prepare the highlighter so that when the results are returned via AJAX /// the highlighter array will be ready to go. /// Do we already have the regex array or do we not need because the highlighted words will be returned (e.g., morphological searching)? if (raw_search_terms != last_search && last_type != MORPHOLOGICAL_SEARCH) { prepare_highlighter(last_search_prepared); last_search = raw_search_terms; } } clean_up_page(); last_book = 0; /// Clear cache. cached_verses_top = []; cached_count_top = 0; cached_verses_bottom = []; cached_count_bottom = 0; doc.title = raw_search_terms + " - " + lang.page_title; return false;}
var raw_search_terms = q_obj.value, verse_id, last_search_prepared, search_type_array;
var last_search_prepared, raw_search_terms = q_obj.value, search_type_array, verse_id;
function prepare_new_search() { var raw_search_terms = q_obj.value, verse_id, last_search_prepared, search_type_array; waiting_for_first_search = true; last_search_prepared = lang.prepare_search(raw_search_terms); if (last_search_prepared.length == 0) return false; /// Stop any old requests since we have a new one. /// Is readyState > 0 and < 4? (Anything 1-3 needs to be aborted.) if (ajax_additional.readyState % 4) ajax_additional.abort(); if (ajax_previous.readyState % 4) ajax_previous.abort(); /// Determine if the user is preforming a search or looking up a verse. /// If the query is a verse reference, a number is returned, if it is a search, then FALSE is returned. verse_id = lang.determine_reference(last_search_prepared); /// Is the user looking up a verse? (verse_id is false when the user is preforming a search.) if (verse_id !== false) { /// To get the titles of Psalms, select verse 0 instead of verse 1. if (verse_id < 19145002 && verse_id > 19003000 && verse_id % 1000 == 1) --verse_id; last_type = VERSE_LOOKUP; ///TODO: Determine if there is a better way of doing this. ///NOTE: Subtract 1 because run_search() adds one. bottom_id = verse_id - 1; /// The user is submitting a search request. } else { /// The type of search must be determined (i.e., MIXED_SEARCH or STANDARD_SEARCH or MORPHOLOGICAL_SEARCH). search_type_array = determine_search_type(last_search_prepared); /// The type of search is stored in the first index of the array. last_type = search_type_array[0]; if (last_type == MORPHOLOGICAL_SEARCH) { /// MORPHOLOGICAL_SEARCH uses a JSON array which is stored as text in the second index of the array. last_search_prepared = search_type_array[1]; } last_search_encoded = encodeURIComponent(last_search_prepared); bottom_id = 0; } run_search(ADDITIONAL); /// Prepare for the new results. if (last_type == VERSE_LOOKUP) { scroll_maxed_top = false; scroll_maxed_bottom = false; } else { scroll_maxed_top = true; scroll_maxed_bottom = false; /// We immediately prepare the highlighter so that when the results are returned via Ajax. /// the highlighter array will be ready to go. /// Do we already have the regex array or do we not need because the highlighted words will be returned (e.g., morphological searching)? if (raw_search_terms != last_search) { prepare_highlighter(last_search_prepared); /// This global variable is used to display the last search on the info bar. last_search = raw_search_terms; } } clean_up_page(); last_book = 0; /// Clear cache. ///TODO: Determine a way to store the cache in a way that it can be used later. cached_verses_top = []; cached_count_top = 0; cached_verses_bottom = []; cached_count_bottom = 0; doc.title = raw_search_terms + " - " + lang.app_name; return false; }
if (last_search_prepared.length == 0) return false;
if (last_search_prepared.length === 0) return false;
function prepare_new_search() { var last_search_prepared, raw_search_terms = q_obj.value, search_type_array, verse_id; waiting_for_first_search = true; last_search_prepared = lang.prepare_search(raw_search_terms); if (last_search_prepared.length == 0) return false; /// Stop any old requests since we have a new one. /// Is readyState > 0 and < 4? (Anything 1-3 needs to be aborted.) if (ajax_additional.readyState % 4) ajax_additional.abort(); if (ajax_previous.readyState % 4) ajax_previous.abort(); /// Determine if the user is preforming a search or looking up a verse. /// If the query is a verse reference, a number is returned, if it is a search, then FALSE is returned. verse_id = lang.determine_reference(last_search_prepared); /// Is the user looking up a verse? (verse_id is false when the user is preforming a search.) if (verse_id !== false) { /// To get the titles of Psalms, select verse 0 instead of verse 1. if (verse_id < 19145002 && verse_id > 19003000 && verse_id % 1000 == 1) --verse_id; last_type = VERSE_LOOKUP; ///TODO: Determine if there is a better way of doing this. ///NOTE: Subtract 1 because run_search() adds one. bottom_id = verse_id - 1; /// The user is submitting a search request. } else { /// The type of search must be determined (i.e., MIXED_SEARCH or STANDARD_SEARCH or MORPHOLOGICAL_SEARCH). search_type_array = determine_search_type(last_search_prepared); /// The type of search is stored in the first index of the array. last_type = search_type_array[0]; if (last_type == MORPHOLOGICAL_SEARCH) { /// MORPHOLOGICAL_SEARCH uses a JSON array which is stored as text in the second index of the array. last_search_prepared = search_type_array[1]; } last_search_encoded = encodeURIComponent(last_search_prepared); bottom_id = 0; } run_search(ADDITIONAL); /// Prepare for the new results. if (last_type == VERSE_LOOKUP) { scroll_maxed_top = false; scroll_maxed_bottom = false; } else { scroll_maxed_top = true; scroll_maxed_bottom = false; /// We immediately prepare the highlighter so that when the results are returned via Ajax. /// the highlighter array will be ready to go. /// Do we already have the regex array or do we not need because the highlighted words will be returned (e.g., morphological searching)? if (raw_search_terms != last_search) { prepare_highlighter(last_search_prepared); /// This global variable is used to display the last search on the info bar. last_search = raw_search_terms; } } clean_up_page(); last_book = 0; /// Clear cache. ///TODO: Determine a way to store the cache in a way that it can be used later. cached_verses_top = []; cached_count_top = 0; cached_verses_bottom = []; cached_count_bottom = 0; doc.title = raw_search_terms + " - " + lang.app_name; return false; }
return search_terms.replace(" IN RED", " AS RED").replace(/\s{2,}/g, " ").replace(/\sAND\s/g, " & ").replace(/\sOR\s/g, " | ").replace(/(?:\s-|\s*\bNOT)\s/g, " -").replace(/[‘’]/g, "'").replace(/[“”]/g, '"').replace(/[\u2011-\u2015]/g, "-").replace(/([0-9]+)[:.;,\s]title/ig, "$1:0");
return search_terms.replace(" IN RED", " AS RED").replace(/\s{2,}/g, " ").replace(/\sAND\s/g, " & ").replace(/\sOR\s/g, " | ").replace(/(?:\s-|\s*\bNOT)\s/g, " -").replace(/[‘’]/g, "'").replace(/[“”]/g, '"').replace(/[\u2011-\u2015]/g, "-").replace(/([0-9]+)[:.;,\s]title/ig, "$1:0").replace(/subscription/ig, "255");
prepare_search: function (search_terms) { ///NOTE: /\s{2,}/g gets rid of double spaces within the words (e.g., "here there" becomes "here there"). ///NOTE: /\s+-\s+/g ensures that filter_array() will filter out negative words like "this - that" (i.e., "that" does not need to be highlighted). ///NOTE: \u2011-\u2015 replaces various hyphens, dashes, and minuses with the standard hyphen (-). ///NOTE: replace(/([0-9]+)[:.;,\s]title/ig, "$1:0") replaces Psalm title references into an acceptable format (e.g., "Psalm 3:title" becomes "Psalm 3:0"). return search_terms.replace(" IN RED", " AS RED").replace(/\s{2,}/g, " ").replace(/\sAND\s/g, " & ").replace(/\sOR\s/g, " | ").replace(/(?:\s-|\s*\bNOT)\s/g, " -").replace(/[‘’]/g, "'").replace(/[“”]/g, '"').replace(/[\u2011-\u2015]/g, "-").replace(/([0-9]+)[:.;,\s]title/ig, "$1:0"); }
d.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,e){return d.dir(a,"parentNode",e)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,e){return d.dir(a,"nextSibling",e)},prevUntil:function(a,b,e){return d.dir(a,"previousSibling", e)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(e,g){var h=d.map(this,b,e);Ba.test(a)||(g=e);if(g&&typeof g==="string")h=d.filter(g,h);h=this.length>1?d.unique(h):h;if((this.length>1||Da.test(g))&&Ca.test(a))h=h.reverse();return this.pushStack(h,a,I.call(arguments).join(","))}});
"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,e){return c.dir(a,"nextSibling",e)},prevUntil:function(a,b,e){return c.dir(a,"previousSibling",e)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(e,f){var h=c.map(this,b,e);Ba.test(a)||
d.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,e){return d.dir(a,"parentNode",e)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,e){return d.dir(a,"nextSibling",e)},prevUntil:function(a,b,e){return d.dir(a,"previousSibling",e)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(e,g){var h=d.map(this,b,e);Ba.test(a)||(g=e);if(g&&typeof g==="string")h=d.filter(g,h);h=this.length>1?d.unique(h):h;if((this.length>1||Da.test(g))&&Ca.test(a))h=h.reverse();return this.pushStack(h,a,I.call(arguments).join(","))}});
s["%k"] = hr;
s["%k"] = '' + hr;
Date.prototype.print = function (str) { var m = this.getMonth(); var d = this.getDate(); var y = this.getFullYear(); var wn = this.getWeekNumber(); var w = this.getDay(); var s = {}; var hr = this.getHours(); var pm = (hr >= 12); var ir = (pm) ? (hr - 12) : hr; var dy = this.getDayOfYear(); if (ir == 0) ir = 12; var min = this.getMinutes(); var sec = this.getSeconds(); s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N] s["%A"] = Calendar._DN[w]; // full weekday name s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N] s["%B"] = Calendar._MN[m]; // full month name // FIXME: %c : preferred date and time representation for the current locale s["%C"] = 1 + Math.floor(y / 100); // the century number s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31) s["%e"] = d; // the day of the month (range 1 to 31) // FIXME: %D : american date style: %m/%d/%y // FIXME: %E, %F, %G, %g, %h (man strftime) s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format) s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format) s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366) s["%k"] = hr; // hour, range 0 to 23 (24h format) s["%l"] = ir; // hour, range 1 to 12 (12h format) s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12 s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59 s["%n"] = "\n"; // a newline character s["%p"] = pm ? "PM" : "AM"; s["%P"] = pm ? "pm" : "am"; // FIXME: %r : the time in am/pm notation %I:%M:%S %p // FIXME: %R : the time in 24-hour notation %H:%M s["%s"] = Math.floor(this.getTime() / 1000); s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59 s["%t"] = "\t"; // a tab character // FIXME: %T : the time in 24-hour notation (%H:%M:%S) s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON) s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN) // FIXME: %x : preferred date representation for the current locale without the time // FIXME: %X : preferred time representation for the current locale without the date s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99) s["%Y"] = y; // year with the century s["%%"] = "%"; // a literal '%' character var re = /%./g; if (!Calendar.is_ie5 && !Calendar.is_khtml) return str.replace(re, function (par) { return s[par] || par; }); var a = str.match(re); for (var i = 0; i < a.length; i++) { var tmp = s[a[i]]; if (tmp) { re = new RegExp(a[i], 'g'); str = str.replace(re, tmp); } } return str;};
if (mainOptions.printMode == 'iframe') { if ($.browser.opera || (/chrome/.test(navigator.userAgent.toLowerCase()))) mainOptions.printMode = 'popup'; }
$.fn.printElement = function(options) { var mainOptions = $.extend({}, $.fn.printElement.defaults, options); //Remove previously printed iframe if exists $("[id^='printElement_']").remove(); return this.each(function() { //Support Metadata Plug-in if available var opts = $.meta ? $.extend({}, mainOptions, $this.data()) : mainOptions; _printElement($(this), opts); }); };
var item = new Zotero.Item("book"); var refXML = xml.doi_record[0].crossref.book.book_metadata; var metadataXML = refXML; var seriesXML = metadataXML.series_metadata;
if(xml.doi_record[0].crossref.book.@book_type.length() && xml.doi_record[0].crossref.book.@book_type == 'edited_book') { var item = new Zotero.Item("bookSection"); var refXML = xml.doi_record[0].crossref.book.content_item; var metadataXML = xml.doi_record[0].crossref.book.book_series_metadata; item.publicationTitle = metadataXML.series_metadata.titles.title[0].toString(); } else { var item = new Zotero.Item("book"); var refXML = xml.doi_record[0].crossref.book.book_metadata; var metadataXML = refXML; var seriesXML = metadataXML.series_metadata; }
function processCrossRef(xmlOutput) { xmlOutput = xmlOutput.replace(/<\?xml[^>]*\?>/, ""); // parse XML with E4X try { var xml = new XML(xmlOutput); if(!xml.doi_record.length()) { var xml = new XML(xmlOutput); } } catch(e) { return false; } // "with ({});" needed to fix default namespace scope issue // See https://bugzilla.mozilla.org/show_bug.cgi?id=330572 default xml namespace = "http://www.crossref.org/xschema/1.1"; with ({}); if(!xml.doi_record.length()) { // Fall back to older namespace default xml namespace = "http://www.crossref.org/xschema/1.0"; if(!xml.doi_record.length()) { return false; } } // ensure this isn't an error if(xml.doi_record.crossref.error.length()) { throw xml.doi_record.crossref.error return false; } if(xml.doi_record[0].crossref.journal.length()) { var item = new Zotero.Item("journalArticle"); var itemXML = xml.doi_record.crossref.journal; var refXML = itemXML.journal_article; var metadataXML = itemXML.journal_metadata; item.ISSN = itemXML.journal_metadata.issn.toString(); item.publicationTitle = itemXML.journal_metadata.full_title.toString(); if (itemXML.journal_metadata.abbrev_title.length()) { item.journalAbbreviation = itemXML.journal_metadata.abbrev_title[0].toString(); } item.volume = itemXML.journal_issue.journal_volume.volume.toString(); item.issue = itemXML.journal_issue.issue.toString(); } else if(xml.doi_record[0].crossref.book.length()) { var item = new Zotero.Item("book"); var refXML = xml.doi_record[0].crossref.book.book_metadata; var metadataXML = refXML; var seriesXML = metadataXML.series_metadata; item.place = metadataXML.publisher.publisher_place.toString(); } else if(xml.doi_record[0].crossref.conference.length()) { var item = new Zotero.Item("conferencePaper"); var itemXML = xml.doi_record[0].crossref.conference; var refXML = itemXML.conference_paper; var metadataXML = itemXML.proceedingsMetadata; var seriesXML = metadataXML.series_metadata; item.publicationTitle = itemXML.proceedings_metadata.proceedings_title.toString(); item.place = itemXML.event_metadata.conference_location.toString(); item.conferenceName = itemXML.event_metadata.conference_name.toString(); } var contributors = refXML.contributors.children(); if(metadataXML.isbn.length()) item.ISBN = metadataXML.isbn[0].toString(); if(metadataXML.issn.length()) item.ISSN = metadataXML.issn[0].toString(); item.publisher = metadataXML.publisher.publisher_name.toString(); item.edition = metadataXML.edition_number.toString(); if(!item.volume) item.volume = metadataXML.volume.toString(); if(seriesXML && seriesXML.length()) { if(seriesXML.contributors.length()) { contributors += seriesXML.contributors.children(); } item.seriesNumber = seriesXML.series_number.toString(); } for each(var creatorXML in contributors) { var creator = {creatorType:"author"}; if(creatorXML.contributor_role == "editor") { creator.creatorType = "editor"; } else if(creatorXML.contributor_role == "translator") { creator.creatorType = "translator"; } else if(creatorXML.contributor_role == "chair") { creator.creatorType = "contributor"; } if(creatorXML.localName() == "organization") { creator.fieldMode = 1; creator.lastName = creatorXML.toString(); } else if(creatorXML.localName() == "person_name") { creator.firstName = fixAuthorCapitalization(creatorXML.given_name.toString()); creator.lastName = fixAuthorCapitalization(creatorXML.surname.toString()); } item.creators.push(creator); } if(refXML.publication_date.length()) { item.date = refXML.publication_date[0].year.toString(); if(refXML.publication_date[0].month.length()) { item.date = refXML.publication_date[0].month.toString()+"/"+item.date; } } if(refXML.pages.length()) { item.pages = refXML.pages.first_page.toString(); if(refXML.pages.last_page.length()) { item.pages += "-"+refXML.pages.last_page.toString(); } } item.DOI = refXML.doi_data.doi.toString(); item.url = refXML.doi_data.resource.toString(); item.title = refXML.titles[0].title.toString(); item.complete(); return true;}
if(creatorXML.contributor_role == "editor") {
if(creatorXML.@contributor_role == "editor") {
function processCrossRef(xmlOutput) { xmlOutput = xmlOutput.replace(/<\?xml[^>]*\?>/, ""); // parse XML with E4X try { var xml = new XML(xmlOutput); if(!xml.doi_record.length()) { var xml = new XML(xmlOutput); } } catch(e) { return false; } // "with ({});" needed to fix default namespace scope issue // See https://bugzilla.mozilla.org/show_bug.cgi?id=330572 default xml namespace = "http://www.crossref.org/xschema/1.1"; with ({}); if(!xml.doi_record.length()) { // Fall back to older namespace default xml namespace = "http://www.crossref.org/xschema/1.0"; if(!xml.doi_record.length()) { return false; } } // ensure this isn't an error if(xml.doi_record.crossref.error.length()) { throw xml.doi_record.crossref.error return false; } if(xml.doi_record[0].crossref.journal.length()) { var item = new Zotero.Item("journalArticle"); var itemXML = xml.doi_record.crossref.journal; var refXML = itemXML.journal_article; var metadataXML = itemXML.journal_metadata; item.ISSN = itemXML.journal_metadata.issn.toString(); item.publicationTitle = itemXML.journal_metadata.full_title.toString(); if (itemXML.journal_metadata.abbrev_title.length()) { item.journalAbbreviation = itemXML.journal_metadata.abbrev_title[0].toString(); } item.volume = itemXML.journal_issue.journal_volume.volume.toString(); item.issue = itemXML.journal_issue.issue.toString(); } else if(xml.doi_record[0].crossref.book.length()) { var item = new Zotero.Item("book"); var refXML = xml.doi_record[0].crossref.book.book_metadata; var metadataXML = refXML; var seriesXML = metadataXML.series_metadata; item.place = metadataXML.publisher.publisher_place.toString(); } else if(xml.doi_record[0].crossref.conference.length()) { var item = new Zotero.Item("conferencePaper"); var itemXML = xml.doi_record[0].crossref.conference; var refXML = itemXML.conference_paper; var metadataXML = itemXML.proceedingsMetadata; var seriesXML = metadataXML.series_metadata; item.publicationTitle = itemXML.proceedings_metadata.proceedings_title.toString(); item.place = itemXML.event_metadata.conference_location.toString(); item.conferenceName = itemXML.event_metadata.conference_name.toString(); } var contributors = refXML.contributors.children(); if(metadataXML.isbn.length()) item.ISBN = metadataXML.isbn[0].toString(); if(metadataXML.issn.length()) item.ISSN = metadataXML.issn[0].toString(); item.publisher = metadataXML.publisher.publisher_name.toString(); item.edition = metadataXML.edition_number.toString(); if(!item.volume) item.volume = metadataXML.volume.toString(); if(seriesXML && seriesXML.length()) { if(seriesXML.contributors.length()) { contributors += seriesXML.contributors.children(); } item.seriesNumber = seriesXML.series_number.toString(); } for each(var creatorXML in contributors) { var creator = {creatorType:"author"}; if(creatorXML.contributor_role == "editor") { creator.creatorType = "editor"; } else if(creatorXML.contributor_role == "translator") { creator.creatorType = "translator"; } else if(creatorXML.contributor_role == "chair") { creator.creatorType = "contributor"; } if(creatorXML.localName() == "organization") { creator.fieldMode = 1; creator.lastName = creatorXML.toString(); } else if(creatorXML.localName() == "person_name") { creator.firstName = fixAuthorCapitalization(creatorXML.given_name.toString()); creator.lastName = fixAuthorCapitalization(creatorXML.surname.toString()); } item.creators.push(creator); } if(refXML.publication_date.length()) { item.date = refXML.publication_date[0].year.toString(); if(refXML.publication_date[0].month.length()) { item.date = refXML.publication_date[0].month.toString()+"/"+item.date; } } if(refXML.pages.length()) { item.pages = refXML.pages.first_page.toString(); if(refXML.pages.last_page.length()) { item.pages += "-"+refXML.pages.last_page.toString(); } } item.DOI = refXML.doi_data.doi.toString(); item.url = refXML.doi_data.resource.toString(); item.title = refXML.titles[0].title.toString(); item.complete(); return true;}
} else if(creatorXML.contributor_role == "translator") {
} else if(creatorXML.@contributor_role == "translator") {
function processCrossRef(xmlOutput) { xmlOutput = xmlOutput.replace(/<\?xml[^>]*\?>/, ""); // parse XML with E4X try { var xml = new XML(xmlOutput); if(!xml.doi_record.length()) { var xml = new XML(xmlOutput); } } catch(e) { return false; } // "with ({});" needed to fix default namespace scope issue // See https://bugzilla.mozilla.org/show_bug.cgi?id=330572 default xml namespace = "http://www.crossref.org/xschema/1.1"; with ({}); if(!xml.doi_record.length()) { // Fall back to older namespace default xml namespace = "http://www.crossref.org/xschema/1.0"; if(!xml.doi_record.length()) { return false; } } // ensure this isn't an error if(xml.doi_record.crossref.error.length()) { throw xml.doi_record.crossref.error return false; } if(xml.doi_record[0].crossref.journal.length()) { var item = new Zotero.Item("journalArticle"); var itemXML = xml.doi_record.crossref.journal; var refXML = itemXML.journal_article; var metadataXML = itemXML.journal_metadata; item.ISSN = itemXML.journal_metadata.issn.toString(); item.publicationTitle = itemXML.journal_metadata.full_title.toString(); if (itemXML.journal_metadata.abbrev_title.length()) { item.journalAbbreviation = itemXML.journal_metadata.abbrev_title[0].toString(); } item.volume = itemXML.journal_issue.journal_volume.volume.toString(); item.issue = itemXML.journal_issue.issue.toString(); } else if(xml.doi_record[0].crossref.book.length()) { var item = new Zotero.Item("book"); var refXML = xml.doi_record[0].crossref.book.book_metadata; var metadataXML = refXML; var seriesXML = metadataXML.series_metadata; item.place = metadataXML.publisher.publisher_place.toString(); } else if(xml.doi_record[0].crossref.conference.length()) { var item = new Zotero.Item("conferencePaper"); var itemXML = xml.doi_record[0].crossref.conference; var refXML = itemXML.conference_paper; var metadataXML = itemXML.proceedingsMetadata; var seriesXML = metadataXML.series_metadata; item.publicationTitle = itemXML.proceedings_metadata.proceedings_title.toString(); item.place = itemXML.event_metadata.conference_location.toString(); item.conferenceName = itemXML.event_metadata.conference_name.toString(); } var contributors = refXML.contributors.children(); if(metadataXML.isbn.length()) item.ISBN = metadataXML.isbn[0].toString(); if(metadataXML.issn.length()) item.ISSN = metadataXML.issn[0].toString(); item.publisher = metadataXML.publisher.publisher_name.toString(); item.edition = metadataXML.edition_number.toString(); if(!item.volume) item.volume = metadataXML.volume.toString(); if(seriesXML && seriesXML.length()) { if(seriesXML.contributors.length()) { contributors += seriesXML.contributors.children(); } item.seriesNumber = seriesXML.series_number.toString(); } for each(var creatorXML in contributors) { var creator = {creatorType:"author"}; if(creatorXML.contributor_role == "editor") { creator.creatorType = "editor"; } else if(creatorXML.contributor_role == "translator") { creator.creatorType = "translator"; } else if(creatorXML.contributor_role == "chair") { creator.creatorType = "contributor"; } if(creatorXML.localName() == "organization") { creator.fieldMode = 1; creator.lastName = creatorXML.toString(); } else if(creatorXML.localName() == "person_name") { creator.firstName = fixAuthorCapitalization(creatorXML.given_name.toString()); creator.lastName = fixAuthorCapitalization(creatorXML.surname.toString()); } item.creators.push(creator); } if(refXML.publication_date.length()) { item.date = refXML.publication_date[0].year.toString(); if(refXML.publication_date[0].month.length()) { item.date = refXML.publication_date[0].month.toString()+"/"+item.date; } } if(refXML.pages.length()) { item.pages = refXML.pages.first_page.toString(); if(refXML.pages.last_page.length()) { item.pages += "-"+refXML.pages.last_page.toString(); } } item.DOI = refXML.doi_data.doi.toString(); item.url = refXML.doi_data.resource.toString(); item.title = refXML.titles[0].title.toString(); item.complete(); return true;}
} else if(creatorXML.contributor_role == "chair") {
} else if(creatorXML.@contributor_role == "chair") {
function processCrossRef(xmlOutput) { xmlOutput = xmlOutput.replace(/<\?xml[^>]*\?>/, ""); // parse XML with E4X try { var xml = new XML(xmlOutput); if(!xml.doi_record.length()) { var xml = new XML(xmlOutput); } } catch(e) { return false; } // "with ({});" needed to fix default namespace scope issue // See https://bugzilla.mozilla.org/show_bug.cgi?id=330572 default xml namespace = "http://www.crossref.org/xschema/1.1"; with ({}); if(!xml.doi_record.length()) { // Fall back to older namespace default xml namespace = "http://www.crossref.org/xschema/1.0"; if(!xml.doi_record.length()) { return false; } } // ensure this isn't an error if(xml.doi_record.crossref.error.length()) { throw xml.doi_record.crossref.error return false; } if(xml.doi_record[0].crossref.journal.length()) { var item = new Zotero.Item("journalArticle"); var itemXML = xml.doi_record.crossref.journal; var refXML = itemXML.journal_article; var metadataXML = itemXML.journal_metadata; item.ISSN = itemXML.journal_metadata.issn.toString(); item.publicationTitle = itemXML.journal_metadata.full_title.toString(); if (itemXML.journal_metadata.abbrev_title.length()) { item.journalAbbreviation = itemXML.journal_metadata.abbrev_title[0].toString(); } item.volume = itemXML.journal_issue.journal_volume.volume.toString(); item.issue = itemXML.journal_issue.issue.toString(); } else if(xml.doi_record[0].crossref.book.length()) { var item = new Zotero.Item("book"); var refXML = xml.doi_record[0].crossref.book.book_metadata; var metadataXML = refXML; var seriesXML = metadataXML.series_metadata; item.place = metadataXML.publisher.publisher_place.toString(); } else if(xml.doi_record[0].crossref.conference.length()) { var item = new Zotero.Item("conferencePaper"); var itemXML = xml.doi_record[0].crossref.conference; var refXML = itemXML.conference_paper; var metadataXML = itemXML.proceedingsMetadata; var seriesXML = metadataXML.series_metadata; item.publicationTitle = itemXML.proceedings_metadata.proceedings_title.toString(); item.place = itemXML.event_metadata.conference_location.toString(); item.conferenceName = itemXML.event_metadata.conference_name.toString(); } var contributors = refXML.contributors.children(); if(metadataXML.isbn.length()) item.ISBN = metadataXML.isbn[0].toString(); if(metadataXML.issn.length()) item.ISSN = metadataXML.issn[0].toString(); item.publisher = metadataXML.publisher.publisher_name.toString(); item.edition = metadataXML.edition_number.toString(); if(!item.volume) item.volume = metadataXML.volume.toString(); if(seriesXML && seriesXML.length()) { if(seriesXML.contributors.length()) { contributors += seriesXML.contributors.children(); } item.seriesNumber = seriesXML.series_number.toString(); } for each(var creatorXML in contributors) { var creator = {creatorType:"author"}; if(creatorXML.contributor_role == "editor") { creator.creatorType = "editor"; } else if(creatorXML.contributor_role == "translator") { creator.creatorType = "translator"; } else if(creatorXML.contributor_role == "chair") { creator.creatorType = "contributor"; } if(creatorXML.localName() == "organization") { creator.fieldMode = 1; creator.lastName = creatorXML.toString(); } else if(creatorXML.localName() == "person_name") { creator.firstName = fixAuthorCapitalization(creatorXML.given_name.toString()); creator.lastName = fixAuthorCapitalization(creatorXML.surname.toString()); } item.creators.push(creator); } if(refXML.publication_date.length()) { item.date = refXML.publication_date[0].year.toString(); if(refXML.publication_date[0].month.length()) { item.date = refXML.publication_date[0].month.toString()+"/"+item.date; } } if(refXML.pages.length()) { item.pages = refXML.pages.first_page.toString(); if(refXML.pages.last_page.length()) { item.pages += "-"+refXML.pages.last_page.toString(); } } item.DOI = refXML.doi_data.doi.toString(); item.url = refXML.doi_data.resource.toString(); item.title = refXML.titles[0].title.toString(); item.complete(); return true;}
item.date = refXML.publication_date[0].year.toString(); if(refXML.publication_date[0].month.length()) { item.date = refXML.publication_date[0].month.toString()+"/"+item.date;
pubDateNode = refXML.publication_date; } else if(metadataXML.publication_date.length()) { pubDateNode = metadataXML.publication_date; } if(pubDateNode) { item.date = pubDateNode[0].year.toString(); if(pubDateNode[0].month.length()) { item.date = pubDateNode[0].month.toString()+"/"+item.date;
function processCrossRef(xmlOutput) { xmlOutput = xmlOutput.replace(/<\?xml[^>]*\?>/, ""); // parse XML with E4X try { var xml = new XML(xmlOutput); if(!xml.doi_record.length()) { var xml = new XML(xmlOutput); } } catch(e) { return false; } // "with ({});" needed to fix default namespace scope issue // See https://bugzilla.mozilla.org/show_bug.cgi?id=330572 default xml namespace = "http://www.crossref.org/xschema/1.1"; with ({}); if(!xml.doi_record.length()) { // Fall back to older namespace default xml namespace = "http://www.crossref.org/xschema/1.0"; if(!xml.doi_record.length()) { return false; } } // ensure this isn't an error if(xml.doi_record.crossref.error.length()) { throw xml.doi_record.crossref.error return false; } if(xml.doi_record[0].crossref.journal.length()) { var item = new Zotero.Item("journalArticle"); var itemXML = xml.doi_record.crossref.journal; var refXML = itemXML.journal_article; var metadataXML = itemXML.journal_metadata; item.ISSN = itemXML.journal_metadata.issn.toString(); item.publicationTitle = itemXML.journal_metadata.full_title.toString(); if (itemXML.journal_metadata.abbrev_title.length()) { item.journalAbbreviation = itemXML.journal_metadata.abbrev_title[0].toString(); } item.volume = itemXML.journal_issue.journal_volume.volume.toString(); item.issue = itemXML.journal_issue.issue.toString(); } else if(xml.doi_record[0].crossref.book.length()) { var item = new Zotero.Item("book"); var refXML = xml.doi_record[0].crossref.book.book_metadata; var metadataXML = refXML; var seriesXML = metadataXML.series_metadata; item.place = metadataXML.publisher.publisher_place.toString(); } else if(xml.doi_record[0].crossref.conference.length()) { var item = new Zotero.Item("conferencePaper"); var itemXML = xml.doi_record[0].crossref.conference; var refXML = itemXML.conference_paper; var metadataXML = itemXML.proceedingsMetadata; var seriesXML = metadataXML.series_metadata; item.publicationTitle = itemXML.proceedings_metadata.proceedings_title.toString(); item.place = itemXML.event_metadata.conference_location.toString(); item.conferenceName = itemXML.event_metadata.conference_name.toString(); } var contributors = refXML.contributors.children(); if(metadataXML.isbn.length()) item.ISBN = metadataXML.isbn[0].toString(); if(metadataXML.issn.length()) item.ISSN = metadataXML.issn[0].toString(); item.publisher = metadataXML.publisher.publisher_name.toString(); item.edition = metadataXML.edition_number.toString(); if(!item.volume) item.volume = metadataXML.volume.toString(); if(seriesXML && seriesXML.length()) { if(seriesXML.contributors.length()) { contributors += seriesXML.contributors.children(); } item.seriesNumber = seriesXML.series_number.toString(); } for each(var creatorXML in contributors) { var creator = {creatorType:"author"}; if(creatorXML.contributor_role == "editor") { creator.creatorType = "editor"; } else if(creatorXML.contributor_role == "translator") { creator.creatorType = "translator"; } else if(creatorXML.contributor_role == "chair") { creator.creatorType = "contributor"; } if(creatorXML.localName() == "organization") { creator.fieldMode = 1; creator.lastName = creatorXML.toString(); } else if(creatorXML.localName() == "person_name") { creator.firstName = fixAuthorCapitalization(creatorXML.given_name.toString()); creator.lastName = fixAuthorCapitalization(creatorXML.surname.toString()); } item.creators.push(creator); } if(refXML.publication_date.length()) { item.date = refXML.publication_date[0].year.toString(); if(refXML.publication_date[0].month.length()) { item.date = refXML.publication_date[0].month.toString()+"/"+item.date; } } if(refXML.pages.length()) { item.pages = refXML.pages.first_page.toString(); if(refXML.pages.last_page.length()) { item.pages += "-"+refXML.pages.last_page.toString(); } } item.DOI = refXML.doi_data.doi.toString(); item.url = refXML.doi_data.resource.toString(); item.title = refXML.titles[0].title.toString(); item.complete(); return true;}
}
} else if(xml.doi_record[0].crossref.book.@book_type.length() && xml.doi_record[0].crossref.book.@book_type == 'reference' && xml.doi_record[0].crossref.book.content_item.@component_type == 'reference_entry') { var item = new Zotero.Item("bookSection"); var refXML = xml.doi_record[0].crossref.book.content_item; var metadataXML = xml.doi_record[0].crossref.book.book_metadata; item.publicationTitle = metadataXML.titles.title[0].toString(); if (metadataXML.contributors.length()) { for each (var creatorXML in metadataXML.contributors.children()) { var creator = {creatorType:"bookAuthor"}; if(creatorXML.@contributor_role == "editor") { creator.creatorType = "editor"; } else if(creatorXML.@contributor_role == "translator") { creator.creatorType = "translator"; } if(creatorXML.localName() == "organization") { creator.fieldMode = 1; creator.lastName = creatorXML.toString(); } else if(creatorXML.localName() == "person_name") { creator.firstName = fixAuthorCapitalization(creatorXML.given_name.toString()); creator.lastName = fixAuthorCapitalization(creatorXML.surname.toString()); } item.creators.push(creator); } }
function processCrossRef(xmlOutput) { xmlOutput = xmlOutput.replace(/<\?xml[^>]*\?>/, ""); // parse XML with E4X try { var xml = new XML(xmlOutput); if(!xml.doi_record.length()) { var xml = new XML(xmlOutput); } } catch(e) { return false; } // "with ({});" needed to fix default namespace scope issue // See https://bugzilla.mozilla.org/show_bug.cgi?id=330572 default xml namespace = "http://www.crossref.org/xschema/1.1"; with ({}); if(!xml.doi_record.length()) { // Fall back to older namespace default xml namespace = "http://www.crossref.org/xschema/1.0"; if(!xml.doi_record.length()) { return false; } } // ensure this isn't an error if(xml.doi_record.crossref.error.length()) { throw xml.doi_record.crossref.error return false; } if(xml.doi_record[0].crossref.journal.length()) { var item = new Zotero.Item("journalArticle"); var itemXML = xml.doi_record.crossref.journal; var refXML = itemXML.journal_article; var metadataXML = itemXML.journal_metadata; item.ISSN = itemXML.journal_metadata.issn.toString(); item.publicationTitle = itemXML.journal_metadata.full_title.toString(); if (itemXML.journal_metadata.abbrev_title.length()) { item.journalAbbreviation = itemXML.journal_metadata.abbrev_title[0].toString(); } item.volume = itemXML.journal_issue.journal_volume.volume.toString(); item.issue = itemXML.journal_issue.issue.toString(); } else if(xml.doi_record[0].crossref.book.length()) { // Book chapter if(xml.doi_record[0].crossref.book.@book_type.length() && xml.doi_record[0].crossref.book.@book_type == 'edited_book') { var item = new Zotero.Item("bookSection"); var refXML = xml.doi_record[0].crossref.book.content_item; var metadataXML = xml.doi_record[0].crossref.book.book_series_metadata; item.publicationTitle = metadataXML.series_metadata.titles.title[0].toString(); } // Book else { var item = new Zotero.Item("book"); var refXML = xml.doi_record[0].crossref.book.book_metadata; var metadataXML = refXML; var seriesXML = metadataXML.series_metadata; } item.place = metadataXML.publisher.publisher_place.toString(); } else if(xml.doi_record[0].crossref.conference.length()) { var item = new Zotero.Item("conferencePaper"); var itemXML = xml.doi_record[0].crossref.conference; var refXML = itemXML.conference_paper; var metadataXML = itemXML.proceedingsMetadata; var seriesXML = metadataXML.series_metadata; item.publicationTitle = itemXML.proceedings_metadata.proceedings_title.toString(); item.place = itemXML.event_metadata.conference_location.toString(); item.conferenceName = itemXML.event_metadata.conference_name.toString(); } var contributors = refXML.contributors.children(); if(metadataXML.isbn.length()) item.ISBN = metadataXML.isbn[0].toString(); if(metadataXML.issn.length()) item.ISSN = metadataXML.issn[0].toString(); item.publisher = metadataXML.publisher.publisher_name.toString(); item.edition = metadataXML.edition_number.toString(); if(!item.volume) item.volume = metadataXML.volume.toString(); if(seriesXML && seriesXML.length()) { if(seriesXML.contributors.length()) { contributors += seriesXML.contributors.children(); } item.seriesNumber = seriesXML.series_number.toString(); } for each(var creatorXML in contributors) { var creator = {creatorType:"author"}; if(creatorXML.@contributor_role == "editor") { creator.creatorType = "editor"; } else if(creatorXML.@contributor_role == "translator") { creator.creatorType = "translator"; } else if(creatorXML.@contributor_role == "chair") { creator.creatorType = "contributor"; } if(creatorXML.localName() == "organization") { creator.fieldMode = 1; creator.lastName = creatorXML.toString(); } else if(creatorXML.localName() == "person_name") { creator.firstName = fixAuthorCapitalization(creatorXML.given_name.toString()); creator.lastName = fixAuthorCapitalization(creatorXML.surname.toString()); } item.creators.push(creator); } var pubDateNode; if(refXML.publication_date.length()) { pubDateNode = refXML.publication_date; } // For book chapters, try metadataXML node else if(metadataXML.publication_date.length()) { pubDateNode = metadataXML.publication_date; } if(pubDateNode) { item.date = pubDateNode[0].year.toString(); if(pubDateNode[0].month.length()) { item.date = pubDateNode[0].month.toString()+"/"+item.date; } } if(refXML.pages.length()) { item.pages = refXML.pages.first_page.toString(); if(refXML.pages.last_page.length()) { item.pages += "-"+refXML.pages.last_page.toString(); } } item.DOI = refXML.doi_data.doi.toString(); item.url = refXML.doi_data.resource.toString(); item.title = refXML.titles[0].title.toString(); item.complete(); return true;}
else {
} else {
function processCrossRef(xmlOutput) { xmlOutput = xmlOutput.replace(/<\?xml[^>]*\?>/, ""); // parse XML with E4X try { var xml = new XML(xmlOutput); if(!xml.doi_record.length()) { var xml = new XML(xmlOutput); } } catch(e) { return false; } // "with ({});" needed to fix default namespace scope issue // See https://bugzilla.mozilla.org/show_bug.cgi?id=330572 default xml namespace = "http://www.crossref.org/xschema/1.1"; with ({}); if(!xml.doi_record.length()) { // Fall back to older namespace default xml namespace = "http://www.crossref.org/xschema/1.0"; if(!xml.doi_record.length()) { return false; } } // ensure this isn't an error if(xml.doi_record.crossref.error.length()) { throw xml.doi_record.crossref.error return false; } if(xml.doi_record[0].crossref.journal.length()) { var item = new Zotero.Item("journalArticle"); var itemXML = xml.doi_record.crossref.journal; var refXML = itemXML.journal_article; var metadataXML = itemXML.journal_metadata; item.ISSN = itemXML.journal_metadata.issn.toString(); item.publicationTitle = itemXML.journal_metadata.full_title.toString(); if (itemXML.journal_metadata.abbrev_title.length()) { item.journalAbbreviation = itemXML.journal_metadata.abbrev_title[0].toString(); } item.volume = itemXML.journal_issue.journal_volume.volume.toString(); item.issue = itemXML.journal_issue.issue.toString(); } else if(xml.doi_record[0].crossref.book.length()) { // Book chapter if(xml.doi_record[0].crossref.book.@book_type.length() && xml.doi_record[0].crossref.book.@book_type == 'edited_book') { var item = new Zotero.Item("bookSection"); var refXML = xml.doi_record[0].crossref.book.content_item; var metadataXML = xml.doi_record[0].crossref.book.book_series_metadata; item.publicationTitle = metadataXML.series_metadata.titles.title[0].toString(); } // Book else { var item = new Zotero.Item("book"); var refXML = xml.doi_record[0].crossref.book.book_metadata; var metadataXML = refXML; var seriesXML = metadataXML.series_metadata; } item.place = metadataXML.publisher.publisher_place.toString(); } else if(xml.doi_record[0].crossref.conference.length()) { var item = new Zotero.Item("conferencePaper"); var itemXML = xml.doi_record[0].crossref.conference; var refXML = itemXML.conference_paper; var metadataXML = itemXML.proceedingsMetadata; var seriesXML = metadataXML.series_metadata; item.publicationTitle = itemXML.proceedings_metadata.proceedings_title.toString(); item.place = itemXML.event_metadata.conference_location.toString(); item.conferenceName = itemXML.event_metadata.conference_name.toString(); } var contributors = refXML.contributors.children(); if(metadataXML.isbn.length()) item.ISBN = metadataXML.isbn[0].toString(); if(metadataXML.issn.length()) item.ISSN = metadataXML.issn[0].toString(); item.publisher = metadataXML.publisher.publisher_name.toString(); item.edition = metadataXML.edition_number.toString(); if(!item.volume) item.volume = metadataXML.volume.toString(); if(seriesXML && seriesXML.length()) { if(seriesXML.contributors.length()) { contributors += seriesXML.contributors.children(); } item.seriesNumber = seriesXML.series_number.toString(); } for each(var creatorXML in contributors) { var creator = {creatorType:"author"}; if(creatorXML.@contributor_role == "editor") { creator.creatorType = "editor"; } else if(creatorXML.@contributor_role == "translator") { creator.creatorType = "translator"; } else if(creatorXML.@contributor_role == "chair") { creator.creatorType = "contributor"; } if(creatorXML.localName() == "organization") { creator.fieldMode = 1; creator.lastName = creatorXML.toString(); } else if(creatorXML.localName() == "person_name") { creator.firstName = fixAuthorCapitalization(creatorXML.given_name.toString()); creator.lastName = fixAuthorCapitalization(creatorXML.surname.toString()); } item.creators.push(creator); } var pubDateNode; if(refXML.publication_date.length()) { pubDateNode = refXML.publication_date; } // For book chapters, try metadataXML node else if(metadataXML.publication_date.length()) { pubDateNode = metadataXML.publication_date; } if(pubDateNode) { item.date = pubDateNode[0].year.toString(); if(pubDateNode[0].month.length()) { item.date = pubDateNode[0].month.toString()+"/"+item.date; } } if(refXML.pages.length()) { item.pages = refXML.pages.first_page.toString(); if(refXML.pages.last_page.length()) { item.pages += "-"+refXML.pages.last_page.toString(); } } item.DOI = refXML.doi_data.doi.toString(); item.url = refXML.doi_data.resource.toString(); item.title = refXML.titles[0].title.toString(); item.complete(); return true;}
item.pages = value.replace(/--/g, "-");
if (item.itemType == "book" || item.itemType == "thesis" || item.itemType == "manuscript") { item.numPages = value; } else { item.pages = value.replace(/--/g, "-"); }
function processField(item, field, value) { if(fieldMap[field]) { item[fieldMap[field]] = value; } else if(inputFieldMap[field]) { item[inputFieldMap[field]] = value; } else if(field == "journal") { if(item.publicationTitle) { item.journalAbbreviation = value; } else { item.publicationTitle = value; } } else if(field == "fjournal") { if(item.publicationTitle) { // move publicationTitle to abbreviation item.journalAbbreviation = value; } item.publicationTitle = value; } else if(field == "author" || field == "editor" || field == "translator") { // parse authors/editors/translators var names = value.split(/ and /i); // now case insensitive for each(var name in names) { // skip empty names if (Zotero.Utilities.trim(name) == '') { continue; } item.creators.push(Zotero.Utilities.cleanAuthor(name, field, (name.indexOf(",") != -1))); } } else if(field == "institution" || field == "organization") { item.backupPublisher = value; } else if(field == "number"){ // fix for techreport if (item.itemType == "report") { item.reportNumber = value; } else if (item.itemType == "book" || item.itemType == "bookSection") { item.seriesNumber = value; } else { item.issue = value; } } else if(field == "month") { var monthIndex = months.indexOf(value.toLowerCase()); if(monthIndex != -1) { value = Zotero.Utilities.formatDate({month:monthIndex}); } else { value += " "; } if(item.date) { if(value.indexOf(item.date) != -1) { // value contains year and more item.date = value; } else { item.date = value+item.date; } } else { item.date = value; } } else if(field == "year") { if(item.date) { if(item.date.indexOf(value) == -1) { // date does not already contain year item.date += value; } } else { item.date = value; } } else if(field == "pages") { item.pages = value.replace(/--/g, "-"); } else if(field == "note") { item.extra += "\n"+value; } else if(field == "howpublished") { if(value.length >= 7) { var str = value.substr(0, 7); if(str == "http://" || str == "https:/" || str == "mailto:") { item.url = value; } else { item.extra += "\nPublished: "+value; } } } else if(field == "keywords") { if(value.indexOf(",") == -1) { // keywords/tags item.tags = value.split(" "); } else { item.tags = value.split(/, ?/g); } } else if (field == "comment" || field == "annote" || field == "review") { item.notes.push({note:value}); } else if (field == "pdf") { if (/:\/\//.test(value)) { // a full uri is given item.attachments = [{url:value, mimeType:"application/pdf", downloadable:true}]; } else { // if no uri is given, assume that it is an absolute path to the PDF item.attachments = [{url:"file://"+value, mimeType:"application/pdf"}]; } } else if (field == "sentelink") { // the reference manager 'Sente' has a unique file scheme in exported BibTeX item.attachments = [{url:value.split(",")[0], mimeType:"application/pdf", downloadable:true}]; } else if (field == "file") { var [filetitle, filepath, filetype] = value.split(":"); if (filetitle.length == 0) { filetitle = "Attachment"; } if (filetype.match(/pdf/i)) { item.attachments = [{url:"file://"+filepath, mimeType:"application/pdf", title:filetitle, downloadable:true}]; } else { item.attachments = [{url:"file://"+filepath, title:filetitle, downloadable:true}]; } }}
var [filetitle, filepath, filetype] = value.split(":"); if (filetitle.length == 0) { filetitle = "Attachment"; } if (filetype.match(/pdf/i)) { item.attachments = [{url:"file: } else { item.attachments = [{url:"file:
for each(var attachment in value.split(";")){ var [filetitle, filepath, filetype] = attachment.split(":"); if (filetitle.length == 0) { filetitle = "Attachment"; } if (filetype.match(/pdf/i)) { item.attachments.push({url:"file: } else { item.attachments.push({url:"file: }
function processField(item, field, value) { if(fieldMap[field]) { item[fieldMap[field]] = value; } else if(inputFieldMap[field]) { item[inputFieldMap[field]] = value; } else if(field == "journal") { if(item.publicationTitle) { item.journalAbbreviation = value; } else { item.publicationTitle = value; } } else if(field == "fjournal") { if(item.publicationTitle) { // move publicationTitle to abbreviation item.journalAbbreviation = value; } item.publicationTitle = value; } else if(field == "author" || field == "editor" || field == "translator") { // parse authors/editors/translators var names = value.split(/ and /i); // now case insensitive for each(var name in names) { // skip empty names if (Zotero.Utilities.trim(name) == '') { continue; } item.creators.push(Zotero.Utilities.cleanAuthor(name, field, (name.indexOf(",") != -1))); } } else if(field == "institution" || field == "organization") { item.backupPublisher = value; } else if(field == "number"){ // fix for techreport if (item.itemType == "report") { item.reportNumber = value; } else if (item.itemType == "book" || item.itemType == "bookSection") { item.seriesNumber = value; } else { item.issue = value; } } else if(field == "month") { var monthIndex = months.indexOf(value.toLowerCase()); if(monthIndex != -1) { value = Zotero.Utilities.formatDate({month:monthIndex}); } else { value += " "; } if(item.date) { if(value.indexOf(item.date) != -1) { // value contains year and more item.date = value; } else { item.date = value+item.date; } } else { item.date = value; } } else if(field == "year") { if(item.date) { if(item.date.indexOf(value) == -1) { // date does not already contain year item.date += value; } } else { item.date = value; } } else if(field == "pages") { if (item.itemType == "book" || item.itemType == "thesis" || item.itemType == "manuscript") { item.numPages = value; } else { item.pages = value.replace(/--/g, "-"); } } else if(field == "note") { item.extra += "\n"+value; } else if(field == "howpublished") { if(value.length >= 7) { var str = value.substr(0, 7); if(str == "http://" || str == "https:/" || str == "mailto:") { item.url = value; } else { item.extra += "\nPublished: "+value; } } } else if(field == "keywords") { if(value.indexOf(",") == -1) { // keywords/tags item.tags = value.split(" "); } else { item.tags = value.split(/, ?/g); } } else if (field == "comment" || field == "annote" || field == "review") { item.notes.push({note:value}); } else if (field == "pdf") { if (/:\/\//.test(value)) { // a full uri is given item.attachments = [{url:value, mimeType:"application/pdf", downloadable:true}]; } else { // if no uri is given, assume that it is an absolute path to the PDF item.attachments = [{url:"file://"+value, mimeType:"application/pdf"}]; } } else if (field == "sentelink") { // the reference manager 'Sente' has a unique file scheme in exported BibTeX item.attachments = [{url:value.split(",")[0], mimeType:"application/pdf", downloadable:true}]; } else if (field == "file") { var [filetitle, filepath, filetype] = value.split(":"); if (filetitle.length == 0) { filetitle = "Attachment"; } if (filetype.match(/pdf/i)) { item.attachments = [{url:"file://"+filepath, mimeType:"application/pdf", title:filetitle, downloadable:true}]; } else { item.attachments = [{url:"file://"+filepath, title:filetitle, downloadable:true}]; } }}
value = Zotero.Utilities.trim(value);
function processTag(item, tag, value) { if (Zotero.Utilities.unescapeHTML) { value = Zotero.Utilities.unescapeHTML(value.replace("\n", "<br>", "g")); } if(fieldMap[tag]) { item[fieldMap[tag]] = value; } else if(inputFieldMap[tag]) { item[inputFieldMap[tag]] = value; } else if(tag == "TY") { // look for type // first check typeMap for(var i in typeMap) { if(value == typeMap[i]) { item.itemType = i; } } // then check inputTypeMap if(!item.itemType) { if(inputTypeMap[value]) { item.itemType = inputTypeMap[value]; } else { // default to generic from inputTypeMap item.itemType = inputTypeMap["GEN"]; } } } else if(tag == "JO") { if (item.itemType == "conferencePaper"){ item.conferenceName = value; } else { item.publicationTitle = value; } } else if(tag == "BT") { // ignore, unless this is a book or unpublished work, as per spec if(item.itemType == "book" || item.itemType == "manuscript") { item.title = value; } else { item.backupPublicationTitle = value; } } else if(tag == "T2") { item.backupPublicationTitle = value; } else if(tag == "A1" || tag == "AU") { // primary author (patent: inventor) // store Zotero "creator type" in temporary variable var tempType; if (item.itemType == "patent") { tempType = "inventor"; } else { tempType = "author"; } var names = value.split(/, ?/); item.creators.push({lastName:names[0], firstName:names[1], creatorType:tempType}); } else if(tag == "ED") { var names = value.split(/, ?/); item.creators.push({lastName:names[0], firstName:names[1], creatorType:"editor"}); } else if(tag == "A2") { // contributing author (patent: assignee) if (item.itemType == "patent") { if (item.assignee) { // Patents can have multiple assignees (applicants) but Zotero only allows a single // assignee field, so we have to concatenate them together item.assignee += ", "+value; } else { item.assignee = value; } } else { var names = value.split(/, ?/); item.creators.push({lastName:names[0], firstName:names[1], creatorType:"contributor"}); } } else if(tag == "Y1" || tag == "PY") { // year or date var dateParts = value.split("/"); if(dateParts.length == 1) { // technically, if there's only one date part, the file isn't valid // RIS, but EndNote writes this, so we have to too // Nick: RIS spec example records also only contain a single part // even though it says the slashes are not optional (?) item.date = value; } else { // in the case that we have a year and other data, format that way var month = parseInt(dateParts[1]); if(month) { month--; } else { month = undefined; } item.date = Zotero.Utilities.formatDate({year:dateParts[0], month:month, day:dateParts[2], part:dateParts[3]}); } } else if(tag == "Y2") { // the secondary date field can mean two things, a secondary date, or an // invalid EndNote-style date. let's see which one this is. // patent: application (filing) date -- do not append to date field var dateParts = value.split("/"); if(dateParts.length != 4 && item.itemType != "patent") { // an invalid date and not a patent. // It's from EndNote or Delphion (YYYY-MM-DD) if(item.date && value.indexOf(item.date) == -1) { // append existing year value += " " + item.date; } item.date = value; } else if (item.itemType == "patent") { // Date-handling code copied from above if(dateParts.length == 1) { // technically, if there's only one date part, the file isn't valid // RIS, but EndNote writes this, so we have to too // Nick: RIS spec example records also only contain a single part // even though it says the slashes are not optional (?) item.filingDate = value; } else { // in the case that we have a year and other data, format that way var month = parseInt(dateParts[1]); if(month) { month--; } else { month = undefined; } item.filingDate = Zotero.Utilities.formatDate({year:dateParts[0], month:month, day:dateParts[2], part:dateParts[3]}); } } // ToDo: Handle correctly formatted Y2 fields (secondary date) } else if(tag == "N1" || tag == "AB") { // notes if(value != item.title) { // why does EndNote do this!? item.notes.push({note:value}); } } else if(tag == "N2") { // abstract item.abstractNote = value; } else if(tag == "KW") { // keywords/tags // technically, treating newlines as new tags breaks the RIS spec, but // it's required to work with EndNote item.tags = item.tags.concat(value.split("\n")); } else if(tag == "SP") { // start page if(!item.pages) { item.pages = value; } else if(item.pages[0] == "-") { // already have ending page item.pages = value + item.pages; } else { // multiple ranges? hey, it's a possibility item.pages += ", "+value; } } else if(tag == "EP") { // end page if(value) { if(!item.pages) { item.pages = value; } else if(value != item.pages) { item.pages += "-"+value; } } } else if(tag == "SN") { // ISSN/ISBN - just add both // TODO We should be able to tell these apart if(!item.ISBN) { item.ISBN = value; } if(!item.ISSN) { item.ISSN = value; } } else if(tag == "UR" || tag == "L1" || tag == "L2" || tag == "L4") { // URL if(!item.url) { item.url = value; } if(tag == "UR") { item.attachments.push({url:value}); } else if(tag == "L1") { item.attachments.push({url:value, mimeType:"application/pdf", title:"Full Text (PDF)", downloadable:true}); } else if(tag == "L2") { item.attachments.push({url:value, mimeType:"text/html", title:"Full Text (HTML)", downloadable:true}); } else if(tag == "L4") { item.attachments.push({url:value, title:"Image", downloadable:true}); } } else if (tag == "IS") { // Issue Number (patent: patentNumber) if (item.itemType == "patent") { item.patentNumber = value; } else { item.issue = value; } } else if (tag == "VL") { // Volume Number (patent: applicationNumber) if (item.itemType == "patent") { item.applicationNumber = value; // Report Number (report: reportNumber) } else if(item.itemType == "report") { item.reportNumber = value; } else { item.volume = value; } } else if (tag == "PB") { // publisher (patent: references) if (item.itemType == "patent") { item.references = value; } else { item.publisher = value; } } else if (tag == "M1" || tag == "M2") { // Miscellaneous fields if (!item.extra) { item.extra = value; } else { item.extra += "; "+value; } }}
newItem.creators.push(Zotero.Utilities.cleanString(match[2]));
newItem.creators.push(Zotero.Utilities.trimInternal(match[2]));
function processURLs(urls) { if(!urls.length) { // last url Zotero.done(); return; } var newUrl = urls.shift(); Zotero.Utilities.HTTP.doPost(newUrl, 'exportselect=record&exporttype=plaintext', function(text) { var lineRegexp = new RegExp(); lineRegexp.compile("^([\\w() ]+): *(.*)$"); var newItem = new Zotero.Item("book"); newItem.extra = ""; var lines = text.split('\n'); for(var i=0;i<lines.length;i++) { var testMatch = lineRegexp.exec(lines[i]); if(testMatch) { var match = newMatch; var newMatch = testMatch } else { var match = false; } if(match) { // is a useful match if(match[1] == 'Title') { var title = match[2]; if(!lineRegexp.test(lines[i+1])) { i++; title += ' '+lines[i]; } if(title.substring(title.length-2) == " /") { title = title.substring(0, title.length-2); } newItem.title = Zotero.Utilities.capitalizeTitle(title); } else if(match[1] == "Series") { newItem.series = match[2]; } else if(match[1] == "Description") { var pageMatch = /([0-9]+) p\.?/ var m = pageMatch.exec(match[2]); if(m) { newItem.pages = m[1]; } } else if(match[1] == 'Author(s)' || match[1] == "Corp Author(s)") { var yearRegexp = /[0-9]{4}-([0-9]{4})?/; var authors = match[2].split(';'); if(authors) { newItem.creators.push(Zotero.Utilities.cleanAuthor(authors[0], "author", true)); for(var j=1; j<authors.length; j+=2) { if(authors[j-1].substring(0, 1) != '(' && !yearRegexp.test(authors[j])) { // ignore places where there are parentheses newItem.creators.push({lastName:authors[j], creatorType:"author", fieldMode:true}); } } } else { newItem.creators.push(Zotero.Utilities.cleanString(match[2])); } } else if(match[1] == 'Publication') { match[2] = Zotero.Utilities.cleanString(match[2]); if(match[2].substring(match[2].length-1) == ',') { match[2] = match[2].substring(0, match[2].length-1); } // most, but not all, WorldCat publisher/places are // colon delimited var parts = match[2].split(/ ?: ?/); if(parts.length == 2) { newItem.place = parts[0]; newItem.publisher = parts[1]; } else { newItem.publisher = match[2]; } } else if(match[1] == 'Institution') { newItem.publisher = match[2]; } else if(match[1] == 'Standard No') { var ISBNRe = /ISBN:\s*([0-9X]+)/ var m = ISBNRe.exec(match[2]); if(m) newItem.ISBN = m[1]; } else if(match[1] == 'Year') { newItem.date = match[2]; } else if(match[1] == "Descriptor") { if(match[2][match[2].length-1] == ".") { match[2] = match[2].substr(0, match[2].length-1); } var tags = match[2].split("--"); for(var j in tags) { newItem.tags.push(Zotero.Utilities.cleanString(tags[j])); } } else if(match[1] == "Accession No") { newItem.accessionNumber = Zotero.Utilities.superCleanString(match[2]); } else if(match[1] == "Degree") { newItem.itemType = "thesis"; newItem.thesisType = match[2]; } else if(match[1] == "DOI") { newItem.DOI = match[2]; } else if(match[1] == "Database") { if(match[2].substr(0, 8) != "WorldCat") { newItem.itemType = "journalArticle"; } } else if(match[1] != "Availability" && match[1] != "Find Items About" && match[1] != "Document Type") { newItem.extra += match[1]+": "+match[2]+"\n"; } } else { if(lines[i] != "" && lines[i] != "SUBJECT(S)") { newMatch[2] += " "+lines[i]; } } } if(newItem.extra) { newItem.extra = newItem.extra.substr(0, newItem.extra.length-1); } newItem.complete(); processURLs(urls); }, false, 'iso-8859-1');}
match[2] = Zotero.Utilities.cleanString(match[2]);
match[2] = Zotero.Utilities.trimInternal(match[2]);
function processURLs(urls) { if(!urls.length) { // last url Zotero.done(); return; } var newUrl = urls.shift(); Zotero.Utilities.HTTP.doPost(newUrl, 'exportselect=record&exporttype=plaintext', function(text) { var lineRegexp = new RegExp(); lineRegexp.compile("^([\\w() ]+): *(.*)$"); var newItem = new Zotero.Item("book"); newItem.extra = ""; var lines = text.split('\n'); for(var i=0;i<lines.length;i++) { var testMatch = lineRegexp.exec(lines[i]); if(testMatch) { var match = newMatch; var newMatch = testMatch } else { var match = false; } if(match) { // is a useful match if(match[1] == 'Title') { var title = match[2]; if(!lineRegexp.test(lines[i+1])) { i++; title += ' '+lines[i]; } if(title.substring(title.length-2) == " /") { title = title.substring(0, title.length-2); } newItem.title = Zotero.Utilities.capitalizeTitle(title); } else if(match[1] == "Series") { newItem.series = match[2]; } else if(match[1] == "Description") { var pageMatch = /([0-9]+) p\.?/ var m = pageMatch.exec(match[2]); if(m) { newItem.pages = m[1]; } } else if(match[1] == 'Author(s)' || match[1] == "Corp Author(s)") { var yearRegexp = /[0-9]{4}-([0-9]{4})?/; var authors = match[2].split(';'); if(authors) { newItem.creators.push(Zotero.Utilities.cleanAuthor(authors[0], "author", true)); for(var j=1; j<authors.length; j+=2) { if(authors[j-1].substring(0, 1) != '(' && !yearRegexp.test(authors[j])) { // ignore places where there are parentheses newItem.creators.push({lastName:authors[j], creatorType:"author", fieldMode:true}); } } } else { newItem.creators.push(Zotero.Utilities.cleanString(match[2])); } } else if(match[1] == 'Publication') { match[2] = Zotero.Utilities.cleanString(match[2]); if(match[2].substring(match[2].length-1) == ',') { match[2] = match[2].substring(0, match[2].length-1); } // most, but not all, WorldCat publisher/places are // colon delimited var parts = match[2].split(/ ?: ?/); if(parts.length == 2) { newItem.place = parts[0]; newItem.publisher = parts[1]; } else { newItem.publisher = match[2]; } } else if(match[1] == 'Institution') { newItem.publisher = match[2]; } else if(match[1] == 'Standard No') { var ISBNRe = /ISBN:\s*([0-9X]+)/ var m = ISBNRe.exec(match[2]); if(m) newItem.ISBN = m[1]; } else if(match[1] == 'Year') { newItem.date = match[2]; } else if(match[1] == "Descriptor") { if(match[2][match[2].length-1] == ".") { match[2] = match[2].substr(0, match[2].length-1); } var tags = match[2].split("--"); for(var j in tags) { newItem.tags.push(Zotero.Utilities.cleanString(tags[j])); } } else if(match[1] == "Accession No") { newItem.accessionNumber = Zotero.Utilities.superCleanString(match[2]); } else if(match[1] == "Degree") { newItem.itemType = "thesis"; newItem.thesisType = match[2]; } else if(match[1] == "DOI") { newItem.DOI = match[2]; } else if(match[1] == "Database") { if(match[2].substr(0, 8) != "WorldCat") { newItem.itemType = "journalArticle"; } } else if(match[1] != "Availability" && match[1] != "Find Items About" && match[1] != "Document Type") { newItem.extra += match[1]+": "+match[2]+"\n"; } } else { if(lines[i] != "" && lines[i] != "SUBJECT(S)") { newMatch[2] += " "+lines[i]; } } } if(newItem.extra) { newItem.extra = newItem.extra.substr(0, newItem.extra.length-1); } newItem.complete(); processURLs(urls); }, false, 'iso-8859-1');}
newItem.tags.push(Zotero.Utilities.cleanString(tags[j]));
newItem.tags.push(Zotero.Utilities.trimInternal(tags[j]));
function processURLs(urls) { if(!urls.length) { // last url Zotero.done(); return; } var newUrl = urls.shift(); Zotero.Utilities.HTTP.doPost(newUrl, 'exportselect=record&exporttype=plaintext', function(text) { var lineRegexp = new RegExp(); lineRegexp.compile("^([\\w() ]+): *(.*)$"); var newItem = new Zotero.Item("book"); newItem.extra = ""; var lines = text.split('\n'); for(var i=0;i<lines.length;i++) { var testMatch = lineRegexp.exec(lines[i]); if(testMatch) { var match = newMatch; var newMatch = testMatch } else { var match = false; } if(match) { // is a useful match if(match[1] == 'Title') { var title = match[2]; if(!lineRegexp.test(lines[i+1])) { i++; title += ' '+lines[i]; } if(title.substring(title.length-2) == " /") { title = title.substring(0, title.length-2); } newItem.title = Zotero.Utilities.capitalizeTitle(title); } else if(match[1] == "Series") { newItem.series = match[2]; } else if(match[1] == "Description") { var pageMatch = /([0-9]+) p\.?/ var m = pageMatch.exec(match[2]); if(m) { newItem.pages = m[1]; } } else if(match[1] == 'Author(s)' || match[1] == "Corp Author(s)") { var yearRegexp = /[0-9]{4}-([0-9]{4})?/; var authors = match[2].split(';'); if(authors) { newItem.creators.push(Zotero.Utilities.cleanAuthor(authors[0], "author", true)); for(var j=1; j<authors.length; j+=2) { if(authors[j-1].substring(0, 1) != '(' && !yearRegexp.test(authors[j])) { // ignore places where there are parentheses newItem.creators.push({lastName:authors[j], creatorType:"author", fieldMode:true}); } } } else { newItem.creators.push(Zotero.Utilities.cleanString(match[2])); } } else if(match[1] == 'Publication') { match[2] = Zotero.Utilities.cleanString(match[2]); if(match[2].substring(match[2].length-1) == ',') { match[2] = match[2].substring(0, match[2].length-1); } // most, but not all, WorldCat publisher/places are // colon delimited var parts = match[2].split(/ ?: ?/); if(parts.length == 2) { newItem.place = parts[0]; newItem.publisher = parts[1]; } else { newItem.publisher = match[2]; } } else if(match[1] == 'Institution') { newItem.publisher = match[2]; } else if(match[1] == 'Standard No') { var ISBNRe = /ISBN:\s*([0-9X]+)/ var m = ISBNRe.exec(match[2]); if(m) newItem.ISBN = m[1]; } else if(match[1] == 'Year') { newItem.date = match[2]; } else if(match[1] == "Descriptor") { if(match[2][match[2].length-1] == ".") { match[2] = match[2].substr(0, match[2].length-1); } var tags = match[2].split("--"); for(var j in tags) { newItem.tags.push(Zotero.Utilities.cleanString(tags[j])); } } else if(match[1] == "Accession No") { newItem.accessionNumber = Zotero.Utilities.superCleanString(match[2]); } else if(match[1] == "Degree") { newItem.itemType = "thesis"; newItem.thesisType = match[2]; } else if(match[1] == "DOI") { newItem.DOI = match[2]; } else if(match[1] == "Database") { if(match[2].substr(0, 8) != "WorldCat") { newItem.itemType = "journalArticle"; } } else if(match[1] != "Availability" && match[1] != "Find Items About" && match[1] != "Document Type") { newItem.extra += match[1]+": "+match[2]+"\n"; } } else { if(lines[i] != "" && lines[i] != "SUBJECT(S)") { newMatch[2] += " "+lines[i]; } } } if(newItem.extra) { newItem.extra = newItem.extra.substr(0, newItem.extra.length-1); } newItem.complete(); processURLs(urls); }, false, 'iso-8859-1');}
if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=true;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=true;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f<e.length;f++){var g=null,h=e[f],i=h.name;if(!h.name&&!h.id)continue;if(typeof arguments[0]=='string'){var j=new RegExp('(?:^| )'+arguments[0]+'(?:$| )');if(!j.test(h.className))continue;}else if(typeof arguments[0]=='function'){g={};if(arguments[0](h,g)===false)continue;}this.replace(h,g);}};(function(){var e=function(){var f=a.loadFullCore,g=a.loadFullCoreTimeout;if(a.replaceByClassEnabled)a.replaceAll(a.replaceClass);a.status='basic_ready';if(f&&f._load)f();else if(g)setTimeout(function(){if(a.loadFullCore)a.loadFullCore();},g*1000);};if(window.addEventListener)window.addEventListener('load',e,false);else if(window.attachEvent)window.attachEvent('onload',e);})();a.status='basic_loaded';})();a.dom={};var d=a.dom;(function(){var e=[];a.tools={arrayCompare:function(f,g){if(!f&&!g)return true;if(!f||!g||f.length!=g.length)return false;for(var h=0;h<f.length;h++){if(f[h]!=g[h])return false;}return true;},clone:function(f){var g;if(f&&f instanceof Array){g=[];for(var h=0;h<f.length;h++)g[h]=this.clone(f[h]);return g;}if(f===null||typeof f!='object'||f instanceof String||f instanceof Number||f instanceof Boolean||f instanceof Date||f instanceof RegExp)return f;g=new f.constructor();for(var i in f){var j=f[i];g[i]=this.clone(j);}return g;},capitalize:function(f){return f.charAt(0).toUpperCase()+f.substring(1).toLowerCase();},extend:function(f){var g=arguments.length,h,i;if(typeof (h=arguments[g-1])=='boolean')g--;else if(typeof (h=arguments[g-2])=='boolean'){i=arguments[g-1];g-=2;}for(var j=1;j<g;j++){var k=arguments[j];for(var l in k){if(h===true||f[l]==undefined)if(!i||l in i)f[l]=k[l];}}return f;},prototypedCopy:function(f){var g=function(){};g.prototype=f;return new g(); },isArray:function(f){return!!f&&f instanceof Array;},isEmpty:function(f){for(var g in f){if(f.hasOwnProperty(g))return false;}return true;},cssStyleToDomStyle:(function(){var f=document.createElement('div').style,g=typeof f.cssFloat!='undefined'?'cssFloat':typeof f.styleFloat!='undefined'?'styleFloat':'float';return function(h){if(h=='float')return g;else return h.replace(/-./g,function(i){return i.substr(1).toUpperCase();});};})(),buildStyleHtml:function(f){f=[].concat(f);var g,h=[];for(var i=0;i<f.length;i++){g=f[i];if(/@import|[{}]/.test(g))h.push('<style>'+g+'</style>');else h.push('<link type="text/css" rel=stylesheet href="'+g+'">');}return h.join('');},htmlEncode:function(f){var g=function(k){var l=new d.element('span');l.setText(k);return l.getHtml();},h=g('\n').toLowerCase()=='<br>'?function(k){return g(k).replace(/<br>/gi,'\n');}:g,i=g('>')=='>'?function(k){return h(k).replace(/>/g,'&gt;');}:h,j=g(' ')=='&nbsp; '?function(k){return i(k).replace(/&nbsp;/g,' ');}:i;this.htmlEncode=j;return this.htmlEncode(f);},htmlEncodeAttr:function(f){return f.replace(/"/g,'&quot;').replace(/</g,'&lt;').replace(/>/,'&gt;');},escapeCssSelector:function(f){return f.replace(/[\s#:.,$*^\[\]()~=+>]/g,'\\$&');},getNextNumber:(function(){var f=0;return function(){return++f;};})(),override:function(f,g){return g(f);},setTimeout:function(f,g,h,i,j){if(!j)j=window;if(!h)h=j;return j.setTimeout(function(){if(i)f.apply(h,[].concat(i));else f.apply(h);},g||0);},trim:(function(){var f=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(f,'');};})(),ltrim:(function(){var f=/^[ \t\n\r]+/g;return function(g){return g.replace(f,'');};})(),rtrim:(function(){var f=/[ \t\n\r]+$/g;return function(g){return g.replace(f,'');};})(),indexOf:Array.prototype.indexOf?function(f,g){return f.indexOf(g);}:function(f,g){for(var h=0,i=f.length;h<i;h++){if(f[h]===g)return h;}return-1;},bind:function(f,g){return function(){return f.apply(g,arguments);};},createClass:function(f){var g=f.$,h=f.base,i=f.privates||f._,j=f.proto,k=f.statics;if(i){var l=g;g=function(){var p=this;var m=p._||(p._={});for(var n in i){var o=i[n];m[n]=typeof o=='function'?a.tools.bind(o,p):o;}l.apply(p,arguments);};}if(h){g.prototype=this.prototypedCopy(h.prototype);g.prototype['constructor']=g;g.prototype.base=function(){this.base=h.prototype.base;h.apply(this,arguments);this.base=arguments.callee;};}if(j)this.extend(g.prototype,j,true);if(k)this.extend(g,k,true);return g;},addFunction:function(f,g){return e.push(function(){f.apply(g||this,arguments);
return d;})();var b=a.env;var c=b.ie;if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=true;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=true;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f<e.length;f++){var g=null,h=e[f],i=h.name;if(!h.name&&!h.id)continue;if(typeof arguments[0]=='string'){var j=new RegExp('(?:^|\\s)'+arguments[0]+'(?:$|\\s)');if(!j.test(h.className))continue;}else if(typeof arguments[0]=='function'){g={};if(arguments[0](h,g)===false)continue;}this.replace(h,g);}};(function(){var e=function(){var f=a.loadFullCore,g=a.loadFullCoreTimeout;if(a.replaceByClassEnabled)a.replaceAll(a.replaceClass);a.status='basic_ready';if(f&&f._load)f();else if(g)setTimeout(function(){if(a.loadFullCore)a.loadFullCore();},g*1000);};if(window.addEventListener)window.addEventListener('load',e,false);else if(window.attachEvent)window.attachEvent('onload',e);})();a.status='basic_loaded';})();a.dom={};var d=a.dom;(function(){var e=[];a.on('reset',function(){e=[];});a.tools={arrayCompare:function(f,g){if(!f&&!g)return true;if(!f||!g||f.length!=g.length)return false;for(var h=0;h<f.length;h++){if(f[h]!=g[h])return false;}return true;},clone:function(f){var g;if(f&&f instanceof Array){g=[];for(var h=0;h<f.length;h++)g[h]=this.clone(f[h]);return g;}if(f===null||typeof f!='object'||f instanceof String||f instanceof Number||f instanceof Boolean||f instanceof Date||f instanceof RegExp)return f;g=new f.constructor();for(var i in f){var j=f[i];g[i]=this.clone(j);}return g;},capitalize:function(f){return f.charAt(0).toUpperCase()+f.substring(1).toLowerCase();},extend:function(f){var g=arguments.length,h,i;if(typeof (h=arguments[g-1])=='boolean')g--;else if(typeof (h=arguments[g-2])=='boolean'){i=arguments[g-1];g-=2;}for(var j=1;j<g;j++){var k=arguments[j];for(var l in k){if(h===true||f[l]==undefined)if(!i||l in i)f[l]=k[l];}}return f;},prototypedCopy:function(f){var g=function(){}; g.prototype=f;return new g();},isArray:function(f){return!!f&&f instanceof Array;},isEmpty:function(f){for(var g in f){if(f.hasOwnProperty(g))return false;}return true;},cssStyleToDomStyle:(function(){var f=document.createElement('div').style,g=typeof f.cssFloat!='undefined'?'cssFloat':typeof f.styleFloat!='undefined'?'styleFloat':'float';return function(h){if(h=='float')return g;else return h.replace(/-./g,function(i){return i.substr(1).toUpperCase();});};})(),buildStyleHtml:function(f){f=[].concat(f);var g,h=[];for(var i=0;i<f.length;i++){g=f[i];if(/@import|[{}]/.test(g))h.push('<style>'+g+'</style>');else h.push('<link type="text/css" rel=stylesheet href="'+g+'">');}return h.join('');},htmlEncode:function(f){var g=function(k){var l=new d.element('span');l.setText(k);return l.getHtml();},h=g('\n').toLowerCase()=='<br>'?function(k){return g(k).replace(/<br>/gi,'\n');}:g,i=g('>')=='>'?function(k){return h(k).replace(/>/g,'&gt;');}:h,j=g(' ')=='&nbsp; '?function(k){return i(k).replace(/&nbsp;/g,' ');}:i;this.htmlEncode=j;return this.htmlEncode(f);},htmlEncodeAttr:function(f){return f.replace(/"/g,'&quot;').replace(/</g,'&lt;').replace(/>/g,'&gt;');},escapeCssSelector:function(f){return f.replace(/[\s#:.,$*^\[\]()~=+>]/g,'\\$&');},getNextNumber:(function(){var f=0;return function(){return++f;};})(),getNextId:function(){return 'cke_'+this.getNextNumber();},override:function(f,g){return g(f);},setTimeout:function(f,g,h,i,j){if(!j)j=window;if(!h)h=j;return j.setTimeout(function(){if(i)f.apply(h,[].concat(i));else f.apply(h);},g||0);},trim:(function(){var f=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(f,'');};})(),ltrim:(function(){var f=/^[ \t\n\r]+/g;return function(g){return g.replace(f,'');};})(),rtrim:(function(){var f=/[ \t\n\r]+$/g;return function(g){return g.replace(f,'');};})(),indexOf:Array.prototype.indexOf?function(f,g){return f.indexOf(g);}:function(f,g){for(var h=0,i=f.length;h<i;h++){if(f[h]===g)return h;}return-1;},bind:function(f,g){return function(){return f.apply(g,arguments);};},createClass:function(f){var g=f.$,h=f.base,i=f.privates||f._,j=f.proto,k=f.statics;if(i){var l=g;g=function(){var p=this;var m=p._||(p._={});for(var n in i){var o=i[n];m[n]=typeof o=='function'?a.tools.bind(o,p):o;}l.apply(p,arguments);};}if(h){g.prototype=this.prototypedCopy(h.prototype);g.prototype['constructor']=g;g.prototype.base=function(){this.base=h.prototype.base;h.apply(this,arguments);this.base=arguments.callee;};}if(j)this.extend(g.prototype,j,true);
if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=true;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=true;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f<e.length;f++){var g=null,h=e[f],i=h.name;if(!h.name&&!h.id)continue;if(typeof arguments[0]=='string'){var j=new RegExp('(?:^| )'+arguments[0]+'(?:$| )');if(!j.test(h.className))continue;}else if(typeof arguments[0]=='function'){g={};if(arguments[0](h,g)===false)continue;}this.replace(h,g);}};(function(){var e=function(){var f=a.loadFullCore,g=a.loadFullCoreTimeout;if(a.replaceByClassEnabled)a.replaceAll(a.replaceClass);a.status='basic_ready';if(f&&f._load)f();else if(g)setTimeout(function(){if(a.loadFullCore)a.loadFullCore();},g*1000);};if(window.addEventListener)window.addEventListener('load',e,false);else if(window.attachEvent)window.attachEvent('onload',e);})();a.status='basic_loaded';})();a.dom={};var d=a.dom;(function(){var e=[];a.tools={arrayCompare:function(f,g){if(!f&&!g)return true;if(!f||!g||f.length!=g.length)return false;for(var h=0;h<f.length;h++){if(f[h]!=g[h])return false;}return true;},clone:function(f){var g;if(f&&f instanceof Array){g=[];for(var h=0;h<f.length;h++)g[h]=this.clone(f[h]);return g;}if(f===null||typeof f!='object'||f instanceof String||f instanceof Number||f instanceof Boolean||f instanceof Date||f instanceof RegExp)return f;g=new f.constructor();for(var i in f){var j=f[i];g[i]=this.clone(j);}return g;},capitalize:function(f){return f.charAt(0).toUpperCase()+f.substring(1).toLowerCase();},extend:function(f){var g=arguments.length,h,i;if(typeof (h=arguments[g-1])=='boolean')g--;else if(typeof (h=arguments[g-2])=='boolean'){i=arguments[g-1];g-=2;}for(var j=1;j<g;j++){var k=arguments[j];for(var l in k){if(h===true||f[l]==undefined)if(!i||l in i)f[l]=k[l];}}return f;},prototypedCopy:function(f){var g=function(){};g.prototype=f;return new g();},isArray:function(f){return!!f&&f instanceof Array;},isEmpty:function(f){for(var g in f){if(f.hasOwnProperty(g))return false;}return true;},cssStyleToDomStyle:(function(){var f=document.createElement('div').style,g=typeof f.cssFloat!='undefined'?'cssFloat':typeof f.styleFloat!='undefined'?'styleFloat':'float';return function(h){if(h=='float')return g;else return h.replace(/-./g,function(i){return i.substr(1).toUpperCase();});};})(),buildStyleHtml:function(f){f=[].concat(f);var g,h=[];for(var i=0;i<f.length;i++){g=f[i];if(/@import|[{}]/.test(g))h.push('<style>'+g+'</style>');else h.push('<link type="text/css" rel=stylesheet href="'+g+'">');}return h.join('');},htmlEncode:function(f){var g=function(k){var l=new d.element('span');l.setText(k);return l.getHtml();},h=g('\n').toLowerCase()=='<br>'?function(k){return g(k).replace(/<br>/gi,'\n');}:g,i=g('>')=='>'?function(k){return h(k).replace(/>/g,'&gt;');}:h,j=g(' ')=='&nbsp; '?function(k){return i(k).replace(/&nbsp;/g,' ');}:i;this.htmlEncode=j;return this.htmlEncode(f);},htmlEncodeAttr:function(f){return f.replace(/"/g,'&quot;').replace(/</g,'&lt;').replace(/>/,'&gt;');},escapeCssSelector:function(f){return f.replace(/[\s#:.,$*^\[\]()~=+>]/g,'\\$&');},getNextNumber:(function(){var f=0;return function(){return++f;};})(),override:function(f,g){return g(f);},setTimeout:function(f,g,h,i,j){if(!j)j=window;if(!h)h=j;return j.setTimeout(function(){if(i)f.apply(h,[].concat(i));else f.apply(h);},g||0);},trim:(function(){var f=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(f,'');};})(),ltrim:(function(){var f=/^[ \t\n\r]+/g;return function(g){return g.replace(f,'');};})(),rtrim:(function(){var f=/[ \t\n\r]+$/g;return function(g){return g.replace(f,'');};})(),indexOf:Array.prototype.indexOf?function(f,g){return f.indexOf(g);}:function(f,g){for(var h=0,i=f.length;h<i;h++){if(f[h]===g)return h;}return-1;},bind:function(f,g){return function(){return f.apply(g,arguments);};},createClass:function(f){var g=f.$,h=f.base,i=f.privates||f._,j=f.proto,k=f.statics;if(i){var l=g;g=function(){var p=this;var m=p._||(p._={});for(var n in i){var o=i[n];m[n]=typeof o=='function'?a.tools.bind(o,p):o;}l.apply(p,arguments);};}if(h){g.prototype=this.prototypedCopy(h.prototype);g.prototype['constructor']=g;g.prototype.base=function(){this.base=h.prototype.base;h.apply(this,arguments);this.base=arguments.callee;};}if(j)this.extend(g.prototype,j,true);if(k)this.extend(g,k,true);return g;},addFunction:function(f,g){return e.push(function(){f.apply(g||this,arguments);
return-1},merge:function(a,b){var e=a.length,g=0;if(typeof b.length==="number")for(var h=b.length;g<h;g++)a[e++]=b[g];else for(;b[g]!==v;)a[e++]=b[g++];a.length=e;return a},grep:function(a,b,e){for(var g=[],h=0,k=a.length;h<k;h++)!e!==!b(a[h],h)&&g.push(a[h]);return g},map:function(a,b,e){for(var g=[],h,k=0,l=a.length;k<l;k++){h=b(a[k],k,e);if(h!=null)g[g.length]=h}return g.concat.apply([],g)},guid:1,proxy:function(a,b,e){if(arguments.length===2)if(typeof b==="string"){e=a;a=e[b];b=v}else if(b&&!d.isFunction(b)){e= b;b=v}if(!b&&a)b=function(){return a.apply(e||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||d.guid++;return b},uaMatch:function(a){var b={browser:""};a=a.toLowerCase();if(/webkit/.test(a))b={browser:"webkit",version:/webkit[\/ ]([\w.]+)/};else if(/opera/.test(a))b={browser:"opera",version:/opera[\/ ]([\w.]+)/};else if(/msie/.test(a))b={browser:"msie",version:/msie ([\w.]+)/};else if(/mozilla/.test(a)&&!/compatible/.test(a))b={browser:"mozilla",version:/rv:([\w.]+)/};b.version=(b.version&&b.version.exec(a)||
return-1},merge:function(a,b){var e=a.length,f=0;if(typeof b.length==="number")for(var h=b.length;f<h;f++)a[e++]=b[f];else for(;b[f]!==v;)a[e++]=b[f++];a.length=e;return a},grep:function(a,b,e){for(var f=[],h=0,k=a.length;h<k;h++)!e!==!b(a[h],h)&&f.push(a[h]);return f},map:function(a,b,e){for(var f=[],h,k=0,l=a.length;k<l;k++){h=b(a[k],k,e);if(h!=null)f[f.length]=h}return f.concat.apply([],f)},guid:1,proxy:function(a,b,e){if(arguments.length===2)if(typeof b==="string"){e=a;a=e[b];b=v}else if(b&&!c.isFunction(b)){e= b;b=v}if(!b&&a)b=function(){return a.apply(e||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){var b={browser:""};a=a.toLowerCase();if(/webkit/.test(a))b={browser:"webkit",version:/webkit[\/ ]([\w.]+)/};else if(/opera/.test(a))b={browser:"opera",version:/opera[\/ ]([\w.]+)/};else if(/msie/.test(a))b={browser:"msie",version:/msie ([\w.]+)/};else if(/mozilla/.test(a)&&!/compatible/.test(a))b={browser:"mozilla",version:/rv:([\w.]+)/};b.version=(b.version&&b.version.exec(a)||
return-1},merge:function(a,b){var e=a.length,g=0;if(typeof b.length==="number")for(var h=b.length;g<h;g++)a[e++]=b[g];else for(;b[g]!==v;)a[e++]=b[g++];a.length=e;return a},grep:function(a,b,e){for(var g=[],h=0,k=a.length;h<k;h++)!e!==!b(a[h],h)&&g.push(a[h]);return g},map:function(a,b,e){for(var g=[],h,k=0,l=a.length;k<l;k++){h=b(a[k],k,e);if(h!=null)g[g.length]=h}return g.concat.apply([],g)},guid:1,proxy:function(a,b,e){if(arguments.length===2)if(typeof b==="string"){e=a;a=e[b];b=v}else if(b&&!d.isFunction(b)){e=b;b=v}if(!b&&a)b=function(){return a.apply(e||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||d.guid++;return b},uaMatch:function(a){var b={browser:""};a=a.toLowerCase();if(/webkit/.test(a))b={browser:"webkit",version:/webkit[\/ ]([\w.]+)/};else if(/opera/.test(a))b={browser:"opera",version:/opera[\/ ]([\w.]+)/};else if(/msie/.test(a))b={browser:"msie",version:/msie ([\w.]+)/};else if(/mozilla/.test(a)&&!/compatible/.test(a))b={browser:"mozilla",version:/rv:([\w.]+)/};b.version=(b.version&&b.version.exec(a)||
last.position = scimoz.currentPos;
if (last.position != currentPos) { var currentPos = scimoz.currentPos; var currentLine = scimoz.lineFromPosition(currentPos); var mode = this.prefs.editGranularity; try { switch (mode) { case "a": this.addPositionToStack(this.lastEditStack); break; case "s": last.position = currentPos; last.line = currentLine; last.col = scimoz.getColumn(currentPos); break; default: var cnt = parseInt(mode) - 1; var diff = last.line - currentLine; var absdiff = diff < 0 ? -diff : diff; if (absdiff <= cnt) { last.position = currentPos; last.line = currentLine; last.col = scimoz.getColumn(currentPos); if (this.prefs.editClearNextStack) { this.nextEditStack.clear(); this.updateCommands(); } } else { this.addPositionToStack(this.lastEditStack); } } } catch (err) { alert(mode + "--" + currentPos + "\n" + err); } }
pushEdit : function() { var currView = ko.views.manager.currentView; if (!currView.document) { return; } if (!currView.document.isDirty) { return; } var scimoz = currView.scintilla.scimoz; var last = null; if (this.lastEditStack.length) { var last = this.lastEditStack.peek(); } if (last && last.view == currView) { last.position = scimoz.currentPos; } else { if (!this.isEditOnCurrentView(this.lastEditStack.peek())) { this.lastEditStack.push({ view : currView, position : scimoz.currentPos}); this.updateCommands(); } } },
this.lastEditStack.push({ view : currView, position : scimoz.currentPos}); this.updateCommands();
this.addPositionToStack(this.lastEditStack);
pushEdit : function() { var currView = ko.views.manager.currentView; if (!currView.document) { return; } if (!currView.document.isDirty) { return; } var scimoz = currView.scintilla.scimoz; var last = null; if (this.lastEditStack.length) { var last = this.lastEditStack.peek(); } if (last && last.view == currView) { last.position = scimoz.currentPos; } else { if (!this.isEditOnCurrentView(this.lastEditStack.peek())) { this.lastEditStack.push({ view : currView, position : scimoz.currentPos}); this.updateCommands(); } } },
msg = msg[conf.lang];
msg = msg[conf.lang] || v.messages["*"].en;
function pushMessage(to, matcher, returnValue) { // only one message allowed if (!conf.grouped && to.length) { return; } // the error message var msg; // substitutions are returned if (returnValue === false || $.isArray(returnValue)) { msg = v.messages[matcher.key || matcher] || v.messages["*"]; msg = msg[conf.lang]; // substitution var matches = msg.match(/\$\d/g); if (matches && $.isArray(returnValue)) { $.each(matches, function(i) { msg = msg.replace(this, returnValue[i]); }); } // error message is returned directly } else { msg = returnValue[conf.lang] || returnValue; } to.push(msg); }
var v = null; if (document.defaultView && document.defaultView.getComputedStyle) { v = document.defaultView.getComputedStyle(c, null)[s]; } else if (c.currentStyle) { v = c.currentStyle[s]; } else { v = c.style[s]; }
var v = css(c, s);
this.px = function(c, s) { var v = null; if (document.defaultView && document.defaultView.getComputedStyle) { v = document.defaultView.getComputedStyle(c, null)[s]; } else if (c.currentStyle) { v = c.currentStyle[s]; } else { v = c.style[s]; } if (v == 'auto' || v == null) return 0; var m = /^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(v); v = m && m.length == 2 ? m[1] : "0"; return v ? parseFloat(v) : 0;};
var m = /^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(v); v = m && m.length == 2 ? m[1] : "0"; return v ? parseFloat(v) : 0;
if (rnumpx.test(v)) return parseFloat(v); else return 0;
this.px = function(c, s) { var v = null; if (document.defaultView && document.defaultView.getComputedStyle) { v = document.defaultView.getComputedStyle(c, null)[s]; } else if (c.currentStyle) { v = c.currentStyle[s]; } else { v = c.style[s]; } if (v == 'auto' || v == null) return 0; var m = /^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(v); v = m && m.length == 2 ? m[1] : "0"; return v ? parseFloat(v) : 0;};
if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||g.isIE?true:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};var Z=/^-?\d+(?:px)?$/i;this.px=function(a,b){a=w(a,b);if(a=="auto"||a==null)return 0;return Z.test(a)?parseFloat(a):0};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];
b;a.selectionEnd=f}else if(document.selection){a=a.createTextRange();a.collapse(true);a.moveStart("character",b);a.moveEnd("character",f-b);a.select()}};this.isKeyPress=function(a){if(!a)a=window.event;if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||g.isIE?true:a.keyCode==13||a.keyCode==27||a.keyCode>=32&&a.keyCode<125};var Z=/^-?\d+(?:px)?$/i;this.px=function(a,b){a=w(a,b);if(a=="auto"||a==null)return 0;return Z.test(a)?parseFloat(a):0};this.isHidden=
if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||g.isIE?true:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};var Z=/^-?\d+(?:px)?$/i;this.px=function(a,b){a=w(a,b);if(a=="auto"||a==null)return 0;return Z.test(a)?parseFloat(a):0};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];
function(a){if(!a)a=window.event;if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||k.isIE?true:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};this.px=function(a,b){var f=null;f=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null)[b]:a.currentStyle?a.currentStyle[b]:a.style[b];if(f=="auto"||f==null)return 0;return(f=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(f))&&a.length== 2?a[1]:"0")?parseFloat(f):0};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?k.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):
f);a.moveStart("character",b);a.select()}else if(a.setSelectionRange){a.focus();a.setSelectionRange(b,f)}};this.isKeyPress=function(a){if(!a)a=window.event;if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||k.isIE?true:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};var U=/^-?\d+(?:px)?$/i;this.px=function(a,b){a=x(a,b);if(a=="auto"||a==null)return 0;return U.test(a)?parseFloat(a):0};this.isHidden=function(a){if(a.style.display==
function(a){if(!a)a=window.event;if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||k.isIE?true:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};this.px=function(a,b){var f=null;f=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null)[b]:a.currentStyle?a.currentStyle[b]:a.style[b];if(f=="auto"||f==null)return 0;return(f=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(f))&&a.length==2?a[1]:"0")?parseFloat(f):0};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?k.isHidden(a):false}};this.pxself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):0};this.pctself=function(a,b){a=a.style[b];if(a=="auto"||a==null)return 0;return(a=(a=/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/.exec(a))&&a.length==2?a[1]:"0")?parseFloat(a):