rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
if (negative) { formattedNumber = "-" + formattedNumber; }
I18n.toNumber = function(number, options) { options = this.prepareOptions( options, this.lookup("number.format"), {precision: 3, separator: ".", delimiter: ","} ); var string = number.toFixed(options["precision"]).toString(); var parts = string.split("."); number = parts[0]; var precision = parts[1]; var n = []; while (number.length > 0) { n.unshift(number.substr(Math.max(0, number.length - 3), 3)); number = number.substr(0, number.length -3); } var formattedNumber = n.join(options["delimiter"]); if (options["precision"] > 0) { formattedNumber += options["separator"] + parts[1]; } return formattedNumber;};
if ($.isFunction(conf)) { conf = {onBeforeShow: conf}; } else if (typeof conf == 'string') { conf = {tip: conf}; }
$.fn.tooltip = function(conf) { // return existing instance var api = this.data("tooltip"); if (api) { return api; } // configuration if ($.isFunction(conf)) { conf = {onBeforeShow: conf}; } else if (typeof conf == 'string') { conf = {tip: conf}; } conf = $.extend(true, {}, $.tools.tooltip.conf, conf); // position can also be given as string if (typeof conf.position == 'string') { conf.position = conf.position.split(/,?\s/); } // install tooltip for each entry in jQuery object this.each(function() { api = new Tooltip($(this), conf); $(this).data("tooltip", api); }); return conf.api ? api: this; };
if (event[1]) {
if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) {
function Tooltip(trigger, conf) { var self = this, fire = trigger.add(self), tip, timer = 0, pretimer = 0, title = trigger.attr("title"), effect = effects[conf.effect], shown, // get show/hide configuration isInput = trigger.is(":input"), isWidget = isInput && trigger.is(":checkbox, :radio, select, :button"), type = trigger.attr("type"), evt = conf.events[type] || conf.events[isInput ? (isWidget ? 'widget' : 'input') : 'def']; // check that configuration is sane if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; } evt = evt.split(/,\s*/); if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; } // trigger --> show trigger.bind(evt[0], function(e) { if (conf.predelay) { clearTimeout(timer); pretimer = setTimeout(function() { self.show(e); }, conf.predelay); } else { self.show(e); } // trigger --> hide }).bind(evt[1], function(e) { if (conf.delay) { clearTimeout(pretimer); timer = setTimeout(function() { self.hide(e); }, conf.delay); } else { self.hide(e); } }); // remove default title if (title && conf.cancelDefault) { trigger.removeAttr("title"); trigger.data("title", title); } $.extend(self, { show: function(e) { // tip not initialized yet if (!tip) { // find a "manual" tooltip if (title) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide(); } else if (conf.tip) { tip = $(conf.tip).eq(0); } else { tip = trigger.next(); if (!tip.length) { tip = trigger.parent().next(); } } if (!tip.length) { throw "Cannot find tooltip for " + trigger; } } if (self.isShown()) { return self; } // stop previous animation tip.stop(true, true); // get position var pos = getPosition(trigger, tip, conf); // title attribute if (title) { tip.html(title); } // onBeforeShow e = e || $.Event(); e.type = "onBeforeShow"; fire.trigger(e, [pos]); if (e.isDefaultPrevented()) { return self; } // onBeforeShow may have altered the configuration pos = getPosition(trigger, tip, conf); // set position tip.css({position:'absolute', top: pos.top, left: pos.left}); shown = true; // invoke effect effect[0].call(self, function() { e.type = "onShow"; shown = 'full'; fire.trigger(e); }); // tooltip events var event = conf.events.tooltip.split(/,\s*/); tip.bind(event[0], function() { clearTimeout(timer); clearTimeout(pretimer); }); if (event[1]) { tip.bind(event[1], function(e) { // being moved to the trigger element if (e.relatedTarget != trigger[0]) { trigger.trigger(evt[1].split(" ")[0]); } }); } return self; }, hide: function(e) { if (!tip || !self.isShown()) { return self; } // onBeforeHide e = e || $.Event(); e.type = "onBeforeHide"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } shown = false; effects[conf.effect][1].call(self, function() { e.type = "onHide"; shown = false; fire.trigger(e); }); return self; }, isShown: function(fully) { return fully ? shown == 'full' : shown; }, getConf: function() { return conf; }, getTip: function() { return tip; }, getTrigger: function() { return trigger; } }); // callbacks $.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); }
$(self).bind(name, fn);
if (fn) { $(self).bind(name, fn); }
function Tooltip(trigger, conf) { var self = this, fire = trigger.add(self), tip, timer = 0, pretimer = 0, title = trigger.attr("title"), tipAttr = trigger.attr("data-tooltip"), effect = effects[conf.effect], shown, // get show/hide configuration isInput = trigger.is(":input"), isWidget = isInput && trigger.is(":checkbox, :radio, select, :button, :submit"), type = trigger.attr("type"), evt = conf.events[type] || conf.events[isInput ? (isWidget ? 'widget' : 'input') : 'def']; // check that configuration is sane if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; } evt = evt.split(/,\s*/); if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; } // trigger --> show trigger.bind(evt[0], function(e) { clearTimeout(timer); if (conf.predelay) { pretimer = setTimeout(function() { self.show(e); }, conf.predelay); } else { self.show(e); } // trigger --> hide }).bind(evt[1], function(e) { clearTimeout(pretimer); if (conf.delay) { timer = setTimeout(function() { self.hide(e); }, conf.delay); } else { self.hide(e); } }); // remove default title if (title && conf.cancelDefault) { trigger.removeAttr("title"); trigger.data("title", title); } $.extend(self, { show: function(e) { // tip not initialized yet if (!tip) { // data-tooltip if (tipAttr) { tip = $(tipAttr); // single tip element for all } else if (conf.tip) { tip = $(conf.tip).eq(0); // autogenerated tooltip } else if (title) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body) .hide().append(title); // manual tooltip } else { tip = trigger.next(); if (!tip.length) { tip = trigger.parent().next(); } } if (!tip.length) { throw "Cannot find tooltip for " + trigger; } } if (self.isShown()) { return self; } // stop previous animation tip.stop(true, true); // get position var pos = getPosition(trigger, tip, conf); // restore title for single tooltip element if (conf.tip) { tip.html(trigger.data("title")); } // onBeforeShow e = e || $.Event(); e.type = "onBeforeShow"; fire.trigger(e, [pos]); if (e.isDefaultPrevented()) { return self; } // onBeforeShow may have altered the configuration pos = getPosition(trigger, tip, conf); // set position tip.css({position:'absolute', top: pos.top, left: pos.left}); shown = true; // invoke effect effect[0].call(self, function() { e.type = "onShow"; shown = 'full'; fire.trigger(e); }); // tooltip events var event = conf.events.tooltip.split(/,\s*/); if (!tip.data("__set")) { tip.bind(event[0], function() { clearTimeout(timer); clearTimeout(pretimer); }); if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) { tip.bind(event[1], function(e) { // being moved to the trigger element if (e.relatedTarget != trigger[0]) { trigger.trigger(evt[1].split(" ")[0]); } }); } tip.data("__set", true); } return self; }, hide: function(e) { if (!tip || !self.isShown()) { return self; } // onBeforeHide e = e || $.Event(); e.type = "onBeforeHide"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } shown = false; effects[conf.effect][1].call(self, function() { e.type = "onHide"; fire.trigger(e); }); return self; }, isShown: function(fully) { return fully ? shown == 'full' : shown; }, getConf: function() { return conf; }, getTip: function() { return tip; }, getTrigger: function() { return trigger; } }); // callbacks $.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); }
isWidget = isInput && trigger.is(":checkbox, :radio, select, :button"),
isWidget = isInput && trigger.is(":checkbox, :radio, select, :button, :submit"),
function Tooltip(trigger, conf) { var self = this, fire = trigger.add(self), tip, timer = 0, pretimer = 0, title = trigger.attr("title"), effect = effects[conf.effect], shown, // get show/hide configuration isInput = trigger.is(":input"), isWidget = isInput && trigger.is(":checkbox, :radio, select, :button"), type = trigger.attr("type"), evt = conf.events[type] || conf.events[isInput ? (isWidget ? 'widget' : 'input') : 'def']; // check that configuration is sane if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; } evt = evt.split(/,\s*/); if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; } // trigger --> show trigger.bind(evt[0], function(e) { if (conf.predelay) { clearTimeout(timer); pretimer = setTimeout(function() { self.show(e); }, conf.predelay); } else { self.show(e); } // trigger --> hide }).bind(evt[1], function(e) { if (conf.delay) { clearTimeout(pretimer); timer = setTimeout(function() { self.hide(e); }, conf.delay); } else { self.hide(e); } }); // remove default title if (title && conf.cancelDefault) { trigger.removeAttr("title"); trigger.data("title", title); } $.extend(self, { show: function(e) { // tip not initialized yet if (!tip) { // autogenerated tooltip if (title) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body) .hide().append(title); // single tip element for all } else if (conf.tip) { tip = $(conf.tip).eq(0); // manual tooltip } else { tip = trigger.next(); if (!tip.length) { tip = trigger.parent().next(); } } if (!tip.length) { throw "Cannot find tooltip for " + trigger; } } if (self.isShown()) { return self; } // stop previous animation tip.stop(true, true); // get position var pos = getPosition(trigger, tip, conf); // onBeforeShow e = e || $.Event(); e.type = "onBeforeShow"; fire.trigger(e, [pos]); if (e.isDefaultPrevented()) { return self; } // onBeforeShow may have altered the configuration pos = getPosition(trigger, tip, conf); // set position tip.css({position:'absolute', top: pos.top, left: pos.left}); shown = true; // invoke effect effect[0].call(self, function() { e.type = "onShow"; shown = 'full'; fire.trigger(e); }); // tooltip events var event = conf.events.tooltip.split(/,\s*/); tip.bind(event[0], function() { clearTimeout(timer); clearTimeout(pretimer); }); if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) { tip.bind(event[1], function(e) { // being moved to the trigger element if (e.relatedTarget != trigger[0]) { trigger.trigger(evt[1].split(" ")[0]); } }); } return self; }, hide: function(e) { if (!tip || !self.isShown()) { return self; } // onBeforeHide e = e || $.Event(); e.type = "onBeforeHide"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } shown = false; effects[conf.effect][1].call(self, function() { e.type = "onHide"; shown = false; fire.trigger(e); }); return self; }, isShown: function(fully) { return fully ? shown == 'full' : shown; }, getConf: function() { return conf; }, getTip: function() { return tip; }, getTrigger: function() { return trigger; } }); // callbacks $.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); }
tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide();
tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body) .hide().append(title);
function Tooltip(trigger, conf) { var self = this, fire = trigger.add(self), tip, timer = 0, pretimer = 0, title = trigger.attr("title"), effect = effects[conf.effect], shown, // get show/hide configuration isInput = trigger.is(":input"), isWidget = isInput && trigger.is(":checkbox, :radio, select, :button"), type = trigger.attr("type"), evt = conf.events[type] || conf.events[isInput ? (isWidget ? 'widget' : 'input') : 'def']; // check that configuration is sane if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; } evt = evt.split(/,\s*/); if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; } // trigger --> show trigger.bind(evt[0], function(e) { if (conf.predelay) { clearTimeout(timer); pretimer = setTimeout(function() { self.show(e); }, conf.predelay); } else { self.show(e); } // trigger --> hide }).bind(evt[1], function(e) { if (conf.delay) { clearTimeout(pretimer); timer = setTimeout(function() { self.hide(e); }, conf.delay); } else { self.hide(e); } }); // remove default title if (title && conf.cancelDefault) { trigger.removeAttr("title"); trigger.data("title", title); } $.extend(self, { show: function(e) { // tip not initialized yet if (!tip) { // find a "manual" tooltip if (title) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide(); } else if (conf.tip) { tip = $(conf.tip).eq(0); } else { tip = trigger.next(); if (!tip.length) { tip = trigger.parent().next(); } } if (!tip.length) { throw "Cannot find tooltip for " + trigger; } } if (self.isShown()) { return self; } // stop previous animation tip.stop(true, true); // get position var pos = getPosition(trigger, tip, conf); // title attribute if (title) { tip.html(title); } // onBeforeShow e = e || $.Event(); e.type = "onBeforeShow"; fire.trigger(e, [pos]); if (e.isDefaultPrevented()) { return self; } // onBeforeShow may have altered the configuration pos = getPosition(trigger, tip, conf); // set position tip.css({position:'absolute', top: pos.top, left: pos.left}); shown = true; // invoke effect effect[0].call(self, function() { e.type = "onShow"; shown = 'full'; fire.trigger(e); }); // tooltip events var event = conf.events.tooltip.split(/,\s*/); tip.bind(event[0], function() { clearTimeout(timer); clearTimeout(pretimer); }); if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) { tip.bind(event[1], function(e) { // being moved to the trigger element if (e.relatedTarget != trigger[0]) { trigger.trigger(evt[1].split(" ")[0]); } }); } return self; }, hide: function(e) { if (!tip || !self.isShown()) { return self; } // onBeforeHide e = e || $.Event(); e.type = "onBeforeHide"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } shown = false; effects[conf.effect][1].call(self, function() { e.type = "onHide"; shown = false; fire.trigger(e); }); return self; }, isShown: function(fully) { return fully ? shown == 'full' : shown; }, getConf: function() { return conf; }, getTip: function() { return tip; }, getTrigger: function() { return trigger; } }); // callbacks $.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); }
if (title) { tip.html(title); }
function Tooltip(trigger, conf) { var self = this, fire = trigger.add(self), tip, timer = 0, pretimer = 0, title = trigger.attr("title"), effect = effects[conf.effect], shown, // get show/hide configuration isInput = trigger.is(":input"), isWidget = isInput && trigger.is(":checkbox, :radio, select, :button"), type = trigger.attr("type"), evt = conf.events[type] || conf.events[isInput ? (isWidget ? 'widget' : 'input') : 'def']; // check that configuration is sane if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; } evt = evt.split(/,\s*/); if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; } // trigger --> show trigger.bind(evt[0], function(e) { if (conf.predelay) { clearTimeout(timer); pretimer = setTimeout(function() { self.show(e); }, conf.predelay); } else { self.show(e); } // trigger --> hide }).bind(evt[1], function(e) { if (conf.delay) { clearTimeout(pretimer); timer = setTimeout(function() { self.hide(e); }, conf.delay); } else { self.hide(e); } }); // remove default title if (title && conf.cancelDefault) { trigger.removeAttr("title"); trigger.data("title", title); } $.extend(self, { show: function(e) { // tip not initialized yet if (!tip) { // find a "manual" tooltip if (title) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide(); } else if (conf.tip) { tip = $(conf.tip).eq(0); } else { tip = trigger.next(); if (!tip.length) { tip = trigger.parent().next(); } } if (!tip.length) { throw "Cannot find tooltip for " + trigger; } } if (self.isShown()) { return self; } // stop previous animation tip.stop(true, true); // get position var pos = getPosition(trigger, tip, conf); // title attribute if (title) { tip.html(title); } // onBeforeShow e = e || $.Event(); e.type = "onBeforeShow"; fire.trigger(e, [pos]); if (e.isDefaultPrevented()) { return self; } // onBeforeShow may have altered the configuration pos = getPosition(trigger, tip, conf); // set position tip.css({position:'absolute', top: pos.top, left: pos.left}); shown = true; // invoke effect effect[0].call(self, function() { e.type = "onShow"; shown = 'full'; fire.trigger(e); }); // tooltip events var event = conf.events.tooltip.split(/,\s*/); tip.bind(event[0], function() { clearTimeout(timer); clearTimeout(pretimer); }); if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) { tip.bind(event[1], function(e) { // being moved to the trigger element if (e.relatedTarget != trigger[0]) { trigger.trigger(evt[1].split(" ")[0]); } }); } return self; }, hide: function(e) { if (!tip || !self.isShown()) { return self; } // onBeforeHide e = e || $.Event(); e.type = "onBeforeHide"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } shown = false; effects[conf.effect][1].call(self, function() { e.type = "onHide"; shown = false; fire.trigger(e); }); return self; }, isShown: function(fully) { return fully ? shown == 'full' : shown; }, getConf: function() { return conf; }, getTip: function() { return tip; }, getTrigger: function() { return trigger; } }); // callbacks $.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); }
if (conf.tip) { tip = $(conf.tip); if (tip.length > 1) { tip = trigger.next(conf.tip); }
if (title) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body); } else { tip = trigger.next(); if (!tip.length) { tip = trigger.parent().next(); } if (!tip.length) { tip = $(conf.tip).eq(0); }
function Tooltip(trigger, conf) { var self = this, fire = trigger.add(self), tip, timer = 0, pretimer = 0, title = trigger.attr("title"), effect = effects[conf.effect], shown, // get show/hide configuration isInput = trigger.is(":input"), isWidget = isInput && trigger.is(":checkbox, :radio, select, :button"), type = trigger.attr("type"), evt = conf.events[type] || conf.events[isInput ? (isWidget ? 'widget' : 'input') : 'def']; // check that configuration is sane if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; } evt = evt.split(/,\s*/); if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; } // trigger --> show trigger.bind(evt[0], function(e) { if (conf.predelay) { clearTimeout(timer); pretimer = setTimeout(function() { self.show(e) }, conf.predelay); } else { self.show(e); } // trigger --> hide }).bind(evt[1], function(e) { if (conf.delay) { clearTimeout(pretimer); timer = setTimeout(function() { self.hide(e) }, conf.delay); } else { self.hide(e); } }); // remove default title if (title && conf.cancelDefault) { trigger.removeAttr("title"); trigger.data("title", title); } $.extend(self, { show: function(e) { // tip not initialized yet if (!tip) { // find a "manual" tooltip if (conf.tip) { tip = $(conf.tip); if (tip.length > 1) { tip = trigger.next(conf.tip); } } // create it if (!tip || !tip.length) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body); } } if (self.isShown()) { return self; } // stop previous animation tip.stop(true, true); // get position var pos = getPosition(trigger, tip, conf); // title attribute if (title) { tip.html(title); } // onBeforeShow e = e || $.Event(); e.type = "onBeforeShow"; fire.trigger(e, [pos]); if (e.isDefaultPrevented()) { return self; } // onBeforeShow may have altered the configuration pos = getPosition(trigger, tip, conf); // set position tip.css({position:'absolute', top: pos.top, left: pos.left}); shown = true; // invoke effect effect[0].call(self, function() { e.type = "onShow"; shown = 'full'; fire.trigger(e); }); // tooltip events var event = conf.events.tooltip.split(/,\s*/); tip.bind(event[0], function() { clearTimeout(timer); clearTimeout(pretimer); }); if (event[1]) { tip.bind(event[1], function(e) { // being moved to the trigger element if (e.relatedTarget != trigger[0]) { trigger.trigger(evt[1]); } }); } return self; }, hide: function(e) { if (!tip || !self.isShown()) { return self; } // onBeforeHide e = e || $.Event(); e.type = "onBeforeHide"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } shown = false; effects[conf.effect][1].call(self, function() { e.type = "onHide"; fire.trigger(e); }); return self; }, isShown: function(fully) { return fully ? shown == 'full' : shown; }, getConf: function() { return conf; }, getTip: function() { return tip; }, getTrigger: function() { return trigger; } }); // callbacks $.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); }
if (!tip || !tip.length) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body); }
} if (tip.length) { tip.hide() } else { throw "Cannot find tooltip for " + trigger;
function Tooltip(trigger, conf) { var self = this, fire = trigger.add(self), tip, timer = 0, pretimer = 0, title = trigger.attr("title"), effect = effects[conf.effect], shown, // get show/hide configuration isInput = trigger.is(":input"), isWidget = isInput && trigger.is(":checkbox, :radio, select, :button"), type = trigger.attr("type"), evt = conf.events[type] || conf.events[isInput ? (isWidget ? 'widget' : 'input') : 'def']; // check that configuration is sane if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; } evt = evt.split(/,\s*/); if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; } // trigger --> show trigger.bind(evt[0], function(e) { if (conf.predelay) { clearTimeout(timer); pretimer = setTimeout(function() { self.show(e) }, conf.predelay); } else { self.show(e); } // trigger --> hide }).bind(evt[1], function(e) { if (conf.delay) { clearTimeout(pretimer); timer = setTimeout(function() { self.hide(e) }, conf.delay); } else { self.hide(e); } }); // remove default title if (title && conf.cancelDefault) { trigger.removeAttr("title"); trigger.data("title", title); } $.extend(self, { show: function(e) { // tip not initialized yet if (!tip) { // find a "manual" tooltip if (conf.tip) { tip = $(conf.tip); if (tip.length > 1) { tip = trigger.next(conf.tip); } } // create it if (!tip || !tip.length) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body); } } if (self.isShown()) { return self; } // stop previous animation tip.stop(true, true); // get position var pos = getPosition(trigger, tip, conf); // title attribute if (title) { tip.html(title); } // onBeforeShow e = e || $.Event(); e.type = "onBeforeShow"; fire.trigger(e, [pos]); if (e.isDefaultPrevented()) { return self; } // onBeforeShow may have altered the configuration pos = getPosition(trigger, tip, conf); // set position tip.css({position:'absolute', top: pos.top, left: pos.left}); shown = true; // invoke effect effect[0].call(self, function() { e.type = "onShow"; shown = 'full'; fire.trigger(e); }); // tooltip events var event = conf.events.tooltip.split(/,\s*/); tip.bind(event[0], function() { clearTimeout(timer); clearTimeout(pretimer); }); if (event[1]) { tip.bind(event[1], function(e) { // being moved to the trigger element if (e.relatedTarget != trigger[0]) { trigger.trigger(evt[1]); } }); } return self; }, hide: function(e) { if (!tip || !self.isShown()) { return self; } // onBeforeHide e = e || $.Event(); e.type = "onBeforeHide"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } shown = false; effects[conf.effect][1].call(self, function() { e.type = "onHide"; fire.trigger(e); }); return self; }, isShown: function(fully) { return fully ? shown == 'full' : shown; }, getConf: function() { return conf; }, getTip: function() { return tip; }, getTrigger: function() { return trigger; } }); // callbacks $.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); }
var defaults = this.optionsWithDefaults({precision: 3}, this.lookup("number.percentage.format")); options = this.optionsWithDefaults(defaults, options);
options = this.optionsWithDefaults(this.lookup("number.percentage.format"), options); options = this.optionsWithDefaults(this.lookup("number.format"), options); options = this.optionsWithDefaults({ precision: 3, separator: ".", delimiter: "" }, options);
I18n.toPercentage = function(number, options) { var defaults = this.optionsWithDefaults({precision: 3}, this.lookup("number.percentage.format")); options = this.optionsWithDefaults(defaults, options); number = this.toNumber(number, options); return number + "%";};
alert('Field labeled "' + this.label + '" expects an integer value.');
alert('Field labeled "' + field.label + '" expects an integer value.');
toValue: function(doc) { var fieldEl = this.node, field = this.settings, type = field.type; switch (type) { case 'checkbox': this.value = fieldEl.checked; break; case 'select': this.value = fieldEl[fieldEl.selectedIndex].value; break; case 'radio': var radios = fieldEl.getElementsByTagName('input'); for (var i = 0, len = radios.length; i < len; ++i) if (radios[i].checked) this.value = radios[i].value; break; case 'button': break; case 'int': var num = Number(fieldEl.value); if (isNaN(num) || Math.ceil(num) != Math.floor(num)) { alert('Field labeled "' + this.label + '" expects an integer value.'); return false; } this.value = num; break; case 'float': var num = Number(fieldEl.value); if (isNaN(num)) { alert('Field labeled "' + this.label + '" expects a number value.'); return false; } this.value = num; break; default: this.value = fieldEl.value; break; } return true; // value read successfully }
alert('Field labeled "' + this.label + '" expects a number value.');
alert('Field labeled "' + field.label + '" expects a number value.');
toValue: function(doc) { var fieldEl = this.node, field = this.settings, type = field.type; switch (type) { case 'checkbox': this.value = fieldEl.checked; break; case 'select': this.value = fieldEl[fieldEl.selectedIndex].value; break; case 'radio': var radios = fieldEl.getElementsByTagName('input'); for (var i = 0, len = radios.length; i < len; ++i) if (radios[i].checked) this.value = radios[i].value; break; case 'button': break; case 'int': var num = Number(fieldEl.value); if (isNaN(num) || Math.ceil(num) != Math.floor(num)) { alert('Field labeled "' + this.label + '" expects an integer value.'); return false; } this.value = num; break; case 'float': var num = Number(fieldEl.value); if (isNaN(num)) { alert('Field labeled "' + this.label + '" expects a number value.'); return false; } this.value = num; break; default: this.value = fieldEl.value; break; } return true; // value read successfully }
var arr = str.split('\\'); if (arr.length === 1) return str; var out = null; arr.each(function(s) { if (out === null) out = s; else if (s.length < 2) out += "\\" + s;
var arr = str.split('\\'); if (arr.length === 1) return str; var out = null; arr.each(function(s) { if (out === null) out = s; else if (s.length < 2) out += "\\" + s; else { var c = charMap[s.substring(0, 2)]; if (c !== undefined) out += c + s.substring(2);
this.translateString = function(str) { var arr = str.split('\\'); if (arr.length === 1) return str; var out = null; arr.each(function(s) { if (out === null) out = s; else if (s.length < 2) out += "\\" + s; else { var c = charMap[s.substring(0, 2)]; if (c !== undefined) out += c + s.substring(2); else { c = charMap2[s.substring(0, 3)]; if (c !== undefined) out += c + s.substring(3); else out += "\\" + s; } } }); return out; };
var c = charMap[s.substring(0, 2)];
c = charMap2[s.substring(0, 3)];
this.translateString = function(str) { var arr = str.split('\\'); if (arr.length === 1) return str; var out = null; arr.each(function(s) { if (out === null) out = s; else if (s.length < 2) out += "\\" + s; else { var c = charMap[s.substring(0, 2)]; if (c !== undefined) out += c + s.substring(2); else { c = charMap2[s.substring(0, 3)]; if (c !== undefined) out += c + s.substring(3); else out += "\\" + s; } } }); return out; };
out += c + s.substring(2); else { c = charMap2[s.substring(0, 3)]; if (c !== undefined) out += c + s.substring(3); else out += "\\" + s; }
out += c + s.substring(3); else out += "\\" + s;
this.translateString = function(str) { var arr = str.split('\\'); if (arr.length === 1) return str; var out = null; arr.each(function(s) { if (out === null) out = s; else if (s.length < 2) out += "\\" + s; else { var c = charMap[s.substring(0, 2)]; if (c !== undefined) out += c + s.substring(2); else { c = charMap2[s.substring(0, 3)]; if (c !== undefined) out += c + s.substring(3); else out += "\\" + s; } } }); return out; };
}); return out; };
} }); return out; };
this.translateString = function(str) { var arr = str.split('\\'); if (arr.length === 1) return str; var out = null; arr.each(function(s) { if (out === null) out = s; else if (s.length < 2) out += "\\" + s; else { var c = charMap[s.substring(0, 2)]; if (c !== undefined) out += c + s.substring(2); else { c = charMap2[s.substring(0, 3)]; if (c !== undefined) out += c + s.substring(3); else out += "\\" + s; } } }); return out; };
this.request.post($merge(myRequestOptions,options));
if (reqRunning) { reqQueue.chain(arguments.callee.bind(this,options)); } else { reqRunning = true; this.request.post.delay(20,this.request,$merge(myRequestOptions,options)); }
transmit: function (options) { this.request.post($merge(myRequestOptions,options)); }
var start = -1, end = this.length;
var end = this.length, start = -1;
String.prototype.trim = function() { var start = -1, end = this.length; while (this.charCodeAt(--end) < 33); while (++start < end && this.charCodeAt(start) < 33); return this.slice(start, end + 1); };
while (this.charCodeAt(--end) < 33); while (++start < end && this.charCodeAt(start) < 33);
while (this.charCodeAt(--end) < 33) {} while (++start < end && this.charCodeAt(start) < 33) {}
String.prototype.trim = function() { var end = this.length, start = -1; while (this.charCodeAt(--end) < 33); while (++start < end && this.charCodeAt(start) < 33); return this.slice(start, end + 1); };
ba=hideLoadingIndicator;showLoadingIndicator()}function o(d){ha=d}function E(d){if(d){d="(function() {"+d+"})();";window.execScript?window.execScript(d):window.eval(d)}q._p_.autoJavaScript()}function u(d,c,e){if(!P){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();E(c);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+j.description)}_$_$endif_$_();e&&k(e)}else A=da.concat(A);da=[];if(L){clearTimeout(L);L=null}K=null;if(d>0)++X;else X=0;if(!P)if(ha||A.length> 0)if(d==1){d=Math.min(12E4,Math.exp(X)*500);Q=setTimeout(function(){v()},d)}else v()}}function s(){K.abort();L=K=null;P||v()}function z(d,c,e,j){m.checkReleaseCapture(d,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!K){_$_$endif_$_();var n={},i=A.length;n.object=d;n.signal=c;n.event=e;n.feedback=j;A[i]=B(n,i);x();E();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function x(){if(K!=null&&L!=null){clearTimeout(L);K.abort();K=null}if(K==null)if(Q==null){Q=setTimeout(function(){v()},m.updateDelay);
var _$_WT_CLASS_$_=new (function(){function x(a,b){return a.style[b]?a.style[b]:document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null)[b]:a.currentStyle?a.currentStyle[b]:null}function u(a){if(B==null)return null;if(!a)a=window.event;if(a){for(var b=a=g.target(a);b&&b!=B;)b=b.parentNode;return b==B?g.isIE?a:null:B}else return B}function D(a){var b=u(a);if(b&&!S){if(!a)a=window.event;S=true;if(g.isIE){g.firedTarget=a.srcElement||b;b.fireEvent("onmousemove",
ba=hideLoadingIndicator;showLoadingIndicator()}function o(d){ha=d}function E(d){if(d){d="(function() {"+d+"})();";window.execScript?window.execScript(d):window.eval(d)}q._p_.autoJavaScript()}function u(d,c,e){if(!P){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();E(c);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+j.description)}_$_$endif_$_();e&&k(e)}else A=da.concat(A);da=[];if(L){clearTimeout(L);L=null}K=null;if(d>0)++X;else X=0;if(!P)if(ha||A.length>0)if(d==1){d=Math.min(12E4,Math.exp(X)*500);Q=setTimeout(function(){v()},d)}else v()}}function s(){K.abort();L=K=null;P||v()}function z(d,c,e,j){m.checkReleaseCapture(d,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!K){_$_$endif_$_();var n={},i=A.length;n.object=d;n.signal=c;n.event=e;n.feedback=j;A[i]=B(n,i);x();E();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function x(){if(K!=null&&L!=null){clearTimeout(L);K.abort();K=null}if(K==null)if(Q==null){Q=setTimeout(function(){v()},m.updateDelay);
x()}function U(d,c,e){var j=function(){var i=m.getElement(d);if(i){if(e)i.timer=setTimeout(i.tm,c);else{i.timer=null;i.tm=null}i.onclick&&i.onclick()}},n=m.getElement(d);n.timer=setTimeout(j,c);n.tm=j}function M(d,c){setTimeout(function(){if(R[d]===true)c();else R[d]=c},20)}function G(d){if(R[d]!==true){typeof R[d]!=="undefined"&&R[d]();R[d]=true}}function C(d,c){var e=false;if(c!="")try{e=!eval("typeof "+c+" === 'undefined'")}catch(j){e=false}if(e)G(d);else{var n=document.createElement("script");
4)i=4;e+=c+"button="+i;if(typeof j.keyCode!=="undefined")e+=c+"keyCode="+j.keyCode;if(typeof j.charCode!=="undefined")e+=c+"charCode="+j.charCode;if(j.altKey)e+=c+"altKey=1";if(j.ctrlKey)e+=c+"ctrlKey=1";if(j.metaKey)e+=c+"metaKey=1";if(j.shiftKey)e+=c+"shiftKey=1";d.data=e;return d}function S(){for(var d="",c=false,e=0;e<A.length;++e){c=c||A[e].feedback;d+=A[e].data}da=A;A=[];return{feedback:c,result:d}}function U(){P=true;if(X){clearTimeout(X);X=null}var d=$("#Wt-timers");d.size()>0&&m.setHtml(d.get(0), "",false)}function a(){m.history._initTimeout();Y==0&&z(null,"none",null,false);X=setTimeout(a,_$_KEEP_ALIVE_$_000)}function b(d){if(!m.isIEMobile)document.title=d}function f(){if(!document.activeElement){function d(e){if(e&&e.target)document.activeElement=e.target==document?null:e.target}function c(){document.activeElement=null}document.addEventListener("focus",d,true);document.addEventListener("blur",c,true)}m.history._initialize();T();if(!ga){ga=true;_$_ONLOAD_$_();P||(X=setTimeout(a,_$_KEEP_ALIVE_$_000))}}
x()}function U(d,c,e){var j=function(){var i=m.getElement(d);if(i){if(e)i.timer=setTimeout(i.tm,c);else{i.timer=null;i.tm=null}i.onclick&&i.onclick()}},n=m.getElement(d);n.timer=setTimeout(j,c);n.tm=j}function M(d,c){setTimeout(function(){if(R[d]===true)c();else R[d]=c},20)}function G(d){if(R[d]!==true){typeof R[d]!=="undefined"&&R[d]();R[d]=true}}function C(d,c){var e=false;if(c!="")try{e=!eval("typeof "+c+" === 'undefined'")}catch(j){e=false}if(e)G(d);else{var n=document.createElement("script");
d)}else s()}}function n(){K.abort();N=K=null;R||s()}function H(d,c,f,k){g.checkReleaseCapture(d,f);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!K){_$_$endif_$_();var m={},i=z.length;m.object=d;m.signal=c;m.event=f;m.feedback=k;z[i]=aa(m,i);u();j();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function u(){if(K!=null&&N!=null){clearTimeout(N);K.abort();K=null}if(K==null)if(S==null){S=setTimeout(function(){s()},g.updateDelay);ia=(new Date).getTime()}else if(Y){clearTimeout(S);s()}else if((new Date).getTime()- ia>g.updateDelay){clearTimeout(S);s()}}function q(d){ea=d;E._p_.comm.responseReceived(d)}function s(){S=null;if(R){if(!ja){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;ja=true}}else{var d,c,f,k="&rand="+Math.round(Math.random(ka)*1E5);if(z.length>0){d=h();c=d.feedback?setTimeout(b,_$_INDICATOR_TIMEOUT_$_):null;f=false}else{d={result:"signal=poll"};c=null;f=true}K=E._p_.comm.sendUpdate(la+k,"request=jsupdate&"+d.result+"&ackId="+ea,c,ea,-1);
d)}else s()}}function n(){J.abort();N=J=null;R||s()}function H(d,c,f,k){g.checkReleaseCapture(d,f);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!J){_$_$endif_$_();var m={},i=z.length;m.object=d;m.signal=c;m.event=f;m.feedback=k;z[i]=aa(m,i);u();j();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function u(){if(J!=null&&N!=null){clearTimeout(N);J.abort();J=null}if(J==null)if(S==null){S=setTimeout(function(){s()},g.updateDelay);ia=(new Date).getTime()}else if(Y){clearTimeout(S);s()}else if((new Date).getTime()- ia>g.updateDelay){clearTimeout(S);s()}}function q(d){ea=d;E._p_.comm.responseReceived(d)}function s(){if(!J){S=null;if(R){if(!ja){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;ja=true}}else{var d,c,f,k="&rand="+Math.round(Math.random(ka)*1E5);if(z.length>0){d=h();c=d.feedback?setTimeout(b,_$_INDICATOR_TIMEOUT_$_):null;f=false}else{d={result:"&signal=poll"};c=null;f=true}J=E._p_.comm.sendUpdate(la+k,"request=jsupdate"+d.result+"&ackId="+ea,c,
d)}else s()}}function n(){K.abort();N=K=null;R||s()}function H(d,c,f,k){g.checkReleaseCapture(d,f);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!K){_$_$endif_$_();var m={},i=z.length;m.object=d;m.signal=c;m.event=f;m.feedback=k;z[i]=aa(m,i);u();j();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function u(){if(K!=null&&N!=null){clearTimeout(N);K.abort();K=null}if(K==null)if(S==null){S=setTimeout(function(){s()},g.updateDelay);ia=(new Date).getTime()}else if(Y){clearTimeout(S);s()}else if((new Date).getTime()-ia>g.updateDelay){clearTimeout(S);s()}}function q(d){ea=d;E._p_.comm.responseReceived(d)}function s(){S=null;if(R){if(!ja){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;ja=true}}else{var d,c,f,k="&rand="+Math.round(Math.random(ka)*1E5);if(z.length>0){d=h();c=d.feedback?setTimeout(b,_$_INDICATOR_TIMEOUT_$_):null;f=false}else{d={result:"signal=poll"};c=null;f=true}K=E._p_.comm.sendUpdate(la+k,"request=jsupdate&"+d.result+"&ackId="+ea,c,ea,-1);
function o(c,d,e){if(!R){if(c==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();n(d);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+j.description)}_$_$endif_$_();e&&b(e)}else y=ga.concat(y);ga=[];if(O){clearTimeout(O);O=null}F=null;if(c>0)++ba;else ba=0;if(!R)if(ka||y.length>0)if(c==1){c=Math.min(12E4,Math.exp(ba)*500);S=setTimeout(function(){r()},c)}else r()}}function L(){F.abort();O=F=null;R||r()}function u(c,d,e,j){h.checkReleaseCapture(c,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_(); if(!F){_$_$endif_$_();var m={},i=y.length;m.object=c;m.signal=d;m.event=e;m.feedback=j;y[i]=g(m,i);q();n();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function q(){_$_$if_WEB_SOCKETS_$_();if(I.state!=2)if(window.WebSocket===undefined)I.state=2;else{var c=I.socket;if(c==null||c.readyState>1)if(c!=null&&I.state==0)I.state=2;else{c=ha.substr(ha.indexOf("?"));c="ws"+location.protocol.substr(4)+"
P=F=null;R||r()}function u(c,d,e,j){h.checkReleaseCapture(c,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!F){_$_$endif_$_();var m={},i=y.length;m.object=c;m.signal=d;m.event=e;m.feedback=j;y[i]=g(m,i);q();n();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function q(){_$_$if_WEB_SOCKETS_$_();if(I.state!=2)if(typeof window.WebSocket==="undefined")I.state=2;else{var c=I.socket;if(c==null||c.readyState>1)if(c!=null&&I.state==0)I.state=2;else{c=ha.substr(ha.indexOf("?"));c="ws"+location.protocol.substr(4)+
function o(c,d,e){if(!R){if(c==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();n(d);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+j.description)}_$_$endif_$_();e&&b(e)}else y=ga.concat(y);ga=[];if(O){clearTimeout(O);O=null}F=null;if(c>0)++ba;else ba=0;if(!R)if(ka||y.length>0)if(c==1){c=Math.min(12E4,Math.exp(ba)*500);S=setTimeout(function(){r()},c)}else r()}}function L(){F.abort();O=F=null;R||r()}function u(c,d,e,j){h.checkReleaseCapture(c,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!F){_$_$endif_$_();var m={},i=y.length;m.object=c;m.signal=d;m.event=e;m.feedback=j;y[i]=g(m,i);q();n();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function q(){_$_$if_WEB_SOCKETS_$_();if(I.state!=2)if(window.WebSocket===undefined)I.state=2;else{var c=I.socket;if(c==null||c.readyState>1)if(c!=null&&I.state==0)I.state=2;else{c=ha.substr(ha.indexOf("?"));c="ws"+location.protocol.substr(4)+"//"+location.hostname+":"+location.port+location.pathname+c;I.socket=c=new WebSocket(c);c.onmessage=
null){try{aa()}catch(c){}aa=null}}function K(){document.body.style.cursor="wait";aa=hideLoadingIndicator;showLoadingIndicator()}function u(d){ga=d}function q(d){if(d)window.execScript?window.execScript(d):window.eval(d);_$_APP_CLASS_$_._p_.autoJavaScript()}function D(d,c,f){if(!Q){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();q(c);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+j.description)}_$_$endif_$_();f&&n(f)}else z=ca.concat(z);ca=[];if(O){clearTimeout(O);
f.target)document.activeElement=f.target==document?null:f.target}function c(){document.activeElement=null}document.addEventListener("focus",d,true);document.addEventListener("blur",c,true)}o.history._initialize();aa();if(!fa){fa=true;_$_ONLOAD_$_();P||(V=setTimeout(e,_$_KEEP_ALIVE_$_000))}}function n(d){clearTimeout(d);document.body.style.cursor="auto";if(Z!=null){try{Z()}catch(c){}Z=null}}function J(){document.body.style.cursor="wait";Z=hideLoadingIndicator;showLoadingIndicator()}function u(d){ga= d}function q(d){if(d)window.execScript?window.execScript(d):window.eval(d);_$_APP_CLASS_$_._p_.autoJavaScript()}function C(d,c,f){if(!P){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();q(c);_$_$ifnot_DEBUG_$_()}catch(k){alert("Wt internal error: "+k+", code: "+k.code+", description: "+k.description)}_$_$endif_$_();f&&n(f)}else y=ba.concat(y);ba=[];if(N){clearTimeout(N);N=null}I=null;if(d>0)++W;else W=0;if(!P)if(ga||y.length>0)if(d==1){d=Math.min(12E4,Math.exp(W)*500);Q=setTimeout(function(){F()},
null){try{aa()}catch(c){}aa=null}}function K(){document.body.style.cursor="wait";aa=hideLoadingIndicator;showLoadingIndicator()}function u(d){ga=d}function q(d){if(d)window.execScript?window.execScript(d):window.eval(d);_$_APP_CLASS_$_._p_.autoJavaScript()}function D(d,c,f){if(!Q){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();q(c);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+j.description)}_$_$endif_$_();f&&n(f)}else z=ca.concat(z);ca=[];if(O){clearTimeout(O);
d,true);document.addEventListener("blur",c,true)}n.history._initialize();T();if(!ga){ga=true;_$_ONLOAD_$_();P||(W=setTimeout(a,_$_KEEP_ALIVE_$_000))}}function h(d){clearTimeout(d);document.body.style.cursor="auto";if(ba!=null){try{ba()}catch(c){}ba=null}}function k(){document.body.style.cursor="wait";ba=hideLoadingIndicator;showLoadingIndicator()}function o(d){ha=d}function E(d){if(d){d="(function() {"+d+"})();";window.execScript?window.execScript(d):window.eval(d)}q._p_.autoJavaScript()}function u(d, c,e){if(!P){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();E(c);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+j.description)}_$_$endif_$_();e&&h(e)}else A=da.concat(A);da=[];if(L){clearTimeout(L);L=null}K=null;if(d>0)++X;else X=0;if(!P)if(ha||A.length>0)if(d==1){d=Math.min(12E4,Math.exp(X)*500);Q=setTimeout(function(){v()},d)}else v()}}function r(){K.abort();L=K=null;P||v()}function y(d,c,e,j){n.checkReleaseCapture(d,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();
d+"})();";window.execScript?window.execScript(d):window.eval(d)}q._p_.autoJavaScript()}function u(d,c,e){if(!P){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();E(c);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+j.description)}_$_$endif_$_();e&&h(e)}else A=da.concat(A);da=[];if(L){clearTimeout(L);L=null}K=null;if(d>0)++X;else X=0;if(!P)if(ha||A.length>0)if(d==1){d=Math.min(12E4,Math.exp(X)*500);Q=setTimeout(function(){v()},d)}else v()}}function r(){K.abort();
d,true);document.addEventListener("blur",c,true)}n.history._initialize();T();if(!ga){ga=true;_$_ONLOAD_$_();P||(W=setTimeout(a,_$_KEEP_ALIVE_$_000))}}function h(d){clearTimeout(d);document.body.style.cursor="auto";if(ba!=null){try{ba()}catch(c){}ba=null}}function k(){document.body.style.cursor="wait";ba=hideLoadingIndicator;showLoadingIndicator()}function o(d){ha=d}function E(d){if(d){d="(function() {"+d+"})();";window.execScript?window.execScript(d):window.eval(d)}q._p_.autoJavaScript()}function u(d,c,e){if(!P){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();E(c);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+j.description)}_$_$endif_$_();e&&h(e)}else A=da.concat(A);da=[];if(L){clearTimeout(L);L=null}K=null;if(d>0)++X;else X=0;if(!P)if(ha||A.length>0)if(d==1){d=Math.min(12E4,Math.exp(X)*500);Q=setTimeout(function(){v()},d)}else v()}}function r(){K.abort();L=K=null;P||v()}function y(d,c,e,j){n.checkReleaseCapture(d,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();
showLoadingIndicator()}function E(d){ea=d}function q(d){if(d)if(window.execScript)window.execScript(d);else with(window)eval(d);_$_APP_CLASS_$_._p_.autoJavaScript()}function u(d,c,e){if(!ba){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();q(c);_$_$ifnot_DEBUG_$_()}catch(h){alert("Wt internal error: "+h+", code: "+h.code+", description: "+h.description)}_$_$endif_$_();e&&l(e)}else z=Z.concat(z);Z=[];if(M){clearTimeout(M);M=null}G=null;if(d>0)++T;else T=0;if(ea||z.length>0)if(d==1){d=Math.min(12E4, Math.exp(T)*500);P=setTimeout(function(){w()},d)}else w()}}function H(){G.abort();M=G=null;w()}function A(d,c,e,h){g.checkReleaseCapture(d,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!G){_$_$endif_$_();var i={},j=z.length;i.object=d;i.signal=c;i.event=e;i.feedback=h;z[j]=R(i,j);F();q();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function F(){if(G!=null&&M!=null){clearTimeout(M);G.abort();G=null}if(G==null)if(P==null){P=setTimeout(function(){w()},g.updateDelay);fa=(new Date).getTime()}else if(T){clearTimeout(P);
showLoadingIndicator()}function E(d){ea=d}function q(d){if(d)window.execScript?window.execScript(d):window.eval(d);_$_APP_CLASS_$_._p_.autoJavaScript()}function u(d,c,e){if(!ba){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();q(c);_$_$ifnot_DEBUG_$_()}catch(h){alert("Wt internal error: "+h+", code: "+h.code+", description: "+h.description)}_$_$endif_$_();e&&l(e)}else z=Z.concat(z);Z=[];if(M){clearTimeout(M);M=null}G=null;if(d>0)++T;else T=0;if(ea||z.length>0)if(d==1){d=Math.min(12E4,Math.exp(T)* 500);P=setTimeout(function(){w()},d)}else w()}}function H(){G.abort();M=G=null;w()}function A(d,c,e,h){g.checkReleaseCapture(d,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!G){_$_$endif_$_();var i={},j=z.length;i.object=d;i.signal=c;i.event=e;i.feedback=h;z[j]=R(i,j);F();q();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function F(){if(G!=null&&M!=null){clearTimeout(M);G.abort();G=null}if(G==null)if(P==null){P=setTimeout(function(){w()},g.updateDelay);fa=(new Date).getTime()}else if(T){clearTimeout(P);
showLoadingIndicator()}function E(d){ea=d}function q(d){if(d)if(window.execScript)window.execScript(d);else with(window)eval(d);_$_APP_CLASS_$_._p_.autoJavaScript()}function u(d,c,e){if(!ba){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();q(c);_$_$ifnot_DEBUG_$_()}catch(h){alert("Wt internal error: "+h+", code: "+h.code+", description: "+h.description)}_$_$endif_$_();e&&l(e)}else z=Z.concat(z);Z=[];if(M){clearTimeout(M);M=null}G=null;if(d>0)++T;else T=0;if(ea||z.length>0)if(d==1){d=Math.min(12E4,Math.exp(T)*500);P=setTimeout(function(){w()},d)}else w()}}function H(){G.abort();M=G=null;w()}function A(d,c,e,h){g.checkReleaseCapture(d,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!G){_$_$endif_$_();var i={},j=z.length;i.object=d;i.signal=c;i.event=e;i.feedback=h;z[j]=R(i,j);F();q();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function F(){if(G!=null&&M!=null){clearTimeout(M);G.abort();G=null}if(G==null)if(P==null){P=setTimeout(function(){w()},g.updateDelay);fa=(new Date).getTime()}else if(T){clearTimeout(P);
s(x);});},s=function(x){var y=x.config,z=y.plugins,A=y.extraPlugins,B=y.removePlugins;if(A){var C=new RegExp('(?:^|,)(?:'+A.replace(/\s*,\s*/g,'|')+')(?=,|$)','g');z=z.replace(C,'');z+=','+A;}if(B){C=new RegExp('(?:^|,)(?:'+B.replace(/\s*,\s*/g,'|')+')(?=,|$)','g');z=z.replace(C,'');}j.load(z.split(','),function(D){var E=[],F=[],G=[];x.plugins=D;for(var H in D){var I=D[H],J=I.lang,K=j.getPath(H),L=null;I.path=K;if(J){L=e.indexOf(J,x.langCode)>=0?x.langCode:J[0];if(!I.lang[L])G.push(a.getUrl(K+'lang/'+L+'.js'));else{e.extend(x.lang,I.lang[L]);L=null;}}F.push(L);E.push(I);}a.scriptLoader.load(G,function(){var M=['beforeInit','init','afterInit'];for(var N=0;N<M.length;N++)for(var O=0;O<E.length;O++){var P=E[O];if(N===0&&F[O]&&P.lang)e.extend(x.lang,P.lang[F[O]]);if(P[M[N]])P[M[N]](x);}x.fire('pluginsLoaded');u(x);});});},t=function(x){a.skins.load(x,'editor',function(){r(x);});},u=function(x){var y=x.config.theme;a.themes.load(y,function(){var z=x.theme=a.themes.get(y);z.path=a.themes.getPath(y);z.build(x);if(x.config.autoUpdateElement)v(x);});},v=function(x){var y=x.element;if(x.elementMode==1&&y.is('textarea')){var z=y.$.form&&new h(y.$.form);if(z){function A(){x.updateElement();};z.on('submit',A);if(!z.$.submit.nodeName)z.$.submit=e.override(z.$.submit,function(B){return function(){x.updateElement();if(B.apply)B.apply(this,arguments);else B();};});x.on('destroy',function(){z.removeListener('submit',A);});}}};function w(){var x,y=this._.commands,z=this.mode;for(var A in y){x=y[A];x[x.startDisabled?'disable':x.modes[z]?'enable':'disable']();}};a.editor.prototype._init=function(){var z=this;var x=h.get(z._.element),y=z._.instanceConfig;delete z._.element;delete z._.instanceConfig;z._.commands={};z._.styles=[];z.element=x;z.name=x&&z.elementMode==1&&(x.getId()||x.getNameAtt())||m();if(z.name in a.instances)throw '[CKEDITOR.editor] The instance "'+z.name+'" already exists.';z.config=e.prototypedCopy(i);z.ui=new k(z);z.focusManager=new a.focusManager(z);a.fire('instanceCreated',null,z);z.on('mode',w,null,null,1);p(z,y);};})();e.extend(a.editor.prototype,{addCommand:function(l,m){return this._.commands[l]=new a.command(this,m);},addCss:function(l){this._.styles.push(l);},destroy:function(l){var r=this;if(!l)r.updateElement();if(r.mode)r._.modes[r.mode].unload(r.getThemeSpace('contents'));r.theme.destroy(r);var m,n=0,o,p,q;if(r.toolbox){m=r.toolbox.toolbars;for(;n<m.length;n++){p=m[n].items;for(o=0;o<p.length;o++){q=p[o];if(q.clickFn)e.removeFunction(q.clickFn);if(q.keyDownFn)e.removeFunction(q.keyDownFn);
}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);
s(x);});},s=function(x){var y=x.config,z=y.plugins,A=y.extraPlugins,B=y.removePlugins;if(A){var C=new RegExp('(?:^|,)(?:'+A.replace(/\s*,\s*/g,'|')+')(?=,|$)','g');z=z.replace(C,'');z+=','+A;}if(B){C=new RegExp('(?:^|,)(?:'+B.replace(/\s*,\s*/g,'|')+')(?=,|$)','g');z=z.replace(C,'');}j.load(z.split(','),function(D){var E=[],F=[],G=[];x.plugins=D;for(var H in D){var I=D[H],J=I.lang,K=j.getPath(H),L=null;I.path=K;if(J){L=e.indexOf(J,x.langCode)>=0?x.langCode:J[0];if(!I.lang[L])G.push(a.getUrl(K+'lang/'+L+'.js'));else{e.extend(x.lang,I.lang[L]);L=null;}}F.push(L);E.push(I);}a.scriptLoader.load(G,function(){var M=['beforeInit','init','afterInit'];for(var N=0;N<M.length;N++)for(var O=0;O<E.length;O++){var P=E[O];if(N===0&&F[O]&&P.lang)e.extend(x.lang,P.lang[F[O]]);if(P[M[N]])P[M[N]](x);}x.fire('pluginsLoaded');u(x);});});},t=function(x){a.skins.load(x,'editor',function(){r(x);});},u=function(x){var y=x.config.theme;a.themes.load(y,function(){var z=x.theme=a.themes.get(y);z.path=a.themes.getPath(y);z.build(x);if(x.config.autoUpdateElement)v(x);});},v=function(x){var y=x.element;if(x.elementMode==1&&y.is('textarea')){var z=y.$.form&&new h(y.$.form);if(z){function A(){x.updateElement();};z.on('submit',A);if(!z.$.submit.nodeName)z.$.submit=e.override(z.$.submit,function(B){return function(){x.updateElement();if(B.apply)B.apply(this,arguments);else B();};});x.on('destroy',function(){z.removeListener('submit',A);});}}};function w(){var x,y=this._.commands,z=this.mode;for(var A in y){x=y[A];x[x.startDisabled?'disable':x.modes[z]?'enable':'disable']();}};a.editor.prototype._init=function(){var z=this;var x=h.get(z._.element),y=z._.instanceConfig;delete z._.element;delete z._.instanceConfig;z._.commands={};z._.styles=[];z.element=x;z.name=x&&z.elementMode==1&&(x.getId()||x.getNameAtt())||m();if(z.name in a.instances)throw '[CKEDITOR.editor] The instance "'+z.name+'" already exists.';z.config=e.prototypedCopy(i);z.ui=new k(z);z.focusManager=new a.focusManager(z);a.fire('instanceCreated',null,z);z.on('mode',w,null,null,1);p(z,y);};})();e.extend(a.editor.prototype,{addCommand:function(l,m){return this._.commands[l]=new a.command(this,m);},addCss:function(l){this._.styles.push(l);},destroy:function(l){var r=this;if(!l)r.updateElement();if(r.mode)r._.modes[r.mode].unload(r.getThemeSpace('contents'));r.theme.destroy(r);var m,n=0,o,p,q;if(r.toolbox){m=r.toolbox.toolbars;for(;n<m.length;n++){p=m[n].items;for(o=0;o<p.length;o++){q=p[o];if(q.clickFn)e.removeFunction(q.clickFn);if(q.keyDownFn)e.removeFunction(q.keyDownFn);
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)|| [0,"0"])[1];return b},browser:{}});G=d.uaMatch(G);if(G.browser){d.browser[G.browser]=true;d.browser.version=G.version}if(d.browser.webkit)d.browser.safari=true;if(O)d.inArray=function(a,b){return O.call(b,a)};N=d(r);if(r.addEventListener)E=function(){r.removeEventListener("DOMContentLoaded",E,false);d.ready()};else if(r.attachEvent)E=function(){if(r.readyState==="complete"){r.detachEvent("onreadystatechange",E);d.ready()}};if(O)d.inArray=function(a,b){return O.call(b,a)};(function(){d.support={};
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)|| [0,"0"])[1];return b},browser:{}});G=c.uaMatch(G);if(G.browser){c.browser[G.browser]=true;c.browser.version=G.version}if(c.browser.webkit)c.browser.safari=true;if(O)c.inArray=function(a,b){return O.call(b,a)};N=c(r);if(r.addEventListener)E=function(){r.removeEventListener("DOMContentLoaded",E,false);c.ready()};else if(r.attachEvent)E=function(){if(r.readyState==="complete"){r.detachEvent("onreadystatechange",E);c.ready()}};if(O)c.inArray=function(a,b){return O.call(b,a)};(function(){c.support={};
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)||[0,"0"])[1];return b},browser:{}});G=d.uaMatch(G);if(G.browser){d.browser[G.browser]=true;d.browser.version=G.version}if(d.browser.webkit)d.browser.safari=true;if(O)d.inArray=function(a,b){return O.call(b,a)};N=d(r);if(r.addEventListener)E=function(){r.removeEventListener("DOMContentLoaded",E,false);d.ready()};else if(r.attachEvent)E=function(){if(r.readyState==="complete"){r.detachEvent("onreadystatechange",E);d.ready()}};if(O)d.inArray=function(a,b){return O.call(b,a)};(function(){d.support={};
var ss = prefs.getValue("originalPreferenceSessionStore", true);
uninstallHandler: function() { //TODO: this doesn't work. dunno how to catch the secret FUEL notifications yet... //TODO: explain to user what will be uninstalled and offer extra // options (e.g. "Uninstall KeePass too?") // Reset prefs to pre-KeeFox settings var rs = prefs.getValue("originalPreferenceRememberSignons", false); var ss = prefs.getValue("originalPreferenceSessionStore", true); Application.prefs.setValue("signon.rememberSignons", rs); Application.prefs.setValue("browser.sessionstore.enabled", ss); },
Application.prefs.setValue("browser.sessionstore.enabled", ss);
uninstallHandler: function() { //TODO: this doesn't work. dunno how to catch the secret FUEL notifications yet... //TODO: explain to user what will be uninstalled and offer extra // options (e.g. "Uninstall KeePass too?") // Reset prefs to pre-KeeFox settings var rs = prefs.getValue("originalPreferenceRememberSignons", false); var ss = prefs.getValue("originalPreferenceSessionStore", true); Application.prefs.setValue("signon.rememberSignons", rs); Application.prefs.setValue("browser.sessionstore.enabled", ss); },
return f},show:function(){a.style.height=I+"px";if(l)l.style.height=G+"px";return f},isHidden:function(){return l&&parseInt(l.style.height,10)===0},load:function(g){if(!l&&f._fireEvent("onBeforeLoad")!==false){o(e,function(){this.unload()});if((F=a.innerHTML)&&!flashembed.isSupported(b.version))a.innerHTML="";flashembed(a,b,{config:c});if(g){g.cached=true;y(w,"onLoad",g)}}return f},unload:function(){if(F.replace(/\s/g,"")!==""){if(f._fireEvent("onBeforeUnload")===false)return f;try{if(l){l.fp_close();
return f},show:function(){a.style.height=G+"px";if(l)l.style.height=H+"px";return f},isHidden:function(){return l&&parseInt(l.style.height,10)===0},load:function(g){if(!l&&f._fireEvent("onBeforeLoad")!==false){o(e,function(){this.unload()});if((F=a.innerHTML)&&!flashembed.isSupported(b.version))a.innerHTML="";flashembed(a,b,{config:c});if(g){g.cached=true;y(w,"onLoad",g)}}return f},unload:function(){if(F.replace(/\s/g,"")!==""){if(f._fireEvent("onBeforeUnload")===false)return f;try{if(l){l.fp_close();
return f},show:function(){a.style.height=I+"px";if(l)l.style.height=G+"px";return f},isHidden:function(){return l&&parseInt(l.style.height,10)===0},load:function(g){if(!l&&f._fireEvent("onBeforeLoad")!==false){o(e,function(){this.unload()});if((F=a.innerHTML)&&!flashembed.isSupported(b.version))a.innerHTML="";flashembed(a,b,{config:c});if(g){g.cached=true;y(w,"onLoad",g)}}return f},unload:function(){if(F.replace(/\s/g,"")!==""){if(f._fireEvent("onBeforeUnload")===false)return f;try{if(l){l.fp_close();f._fireEvent("onUnload")}}catch(g){}l=null;a.innerHTML=F}return f},getClip:function(g){if(g===undefined)g=x;return k[g]},getCommonClip:function(){return h},getPlaylist:function(){return k},getPlugin:function(g){var q=r[g];if(!q&&f.isLoaded()){var i=f._api().fp_getPlugin(g);if(i){q=new d(g,i,f);r[g]=q}}return q},getScreen:function(){return f.getPlugin("screen")},getControls:function(){return f.getPlugin("controls")},getConfig:function(g){return g?z(c):c},getFlashParams:function(){return b},loadPlugin:function(g,
b){return a.nodeType==1&&a.tagName.toUpperCase()===b};this.insertAt=function(a,b,f){a.childNodes.length==0?a.appendChild(b):a.insertBefore(b,a.childNodes[f])};this.remove=function(a){(a=g.getElement(a))&&a.parentNode.removeChild(a)};this.unstub=function(a,b,f){if(f==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width= a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");
b){return a.nodeType==1&&a.tagName.toUpperCase()===b};this.insertAt=function(a,b,f){a.childNodes.length==0?a.appendChild(b):a.insertBefore(b,a.childNodes[f])};this.remove=function(a){(a=g.getElement(a))&&a.parentNode.removeChild(a)};this.contains=function(a,b){for(b=b.parentNode;b!=null&&b.tagName.toLowerCase()!="body";){if(b==a)return true;b=b.parentNode}return false};this.unstub=function(a,b,f){if(f==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position; b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")==
b){return a.nodeType==1&&a.tagName.toUpperCase()===b};this.insertAt=function(a,b,f){a.childNodes.length==0?a.appendChild(b):a.insertBefore(b,a.childNodes[f])};this.remove=function(a){(a=g.getElement(a))&&a.parentNode.removeChild(a)};this.unstub=function(a,b,f){if(f==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=h.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=h.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=h.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);
this.hasTag=function(a,b){return a.tagName.toUpperCase()===b};this.insertAt=function(a,b,f){a.childNodes.length==0?a.appendChild(b):a.insertBefore(b,a.childNodes[f])};this.unstub=function(a,b,f){if(f==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=k.getElement(a);
"application/xhtml+xml").documentElement;if(l.nodeType!=1)l=l.nextSibling;if(!f)a.innerHTML="";b=0;for(f=l.childNodes.length;b<f;)a.appendChild(m(l.childNodes[b++],true))}};this.hasTag=function(a,b){return a.tagName.toUpperCase()===b};this.insertAt=function(a,b,f){a.childNodes.length==0?a.appendChild(b):a.insertBefore(b,a.childNodes[f])};this.unstub=function(a,b,f){if(f==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left; b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=k.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;b.style.margin=a.style.margin;a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(k.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,
this.hasTag=function(a,b){return a.tagName.toUpperCase()===b};this.insertAt=function(a,b,f){a.childNodes.length==0?a.appendChild(b):a.insertBefore(b,a.childNodes[f])};this.unstub=function(a,b,f){if(f==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=k.getElement(a);
a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img"); if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,l;f=0;for(l=a.attributes.length;f<l;f++){var n=a.attributes[f].nodeName;n!="type"&&n!="name"&&b.setAttribute(n,a.getAttribute(n))}}a.parentNode.replaceChild(b,a)}}};var N=false;this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){if(!N){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=
b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")== "submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,l;f=0;for(l=a.attributes.length;f<l;f++){var n=a.attributes[f].nodeName;n!="type"&&n!="name"&&b.setAttribute(n,a.getAttribute(n))}}a.parentNode.replaceChild(b,a)}}};var N=false;this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=
a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,l;f=0;for(l=a.attributes.length;f<l;f++){var n=a.attributes[f].nodeName;n!="type"&&n!="name"&&b.setAttribute(n,a.getAttribute(n))}}a.parentNode.replaceChild(b,a)}}};var N=false;this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){if(!N){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=
wrapped.setAttribute('style', e.getAttribute('style'));
if (WT.isIE) wrapped.style.setAttribute('cssText', e.getAttribute('style')); else wrapped.setAttribute('style', e.getAttribute('style'));
this.unwrap = function(e) { e = WT.getElement(e); if (e.parentNode.className.indexOf('Wt-wrap') == 0) { var wrapped = e; e = e.parentNode; if (e.className.length >= 8) wrapped.className = e.className.substring(8); wrapped.setAttribute('style', e.getAttribute('style')); e.parentNode.replaceChild(wrapped, e); } else { if (e.getAttribute('type') == 'submit') { e.setAttribute('type', 'button'); e.removeAttribute('name'); } if (WT.hasTag(e, 'INPUT') && e.getAttribute('type') == 'image') { // change <input> to <image> var img = document.createElement('img'); if (img.mergeAttributes) { img.mergeAttributes(e, false); img.src = e.src; } else { if (e.attributes && e.attributes.length > 0) { var i, il; for (i = 0, il = e.attributes.length; i < il; i++) { var n = e.attributes[i].nodeName; if (n != 'type' && n != 'name') img.setAttribute(n, e.getAttribute(n)); } } } e.parentNode.replaceChild(img, e); } }};
if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,l;f=0;for(l=a.attributes.length;f<l;f++){var n=a.attributes[f].nodeName;n!="type"&&n!="name"&&b.setAttribute(n,a.getAttribute(n))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&
if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,l;f=0;for(l=a.attributes.length;f<l;f++){var n=a.attributes[f].nodeName;n!="type"&&n!="name"&&b.setAttribute(n,a.getAttribute(n))}}a.parentNode.replaceChild(b,a)}}};var N=false;this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){if(!N){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=
a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,l;f=0;for(l=a.attributes.length;f<l;f++){var n=a.attributes[f].nodeName;n!="type"&&n!="name"&&b.setAttribute(n,a.getAttribute(n))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=h.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8); h.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(h.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var e,k;e=0;for(k=a.attributes.length;e<k;e++){var i=a.attributes[e].nodeName; i!="type"&&i!="name"&&b.setAttribute(i,a.getAttribute(i))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?h.CancelAll:b;if(b&h.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&h.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;document.activeElement&&document.activeElement.blur&&h.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}};
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8); g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var e,j;e=0;for(j=a.attributes.length;e<j;e++){var i=a.attributes[e].nodeName; i!="type"&&i!="name"&&b.setAttribute(i,a.getAttribute(i))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}};
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=h.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);h.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(h.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var e,k;e=0;for(k=a.attributes.length;e<k;e++){var i=a.attributes[e].nodeName;i!="type"&&i!="name"&&b.setAttribute(i,a.getAttribute(i))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?h.CancelAll:b;if(b&h.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&h.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;document.activeElement&&document.activeElement.blur&&h.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}};
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8); g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var e,k;e=0;for(k=a.attributes.length;e<k;e++){var i=a.attributes[e].nodeName; i!="type"&&i!="name"&&b.setAttribute(i,a.getAttribute(i))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}};
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=h.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8); h.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(h.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var e,k;e=0;for(k=a.attributes.length;e<k;e++){var i=a.attributes[e].nodeName; i!="type"&&i!="name"&&b.setAttribute(i,a.getAttribute(i))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?h.CancelAll:b;if(b&h.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&h.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;document.activeElement&&document.activeElement.blur&&h.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}};
0?a.appendChild(b):a.insertBefore(b,a.childNodes[e])};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var e,k;e=0;for(k=a.attributes.length;e<k;e++){var i=a.attributes[e].nodeName;i!="type"&&i!="name"&&b.setAttribute(i,a.getAttribute(i))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}};
this.hasTag=function(a,b){return a.tagName.toUpperCase()===b};this.insertAt=function(a,b,f){a.childNodes.length==0?a.appendChild(b):a.insertBefore(b,a.childNodes[f])};this.unstub=function(a,b,f){if(f==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=k.getElement(a); if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;b.style.margin=a.style.margin;a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(k.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,m;f=0;for(m=a.attributes.length;f<m;f++){var l=a.attributes[f].nodeName; l!="type"&&l!="name"&&b.setAttribute(l,a.getAttribute(l))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?k.CancelAll:b;if(b&k.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&k.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;document.activeElement&&document.activeElement.blur&&k.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}};
b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=k.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;b.style.margin=a.style.margin;a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(k.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a, false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,m;f=0;for(m=a.attributes.length;f<m;f++){var l=a.attributes[f].nodeName;l!="type"&&l!="name"&&b.setAttribute(l,a.getAttribute(l))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?k.CancelAll:b;if(b&k.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&k.CancelPropagate){if(a.stopPropagation)a.stopPropagation();
this.hasTag=function(a,b){return a.tagName.toUpperCase()===b};this.insertAt=function(a,b,f){a.childNodes.length==0?a.appendChild(b):a.insertBefore(b,a.childNodes[f])};this.unstub=function(a,b,f){if(f==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=k.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;b.style.margin=a.style.margin;a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(k.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,m;f=0;for(m=a.attributes.length;f<m;f++){var l=a.attributes[f].nodeName;l!="type"&&l!="name"&&b.setAttribute(l,a.getAttribute(l))}}a.parentNode.replaceChild(b,a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?k.CancelAll:b;if(b&k.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&k.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;document.activeElement&&document.activeElement.blur&&k.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}};
e))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var e=this;e.firstChild&&e.firstChild.nodeType===1;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(a){return this.each(function(){d(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},
unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=
e))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var e=this;e.firstChild&&e.firstChild.nodeType===1;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(a){return this.each(function(){d(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},
update: function(event, ui) { sortMapLayers(event , ui); }
update: function(event, ui) { sortMapLayers(event , ui); },
update: function(event, ui) { sortMapLayers(event , ui); }
console.info(new_url)
function update_graphs() { $('.gc-img').each(function () { var $this = $(this) var start = $('#timespan-menu').data('start'); var end = $('#timespan-menu').data('end'); var new_url = build_url($this.attr('src'), { 'start': start, 'end': end }); console.info(new_url) $this.attr('src', new_url); });}
if ( paranoia_mode ) { reflink += "&showSamples=" + show_samples ; }
function update_reflink ( lanes , display ) { var sel = document.getElementById("chr_list"); var reflink = cgi_path + '/index.pl?show=' ; reflink += sel.options[sel.selectedIndex].value + ':' + cur_from + '-' + cur_to + ',' + display_mode ; reflink += '&lane=' + lanes + '&width=' + img_width ; if ( had_win ) reflink += '&win=' + max_window; reflink += '&display=' + display ; if ( indel_zoom != 'auto' ) reflink += '&maxdist=' + indel_zoom ; if ( mapq_cutoff != 0 ) reflink += '&mapq=' + mapq_cutoff; if ( skin != 'lookseq' ) reflink += '&skin=' + skin ; if ( document.getElementById('display_second_track').checked ) { reflink += '&second_image=' + second_track_lanes ; if ( document.getElementById('squeeze_tracks').checked ) reflink += '&squeeze_tracks=1' ; } document.getElementById('reflink').href = reflink ;}
callURL('Config?special=UPDATE&edition=SWAP');
callURL('Other/Display?action=NEXT_EDITION');
function updateAffichage(option) { if (option == 'edition') { callURL('Config?special=UPDATE&edition=SWAP'); } else if (option == 'maps') { alert("not implemented"); } else if (option == 'details') { callURL('Config?special=UPDATE&details=SWAP'); } else { alert("Unknown option..."); } window.location.reload();}
callURL('Config?special=UPDATE&details=SWAP');
callURL('Other/Display?action=SWAP_DETAILS');
function updateAffichage(option) { if (option == 'edition') { callURL('Config?special=UPDATE&edition=SWAP'); } else if (option == 'maps') { alert("not implemented"); } else if (option == 'details') { callURL('Config?special=UPDATE&details=SWAP'); } else { alert("Unknown option..."); } window.location.reload();}
if (data != null && this.collapsed)
if (data != null)
updateArtifact : function(data) { Sonatype.Events.fireEvent(this.updateEventName, this, data); if (data != null && this.collapsed) { this.expand(); } },
$this.definition.mimes = (''+$('#mimes').val()).split("\n");
$this.definition.mimes = (''+$('#mimes').val()).replace("\n", " ").split(" ");
updateDefinitionFromForm: function () { $this.definition.meta = $this.extractPropertyFields($('#meta-fields')); // Forcibly overwrite any edits to PFS ID with original value. $this.definition.meta.pfs_id = $this.pfs_id; $this.definition.mimes = (''+$('#mimes').val()).split("\n"); $this.definition.aliases = { literal: (''+$('#literal_aliases').val()).split("\n"), regex: (''+$('#regex_aliases').val()).split("\n") }; $this.definition.releases = []; $('ul#releases li.release ul.fields').each(function () { var release = $this.extractPropertyFields($(this)); $this.definition.releases.push(release); }); },
Ext.Ajax.timeout = 30000;
Ext.Ajax.timeout = 60000;
updateGlobalTimeout : function() { Ext.Ajax.request({ method : 'GET', scope : this, url : Sonatype.config.repos.urls.restApiSettings, callback : function(options, success, response) { if (success) { var dec = Ext.decode(response.responseText); Ext.Ajax.timeout = dec.data.uiTimeout * 1000; } else { Ext.Ajax.timeout = 30000; Sonatype.utils.connectionError(response, 'Error retrieving rest timeout'); } } }); },
var oldBookmark = Ext.History.getToken(); if (bookmark != oldBookmark)
if (bookmark)
updateHistory : function(tab) { var bookmark = Sonatype.utils.getBookmark(tab); var oldBookmark = Ext.History.getToken(); if (bookmark != oldBookmark) { Ext.History.add(bookmark); } },
Ext.History.add(bookmark);
var oldBookmark = Ext.History.getToken(); if (bookmark != oldBookmark) { Ext.History.add(bookmark); }
updateHistory : function(tab) { var bookmark = Sonatype.utils.getBookmark(tab); var oldBookmark = Ext.History.getToken(); if (bookmark != oldBookmark) { Ext.History.add(bookmark); } },
this.artifactContainer.updateArtifact(payload);
updatePayload : function(payload) { if (payload == null) { this.collapse(); this.repositoryBrowser.updatePayload(null); this.artifactContainer.collapsePanel(); } else { this.expand(); this.repositoryBrowser.updatePayload(payload); this.artifactContainer.updateArtifact(payload); } }
return utils.string.replaceAll(value, ' ', '-');
var allowedChars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_', ' ']; value = value.toLowerCase(); value = value.replace(/[\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5]/g, 'a'); value = value.replace(/[\u00E7]/g, 'c'); value = value.replace(/[\u00E8\u00E9\u00EA\u00EB]/g, 'e'); value = value.replace(/[\u00EC\u00ED\u00EE\u00EF]/g, 'i'); value = value.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F6\u00F8]/g, 'o'); value = value.replace(/[\u00F9\u00FA\u00FB\u00FC]/g, 'u'); value = value.replace(/[\u00FD\u00FF]/g, 'y'); value = value.replace(/[\u00F1]/g, 'n'); value = value.replace(/[\u0153]/g, 'oe'); value = value.replace(/[\u00E6]/g, 'ae'); value = value.replace(/[\u00DF]/g, 'ss'); var url = ''; for(i in value) { if(value.charAt(i) == '@') url += 'at'; else if(value.charAt(i) == '©') url += 'copyright'; else if(value.charAt(i) == '€') url += 'euro'; else if(value.charAt(i) == '™') url += 'tm'; else if(value.charAt(i) == '-') url += ' '; else if(allowedChars.indexOf(value.charAt(i)) != -1) url += value.charAt(i); } url = utils.string.trim(url); url = url.replace(/\s+/g, ' '); url = utils.string.replaceAll(url, ' ', '-'); return url;
urlise: function(value) { return utils.string.replaceAll(value, ' ', '-'); },
context.fork("additional", 0, this, function (context) { context.title[0] += " (additional)"; context.filter = context.parent.filter; context.completions = context.parent.completions; let match = context.filters[0]; context.filters[0] = function (item) !match.call(this, item); let tokens = context.filter.split(/\s+/); context.filters.push(function (item) tokens.every( function (tok) contains(item.url, tok) || contains(item.title, tok))); let re = RegExp(tokens.filter(util.identity).map(util.escapeRegex).join("|"), "g"); function highlight(item, text, i) process[i].call(this, item, template.highlightRegexp(text, re)); let process = [template.icon, function (item, k) k]; context.process = [ function (item, text) highlight.call(this, item, item.text, 0), function (item, text) highlight.call(this, item, text, 1) ]; });
urls: function (context, tags) { let compare = String.localeCompare; let contains = String.indexOf; if (context.ignoreCase) { compare = util.compareIgnoreCase; contains = function (a, b) a && a.toLowerCase().indexOf(b.toLowerCase()) > -1; } if (tags) context.filters.push(function (item) tags. every(function (tag) (item.tags || []). some(function (t) !compare(tag, t)))); context.anchored = false; if (!context.title) context.title = ["URL", "Title"]; context.fork("additional", 0, this, function (context) { context.title[0] += " (additional)"; context.filter = context.parent.filter; // FIXME context.completions = context.parent.completions; // For items whose URL doesn't exactly match the filter, // accept them if all tokens match either the URL or the title. // Filter out all directly matching strings. let match = context.filters[0]; context.filters[0] = function (item) !match.call(this, item); // and all that don't match the tokens. let tokens = context.filter.split(/\s+/); context.filters.push(function (item) tokens.every( function (tok) contains(item.url, tok) || contains(item.title, tok))); let re = RegExp(tokens.filter(util.identity).map(util.escapeRegex).join("|"), "g"); function highlight(item, text, i) process[i].call(this, item, template.highlightRegexp(text, re)); let process = [template.icon, function (item, k) k]; context.process = [ function (item, text) highlight.call(this, item, item.text, 0), function (item, text) highlight.call(this, item, text, 1) ]; }); }
ia=(new Date).getTime()}else if(X){clearTimeout(Q);v()}else if((new Date).getTime()-ia>m.updateDelay){clearTimeout(Q);v()}}function F(d){ea=d;q._p_.comm.responseReceived(d)}function v(){Q=null;if(P){if(!ja){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;ja=true}}else{var d,c,e,j="&rand="+Math.round(Math.random(ka)*1E5);if(A.length>0){d=S();c=d.feedback?setTimeout(h,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{d={result:"signal=poll"};c=null;e=true}K= q._p_.comm.sendUpdate(la+j,"request=jsupdate&"+d.result+"&ackId="+ea,c,ea,-1);L=e?setTimeout(s,_$_SERVER_PUSH_TIMEOUT_$_):null}}function I(d,c){var e={},j=A.length;e.signal="user";e.id=typeof d==="string"?d:d==q?"app":d.id;if(typeof c==="object"){e.name=c.name;e.object=c.eventObject;e.event=c.event}else{e.name=c;e.object=e.event=null}e.args=[];for(var n=2;n<arguments.length;++n){var i=arguments[n];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[n-2]=i}e.feedback=true;A[j]=B(e,j);
function k(d){clearTimeout(d);document.body.style.cursor="auto";if(ba!=null){try{ba()}catch(c){}ba=null}}function h(){document.body.style.cursor="wait";ba=hideLoadingIndicator;showLoadingIndicator()}function o(d){ha=d}function E(d){if(d){d="(function() {"+d+"})();";window.execScript?window.execScript(d):window.eval(d)}r._p_.autoJavaScript()}function v(d,c,e){if(!P){if(d==0){_$_$ifnot_DEBUG_$_();try{_$_$endif_$_();E(c);_$_$ifnot_DEBUG_$_()}catch(j){alert("Wt internal error: "+j+", code: "+j.code+", description: "+ j.description)}_$_$endif_$_();e&&k(e)}else A=da.concat(A);da=[];if(L){clearTimeout(L);L=null}K=null;if(d>0)++Y;else Y=0;if(!P)if(ha||A.length>0)if(d==1){d=Math.min(12E4,Math.exp(Y)*500);Q=setTimeout(function(){w()},d)}else w()}}function s(){K.abort();L=K=null;P||w()}function z(d,c,e,j){m.checkReleaseCapture(d,e);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!K){_$_$endif_$_();var n={},i=A.length;n.object=d;n.signal=c;n.event=e;n.feedback=j;A[i]=B(n,i);y();E();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}
ia=(new Date).getTime()}else if(X){clearTimeout(Q);v()}else if((new Date).getTime()-ia>m.updateDelay){clearTimeout(Q);v()}}function F(d){ea=d;q._p_.comm.responseReceived(d)}function v(){Q=null;if(P){if(!ja){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;ja=true}}else{var d,c,e,j="&rand="+Math.round(Math.random(ka)*1E5);if(A.length>0){d=S();c=d.feedback?setTimeout(h,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{d={result:"signal=poll"};c=null;e=true}K=q._p_.comm.sendUpdate(la+j,"request=jsupdate&"+d.result+"&ackId="+ea,c,ea,-1);L=e?setTimeout(s,_$_SERVER_PUSH_TIMEOUT_$_):null}}function I(d,c){var e={},j=A.length;e.signal="user";e.id=typeof d==="string"?d:d==q?"app":d.id;if(typeof c==="object"){e.name=c.name;e.object=c.eventObject;e.event=c.event}else{e.name=c;e.object=e.event=null}e.args=[];for(var n=2;n<arguments.length;++n){var i=arguments[n];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[n-2]=i}e.feedback=true;A[j]=B(e,j);
if(!K){_$_$endif_$_();var m={},i=A.length;m.object=d;m.signal=c;m.event=e;m.feedback=j;A[i]=B(m,i);x();E();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function x(){if(K!=null&&L!=null){clearTimeout(L);K.abort();K=null}if(K==null)if(Q==null){Q=setTimeout(function(){v()},n.updateDelay);ia=(new Date).getTime()}else if(X){clearTimeout(Q);v()}else if((new Date).getTime()-ia>n.updateDelay){clearTimeout(Q);v()}}function F(d){ea=d;q._p_.comm.responseReceived(d)}function v(){Q=null;if(P){if(!ja){if(confirm("The application was quited, do you want to restart?"))document.location= document.location;ja=true}}else{var d,c,e,j="&rand="+Math.round(Math.random(ka)*1E5);if(A.length>0){d=S();c=d.feedback?setTimeout(k,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{d={result:"signal=poll"};c=null;e=true}K=q._p_.comm.sendUpdate(la+j,"request=jsupdate&"+d.result+"&ackId="+ea,c,ea,-1);L=e?setTimeout(r,_$_SERVER_PUSH_TIMEOUT_$_):null}}function I(d,c){var e={},j=A.length;e.signal="user";e.id=typeof d==="string"?d:d==q?"app":d.id;if(typeof c==="object"){e.name=c.name;e.object=c.eventObject;e.event=
v()}}function F(d){ea=d;q._p_.comm.responseReceived(d)}function v(){Q=null;if(P){if(!ja){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;ja=true}}else{var d,c,e,j="&rand="+Math.round(Math.random(ka)*1E5);if(A.length>0){d=S();c=d.feedback?setTimeout(k,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{d={result:"signal=poll"};c=null;e=true}K=q._p_.comm.sendUpdate(la+j,"request=jsupdate&"+d.result+"&ackId="+ea,c,ea,-1);L=e?setTimeout(r,_$_SERVER_PUSH_TIMEOUT_$_): null}}function I(d,c){var e={},j=A.length;e.signal="user";e.id=typeof d==="string"?d:d==q?"app":d.id;if(typeof c==="object"){e.name=c.name;e.object=c.eventObject;e.event=c.event}else{e.name=c;e.object=e.event=null}e.args=[];for(var m=2;m<arguments.length;++m){var i=arguments[m];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[m-2]=i}e.feedback=true;A[j]=B(e,j);x()}function U(d,c,e){var j=function(){var i=n.getElement(d);if(i){if(e)i.timer=setTimeout(i.tm,c);else{i.timer=null;i.tm=
if(!K){_$_$endif_$_();var m={},i=A.length;m.object=d;m.signal=c;m.event=e;m.feedback=j;A[i]=B(m,i);x();E();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function x(){if(K!=null&&L!=null){clearTimeout(L);K.abort();K=null}if(K==null)if(Q==null){Q=setTimeout(function(){v()},n.updateDelay);ia=(new Date).getTime()}else if(X){clearTimeout(Q);v()}else if((new Date).getTime()-ia>n.updateDelay){clearTimeout(Q);v()}}function F(d){ea=d;q._p_.comm.responseReceived(d)}function v(){Q=null;if(P){if(!ja){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;ja=true}}else{var d,c,e,j="&rand="+Math.round(Math.random(ka)*1E5);if(A.length>0){d=S();c=d.feedback?setTimeout(k,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{d={result:"signal=poll"};c=null;e=true}K=q._p_.comm.sendUpdate(la+j,"request=jsupdate&"+d.result+"&ackId="+ea,c,ea,-1);L=e?setTimeout(r,_$_SERVER_PUSH_TIMEOUT_$_):null}}function I(d,c){var e={},j=A.length;e.signal="user";e.id=typeof d==="string"?d:d==q?"app":d.id;if(typeof c==="object"){e.name=c.name;e.object=c.eventObject;e.event=
}else{v=w.startContainer;v=v.getChild(w.startOffset);if(v){if(x(v)===false)v=null;}else v=x(w.startContainer,true)===false?null:w.startContainer.getNextSourceNode(true,z,x);}while(v&&!this._.end){this.current=v;if(!this.evaluator||this.evaluator(v)!==false){if(!u)return v;}else if(u&&this.evaluator)return false;v=v[A](false,z,x);}this.end();return this.current=null;};function m(t){var u,v=null;while(u=l.call(this,t))v=u;return v;};d.walker=e.createClass({$:function(t){this.range=t;this._={};},proto:{end:function(){this._.end=1;},next:function(){return l.call(this);},previous:function(){return l.call(this,true);},checkForward:function(){return l.call(this,false,true)!==false;},checkBackward:function(){return l.call(this,true,true)!==false;},lastForward:function(){return m.call(this);},lastBackward:function(){return m.call(this,true);},reset:function(){delete this.current;this._={};}}});var n={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1},o={hr:1};h.prototype.isBlockBoundary=function(t){var u=e.extend({},o,t||{});return n[this.getComputedStyle('display')]||u[this.getName()];};d.walker.blockBoundary=function(t){return function(u,v){return!(u.type==1&&u.isBlockBoundary(t));};};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};d.walker.bookmarkContents=function(t){},d.walker.bookmark=function(t,u){function v(w){return w&&w.getName&&w.getName()=='span'&&w.hasAttribute('_fck_bookmark');};return function(w){var x,y;x=w&&!w.getName&&(y=w.getParent())&&v(y);x=t?x:x||v(w);return u^x;};};d.walker.whitespaces=function(t){return function(u){var v=u&&u.type==3&&!e.trim(u.getText());return t^v;};};d.walker.invisible=function(t){var u=d.walker.whitespaces();return function(v){var w=u(v)||v.is&&!v.$.offsetHeight;return t^w;};};var p=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,q=d.walker.whitespaces(true),r=d.walker.bookmark(false,true),s=function(t){return r(t)&&q(t);};h.prototype.getBogus=function(){var t=this.getLast(s);if(t&&(!c?t.is&&t.is('br'):t.getText&&p.test(t.getText())))return t;return false;};})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l;};(function(){var l=function(t){t.collapsed=t.startContainer&&t.endContainer&&t.startContainer.equals(t.endContainer)&&t.startOffset==t.endOffset;},m=function(t,u,v){t.optimizeBookmark();var w=t.startContainer,x=t.endContainer,y=t.startOffset,z=t.endOffset,A,B;
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; for(var B=1,C;C=A[B];B++){if(C.equals(z.block)||C.equals(z.blockLimit))break;if(m.test(C.getName())&&o(l,C))y.breakParent(C);}};v(t);v(u);var w=t.getNextSourceNode(true,1);while(w){if(w.equals(u))break;var x=w.getNextSourceNode(false,1);if(!(w.getName()=='img'&&w.getAttribute('_cke_realelement'))&&o(l,w))if(m.test(w.getName()))w.remove(true);else{w.removeAttributes(n);l.fire('removeFormatCleanup',w);}w=x;}r.moveToBookmark(s);}l.getSelection().selectRanges(p);}}},filter:function(l,m){var n=l._.removeFormat.filters;for(var o=0;o<n.length;o++){if(n[o](m)===false)return false;}return true;}};a.editor.prototype.addRemoveFormatFilter=function(l){this._.removeFormat.filters.push(l);};i.removeFormatTags='b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';i.removeFormatAttributes='class,style,lang,width,height,align,hspace,valign';j.add('resize',{init:function(l){var m=l.config;!m.resize_dir&&(m.resize_dir='both');m.resize_maxWidth==undefined&&(m.resize_maxWidth=3000);m.resize_maxHeight==undefined&&(m.resize_maxHeight=3000);m.resize_minWidth==undefined&&(m.resize_minWidth=750);m.resize_minHeight==undefined&&(m.resize_minHeight=250);if(m.resize_enabled!==false){var n=null,o,p,q=(m.resize_dir=='both'||m.resize_dir=='horizontal')&&m.resize_minWidth!=m.resize_maxWidth,r=(m.resize_dir=='both'||m.resize_dir=='vertical')&&m.resize_minHeight!=m.resize_maxHeight;function s(v){var w=v.data.$.screenX-o.x,x=v.data.$.screenY-o.y,y=p.width,z=p.height,A=y+w*(l.lang.dir=='rtl'?-1:1),B=z+x;if(q)y=Math.max(m.resize_minWidth,Math.min(A,m.resize_maxWidth));if(r)z=Math.max(m.resize_minHeight,Math.min(B,m.resize_maxHeight));l.resize(y,z);};function t(v){a.document.removeListener('mousemove',s);a.document.removeListener('mouseup',t);if(l.document){l.document.removeListener('mousemove',s);l.document.removeListener('mouseup',t);}};var u=e.addFunction(function(v){if(!n)n=l.getResizable();p={width:n.$.offsetWidth||0,height:n.$.offsetHeight||0};o={x:v.screenX,y:v.screenY};m.resize_minWidth>p.width&&(m.resize_minWidth=p.width);m.resize_minHeight>p.height&&(m.resize_minHeight=p.height);a.document.on('mousemove',s);a.document.on('mouseup',t);if(l.document){l.document.on('mousemove',s);l.document.on('mouseup',t);}});l.on('destroy',function(){e.removeFunction(u);});l.on('themeSpace',function(v){if(v.data.space=='bottom'){var w='';if(q&&!r)w=' cke_resizer_horizontal';if(!q&&r)w=' cke_resizer_vertical';v.data.html+='<div class="cke_resizer'+w+'"'+' title="'+e.htmlEncode(l.lang.resize)+'"'+' onmousedown="CKEDITOR.tools.callFunction('+u+', event)"'+'></div>';
}else{v=w.startContainer;v=v.getChild(w.startOffset);if(v){if(x(v)===false)v=null;}else v=x(w.startContainer,true)===false?null:w.startContainer.getNextSourceNode(true,z,x);}while(v&&!this._.end){this.current=v;if(!this.evaluator||this.evaluator(v)!==false){if(!u)return v;}else if(u&&this.evaluator)return false;v=v[A](false,z,x);}this.end();return this.current=null;};function m(t){var u,v=null;while(u=l.call(this,t))v=u;return v;};d.walker=e.createClass({$:function(t){this.range=t;this._={};},proto:{end:function(){this._.end=1;},next:function(){return l.call(this);},previous:function(){return l.call(this,true);},checkForward:function(){return l.call(this,false,true)!==false;},checkBackward:function(){return l.call(this,true,true)!==false;},lastForward:function(){return m.call(this);},lastBackward:function(){return m.call(this,true);},reset:function(){delete this.current;this._={};}}});var n={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1},o={hr:1};h.prototype.isBlockBoundary=function(t){var u=e.extend({},o,t||{});return n[this.getComputedStyle('display')]||u[this.getName()];};d.walker.blockBoundary=function(t){return function(u,v){return!(u.type==1&&u.isBlockBoundary(t));};};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};d.walker.bookmarkContents=function(t){},d.walker.bookmark=function(t,u){function v(w){return w&&w.getName&&w.getName()=='span'&&w.hasAttribute('_fck_bookmark');};return function(w){var x,y;x=w&&!w.getName&&(y=w.getParent())&&v(y);x=t?x:x||v(w);return u^x;};};d.walker.whitespaces=function(t){return function(u){var v=u&&u.type==3&&!e.trim(u.getText());return t^v;};};d.walker.invisible=function(t){var u=d.walker.whitespaces();return function(v){var w=u(v)||v.is&&!v.$.offsetHeight;return t^w;};};var p=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,q=d.walker.whitespaces(true),r=d.walker.bookmark(false,true),s=function(t){return r(t)&&q(t);};h.prototype.getBogus=function(){var t=this.getLast(s);if(t&&(!c?t.is&&t.is('br'):t.getText&&p.test(t.getText())))return t;return false;};})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l;};(function(){var l=function(t){t.collapsed=t.startContainer&&t.endContainer&&t.startContainer.equals(t.endContainer)&&t.startOffset==t.endOffset;},m=function(t,u,v){t.optimizeBookmark();var w=t.startContainer,x=t.endContainer,y=t.startOffset,z=t.endOffset,A,B;
a===false?"":d.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,e=this.length;b<e;b++)if((" "+this[b].className+" ").replace(ia," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===v){var b=this[0];if(b){if(d.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(d.nodeName(b,"select")){var e=b.selectedIndex,g=[],h=b.options;b=b.type==="select-one";if(e<0)return null;var k=b?e:0;for(e=b?e+1:h.length;k<e;k++){var l=h[k];if(l.selected){a= d(l).val();if(b)return a;g.push(a)}}return g}if(ja.test(b.type)&&!d.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Ea,"")}return v}var q=d.isFunction(a);return this.each(function(p){var o=d(this),w=a;if(this.nodeType===1){if(q)w=a.call(this,p,o.val());if(typeof w==="number")w+="";if(d.isArray(w)&&ja.test(this.type))this.checked=d.inArray(o.val(),w)>=0;else if(d.nodeName(this,"select")){var A=d.makeArray(w);d("option",this).each(function(){this.selected= d.inArray(d(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=w}})}});d.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,e,g){if(!a||a.nodeType===3||a.nodeType===8)return v;if(g&&b in d.attrFn)return d(a)[b](e);g=a.nodeType!==1||!d.isXMLDoc(a);var h=e!==v;b=g&&d.props[b]||b;if(a.nodeType===1){var k=Fa.test(b);if(b in a&&g&&!k){if(h){if(b==="type"&&Ga.test(a.nodeName)&&a.parentNode)throw"type property can't be changed";
l[q?"addClass":"removeClass"](h)}else if(e==="undefined"||e==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,e=this.length;b<e;b++)if((" "+this[b].className+" ").replace(ia," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===v){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b, "select")){var e=b.selectedIndex,f=[],h=b.options;b=b.type==="select-one";if(e<0)return null;var k=b?e:0;for(e=b?e+1:h.length;k<e;k++){var l=h[k];if(l.selected){a=c(l).val();if(b)return a;f.push(a)}}return f}if(ja.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Ea,"")}return v}var q=c.isFunction(a);return this.each(function(p){var o=c(this),w=a;if(this.nodeType===1){if(q)w=a.call(this,p,o.val());if(typeof w==="number")w+="";if(c.isArray(w)&& ja.test(this.type))this.checked=c.inArray(o.val(),w)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(w);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=w}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,e,f){if(!a||a.nodeType===3||a.nodeType===8)return v;if(f&&b in c.attrFn)return c(a)[b](e);f=a.nodeType!==1||!c.isXMLDoc(a);var h=e!==
a===false?"":d.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,e=this.length;b<e;b++)if((" "+this[b].className+" ").replace(ia," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===v){var b=this[0];if(b){if(d.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(d.nodeName(b,"select")){var e=b.selectedIndex,g=[],h=b.options;b=b.type==="select-one";if(e<0)return null;var k=b?e:0;for(e=b?e+1:h.length;k<e;k++){var l=h[k];if(l.selected){a=d(l).val();if(b)return a;g.push(a)}}return g}if(ja.test(b.type)&&!d.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Ea,"")}return v}var q=d.isFunction(a);return this.each(function(p){var o=d(this),w=a;if(this.nodeType===1){if(q)w=a.call(this,p,o.val());if(typeof w==="number")w+="";if(d.isArray(w)&&ja.test(this.type))this.checked=d.inArray(o.val(),w)>=0;else if(d.nodeName(this,"select")){var A=d.makeArray(w);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=w}})}});d.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,e,g){if(!a||a.nodeType===3||a.nodeType===8)return v;if(g&&b in d.attrFn)return d(a)[b](e);g=a.nodeType!==1||!d.isXMLDoc(a);var h=e!==v;b=g&&d.props[b]||b;if(a.nodeType===1){var k=Fa.test(b);if(b in a&&g&&!k){if(h){if(b==="type"&&Ga.test(a.nodeName)&&a.parentNode)throw"type property can't be changed";
};
}
function validateWCSInfoWindow() { var win = Ext.getCmp('wcsDownloadFrm'); var form = win.getForm(); var timePositionFieldSet = Ext.getCmp('timePositionFldSet'); var timePeriodFieldSet = Ext.getCmp('timePeriodFldSet'); var bboxFieldSet = Ext.getCmp('bboxFldSet'); if (!form.isValid()) { Ext.Msg.alert('Invalid Fields','One or more fields are invalid'); return false; } var usingTimePosition = timePositionFieldSet && !timePositionFieldSet.collapsed; var usingTimePeriod = timePeriodFieldSet && !timePeriodFieldSet.collapsed; var usingBbox = bboxFieldSet && !bboxFieldSet.collapsed; if (!usingBbox && !(usingTimePosition || usingTimePeriod)) { Ext.Msg.alert('No Constraints', 'You must specify at least one spatial or temporal constraint'); return false; } if (usingTimePosition && usingTimePeriod) { Ext.Msg.alert('Too many temporal', 'You may only specify a single temporal constraint'); return false; } return true;};
var firstField = this.ownerCt.find('name', 'password')[0]; if (firstField && firstField.getRawValue() != s) { return "Passwords don't match"; } return true; }
var firstField = this.ownerCt.find('name', 'newPassword')[0]; if (firstField && firstField.getRawValue() != s) { return "Passwords don't match"; } return true; }
validator : function(s) { var firstField = this.ownerCt.find('name', 'password')[0]; if (firstField && firstField.getRawValue() != s) { return "Passwords don't match"; } return true; }
validator : function(s) { var firstField = this.ownerCt.find('name', 'password')[0]; if (firstField && firstField.getRawValue() != s) { return "Passwords don't match"; }
validator : function(v) { if (v && v.length != 0 && v.match(WHITE_SPACE_REGEX)) {
validator : function(s) { var firstField = this.ownerCt.find('name', 'password')[0]; if (firstField && firstField.getRawValue() != s) { return "Passwords don't match"; } return true; }
else { return 'Last Name cannot start with whitespace.'; } }
validator : function(s) { var firstField = this.ownerCt.find('name', 'password')[0]; if (firstField && firstField.getRawValue() != s) { return "Passwords don't match"; } return true; }
return this.each(function() { var el = new Validator($(this), conf); $(this).data("validator", el); });
if (this.is("form")) { return this.each(function() { var form = $(this), validator = new Validator(form.find(":input"), form, conf); form.data("validator", validator); }); } else { var validator = new Validator(this, this.eq(0).closest("form"), conf); return this.data("validator", validator); }
$.fn.validator = function(conf) { // return existing instance if (this.data("validator")) { return this; } // configuration conf = $.extend(true, {}, v.conf, conf); // selector is a form return this.each(function() { var el = new Validator($(this), conf); $(this).data("validator", el); }); };
this.oninvalid = function() { return false; }
this.oninvalid = function() { return false; };
function Validator(inputs, form, conf) { // private variables var self = this, fire = form.add(self); // make sure there are input fields available inputs = inputs.not(":button, :image, :reset, :submit"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name=" + key + "]"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("OI", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("OI", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // disable browser's default validation mechanism if (inputs.get(0).validity) { inputs.each(function() { this.oninvalid = function() { return false; } }); } // Web Forms 2.0 compatibility if (form[0]) { form[0].checkValidity = self.checkValidity; } // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } inputs.filter(":checkbox, select").filter("[required]").change(function(e) { var el = $(this); if (this.checked || (el.is("select") && $(this).val())) { effects[conf.effect][1].call(self, el, e); } }); }
el.bind(event, function(e) {
el.bind(el.is(":date") ? "onHide" : event, function(e) {
function Validator(inputs, form, conf) { // private variables var self = this, fire = form.add(self); // make sure there are input fields available inputs = inputs.not(":button, :image, :reset, :submit"); // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, reflow: function() { inputs.each(function() { var input = $(this), msg = input.data("msg.el"); if (msg) { var pos = getPosition(input, msg, conf); msg.css({ top: pos.top, left: pos.left }); } }); return self; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name='" + key + "']"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("OI", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, reset: function(els) { els = els || inputs; els.removeClass(conf.errorClass).each(function() { var msg = $(this).data("msg.el"); if (msg) { msg.remove(); $(this).data("msg.el", null); } }).unbind(conf.errorInputEvent || ''); return self; }, destroy: function() { form.unbind(conf.formEvent || '').unbind("reset.V"); inputs.unbind(conf.inputEvent || '').unbind("change.V"); return self.reset(); }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.not(":radio:not(:checked)").each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("OI", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // form reset form.bind("reset.V", function() { self.reset(); }); // disable browser's default validation mechanism if (inputs[0] && inputs[0].validity) { inputs.each(function() { this.oninvalid = function() { return false; }; }); } // Web Forms 2.0 compatibility if (form[0]) { form[0].checkValidity = self.checkValidity; } // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } // checkboxes, selects and radios are checked separately inputs.filter(":checkbox, select").filter("[required]").bind("change.V", function(e) { var el = $(this); if (this.checked || (el.is("select") && $(this).val())) { effects[conf.effect][1].call(self, el, e); } }); var radios = inputs.filter(":radio").change(function(e) { self.checkValidity(radios, e); }); // reposition tooltips when window is resized $(window).resize(function() { self.reflow(); }); }
form.bind("reset", function() { $("." + conf.messageClass).remove(); inputs.removeClass(conf.errorClass).data("msg.el", null); });
function Validator(inputs, form, conf) { // private variables var self = this, fire = form.add(self); // make sure there are input fields available inputs = inputs.not(":button, :image, :reset, :submit"); // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name=" + key + "]"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("OI", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("OI", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // disable browser's default validation mechanism if (inputs[0] && inputs[0].validity) { inputs.each(function() { this.oninvalid = function() { return false; }; }); } // Web Forms 2.0 compatibility if (form[0]) { form[0].checkValidity = self.checkValidity; } // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } inputs.filter(":checkbox, select").filter("[required]").change(function(e) { var el = $(this); if (this.checked || (el.is("select") && $(this).val())) { effects[conf.effect][1].call(self, el, e); } }); }
$(self).bind(name, fn);
if (fn) { $(self).bind(name, fn); }
function Validator(inputs, form, conf) { // private variables var self = this, fire = form.add(self); // make sure there are input fields available inputs = inputs.not(":button, :image, :reset, :submit"); // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, reflow: function() { inputs.each(function() { var input = $(this), msg = input.data("msg.el"); if (msg) { var pos = getPosition(input, msg, conf); msg.css({ top: pos.top, left: pos.left }); } }); return self; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name='" + key + "']"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("OI", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, reset: function(els) { els = els || inputs; els.removeClass(conf.errorClass).each(function() { var msg = $(this).data("msg.el"); if (msg) { msg.remove(); $(this).data("msg.el", null); } }).unbind(conf.errorInputEvent || ''); return self; }, destroy: function() { form.unbind(conf.formEvent + ".V").unbind("reset.V"); inputs.unbind(conf.inputEvent + ".V").unbind("change.V"); return self.reset(); }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } // container for errors var errs = []; // loop trough the inputs els.not(":radio:not(:checked)").each(function() { // field and it's error message container var msgs = [], el = $(this).data("messages", msgs), event = dateInput && el.is(":date") ? "onHide.v" : conf.errorInputEvent + ".v"; // cleanup previous validation event el.unbind(event); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("OI", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(conf.errorInputEvent + ".v"); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent + ".V", function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // form reset form.bind("reset.V", function() { self.reset(); }); // disable browser's default validation mechanism if (inputs[0] && inputs[0].validity) { inputs.each(function() { this.oninvalid = function() { return false; }; }); } // Web Forms 2.0 compatibility if (form[0]) { form[0].checkValidity = self.checkValidity; } // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent + ".V", function(e) { self.checkValidity($(this), e); }); } // checkboxes, selects and radios are checked separately inputs.filter(":checkbox, select").filter("[required]").bind("change.V", function(e) { var el = $(this); if (this.checked || (el.is("select") && $(this).val())) { effects[conf.effect][1].call(self, el, e); } }); var radios = inputs.filter(":radio").change(function(e) { self.checkValidity(radios, e); }); // reposition tooltips when window is resized $(window).resize(function() { self.reflow(); }); }
inputs = inputs.not(":button, :image, :reset, :submit, :hidden");
inputs = inputs.not(":button, :image, :reset, :submit");
function Validator(form, conf) { // private variables var self = this, fire = form.add(self), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit, :hidden"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name=" + key + "]"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("oninvalid", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
fire = form.add(this),
fire = form.add(self),
function Validator(form, conf) { // private variables var self = this, fire = form.add(this), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit, :hidden"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function() { self.checkValidity(el); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { eff[0].call(self, errs); } return false; // no errors } else { // call the effect eff[1].call(self, els); // onSuccess callback e.type = "onSuccess"; fire.trigger(e); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity()) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this)); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
msg = msg[conf.lang];
msg = msg[conf.lang] || v.messages["*"].en;
function Validator(form, conf) { // private variables var self = this, fire = form.add(this), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit, :hidden"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function() { self.checkValidity(el); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { eff[0].call(self, errs); } return false; // no errors } else { // call the effect eff[1].call(self, els); // onSuccess callback e.type = "onSuccess"; fire.trigger(e); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity()) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this)); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
el.bind(event, function() { self.checkValidity(el);
el.bind(event, function(e) { self.checkValidity(el, e);
function Validator(form, conf) { // private variables var self = this, fire = form.add(this), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit, :hidden"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function() { self.checkValidity(el); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { eff[0].call(self, errs); } return false; // no errors } else { // call the effect eff[1].call(self, els); // onSuccess callback e.type = "onSuccess"; fire.trigger(e); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity()) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this)); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
if (errs.length) { e.type = "onFail"; fire.trigger(e, [errs]); if (!e.isDefaultPrevented()) { eff[0].call(self, errs); }
if (errs.length) { self.invalidate(errs, e);
function Validator(form, conf) { // private variables var self = this, fire = form.add(this), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit, :hidden"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function() { self.checkValidity(el); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { eff[0].call(self, errs); } return false; // no errors } else { // call the effect eff[1].call(self, els); // onSuccess callback e.type = "onSuccess"; fire.trigger(e); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity()) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this)); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
eff[1].call(self, els);
eff[1].call(self, els, e);
function Validator(form, conf) { // private variables var self = this, fire = form.add(this), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit, :hidden"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function() { self.checkValidity(el); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { eff[0].call(self, errs); } return false; // no errors } else { // call the effect eff[1].call(self, els); // onSuccess callback e.type = "onSuccess"; fire.trigger(e); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity()) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this)); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
fire.trigger(e);
fire.trigger(e, [els]);
function Validator(form, conf) { // private variables var self = this, fire = form.add(this), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit, :hidden"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function() { self.checkValidity(el); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { eff[0].call(self, errs); } return false; // no errors } else { // call the effect eff[1].call(self, els); // onSuccess callback e.type = "onSuccess"; fire.trigger(e); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity()) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this)); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
if (!self.checkValidity()) {
if (!self.checkValidity(null, e)) {
function Validator(form, conf) { // private variables var self = this, fire = form.add(this), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit, :hidden"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function() { self.checkValidity(el); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { eff[0].call(self, errs); } return false; // no errors } else { // call the effect eff[1].call(self, els); // onSuccess callback e.type = "onSuccess"; fire.trigger(e); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity()) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this)); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
self.checkValidity($(this));
self.checkValidity($(this), e);
function Validator(form, conf) { // private variables var self = this, fire = form.add(this), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit, :hidden"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function() { self.checkValidity(el); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { eff[0].call(self, errs); } return false; // no errors } else { // call the effect eff[1].call(self, els); // onSuccess callback e.type = "onSuccess"; fire.trigger(e); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity()) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this)); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
function Validator(form, conf) {
function Validator(inputs, form, conf) {
function Validator(form, conf) { // private variables var self = this, fire = form.add(self), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name=" + key + "]"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("oninvalid", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
fire = form.add(self), inputs = form.find(":input"); if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); }
fire = form.add(self);
function Validator(form, conf) { // private variables var self = this, fire = form.add(self), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name=" + key + "]"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("oninvalid", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
input.trigger("oninvalid", [val]);
input.trigger("OI", [val]);
function Validator(form, conf) { // private variables var self = this, fire = form.add(self), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name=" + key + "]"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("oninvalid", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
el.trigger("oninvalid", [msgs]);
el.trigger("OI", [msgs]);
function Validator(form, conf) { // private variables var self = this, fire = form.add(self), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name=" + key + "]"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("oninvalid", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
form[0].checkValidity = self.checkValidity;
if (form[0]) { form[0].checkValidity = self.checkValidity; }
function Validator(form, conf) { // private variables var self = this, fire = form.add(self), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name=" + key + "]"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("oninvalid", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
} inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); });
} inputs.filter(":checkbox, select").filter("[required]").change(function(e) { var el = $(this); if (this.checked || (el.is("select") && $(this).val())) { effects[conf.effect][1].call(self, el, e); } });
function Validator(form, conf) { // private variables var self = this, fire = form.add(self), inputs = form.find(":input"); // inputs are given directly if (!inputs.length) { inputs = form.filter(":input").data("validator", self); form = inputs.eq(0).closest("form"); } inputs = inputs.not(":button, :image, :reset, :submit"); if (!inputs.length) { throw "Validator: no input fields supplied"; } // utility function 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] || v.messages["*"].en; // 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); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name=" + key + "]"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("oninvalid", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } var errs = [], event = conf.errorInputEvent + ".v"; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).unbind(event).data("messages", msgs); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("oninvalid", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.bind(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.unbind(event); } return true; }//}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // form validation if (conf.formEvent) { form.bind(conf.formEvent, function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } }); } // Web Forms 2.0 compatibility form[0].checkValidity = self.checkValidity; // input validation if (conf.inputEvent) { inputs.bind(conf.inputEvent, function(e) { self.checkValidity($(this), e); }); } // oninvalid attribute (not using eval()) inputs.filter("[oninvalid]").each(function() { $(this).oninvalid(function() { $.globalEval($(this).attr("oninvalid")); }); }); }
if (!responseObj || !responseObj.variables)
if (!responseObj || !responseObj.variables) {
var variableListToForm = function (frm, responseObj) { if (!responseObj || !responseObj.variables) return; for (var i = 0; i < responseObj.variables.length; i++) { var variableFldSet = generateVariableFieldSet(responseObj.variables[i]); frm.add(variableFldSet); } frm.doLayout(); };
}
var variableListToForm = function (frm, responseObj) { if (!responseObj || !responseObj.variables) return; for (var i = 0; i < responseObj.variables.length; i++) { var variableFldSet = generateVariableFieldSet(responseObj.variables[i]); frm.add(variableFldSet); } frm.doLayout(); };
return [$(window).width(), $(document).height()];
return [$(document).width(), $(document).height()];
function viewport() { // the horror case if ($.browser.msie) { // if there are no scrollbars then use window.height var d = $(document).height(), w = $(window).height(); return [ window.innerWidth || // ie7+ document.documentElement.clientWidth || // ie6 document.body.clientWidth, // ie6 quirks mode d - w < 20 ? w : d ]; } // other well behaving browsers return [$(window).width(), $(document).height()]; }
a.nodeName.toLowerCase()==="tr";return b===0&&e===0&&!g?true:b>0&&e>0&&!g?false:d.curCSS(a,"display")==="none"};d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)}}x.jQuery=x.$=d})(window);
visible: function(a){return "hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},
a.nodeName.toLowerCase()==="tr";return b===0&&e===0&&!g?true:b>0&&e>0&&!g?false:d.curCSS(a,"display")==="none"};d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)}}x.jQuery=x.$=d})(window);
a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,l)}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft=
a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,parseInt(l))}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft=
a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,l)}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft=
var _$_WT_CLASS_$_=new (function(){function w(a,b){return a.style[b]?a.style[b]:document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null)[b]:a.currentStyle?a.currentStyle[b]:null}function t(a){if(B==null)return null;if(!a)a=window.event;if(a){for(var b=a=g.target(a);b&&b!=B;)b=b.parentNode;return b==B?g.isIE?a:null:B}else return B}function D(a){var b=t(a);if(b&&!S){if(!a)a=window.event;S=true;if(g.isIE){g.firedTarget=a.srcElement||b;b.fireEvent("onmousemove",
function y(){if(K!=null&&L!=null){clearTimeout(L);K.abort();K=null}if(K==null)if(Q==null){Q=setTimeout(function(){w()},m.updateDelay);ia=(new Date).getTime()}else if(Y){clearTimeout(Q);w()}else if((new Date).getTime()-ia>m.updateDelay){clearTimeout(Q);w()}}function F(d){ea=d;r._p_.comm.responseReceived(d)}function w(){Q=null;if(P){if(!ja){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;ja=true}}else{var d,c,e,j="&rand="+Math.round(Math.random(ka)* 1E5);if(A.length>0){d=S();c=d.feedback?setTimeout(h,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{d={result:"signal=poll"};c=null;e=true}K=r._p_.comm.sendUpdate(la+j,"request=jsupdate&"+d.result+"&ackId="+ea,c,ea,-1);L=e?setTimeout(s,_$_SERVER_PUSH_TIMEOUT_$_):null}}function I(d,c){var e={},j=A.length;e.signal="user";e.id=typeof d==="string"?d:d==r?"app":d.id;if(typeof c==="object"){e.name=c.name;e.object=c.eventObject;e.event=c.event}else{e.name=c;e.object=e.event=null}e.args=[];for(var n=2;n<arguments.length;++n){var i=
var _$_WT_CLASS_$_=new (function(){function w(a,b){return a.style[b]?a.style[b]:document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null)[b]:a.currentStyle?a.currentStyle[b]:null}function t(a){if(B==null)return null;if(!a)a=window.event;if(a){for(var b=a=g.target(a);b&&b!=B;)b=b.parentNode;return b==B?g.isIE?a:null:B}else return B}function D(a){var b=t(a);if(b&&!S){if(!a)a=window.event;S=true;if(g.isIE){g.firedTarget=a.srcElement||b;b.fireEvent("onmousemove",
d=null;e=true}C=da._p_.comm.sendUpdate(ga+g,"request=jsupdate&"+c.result+"&ackId="+Y,d,Y,-1);K=e?setTimeout(y,_$_SERVER_PUSH_TIMEOUT_$_):null}}function w(c,d){var e={},g=v.length;e.signal="user";e.id=typeof c==="string"?c:c==_$_APP_CLASS_$_?"app":c.id;if(typeof d==="object"){e.name=d.name;e.object=d.eventObject;e.event=d.event}else{e.name=d;e.object=e.event=null}e.args=[];for(var h=2;h<arguments.length;++h){var i=arguments[h];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[h-2]= i}e.feedback=true;v[g]=r(e,g);j()}function O(c,d,e){var g=function(){var i=q.getElement(c);if(i){if(e)i.timer=setTimeout(i.tm,d);else{i.timer=null;i.tm=null}i.onclick()}},h=q.getElement(c);h.timer=setTimeout(g,d);h.tm=g}function G(c,d){setTimeout(function(){if(M[c]===true)d();else M[c]=d},20)}function Z(c){if(M[c]!==true){typeof M[c]!=="undefined"&&M[c]();M[c]=true}}function ha(c,d){var e=false;if(d!="")try{e=!eval("typeof "+d+" === 'undefined'")}catch(g){e=false}if(e)Z(c);else{var h=document.createElement("script");
0){c=t();d=c.feedback?setTimeout(B,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{c={result:"signal=poll"};d=null;e=true}C=ea._p_.comm.sendUpdate(ha+g,"request=jsupdate&"+c.result+"&ackId="+Y,d,Y,-1);K=e?setTimeout(y,_$_SERVER_PUSH_TIMEOUT_$_):null}}function w(c,d){var e={},g=v.length;e.signal="user";e.id=typeof c==="string"?c:c==_$_APP_CLASS_$_?"app":c.id;if(typeof d==="object"){e.name=d.name;e.object=d.eventObject;e.event=d.event}else{e.name=d;e.object=e.event=null}e.args=[];for(var h=2;h<arguments.length;++h){var i= arguments[h];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[h-2]=i}e.feedback=true;v[g]=r(e,g);j()}function P(c,d,e){var g=function(){var i=q.getElement(c);if(i){if(e)i.timer=setTimeout(i.tm,d);else{i.timer=null;i.tm=null}i.onclick()}},h=q.getElement(c);h.timer=setTimeout(g,d);h.tm=g}function G(c,d){setTimeout(function(){if(N[c]===true)d();else N[c]=d},20)}function Z(c){if(N[c]!==true){typeof N[c]!=="undefined"&&N[c]();N[c]=true}}function ia(c,d){var e=false;if(d!="")try{e=!eval("typeof "+
d=null;e=true}C=da._p_.comm.sendUpdate(ga+g,"request=jsupdate&"+c.result+"&ackId="+Y,d,Y,-1);K=e?setTimeout(y,_$_SERVER_PUSH_TIMEOUT_$_):null}}function w(c,d){var e={},g=v.length;e.signal="user";e.id=typeof c==="string"?c:c==_$_APP_CLASS_$_?"app":c.id;if(typeof d==="object"){e.name=d.name;e.object=d.eventObject;e.event=d.event}else{e.name=d;e.object=e.event=null}e.args=[];for(var h=2;h<arguments.length;++h){var i=arguments[h];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[h-2]=i}e.feedback=true;v[g]=r(e,g);j()}function O(c,d,e){var g=function(){var i=q.getElement(c);if(i){if(e)i.timer=setTimeout(i.tm,d);else{i.timer=null;i.tm=null}i.onclick()}},h=q.getElement(c);h.timer=setTimeout(g,d);h.tm=g}function G(c,d){setTimeout(function(){if(M[c]===true)d();else M[c]=d},20)}function Z(c){if(M[c]!==true){typeof M[c]!=="undefined"&&M[c]();M[c]=true}}function ha(c,d){var e=false;if(d!="")try{e=!eval("typeof "+d+" === 'undefined'")}catch(g){e=false}if(e)Z(c);else{var h=document.createElement("script");
a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var h=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";h;h=h.nextSibling){h.style.left=i.pxself(h,"left")+b+"px";if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}}n.emit(j,"columnResized",d,l)}jQuery.data(j,"obj",this);var i=n.WT,s=0,
a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,l)}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft=
a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var h=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";h;h=h.nextSibling){h.style.left=i.pxself(h,"left")+b+"px";if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}}n.emit(j,"columnResized",d,l)}jQuery.data(j,"obj",this);var i=n.WT,s=0,
var _$_WT_CLASS_$_=new (function(){function w(a,b){return a.style[b]?a.style[b]:document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null)[b]:a.currentStyle?a.currentStyle[b]:null}function t(a){if(C!=null){if(!a)a=window.event;h.condCall(C,"onmousemove",a);return false}else return true}function B(a){if(C!=null){var b=C;h.capture(null);if(!a)a=window.event;h.condCall(b,"onmouseup",a);h.cancelEvent(a,h.CancelPropagate);return false}else return true}function ba(){if(!T){T=
d)}else F()}}function w(){I.abort();N=I=null;P||F()}function z(d,c,f,k){o.checkReleaseCapture(d,f);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!I){_$_$endif_$_();var h={},m=y.length;h.object=d;h.signal=c;h.event=f;h.feedback=k;y[m]=S(h,m);E();q();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_()}function E(){if(I!=null&&N!=null){clearTimeout(N);I.abort();I=null}if(I==null)if(Q==null){Q=setTimeout(function(){F()},o.updateDelay);ha=(new Date).getTime()}else if(W){clearTimeout(Q);F()}else if((new Date).getTime()-
var _$_WT_CLASS_$_=new (function(){function w(a,b){return a.style[b]?a.style[b]:document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null)[b]:a.currentStyle?a.currentStyle[b]:null}function t(a){if(C!=null){if(!a)a=window.event;h.condCall(C,"onmousemove",a);return false}else return true}function B(a){if(C!=null){var b=C;h.capture(null);if(!a)a=window.event;h.condCall(b,"onmouseup",a);h.cancelEvent(a,h.CancelPropagate);return false}else return true}function ba(){if(!T){T=
0){c=t();d=c.feedback?setTimeout(B,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{c={result:"signal=poll"};d=null;e=true}C=ea._p_.comm.sendUpdate(ha+g,"request=jsupdate&"+c.result+"&ackId="+Y,d,Y,-1);K=e?setTimeout(y,_$_SERVER_PUSH_TIMEOUT_$_):null}}function w(c,d){var e={},g=v.length;e.signal="user";e.id=typeof c==="string"?c:c==_$_APP_CLASS_$_?"app":c.id;if(typeof d==="object"){e.name=d.name;e.object=d.eventObject;e.event=d.event}else{e.name=d;e.object=e.event=null}e.args=[];for(var h=2;h<arguments.length;++h){var i= arguments[h];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[h-2]=i}e.feedback=true;v[g]=r(e,g);j()}function P(c,d,e){var g=function(){var i=p.getElement(c);if(i){if(e)i.timer=setTimeout(i.tm,d);else{i.timer=null;i.tm=null}i.onclick()}},h=p.getElement(c);h.timer=setTimeout(g,d);h.tm=g}function G(c,d){setTimeout(function(){if(N[c]===true)d();else N[c]=d},20)}function Z(c){if(N[c]!==true){typeof N[c]!=="undefined"&&N[c]();N[c]=true}}function ia(c,d){var e=false;if(d!="")try{e=!eval("typeof "+
Math.round(Math.random(ga)*1E5);if(v.length>0){c=t();d=c.feedback?setTimeout(B,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{c={result:"signal=poll"};d=null;e=true}C=ea._p_.comm.sendUpdate(ha+g,"request=jsupdate&"+c.result+"&ackId="+Y,d,Y,-1);K=e?setTimeout(y,_$_SERVER_PUSH_TIMEOUT_$_):null}}function w(c,d){var e={},g=v.length;e.signal="user";e.id=typeof c==="string"?c:c==_$_APP_CLASS_$_?"app":c.id;if(typeof d==="object"){e.name=d.name;e.object=d.eventObject;e.event=d.event}else{e.name=d;e.object=e.event= null}e.args=[];for(var h=2;h<arguments.length;++h){var i=arguments[h];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[h-2]=i}e.feedback=true;v[g]=r(e,g);j()}function P(c,d,e){var g=function(){var i=p.getElement(c);if(i){if(e)i.timer=setTimeout(i.tm,d);else{i.timer=null;i.tm=null}i.onclick()}},h=p.getElement(c);h.timer=setTimeout(g,d);h.tm=g}function G(c,d){setTimeout(function(){if(N[c]===true)d();else N[c]=d},20)}function Z(c){if(N[c]!==true){typeof N[c]!=="undefined"&&N[c]();N[c]=
0){c=t();d=c.feedback?setTimeout(B,_$_INDICATOR_TIMEOUT_$_):null;e=false}else{c={result:"signal=poll"};d=null;e=true}C=ea._p_.comm.sendUpdate(ha+g,"request=jsupdate&"+c.result+"&ackId="+Y,d,Y,-1);K=e?setTimeout(y,_$_SERVER_PUSH_TIMEOUT_$_):null}}function w(c,d){var e={},g=v.length;e.signal="user";e.id=typeof c==="string"?c:c==_$_APP_CLASS_$_?"app":c.id;if(typeof d==="object"){e.name=d.name;e.object=d.eventObject;e.event=d.event}else{e.name=d;e.object=e.event=null}e.args=[];for(var h=2;h<arguments.length;++h){var i=arguments[h];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[h-2]=i}e.feedback=true;v[g]=r(e,g);j()}function P(c,d,e){var g=function(){var i=p.getElement(c);if(i){if(e)i.timer=setTimeout(i.tm,d);else{i.timer=null;i.tm=null}i.onclick()}},h=p.getElement(c);h.timer=setTimeout(g,d);h.tm=g}function G(c,d){setTimeout(function(){if(N[c]===true)d();else N[c]=d},20)}function Z(c){if(N[c]!==true){typeof N[c]!=="undefined"&&N[c]();N[c]=true}}function ia(c,d){var e=false;if(d!="")try{e=!eval("typeof "+
if (geographyEls.length == 0) {
if (geographyEls.length === 0) {
var wcsHandler = function(activeLayerRecord) { //get our overlay manager (create if required) var overlayManager = activeLayerRecord.getOverlayManager(); if (!overlayManager) { overlayManager = new OverlayManager(map); activeLayerRecord.setOverlayManager(overlayManager); } overlayManager.clearOverlays(); var responseTooltip = new ResponseTooltip(); activeLayerRecord.setResponseToolTip(responseTooltip); //Attempt to handle each CSW record as a WCS (if possible). var cswRecords = activeLayerRecord.getCSWRecordsWithType('WCS'); for (var i = 0; i < cswRecords.length; i++) { var wmsOnlineResources = cswRecords[i].getFilteredOnlineResources('WMS'); var wcsOnlineResources = cswRecords[i].getFilteredOnlineResources('WCS'); var geographyEls = cswRecords[i].getGeographicElements(); //Assumption - We only contain a single WCS in a CSWRecord (although more would be possible) var wcsOnlineResource = wcsOnlineResources[0]; if (geographyEls.length == 0) { responseTooltip.addResponse(wcsOnlineResource.url, 'No bounding box has been specified for this coverage.'); continue; } //We will need to add the bounding box polygons regardless of whether we have a WMS service or not. //The difference is that we will make the "WMS" bounding box polygons transparent but still clickable var polygonList = []; for (var j = 0; j < geographyEls.length; j++) { var thisPolygon = null; if (wmsOnlineResources.length > 0) { thisPolygon = geographyEls[j].toGMapPolygon('#000000', 0, 0.0,'#000000', 0.0); } else { thisPolygon = geographyEls[j].toGMapPolygon('#FF0000', 0, 0.7,'#FF0000', 0.6); } polygonList = polygonList.concat(thisPolygon); } //Add our overlays (they will be used for clicking so store some extra info) for (var j = 0; j < polygonList.length; j++) { polygonList[j].onlineResource = wcsOnlineResource; polygonList[j].cswRecord = cswRecords[i].internalRecord; polygonList[j].activeLayerRecord = activeLayerRecord.internalRecord; overlayManager.addOverlay(polygonList[j]); } //Add our WMS tiles (if any) for (var j = 0; j < wmsOnlineResources.length; j++) { var tileLayer = new GWMSTileLayer(map, new GCopyrightCollection(""), 1, 17); tileLayer.baseURL = wmsOnlineResources[i].url; tileLayer.layers = wmsOnlineResources[i].name; tileLayer.opacity = activeLayerRecord.getOpacity(); overlayManager.addOverlay(new GTileLayerOverlay(tileLayer)); } } //This will update the Z order of our WMS layers updateActiveLayerZOrder(); };
selectedRecord.responseTooltip = new ResponseTooltip();
selectedRecord.responseTooltip = new ResponseTooltip(); selectedRecord.debuggerData = new DebuggerData();
var wfsHandler = function(selectedRecord) { //if there is already updateCSWRecords filter running for this record then don't call another if (selectedRecord.get('loadingStatus') == '<img src="js/external/extjs/resources/images/default/grid/loading.gif">') { Ext.MessageBox.show({ title: 'Please wait', msg: "There is an operation in process for this layer. Please wait until it is finished.", buttons: Ext.MessageBox.OK, animEl: 'mb9', icon: Ext.MessageBox.INFO }); return; } if (selectedRecord.tileOverlay instanceof OverlayManager) selectedRecord.tileOverlay.clearOverlays(); //a response status holder selectedRecord.responseTooltip = new ResponseTooltip(); var serviceURLs = selectedRecord.get('serviceURLs'); var proxyURL = selectedRecord.get('proxyURL'); var iconUrl = selectedRecord.get('iconUrl'); var finishedLoadingCounter = serviceURLs.length; // var markerOverlay = new MarkerOverlay(); var overlayManager = new OverlayManager(map); selectedRecord.tileOverlay = overlayManager; //set the status as loading for this record selectedRecord.set('loadingStatus', '<img src="js/external/extjs/resources/images/default/grid/loading.gif">'); var filterParameters = ''; if (filterPanel.getLayout().activeItem == filterPanel.getComponent(0)) { filterParameters = "&typeName=" + selectedRecord.get('typeName'); } else { filterParameters = filterPanel.getLayout().activeItem.getForm().getValues(true); } filterParameters += '&maxFeatures=200'; // limit our feature request to 200 so we don't overwhelm the browser // This line activates bbox support AUS-1597 filterParameters += '&bbox=' + escape(Ext.util.JSON.encode(fetchVisibleMapBounds(map))); for (var i = 0; i < serviceURLs.length; i++) { handleQuery(serviceURLs[i], selectedRecord, proxyURL, iconUrl, overlayManager, filterParameters, function() { //decrement the counter finishedLoadingCounter--; //check if we can set the status to finished if (finishedLoadingCounter <= 0) { selectedRecord.set('loadingStatus', '<img src="js/external/extjs/resources/images/default/grid/done.gif">'); } }); } };
var featureString = selectedRecord.get('featureString'); var description = selectedRecord.get('description');
var wfsHandler = function(selectedRecord) { //if there is already updateCSWRecords filter running for this record then don't call another if (selectedRecord.get('loadingStatus') == '<img src="js/external/extjs/resources/images/default/grid/loading.gif">') { Ext.MessageBox.show({ title: 'Please wait', msg: "There is an operation in process for this layer. Please wait until it is finished.", buttons: Ext.MessageBox.OK, animEl: 'mb9', icon: Ext.MessageBox.INFO }); return; } if (selectedRecord.tileOverlay instanceof OverlayManager) selectedRecord.tileOverlay.clearOverlays(); //a response status holder selectedRecord.responseTooltip = new ResponseTooltip(); var serviceURLs = selectedRecord.get('serviceURLs'); var proxyURL = selectedRecord.get('proxyURL'); var iconUrl = selectedRecord.get('iconUrl'); var finishedLoadingCounter = serviceURLs.length; // var markerOverlay = new MarkerOverlay(); var overlayManager = new OverlayManager(map); selectedRecord.tileOverlay = overlayManager; //set the status as loading for this record selectedRecord.set('loadingStatus', '<img src="js/external/extjs/resources/images/default/grid/loading.gif">'); var filterParameters = ''; if (filterPanel.getLayout().activeItem == filterPanel.getComponent(0)) { filterParameters = "&typeName=" + selectedRecord.get('typeName'); } else { filterParameters = filterPanel.getLayout().activeItem.getForm().getValues(true); } filterParameters += '&maxFeatures=200'; // limit our feature request to 200 so we don't overwhelm the browser // This line activates bbox support AUS-1597 filterParameters += '&bbox=' + escape(Ext.util.JSON.encode(fetchVisibleMapBounds(map))); for (var i = 0; i < serviceURLs.length; i++) { handleQuery(serviceURLs[i], selectedRecord, proxyURL, iconUrl, overlayManager, filterParameters, function() { //decrement the counter finishedLoadingCounter--; //check if we can set the status to finished if (finishedLoadingCounter <= 0) { selectedRecord.set('loadingStatus', '<img src="js/external/extjs/resources/images/default/grid/done.gif">'); } }); } };
filterParameters += '&bbox=' + escape(Ext.util.JSON.encode(fetchVisibleMapBounds(map)));
var wfsHandler = function(selectedRecord) { //if there is already updateCSWRecords filter running for this record then don't call another if (selectedRecord.get('loadingStatus') == '<img src="js/external/extjs/resources/images/default/grid/loading.gif">') { Ext.MessageBox.show({ title: 'Please wait', msg: "There is an operation in process for this layer. Please wait until it is finished.", buttons: Ext.MessageBox.OK, animEl: 'mb9', icon: Ext.MessageBox.INFO }); return; } if (selectedRecord.tileOverlay instanceof OverlayManager) selectedRecord.tileOverlay.clearOverlays(); //a response status holder selectedRecord.responseTooltip = new ResponseTooltip(); var serviceURLs = selectedRecord.get('serviceURLs'); var proxyURL = selectedRecord.get('proxyURL'); var iconUrl = selectedRecord.get('iconUrl'); var finishedLoadingCounter = serviceURLs.length; // var markerOverlay = new MarkerOverlay(); var overlayManager = new OverlayManager(map); selectedRecord.tileOverlay = overlayManager; //set the status as loading for this record selectedRecord.set('loadingStatus', '<img src="js/external/extjs/resources/images/default/grid/loading.gif">'); var filterParameters = ''; if (filterPanel.getLayout().activeItem == filterPanel.getComponent(0)) { filterParameters = "&typeName=" + selectedRecord.get('typeName'); } else { filterParameters = filterPanel.getLayout().activeItem.getForm().getValues(true); } filterParameters += '&maxFeatures=200'; // limit our feature request to 200 so we don't overwhelm the browser // This line activates bbox support AUS-1597 filterParameters += '&bbox=' + escape(Ext.util.JSON.encode(fetchVisibleMapBounds(map))); for (var i = 0; i < serviceURLs.length; i++) { handleQuery(serviceURLs[i], selectedRecord, proxyURL, iconUrl, overlayManager, filterParameters, function() { //decrement the counter finishedLoadingCounter--; //check if we can set the status to finished if (finishedLoadingCounter <= 0) { selectedRecord.set('loadingStatus', '<img src="js/external/extjs/resources/images/default/grid/done.gif">'); } }); } };
filterParameters += '&bbox=' + escape(Ext.util.JSON.encode(fetchVisibleMapBounds(map)));
var wfsHandler = function(selectedRecord) { //if there is already updateCSWRecords filter running for this record then don't call another if (selectedRecord.get('loadingStatus') == '<img src="js/external/extjs/resources/images/default/grid/loading.gif">') { Ext.MessageBox.show({ title: 'Please wait', msg: "There is an operation in process for this layer. Please wait until it is finished.", buttons: Ext.MessageBox.OK, animEl: 'mb9', icon: Ext.MessageBox.INFO }); return; } if (selectedRecord.tileOverlay instanceof OverlayManager) selectedRecord.tileOverlay.clearOverlays(); //a response status holder selectedRecord.responseTooltip = new ResponseTooltip(); var serviceURLs = selectedRecord.get('serviceURLs'); var proxyURL = selectedRecord.get('proxyURL'); var iconUrl = selectedRecord.get('iconUrl'); var finishedLoadingCounter = serviceURLs.length; // var markerOverlay = new MarkerOverlay(); var overlayManager = new OverlayManager(map); selectedRecord.tileOverlay = overlayManager; //set the status as loading for this record selectedRecord.set('loadingStatus', '<img src="js/external/extjs/resources/images/default/grid/loading.gif">'); var filterParameters = ''; if (filterPanel.getLayout().activeItem == filterPanel.getComponent(0)) { filterParameters = "&typeName=" + selectedRecord.get('typeName'); } else { filterParameters = filterPanel.getLayout().activeItem.getForm().getValues(true); // Uncomment this to add bbox support AUS-1597 //filterParameters += '&bbox=' + Ext.util.JSON.encode(fetchVisibleMapBounds(map)); } filterParameters += '&maxFeatures=200'; // limit our feature request to 200 so we don't overwhelm the browser for (var i = 0; i < serviceURLs.length; i++) { handleQuery(serviceURLs[i], selectedRecord, proxyURL, iconUrl, overlayManager, filterParameters, function() { //decrement the counter finishedLoadingCounter--; //check if we can set the status to finished if (finishedLoadingCounter <= 0) { selectedRecord.set('loadingStatus', '<img src="js/external/extjs/resources/images/default/grid/done.gif">'); } }); } };
function(a){if(!a)a=window.event;var b=0,f=0;if(a.pageX||a.pageY){b=a.pageX;f=a.pageY}else if(a.clientX||a.clientY){b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;f=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}return{x:b,y:f}};this.windowCoordinates=function(a){a=g.pageCoordinates(a);return{x:a.x-document.body.scrollLeft-document.documentElement.scrollLeft,y:a.y-document.body.scrollTop-document.documentElement.scrollTop}};this.wheelDelta=function(a){var b= 0;if(a.wheelDelta)b=a.wheelDelta>0?1:-1;else if(a.detail)b=a.detail<0?1:-1;return b};this.scrollIntoView=function(a){(a=document.getElementById(a))&&a.scrollIntoView&&a.scrollIntoView(true)};this.getSelectionRange=function(a){if(document.selection)if(g.hasTag(a,"TEXTAREA")){var b=document.selection.createRange(),f=b.duplicate();f.moveToElementText(a);var l=0;if(b.text.length>1){l-=b.text.length;if(l<0)l=0}a=-1+l;for(f.moveStart("character",l);f.inRange(b);){f.moveStart("character");a++}b=b.text.replace(/\r/g,
document.body.scrollLeft-document.documentElement.scrollLeft,y:a.y-document.body.scrollTop-document.documentElement.scrollTop}};this.wheelDelta=function(a){var b=0;if(a.wheelDelta)b=a.wheelDelta>0?1:-1;else if(a.detail)b=a.detail<0?1:-1;return b};this.scrollIntoView=function(a){(a=document.getElementById(a))&&a.scrollIntoView&&a.scrollIntoView(true)};this.getSelectionRange=function(a){if(document.selection)if(g.hasTag(a,"TEXTAREA")){var b=document.selection.createRange(),f=b.duplicate();f.moveToElementText(a);
function(a){if(!a)a=window.event;var b=0,f=0;if(a.pageX||a.pageY){b=a.pageX;f=a.pageY}else if(a.clientX||a.clientY){b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;f=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}return{x:b,y:f}};this.windowCoordinates=function(a){a=g.pageCoordinates(a);return{x:a.x-document.body.scrollLeft-document.documentElement.scrollLeft,y:a.y-document.body.scrollTop-document.documentElement.scrollTop}};this.wheelDelta=function(a){var b=0;if(a.wheelDelta)b=a.wheelDelta>0?1:-1;else if(a.detail)b=a.detail<0?1:-1;return b};this.scrollIntoView=function(a){(a=document.getElementById(a))&&a.scrollIntoView&&a.scrollIntoView(true)};this.getSelectionRange=function(a){if(document.selection)if(g.hasTag(a,"TEXTAREA")){var b=document.selection.createRange(),f=b.duplicate();f.moveToElementText(a);var l=0;if(b.text.length>1){l-=b.text.length;if(l<0)l=0}a=-1+l;for(f.moveStart("character",l);f.inRange(b);){f.moveStart("character");a++}b=b.text.replace(/\r/g,
window.event;var b=0,f=0;if(a.pageX||a.pageY){b=a.pageX;f=a.pageY}else if(a.clientX||a.clientY){b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;f=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}return{x:b,y:f}};this.windowCoordinates=function(a){a=g.pageCoordinates(a);return{x:a.x-document.body.scrollLeft-document.documentElement.scrollLeft,y:a.y-document.body.scrollTop-document.documentElement.scrollTop}};this.wheelDelta=function(a){var b=0;if(a.wheelDelta)b= a.wheelDelta>0?1:-1;else if(a.detail)b=a.detail<0?1:-1;return b};this.scrollIntoView=function(a){(a=document.getElementById(a))&&a.scrollIntoView&&a.scrollIntoView(true)};this.getSelectionRange=function(a){if(document.selection)if(g.hasTag(a,"TEXTAREA")){var b=document.selection.createRange(),f=b.duplicate();f.moveToElementText(a);var l=0;if(b.text.length>1){l-=b.text.length;if(l<0)l=0}a=-1+l;for(f.moveStart("character",l);f.inRange(b);){f.moveStart("character");a++}b=b.text.replace(/\r/g,"");return{start:a,
function(a){if(!a)a=window.event;var b=0,f=0;if(a.pageX||a.pageY){b=a.pageX;f=a.pageY}else if(a.clientX||a.clientY){b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;f=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}return{x:b,y:f}};this.windowCoordinates=function(a){a=g.pageCoordinates(a);return{x:a.x-document.body.scrollLeft-document.documentElement.scrollLeft,y:a.y-document.body.scrollTop-document.documentElement.scrollTop}};this.wheelDelta=function(a){var b= 0;if(a.wheelDelta)b=a.wheelDelta>0?1:-1;else if(a.detail)b=a.detail<0?1:-1;return b};this.scrollIntoView=function(a){(a=document.getElementById(a))&&a.scrollIntoView&&a.scrollIntoView(true)};this.getSelectionRange=function(a){if(document.selection)if(g.hasTag(a,"TEXTAREA")){var b=document.selection.createRange(),f=b.duplicate();f.moveToElementText(a);var l=0;if(b.text.length>1){l-=b.text.length;if(l<0)l=0}a=-1+l;for(f.moveStart("character",l);f.inRange(b);){f.moveStart("character");a++}b=b.text.replace(/\r/g,
window.event;var b=0,f=0;if(a.pageX||a.pageY){b=a.pageX;f=a.pageY}else if(a.clientX||a.clientY){b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;f=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}return{x:b,y:f}};this.windowCoordinates=function(a){a=g.pageCoordinates(a);return{x:a.x-document.body.scrollLeft-document.documentElement.scrollLeft,y:a.y-document.body.scrollTop-document.documentElement.scrollTop}};this.wheelDelta=function(a){var b=0;if(a.wheelDelta)b=a.wheelDelta>0?1:-1;else if(a.detail)b=a.detail<0?1:-1;return b};this.scrollIntoView=function(a){(a=document.getElementById(a))&&a.scrollIntoView&&a.scrollIntoView(true)};this.getSelectionRange=function(a){if(document.selection)if(g.hasTag(a,"TEXTAREA")){var b=document.selection.createRange(),f=b.duplicate();f.moveToElementText(a);var l=0;if(b.text.length>1){l-=b.text.length;if(l<0)l=0}a=-1+l;for(f.moveStart("character",l);f.inRange(b);){f.moveStart("character");a++}b=b.text.replace(/\r/g,"");return{start:a,