rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
play: function() { | play: function() {http: | (function($) { var tool; tool = $.tools.tabs.slideshow = { conf: { next: '.forward', prev: '.backward', disabledClass: 'disabled', autoplay: false, autopause: true, interval: 3000, clickable: true, api: false } }; function Slideshow(root, conf, len) { var self = this, fire = root.add(this), tabs = root.data("tabs"), timer, hoverTimer, startTimer, stopped = false; // next / prev buttons function find(query) { return len == 1 ? $(query) : root.parent().find(query); } var nextButton = find(conf.next).click(function() { tabs.next(); }); var prevButton = find(conf.prev).click(function() { tabs.prev(); }); // extend the Tabs API with slideshow methods $.extend(self, { // return tabs API getTabs: function() { return tabs; }, play: function() { // do not start additional timer if already exists if (timer) { return; } // onBeforePlay var e = $.Event("onBeforePlay"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } stopped = false; // construct new timer timer = setInterval(tabs.next, conf.interval); // onPlay fire.trigger("onPlay"); tabs.next(); }, pause: function() { if (!timer) { return self; } // onBeforePause var e = $.Event("onBeforePause"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } timer = clearInterval(timer); startTimer = clearInterval(startTimer); // onPause fire.trigger("onPause"); }, // when stopped - mouseover won't restart stop: function() { self.pause(); stopped = true; }, bind: function(name, fn) { $(self).bind(name, fn); return self; }, unbind: function(name) { $(self).unbind(name); return self; } }); // callbacks $.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); /* when mouse enters, slideshow stops */ if (conf.autopause) { var els = tabs.getTabs().add(nextButton).add(prevButton).add(tabs.getPanes()); els.hover(function() { self.pause(); hoverTimer = clearInterval(hoverTimer); }, function() { if (!stopped) { hoverTimer = setTimeout(self.play, conf.interval); } }); } if (conf.autoplay) { startTimer = setTimeout(self.play, conf.interval); } else { self.stop(); } if (conf.clickable) { tabs.getPanes().click(function() { tabs.next(); }); } // manage disabling of next/prev buttons if (!tabs.getConf().rotate) { var cls = conf.disabledClass; if (!tabs.getIndex()) { prevButton.addClass(cls); } tabs.onBeforeClick(function(e, i) { if (!i) { prevButton.addClass(cls); } else { prevButton.removeClass(cls); if (i == tabs.getTabs().length -1) { nextButton.addClass(cls); } else { nextButton.removeClass(cls); } } }); } } // jQuery plugin implementation $.fn.slideshow = function(conf) { // return existing instance var el = this.data("slideshow"), len = this.length; if (el) { return el; } conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slideshow($(this), conf, len); $(this).data("slideshow", el); }); return conf.api ? el : this; }; })(jQuery); |
}, bind: function(name, fn) { $(self).bind(name, fn); return self; }, unbind: function(name) { $(self).unbind(name); return self; | (function($) { var tool; tool = $.tools.tabs.slideshow = { conf: { next: '.forward', prev: '.backward', disabledClass: 'disabled', autoplay: false, autopause: true, interval: 3000, clickable: true, api: false } }; function Slideshow(root, conf, len) { var self = this, fire = root.add(this), tabs = root.data("tabs"), timer, hoverTimer, startTimer, stopped = false; // next / prev buttons function find(query) { return len == 1 ? $(query) : root.parent().find(query); } var nextButton = find(conf.next).click(function() { tabs.next(); }); var prevButton = find(conf.prev).click(function() { tabs.prev(); }); // extend the Tabs API with slideshow methods $.extend(self, { // return tabs API getTabs: function() { return tabs; }, play: function() { // do not start additional timer if already exists if (timer) { return; } // onBeforePlay var e = $.Event("onBeforePlay"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } stopped = false; // construct new timer timer = setInterval(tabs.next, conf.interval); // onPlay fire.trigger("onPlay"); tabs.next(); }, pause: function() { if (!timer) { return self; } // onBeforePause var e = $.Event("onBeforePause"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } timer = clearInterval(timer); startTimer = clearInterval(startTimer); // onPause fire.trigger("onPause"); }, // when stopped - mouseover won't restart stop: function() { self.pause(); stopped = true; }, bind: function(name, fn) { $(self).bind(name, fn); return self; }, unbind: function(name) { $(self).unbind(name); return self; } }); // callbacks $.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); /* when mouse enters, slideshow stops */ if (conf.autopause) { var els = tabs.getTabs().add(nextButton).add(prevButton).add(tabs.getPanes()); els.hover(function() { self.pause(); hoverTimer = clearInterval(hoverTimer); }, function() { if (!stopped) { hoverTimer = setTimeout(self.play, conf.interval); } }); } if (conf.autoplay) { startTimer = setTimeout(self.play, conf.interval); } else { self.stop(); } if (conf.clickable) { tabs.getPanes().click(function() { tabs.next(); }); } // manage disabling of next/prev buttons if (!tabs.getConf().rotate) { var cls = conf.disabledClass; if (!tabs.getIndex()) { prevButton.addClass(cls); } tabs.onBeforeClick(function(e, i) { if (!i) { prevButton.addClass(cls); } else { prevButton.removeClass(cls); if (i == tabs.getTabs().length -1) { nextButton.addClass(cls); } else { nextButton.removeClass(cls); } } }); } } // jQuery plugin implementation $.fn.slideshow = function(conf) { // return existing instance var el = this.data("slideshow"), len = this.length; if (el) { return el; } conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slideshow($(this), conf, len); $(this).data("slideshow", el); }); return conf.api ? el : this; }; })(jQuery); |
|
setTimeout( function(){ marker.updateInfoWindow() }, 500); } | setTimeout( function(){ marker.updateInfoWindow(); }, 500); }; | return function() { geodesyMarker.markerClicked(); // Once the marker has been opened and rendered, // we add the calendar to the info window // The onOpenFn option with GInfoWindow does not work // Hence this function is called with updateCSWRecords time lag of 500ms var marker = geodesyMarker; setTimeout( function(){ marker.updateInfoWindow() }, 500); } |
e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); var fix = handle.width() / 2; | var fireEvent = e.target != handle[0]; if (fireEvent) { e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } } init(); var fix = handle.width() / 2; | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool = $.tools.slider = { conf: { min: 0, max: 100, size: 0, // The number of options meant to be shown by the control (fixed points in scrubber) step: 0, // Specifies the value granularity of the elements value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: true, sliderClass: 'slider', speed: 200, // set to null if not needed progressClass: 'progress', handleClass: 'handle', api: false } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>"), range = conf.max - conf.min, value, callbacks, origo, len, pos, progress, handle; input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes $.each("min,max,size,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); /* with JavaScript we don't want the HTML5 range element NOTE: input.attr("type", "text") throws exception by the browser */ var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")); input.replaceWith(tmp); input = tmp; if (conf.hideInput) { input.hide(); } var fire = input.add(this); function init() { var o = handle.offset(); // recalculate when value = 0 (a recovery mechanism) if (!len || !value) { if (conf.vertical) { len = root.height() - handle.outerWidth(true); origo = o.top + len; } else { len = root.width() - handle.outerWidth(true); origo = o.left; } } } // flesh and bone of this tool function seek(x, e) { init(); // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.size) { x = toSteps(x, conf.size, len); } // calculate value var v = x / len * range + conf.min; if (conf.step) { v = toSteps(v, conf.step, conf.max); } // rounding v = round(v, conf.decimals); if (v != value) { value = v; e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); } // move handle & resize progress var orig = e && e.originalEvent, speed = orig && orig.type == "click" ? conf.speed : 0; if (conf.vertical) { handle.animate({top: -(x - len)}, speed); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed); progress.animate({width: x}, speed); } pos = x; return self; } $.extend(self, { setValue: function(v, e) { if (v == value) { return self; } init(); // widget is hidden. cannot determine wrapper dimension if (!len) { value = v; return self; } var x = (v - conf.min) * (len / range); return seek(x, e); }, // if widget is hidden draw: function(e) { var v = value; value = 0; self.setValue(v, e); }, getName: function() { return input.attr("name"); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { init(); var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e) }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); }, // callback functions bind: function(name, fn) { $(self).bind(name, fn); return self; }, unbind: function(name) { $(self).unbind(name); return self; } }); // callbacks $.each("onBeforeSlide,onSlide,onSlideEnd".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); // dragging handle.bind("dragstart", function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); }).bind("drag", function(e) { if (input.is(":disabled")) { return false; } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { e.type = "onSlideEnd"; fire.trigger(e); }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); var fix = handle.width() / 2; seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); e.type = "onSlideEnd"; fire.trigger(e); }); self.onSlide(function(e, val) { input.val(val); }); self.setValue(conf.value || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current; if (slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if ($([75, 76, 38, 33, 39]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 33 ? 3 : 1, e); return false; } // DOWN: j=74, h=72, down=40, pagedown=34, left=37 if ($([74, 72, 40, 34, 37]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 34 ? -3 : -1, e); return false; } setTimeout(function() { var val = /[\d\.]+/.exec(el.val()); if (val && parseFloat(val)) { slider.setValue(parseFloat(val), e); } else { el.val(slider.getValue()); } }, 300); current = slider; } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } if (typeof conf == 'number') { conf = {max: conf}; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return conf.api ? el : els; }; }) (jQuery); |
e.type = "onSlideEnd"; fire.trigger(e); | if (fireEvent) { e.type = "onSlideEnd"; fire.trigger(e); } | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool = $.tools.slider = { conf: { min: 0, max: 100, size: 0, // The number of options meant to be shown by the control (fixed points in scrubber) step: 0, // Specifies the value granularity of the elements value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: true, sliderClass: 'slider', speed: 200, // set to null if not needed progressClass: 'progress', handleClass: 'handle', api: false } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>"), range = conf.max - conf.min, value, callbacks, origo, len, pos, progress, handle; input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes $.each("min,max,size,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); /* with JavaScript we don't want the HTML5 range element NOTE: input.attr("type", "text") throws exception by the browser */ var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")); input.replaceWith(tmp); input = tmp; if (conf.hideInput) { input.hide(); } var fire = input.add(this); function init() { var o = handle.offset(); // recalculate when value = 0 (a recovery mechanism) if (!len || !value) { if (conf.vertical) { len = root.height() - handle.outerWidth(true); origo = o.top + len; } else { len = root.width() - handle.outerWidth(true); origo = o.left; } } } // flesh and bone of this tool function seek(x, e) { init(); // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.size) { x = toSteps(x, conf.size, len); } // calculate value var v = x / len * range + conf.min; if (conf.step) { v = toSteps(v, conf.step, conf.max); } // rounding v = round(v, conf.decimals); if (v != value) { value = v; e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); } // move handle & resize progress var orig = e && e.originalEvent, speed = orig && orig.type == "click" ? conf.speed : 0; if (conf.vertical) { handle.animate({top: -(x - len)}, speed); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed); progress.animate({width: x}, speed); } pos = x; return self; } $.extend(self, { setValue: function(v, e) { if (v == value) { return self; } init(); // widget is hidden. cannot determine wrapper dimension if (!len) { value = v; return self; } var x = (v - conf.min) * (len / range); return seek(x, e); }, // if widget is hidden draw: function(e) { var v = value; value = 0; self.setValue(v, e); }, getName: function() { return input.attr("name"); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { init(); var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e) }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); }, // callback functions bind: function(name, fn) { $(self).bind(name, fn); return self; }, unbind: function(name) { $(self).unbind(name); return self; } }); // callbacks $.each("onBeforeSlide,onSlide,onSlideEnd".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); // dragging handle.bind("dragstart", function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); }).bind("drag", function(e) { if (input.is(":disabled")) { return false; } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { e.type = "onSlideEnd"; fire.trigger(e); }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); var fix = handle.width() / 2; seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); e.type = "onSlideEnd"; fire.trigger(e); }); self.onSlide(function(e, val) { input.val(val); }); self.setValue(conf.value || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current; if (slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if ($([75, 76, 38, 33, 39]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 33 ? 3 : 1, e); return false; } // DOWN: j=74, h=72, down=40, pagedown=34, left=37 if ($([74, 72, 40, 34, 37]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 34 ? -3 : -1, e); return false; } setTimeout(function() { var val = /[\d\.]+/.exec(el.val()); if (val && parseFloat(val)) { slider.setValue(parseFloat(val), e); } else { el.val(slider.getValue()); } }, 300); current = slider; } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } if (typeof conf == 'number') { conf = {max: conf}; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return conf.api ? el : els; }; }) (jQuery); |
var el = $(e.target), slider = el.data("slider") || current; if (slider) { | var el = $(e.target), slider = el.data("slider") || current, key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(e.keyCode) != -1, down = $([74, 72, 40, 34, 37]).index(e.keyCode) != -1; if ((up || down) && !(e.shiftKey || e.altKey) && slider) { var fire = slider.getInput().add(slider); e.type = "onBeforeSlide"; | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool = $.tools.slider = { conf: { min: 0, max: 100, size: 0, // The number of options meant to be shown by the control (fixed points in scrubber) step: 0, // Specifies the value granularity of the elements value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: true, sliderClass: 'slider', speed: 200, // set to null if not needed progressClass: 'progress', handleClass: 'handle', api: false } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>"), range = conf.max - conf.min, value, callbacks, origo, len, pos, progress, handle; input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes $.each("min,max,size,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); /* with JavaScript we don't want the HTML5 range element NOTE: input.attr("type", "text") throws exception by the browser */ var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")); input.replaceWith(tmp); input = tmp; if (conf.hideInput) { input.hide(); } var fire = input.add(this); function init() { var o = handle.offset(); // recalculate when value = 0 (a recovery mechanism) if (!len || !value) { if (conf.vertical) { len = root.height() - handle.outerWidth(true); origo = o.top + len; } else { len = root.width() - handle.outerWidth(true); origo = o.left; } } } // flesh and bone of this tool function seek(x, e) { init(); // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.size) { x = toSteps(x, conf.size, len); } // calculate value var v = x / len * range + conf.min; if (conf.step) { v = toSteps(v, conf.step, conf.max); } // rounding v = round(v, conf.decimals); if (v != value) { value = v; e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); } // move handle & resize progress var orig = e && e.originalEvent, speed = orig && orig.type == "click" ? conf.speed : 0; if (conf.vertical) { handle.animate({top: -(x - len)}, speed); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed); progress.animate({width: x}, speed); } pos = x; return self; } $.extend(self, { setValue: function(v, e) { if (v == value) { return self; } init(); // widget is hidden. cannot determine wrapper dimension if (!len) { value = v; return self; } var x = (v - conf.min) * (len / range); return seek(x, e); }, // if widget is hidden draw: function(e) { var v = value; value = 0; self.setValue(v, e); }, getName: function() { return input.attr("name"); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { init(); var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e) }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); }, // callback functions bind: function(name, fn) { $(self).bind(name, fn); return self; }, unbind: function(name) { $(self).unbind(name); return self; } }); // callbacks $.each("onBeforeSlide,onSlide,onSlideEnd".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); // dragging handle.bind("dragstart", function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); }).bind("drag", function(e) { if (input.is(":disabled")) { return false; } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { e.type = "onSlideEnd"; fire.trigger(e); }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); var fix = handle.width() / 2; seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); e.type = "onSlideEnd"; fire.trigger(e); }); self.onSlide(function(e, val) { input.val(val); }); self.setValue(conf.value || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current; if (slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if ($([75, 76, 38, 33, 39]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 33 ? 3 : 1, e); return false; } // DOWN: j=74, h=72, down=40, pagedown=34, left=37 if ($([74, 72, 40, 34, 37]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 34 ? -3 : -1, e); return false; } setTimeout(function() { var val = /[\d\.]+/.exec(el.val()); if (val && parseFloat(val)) { slider.setValue(parseFloat(val), e); } else { el.val(slider.getValue()); } }, 300); current = slider; } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } if (typeof conf == 'number') { conf = {max: conf}; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return conf.api ? el : els; }; }) (jQuery); |
if ($([75, 76, 38, 33, 39]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 33 ? 3 : 1, e); | if (up) { fire.trigger(e); if (e.isDefaultPrevented()) { return false; } slider.step(e.ctrlKey || key == 33 ? 3 : 1, e); | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool = $.tools.slider = { conf: { min: 0, max: 100, size: 0, // The number of options meant to be shown by the control (fixed points in scrubber) step: 0, // Specifies the value granularity of the elements value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: true, sliderClass: 'slider', speed: 200, // set to null if not needed progressClass: 'progress', handleClass: 'handle', api: false } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>"), range = conf.max - conf.min, value, callbacks, origo, len, pos, progress, handle; input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes $.each("min,max,size,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); /* with JavaScript we don't want the HTML5 range element NOTE: input.attr("type", "text") throws exception by the browser */ var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")); input.replaceWith(tmp); input = tmp; if (conf.hideInput) { input.hide(); } var fire = input.add(this); function init() { var o = handle.offset(); // recalculate when value = 0 (a recovery mechanism) if (!len || !value) { if (conf.vertical) { len = root.height() - handle.outerWidth(true); origo = o.top + len; } else { len = root.width() - handle.outerWidth(true); origo = o.left; } } } // flesh and bone of this tool function seek(x, e) { init(); // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.size) { x = toSteps(x, conf.size, len); } // calculate value var v = x / len * range + conf.min; if (conf.step) { v = toSteps(v, conf.step, conf.max); } // rounding v = round(v, conf.decimals); if (v != value) { value = v; e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); } // move handle & resize progress var orig = e && e.originalEvent, speed = orig && orig.type == "click" ? conf.speed : 0; if (conf.vertical) { handle.animate({top: -(x - len)}, speed); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed); progress.animate({width: x}, speed); } pos = x; return self; } $.extend(self, { setValue: function(v, e) { if (v == value) { return self; } init(); // widget is hidden. cannot determine wrapper dimension if (!len) { value = v; return self; } var x = (v - conf.min) * (len / range); return seek(x, e); }, // if widget is hidden draw: function(e) { var v = value; value = 0; self.setValue(v, e); }, getName: function() { return input.attr("name"); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { init(); var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e) }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); }, // callback functions bind: function(name, fn) { $(self).bind(name, fn); return self; }, unbind: function(name) { $(self).unbind(name); return self; } }); // callbacks $.each("onBeforeSlide,onSlide,onSlideEnd".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); // dragging handle.bind("dragstart", function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); }).bind("drag", function(e) { if (input.is(":disabled")) { return false; } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { e.type = "onSlideEnd"; fire.trigger(e); }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); var fix = handle.width() / 2; seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); e.type = "onSlideEnd"; fire.trigger(e); }); self.onSlide(function(e, val) { input.val(val); }); self.setValue(conf.value || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current; if (slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if ($([75, 76, 38, 33, 39]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 33 ? 3 : 1, e); return false; } // DOWN: j=74, h=72, down=40, pagedown=34, left=37 if ($([74, 72, 40, 34, 37]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 34 ? -3 : -1, e); return false; } setTimeout(function() { var val = /[\d\.]+/.exec(el.val()); if (val && parseFloat(val)) { slider.setValue(parseFloat(val), e); } else { el.val(slider.getValue()); } }, 300); current = slider; } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } if (typeof conf == 'number') { conf = {max: conf}; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return conf.api ? el : els; }; }) (jQuery); |
if ($([74, 72, 40, 34, 37]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 34 ? -3 : -1, e); | if (down) { fire.trigger(e); if (e.isDefaultPrevented()) { return false; } slider.step(e.ctrlKey || key == 34 ? -3 : -1, e); | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool = $.tools.slider = { conf: { min: 0, max: 100, size: 0, // The number of options meant to be shown by the control (fixed points in scrubber) step: 0, // Specifies the value granularity of the elements value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: true, sliderClass: 'slider', speed: 200, // set to null if not needed progressClass: 'progress', handleClass: 'handle', api: false } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>"), range = conf.max - conf.min, value, callbacks, origo, len, pos, progress, handle; input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes $.each("min,max,size,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); /* with JavaScript we don't want the HTML5 range element NOTE: input.attr("type", "text") throws exception by the browser */ var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")); input.replaceWith(tmp); input = tmp; if (conf.hideInput) { input.hide(); } var fire = input.add(this); function init() { var o = handle.offset(); // recalculate when value = 0 (a recovery mechanism) if (!len || !value) { if (conf.vertical) { len = root.height() - handle.outerWidth(true); origo = o.top + len; } else { len = root.width() - handle.outerWidth(true); origo = o.left; } } } // flesh and bone of this tool function seek(x, e) { init(); // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.size) { x = toSteps(x, conf.size, len); } // calculate value var v = x / len * range + conf.min; if (conf.step) { v = toSteps(v, conf.step, conf.max); } // rounding v = round(v, conf.decimals); if (v != value) { value = v; e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); } // move handle & resize progress var orig = e && e.originalEvent, speed = orig && orig.type == "click" ? conf.speed : 0; if (conf.vertical) { handle.animate({top: -(x - len)}, speed); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed); progress.animate({width: x}, speed); } pos = x; return self; } $.extend(self, { setValue: function(v, e) { if (v == value) { return self; } init(); // widget is hidden. cannot determine wrapper dimension if (!len) { value = v; return self; } var x = (v - conf.min) * (len / range); return seek(x, e); }, // if widget is hidden draw: function(e) { var v = value; value = 0; self.setValue(v, e); }, getName: function() { return input.attr("name"); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { init(); var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e) }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); }, // callback functions bind: function(name, fn) { $(self).bind(name, fn); return self; }, unbind: function(name) { $(self).unbind(name); return self; } }); // callbacks $.each("onBeforeSlide,onSlide,onSlideEnd".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); // dragging handle.bind("dragstart", function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); }).bind("drag", function(e) { if (input.is(":disabled")) { return false; } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { e.type = "onSlideEnd"; fire.trigger(e); }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); var fix = handle.width() / 2; seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); e.type = "onSlideEnd"; fire.trigger(e); }); self.onSlide(function(e, val) { input.val(val); }); self.setValue(conf.value || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current; if (slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if ($([75, 76, 38, 33, 39]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 33 ? 3 : 1, e); return false; } // DOWN: j=74, h=72, down=40, pagedown=34, left=37 if ($([74, 72, 40, 34, 37]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 34 ? -3 : -1, e); return false; } setTimeout(function() { var val = /[\d\.]+/.exec(el.val()); if (val && parseFloat(val)) { slider.setValue(parseFloat(val), e); } else { el.val(slider.getValue()); } }, 300); current = slider; } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } if (typeof conf == 'number') { conf = {max: conf}; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return conf.api ? el : els; }; }) (jQuery); |
}, 300); | }, 400); | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool = $.tools.slider = { conf: { min: 0, max: 100, size: 0, // The number of options meant to be shown by the control (fixed points in scrubber) step: 0, // Specifies the value granularity of the elements value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: true, sliderClass: 'slider', speed: 200, // set to null if not needed progressClass: 'progress', handleClass: 'handle', api: false } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>"), range = conf.max - conf.min, value, callbacks, origo, len, pos, progress, handle; input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes $.each("min,max,size,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); /* with JavaScript we don't want the HTML5 range element NOTE: input.attr("type", "text") throws exception by the browser */ var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")); input.replaceWith(tmp); input = tmp; if (conf.hideInput) { input.hide(); } var fire = input.add(this); function init() { var o = handle.offset(); // recalculate when value = 0 (a recovery mechanism) if (!len || !value) { if (conf.vertical) { len = root.height() - handle.outerWidth(true); origo = o.top + len; } else { len = root.width() - handle.outerWidth(true); origo = o.left; } } } // flesh and bone of this tool function seek(x, e) { init(); // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.size) { x = toSteps(x, conf.size, len); } // calculate value var v = x / len * range + conf.min; if (conf.step) { v = toSteps(v, conf.step, conf.max); } // rounding v = round(v, conf.decimals); if (v != value) { value = v; e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); } // move handle & resize progress var orig = e && e.originalEvent, speed = orig && orig.type == "click" ? conf.speed : 0; if (conf.vertical) { handle.animate({top: -(x - len)}, speed); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed); progress.animate({width: x}, speed); } pos = x; return self; } $.extend(self, { setValue: function(v, e) { if (v == value) { return self; } init(); // widget is hidden. cannot determine wrapper dimension if (!len) { value = v; return self; } var x = (v - conf.min) * (len / range); return seek(x, e); }, // if widget is hidden draw: function(e) { var v = value; value = 0; self.setValue(v, e); }, getName: function() { return input.attr("name"); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { init(); var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e) }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); }, // callback functions bind: function(name, fn) { $(self).bind(name, fn); return self; }, unbind: function(name) { $(self).unbind(name); return self; } }); // callbacks $.each("onBeforeSlide,onSlide,onSlideEnd".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); // dragging handle.bind("dragstart", function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); }).bind("drag", function(e) { if (input.is(":disabled")) { return false; } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { e.type = "onSlideEnd"; fire.trigger(e); }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } e.type = "onBeforeSlide"; fire.trigger(e); if (e.isDefaultPrevented()) { return false; } init(); var fix = handle.width() / 2; seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); e.type = "onSlideEnd"; fire.trigger(e); }); self.onSlide(function(e, val) { input.val(val); }); self.setValue(conf.value || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current; if (slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if ($([75, 76, 38, 33, 39]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 33 ? 3 : 1, e); return false; } // DOWN: j=74, h=72, down=40, pagedown=34, left=37 if ($([74, 72, 40, 34, 37]).index(e.keyCode) != -1) { slider.step(e.ctrlKey || e.keyCode == 34 ? -3 : -1, e); return false; } setTimeout(function() { var val = /[\d\.]+/.exec(el.val()); if (val && parseFloat(val)) { slider.setValue(parseFloat(val), e); } else { el.val(slider.getValue()); } }, 300); current = slider; } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } if (typeof conf == 'number') { conf = {max: conf}; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return conf.api ? el : els; }; }) (jQuery); |
top: '10%', left: 'center', absolute: false, speed: 'normal', | close: null, closeOnClick: true, closeOnEsc: true, | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { top: '10%', left: 'center', absolute: false, speed: 'normal', closeSpeed: 'fast', effect: 'default', close: null, oneInstance: true, closeOnClick: true, closeOnEsc: true, mask: null, // target element to be overlayed. by default taken from [rel] target: null, // 1.2 fixed: true } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
close: null, | fixed: true, left: 'center', load: false, mask: null, | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { top: '10%', left: 'center', absolute: false, speed: 'normal', closeSpeed: 'fast', effect: 'default', close: null, oneInstance: true, closeOnClick: true, closeOnEsc: true, mask: null, // target element to be overlayed. by default taken from [rel] target: null, // 1.2 fixed: true } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
closeOnClick: true, closeOnEsc: true, mask: null, target: null, fixed: true | speed: 'normal', target: null, top: '10%' | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { top: '10%', left: 'center', absolute: false, speed: 'normal', closeSpeed: 'fast', effect: 'default', close: null, oneInstance: true, closeOnClick: true, closeOnEsc: true, mask: null, // target element to be overlayed. by default taken from [rel] target: null, // 1.2 fixed: true } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); | function(pos, onLoad) { var conf = this.getConf(), w = $(window); if (!conf.fixed) { pos.top += w.scrollTop(); pos.left += w.scrollLeft(); } pos.position = conf.fixed ? 'fixed' : 'absolute'; this.getOverlay().css(pos).fadeIn(conf.speed, onLoad); | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { top: '10%', left: 'center', absolute: false, speed: 'normal', closeSpeed: 'fast', effect: 'default', close: null, oneInstance: true, closeOnClick: true, closeOnEsc: true, mask: null, // target element to be overlayed. by default taken from [rel] target: null, // 1.2 fixed: true } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
if (maskConf) { $.mask.load(overlay, maskConf); } | if (maskConf) { $(overlay).expose(maskConf); } | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { top: '10%', left: 'center', absolute: false, speed: 'normal', closeSpeed: 'fast', effect: 'default', close: null, oneInstance: true, closeOnClick: true, closeOnEsc: true, mask: null, // target element to be overlayed. by default taken from [rel] target: null, // 1.2 fixed: true } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { top: '10%', left: 'center', absolute: false, speed: 'normal', closeSpeed: 'fast', effect: 'default', close: null, oneInstance: true, closeOnClick: true, closeOnEsc: true, mask: null, // target element to be overlayed. by default taken from [rel] target: null, // 1.2 fixed: true } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
|
eff[0].call(self, function() { | eff[0].call(self, {top: top, left: left}, function() { | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { top: '10%', left: 'center', absolute: false, speed: 'normal', closeSpeed: 'fast', effect: 'default', close: null, oneInstance: true, closeOnClick: true, closeOnEsc: true, mask: null, // target element to be overlayed. by default taken from [rel] target: null, // 1.2 fixed: true } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
if (maskConf) { | if (maskConf && conf.closeOnClick) { | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { top: '10%', left: 'center', absolute: false, speed: 'normal', closeSpeed: 'fast', effect: 'default', close: null, oneInstance: true, closeOnClick: true, closeOnEsc: true, mask: null, // target element to be overlayed. by default taken from [rel] target: null, // 1.2 fixed: true } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
if (conf.load) { self.load(); } | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { top: '10%', left: 'center', absolute: false, speed: 'normal', closeSpeed: 'fast', effect: 'default', close: null, oneInstance: true, closeOnClick: true, closeOnEsc: true, mask: null, // target element to be overlayed. by default taken from [rel] target: null, // 1.2 fixed: true } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(onLoad) { this.getOverlay().fadeIn(this.getConf().speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
|
findABC($("body")).each(function(i,elem){ | getABCContainingElements($("body")).each(function(i,elem){ | findABC($("body")).each(function(i,elem){ ABCConversion(elem); }); |
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"); 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= false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a= a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;if(w(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;f+=document.body.scrollTop+document.documentElement.scrollTop;break}l=a.offsetParent;if(l==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,"DIV")){b-=a.scrollLeft;f-=a.scrollTop}}while(a!=null&&a!=l)}}return{x:b,y:f}};this.widgetCoordinates=function(a,b){b=g.pageCoordinates(b);a=g.widgetPageCoordinates(a);return{x:b.x-a.x,y:b.y-a.y}};this.pageCoordinates= 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, "");return{start:a,end:b.length+a}}else{f=$(a).val();a=document.selection.createRange().duplicate();a.moveEnd("character",f.length);b=a.text==""?f.length:f.lastIndexOf(a.text);a=document.selection.createRange().duplicate();a.moveStart("character",-f.length);return{start:b,end:a.text.length}}else return a.selectionStart||a.selectionStart==0?{start:a.selectionStart,end:a.selectionEnd}:{start:-1,end:-1}};this.setSelectionRange=function(a,b,f){var l=$(a).val();if(typeof b!="number")b=-1;if(typeof f!= "number")f=-1;if(b<0)b=0;if(f>l.length)f=l.length;if(f<b)f=b;if(b>f)b=f;a.focus();if(typeof a.selectionStart!=="undefined"){a.selectionStart=b;a.selectionEnd=f}else if(document.selection){a=a.createTextRange();a.collapse(true);a.moveStart("character",b);a.moveEnd("character",f-b);a.select()}};this.isKeyPress=function(a){if(!a)a=window.event;if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||g.isIE?true:g.isOpera?a.keyCode==13||a.keyCode==27||a.keyCode>= 32&&a.keyCode<125:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};this.px=function(a,b){return G(w(a,b))};this.pxself=function(a,b){return G(a.style[b])};this.pctself=function(a,b){return U(a.style[b],0)};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.IEwidth=function(a,b,f){if(a.parentNode){var l=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")- g.px(a,"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,"paddingRight");b=U(b,0);f=U(f,1E5);return l<b?b-1:l>f?f+1:a.style.styleFloat!=""?b-1:"auto"}else return"auto"};this.hide=function(a){g.getElement(a).style.display="none"};this.inline=function(a){g.getElement(a).style.display="inline"};this.block=function(a){g.getElement(a).style.display="block"};this.show=function(a){g.getElement(a).style.display=""};var z=null;this.firedTarget=null;this.target= function(a){return g.firedTarget||a.target||a.srcElement};var da=false;this.capture=function(a){W();if(!(z&&a)){z=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName= function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f= document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var l=document.styleSheets[f],n=0,o;do{o=null;if(l.cssRules)o=l.cssRules[n];else if(l.rules)o=l.rules[n];if(o&&o.selectorText)if(o.selectorText.toLowerCase()== a)if(b=="delete"){l.cssRules?l.deleteRule(n):l.removeRule(n);return true}else return o;++n}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href",a);f.setAttribute("type","text/css");f.setAttribute("rel","stylesheet");b!=""&&b!="all"&&f.setAttribute("media", b);document.getElementsByTagName("head")[0].appendChild(f)}};this.windowSize=function(){var a,b;if(typeof window.innerWidth==="number"){a=window.innerWidth;b=window.innerHeight}else{a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}return{x:a,y:b}};this.fitToWindow=function(a,b,f,l,n){var o=g.windowSize(),L=document.body.scrollLeft+document.documentElement.scrollLeft,u=document.body.scrollTop+document.documentElement.scrollTop,q=g.widgetPageCoordinates(a.offsetParent), B=["left","right"],r=["top","bottom"],C=g.px(a,"maxWidth")||a.offsetWidth,J=g.px(a,"maxHeight")||a.offsetHeight;if(b+C>L+o.x){l-=q.x;b=a.offsetParent.offsetWidth-(l+g.px(a,"marginRight"));l=1}else{b-=q.x;b-=g.px(a,"marginLeft");l=0}if(f+J>u+o.y){if(n>u+o.y)n=u+o.y;n-=q.y;f=a.offsetParent.offsetHeight-(n+g.px(a,"marginBottom"));n=1}else{f-=q.y;f-=g.px(a,"marginTop");n=0}a.style[B[l]]=b+"px";a.style[B[1-l]]="";a.style[r[n]]=f+"px";a.style[r[1-n]]=""};this.positionXY=function(a,b,f){a=g.getElement(a); g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus= function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k,h,s,A;if(!C.contentWindow|| !C.contentWindow.document)setTimeout(n,10);else{k=C.contentWindow.document;s=(h=k.getElementById("state"))?h.innerText:null;A=a();setInterval(function(){var H,E;k=C.contentWindow.document;H=(h=k.getElementById("state"))?h.innerText:null;E=a();if(H!==s){s=H;f(s);E=s?s:x;A=location.hash=E;b()}else if(E!==A){A=E;l(E)}},50);K=true;r!=null&&r()}}function o(){if(!q){var k=a(),h=history.length;M&&clearInterval(M);M=setInterval(function(){var s,A;s=a();A=history.length;if(s!==k){k=s;h=A;f(k);b()}else if(A!== h&&u){k=s;h=A;s=O[h-1];f(s);b()}},50)}}function L(){var k;k=J.value.split("|");if(k.length>1){x=k[0];D=k[1]}if(k.length>2)O=k[2].split(",");if(q)n();else{o();K=true;r!=null&&r()}}var u=false,q=g.isIElt9,B=false,r=null,C=null,J=null,K=false,M=null,O=[],x,D,Y=function(){};return{onReady:function(k){if(K)setTimeout(function(){k()},0);else r=k},_initialize:function(){J!=null&&L()},_initTimeout:function(){o()},register:function(k,h){if(!K){D=x=escape(k);Y=h}},initialize:function(k,h){if(!K){var s=navigator.vendor|| "";if(s!=="KDE")if(typeof window.opera!=="undefined")B=true;else if(!q&&s.indexOf("Apple Computer, Inc.")>-1)u=true;if(typeof k==="string")k=document.getElementById(k);if(!(!k||k.tagName.toUpperCase()!=="TEXTAREA"&&(k.tagName.toUpperCase()!=="INPUT"||k.type!=="hidden"&&k.type!=="text"))){J=k;if(q){if(typeof h==="string")h=document.getElementById(h);!h||h.tagName.toUpperCase()!=="IFRAME"||(C=h)}}}},navigate:function(k){if(K){fqstate=k;if(q)l(fqstate);else{location.hash=fqstate;if(u){O[history.length]= fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()}); | 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")== "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=false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b= window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;if(w(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;f+=document.body.scrollTop+document.documentElement.scrollTop;break}l=a.offsetParent;if(l==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,"DIV")){b-=a.scrollLeft;f-=a.scrollTop}}while(a!=null&& a!=l)}}return{x:b,y:f}};this.widgetCoordinates=function(a,b){b=g.pageCoordinates(b);a=g.widgetPageCoordinates(a);return{x:b.x-a.x,y:b.y-a.y}};this.pageCoordinates=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,"");return{start:a,end:b.length+a}}else{f=$(a).val();a=document.selection.createRange().duplicate();a.moveEnd("character",f.length);b=a.text==""?f.length:f.lastIndexOf(a.text);a=document.selection.createRange().duplicate();a.moveStart("character",-f.length);return{start:b,end:a.text.length}}else return a.selectionStart||a.selectionStart== 0?{start:a.selectionStart,end:a.selectionEnd}:{start:-1,end:-1}};this.setSelectionRange=function(a,b,f){var l=$(a).val();if(typeof b!="number")b=-1;if(typeof f!="number")f=-1;if(b<0)b=0;if(f>l.length)f=l.length;if(f<b)f=b;if(b>f)b=f;a.focus();if(typeof a.selectionStart!=="undefined"){a.selectionStart=b;a.selectionEnd=f}else if(document.selection){a=a.createTextRange();a.collapse(true);a.moveStart("character",b);a.moveEnd("character",f-b);a.select()}};this.isKeyPress=function(a){if(!a)a=window.event; if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||g.isIE?true:g.isOpera?a.keyCode==13||a.keyCode==27||a.keyCode>=32&&a.keyCode<125:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};this.px=function(a,b){return G(w(a,b))};this.pxself=function(a,b){return G(a.style[b])};this.pctself=function(a,b){return U(a.style[b],0)};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!= "body"?g.isHidden(a):false}};this.IEwidth=function(a,b,f){if(a.parentNode){var l=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-g.px(a,"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,"paddingRight");b=U(b,0);f=U(f,1E5);return l<b?b-1:l>f?f+1:a.style.styleFloat!=""?b-1:"auto"}else return"auto"};this.hide=function(a){g.getElement(a).style.display="none"};this.inline=function(a){g.getElement(a).style.display="inline"};this.block=function(a){g.getElement(a).style.display= "block"};this.show=function(a){g.getElement(a).style.display=""};var z=null;this.firedTarget=null;this.target=function(a){return g.firedTarget||a.target||a.srcElement};var da=false;this.capture=function(a){W();if(!(z&&a)){z=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart= ""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css"); if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var l=document.styleSheets[f],n=0,o; do{o=null;if(l.cssRules)o=l.cssRules[n];else if(l.rules)o=l.rules[n];if(o&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){l.cssRules?l.deleteRule(n):l.removeRule(n);return true}else return o;++n}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href", a);f.setAttribute("type","text/css");f.setAttribute("rel","stylesheet");b!=""&&b!="all"&&f.setAttribute("media",b);document.getElementsByTagName("head")[0].appendChild(f)}};this.windowSize=function(){var a,b;if(typeof window.innerWidth==="number"){a=window.innerWidth;b=window.innerHeight}else{a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}return{x:a,y:b}};this.fitToWindow=function(a,b,f,l,n){var o=g.windowSize(),L=document.body.scrollLeft+document.documentElement.scrollLeft, u=document.body.scrollTop+document.documentElement.scrollTop,q=g.widgetPageCoordinates(a.offsetParent),B=["left","right"],r=["top","bottom"],C=g.px(a,"maxWidth")||a.offsetWidth,J=g.px(a,"maxHeight")||a.offsetHeight;if(b+C>L+o.x){l-=q.x;b=a.offsetParent.offsetWidth-(l+g.px(a,"marginRight"));l=1}else{b-=q.x;b-=g.px(a,"marginLeft");l=0}if(f+J>u+o.y){if(n>u+o.y)n=u+o.y;n-=q.y;f=a.offsetParent.offsetHeight-(n+g.px(a,"marginBottom"));n=1}else{f-=q.y;f-=g.px(a,"marginTop");n=0}a.style[B[l]]=b+"px";a.style[B[1- l]]="";a.style[r[n]]=f+"px";a.style[r[1-n]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight; o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open(); h.write(k);h.close();return true}catch(s){return false}}function n(){var k,h,s,A;if(!C.contentWindow||!C.contentWindow.document)setTimeout(n,10);else{k=C.contentWindow.document;s=(h=k.getElementById("state"))?h.innerText:null;A=a();setInterval(function(){var H,E;k=C.contentWindow.document;H=(h=k.getElementById("state"))?h.innerText:null;E=a();if(H!==s){s=H;f(s);E=s?s:x;A=location.hash=E;b()}else if(E!==A){A=E;l(E)}},50);K=true;r!=null&&r()}}function o(){if(!q){var k=a(),h=history.length;M&&clearInterval(M); M=setInterval(function(){var s,A;s=a();A=history.length;if(s!==k){k=s;h=A;f(k);b()}else if(A!==h&&u){k=s;h=A;s=O[h-1];f(s);b()}},50)}}function L(){var k;k=J.value.split("|");if(k.length>1){x=k[0];D=k[1]}if(k.length>2)O=k[2].split(",");if(q)n();else{o();K=true;r!=null&&r()}}var u=false,q=g.isIElt9,B=false,r=null,C=null,J=null,K=false,M=null,O=[],x,D,Y=function(){};return{onReady:function(k){if(K)setTimeout(function(){k()},0);else r=k},_initialize:function(){J!=null&&L()},_initTimeout:function(){o()}, register:function(k,h){if(!K){D=x=escape(k);Y=h}},initialize:function(k,h){if(!K){var s=navigator.vendor||"";if(s!=="KDE")if(typeof window.opera!=="undefined")B=true;else if(!q&&s.indexOf("Apple Computer, Inc.")>-1)u=true;if(typeof k==="string")k=document.getElementById(k);if(!(!k||k.tagName.toUpperCase()!=="TEXTAREA"&&(k.tagName.toUpperCase()!=="INPUT"||k.type!=="hidden"&&k.type!=="text"))){J=k;if(q){if(typeof h==="string")h=document.getElementById(h);!h||h.tagName.toUpperCase()!=="IFRAME"||(C=h)}}}}, navigate:function(k){if(K){fqstate=k;if(q)l(fqstate);else{location.hash=fqstate;if(u){O[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()}); | window._$_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 v(a,b,f){if(a=="auto"||a==null)return f;return(a=(a=b.exec(a))&&a.length==2?a[1]:null)?parseFloat(a):f}function G(a){return v(a,/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/i,0)}function U(a,b){return v(a,/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/i,b)}function ca(a){if(z==null)return null;if(!a)a=window.event;if(a){for(var b=a=g.target(a);b&&b!=z;)b=b.parentNode;return b==z?g.isIElt9?a:null:z}else return z}function V(a){var b=ca(a);if(b&&!N){if(!a)a=window.event;N=true;if(g.isIElt9){g.firedTarget=a.srcElement||b;b.fireEvent("onmousemove",a);g.firedTarget=null}else g.condCall(b,"onmousemove",a);return N=false}else return true}function R(a){var b=ca(a);g.capture(null);if(b){if(!a)a=window.event;if(g.isIElt9){g.firedTarget=a.srcElement||b;b.fireEvent("onmouseup",a);g.firedTarget=null}else g.condCall(b,"onmouseup",a);g.cancelEvent(a,g.CancelPropagate);return false}else return true}function W(){if(!da){da=true;if(document.body.addEventListener){var a=document.body;a.addEventListener("mousemove",V,true);a.addEventListener("mouseup",R,true);g.isGecko&&window.addEventListener("mouseout",function(b){!b.relatedTarget&&g.hasTag(b.target,"HTML")&&R(b)},true)}else{a=document.body;a.attachEvent("onmousemove",V);a.attachEvent("onmouseup",R)}}}var g=this;this.buttons=0;this.mouseDown=function(a){g.buttons|=g.button(a)};this.mouseUp=function(a){g.buttons^=g.button(a)};this.arrayRemove=function(a,b,f){f=a.slice((f||b)+1||a.length);a.length=b<0?a.length+b:b;return a.push.apply(a,f)};var X=function(){for(var a,b=3,f=document.createElement("div"),l=f.getElementsByTagName("i");f.innerHTML="<!--[if gt IE "+ ++b+"]><i></i><![endif]--\>",l[0];);return b>4?b:a}();this.isIE=X!==undefined;this.isIE6=X===6;this.isIElt9=X<9;this.isGecko=navigator.userAgent.toLowerCase().indexOf("gecko")!=-1;this.isIEMobile=navigator.userAgent.toLowerCase().indexOf("msie 4")!=-1||navigator.userAgent.toLowerCase().indexOf("msie 5")!=-1;this.isOpera=typeof window.opera!=="undefined";this.updateDelay=this.isIE?10:51;this.setHtml=function(a,b,f){function l(o,L){var u,q,B;switch(o.nodeType){case 1:u=o.namespaceURI==null?document.createElement(o.nodeName):document.createElementNS(o.namespaceURI,o.nodeName);if(o.attributes&&o.attributes.length>0){q=0;for(B=o.attributes.length;q<B;)u.setAttribute(o.attributes[q].nodeName,o.getAttribute(o.attributes[q++].nodeName))}if(L&&o.childNodes.length>0){q=0;for(B=o.childNodes.length;q<B;){var r=l(o.childNodes[q++],L);r&&u.appendChild(r)}}return u;case 3:case 4:case 5:return document.createTextNode(o.nodeValue)}return null}if(g.isIE||_$_INNER_HTML_$_&&!f)if(f)a.innerHTML+=b;else a.innerHTML=b;else{var n;n=new DOMParser;n=n.parseFromString("<div>"+b+"</div>","application/xhtml+xml").documentElement;if(n.nodeType!=1)n=n.nextSibling;if(!f)a.innerHTML="";b=0;for(f=n.childNodes.length;b<f;)a.appendChild(l(n.childNodes[b++],true))}};this.hasTag=function(a,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");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=false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;if(w(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;f+=document.body.scrollTop+document.documentElement.scrollTop;break}l=a.offsetParent;if(l==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,"DIV")){b-=a.scrollLeft;f-=a.scrollTop}}while(a!=null&&a!=l)}}return{x:b,y:f}};this.widgetCoordinates=function(a,b){b=g.pageCoordinates(b);a=g.widgetPageCoordinates(a);return{x:b.x-a.x,y:b.y-a.y}};this.pageCoordinates=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,"");return{start:a,end:b.length+a}}else{f=$(a).val();a=document.selection.createRange().duplicate();a.moveEnd("character",f.length);b=a.text==""?f.length:f.lastIndexOf(a.text);a=document.selection.createRange().duplicate();a.moveStart("character",-f.length);return{start:b,end:a.text.length}}else return a.selectionStart||a.selectionStart==0?{start:a.selectionStart,end:a.selectionEnd}:{start:-1,end:-1}};this.setSelectionRange=function(a,b,f){var l=$(a).val();if(typeof b!="number")b=-1;if(typeof f!="number")f=-1;if(b<0)b=0;if(f>l.length)f=l.length;if(f<b)f=b;if(b>f)b=f;a.focus();if(typeof a.selectionStart!=="undefined"){a.selectionStart=b;a.selectionEnd=f}else if(document.selection){a=a.createTextRange();a.collapse(true);a.moveStart("character",b);a.moveEnd("character",f-b);a.select()}};this.isKeyPress=function(a){if(!a)a=window.event;if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||g.isIE?true:g.isOpera?a.keyCode==13||a.keyCode==27||a.keyCode>=32&&a.keyCode<125:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};this.px=function(a,b){return G(w(a,b))};this.pxself=function(a,b){return G(a.style[b])};this.pctself=function(a,b){return U(a.style[b],0)};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.IEwidth=function(a,b,f){if(a.parentNode){var l=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-g.px(a,"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,"paddingRight");b=U(b,0);f=U(f,1E5);return l<b?b-1:l>f?f+1:a.style.styleFloat!=""?b-1:"auto"}else return"auto"};this.hide=function(a){g.getElement(a).style.display="none"};this.inline=function(a){g.getElement(a).style.display="inline"};this.block=function(a){g.getElement(a).style.display="block"};this.show=function(a){g.getElement(a).style.display=""};var z=null;this.firedTarget=null;this.target=function(a){return g.firedTarget||a.target||a.srcElement};var da=false;this.capture=function(a){W();if(!(z&&a)){z=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var l=document.styleSheets[f],n=0,o;do{o=null;if(l.cssRules)o=l.cssRules[n];else if(l.rules)o=l.rules[n];if(o&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){l.cssRules?l.deleteRule(n):l.removeRule(n);return true}else return o;++n}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href",a);f.setAttribute("type","text/css");f.setAttribute("rel","stylesheet");b!=""&&b!="all"&&f.setAttribute("media",b);document.getElementsByTagName("head")[0].appendChild(f)}};this.windowSize=function(){var a,b;if(typeof window.innerWidth==="number"){a=window.innerWidth;b=window.innerHeight}else{a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}return{x:a,y:b}};this.fitToWindow=function(a,b,f,l,n){var o=g.windowSize(),L=document.body.scrollLeft+document.documentElement.scrollLeft,u=document.body.scrollTop+document.documentElement.scrollTop,q=g.widgetPageCoordinates(a.offsetParent),B=["left","right"],r=["top","bottom"],C=g.px(a,"maxWidth")||a.offsetWidth,J=g.px(a,"maxHeight")||a.offsetHeight;if(b+C>L+o.x){l-=q.x;b=a.offsetParent.offsetWidth-(l+g.px(a,"marginRight"));l=1}else{b-=q.x;b-=g.px(a,"marginLeft");l=0}if(f+J>u+o.y){if(n>u+o.y)n=u+o.y;n-=q.y;f=a.offsetParent.offsetHeight-(n+g.px(a,"marginBottom"));n=1}else{f-=q.y;f-=g.px(a,"marginTop");n=0}a.style[B[l]]=b+"px";a.style[B[1-l]]="";a.style[r[n]]=f+"px";a.style[r[1-n]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k,h,s,A;if(!C.contentWindow||!C.contentWindow.document)setTimeout(n,10);else{k=C.contentWindow.document;s=(h=k.getElementById("state"))?h.innerText:null;A=a();setInterval(function(){var H,E;k=C.contentWindow.document;H=(h=k.getElementById("state"))?h.innerText:null;E=a();if(H!==s){s=H;f(s);E=s?s:x;A=location.hash=E;b()}else if(E!==A){A=E;l(E)}},50);K=true;r!=null&&r()}}function o(){if(!q){var k=a(),h=history.length;M&&clearInterval(M);M=setInterval(function(){var s,A;s=a();A=history.length;if(s!==k){k=s;h=A;f(k);b()}else if(A!==h&&u){k=s;h=A;s=O[h-1];f(s);b()}},50)}}function L(){var k;k=J.value.split("|");if(k.length>1){x=k[0];D=k[1]}if(k.length>2)O=k[2].split(",");if(q)n();else{o();K=true;r!=null&&r()}}var u=false,q=g.isIElt9,B=false,r=null,C=null,J=null,K=false,M=null,O=[],x,D,Y=function(){};return{onReady:function(k){if(K)setTimeout(function(){k()},0);else r=k},_initialize:function(){J!=null&&L()},_initTimeout:function(){o()},register:function(k,h){if(!K){D=x=escape(k);Y=h}},initialize:function(k,h){if(!K){var s=navigator.vendor||"";if(s!=="KDE")if(typeof window.opera!=="undefined")B=true;else if(!q&&s.indexOf("Apple Computer, Inc.")>-1)u=true;if(typeof k==="string")k=document.getElementById(k);if(!(!k||k.tagName.toUpperCase()!=="TEXTAREA"&&(k.tagName.toUpperCase()!=="INPUT"||k.type!=="hidden"&&k.type!=="text"))){J=k;if(q){if(typeof h==="string")h=document.getElementById(h);!h||h.tagName.toUpperCase()!=="IFRAME"||(C=h)}}}},navigate:function(k){if(K){fqstate=k;if(q)l(fqstate);else{location.hash=fqstate;if(u){O[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()}); |
var Coordinator=new Class({initialize:function(a,b){this.activities=new Hash();a.each(function(c){this.activities.set(c,false)}.bind(this));this.callback=b},done:function(b,a){this.activities.set(b,a);if(this.activities.every(function(d){var c=0;return d})){this.callback(this.activities)}}}); | var Coordinator=new Class({initialize:function(a,b){this.activities=new Hash();a.each(function(c){this.activities.set(c,false)}.bind(this));this.callback=b},done:function(b,a){this.activities.set(b,a);if(this.activities.every(function(c){return c})){this.callback(this.activities)}}}); | var Coordinator=new Class({initialize:function(a,b){this.activities=new Hash();a.each(function(c){this.activities.set(c,false)}.bind(this));this.callback=b},done:function(b,a){this.activities.set(b,a);if(this.activities.every(function(d){var c=0;return d})){this.callback(this.activities)}}}); |
RSA.log( "RSAEngine:2.3.3:subparam.result="+result ); | RSA.log( "RSAEngine:2.3.3:result="+result ); | (function ( ) { //This file has been reworked to rely on class NS - A Chandler May 2010 /////////////////////////////////////////// // import /////////////////////////////////////////// // var RSA = __package( packages, id ).RSA; // var BigInteger = __package( packages, id ).BigInteger; // var SecureRandom = __package( packages, id ).SecureRandom; /////////////////////////////////////////// // implementation /////////////////////////////////////////// RSA.prototype.generateAsync = function(keylen,exp,result) { var self=this; var generator = new NS( stepping_generate,true); var _result = function(keyPair) { $extend(self,keyPair); result( self ); }; generator.EXEC([keylen,exp],_result); /////////////////////////////////////////// // implementation /////////////////////////////////////////// // Generate a new random private key B bits long, using public expt E function stepping_generate (myArgs) { var B,E; B = myArgs[0]; E = myArgs[1]; //var rng = new SecureRandom(); // MODIFIED 2008/12/07 var rng; // var qs = B>>1; var qs = self.splitBitLength( B ); self._e(E); var ee = new BigInteger(self.e); var p1; var q1; var phi; return DO([ // Step1.ver2 function () { RSA.log("RSAEngine:1.1"); self.p = new BigInteger(); rng = new SecureRandom(); }, function () { RSA.log("RSAEngine:1.2"); // return self.p.stepping_fromNumber1( B-qs, 1, rng ).BREAK(); return self.p.stepping_fromNumber1( qs[0], 1, rng ); }, [ // Step1.3 ver3 function () { RSA.log("RSAEngine:1.3.1"); if ( self.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) != 0 ) return AGAIN(); }, function () { RSA.log("RSAEngine:1.3.2 : calling stepping_isProbablePrime"); return self.p.stepping_isProbablePrime(10); }, function (result) { RSA.log("RSAEngine:1.3.3 : returned stepping_isProbablePrime" + result ); if ( result ) { RSA.log("RSAEngine:1.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:1.3.3=>AGAIN"); return AGAIN(); } }, EXIT ], function() { RSA.log("RSAEngine:2.0"); }, // Step2.ver2 [ function() { RSA.log("RSAEngine:2.1"); self.q = new BigInteger(); }, function () { RSA.log("RSAEngine:2.2"); // return self.q.stepping_fromNumber1( qs, 1, rng ).BREAK(); return self.q.stepping_fromNumber1( qs[1], 1, rng ); }, // Step2.3 ver2>>> function () { RSA.log("RSAEngine:2.3.1"); if ( self.q.subtract( BigInteger.ONE ).gcd( ee ).compareTo( BigInteger.ONE ) != 0 ) return AGAIN(); }, function() { RSA.log("RSAEngine:2.3.2"); return self.q.stepping_isProbablePrime(10); }, function(result) { RSA.log( "RSAEngine:2.3.3:subparam.result="+result ); if ( result ) { RSA.log("RSAEngine:2.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:2.3.3=>AGAIN"); return AGAIN(); } }, // <<< EXIT ], function() { RSA.log("RSAEngine:2.3"); if ( self.p.compareTo(self.q) <= 0 ) { var t = self.p; self.p = self.q; self.q = t; } RSA.log("RSAEngine:3.1"); RSA.log( "p=" + self.p.toString(16) ); RSA.log( "q=" + self.q.toString(16) ); }, // // Step3.2 ver2 >>> function() { RSA.log("RSAEngine:3.2"); /* var */ p1 = self.p.subtract( BigInteger.ONE ); /* var */ q1 = self.q.subtract( BigInteger.ONE ); /* var */ phi = p1.multiply( q1 ); if ( phi.gcd(ee).compareTo( BigInteger.ONE ) == 0 ) { RSA.log("RSAEngine:3.2=>BREAK"); return ; } else { RSA.log("RSAEngine:3.2=>AGAIN"); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.2.sub"); // ADDED 11Dec,2008 Ats >>> // When p and q in a RSA key have the same value, the RSA // key cannot encrypt/decrypt messages correctly. // Check if they have the same value and if so regenerate these value again. // Though rarely do p and q conflict when key length is large enough. // <<< if ( self.p.compareTo( self.q ) ==0 ) { RSA.log("RSAEngine:3.2.sub +++ P & Q ARE EQUAL !!!"); return AGAIN(); } self.n = self.p.multiply( self.q ); // ADDED 2008/12/1 >>> // if ( self.n.bitLength() != B ) { // if ( self.n.bitLength() < B ) { // modified 2009/1/13 if ( ! self.isProperBitLength( self.n, B ) ) { // modified 2009/1/15 RSA.log("RSAEngine:3.3.2.1:AGAIN bitLength="+self.n.bitLength() + " B=" + B ); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.3.1"); RSA.log("RSAEngine:3.3.1(1)"); self.d = ee.modInverse( phi ); RSA.log("RSAEngine:3.3.2(2)"); self._ksize(B); // added Jan15,2009 }, function() { RSA.log("RSAEngine:3.3.2"); self.dmp1 = self.d.mod(p1); self.dmq1 = self.d.mod(q1); }, function() { RSA.log("RSAEngine:3.3.3"); self.coeff = self.q.modInverse(self.p); }, // <<< EXIT ]); } } /////////////////////////////////////////// /* RSA.prototype.stepping_processPublic = function(m){ return m.stepping_modPow( new BigInteger(this.e), this.n); }; RSA.prototype.stepping_processPrivate = function(m){ return m.stepping_modPow( this.d, this.n ); };*/ })(); |
(function($){$.imgAreaSelect={onKeyPress:null};$.imgAreaSelect.init=function(img,options){var $img=$(img),imgLoaded,$box=$('<div />'),$area=$('<div />'),$border1=$('<div />'),$border2=$('<div />'),$areaOpera,$outLeft=$('<div />'),$outTop=$('<div />'),$outRight=$('<div />'),$outBottom=$('<div />'),$handles=$([]),handleWidth,handles=[],left,top,M=Math,imgOfs,imgWidth,imgHeight,$parent,parOfs,zIndex=0,position='absolute',$p,startX,startY,scaleX=1,scaleY=1,resizeMargin=10,resize=[],V=0,H=1,d,aspectRatio,x1,x2,y1,y2,x,y,adjusted,shown,i,selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0};var $o=$outLeft.add($outTop).add($outRight).add($outBottom);function viewX(x){return x+imgOfs.left-parOfs.left}function viewY(y){return y+imgOfs.top-parOfs.top}function selX(x){return x-imgOfs.left+parOfs.left}function selY(y){return y-imgOfs.top+parOfs.top}function evX(event){return event.pageX-parOfs.left}function evY(event){return event.pageY-parOfs.top}function trueSelection(){return{x1:M.round(selection.x1*scaleX),y1:M.round(selection.y1*scaleY),x2:M.round(selection.x2*scaleX),y2:M.round(selection.y2*scaleY),width:M.round(selection.x2*scaleX)-M.round(selection.x1*scaleX),height:M.round(selection.y2*scaleY)-M.round(selection.y1*scaleY)}}function getZIndex(){$p=$img;while($p.length&&!$p.is('body')){if(!isNaN($p.css('z-index'))&&$p.css('z-index')>zIndex)zIndex=$p.css('z-index');if($p.css('position')=='fixed')position='fixed';$p=$p.parent()}if(!isNaN(options.zIndex))zIndex=options.zIndex}function adjust(){imgOfs={left:M.round($img.offset().left),top:M.round($img.offset().top)};imgWidth=$img.width();imgHeight=$img.height();if($().jquery=='1.3.2'&&$.browser.safari&&position=='fixed'){imgOfs.top+=M.max(document.documentElement.scrollTop,$('body').scrollTop());imgOfs.left+=M.max(document.documentElement.scrollLeft,$('body').scrollLeft())}parOfs=$.inArray($parent.css('position'),['absolute','relative'])!=-1?{left:M.round($parent.offset().left)-$parent.scrollLeft(),top:M.round($parent.offset().top)-$parent.scrollTop()}:position=='fixed'?{left:$(document).scrollLeft(),top:$(document).scrollTop()}:{left:0,top:0};left=viewX(0);top=viewY(0)}function update(resetKeyPress){if(!shown)return;$box.css({left:viewX(selection.x1)+'px',top:viewY(selection.y1)+'px',width:selection.width+'px',height:selection.height+'px'});$area.add($border1).add($border2).css({left:'0px',top:'0px',width:M.max(selection.width-options.borderWidth*2,0)+'px',height:M.max(selection.height-options.borderWidth*2,0)+'px'});$border1.css({borderStyle:'solid',borderColor:options.borderColor1});$border2.css({borderStyle:'dashed',borderColor:options.borderColor2});$border1.add($border2).css({opacity:options.borderOpacity});$outLeft.css({left:left+'px',top:top+'px',width:selection.x1+'px',height:imgHeight+'px'});$outTop.css({left:left+selection.x1+'px',top:top+'px',width:selection.width+'px',height:selection.y1+'px'});$outRight.css({left:left+selection.x2+'px',top:top+'px',width:imgWidth-selection.x2+'px',height:imgHeight+'px'});$outBottom.css({left:left+selection.x1+'px',top:top+selection.y2+'px',width:selection.width+'px',height:imgHeight-selection.y2+'px'});if(handles.length){handles[1].css({left:selection.width-handleWidth+'px'});handles[2].css({left:selection.width-handleWidth+'px',top:selection.height-handleWidth+'px'});handles[3].css({top:selection.height-handleWidth+'px'});if(handles.length==8){handles[4].css({left:(selection.width-handleWidth)/2+'px'});handles[5].css({left:selection.width-handleWidth+'px',top:(selection.height-handleWidth)/2+'px'});handles[6].css({left:(selection.width-handleWidth)/2+'px',top:selection.height-handleWidth+'px'});handles[7].css({top:(selection.height-handleWidth)/2+'px'})}}if(resetKeyPress!==false){if($.imgAreaSelect.keyPress!=docKeyPress)$(document).unbind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress);if(options.keys)$(document).bind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress=docKeyPress)}if($.browser.msie&&options.borderWidth==1&&options.borderOpacity<1){$border1.add($border2).css('margin','0');setTimeout(function(){$border1.add($border2).css('margin','auto')},0)}}function areaMouseMove(event){if(!adjusted){adjust();adjusted=true;$box.one('mouseout',function(){adjusted=false})}x=selX(evX(event))-selection.x1;y=selY(evY(event))-selection.y1;resize=[];if(options.resizable){if(y<=resizeMargin)resize[V]='n';else if(y>=selection.height-resizeMargin)resize[V]='s';if(x<=resizeMargin)resize[H]='w';else if(x>=selection.width-resizeMargin)resize[H]='e'}$box.css('cursor',resize.length?resize.join('')+'-resize':options.movable?'move':'');if($areaOpera)$areaOpera.toggle()}function docMouseUp(event){resize=[];$('body').css('cursor','');if(options.autoHide||selection.width*selection.height==0)$box.add($o).hide();options.onSelectEnd(img,trueSelection());$(document).unbind('mousemove',selectingMouseMove);$box.mousemove(areaMouseMove)}function areaMouseDown(event){if(event.which!=1)return false;adjust();if(options.resizable&&resize.length>0){$('body').css('cursor',resize.join('')+'-resize');x1=viewX(selection[resize[H]=='w'?'x2':'x1']);y1=viewY(selection[resize[V]=='n'?'y2':'y1']);$(document).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove)}else if(options.movable){startX=left+selection.x1-evX(event);startY=top+selection.y1-evY(event);$box.unbind('mousemove',areaMouseMove);$(document).mousemove(movingMouseMove).one('mouseup',function(){options.onSelectEnd(img,trueSelection());$(document).unbind('mousemove',movingMouseMove);$box.mousemove(areaMouseMove)})}else $img.mousedown(event);return false}function aspectRatioXY(){x2=M.max(left,M.min(left+imgWidth,x1+M.abs(y2-y1)*aspectRatio*(x2<x1?-1:1)));y2=M.round(M.max(top,M.min(top+imgHeight,y1+M.abs(x2-x1)/aspectRatio*(y2<y1?-1:1))));x2=M.round(x2)}function aspectRatioYX(){y2=M.max(top,M.min(top+imgHeight,y1+M.abs(x2-x1)/aspectRatio*(y2<y1?-1:1)));x2=M.round(M.max(left,M.min(left+imgWidth,x1+M.abs(y2-y1)*aspectRatio*(x2<x1?-1:1))));y2=M.round(y2)}function doResize(){if(options.minWidth&&M.abs(x2-x1)<options.minWidth){x2=x1-options.minWidth*(x2<x1?1:-1);if(x2<left)x1=left+options.minWidth;else if(x2>left+imgWidth)x1=left+imgWidth-options.minWidth}if(options.minHeight&&M.abs(y2-y1)<options.minHeight){y2=y1-options.minHeight*(y2<y1?1:-1);if(y2<top)y1=top+options.minHeight;else if(y2>top+imgHeight)y1=top+imgHeight-options.minHeight}x2=M.max(left,M.min(x2,left+imgWidth));y2=M.max(top,M.min(y2,top+imgHeight));if(aspectRatio)if(M.abs(x2-x1)/aspectRatio>M.abs(y2-y1))aspectRatioYX();else aspectRatioXY();if(options.maxWidth&&M.abs(x2-x1)>options.maxWidth){x2=x1-options.maxWidth*(x2<x1?1:-1);if(aspectRatio)aspectRatioYX()}if(options.maxHeight&&M.abs(y2-y1)>options.maxHeight){y2=y1-options.maxHeight*(y2<y1?1:-1);if(aspectRatio)aspectRatioXY()}selection={x1:selX(M.min(x1,x2)),x2:selX(M.max(x1,x2)),y1:selY(M.min(y1,y2)),y2:selY(M.max(y1,y2)),width:M.abs(x2-x1),height:M.abs(y2-y1)};update();options.onSelectChange(img,trueSelection())}function selectingMouseMove(event){x2=!resize.length||resize[H]||aspectRatio?evX(event):viewX(selection.x2);y2=!resize.length||resize[V]||aspectRatio?evY(event):viewY(selection.y2);doResize();return false}function doMove(newX1,newY1){x2=(x1=newX1)+selection.width;y2=(y1=newY1)+selection.height;selection=$.extend(selection,{x1:selX(x1),y1:selY(y1),x2:selX(x2),y2:selY(y2)});update();options.onSelectChange(img,trueSelection())}function movingMouseMove(event){x1=M.max(left,M.min(startX+evX(event),left+imgWidth-selection.width));y1=M.max(top,M.min(startY+evY(event),top+imgHeight-selection.height));doMove(x1,y1);event.preventDefault();return false}function startSelection(event){adjust();x2=x1;y2=y1;doResize();resize=[];$box.add($o.is(':visible')?null:$o).show();shown=true;$(document).unbind('mouseup',cancelSelection).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove);options.onSelectStart(img,trueSelection())}function cancelSelection(){$(document).unbind('mousemove',startSelection);$box.add($o).hide();selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0};options.onSelectChange(img,selection);options.onSelectEnd(img,selection)}function imgMouseDown(event){if(event.which!=1)return false;adjust();startX=x1=evX(event);startY=y1=evY(event);$(document).one('mousemove',startSelection).one('mouseup',cancelSelection);return false}function parentScroll(){adjust();update(false);x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2)}function imgLoad(){imgLoaded=true;if(options.show){shown=true;adjust();update();$box.add($o).show()}$box.add($o).css({visibility:''})}var docKeyPress=function(event){var k=options.keys,d,t,key=event.keyCode||event.which;d=!isNaN(k.alt)&&(event.altKey||event.originalEvent.altKey)?k.alt:!isNaN(k.ctrl)&&event.ctrlKey?k.ctrl:!isNaN(k.shift)&&event.shiftKey?k.shift:!isNaN(k.arrows)?k.arrows:10;if(k.arrows=='resize'||(k.shift=='resize'&&event.shiftKey)||(k.ctrl=='resize'&&event.ctrlKey)||(k.alt=='resize'&&(event.altKey||event.originalEvent.altKey))){switch(key){case 37:d=-d;case 39:t=M.max(x1,x2);x1=M.min(x1,x2);x2=M.max(t+d,x1);if(aspectRatio)aspectRatioYX();break;case 38:d=-d;case 40:t=M.max(y1,y2);y1=M.min(y1,y2);y2=M.max(t+d,y1);if(aspectRatio)aspectRatioXY();break;default:return}doResize()}else{x1=M.min(x1,x2);y1=M.min(y1,y2);switch(key){case 37:doMove(M.max(x1-d,left),y1);break;case 38:doMove(x1,M.max(y1-d,top));break;case 39:doMove(x1+M.min(d,imgWidth-selX(x2)),y1);break;case 40:doMove(x1,y1+M.min(d,imgHeight-selY(y2)));break;default:return}}return false};this.setOptions=function(newOptions){if(newOptions.parent)($parent=$(newOptions.parent)).append($box.add($o));adjust();getZIndex();if(newOptions.x1!=null){selection={x1:newOptions.x1,y1:newOptions.y1,x2:newOptions.x2,y2:newOptions.y2};newOptions.show=!newOptions.hide;x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2);selection.width=x2-x1;selection.height=y2-y1}if(newOptions.handles!=null){$handles.remove();$handles=$(handles=[]);i=newOptions.handles?newOptions.handles=='corners'?4:8:0;while(i--)$handles=$handles.add(handles[i]=$('<div />'));handleWidth=4+options.borderWidth;$handles.css({position:'absolute',borderWidth:options.borderWidth+'px',borderStyle:'solid',borderColor:options.borderColor1,opacity:options.borderOpacity,backgroundColor:options.borderColor2,width:handleWidth+'px',height:handleWidth+'px',fontSize:'0px',zIndex:zIndex>0?zIndex+1:'1'}).addClass(options.classPrefix+'-handle');handleWidth+=options.borderWidth*2}update();options=$.extend(options,newOptions);if(options.imageWidth||options.imageHeight){scaleX=(parseInt(options.imageWidth)||imgWidth)/imgWidth;scaleY=(parseInt(options.imageHeight)||imgHeight)/imgHeight}if(newOptions.keys)options.keys=$.extend({shift:1,ctrl:'resize'},newOptions.keys===true?{}:newOptions.keys);$o.addClass(options.classPrefix+'-outer');$area.addClass(options.classPrefix+'-selection');$border1.addClass(options.classPrefix+'-border1');$border2.addClass(options.classPrefix+'-border2');$box.add($area).add($border1).add($border2).css({borderWidth:options.borderWidth+'px'});$area.css({backgroundColor:options.selectionColor,opacity:options.selectionOpacity});$border1.css({borderStyle:'solid',borderColor:options.borderColor1});$border2.css({borderStyle:'dashed',borderColor:options.borderColor2});$border1.add($border2).css({opacity:options.borderOpacity});$o.css({opacity:options.outerOpacity,backgroundColor:options.outerColor});$box.append($area.add($border1).add($border2).add($handles).add($areaOpera));if(newOptions.hide)$box.add($o).hide();else if(newOptions.show&&imgLoaded){shown=true;update();$box.add($o).show()}aspectRatio=options.aspectRatio&&(d=options.aspectRatio.split(/:/))?d[0]/d[1]:null;if(aspectRatio)if(options.minWidth)options.minHeight=parseInt(options.minWidth/aspectRatio);else if(options.minHeight)options.minWidth=parseInt(options.minHeight*aspectRatio);if(options.disable||options.enable===false){$box.unbind('mousemove',areaMouseMove).unbind('mousedown',areaMouseDown);$img.add($o).unbind('mousedown',imgMouseDown);$(window).unbind('resize',parentScroll);$img.add($img.parents()).unbind('scroll',parentScroll)}else if(options.enable||options.disable===false){if(options.resizable||options.movable)$box.mousemove(areaMouseMove).mousedown(areaMouseDown);if(!options.persistent)$img.add($o).mousedown(imgMouseDown);$(window).resize(parentScroll);$img.add($img.parents()).scroll(parentScroll)}options.enable=options.disable=undefined};if($.browser.msie)$img.attr('unselectable','on');$.imgAreaSelect.keyPress=$.browser.msie||$.browser.safari?'keydown':'keypress';if($.browser.opera)($areaOpera=$('<div style="width: 100%; height: 100%; position: absolute;" />')).css({zIndex:zIndex>0?zIndex+2:'2'});this.setOptions(options=$.extend({borderColor1:'#000',borderColor2:'#fff',borderWidth:1,borderOpacity:.5,classPrefix:'imgareaselect',movable:true,resizable:true,selectionColor:'#fff',selectionOpacity:0,outerColor:'#000',outerOpacity:.4,parent:'body',onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},options));$box.add($o).css({visibility:'hidden',position:position,overflow:'hidden',zIndex:zIndex>0?zIndex:'0'});$area.css({borderStyle:'solid'});$box.css({position:position,zIndex:zIndex>0?zIndex+2:'2'});$area.add($border1).add($border2).css({position:'absolute'});img.complete||img.readyState=='complete'||!$img.is('img')?imgLoad():$img.one('load',imgLoad)};$.fn.imgAreaSelect=function(options){options=options||{};this.each(function(){if($(this).data('imgAreaSelect'))$(this).data('imgAreaSelect').setOptions(options);else{if(options.enable===undefined&&options.disable===undefined)options.enable=true;$(this).data('imgAreaSelect',new $.imgAreaSelect.init(this,options))}});return this}})(jQuery); | (function($){var abs=Math.abs,max=Math.max,min=Math.min,round=Math.round;function div(){return $('<div/>')}$.imgAreaSelect=function(img,options){var $img=$(img),imgLoaded,$box=div(),$area=div(),$border=div().add(div()).add(div()).add(div()),$outer=div().add(div()).add(div()).add(div()),$handles=$([]),$areaOpera,left,top,imgOfs,imgWidth,imgHeight,$parent,parOfs,zIndex=0,position='absolute',startX,startY,scaleX,scaleY,resizeMargin=10,resize,minWidth,minHeight,maxWidth,maxHeight,aspectRatio,shown,x1,y1,x2,y2,selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0},docElem=document.documentElement,$p,d,i,o,w,h,adjusted;function viewX(x){return x+imgOfs.left-parOfs.left}function viewY(y){return y+imgOfs.top-parOfs.top}function selX(x){return x-imgOfs.left+parOfs.left}function selY(y){return y-imgOfs.top+parOfs.top}function evX(event){return event.pageX-parOfs.left}function evY(event){return event.pageY-parOfs.top}function getSelection(noScale){var sx=noScale||scaleX,sy=noScale||scaleY;return{x1:round(selection.x1*sx),y1:round(selection.y1*sy),x2:round(selection.x2*sx),y2:round(selection.y2*sy),width:round(selection.x2*sx)-round(selection.x1*sx),height:round(selection.y2*sy)-round(selection.y1*sy)}}function setSelection(x1,y1,x2,y2,noScale){var sx=noScale||scaleX,sy=noScale||scaleY;selection={x1:round(x1/sx),y1:round(y1/sy),x2:round(x2/sx),y2:round(y2/sy)};selection.width=selection.x2-selection.x1;selection.height=selection.y2-selection.y1}function adjust(){if(!$img.width())return;imgOfs={left:round($img.offset().left),top:round($img.offset().top)};imgWidth=$img.width();imgHeight=$img.height();minWidth=options.minWidth||0;minHeight=options.minHeight||0;maxWidth=min(options.maxWidth||1<<24,imgWidth);maxHeight=min(options.maxHeight||1<<24,imgHeight);if($().jquery=='1.3.2'&&position=='fixed'&&!docElem['getBoundingClientRect']){imgOfs.top+=max(document.body.scrollTop,docElem.scrollTop);imgOfs.left+=max(document.body.scrollLeft,docElem.scrollLeft)}parOfs=$.inArray($parent.css('position'),['absolute','relative'])+1?{left:round($parent.offset().left)-$parent.scrollLeft(),top:round($parent.offset().top)-$parent.scrollTop()}:position=='fixed'?{left:$(document).scrollLeft(),top:$(document).scrollTop()}:{left:0,top:0};left=viewX(0);top=viewY(0);if(selection.x2>imgWidth||selection.y2>imgHeight)doResize()}function update(resetKeyPress){if(!shown)return;$box.css({left:viewX(selection.x1),top:viewY(selection.y1)}).add($area).width(w=selection.width).height(h=selection.height);$area.add($border).add($handles).css({left:0,top:0});$border.width(max(w-$border.outerWidth()+$border.innerWidth(),0)).height(max(h-$border.outerHeight()+$border.innerHeight(),0));$($outer[0]).css({left:left,top:top,width:selection.x1,height:imgHeight});$($outer[1]).css({left:left+selection.x1,top:top,width:w,height:selection.y1});$($outer[2]).css({left:left+selection.x2,top:top,width:imgWidth-selection.x2,height:imgHeight});$($outer[3]).css({left:left+selection.x1,top:top+selection.y2,width:w,height:imgHeight-selection.y2});w-=$handles.outerWidth();h-=$handles.outerHeight();switch($handles.length){case 8:$($handles[4]).css({left:w/2});$($handles[5]).css({left:w,top:h/2});$($handles[6]).css({left:w/2,top:h});$($handles[7]).css({top:h/2});case 4:$handles.slice(1,3).css({left:w});$handles.slice(2,4).css({top:h})}if(resetKeyPress!==false){if($.imgAreaSelect.keyPress!=docKeyPress)$(document).unbind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress);if(options.keys)$(document)[$.imgAreaSelect.keyPress]($.imgAreaSelect.onKeyPress=docKeyPress)}if($.browser.msie&&$border.outerWidth()-$border.innerWidth()==2){$border.css('margin',0);setTimeout(function(){$border.css('margin','auto')},0)}}function doUpdate(resetKeyPress){adjust();update(resetKeyPress);x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2)}function hide($elem,fn){options.fadeSpeed?$elem.fadeOut(options.fadeSpeed,fn):$elem.hide()}function areaMouseMove(event){var x=selX(evX(event))-selection.x1,y=selY(evY(event))-selection.y1;if(!adjusted){adjust();adjusted=true;$box.one('mouseout',function(){adjusted=false})}resize='';if(options.resizable){if(y<=resizeMargin)resize='n';else if(y>=selection.height-resizeMargin)resize='s';if(x<=resizeMargin)resize+='w';else if(x>=selection.width-resizeMargin)resize+='e'}$box.css('cursor',resize?resize+'-resize':options.movable?'move':'');if($areaOpera)$areaOpera.toggle()}function docMouseUp(event){$('body').css('cursor','');if(options.autoHide||selection.width*selection.height==0)hide($box.add($outer),function(){$(this).hide()});options.onSelectEnd(img,getSelection());$(document).unbind('mousemove',selectingMouseMove);$box.mousemove(areaMouseMove)}function areaMouseDown(event){if(event.which!=1)return false;adjust();if(resize){$('body').css('cursor',resize+'-resize');x1=viewX(selection[/w/.test(resize)?'x2':'x1']);y1=viewY(selection[/n/.test(resize)?'y2':'y1']);$(document).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove)}else if(options.movable){startX=left+selection.x1-evX(event);startY=top+selection.y1-evY(event);$box.unbind('mousemove',areaMouseMove);$(document).mousemove(movingMouseMove).one('mouseup',function(){options.onSelectEnd(img,getSelection());$(document).unbind('mousemove',movingMouseMove);$box.mousemove(areaMouseMove)})}else $img.mousedown(event);return false}function fixAspectRatio(xFirst){if(aspectRatio)if(xFirst){x2=max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1)));y2=round(max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1))));x2=round(x2)}else{y2=max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1)));x2=round(max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1))));y2=round(y2)}}function doResize(){x1=min(x1,left+imgWidth);y1=min(y1,top+imgHeight);if(abs(x2-x1)<minWidth){x2=x1-minWidth*(x2<x1||-1);if(x2<left)x1=left+minWidth;else if(x2>left+imgWidth)x1=left+imgWidth-minWidth}if(abs(y2-y1)<minHeight){y2=y1-minHeight*(y2<y1||-1);if(y2<top)y1=top+minHeight;else if(y2>top+imgHeight)y1=top+imgHeight-minHeight}x2=max(left,min(x2,left+imgWidth));y2=max(top,min(y2,top+imgHeight));fixAspectRatio(abs(x2-x1)<abs(y2-y1)*aspectRatio);if(abs(x2-x1)>maxWidth){x2=x1-maxWidth*(x2<x1||-1);fixAspectRatio()}if(abs(y2-y1)>maxHeight){y2=y1-maxHeight*(y2<y1||-1);fixAspectRatio(true)}selection={x1:selX(min(x1,x2)),x2:selX(max(x1,x2)),y1:selY(min(y1,y2)),y2:selY(max(y1,y2)),width:abs(x2-x1),height:abs(y2-y1)};update();options.onSelectChange(img,getSelection())}function selectingMouseMove(event){x2=resize==''||/w|e/.test(resize)||aspectRatio?evX(event):viewX(selection.x2);y2=resize==''||/n|s/.test(resize)||aspectRatio?evY(event):viewY(selection.y2);doResize();return false}function doMove(newX1,newY1){x2=(x1=newX1)+selection.width;y2=(y1=newY1)+selection.height;$.extend(selection,{x1:selX(x1),y1:selY(y1),x2:selX(x2),y2:selY(y2)});update();options.onSelectChange(img,getSelection())}function movingMouseMove(event){x1=max(left,min(startX+evX(event),left+imgWidth-selection.width));y1=max(top,min(startY+evY(event),top+imgHeight-selection.height));doMove(x1,y1);event.preventDefault();return false}function startSelection(){adjust();x2=x1;y2=y1;doResize();resize='';if($outer.is(':not(:visible)'))$box.add($outer).hide().fadeIn(options.fadeSpeed||0);shown=true;$(document).unbind('mouseup',cancelSelection).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove);options.onSelectStart(img,getSelection())}function cancelSelection(){$(document).unbind('mousemove',startSelection);hide($box.add($outer));selection={x1:selX(x1),y1:selY(y1),x2:selX(x1),y2:selY(y1),width:0,height:0};options.onSelectChange(img,getSelection());options.onSelectEnd(img,getSelection())}function imgMouseDown(event){if(event.which!=1||$outer.is(':animated'))return false;adjust();startX=x1=evX(event);startY=y1=evY(event);$(document).one('mousemove',startSelection).one('mouseup',cancelSelection);return false}function windowResize(){doUpdate(false)}function imgLoad(){imgLoaded=true;setOptions(options=$.extend({classPrefix:'imgareaselect',movable:true,resizable:true,parent:'body',onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},options));$box.add($outer).css({visibility:''});if(options.show){shown=true;adjust();update();$box.add($outer).hide().fadeIn(options.fadeSpeed||0)}setTimeout(function(){options.onInit(img,getSelection())},0)}var docKeyPress=function(event){var k=options.keys,d,t,key=event.keyCode;d=!isNaN(k.alt)&&(event.altKey||event.originalEvent.altKey)?k.alt:!isNaN(k.ctrl)&&event.ctrlKey?k.ctrl:!isNaN(k.shift)&&event.shiftKey?k.shift:!isNaN(k.arrows)?k.arrows:10;if(k.arrows=='resize'||(k.shift=='resize'&&event.shiftKey)||(k.ctrl=='resize'&&event.ctrlKey)||(k.alt=='resize'&&(event.altKey||event.originalEvent.altKey))){switch(key){case 37:d=-d;case 39:t=max(x1,x2);x1=min(x1,x2);x2=max(t+d,x1);fixAspectRatio();break;case 38:d=-d;case 40:t=max(y1,y2);y1=min(y1,y2);y2=max(t+d,y1);fixAspectRatio(true);break;default:return}doResize()}else{x1=min(x1,x2);y1=min(y1,y2);switch(key){case 37:doMove(max(x1-d,left),y1);break;case 38:doMove(x1,max(y1-d,top));break;case 39:doMove(x1+min(d,imgWidth-selX(x2)),y1);break;case 40:doMove(x1,y1+min(d,imgHeight-selY(y2)));break;default:return}}return false};function styleOptions($elem,props){for(option in props)if(options[option]!==undefined)$elem.css(props[option],options[option])}function setOptions(newOptions){if(newOptions.parent)($parent=$(newOptions.parent)).append($box.add($outer));$.extend(options,newOptions);adjust();if(newOptions.handles!=null){$handles.remove();$handles=$([]);i=newOptions.handles?newOptions.handles=='corners'?4:8:0;while(i--)$handles=$handles.add(div());$handles.addClass(options.classPrefix+'-handle').css({position:'absolute',fontSize:0,zIndex:zIndex+1||1});if(!parseInt($handles.css('width')))$handles.width(5).height(5);if(o=options.borderWidth)$handles.css({borderWidth:o,borderStyle:'solid'});styleOptions($handles,{borderColor1:'border-color',borderColor2:'background-color',borderOpacity:'opacity'})}scaleX=options.imageWidth/imgWidth||1;scaleY=options.imageHeight/imgHeight||1;if(newOptions.x1!=null){setSelection(newOptions.x1,newOptions.y1,newOptions.x2,newOptions.y2);newOptions.show=!newOptions.hide}if(newOptions.keys)options.keys=$.extend({shift:1,ctrl:'resize'},newOptions.keys);$outer.addClass(options.classPrefix+'-outer');$area.addClass(options.classPrefix+'-selection');for(i=0;i++<4;)$($border[i-1]).addClass(options.classPrefix+'-border'+i);styleOptions($area,{selectionColor:'background-color',selectionOpacity:'opacity'});styleOptions($border,{borderOpacity:'opacity',borderWidth:'border-width'});styleOptions($outer,{outerColor:'background-color',outerOpacity:'opacity'});if(o=options.borderColor1)$($border[0]).css({borderStyle:'solid',borderColor:o});if(o=options.borderColor2)$($border[1]).css({borderStyle:'dashed',borderColor:o});$box.append($area.add($border).add($handles).add($areaOpera));if($.browser.msie){if(o=$outer.css('filter').match(/opacity=([0-9]+)/))$outer.css('opacity',o[1]/100);if(o=$border.css('filter').match(/opacity=([0-9]+)/))$border.css('opacity',o[1]/100)}if(newOptions.hide)hide($box.add($outer));else if(newOptions.show&&imgLoaded){shown=true;$box.add($outer).fadeIn(options.fadeSpeed||0);doUpdate()}aspectRatio=(d=(options.aspectRatio||'').split(/:/))[0]/d[1];if(options.disable||options.enable===false){$box.unbind('mousemove',areaMouseMove).unbind('mousedown',areaMouseDown);$img.add($outer).unbind('mousedown',imgMouseDown);$(window).unbind('resize',windowResize)}else if(options.enable||options.disable===false){if(options.resizable||options.movable)$box.mousemove(areaMouseMove).mousedown(areaMouseDown);if(!options.persistent)$img.add($outer).mousedown(imgMouseDown);$(window).resize(windowResize)}options.enable=options.disable=undefined}this.remove=function(){$img.unbind('mousedown',imgMouseDown);$box.add($outer).remove()};this.getOptions=function(){return options};this.setOptions=setOptions;this.getSelection=getSelection;this.setSelection=setSelection;this.update=doUpdate;$p=$img;while($p.length){zIndex=max(zIndex,!isNaN($p.css('z-index'))?$p.css('z-index'):zIndex);if($p.css('position')=='fixed')position='fixed';$p=$p.parent(':not(body)')}zIndex=options.zIndex||zIndex;if($.browser.msie)$img.attr('unselectable','on');$.imgAreaSelect.keyPress=$.browser.msie||$.browser.safari?'keydown':'keypress';if($.browser.opera)$areaOpera=div().css({width:'100%',height:'100%',position:'absolute',zIndex:zIndex+2||2});$box.add($outer).css({visibility:'hidden',position:position,overflow:'hidden',zIndex:zIndex||'0'});$box.css({zIndex:zIndex+2||2});$area.add($border).css({position:'absolute',fontSize:0});img.complete||img.readyState=='complete'||!$img.is('img')?imgLoad():$img.one('load',imgLoad)};$.fn.imgAreaSelect=function(options){options=options||{};this.each(function(){if($(this).data('imgAreaSelect')){if(options.remove){$(this).data('imgAreaSelect').remove();$(this).removeData('imgAreaSelect')}else $(this).data('imgAreaSelect').setOptions(options)}else if(!options.remove){if(options.enable===undefined&&options.disable===undefined)options.enable=true;$(this).data('imgAreaSelect',new $.imgAreaSelect(this,options))}});if(options.instance)return $(this).data('imgAreaSelect');return this}})(jQuery); | (function($){$.imgAreaSelect={onKeyPress:null};$.imgAreaSelect.init=function(img,options){var $img=$(img),imgLoaded,$box=$('<div />'),$area=$('<div />'),$border1=$('<div />'),$border2=$('<div />'),$areaOpera,$outLeft=$('<div />'),$outTop=$('<div />'),$outRight=$('<div />'),$outBottom=$('<div />'),$handles=$([]),handleWidth,handles=[],left,top,M=Math,imgOfs,imgWidth,imgHeight,$parent,parOfs,zIndex=0,position='absolute',$p,startX,startY,scaleX=1,scaleY=1,resizeMargin=10,resize=[],V=0,H=1,d,aspectRatio,x1,x2,y1,y2,x,y,adjusted,shown,i,selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0};var $o=$outLeft.add($outTop).add($outRight).add($outBottom);function viewX(x){return x+imgOfs.left-parOfs.left}function viewY(y){return y+imgOfs.top-parOfs.top}function selX(x){return x-imgOfs.left+parOfs.left}function selY(y){return y-imgOfs.top+parOfs.top}function evX(event){return event.pageX-parOfs.left}function evY(event){return event.pageY-parOfs.top}function trueSelection(){return{x1:M.round(selection.x1*scaleX),y1:M.round(selection.y1*scaleY),x2:M.round(selection.x2*scaleX),y2:M.round(selection.y2*scaleY),width:M.round(selection.x2*scaleX)-M.round(selection.x1*scaleX),height:M.round(selection.y2*scaleY)-M.round(selection.y1*scaleY)}}function getZIndex(){$p=$img;while($p.length&&!$p.is('body')){if(!isNaN($p.css('z-index'))&&$p.css('z-index')>zIndex)zIndex=$p.css('z-index');if($p.css('position')=='fixed')position='fixed';$p=$p.parent()}if(!isNaN(options.zIndex))zIndex=options.zIndex}function adjust(){imgOfs={left:M.round($img.offset().left),top:M.round($img.offset().top)};imgWidth=$img.width();imgHeight=$img.height();if($().jquery=='1.3.2'&&$.browser.safari&&position=='fixed'){imgOfs.top+=M.max(document.documentElement.scrollTop,$('body').scrollTop());imgOfs.left+=M.max(document.documentElement.scrollLeft,$('body').scrollLeft())}parOfs=$.inArray($parent.css('position'),['absolute','relative'])!=-1?{left:M.round($parent.offset().left)-$parent.scrollLeft(),top:M.round($parent.offset().top)-$parent.scrollTop()}:position=='fixed'?{left:$(document).scrollLeft(),top:$(document).scrollTop()}:{left:0,top:0};left=viewX(0);top=viewY(0)}function update(resetKeyPress){if(!shown)return;$box.css({left:viewX(selection.x1)+'px',top:viewY(selection.y1)+'px',width:selection.width+'px',height:selection.height+'px'});$area.add($border1).add($border2).css({left:'0px',top:'0px',width:M.max(selection.width-options.borderWidth*2,0)+'px',height:M.max(selection.height-options.borderWidth*2,0)+'px'});$border1.css({borderStyle:'solid',borderColor:options.borderColor1});$border2.css({borderStyle:'dashed',borderColor:options.borderColor2});$border1.add($border2).css({opacity:options.borderOpacity});$outLeft.css({left:left+'px',top:top+'px',width:selection.x1+'px',height:imgHeight+'px'});$outTop.css({left:left+selection.x1+'px',top:top+'px',width:selection.width+'px',height:selection.y1+'px'});$outRight.css({left:left+selection.x2+'px',top:top+'px',width:imgWidth-selection.x2+'px',height:imgHeight+'px'});$outBottom.css({left:left+selection.x1+'px',top:top+selection.y2+'px',width:selection.width+'px',height:imgHeight-selection.y2+'px'});if(handles.length){handles[1].css({left:selection.width-handleWidth+'px'});handles[2].css({left:selection.width-handleWidth+'px',top:selection.height-handleWidth+'px'});handles[3].css({top:selection.height-handleWidth+'px'});if(handles.length==8){handles[4].css({left:(selection.width-handleWidth)/2+'px'});handles[5].css({left:selection.width-handleWidth+'px',top:(selection.height-handleWidth)/2+'px'});handles[6].css({left:(selection.width-handleWidth)/2+'px',top:selection.height-handleWidth+'px'});handles[7].css({top:(selection.height-handleWidth)/2+'px'})}}if(resetKeyPress!==false){if($.imgAreaSelect.keyPress!=docKeyPress)$(document).unbind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress);if(options.keys)$(document).bind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress=docKeyPress)}if($.browser.msie&&options.borderWidth==1&&options.borderOpacity<1){$border1.add($border2).css('margin','0');setTimeout(function(){$border1.add($border2).css('margin','auto')},0)}}function areaMouseMove(event){if(!adjusted){adjust();adjusted=true;$box.one('mouseout',function(){adjusted=false})}x=selX(evX(event))-selection.x1;y=selY(evY(event))-selection.y1;resize=[];if(options.resizable){if(y<=resizeMargin)resize[V]='n';else if(y>=selection.height-resizeMargin)resize[V]='s';if(x<=resizeMargin)resize[H]='w';else if(x>=selection.width-resizeMargin)resize[H]='e'}$box.css('cursor',resize.length?resize.join('')+'-resize':options.movable?'move':'');if($areaOpera)$areaOpera.toggle()}function docMouseUp(event){resize=[];$('body').css('cursor','');if(options.autoHide||selection.width*selection.height==0)$box.add($o).hide();options.onSelectEnd(img,trueSelection());$(document).unbind('mousemove',selectingMouseMove);$box.mousemove(areaMouseMove)}function areaMouseDown(event){if(event.which!=1)return false;adjust();if(options.resizable&&resize.length>0){$('body').css('cursor',resize.join('')+'-resize');x1=viewX(selection[resize[H]=='w'?'x2':'x1']);y1=viewY(selection[resize[V]=='n'?'y2':'y1']);$(document).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove)}else if(options.movable){startX=left+selection.x1-evX(event);startY=top+selection.y1-evY(event);$box.unbind('mousemove',areaMouseMove);$(document).mousemove(movingMouseMove).one('mouseup',function(){options.onSelectEnd(img,trueSelection());$(document).unbind('mousemove',movingMouseMove);$box.mousemove(areaMouseMove)})}else $img.mousedown(event);return false}function aspectRatioXY(){x2=M.max(left,M.min(left+imgWidth,x1+M.abs(y2-y1)*aspectRatio*(x2<x1?-1:1)));y2=M.round(M.max(top,M.min(top+imgHeight,y1+M.abs(x2-x1)/aspectRatio*(y2<y1?-1:1))));x2=M.round(x2)}function aspectRatioYX(){y2=M.max(top,M.min(top+imgHeight,y1+M.abs(x2-x1)/aspectRatio*(y2<y1?-1:1)));x2=M.round(M.max(left,M.min(left+imgWidth,x1+M.abs(y2-y1)*aspectRatio*(x2<x1?-1:1))));y2=M.round(y2)}function doResize(){if(options.minWidth&&M.abs(x2-x1)<options.minWidth){x2=x1-options.minWidth*(x2<x1?1:-1);if(x2<left)x1=left+options.minWidth;else if(x2>left+imgWidth)x1=left+imgWidth-options.minWidth}if(options.minHeight&&M.abs(y2-y1)<options.minHeight){y2=y1-options.minHeight*(y2<y1?1:-1);if(y2<top)y1=top+options.minHeight;else if(y2>top+imgHeight)y1=top+imgHeight-options.minHeight}x2=M.max(left,M.min(x2,left+imgWidth));y2=M.max(top,M.min(y2,top+imgHeight));if(aspectRatio)if(M.abs(x2-x1)/aspectRatio>M.abs(y2-y1))aspectRatioYX();else aspectRatioXY();if(options.maxWidth&&M.abs(x2-x1)>options.maxWidth){x2=x1-options.maxWidth*(x2<x1?1:-1);if(aspectRatio)aspectRatioYX()}if(options.maxHeight&&M.abs(y2-y1)>options.maxHeight){y2=y1-options.maxHeight*(y2<y1?1:-1);if(aspectRatio)aspectRatioXY()}selection={x1:selX(M.min(x1,x2)),x2:selX(M.max(x1,x2)),y1:selY(M.min(y1,y2)),y2:selY(M.max(y1,y2)),width:M.abs(x2-x1),height:M.abs(y2-y1)};update();options.onSelectChange(img,trueSelection())}function selectingMouseMove(event){x2=!resize.length||resize[H]||aspectRatio?evX(event):viewX(selection.x2);y2=!resize.length||resize[V]||aspectRatio?evY(event):viewY(selection.y2);doResize();return false}function doMove(newX1,newY1){x2=(x1=newX1)+selection.width;y2=(y1=newY1)+selection.height;selection=$.extend(selection,{x1:selX(x1),y1:selY(y1),x2:selX(x2),y2:selY(y2)});update();options.onSelectChange(img,trueSelection())}function movingMouseMove(event){x1=M.max(left,M.min(startX+evX(event),left+imgWidth-selection.width));y1=M.max(top,M.min(startY+evY(event),top+imgHeight-selection.height));doMove(x1,y1);event.preventDefault();return false}function startSelection(event){adjust();x2=x1;y2=y1;doResize();resize=[];$box.add($o.is(':visible')?null:$o).show();shown=true;$(document).unbind('mouseup',cancelSelection).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove);options.onSelectStart(img,trueSelection())}function cancelSelection(){$(document).unbind('mousemove',startSelection);$box.add($o).hide();selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0};options.onSelectChange(img,selection);options.onSelectEnd(img,selection)}function imgMouseDown(event){if(event.which!=1)return false;adjust();startX=x1=evX(event);startY=y1=evY(event);$(document).one('mousemove',startSelection).one('mouseup',cancelSelection);return false}function parentScroll(){adjust();update(false);x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2)}function imgLoad(){imgLoaded=true;if(options.show){shown=true;adjust();update();$box.add($o).show()}$box.add($o).css({visibility:''})}var docKeyPress=function(event){var k=options.keys,d,t,key=event.keyCode||event.which;d=!isNaN(k.alt)&&(event.altKey||event.originalEvent.altKey)?k.alt:!isNaN(k.ctrl)&&event.ctrlKey?k.ctrl:!isNaN(k.shift)&&event.shiftKey?k.shift:!isNaN(k.arrows)?k.arrows:10;if(k.arrows=='resize'||(k.shift=='resize'&&event.shiftKey)||(k.ctrl=='resize'&&event.ctrlKey)||(k.alt=='resize'&&(event.altKey||event.originalEvent.altKey))){switch(key){case 37:d=-d;case 39:t=M.max(x1,x2);x1=M.min(x1,x2);x2=M.max(t+d,x1);if(aspectRatio)aspectRatioYX();break;case 38:d=-d;case 40:t=M.max(y1,y2);y1=M.min(y1,y2);y2=M.max(t+d,y1);if(aspectRatio)aspectRatioXY();break;default:return}doResize()}else{x1=M.min(x1,x2);y1=M.min(y1,y2);switch(key){case 37:doMove(M.max(x1-d,left),y1);break;case 38:doMove(x1,M.max(y1-d,top));break;case 39:doMove(x1+M.min(d,imgWidth-selX(x2)),y1);break;case 40:doMove(x1,y1+M.min(d,imgHeight-selY(y2)));break;default:return}}return false};this.setOptions=function(newOptions){if(newOptions.parent)($parent=$(newOptions.parent)).append($box.add($o));adjust();getZIndex();if(newOptions.x1!=null){selection={x1:newOptions.x1,y1:newOptions.y1,x2:newOptions.x2,y2:newOptions.y2};newOptions.show=!newOptions.hide;x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2);selection.width=x2-x1;selection.height=y2-y1}if(newOptions.handles!=null){$handles.remove();$handles=$(handles=[]);i=newOptions.handles?newOptions.handles=='corners'?4:8:0;while(i--)$handles=$handles.add(handles[i]=$('<div />'));handleWidth=4+options.borderWidth;$handles.css({position:'absolute',borderWidth:options.borderWidth+'px',borderStyle:'solid',borderColor:options.borderColor1,opacity:options.borderOpacity,backgroundColor:options.borderColor2,width:handleWidth+'px',height:handleWidth+'px',fontSize:'0px',zIndex:zIndex>0?zIndex+1:'1'}).addClass(options.classPrefix+'-handle');handleWidth+=options.borderWidth*2}update();options=$.extend(options,newOptions);if(options.imageWidth||options.imageHeight){scaleX=(parseInt(options.imageWidth)||imgWidth)/imgWidth;scaleY=(parseInt(options.imageHeight)||imgHeight)/imgHeight}if(newOptions.keys)options.keys=$.extend({shift:1,ctrl:'resize'},newOptions.keys===true?{}:newOptions.keys);$o.addClass(options.classPrefix+'-outer');$area.addClass(options.classPrefix+'-selection');$border1.addClass(options.classPrefix+'-border1');$border2.addClass(options.classPrefix+'-border2');$box.add($area).add($border1).add($border2).css({borderWidth:options.borderWidth+'px'});$area.css({backgroundColor:options.selectionColor,opacity:options.selectionOpacity});$border1.css({borderStyle:'solid',borderColor:options.borderColor1});$border2.css({borderStyle:'dashed',borderColor:options.borderColor2});$border1.add($border2).css({opacity:options.borderOpacity});$o.css({opacity:options.outerOpacity,backgroundColor:options.outerColor});$box.append($area.add($border1).add($border2).add($handles).add($areaOpera));if(newOptions.hide)$box.add($o).hide();else if(newOptions.show&&imgLoaded){shown=true;update();$box.add($o).show()}aspectRatio=options.aspectRatio&&(d=options.aspectRatio.split(/:/))?d[0]/d[1]:null;if(aspectRatio)if(options.minWidth)options.minHeight=parseInt(options.minWidth/aspectRatio);else if(options.minHeight)options.minWidth=parseInt(options.minHeight*aspectRatio);if(options.disable||options.enable===false){$box.unbind('mousemove',areaMouseMove).unbind('mousedown',areaMouseDown);$img.add($o).unbind('mousedown',imgMouseDown);$(window).unbind('resize',parentScroll);$img.add($img.parents()).unbind('scroll',parentScroll)}else if(options.enable||options.disable===false){if(options.resizable||options.movable)$box.mousemove(areaMouseMove).mousedown(areaMouseDown);if(!options.persistent)$img.add($o).mousedown(imgMouseDown);$(window).resize(parentScroll);$img.add($img.parents()).scroll(parentScroll)}options.enable=options.disable=undefined};if($.browser.msie)$img.attr('unselectable','on');$.imgAreaSelect.keyPress=$.browser.msie||$.browser.safari?'keydown':'keypress';if($.browser.opera)($areaOpera=$('<div style="width: 100%; height: 100%; position: absolute;" />')).css({zIndex:zIndex>0?zIndex+2:'2'});this.setOptions(options=$.extend({borderColor1:'#000',borderColor2:'#fff',borderWidth:1,borderOpacity:.5,classPrefix:'imgareaselect',movable:true,resizable:true,selectionColor:'#fff',selectionOpacity:0,outerColor:'#000',outerOpacity:.4,parent:'body',onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},options));$box.add($o).css({visibility:'hidden',position:position,overflow:'hidden',zIndex:zIndex>0?zIndex:'0'});$area.css({borderStyle:'solid'});$box.css({position:position,zIndex:zIndex>0?zIndex+2:'2'});$area.add($border1).add($border2).css({position:'absolute'});img.complete||img.readyState=='complete'||!$img.is('img')?imgLoad():$img.one('load',imgLoad)};$.fn.imgAreaSelect=function(options){options=options||{};this.each(function(){if($(this).data('imgAreaSelect'))$(this).data('imgAreaSelect').setOptions(options);else{if(options.enable===undefined&&options.disable===undefined)options.enable=true;$(this).data('imgAreaSelect',new $.imgAreaSelect.init(this,options))}});return this}})(jQuery); |
$('#addValue-'+ id).live('keypress', function(evt) { | $('#addValue-'+ id).live('keyup', function(evt) { | (function($) { $.fn.tagBox = function(options) { // define defaults var defaults = { splitChar: ',', emptyMessage: '', addLabel: 'add', removeLabel: 'delete', autoCompleteUrl: '', canAddNew: false }; // extend options var options = $.extend(defaults, options); // loop all elements return this.each(function() { // define some vars var id = $(this).attr('id'); var elements = get(); // build replace html var html = '<div class="tagsWrapper">'+ ' <div class="oneLiner">'+ ' <p><input class="inputText" id="addValue-'+ id +'" name="addValue-'+ id +'" type="text" /></p>'+ ' <div class="buttonHolder">'+ ' <a href="#" id="addButton-'+ id +'" class="button icon iconAdd iconOnly disabledButton">'+ ' <span><span><span>'+ options.addLabel +'</span></span></span>'+ ' </a>'+ ' </div>'+ ' </div>'+ ' <div id="elementList-'+ id +'" class="tagList">'+ ' </div>'+ '</div>'; // hide current element $(this).css('visibility', 'hidden') .css('position', 'absolute') .css('top', '-9000px') .css('left', '-9000px') .attr('tabindex', '-1'); // prepend html $(this).before(html); // add elements list build(); // bind autocomplete if needed if(options.autoCompleteUrl != '') { $('#addValue-'+ id).autocomplete(options.autoCompleteUrl, { minChars: 1, dataType: 'json', width: $('#addValue-'+ id).width(), parse: function(json) { // init vars var parsed = []; // validate json if(json.code != 200) return parsed; // only process if we have results if(json.data.length > 0) { // loop data for(i in json.data) { parsed[parsed.length] = { data: [json.data[i].name], value: json.data[i].value, result: json.data[i].name }; } } // return data return parsed; } }); } // bind keypress on value-field $('#addValue-'+ id).live('keypress', function(evt) { // grab code var code = (evt.which||evt.charCode||evt.keyCode); // enter of splitchar should add an element if(code == 13 || String.fromCharCode(code) == options.splitChar) { evt.preventDefault(); evt.stopPropagation(); // add element add(); } // disable or enable button if($(this).val().replace(/^\s+|\s+$/g, '') == '') $('#addButton-'+ id).addClass('disabledButton'); else $('#addButton-'+ id).removeClass('disabledButton'); }); // bind click on add-button $('#addButton-'+ id).live('click', function(evt) { // dont submit evt.preventDefault(); evt.stopPropagation(); // add element add(); }); // bind click on delete-button $('.deleteButton-'+ id).live('click', function(evt) { // dont submit evt.preventDefault(); evt.stopPropagation(); // remove element remove($(this).attr('rel')); }); // add an element function add() { // init some vars var value = $('#addValue-'+ id).val().replace(/^\s+|\s+$/g, ''); var inElements = false; // reset box $('#addValue-'+ id).val('').focus(); $('#addButton-'+ id).addClass('disabledButton'); // only add new element if it isn't empty if(value != '') { // already in elements? for(var i in elements) if(value == elements[i]) inElements = true; // only add if not already in elements if(!inElements) { // add elements elements.push(value); // set new value $('#'+ id).val(elements.join(options.splitChar)); // rebuild element list build(); } } } // build the list function build() { // init var var html = ''; // no items and message given? if(elements.length == 0 && options.emptyMessage != '') html = '<p class="helpTxt">'+ options.emptyMessage +'</p>'; // items available else { // start html html = '<ul>'; // loop elements for(var i in elements) { html += ' <li><span><strong>'+ elements[i] +'</strong>'+ ' <a href="#" class="deleteButton-'+ id +'" rel="'+ elements[i] +'" title="'+ options.removeLabel +'">'+ options.removeLabel +'</a></span>'+ ' </li>'; } // end html html += '</ul>'; } // set html $('#elementList-'+ id).html(html); } // get all items function get() { // get chunks var chunks = $('#'+ id).val().split(options.splitChar); var elements = []; // loop elements and trim them from spaces for(var i in chunks) { value = chunks[i].replace(/^\s+|\s+$/g,''); if(value != '') elements.push(value) } return elements; } // remove an item function remove(value) { // get index for element var index = elements.indexOf(value); // remove element if(index > -1) elements.splice(index, 1); // set new value $('#'+ id).val(elements.join(options.splitChar)); // rebuild element list build(); } }); };})(jQuery); |
(function(){var a=/^(\d+(?:\.\d+)?)(px|%)$/,b=/^(\d+(?:\.\d+)?)px$/,c=function(e){var f=this.id;if(!e.info)e.info={};e.info[f]=this.getValue();};function d(e,f){var g=function(h){return new CKEDITOR.dom.element(h,e.document);};return{title:e.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?310:280,onShow:function(){var o=this;var h=e.getSelection(),i=h.getRanges(),j=null,k=o.getContentElement('info','txtRows'),l=o.getContentElement('info','txtCols'),m=o.getContentElement('info','txtWidth');if(f=='tableProperties'){if(j=e.getSelection().getSelectedElement()){if(j.getName()!='table')j=null;}else if(i.length>0){var n=i[0].getCommonAncestor(true);j=n.getAscendant('table',true);}o._.selectedElement=j;}if(j){o.setupContent(j);k&&k.disable();l&&l.disable();m&&m.select();}else{k&&k.enable();l&&l.enable();k&&k.select();}},onOk:function(){var C=this;if(C._.selectedElement)var h=e.getSelection(),i=e.getSelection().createBookmarks();var j=C._.selectedElement||g('table'),k=C,l={};C.commitContent(l,j);if(l.info){var m=l.info;if(!C._.selectedElement){var n=j.append(g('tbody')),o=parseInt(m.txtRows,10)||0,p=parseInt(m.txtCols,10)||0;for(var q=0;q<o;q++){var r=n.append(g('tr'));for(var s=0;s<p;s++){var t=r.append(g('td'));if(!CKEDITOR.env.ie)t.append(g('br'));}}}var u=m.selHeaders;if(!j.$.tHead&&(u=='row'||u=='both')){var v=new CKEDITOR.dom.element(j.$.createTHead());n=j.getElementsByTag('tbody').getItem(0);var w=n.getElementsByTag('tr').getItem(0);for(q=0;q<w.getChildCount();q++){var x=w.getChild(q);if(x.type==CKEDITOR.NODE_ELEMENT){x.renameNode('th');x.setAttribute('scope','col');}}v.append(w.remove());}if(j.$.tHead!==null&&!(u=='row'||u=='both')){v=new CKEDITOR.dom.element(j.$.tHead);n=j.getElementsByTag('tbody').getItem(0);var y=n.getFirst();while(v.getChildCount()>0){w=v.getFirst();for(q=0;q<w.getChildCount();q++){var z=w.getChild(q);if(z.type==CKEDITOR.NODE_ELEMENT){z.renameNode('td');z.removeAttribute('scope');}}w.insertBefore(y);}v.remove();}if(!C.hasColumnHeaders&&(u=='col'||u=='both'))for(r=0;r<j.$.rows.length;r++){z=new CKEDITOR.dom.element(j.$.rows[r].cells[0]);z.renameNode('th');z.setAttribute('scope','row');}if(C.hasColumnHeaders&&!(u=='col'||u=='both'))for(q=0;q<j.$.rows.length;q++){r=new CKEDITOR.dom.element(j.$.rows[q]);if(r.getParent().getName()=='tbody'){z=new CKEDITOR.dom.element(r.$.cells[0]);z.renameNode('td');z.removeAttribute('scope');}}var A=[];if(m.txtHeight)j.setStyle('height',CKEDITOR.tools.cssLength(m.txtHeight));else j.removeStyle('height'); if(m.txtWidth){var B=m.cmbWidthType||'pixels';j.setStyle('width',m.txtWidth+(B=='pixels'?'px':'%'));}else j.removeStyle('width');if(!j.getAttribute('style'))j.removeAttribute('style');}if(!C._.selectedElement)e.insertElement(j);else h.selectBookmarks(i);return true;},contents:[{id:'info',label:e.lang.table.title,elements:[{type:'hbox',widths:[null,null],styles:['vertical-align:top'],children:[{type:'vbox',padding:0,children:[{type:'text',id:'txtRows','default':3,label:e.lang.table.rows,style:'width:5em',validate:function(){var h=true,i=this.getValue();h=h&&CKEDITOR.dialog.validate.integer()(i)&&i>0;if(!h){alert(e.lang.table.invalidRows);this.select();}return h;},setup:function(h){this.setValue(h.$.rows.length);},commit:c},{type:'text',id:'txtCols','default':2,label:e.lang.table.columns,style:'width:5em',validate:function(){var h=true,i=this.getValue();h=h&&CKEDITOR.dialog.validate.integer()(i)&&i>0;if(!h){alert(e.lang.table.invalidCols);this.select();}return h;},setup:function(h){this.setValue(h.$.rows[0].cells.length);},commit:c},{type:'html',html:' '},{type:'select',id:'selHeaders','default':'',label:e.lang.table.headers,items:[[e.lang.table.headersNone,''],[e.lang.table.headersRow,'row'],[e.lang.table.headersColumn,'col'],[e.lang.table.headersBoth,'both']],setup:function(h){var i=this.getDialog();i.hasColumnHeaders=true;for(var j=0;j<h.$.rows.length;j++){if(h.$.rows[j].cells[0].nodeName.toLowerCase()!='th'){i.hasColumnHeaders=false;break;}}if(h.$.tHead!==null)this.setValue(i.hasColumnHeaders?'both':'row');else this.setValue(i.hasColumnHeaders?'col':'');},commit:c},{type:'text',id:'txtBorder','default':1,label:e.lang.table.border,style:'width:3em',validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidBorder),setup:function(h){this.setValue(h.getAttribute('border')||'');},commit:function(h,i){if(this.getValue())i.setAttribute('border',this.getValue());else i.removeAttribute('border');}},{id:'cmbAlign',type:'select','default':'',label:e.lang.table.align,items:[[e.lang.common.notSet,''],[e.lang.table.alignLeft,'left'],[e.lang.table.alignCenter,'center'],[e.lang.table.alignRight,'right']],setup:function(h){this.setValue(h.getAttribute('align')||'');},commit:function(h,i){if(this.getValue())i.setAttribute('align',this.getValue());else i.removeAttribute('align');}}]},{type:'vbox',padding:0,children:[{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtWidth',style:'width:5em',label:e.lang.table.width,'default':200,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidWidth),onLoad:function(){var h=this.getDialog().getContentElement('info','cmbWidthType'),i=h.getElement(),j=this.getInputElement(),k=j.getAttribute('aria-labelledby'); j.setAttribute('aria-labelledby',[k,i.$.id].join(' '));},setup:function(h){var i=a.exec(h.$.style.width);if(i)this.setValue(i[1]);else this.setValue('');},commit:c},{id:'cmbWidthType',type:'select',label:e.lang.table.widthUnit,labelStyle:'visibility:hidden','default':'pixels',items:[[e.lang.table.widthPx,'pixels'],[e.lang.table.widthPc,'percents']],setup:function(h){var i=a.exec(h.$.style.width);if(i)this.setValue(i[2]=='px'?'pixels':'percents');},commit:c}]},{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtHeight',style:'width:5em',label:e.lang.table.height,'default':'',validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidHeight),onLoad:function(){var h=this.getDialog().getContentElement('info','htmlHeightType'),i=h.getElement(),j=this.getInputElement(),k=j.getAttribute('aria-labelledby');j.setAttribute('aria-labelledby',[k,i.$.id].join(' '));},setup:function(h){var i=b.exec(h.$.style.height);if(i)this.setValue(i[1]);},commit:c},{id:'htmlHeightType',type:'html',html:'<div><br />'+e.lang.table.widthPx+'</div>'}]},{type:'html',html:' '},{type:'text',id:'txtCellSpace',style:'width:3em',label:e.lang.table.cellSpace,'default':1,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidCellSpacing),setup:function(h){this.setValue(h.getAttribute('cellSpacing')||'');},commit:function(h,i){if(this.getValue())i.setAttribute('cellSpacing',this.getValue());else i.removeAttribute('cellSpacing');}},{type:'text',id:'txtCellPad',style:'width:3em',label:e.lang.table.cellPad,'default':1,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidCellPadding),setup:function(h){this.setValue(h.getAttribute('cellPadding')||'');},commit:function(h,i){if(this.getValue())i.setAttribute('cellPadding',this.getValue());else i.removeAttribute('cellPadding');}}]}]},{type:'html',align:'right',html:''},{type:'vbox',padding:0,children:[{type:'text',id:'txtCaption',label:e.lang.table.caption,setup:function(h){var i=h.getElementsByTag('caption');if(i.count()>0){var j=i.getItem(0);j=j.getChild(0)&&j.getChild(0).getText()||'';j=CKEDITOR.tools.trim(j);this.setValue(j);}},commit:function(h,i){var j=this.getValue(),k=i.getElementsByTag('caption');if(j){if(k.count()>0){k=k.getItem(0);k.setHtml('');}else{k=new CKEDITOR.dom.element('caption',e.document);if(i.getChildCount())k.insertBefore(i.getFirst());else k.appendTo(i);}k.append(new CKEDITOR.dom.text(j,e.document));}else if(k.count()>0)for(var l=k.count()-1;l>=0;l--)k.getItem(l).remove();}},{type:'text',id:'txtSummary',label:e.lang.table.summary,setup:function(h){this.setValue(h.getAttribute('summary')||''); },commit:function(h,i){if(this.getValue())i.setAttribute('summary',this.getValue());else i.removeAttribute('summary');}}]}]}]};};CKEDITOR.dialog.add('table',function(e){return d(e,'table');});CKEDITOR.dialog.add('tableProperties',function(e){return d(e,'tableProperties');});})(); | (function(){var a=/^(\d+(?:\.\d+)?)(px|%)$/,b=/^(\d+(?:\.\d+)?)px$/,c=function(e){var f=this.id;if(!e.info)e.info={};e.info[f]=this.getValue();};function d(e,f){var g=function(i){return new CKEDITOR.dom.element(i,e.document);},h=e.plugins.dialogadvtab;return{title:e.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?310:280,onLoad:function(){var i=this,j=i.getContentElement('advanced','advStyles');if(j)j.on('change',function(k){var l=this.getStyle('width',''),m=i.getContentElement('info','txtWidth'),n=i.getContentElement('info','cmbWidthType'),o=1;if(l){o=l.length<3||l.substr(l.length-1)!='%';l=parseInt(l,10);}m&&m.setValue(l,true);n&&n.setValue(o?'pixels':'percents',true);var p=this.getStyle('height',''),q=i.getContentElement('info','txtHeight');p&&(p=parseInt(p,10));q&&q.setValue(p,true);});},onShow:function(){var q=this;var i=e.getSelection(),j=i.getRanges(),k=null,l=q.getContentElement('info','txtRows'),m=q.getContentElement('info','txtCols'),n=q.getContentElement('info','txtWidth'),o=q.getContentElement('info','txtHeight');if(f=='tableProperties'){if(k=i.getSelectedElement())k=k.getAscendant('table',true);else if(j.length>0){if(CKEDITOR.env.webkit)j[0].shrink(CKEDITOR.NODE_ELEMENT);var p=j[0].getCommonAncestor(true);k=p.getAscendant('table',true);}q._.selectedElement=k;}if(k){q.setupContent(k);l&&l.disable();m&&m.disable();}else{l&&l.enable();m&&m.enable();}n&&n.onChange();o&&o.onChange();},onOk:function(){var D=this;if(D._.selectedElement)var i=e.getSelection(),j=i.createBookmarks();var k=D._.selectedElement||g('table'),l=D,m={};D.commitContent(m,k);if(m.info){var n=m.info;if(!D._.selectedElement){var o=k.append(g('tbody')),p=parseInt(n.txtRows,10)||0,q=parseInt(n.txtCols,10)||0;for(var r=0;r<p;r++){var s=o.append(g('tr'));for(var t=0;t<q;t++){var u=s.append(g('td'));if(!CKEDITOR.env.ie)u.append(g('br'));}}}var v=n.selHeaders;if(!k.$.tHead&&(v=='row'||v=='both')){var w=new CKEDITOR.dom.element(k.$.createTHead());o=k.getElementsByTag('tbody').getItem(0);var x=o.getElementsByTag('tr').getItem(0);for(r=0;r<x.getChildCount();r++){var y=x.getChild(r);if(y.type==CKEDITOR.NODE_ELEMENT&&!y.hasAttribute('_cke_bookmark')){y.renameNode('th');y.setAttribute('scope','col');}}w.append(x.remove());}if(k.$.tHead!==null&&!(v=='row'||v=='both')){w=new CKEDITOR.dom.element(k.$.tHead);o=k.getElementsByTag('tbody').getItem(0);var z=o.getFirst();while(w.getChildCount()>0){x=w.getFirst();for(r=0;r<x.getChildCount();r++){var A=x.getChild(r);if(A.type==CKEDITOR.NODE_ELEMENT){A.renameNode('td'); A.removeAttribute('scope');}}x.insertBefore(z);}w.remove();}if(!D.hasColumnHeaders&&(v=='col'||v=='both'))for(s=0;s<k.$.rows.length;s++){A=new CKEDITOR.dom.element(k.$.rows[s].cells[0]);A.renameNode('th');A.setAttribute('scope','row');}if(D.hasColumnHeaders&&!(v=='col'||v=='both'))for(r=0;r<k.$.rows.length;r++){s=new CKEDITOR.dom.element(k.$.rows[r]);if(s.getParent().getName()=='tbody'){A=new CKEDITOR.dom.element(s.$.cells[0]);A.renameNode('td');A.removeAttribute('scope');}}var B=[];if(n.txtHeight)k.setStyle('height',CKEDITOR.tools.cssLength(n.txtHeight));else k.removeStyle('height');if(n.txtWidth){var C=n.cmbWidthType||'pixels';k.setStyle('width',n.txtWidth+(C=='pixels'?'px':'%'));}else k.removeStyle('width');if(!k.getAttribute('style'))k.removeAttribute('style');}if(!D._.selectedElement)e.insertElement(k);else i.selectBookmarks(j);return true;},contents:[{id:'info',label:e.lang.table.title,elements:[{type:'hbox',widths:[null,null],styles:['vertical-align:top'],children:[{type:'vbox',padding:0,children:[{type:'text',id:'txtRows','default':3,label:e.lang.table.rows,required:true,style:'width:5em',validate:function(){var i=true,j=this.getValue();i=i&&CKEDITOR.dialog.validate.integer()(j)&&j>0;if(!i){alert(e.lang.table.invalidRows);this.select();}return i;},setup:function(i){this.setValue(i.$.rows.length);},commit:c},{type:'text',id:'txtCols','default':2,label:e.lang.table.columns,required:true,style:'width:5em',validate:function(){var i=true,j=this.getValue();i=i&&CKEDITOR.dialog.validate.integer()(j)&&j>0;if(!i){alert(e.lang.table.invalidCols);this.select();}return i;},setup:function(i){this.setValue(i.$.rows[0].cells.length);},commit:c},{type:'html',html:' '},{type:'select',id:'selHeaders','default':'',label:e.lang.table.headers,items:[[e.lang.table.headersNone,''],[e.lang.table.headersRow,'row'],[e.lang.table.headersColumn,'col'],[e.lang.table.headersBoth,'both']],setup:function(i){var j=this.getDialog();j.hasColumnHeaders=true;for(var k=0;k<i.$.rows.length;k++){if(i.$.rows[k].cells[0].nodeName.toLowerCase()!='th'){j.hasColumnHeaders=false;break;}}if(i.$.tHead!==null)this.setValue(j.hasColumnHeaders?'both':'row');else this.setValue(j.hasColumnHeaders?'col':'');},commit:c},{type:'text',id:'txtBorder','default':1,label:e.lang.table.border,style:'width:3em',validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidBorder),setup:function(i){this.setValue(i.getAttribute('border')||'');},commit:function(i,j){if(this.getValue())j.setAttribute('border',this.getValue()); else j.removeAttribute('border');}},{id:'cmbAlign',type:'select','default':'',label:e.lang.table.align,items:[[e.lang.common.notSet,''],[e.lang.table.alignLeft,'left'],[e.lang.table.alignCenter,'center'],[e.lang.table.alignRight,'right']],setup:function(i){this.setValue(i.getAttribute('align')||'');},commit:function(i,j){if(this.getValue())j.setAttribute('align',this.getValue());else j.removeAttribute('align');}}]},{type:'vbox',padding:0,children:[{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtWidth',style:'width:5em',label:e.lang.table.width,'default':500,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidWidth),onLoad:function(){var i=this.getDialog().getContentElement('info','cmbWidthType'),j=i.getElement(),k=this.getInputElement(),l=k.getAttribute('aria-labelledby');k.setAttribute('aria-labelledby',[l,j.$.id].join(' '));},onChange:function(){var i=this.getDialog().getContentElement('advanced','advStyles');if(i){var j=this.getValue();if(j)j+=this.getDialog().getContentElement('info','cmbWidthType').getValue()=='percents'?'%':'px';i.updateStyle('width',j);}},setup:function(i){var j=a.exec(i.$.style.width);if(j)this.setValue(j[1]);else this.setValue('');},commit:c},{id:'cmbWidthType',type:'select',label:e.lang.table.widthUnit,labelStyle:'visibility:hidden','default':'pixels',items:[[e.lang.table.widthPx,'pixels'],[e.lang.table.widthPc,'percents']],setup:function(i){var j=a.exec(i.$.style.width);if(j)this.setValue(j[2]=='px'?'pixels':'percents');},onChange:function(){this.getDialog().getContentElement('info','txtWidth').onChange();},commit:c}]},{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtHeight',style:'width:5em',label:e.lang.table.height,'default':'',validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidHeight),onLoad:function(){var i=this.getDialog().getContentElement('info','htmlHeightType'),j=i.getElement(),k=this.getInputElement(),l=k.getAttribute('aria-labelledby');k.setAttribute('aria-labelledby',[l,j.$.id].join(' '));},onChange:function(){var i=this.getDialog().getContentElement('advanced','advStyles');if(i){var j=this.getValue();i.updateStyle('height',j&&j+'px');}},setup:function(i){var j=b.exec(i.$.style.height);if(j)this.setValue(j[1]);},commit:c},{id:'htmlHeightType',type:'html',html:'<div><br />'+e.lang.table.widthPx+'</div>'}]},{type:'html',html:' '},{type:'text',id:'txtCellSpace',style:'width:3em',label:e.lang.table.cellSpace,'default':1,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidCellSpacing),setup:function(i){this.setValue(i.getAttribute('cellSpacing')||''); },commit:function(i,j){if(this.getValue())j.setAttribute('cellSpacing',this.getValue());else j.removeAttribute('cellSpacing');}},{type:'text',id:'txtCellPad',style:'width:3em',label:e.lang.table.cellPad,'default':1,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidCellPadding),setup:function(i){this.setValue(i.getAttribute('cellPadding')||'');},commit:function(i,j){if(this.getValue())j.setAttribute('cellPadding',this.getValue());else j.removeAttribute('cellPadding');}}]}]},{type:'html',align:'right',html:''},{type:'vbox',padding:0,children:[{type:'text',id:'txtCaption',label:e.lang.table.caption,setup:function(i){var j=i.getElementsByTag('caption');if(j.count()>0){var k=j.getItem(0);k=k.getChild(0)&&k.getChild(0).getText()||'';k=CKEDITOR.tools.trim(k);this.setValue(k);}},commit:function(i,j){var k=this.getValue(),l=j.getElementsByTag('caption');if(k){if(l.count()>0){l=l.getItem(0);l.setHtml('');}else{l=new CKEDITOR.dom.element('caption',e.document);if(j.getChildCount())l.insertBefore(j.getFirst());else l.appendTo(j);}l.append(new CKEDITOR.dom.text(k,e.document));}else if(l.count()>0)for(var m=l.count()-1;m>=0;m--)l.getItem(m).remove();}},{type:'text',id:'txtSummary',label:e.lang.table.summary,setup:function(i){this.setValue(i.getAttribute('summary')||'');},commit:function(i,j){if(this.getValue())j.setAttribute('summary',this.getValue());else j.removeAttribute('summary');}}]}]},h&&h.createAdvancedTab(e)]};};CKEDITOR.dialog.add('table',function(e){return d(e,'table');});CKEDITOR.dialog.add('tableProperties',function(e){return d(e,'tableProperties');});})(); | (function(){var a=/^(\d+(?:\.\d+)?)(px|%)$/,b=/^(\d+(?:\.\d+)?)px$/,c=function(e){var f=this.id;if(!e.info)e.info={};e.info[f]=this.getValue();};function d(e,f){var g=function(h){return new CKEDITOR.dom.element(h,e.document);};return{title:e.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?310:280,onShow:function(){var o=this;var h=e.getSelection(),i=h.getRanges(),j=null,k=o.getContentElement('info','txtRows'),l=o.getContentElement('info','txtCols'),m=o.getContentElement('info','txtWidth');if(f=='tableProperties'){if(j=e.getSelection().getSelectedElement()){if(j.getName()!='table')j=null;}else if(i.length>0){var n=i[0].getCommonAncestor(true);j=n.getAscendant('table',true);}o._.selectedElement=j;}if(j){o.setupContent(j);k&&k.disable();l&&l.disable();m&&m.select();}else{k&&k.enable();l&&l.enable();k&&k.select();}},onOk:function(){var C=this;if(C._.selectedElement)var h=e.getSelection(),i=e.getSelection().createBookmarks();var j=C._.selectedElement||g('table'),k=C,l={};C.commitContent(l,j);if(l.info){var m=l.info;if(!C._.selectedElement){var n=j.append(g('tbody')),o=parseInt(m.txtRows,10)||0,p=parseInt(m.txtCols,10)||0;for(var q=0;q<o;q++){var r=n.append(g('tr'));for(var s=0;s<p;s++){var t=r.append(g('td'));if(!CKEDITOR.env.ie)t.append(g('br'));}}}var u=m.selHeaders;if(!j.$.tHead&&(u=='row'||u=='both')){var v=new CKEDITOR.dom.element(j.$.createTHead());n=j.getElementsByTag('tbody').getItem(0);var w=n.getElementsByTag('tr').getItem(0);for(q=0;q<w.getChildCount();q++){var x=w.getChild(q);if(x.type==CKEDITOR.NODE_ELEMENT){x.renameNode('th');x.setAttribute('scope','col');}}v.append(w.remove());}if(j.$.tHead!==null&&!(u=='row'||u=='both')){v=new CKEDITOR.dom.element(j.$.tHead);n=j.getElementsByTag('tbody').getItem(0);var y=n.getFirst();while(v.getChildCount()>0){w=v.getFirst();for(q=0;q<w.getChildCount();q++){var z=w.getChild(q);if(z.type==CKEDITOR.NODE_ELEMENT){z.renameNode('td');z.removeAttribute('scope');}}w.insertBefore(y);}v.remove();}if(!C.hasColumnHeaders&&(u=='col'||u=='both'))for(r=0;r<j.$.rows.length;r++){z=new CKEDITOR.dom.element(j.$.rows[r].cells[0]);z.renameNode('th');z.setAttribute('scope','row');}if(C.hasColumnHeaders&&!(u=='col'||u=='both'))for(q=0;q<j.$.rows.length;q++){r=new CKEDITOR.dom.element(j.$.rows[q]);if(r.getParent().getName()=='tbody'){z=new CKEDITOR.dom.element(r.$.cells[0]);z.renameNode('td');z.removeAttribute('scope');}}var A=[];if(m.txtHeight)j.setStyle('height',CKEDITOR.tools.cssLength(m.txtHeight));else j.removeStyle('height');if(m.txtWidth){var B=m.cmbWidthType||'pixels';j.setStyle('width',m.txtWidth+(B=='pixels'?'px':'%'));}else j.removeStyle('width');if(!j.getAttribute('style'))j.removeAttribute('style');}if(!C._.selectedElement)e.insertElement(j);else h.selectBookmarks(i);return true;},contents:[{id:'info',label:e.lang.table.title,elements:[{type:'hbox',widths:[null,null],styles:['vertical-align:top'],children:[{type:'vbox',padding:0,children:[{type:'text',id:'txtRows','default':3,label:e.lang.table.rows,style:'width:5em',validate:function(){var h=true,i=this.getValue();h=h&&CKEDITOR.dialog.validate.integer()(i)&&i>0;if(!h){alert(e.lang.table.invalidRows);this.select();}return h;},setup:function(h){this.setValue(h.$.rows.length);},commit:c},{type:'text',id:'txtCols','default':2,label:e.lang.table.columns,style:'width:5em',validate:function(){var h=true,i=this.getValue();h=h&&CKEDITOR.dialog.validate.integer()(i)&&i>0;if(!h){alert(e.lang.table.invalidCols);this.select();}return h;},setup:function(h){this.setValue(h.$.rows[0].cells.length);},commit:c},{type:'html',html:' '},{type:'select',id:'selHeaders','default':'',label:e.lang.table.headers,items:[[e.lang.table.headersNone,''],[e.lang.table.headersRow,'row'],[e.lang.table.headersColumn,'col'],[e.lang.table.headersBoth,'both']],setup:function(h){var i=this.getDialog();i.hasColumnHeaders=true;for(var j=0;j<h.$.rows.length;j++){if(h.$.rows[j].cells[0].nodeName.toLowerCase()!='th'){i.hasColumnHeaders=false;break;}}if(h.$.tHead!==null)this.setValue(i.hasColumnHeaders?'both':'row');else this.setValue(i.hasColumnHeaders?'col':'');},commit:c},{type:'text',id:'txtBorder','default':1,label:e.lang.table.border,style:'width:3em',validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidBorder),setup:function(h){this.setValue(h.getAttribute('border')||'');},commit:function(h,i){if(this.getValue())i.setAttribute('border',this.getValue());else i.removeAttribute('border');}},{id:'cmbAlign',type:'select','default':'',label:e.lang.table.align,items:[[e.lang.common.notSet,''],[e.lang.table.alignLeft,'left'],[e.lang.table.alignCenter,'center'],[e.lang.table.alignRight,'right']],setup:function(h){this.setValue(h.getAttribute('align')||'');},commit:function(h,i){if(this.getValue())i.setAttribute('align',this.getValue());else i.removeAttribute('align');}}]},{type:'vbox',padding:0,children:[{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtWidth',style:'width:5em',label:e.lang.table.width,'default':200,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidWidth),onLoad:function(){var h=this.getDialog().getContentElement('info','cmbWidthType'),i=h.getElement(),j=this.getInputElement(),k=j.getAttribute('aria-labelledby');j.setAttribute('aria-labelledby',[k,i.$.id].join(' '));},setup:function(h){var i=a.exec(h.$.style.width);if(i)this.setValue(i[1]);else this.setValue('');},commit:c},{id:'cmbWidthType',type:'select',label:e.lang.table.widthUnit,labelStyle:'visibility:hidden','default':'pixels',items:[[e.lang.table.widthPx,'pixels'],[e.lang.table.widthPc,'percents']],setup:function(h){var i=a.exec(h.$.style.width);if(i)this.setValue(i[2]=='px'?'pixels':'percents');},commit:c}]},{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtHeight',style:'width:5em',label:e.lang.table.height,'default':'',validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidHeight),onLoad:function(){var h=this.getDialog().getContentElement('info','htmlHeightType'),i=h.getElement(),j=this.getInputElement(),k=j.getAttribute('aria-labelledby');j.setAttribute('aria-labelledby',[k,i.$.id].join(' '));},setup:function(h){var i=b.exec(h.$.style.height);if(i)this.setValue(i[1]);},commit:c},{id:'htmlHeightType',type:'html',html:'<div><br />'+e.lang.table.widthPx+'</div>'}]},{type:'html',html:' '},{type:'text',id:'txtCellSpace',style:'width:3em',label:e.lang.table.cellSpace,'default':1,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidCellSpacing),setup:function(h){this.setValue(h.getAttribute('cellSpacing')||'');},commit:function(h,i){if(this.getValue())i.setAttribute('cellSpacing',this.getValue());else i.removeAttribute('cellSpacing');}},{type:'text',id:'txtCellPad',style:'width:3em',label:e.lang.table.cellPad,'default':1,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidCellPadding),setup:function(h){this.setValue(h.getAttribute('cellPadding')||'');},commit:function(h,i){if(this.getValue())i.setAttribute('cellPadding',this.getValue());else i.removeAttribute('cellPadding');}}]}]},{type:'html',align:'right',html:''},{type:'vbox',padding:0,children:[{type:'text',id:'txtCaption',label:e.lang.table.caption,setup:function(h){var i=h.getElementsByTag('caption');if(i.count()>0){var j=i.getItem(0);j=j.getChild(0)&&j.getChild(0).getText()||'';j=CKEDITOR.tools.trim(j);this.setValue(j);}},commit:function(h,i){var j=this.getValue(),k=i.getElementsByTag('caption');if(j){if(k.count()>0){k=k.getItem(0);k.setHtml('');}else{k=new CKEDITOR.dom.element('caption',e.document);if(i.getChildCount())k.insertBefore(i.getFirst());else k.appendTo(i);}k.append(new CKEDITOR.dom.text(j,e.document));}else if(k.count()>0)for(var l=k.count()-1;l>=0;l--)k.getItem(l).remove();}},{type:'text',id:'txtSummary',label:e.lang.table.summary,setup:function(h){this.setValue(h.getAttribute('summary')||'');},commit:function(h,i){if(this.getValue())i.setAttribute('summary',this.getValue());else i.removeAttribute('summary');}}]}]}]};};CKEDITOR.dialog.add('table',function(e){return d(e,'table');});CKEDITOR.dialog.add('tableProperties',function(e){return d(e,'tableProperties');});})(); |
$('input.block_extra_id').each(function() | $('#extraType').change(function(evt) | $('input.block_extra_id').each(function() { var value = $(this).val(); var id = $(this).attr('id').replace('blockExtraId', ''); jsBackend.pages.extras.changeExtra(value, id); }); |
var value = $(this).val(); var id = $(this).attr('id').replace('blockExtraId', ''); jsBackend.pages.extras.changeExtra(value, id); | if($(this).val() != 'block') { var hasModules = false; $('.linkedExtra input:hidden').each(function() { var id = $(this).val(); if(id !== $('#extraForBlock').val()) { if(id != '' && typeof extrasById[id] != 'undefined' && extrasById[id].type == 'block') hasModules = true; } }); if(!hasModules) $('#extraType option[value="block"]').attr('disabled', ''); } jsBackend.pages.extras.populateExtraModules(evt); | $('input.block_extra_id').each(function() { var value = $(this).val(); var id = $(this).attr('id').replace('blockExtraId', ''); jsBackend.pages.extras.changeExtra(value, id); }); |
calculateMeta(null, $(this)); | (function($) { $.fn.doMeta = function(options) { // define defaults var defaults = {}; // extend options var options = $.extend(defaults, options); // loop all elements return this.each(function() { // init var var element = $(this); // initialize calculateMeta(null, $(this)); // bind keypress $(this).bind('keyup', calculateMeta); // bind change on the checkboxes if($('#pageTitle').length > 0 && $('#pageTitleOverwrite').length > 0) { $('#pageTitleOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#pageTitle').val(element.val()); } }); } if($('#navigationTitle').length > 0 && $('#navigationTitleOverwrite').length > 0) { $('#navigationTitleOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#navigationTitle').val(element.val()); } }); } $('#metaDescriptionOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#metaDescription').val(element.val()); } }); $('#metaKeywordsOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#metaKeywords').val(element.val()); } }); $('#urlOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#url').val(utils.string.urlise(element.val())); $('#generatedUrl').html(utils.string.urlise(element.val())); } }); // calculate meta function calculateMeta(evt, element) { if(typeof element != 'undefined') var title = element.val(); else var title = $(this).val(); if($('#pageTitle').length > 0 && $('#pageTitleOverwrite').length > 0) { if(!$('#pageTitleOverwrite').is(':checked')) { $('#pageTitle').val(title); } } if($('#navigationTitle').length > 0 && $('#navigationTitleOverwrite').length > 0) { if(!$('#navigationTitleOverwrite').is(':checked')) { $('#navigationTitle').val(title); } } if(!$('#metaDescriptionOverwrite').is(':checked')) { $('#metaDescription').val(title); } if(!$('#metaKeywordsOverwrite').is(':checked')) { $('#metaKeywords').val(title); } if(!$('#urlOverwrite').is(':checked')) { $('#url').val(utils.string.urlise(title)); $('#generatedUrl').html(utils.string.urlise(title)); } } }); };})(jQuery); |
|
$('#url').val(utils.string.urlise(title)); $('#generatedUrl').html(utils.string.urlise(title)); | if(typeof pageID == 'undefined' || pageID != 1) { $('#url').val(utils.string.urlise(title)); $('#generatedUrl').html(utils.string.urlise(title)); } | (function($) { $.fn.doMeta = function(options) { // define defaults var defaults = {}; // extend options var options = $.extend(defaults, options); // loop all elements return this.each(function() { // init var var element = $(this); // initialize calculateMeta(null, $(this)); // bind keypress $(this).bind('keyup', calculateMeta); // bind change on the checkboxes if($('#pageTitle').length > 0 && $('#pageTitleOverwrite').length > 0) { $('#pageTitleOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#pageTitle').val(element.val()); } }); } if($('#navigationTitle').length > 0 && $('#navigationTitleOverwrite').length > 0) { $('#navigationTitleOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#navigationTitle').val(element.val()); } }); } $('#metaDescriptionOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#metaDescription').val(element.val()); } }); $('#metaKeywordsOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#metaKeywords').val(element.val()); } }); $('#urlOverwrite').change(function(evt) { if(!$(this).is(':checked')) { $('#url').val(utils.string.urlise(element.val())); $('#generatedUrl').html(utils.string.urlise(element.val())); } }); // calculate meta function calculateMeta(evt, element) { if(typeof element != 'undefined') var title = element.val(); else var title = $(this).val(); if($('#pageTitle').length > 0 && $('#pageTitleOverwrite').length > 0) { if(!$('#pageTitleOverwrite').is(':checked')) { $('#pageTitle').val(title); } } if($('#navigationTitle').length > 0 && $('#navigationTitleOverwrite').length > 0) { if(!$('#navigationTitleOverwrite').is(':checked')) { $('#navigationTitle').val(title); } } if(!$('#metaDescriptionOverwrite').is(':checked')) { $('#metaDescription').val(title); } if(!$('#metaKeywordsOverwrite').is(':checked')) { $('#metaKeywords').val(title); } if(!$('#urlOverwrite').is(':checked')) { $('#url').val(utils.string.urlise(title)); $('#generatedUrl').html(utils.string.urlise(title)); } } }); };})(jQuery); |
console.info(new_url) | $('.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 (event[1]) { | if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) { | (function($) { /* removed: oneInstance, lazy, tip must next to the trigger isShown(fully), layout, tipClass, layout */ // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.tooltip = { conf: { // default effect variables effect: 'toggle', fadeOutSpeed: "fast", predelay: 0, delay: 30, opacity: 1, tip: 0, // 'top', 'bottom', 'right', 'left', 'center' position: ['top', 'center'], offset: [0, 0], relative: false, cancelDefault: true, // type to event mapping events: { def: "mouseenter,mouseleave", input: "focus,blur", widget: "focus mouseenter,blur mouseleave", tooltip: "mouseenter,mouseleave" }, // 1.2 layout: '<div/>', tipClass: 'tooltip' }, addEffect: function(name, loadFn, hideFn) { effects[name] = [loadFn, hideFn]; } }; var effects = { toggle: [ function(done) { var conf = this.getConf(), tip = this.getTip(), o = conf.opacity; if (o < 1) { tip.css({opacity: o}); } tip.show(); done.call(); }, function(done) { this.getTip().hide(); done.call(); } ], fade: [ function(done) { this.getTip().fadeIn(this.getConf().fadeInSpeed, done); }, function(done) { this.getTip().fadeOut(this.getConf().fadeOutSpeed, done); } ] }; /* calculate tip position relative to the trigger */ function getPosition(trigger, tip, conf) { // get origin top/left position var top = conf.relative ? trigger.position().top : trigger.offset().top, left = conf.relative ? trigger.position().left : trigger.offset().left, pos = conf.position[0]; top -= tip.outerHeight() - conf.offset[0]; left += trigger.outerWidth() + conf.offset[1]; // adjust Y var height = tip.outerHeight() + trigger.outerHeight(); if (pos == 'center') { top += height / 2; } if (pos == 'bottom') { top += height; } // adjust X pos = conf.position[1]; var width = tip.outerWidth() + trigger.outerWidth(); if (pos == 'center') { left -= width / 2; } if (pos == 'left') { left -= width; } return {top: top, left: left}; } 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; }; }); } // jQuery plugin implementation $.fn.tooltip = function(conf) { // return existing instance var api = this.data("tooltip"); if (api) { return api; } 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; }; }) (jQuery); |
img.css({border:0,position:'absolute',display:'none'}).width(oWidth); | img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); | (function($) { // version number var t = $.tools.overlay; // extend global configuragion with effect specific defaults $.extend(t.conf, { start: { absolute: true, top: null, left: null }, fadeInSpeed: 'fast', zIndex: 9999 }); // utility function function getPosition(el) { var p = el.offset(); return [p.top + el.height() / 2, p.left + el.width() / 2]; } //{{{ load var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0,position:'absolute',display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative toverlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };//}}} var closeEffect = function(onClose) { // variables var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), top = opts.start.top, left = opts.start.left; // hide overlay & closers overlay.hide(); // trigger position if (trigger) { var p = getPosition(trigger); top = p[0]; left = p[1]; } // shrink image overlay.data("img").animate({top: top, left: left, width:0}, opts.closeSpeed, onClose); }; // add overlay effect t.addEffect("apple", loadEffect, closeEffect); })(jQuery); |
this.mediaEl = null; this.alternativeEl = null; | function(APP, el) { jQuery.data(el, 'obj', this); var self = this; var WT = APP.WT; this.mediaEl = null; this.alternativeEl = null; function handleMove(event) { }; this.play = function() { if (el.mediaId) { var mediaEl = $('#' + el.mediaId).get(0); if (mediaEl) { mediaEl.play(); return; } } if (el.alternativeId) { var alternativeEl = $('#' + el.alternativeId).get(0); if (alternativeEl && alternativeEl.WtPlay) { alternativeEl.WtPlay(); } } }; this.pause = function() { if (el.mediaId) { var mediaEl = $('#' + el.mediaId).get(0); if (mediaEl) { mediaEl.pause(); return; } } if (el.alternativeId) { var alternativeEl = $('#' + el.alternativeId).get(0); if (alternativeEl && alternativeEl.WtPlay) { alternativeEl.WtPause(); } } }; }); |
|
$('.contentTitle .inputDropdown').each(function() { | $('.contentTitle .select').each(function() { | $('.contentTitle .inputDropdown').each(function() { // get selected value var val = $(this).val(); var id = $(this).attr('id'); var index = id.replace('blockExtraId', ''); var data = (val !== 'html') ? extraData[val] : null; // no real data, show editor if(data == null) { $('#blockContentHTML-'+ index).show(); $('#blockContentExtra-'+ index).hide(); $('#blockContentExtra-'+ index + ' p').html(' '); } else { if(data.type == 'block') { // build html var html = '{$msgModuleAttached}'.replace('{url}', data.data.url) .replace('{name}', data.label); } else { // build html var html = '{$msgWidgetAttached}'; } $('#blockContentHTML-'+ index).hide(); $('#blockContentExtra-'+ index).show(); $('#blockContentExtra-'+ index + ' p').html(html); } }); |
lazyload: false, | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.scrollable = { conf: { activeClass: 'active', circular: false, clickable: true, clonedClass: 'cloned', disabledClass: 'disabled', easing: 'swing', initialIndex: 0, item: null, items: '.items', keyboard: true, lazyload: false, mousewheel: false, next: '.next', prev: '.prev', speed: 400, vertical: false, wheelSpeed: 0 } }; var current; // constructor function Scrollable(root, conf) { // current instance var self = this, fire = root.add(self), itemWrap = root.children(), index = 0, forward, vertical = conf.vertical; if (!current) { current = self; } if (itemWrap.length > 1) { itemWrap = $(conf.items, root); } // methods $.extend(self, { getConf: function() { return conf; }, getIndex: function() { return index; }, getSize: function() { return self.getItems().size(); }, getNaviButtons: function() { return prev.add(next); }, getRoot: function() { return root; }, getItemWrap: function() { return itemWrap; }, getItems: function() { return itemWrap.children(conf.item).not("." + conf.clonedClass); }, move: function(offset, time) { return self.seekTo(index + offset, time); }, next: function(time) { return self.move(1, time); }, prev: function(time) { return self.move(-1, time); }, begin: function(time) { return self.seekTo(0, time); }, end: function(time) { return self.seekTo(self.getSize() -1, time); }, focus: function() { current = self; return self; }, addItem: function(item) { item = $(item); if (!conf.circular) { itemWrap.append(item); } else { $(".cloned:last").before(item); $(".cloned:first").replaceWith(item.clone().addClass(conf.clonedClass)); } fire.trigger("onAddItem", [item]); return self; }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { // check that index is sane if (!conf.circular && i < 0 || i > self.getSize()) { return self; } var item = i; if (i.jquery) { i = self.getItems().index(i); } else { item = self.getItems().eq(i); } // onBeforeSeek var e = $.Event("onBeforeSeek"); if (!fn) { fire.trigger(e, [i, time]); if (e.isDefaultPrevented() || !item.length) { return self; } } var props = vertical ? {top: -item.position().top} : {left: -item.position().left}; itemWrap.animate(props, time, conf.easing, fn || function() { fire.trigger("onSeek", [i]); }); current = self; index = i; return self; } }); // callbacks $.each("onBeforeSeek,onSeek,onAddItem".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // circular loop if (conf.circular) { var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap), cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); cloned1.add(cloned2).addClass(conf.clonedClass); self.onBeforeSeek(function(e, i, time) { if (e.isDefaultPrevented()) { return; } /* 1. animate to the clone without event triggering 2. seek to correct position with 0 speed */ if (i == -1) { self.seekTo(cloned1, time, function() { self.end(0); }); return e.preventDefault(); } else if (i == self.getSize()) { self.seekTo(cloned2, time, function() { self.begin(0); }); } }); } // next/prev buttons var prev = root.parent().find(conf.prev).click(function() { self.prev(); }), next = root.parent().find(conf.next).click(function() { self.next(); }); if (!conf.circular && self.getSize() > 2) { self.onBeforeSeek(function(e, i) { prev.toggleClass(conf.disabledClass, i <= 0); next.toggleClass(conf.disabledClass, i >= self.getSize() -1); }); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { if (conf.mousewheel) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; } }); } if (conf.clickable) { root.click(function() { if (conf.clickable) { self.next(); } }); } if (conf.keyboard) { $(document).bind("keydown.scrollable", function(evt) { // skip certain conditions if (!conf.keyboard || evt.altKey || evt.ctrlKey || $(evt.target).is(":input")) { return; } // does this instance have focus? if (conf.keyboard != 'static' && current != self) { return; } var key = evt.keyCode; if (vertical && (key == 38 || key == 40)) { self.move(key == 38 ? -1 : 1); return evt.preventDefault(); } if (!vertical && (key == 37 || key == 39)) { self.move(key == 37 ? -1 : 1); return evt.preventDefault(); } }); } // lazyload support. all logic is here. var lconf = $.tools.lazyload && conf.lazyload, loader, doLoad = function (ev, i) { loader.load(self.getItems().eq(i).find(":unloaded").andSelf()); }; if (lconf) { // lazyload configuration if (typeof lconf != 'object') { lconf = { select: lconf }; } if (typeof lconf.select != 'string') { lconf.select = "img, :backgroundImage"; } // initialize lazyload loader = itemWrap.find(lconf.select).lazyload(lconf).data("lazyload"); self.onBeforeSeek(doLoad); } // initial index $(self).trigger("onBeforeSeek", [conf.initialIndex]); self.seekTo(conf.initialIndex, 0, true); } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.data("scrollable"); if (el) { return el; } conf = $.extend({}, $.tools.scrollable.conf, conf); this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
|
}); } var lconf = $.tools.lazyload && conf.lazyload, loader, doLoad = function (ev, i) { loader.load(self.getItems().eq(i).find(":unloaded").andSelf()); }; if (lconf) { if (typeof lconf != 'object') { lconf = { select: lconf }; } if (typeof lconf.select != 'string') { lconf.select = "img, :backgroundImage"; } loader = itemWrap.find(lconf.select).lazyload(lconf).data("lazyload"); self.onBeforeSeek(doLoad); } | }); } | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.scrollable = { conf: { activeClass: 'active', circular: false, clickable: true, clonedClass: 'cloned', disabledClass: 'disabled', easing: 'swing', initialIndex: 0, item: null, items: '.items', keyboard: true, lazyload: false, mousewheel: false, next: '.next', prev: '.prev', speed: 400, vertical: false, wheelSpeed: 0 } }; var current; // constructor function Scrollable(root, conf) { // current instance var self = this, fire = root.add(self), itemWrap = root.children(), index = 0, forward, vertical = conf.vertical; if (!current) { current = self; } if (itemWrap.length > 1) { itemWrap = $(conf.items, root); } // methods $.extend(self, { getConf: function() { return conf; }, getIndex: function() { return index; }, getSize: function() { return self.getItems().size(); }, getNaviButtons: function() { return prev.add(next); }, getRoot: function() { return root; }, getItemWrap: function() { return itemWrap; }, getItems: function() { return itemWrap.children(conf.item).not("." + conf.clonedClass); }, move: function(offset, time) { return self.seekTo(index + offset, time); }, next: function(time) { return self.move(1, time); }, prev: function(time) { return self.move(-1, time); }, begin: function(time) { return self.seekTo(0, time); }, end: function(time) { return self.seekTo(self.getSize() -1, time); }, focus: function() { current = self; return self; }, addItem: function(item) { item = $(item); if (!conf.circular) { itemWrap.append(item); } else { $(".cloned:last").before(item); $(".cloned:first").replaceWith(item.clone().addClass(conf.clonedClass)); } fire.trigger("onAddItem", [item]); return self; }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { // check that index is sane if (!conf.circular && i < 0 || i > self.getSize()) { return self; } var item = i; if (i.jquery) { i = self.getItems().index(i); } else { item = self.getItems().eq(i); } // onBeforeSeek var e = $.Event("onBeforeSeek"); if (!fn) { fire.trigger(e, [i, time]); if (e.isDefaultPrevented() || !item.length) { return self; } } var props = vertical ? {top: -item.position().top} : {left: -item.position().left}; itemWrap.animate(props, time, conf.easing, fn || function() { fire.trigger("onSeek", [i]); }); current = self; index = i; return self; } }); // callbacks $.each("onBeforeSeek,onSeek,onAddItem".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // circular loop if (conf.circular) { var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap), cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); cloned1.add(cloned2).addClass(conf.clonedClass); self.onBeforeSeek(function(e, i, time) { if (e.isDefaultPrevented()) { return; } /* 1. animate to the clone without event triggering 2. seek to correct position with 0 speed */ if (i == -1) { self.seekTo(cloned1, time, function() { self.end(0); }); return e.preventDefault(); } else if (i == self.getSize()) { self.seekTo(cloned2, time, function() { self.begin(0); }); } }); } // next/prev buttons var prev = root.parent().find(conf.prev).click(function() { self.prev(); }), next = root.parent().find(conf.next).click(function() { self.next(); }); if (!conf.circular && self.getSize() > 2) { self.onBeforeSeek(function(e, i) { prev.toggleClass(conf.disabledClass, i <= 0); next.toggleClass(conf.disabledClass, i >= self.getSize() -1); }); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { if (conf.mousewheel) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; } }); } if (conf.clickable) { root.click(function() { if (conf.clickable) { self.next(); } }); } if (conf.keyboard) { $(document).bind("keydown.scrollable", function(evt) { // skip certain conditions if (!conf.keyboard || evt.altKey || evt.ctrlKey || $(evt.target).is(":input")) { return; } // does this instance have focus? if (conf.keyboard != 'static' && current != self) { return; } var key = evt.keyCode; if (vertical && (key == 38 || key == 40)) { self.move(key == 38 ? -1 : 1); return evt.preventDefault(); } if (!vertical && (key == 37 || key == 39)) { self.move(key == 37 ? -1 : 1); return evt.preventDefault(); } }); } // lazyload support. all logic is here. var lconf = $.tools.lazyload && conf.lazyload, loader, doLoad = function (ev, i) { loader.load(self.getItems().eq(i).find(":unloaded").andSelf()); }; if (lconf) { // lazyload configuration if (typeof lconf != 'object') { lconf = { select: lconf }; } if (typeof lconf.select != 'string') { lconf.select = "img, :backgroundImage"; } // initialize lazyload loader = itemWrap.find(lconf.select).lazyload(lconf).data("lazyload"); self.onBeforeSeek(doLoad); } // initial index $(self).trigger("onBeforeSeek", [conf.initialIndex]); self.seekTo(conf.initialIndex, 0, true); } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.data("scrollable"); if (el) { return el; } conf = $.extend({}, $.tools.scrollable.conf, conf); this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
newItem.creators.push(Zotero.Utilities.cleanString(match[2])); | newItem.creators.push(Zotero.Utilities.trimInternal(match[2])); | 'exportselect=record&exporttype=plaintext', function(text) { var lineRegexp = new RegExp(); lineRegexp.compile("^([\\w() ]+): *(.*)$"); var newItem = new Zotero.Item("book"); newItem.extra = ""; var lines = text.split('\n'); for(var i=0;i<lines.length;i++) { var testMatch = lineRegexp.exec(lines[i]); if(testMatch) { var match = newMatch; var newMatch = testMatch } else { var match = false; } if(match) { // is a useful match if(match[1] == 'Title') { var title = match[2]; if(!lineRegexp.test(lines[i+1])) { i++; title += ' '+lines[i]; } if(title.substring(title.length-2) == " /") { title = title.substring(0, title.length-2); } newItem.title = Zotero.Utilities.capitalizeTitle(title); } else if(match[1] == "Series") { newItem.series = match[2]; } else if(match[1] == "Description") { var pageMatch = /([0-9]+) p\.?/ var m = pageMatch.exec(match[2]); if(m) { newItem.pages = m[1]; } } else if(match[1] == 'Author(s)' || match[1] == "Corp Author(s)") { var yearRegexp = /[0-9]{4}-([0-9]{4})?/; var authors = match[2].split(';'); if(authors) { newItem.creators.push(Zotero.Utilities.cleanAuthor(authors[0], "author", true)); for(var j=1; j<authors.length; j+=2) { if(authors[j-1].substring(0, 1) != '(' && !yearRegexp.test(authors[j])) { // ignore places where there are parentheses newItem.creators.push({lastName:authors[j], creatorType:"author", fieldMode:true}); } } } else { newItem.creators.push(Zotero.Utilities.cleanString(match[2])); } } else if(match[1] == 'Publication') { match[2] = Zotero.Utilities.cleanString(match[2]); if(match[2].substring(match[2].length-1) == ',') { match[2] = match[2].substring(0, match[2].length-1); } // most, but not all, WorldCat publisher/places are // colon delimited var parts = match[2].split(/ ?: ?/); if(parts.length == 2) { newItem.place = parts[0]; newItem.publisher = parts[1]; } else { newItem.publisher = match[2]; } } else if(match[1] == 'Institution') { newItem.publisher = match[2]; } else if(match[1] == 'Standard No') { var ISBNRe = /ISBN:\s*([0-9X]+)/ var m = ISBNRe.exec(match[2]); if(m) newItem.ISBN = m[1]; } else if(match[1] == 'Year') { newItem.date = match[2]; } else if(match[1] == "Descriptor") { if(match[2][match[2].length-1] == ".") { match[2] = match[2].substr(0, match[2].length-1); } var tags = match[2].split("--"); for(var j in tags) { newItem.tags.push(Zotero.Utilities.cleanString(tags[j])); } } else if(match[1] == "Accession No") { newItem.accessionNumber = Zotero.Utilities.superCleanString(match[2]); } else if(match[1] == "Degree") { newItem.itemType = "thesis"; newItem.thesisType = match[2]; } else if(match[1] == "DOI") { newItem.DOI = match[2]; } else if(match[1] == "Database") { if(match[2].substr(0, 8) != "WorldCat") { newItem.itemType = "journalArticle"; } } else if(match[1] != "Availability" && match[1] != "Find Items About" && match[1] != "Document Type") { newItem.extra += match[1]+": "+match[2]+"\n"; } } else { if(lines[i] != "" && lines[i] != "SUBJECT(S)") { newMatch[2] += " "+lines[i]; } } } if(newItem.extra) { newItem.extra = newItem.extra.substr(0, newItem.extra.length-1); } newItem.complete(); processURLs(urls); }, false, 'iso-8859-1'); |
match[2] = Zotero.Utilities.cleanString(match[2]); | match[2] = Zotero.Utilities.trimInternal(match[2]); | 'exportselect=record&exporttype=plaintext', function(text) { var lineRegexp = new RegExp(); lineRegexp.compile("^([\\w() ]+): *(.*)$"); var newItem = new Zotero.Item("book"); newItem.extra = ""; var lines = text.split('\n'); for(var i=0;i<lines.length;i++) { var testMatch = lineRegexp.exec(lines[i]); if(testMatch) { var match = newMatch; var newMatch = testMatch } else { var match = false; } if(match) { // is a useful match if(match[1] == 'Title') { var title = match[2]; if(!lineRegexp.test(lines[i+1])) { i++; title += ' '+lines[i]; } if(title.substring(title.length-2) == " /") { title = title.substring(0, title.length-2); } newItem.title = Zotero.Utilities.capitalizeTitle(title); } else if(match[1] == "Series") { newItem.series = match[2]; } else if(match[1] == "Description") { var pageMatch = /([0-9]+) p\.?/ var m = pageMatch.exec(match[2]); if(m) { newItem.pages = m[1]; } } else if(match[1] == 'Author(s)' || match[1] == "Corp Author(s)") { var yearRegexp = /[0-9]{4}-([0-9]{4})?/; var authors = match[2].split(';'); if(authors) { newItem.creators.push(Zotero.Utilities.cleanAuthor(authors[0], "author", true)); for(var j=1; j<authors.length; j+=2) { if(authors[j-1].substring(0, 1) != '(' && !yearRegexp.test(authors[j])) { // ignore places where there are parentheses newItem.creators.push({lastName:authors[j], creatorType:"author", fieldMode:true}); } } } else { newItem.creators.push(Zotero.Utilities.cleanString(match[2])); } } else if(match[1] == 'Publication') { match[2] = Zotero.Utilities.cleanString(match[2]); if(match[2].substring(match[2].length-1) == ',') { match[2] = match[2].substring(0, match[2].length-1); } // most, but not all, WorldCat publisher/places are // colon delimited var parts = match[2].split(/ ?: ?/); if(parts.length == 2) { newItem.place = parts[0]; newItem.publisher = parts[1]; } else { newItem.publisher = match[2]; } } else if(match[1] == 'Institution') { newItem.publisher = match[2]; } else if(match[1] == 'Standard No') { var ISBNRe = /ISBN:\s*([0-9X]+)/ var m = ISBNRe.exec(match[2]); if(m) newItem.ISBN = m[1]; } else if(match[1] == 'Year') { newItem.date = match[2]; } else if(match[1] == "Descriptor") { if(match[2][match[2].length-1] == ".") { match[2] = match[2].substr(0, match[2].length-1); } var tags = match[2].split("--"); for(var j in tags) { newItem.tags.push(Zotero.Utilities.cleanString(tags[j])); } } else if(match[1] == "Accession No") { newItem.accessionNumber = Zotero.Utilities.superCleanString(match[2]); } else if(match[1] == "Degree") { newItem.itemType = "thesis"; newItem.thesisType = match[2]; } else if(match[1] == "DOI") { newItem.DOI = match[2]; } else if(match[1] == "Database") { if(match[2].substr(0, 8) != "WorldCat") { newItem.itemType = "journalArticle"; } } else if(match[1] != "Availability" && match[1] != "Find Items About" && match[1] != "Document Type") { newItem.extra += match[1]+": "+match[2]+"\n"; } } else { if(lines[i] != "" && lines[i] != "SUBJECT(S)") { newMatch[2] += " "+lines[i]; } } } if(newItem.extra) { newItem.extra = newItem.extra.substr(0, newItem.extra.length-1); } newItem.complete(); processURLs(urls); }, false, 'iso-8859-1'); |
newItem.tags.push(Zotero.Utilities.cleanString(tags[j])); | newItem.tags.push(Zotero.Utilities.trimInternal(tags[j])); | 'exportselect=record&exporttype=plaintext', function(text) { var lineRegexp = new RegExp(); lineRegexp.compile("^([\\w() ]+): *(.*)$"); var newItem = new Zotero.Item("book"); newItem.extra = ""; var lines = text.split('\n'); for(var i=0;i<lines.length;i++) { var testMatch = lineRegexp.exec(lines[i]); if(testMatch) { var match = newMatch; var newMatch = testMatch } else { var match = false; } if(match) { // is a useful match if(match[1] == 'Title') { var title = match[2]; if(!lineRegexp.test(lines[i+1])) { i++; title += ' '+lines[i]; } if(title.substring(title.length-2) == " /") { title = title.substring(0, title.length-2); } newItem.title = Zotero.Utilities.capitalizeTitle(title); } else if(match[1] == "Series") { newItem.series = match[2]; } else if(match[1] == "Description") { var pageMatch = /([0-9]+) p\.?/ var m = pageMatch.exec(match[2]); if(m) { newItem.pages = m[1]; } } else if(match[1] == 'Author(s)' || match[1] == "Corp Author(s)") { var yearRegexp = /[0-9]{4}-([0-9]{4})?/; var authors = match[2].split(';'); if(authors) { newItem.creators.push(Zotero.Utilities.cleanAuthor(authors[0], "author", true)); for(var j=1; j<authors.length; j+=2) { if(authors[j-1].substring(0, 1) != '(' && !yearRegexp.test(authors[j])) { // ignore places where there are parentheses newItem.creators.push({lastName:authors[j], creatorType:"author", fieldMode:true}); } } } else { newItem.creators.push(Zotero.Utilities.cleanString(match[2])); } } else if(match[1] == 'Publication') { match[2] = Zotero.Utilities.cleanString(match[2]); if(match[2].substring(match[2].length-1) == ',') { match[2] = match[2].substring(0, match[2].length-1); } // most, but not all, WorldCat publisher/places are // colon delimited var parts = match[2].split(/ ?: ?/); if(parts.length == 2) { newItem.place = parts[0]; newItem.publisher = parts[1]; } else { newItem.publisher = match[2]; } } else if(match[1] == 'Institution') { newItem.publisher = match[2]; } else if(match[1] == 'Standard No') { var ISBNRe = /ISBN:\s*([0-9X]+)/ var m = ISBNRe.exec(match[2]); if(m) newItem.ISBN = m[1]; } else if(match[1] == 'Year') { newItem.date = match[2]; } else if(match[1] == "Descriptor") { if(match[2][match[2].length-1] == ".") { match[2] = match[2].substr(0, match[2].length-1); } var tags = match[2].split("--"); for(var j in tags) { newItem.tags.push(Zotero.Utilities.cleanString(tags[j])); } } else if(match[1] == "Accession No") { newItem.accessionNumber = Zotero.Utilities.superCleanString(match[2]); } else if(match[1] == "Degree") { newItem.itemType = "thesis"; newItem.thesisType = match[2]; } else if(match[1] == "DOI") { newItem.DOI = match[2]; } else if(match[1] == "Database") { if(match[2].substr(0, 8) != "WorldCat") { newItem.itemType = "journalArticle"; } } else if(match[1] != "Availability" && match[1] != "Find Items About" && match[1] != "Document Type") { newItem.extra += match[1]+": "+match[2]+"\n"; } } else { if(lines[i] != "" && lines[i] != "SUBJECT(S)") { newMatch[2] += " "+lines[i]; } } } if(newItem.extra) { newItem.extra = newItem.extra.substr(0, newItem.extra.length-1); } newItem.complete(); processURLs(urls); }, false, 'iso-8859-1'); |
WT_DECLARE_WT_MEMBER(1,"WSuggestionPopup",function(q,d,x,y,p){function r(){return d.style.display!="none"}function k(){d.style.display="none"}function z(a){c.positionAtWidget(d.id,a.id,c.Vertical)}function A(a){a=a||window.event;a=a.target||a.srcElement;if(a.className!="content"){if(!c.hasTag(a,"DIV"))a=a.parentNode;s(a)}}function s(a){var b=a.firstChild;a=c.getElement(e);var i=b.innerHTML;b=b.getAttribute("sug");a.focus();x(a,i,b);k();e=null}function B(a,b){for(a=b?a.nextSibling:a.previousSibling;a;a= b?a.nextSibling:a.previousSibling)if(c.hasTag(a,"DIV"))if(a.style.display!="none")return a;return null}$(".Wt-domRoot").add(d);jQuery.data(d,"obj",this);var n=this,c=q.WT,m=null,e=null,t=false,u=null,v=null,o=null;this.showPopup=function(){d.style.display="";m=null};this.editMouseMove=function(a,b){a.style.cursor=c.widgetCoordinates(a,b).x>a.offsetWidth-16?"default":""};this.editClick=function(a,b){if(c.widgetCoordinates(a,b).x>a.offsetWidth-16)if(e!=a.id){k();e=a.id;n.refilter()}else{e=null;k()}}; this.editKeyDown=function(a,b){if(e!=a.id)if($(a).hasClass("Wt-suggest-onedit"))e=a.id;else if($(a).hasClass("Wt-suggest-dropdown")&&b.keyCode==40)e=a.id;else{e=null;return true}var i=m?c.getElement(m):null;if(r()&&i)if(b.keyCode==13||b.keyCode==9){s(i);c.cancelEvent(b);setTimeout(function(){a.focus()},0);return false}else if(b.keyCode==40||b.keyCode==38||b.keyCode==34||b.keyCode==33){if(b.type.toUpperCase()=="KEYDOWN"){t=true;c.cancelEvent(b,c.CancelDefaultAction)}if(b.type.toUpperCase()=="KEYPRESS"&& t==true){c.cancelEvent(b);return false}var f=i,j=b.keyCode==40||b.keyCode==34;b=b.keyCode==34||b.keyCode==33?d.clientHeight/i.offsetHeight:1;var h;for(h=0;f&&h<b;++h){var l=B(f,j);if(!l)break;f=l}if(f&&c.hasTag(f,"DIV")){i.className="";f.className="sel";m=f.id}return false}return b.keyCode!=13&&b.keyCode!=9};this.filtered=function(a){u=a;n.refilter()};this.refilter=function(){var a=m?c.getElement(m):null,b=c.getElement(e),i=y(b),f=!$(b).hasClass("Wt-suggest-dropdown"),j=d.lastChild.childNodes,h=i(null); if(p)if(f&&h.length<p){k();return}else{j=h.substring(0,p);if(j!=u){if(j!=v){v=j;q.emit(d,"filter",j)}if(f){k();return}}}var l=null;j=d.lastChild.childNodes;f=!f&&h.length==0;for(h=0;h<j.length;h++){var g=j[h];if(c.hasTag(g,"DIV")){if(g.orig==null)g.orig=g.firstChild.innerHTML;else g.firstChild.innerHTML=g.orig;var w=i(g.firstChild.innerHTML),C=f||w.match;g.firstChild.innerHTML=w.suggestion;if(C){g.style.display="";if(l==null)l=g}else g.style.display="none";g.className=""}}if(l==null)k();else{if(!r()){z(b); n.showPopup();a=null}if(!a||a.style.display=="none"){m=l.id;a=l;a.parentNode.scrollTop=0}a.className="sel";b=a.parentNode;if(a.offsetTop+a.offsetHeight>b.scrollTop+b.clientHeight)b.scrollTop=a.offsetTop+a.offsetHeight-b.clientHeight;else if(a.offsetTop<b.scrollTop)b.scrollTop=a.offsetTop}};this.editKeyUp=function(a,b){if(e!=null)if(!((b.keyCode==13||b.keyCode==9)&&d.style.display=="none"))if(b.keyCode==27||b.keyCode==37||b.keyCode==39){d.style.display="none";if(b.keyCode==27){e=null;$(a).hasClass("Wt-suggest-dropdown")? k():a.blur()}}else n.refilter()};d.lastChild.onclick=A;d.lastChild.onscroll=function(){if(o){clearTimeout(o);var a=c.getElement(e);a&&a.focus()}};this.delayHide=function(a){o=setTimeout(function(){o=null;if(d&&(a==null||e==a.id))k()},300)}}); | WT_DECLARE_WT_MEMBER(1,"WSuggestionPopup",function(q,d,y,z,r){function m(a){return $(a).hasClass("Wt-suggest-onedit")||$(a).hasClass("Wt-suggest-dropdown")}function s(){return d.style.display!="none"}function k(){d.style.display="none"}function A(a){c.positionAtWidget(d.id,a.id,c.Vertical)}function B(a){a=a||window.event;a=a.target||a.srcElement;if(a.className!="content"){if(!c.hasTag(a,"DIV"))a=a.parentNode;t(a)}}function t(a){var b=a.firstChild,h=c.getElement(f),e=b.innerHTML;b=b.getAttribute("sug"); h.focus();q.emit(d,"select",a.id,h.id);y(h,e,b);k();f=null}function C(a,b){for(a=b?a.nextSibling:a.previousSibling;a;a=b?a.nextSibling:a.previousSibling)if(c.hasTag(a,"DIV"))if(a.style.display!="none")return a;return null}$(".Wt-domRoot").add(d);jQuery.data(d,"obj",this);var n=this,c=q.WT,l=null,f=null,u=false,v=null,w=null,o=null;this.showPopup=function(){d.style.display="";l=null};this.editMouseMove=function(a,b){if(m(a))a.style.cursor=c.widgetCoordinates(a,b).x>a.offsetWidth-16?"default":""};this.editClick= function(a,b){if(m(a))if(c.widgetCoordinates(a,b).x>a.offsetWidth-16)if(f!=a.id){k();f=a.id;n.refilter()}else{f=null;k()}};this.editKeyDown=function(a,b){if(!m(a))return true;if(f!=a.id)if($(a).hasClass("Wt-suggest-onedit"))f=a.id;else if($(a).hasClass("Wt-suggest-dropdown")&&b.keyCode==40)f=a.id;else{f=null;return true}var h=l?c.getElement(l):null;if(s()&&h)if(b.keyCode==13||b.keyCode==9){t(h);c.cancelEvent(b);setTimeout(function(){a.focus()},0);return false}else if(b.keyCode==40||b.keyCode==38|| b.keyCode==34||b.keyCode==33){if(b.type.toUpperCase()=="KEYDOWN"){u=true;c.cancelEvent(b,c.CancelDefaultAction)}if(b.type.toUpperCase()=="KEYPRESS"&&u==true){c.cancelEvent(b);return false}var e=h,p=b.keyCode==40||b.keyCode==34;b=b.keyCode==34||b.keyCode==33?d.clientHeight/h.offsetHeight:1;var j;for(j=0;e&&j<b;++j){var g=C(e,p);if(!g)break;e=g}if(e&&c.hasTag(e,"DIV")){h.className="";e.className="sel";l=e.id}return false}return b.keyCode!=13&&b.keyCode!=9};this.filtered=function(a){v=a;n.refilter()}; this.refilter=function(){var a=l?c.getElement(l):null,b=c.getElement(f),h=z(b),e=!$(b).hasClass("Wt-suggest-dropdown"),p=d.lastChild.childNodes,j=h(null);if(r)if(e&&j.length<r){k();return}else{var g=j.substring(0,r);if(g!=v){if(g!=w){w=g;q.emit(d,"filter",g)}if(e){k();return}}}g=null;e=!e&&j.length==0;for(j=0;j<p.length;j++){var i=p[j];if(c.hasTag(i,"DIV")){if(i.orig==null)i.orig=i.firstChild.innerHTML;else i.firstChild.innerHTML=i.orig;var x=h(i.firstChild.innerHTML),D=e||x.match;i.firstChild.innerHTML= x.suggestion;if(D){i.style.display="";if(g==null)g=i}else i.style.display="none";i.className=""}}if(g==null)k();else{if(!s()){A(b);n.showPopup();a=null}if(!a||a.style.display=="none"){l=g.id;a=g;a.parentNode.scrollTop=0}a.className="sel";b=a.parentNode;if(a.offsetTop+a.offsetHeight>b.scrollTop+b.clientHeight)b.scrollTop=a.offsetTop+a.offsetHeight-b.clientHeight;else if(a.offsetTop<b.scrollTop)b.scrollTop=a.offsetTop}};this.editKeyUp=function(a,b){if(f!=null)if(m(a))if(!((b.keyCode==13||b.keyCode== 9)&&d.style.display=="none"))if(b.keyCode==27||b.keyCode==37||b.keyCode==39){d.style.display="none";if(b.keyCode==27){f=null;$(a).hasClass("Wt-suggest-dropdown")?k():a.blur()}}else n.refilter()};d.lastChild.onclick=B;d.lastChild.onscroll=function(){if(o){clearTimeout(o);var a=c.getElement(f);a&&a.focus()}};this.delayHide=function(a){o=setTimeout(function(){o=null;if(d&&(a==null||f==a.id))k()},300)}}); | WT_DECLARE_WT_MEMBER(1,"WSuggestionPopup",function(q,d,x,y,p){function r(){return d.style.display!="none"}function k(){d.style.display="none"}function z(a){c.positionAtWidget(d.id,a.id,c.Vertical)}function A(a){a=a||window.event;a=a.target||a.srcElement;if(a.className!="content"){if(!c.hasTag(a,"DIV"))a=a.parentNode;s(a)}}function s(a){var b=a.firstChild;a=c.getElement(e);var i=b.innerHTML;b=b.getAttribute("sug");a.focus();x(a,i,b);k();e=null}function B(a,b){for(a=b?a.nextSibling:a.previousSibling;a;a=b?a.nextSibling:a.previousSibling)if(c.hasTag(a,"DIV"))if(a.style.display!="none")return a;return null}$(".Wt-domRoot").add(d);jQuery.data(d,"obj",this);var n=this,c=q.WT,m=null,e=null,t=false,u=null,v=null,o=null;this.showPopup=function(){d.style.display="";m=null};this.editMouseMove=function(a,b){a.style.cursor=c.widgetCoordinates(a,b).x>a.offsetWidth-16?"default":""};this.editClick=function(a,b){if(c.widgetCoordinates(a,b).x>a.offsetWidth-16)if(e!=a.id){k();e=a.id;n.refilter()}else{e=null;k()}};this.editKeyDown=function(a,b){if(e!=a.id)if($(a).hasClass("Wt-suggest-onedit"))e=a.id;else if($(a).hasClass("Wt-suggest-dropdown")&&b.keyCode==40)e=a.id;else{e=null;return true}var i=m?c.getElement(m):null;if(r()&&i)if(b.keyCode==13||b.keyCode==9){s(i);c.cancelEvent(b);setTimeout(function(){a.focus()},0);return false}else if(b.keyCode==40||b.keyCode==38||b.keyCode==34||b.keyCode==33){if(b.type.toUpperCase()=="KEYDOWN"){t=true;c.cancelEvent(b,c.CancelDefaultAction)}if(b.type.toUpperCase()=="KEYPRESS"&&t==true){c.cancelEvent(b);return false}var f=i,j=b.keyCode==40||b.keyCode==34;b=b.keyCode==34||b.keyCode==33?d.clientHeight/i.offsetHeight:1;var h;for(h=0;f&&h<b;++h){var l=B(f,j);if(!l)break;f=l}if(f&&c.hasTag(f,"DIV")){i.className="";f.className="sel";m=f.id}return false}return b.keyCode!=13&&b.keyCode!=9};this.filtered=function(a){u=a;n.refilter()};this.refilter=function(){var a=m?c.getElement(m):null,b=c.getElement(e),i=y(b),f=!$(b).hasClass("Wt-suggest-dropdown"),j=d.lastChild.childNodes,h=i(null);if(p)if(f&&h.length<p){k();return}else{j=h.substring(0,p);if(j!=u){if(j!=v){v=j;q.emit(d,"filter",j)}if(f){k();return}}}var l=null;j=d.lastChild.childNodes;f=!f&&h.length==0;for(h=0;h<j.length;h++){var g=j[h];if(c.hasTag(g,"DIV")){if(g.orig==null)g.orig=g.firstChild.innerHTML;else g.firstChild.innerHTML=g.orig;var w=i(g.firstChild.innerHTML),C=f||w.match;g.firstChild.innerHTML=w.suggestion;if(C){g.style.display="";if(l==null)l=g}else g.style.display="none";g.className=""}}if(l==null)k();else{if(!r()){z(b);n.showPopup();a=null}if(!a||a.style.display=="none"){m=l.id;a=l;a.parentNode.scrollTop=0}a.className="sel";b=a.parentNode;if(a.offsetTop+a.offsetHeight>b.scrollTop+b.clientHeight)b.scrollTop=a.offsetTop+a.offsetHeight-b.clientHeight;else if(a.offsetTop<b.scrollTop)b.scrollTop=a.offsetTop}};this.editKeyUp=function(a,b){if(e!=null)if(!((b.keyCode==13||b.keyCode==9)&&d.style.display=="none"))if(b.keyCode==27||b.keyCode==37||b.keyCode==39){d.style.display="none";if(b.keyCode==27){e=null;$(a).hasClass("Wt-suggest-dropdown")?k():a.blur()}}else n.refilter()};d.lastChild.onclick=A;d.lastChild.onscroll=function(){if(o){clearTimeout(o);var a=c.getElement(e);a&&a.focus()}};this.delayHide=function(a){o=setTimeout(function(){o=null;if(d&&(a==null||e==a.id))k()},300)}}); |
maskConf = $.tools.mask && (conf.mask || conf.expose), | maskConf = $.tools.expose && (conf.mask || conf.expose), | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { close: null, closeOnClick: true, closeOnEsc: true, closeSpeed: 'fast', effect: 'default', // since 1.2. fixed positioning not supported by IE6 fixed: !$.browser.msie || $.browser.version > 6, left: 'center', load: false, // 1.2 mask: null, oneInstance: true, speed: 'normal', target: null, // target element to be overlayed. by default taken from [rel] top: '10%' } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(pos, onLoad) { var conf = this.getConf(), w = $(window); if (!conf.fixed) { pos.top += w.scrollTop(); pos.left += w.scrollLeft(); } pos.position = conf.fixed ? 'fixed' : 'absolute'; this.getOverlay().css(pos).fadeIn(conf.speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.mask && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and triggerr var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $(overlay).expose(maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } // load effect eff[0].call(self, {top: top, left: left}, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf && conf.closeOnClick) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).unbind("click." + uid).unbind("keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".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; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<div class="close"></div>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); // autoload if (conf.load) { self.load(); } } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); |
} | }; | return function() { nvclMarker.markerClicked(); } |
if (!moved) { var ws = WT.windowSize(); var w = el.offsetWidth, h = el.offsetHeight; el.style.left = Math.round((ws.x - w)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - h)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; | if (el.style.display != 'none') { if (!moved) { var ws = WT.windowSize(); var w = el.offsetWidth, h = el.offsetHeight; el.style.left = Math.round((ws.x - w)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - h)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; | function(APP, el) { jQuery.data(el, 'obj', this); var self = this; var titlebar = $(el).find(".titlebar").first().get(0); var WT = APP.WT; var dsx, dsy; var moved = false; if (el.style.left != '' || el.style.top != '') moved = true; function handleMove(event) { var e = event||window.event; var nowxy = WT.pageCoordinates(e); var wxy = WT.windowCoordinates(e); var wsize = WT.windowSize(); if (wxy.x > 0 && wxy.x < wsize.x && wxy.y > 0 && wxy.y < wsize.y) { moved = true; el.style.left = (WT.pxself(el, 'left') + nowxy.x - dsx) + 'px'; el.style.top = (WT.pxself(el, 'top') + nowxy.y - dsy) + 'px'; dsx = nowxy.x; dsy = nowxy.y; } }; if (titlebar) { titlebar.onmousedown = function(event) { var e = event||window.event; WT.capture(titlebar); var pc = WT.pageCoordinates(e); dsx = pc.x; dsy = pc.y; titlebar.onmousemove = handleMove; }; titlebar.onmouseup = function(event) { titlebar.onmousemove = null; WT.capture(null); }; } this.centerDialog = function() { if (el.parentNode == null) { el = titlebar = null; this.centerDialog = function() { }; return; } if (!moved) { var ws = WT.windowSize(); var w = el.offsetWidth, h = el.offsetHeight; el.style.left = Math.round((ws.x - w)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - h)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; if (el.style.width != null && el.style.height != null) self.wtResize(el, w, h); } }; this.wtResize = function(self, w, h) { h -= 2; w -= 2; // 2 = dialog border self.style.height= h + 'px'; self.style.width= w + 'px'; var c = self.lastChild; var t = c.previousSibling; h -= t.offsetHeight + 8; // 8 = body padding if (h > 0) { c.style.height = h + 'px'; if (APP.layouts) APP.layouts.adjust(); } }; }); |
if (el.style.width != null && el.style.height != null) self.wtResize(el, w, h); | if (el.style.width != '' && el.style.height != '') self.wtResize(el, w, h); } el.style.visibility = 'visible'; | function(APP, el) { jQuery.data(el, 'obj', this); var self = this; var titlebar = $(el).find(".titlebar").first().get(0); var WT = APP.WT; var dsx, dsy; var moved = false; if (el.style.left != '' || el.style.top != '') moved = true; function handleMove(event) { var e = event||window.event; var nowxy = WT.pageCoordinates(e); var wxy = WT.windowCoordinates(e); var wsize = WT.windowSize(); if (wxy.x > 0 && wxy.x < wsize.x && wxy.y > 0 && wxy.y < wsize.y) { moved = true; el.style.left = (WT.pxself(el, 'left') + nowxy.x - dsx) + 'px'; el.style.top = (WT.pxself(el, 'top') + nowxy.y - dsy) + 'px'; dsx = nowxy.x; dsy = nowxy.y; } }; if (titlebar) { titlebar.onmousedown = function(event) { var e = event||window.event; WT.capture(titlebar); var pc = WT.pageCoordinates(e); dsx = pc.x; dsy = pc.y; titlebar.onmousemove = handleMove; }; titlebar.onmouseup = function(event) { titlebar.onmousemove = null; WT.capture(null); }; } this.centerDialog = function() { if (el.parentNode == null) { el = titlebar = null; this.centerDialog = function() { }; return; } if (!moved) { var ws = WT.windowSize(); var w = el.offsetWidth, h = el.offsetHeight; el.style.left = Math.round((ws.x - w)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - h)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; if (el.style.width != null && el.style.height != null) self.wtResize(el, w, h); } }; this.wtResize = function(self, w, h) { h -= 2; w -= 2; // 2 = dialog border self.style.height= h + 'px'; self.style.width= w + 'px'; var c = self.lastChild; var t = c.previousSibling; h -= t.offsetHeight + 8; // 8 = body padding if (h > 0) { c.style.height = h + 'px'; if (APP.layouts) APP.layouts.adjust(); } }; }); |
} | }; | return function() { gaSentinel.markerClicked(); } |
WT_DECLARE_WT_MEMBER(1,"WDialog",function(j,b){function k(a){a=c.pageCoordinates(a||window.event);h=true;b.style.left=c.pxself(b,"left")+a.x-f+"px";b.style.top=c.pxself(b,"top")+a.y-g+"px";f=a.x;g=a.y}jQuery.data(b,"obj",this);var d=$(b).find(".titlebar").first().get(0),c=j.WT,f,g,h=false;d.onmousedown=function(a){a=a||window.event;c.capture(d);a=c.pageCoordinates(a);f=a.x;g=a.y;d.onmousemove=k};d.onmouseup=function(){d.onmousemove=null;c.capture(null)};this.centerDialog=function(){if(b.parentNode== | WT_DECLARE_WT_MEMBER(1,"WDialog",function(j,b){function k(a){a=c.pageCoordinates(a||window.event);h=true;b.style.left=c.pxself(b,"left")+a.x-f+"px";b.style.top=c.pxself(b,"top")+a.y-g+"px";f=a.x;g=a.y}jQuery.data(b,"obj",this);var d=$(b).find(".titlebar").first().get(0),c=j.WT,f,g,h=false;if(d){d.onmousedown=function(a){a=a||window.event;c.capture(d);a=c.pageCoordinates(a);f=a.x;g=a.y;d.onmousemove=k};d.onmouseup=function(){d.onmousemove=null;c.capture(null)}}this.centerDialog=function(){if(b.parentNode== | WT_DECLARE_WT_MEMBER(1,"WDialog",function(j,b){function k(a){a=c.pageCoordinates(a||window.event);h=true;b.style.left=c.pxself(b,"left")+a.x-f+"px";b.style.top=c.pxself(b,"top")+a.y-g+"px";f=a.x;g=a.y}jQuery.data(b,"obj",this);var d=$(b).find(".titlebar").first().get(0),c=j.WT,f,g,h=false;d.onmousedown=function(a){a=a||window.event;c.capture(d);a=c.pageCoordinates(a);f=a.x;g=a.y;d.onmousemove=k};d.onmouseup=function(){d.onmousemove=null;c.capture(null)};this.centerDialog=function(){if(b.parentNode==null){b=d=null;this.centerDialog=function(){}}else if(b.style.display!="none"){if(!h){var a=c.windowSize();b.style.left=Math.round((a.x-b.clientWidth)/2+(c.isIE6?document.documentElement.scrollLeft:0))+"px";b.style.top=Math.round((a.y-b.clientHeight)/2+(c.isIE6?document.documentElement.scrollTop:0))+"px";b.style.marginLeft="0px";b.style.marginTop="0px"}b.style.visibility="visible"}};this.wtResize=function(a,i,e){e-=2;i-=2;a.style.height=e+"px";a.style.width=i+"px";a=a.lastChild;e-=a.previousSibling.offsetHeight+8;if(e>0)a.style.height=e+"px"}}); |
if ( result.prime ) { | if ( result ) { | (function ( ) { //This file has been reworked to rely on class NS - A Chandler May 2010 /////////////////////////////////////////// // import /////////////////////////////////////////// // var RSA = __package( packages, id ).RSA; // var BigInteger = __package( packages, id ).BigInteger; // var SecureRandom = __package( packages, id ).SecureRandom; /////////////////////////////////////////// // implementation /////////////////////////////////////////// RSA.prototype.generateAsync = function(keylen,exp,result) { var self=this; var generator = new NS( stepping_generate,true); var _result = function(keyPair) { result( self ); }; generator.EXEC([keylen,exp],_result); /////////////////////////////////////////// // implementation /////////////////////////////////////////// // Generate a new random private key B bits long, using public expt E function stepping_generate (myArgs) { var B,E; B = myArgs[0]; E = myArgs[1]; //var rng = new SecureRandom(); // MODIFIED 2008/12/07 var rng; // var qs = B>>1; var qs = self.splitBitLength( B ); self._e(E); var ee = new BigInteger(self.e); var p1; var q1; var phi; return DO([ // Step1.ver2 function () { RSA.log("RSAEngine:1.1"); self.p = new BigInteger(); rng = new SecureRandom(); }, function () { RSA.log("RSAEngine:1.2"); // return self.p.stepping_fromNumber1( B-qs, 1, rng ).BREAK(); return self.p.stepping_fromNumber1( qs[0], 1, rng ); }, [ // Step1.3 ver3 function () { RSA.log("RSAEngine:1.3.1"); if ( self.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) != 0 ) return AGAIN(); }, function () { RSA.log("RSAEngine:1.3.2 : calling stepping_isProbablePrime"); return self.p.stepping_isProbablePrime(10); }, function (result) { RSA.log("RSAEngine:1.3.3 : returned stepping_isProbablePrime" + result ); if ( result.prime ) { RSA.log("RSAEngine:1.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:1.3.3=>AGAIN"); return AGAIN(); } }, EXIT ], function() { RSA.log("RSAEngine:2.0"); }, // Step2.ver2 [ function() { RSA.log("RSAEngine:2.1"); self.q = new BigInteger(); }, function () { RSA.log("RSAEngine:2.2"); // return self.q.stepping_fromNumber1( qs, 1, rng ).BREAK(); return self.q.stepping_fromNumber1( qs[1], 1, rng ); }, // Step2.3 ver2>>> function () { var result = self.q.subtract( BigInteger.ONE ).gcd( ee ).compareTo( BigInteger.ONE ); RSA.log("RSAEngine:2.3.1 returned from q.stepping_from number with result "+result); if ( result != 0 ) return AGAIN(); }, function() { RSA.log("RSAEngine:2.3.2"); return self.q.stepping_isProbablePrime(10); }, function(result) { RSA.log( "RSAEngine:2.3.3:result="+result.prime ); if ( result.prime ) { RSA.log("RSAEngine:2.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:2.3.3=>AGAIN"); return AGAIN(); } }, // <<< EXIT ], function() { RSA.log("RSAEngine:2.3"); if ( self.p.compareTo(self.q) <= 0 ) { var t = self.p; self.p = self.q; self.q = t; } RSA.log("RSAEngine:3.1"); RSA.log( "p=" + self.p.toString(16) ); RSA.log( "q=" + self.q.toString(16) ); }, // // Step3.2 ver2 >>> function() { RSA.log("RSAEngine:3.2"); /* var */ p1 = self.p.subtract( BigInteger.ONE ); /* var */ q1 = self.q.subtract( BigInteger.ONE ); /* var */ phi = p1.multiply( q1 ); if ( phi.gcd(ee).compareTo( BigInteger.ONE ) == 0 ) { RSA.log("RSAEngine:3.2=>BREAK"); return ; } else { RSA.log("RSAEngine:3.2=>AGAIN"); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.2.sub"); // ADDED 11Dec,2008 Ats >>> // When p and q in a RSA key have the same value, the RSA // key cannot encrypt/decrypt messages correctly. // Check if they have the same value and if so regenerate these value again. // Though rarely do p and q conflict when key length is large enough. // <<< if ( self.p.compareTo( self.q ) ==0 ) { RSA.log("RSAEngine:3.2.sub +++ P & Q ARE EQUAL !!!"); return AGAIN(); } self.n = self.p.multiply( self.q ); // ADDED 2008/12/1 >>> // if ( self.n.bitLength() != B ) { // if ( self.n.bitLength() < B ) { // modified 2009/1/13 if ( ! self.isProperBitLength( self.n, B ) ) { // modified 2009/1/15 RSA.log("RSAEngine:3.3.2.1:AGAIN bitLength="+self.n.bitLength() + " B=" + B ); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.3.1"); RSA.log("RSAEngine:3.3.1(1)"); self.d = ee.modInverse( phi ); RSA.log("RSAEngine:3.3.2(2)"); self._ksize(B); // added Jan15,2009 }, function() { RSA.log("RSAEngine:3.3.2"); self.dmp1 = self.d.mod(p1); self.dmq1 = self.d.mod(q1); }, function() { RSA.log("RSAEngine:3.3.3"); self.coeff = self.q.modInverse(self.p); }, // <<< EXIT ]); } }})(); |
RSA.log( "RSAEngine:2.3.3:result="+result.prime ); if ( result.prime ) { | RSA.log( "RSAEngine:2.3.3:result="+result ); if ( result ) { | (function ( ) { //This file has been reworked to rely on class NS - A Chandler May 2010 /////////////////////////////////////////// // import /////////////////////////////////////////// // var RSA = __package( packages, id ).RSA; // var BigInteger = __package( packages, id ).BigInteger; // var SecureRandom = __package( packages, id ).SecureRandom; /////////////////////////////////////////// // implementation /////////////////////////////////////////// RSA.prototype.generateAsync = function(keylen,exp,result) { var self=this; var generator = new NS( stepping_generate,true); var _result = function(keyPair) { result( self ); }; generator.EXEC([keylen,exp],_result); /////////////////////////////////////////// // implementation /////////////////////////////////////////// // Generate a new random private key B bits long, using public expt E function stepping_generate (myArgs) { var B,E; B = myArgs[0]; E = myArgs[1]; //var rng = new SecureRandom(); // MODIFIED 2008/12/07 var rng; // var qs = B>>1; var qs = self.splitBitLength( B ); self._e(E); var ee = new BigInteger(self.e); var p1; var q1; var phi; return DO([ // Step1.ver2 function () { RSA.log("RSAEngine:1.1"); self.p = new BigInteger(); rng = new SecureRandom(); }, function () { RSA.log("RSAEngine:1.2"); // return self.p.stepping_fromNumber1( B-qs, 1, rng ).BREAK(); return self.p.stepping_fromNumber1( qs[0], 1, rng ); }, [ // Step1.3 ver3 function () { RSA.log("RSAEngine:1.3.1"); if ( self.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) != 0 ) return AGAIN(); }, function () { RSA.log("RSAEngine:1.3.2 : calling stepping_isProbablePrime"); return self.p.stepping_isProbablePrime(10); }, function (result) { RSA.log("RSAEngine:1.3.3 : returned stepping_isProbablePrime" + result ); if ( result.prime ) { RSA.log("RSAEngine:1.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:1.3.3=>AGAIN"); return AGAIN(); } }, EXIT ], function() { RSA.log("RSAEngine:2.0"); }, // Step2.ver2 [ function() { RSA.log("RSAEngine:2.1"); self.q = new BigInteger(); }, function () { RSA.log("RSAEngine:2.2"); // return self.q.stepping_fromNumber1( qs, 1, rng ).BREAK(); return self.q.stepping_fromNumber1( qs[1], 1, rng ); }, // Step2.3 ver2>>> function () { var result = self.q.subtract( BigInteger.ONE ).gcd( ee ).compareTo( BigInteger.ONE ); RSA.log("RSAEngine:2.3.1 returned from q.stepping_from number with result "+result); if ( result != 0 ) return AGAIN(); }, function() { RSA.log("RSAEngine:2.3.2"); return self.q.stepping_isProbablePrime(10); }, function(result) { RSA.log( "RSAEngine:2.3.3:result="+result.prime ); if ( result.prime ) { RSA.log("RSAEngine:2.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:2.3.3=>AGAIN"); return AGAIN(); } }, // <<< EXIT ], function() { RSA.log("RSAEngine:2.3"); if ( self.p.compareTo(self.q) <= 0 ) { var t = self.p; self.p = self.q; self.q = t; } RSA.log("RSAEngine:3.1"); RSA.log( "p=" + self.p.toString(16) ); RSA.log( "q=" + self.q.toString(16) ); }, // // Step3.2 ver2 >>> function() { RSA.log("RSAEngine:3.2"); /* var */ p1 = self.p.subtract( BigInteger.ONE ); /* var */ q1 = self.q.subtract( BigInteger.ONE ); /* var */ phi = p1.multiply( q1 ); if ( phi.gcd(ee).compareTo( BigInteger.ONE ) == 0 ) { RSA.log("RSAEngine:3.2=>BREAK"); return ; } else { RSA.log("RSAEngine:3.2=>AGAIN"); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.2.sub"); // ADDED 11Dec,2008 Ats >>> // When p and q in a RSA key have the same value, the RSA // key cannot encrypt/decrypt messages correctly. // Check if they have the same value and if so regenerate these value again. // Though rarely do p and q conflict when key length is large enough. // <<< if ( self.p.compareTo( self.q ) ==0 ) { RSA.log("RSAEngine:3.2.sub +++ P & Q ARE EQUAL !!!"); return AGAIN(); } self.n = self.p.multiply( self.q ); // ADDED 2008/12/1 >>> // if ( self.n.bitLength() != B ) { // if ( self.n.bitLength() < B ) { // modified 2009/1/13 if ( ! self.isProperBitLength( self.n, B ) ) { // modified 2009/1/15 RSA.log("RSAEngine:3.3.2.1:AGAIN bitLength="+self.n.bitLength() + " B=" + B ); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.3.1"); RSA.log("RSAEngine:3.3.1(1)"); self.d = ee.modInverse( phi ); RSA.log("RSAEngine:3.3.2(2)"); self._ksize(B); // added Jan15,2009 }, function() { RSA.log("RSAEngine:3.3.2"); self.dmp1 = self.d.mod(p1); self.dmq1 = self.d.mod(q1); }, function() { RSA.log("RSAEngine:3.3.3"); self.coeff = self.q.modInverse(self.p); }, // <<< EXIT ]); } }})(); |
$(self).bind(name, fn); | if (fn) { $(self).bind(name, fn); } | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.tooltip = { conf: { // default effect variables effect: 'toggle', fadeOutSpeed: "fast", predelay: 0, delay: 30, opacity: 1, tip: 0, // 'top', 'bottom', 'right', 'left', 'center' position: ['top', 'center'], offset: [0, 0], relative: false, cancelDefault: true, // type to event mapping events: { def: "mouseenter,mouseleave", input: "focus,blur", widget: "focus mouseenter,blur mouseleave", tooltip: "mouseenter,mouseleave" }, // 1.2 layout: '<div/>', tipClass: 'tooltip' }, addEffect: function(name, loadFn, hideFn) { effects[name] = [loadFn, hideFn]; } }; var effects = { toggle: [ function(done) { var conf = this.getConf(), tip = this.getTip(), o = conf.opacity; if (o < 1) { tip.css({opacity: o}); } tip.show(); done.call(); }, function(done) { this.getTip().hide(); done.call(); } ], fade: [ function(done) { var conf = this.getConf(); this.getTip().fadeTo(conf.fadeInSpeed, conf.opacity, done); }, function(done) { this.getTip().fadeOut(this.getConf().fadeOutSpeed, done); } ] }; /* calculate tip position relative to the trigger */ function getPosition(trigger, tip, conf) { // get origin top/left position var top = conf.relative ? trigger.position().top : trigger.offset().top, left = conf.relative ? trigger.position().left : trigger.offset().left, pos = conf.position[0]; top -= tip.outerHeight() - conf.offset[0]; left += trigger.outerWidth() + conf.offset[1]; // adjust Y var height = tip.outerHeight() + trigger.outerHeight(); if (pos == 'center') { top += height / 2; } if (pos == 'bottom') { top += height; } // adjust X pos = conf.position[1]; var width = tip.outerWidth() + trigger.outerWidth(); if (pos == 'center') { left -= width / 2; } if (pos == 'left') { left -= width; } return {top: top, left: left}; } 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; }; }); } // jQuery plugin implementation $.fn.tooltip = function(conf) { // return existing instance var api = this.data("tooltip"); if (api) { return api; } 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; }; }) (jQuery); |
img = overlay.data("img"); | img = overlay.data("img"), position = conf.fixed ? 'fixed' : 'absolute'; | (function($) { // version number var t = $.tools.overlay, w = $(window); // extend global configuragion with effect specific defaults $.extend(t.conf, { start: { top: null, left: null }, fadeInSpeed: 'fast', zIndex: 9999 }); // utility function function getPosition(el) { var p = el.offset(); return { top: p.top + el.height() / 2, left: p.left + el.width() / 2 }; } //{{{ load var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: 'absolute', top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = 'absolute'; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); } // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };//}}} var closeEffect = function(onClose) { // variables var overlay = this.getOverlay().hide(), conf = this.getConf(), trigger = this.getTrigger(), img = overlay.data("img"), css = { top: conf.start.top, left: conf.start.left, width: 0 }; // trigger position if (trigger) { $.extend(css, getPosition(trigger)); } // change from fixed to absolute position if (conf.fixed) { img.css({position: 'absolute'}) .animate({ top: "+=" + w.scrollTop(), left: "+=" + w.scrollLeft()}, 0); } // shrink image img.animate(css, conf.closeSpeed, onClose); }; // add overlay effect t.addEffect("apple", loadEffect, closeEffect); })(jQuery); |
position: 'absolute', | position: position, | (function($) { // version number var t = $.tools.overlay, w = $(window); // extend global configuragion with effect specific defaults $.extend(t.conf, { start: { top: null, left: null }, fadeInSpeed: 'fast', zIndex: 9999 }); // utility function function getPosition(el) { var p = el.offset(); return { top: p.top + el.height() / 2, left: p.left + el.width() / 2 }; } //{{{ load var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: 'absolute', top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = 'absolute'; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); } // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };//}}} var closeEffect = function(onClose) { // variables var overlay = this.getOverlay().hide(), conf = this.getConf(), trigger = this.getTrigger(), img = overlay.data("img"), css = { top: conf.start.top, left: conf.start.left, width: 0 }; // trigger position if (trigger) { $.extend(css, getPosition(trigger)); } // change from fixed to absolute position if (conf.fixed) { img.css({position: 'absolute'}) .animate({ top: "+=" + w.scrollTop(), left: "+=" + w.scrollLeft()}, 0); } // shrink image img.animate(css, conf.closeSpeed, onClose); }; // add overlay effect t.addEffect("apple", loadEffect, closeEffect); })(jQuery); |
pos.position = 'absolute'; | pos.position = position; | (function($) { // version number var t = $.tools.overlay, w = $(window); // extend global configuragion with effect specific defaults $.extend(t.conf, { start: { top: null, left: null }, fadeInSpeed: 'fast', zIndex: 9999 }); // utility function function getPosition(el) { var p = el.offset(); return { top: p.top + el.height() / 2, left: p.left + el.width() / 2 }; } //{{{ load var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: 'absolute', top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = 'absolute'; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); } // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };//}}} var closeEffect = function(onClose) { // variables var overlay = this.getOverlay().hide(), conf = this.getConf(), trigger = this.getTrigger(), img = overlay.data("img"), css = { top: conf.start.top, left: conf.start.left, width: 0 }; // trigger position if (trigger) { $.extend(css, getPosition(trigger)); } // change from fixed to absolute position if (conf.fixed) { img.css({position: 'absolute'}) .animate({ top: "+=" + w.scrollTop(), left: "+=" + w.scrollLeft()}, 0); } // shrink image img.animate(css, conf.closeSpeed, onClose); }; // add overlay effect t.addEffect("apple", loadEffect, closeEffect); })(jQuery); |
width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); } | width: oWidth}, conf.speed, function() { | (function($) { // version number var t = $.tools.overlay, w = $(window); // extend global configuragion with effect specific defaults $.extend(t.conf, { start: { top: null, left: null }, fadeInSpeed: 'fast', zIndex: 9999 }); // utility function function getPosition(el) { var p = el.offset(); return { top: p.top + el.height() / 2, left: p.left + el.width() / 2 }; } //{{{ load var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: 'absolute', top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = 'absolute'; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); } // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };//}}} var closeEffect = function(onClose) { // variables var overlay = this.getOverlay().hide(), conf = this.getConf(), trigger = this.getTrigger(), img = overlay.data("img"), css = { top: conf.start.top, left: conf.start.left, width: 0 }; // trigger position if (trigger) { $.extend(css, getPosition(trigger)); } // change from fixed to absolute position if (conf.fixed) { img.css({position: 'absolute'}) .animate({ top: "+=" + w.scrollTop(), left: "+=" + w.scrollLeft()}, 0); } // shrink image img.animate(css, conf.closeSpeed, onClose); }; // add overlay effect t.addEffect("apple", loadEffect, closeEffect); })(jQuery); |
if (location.hash && conf.tabs === "a" && root.find(conf.tabs + location.hash)) { | if (location.hash && conf.tabs === "a" && root.find(conf.tabs + location.hash).length) { | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.tabs = { conf: { tabs: 'a', current: 'current', onBeforeClick: null, onClick: null, effect: 'default', initialIndex: 0, event: 'click', rotate: false, // 1.2 history: false }, addEffect: function(name, fn) { effects[name] = fn; } }; var effects = { // simple "toggle" effect 'default': function(i, done) { this.getPanes().hide().eq(i).show(); done.call(); }, /* configuration: - fadeOutSpeed (positive value does "crossfading") - fadeInSpeed */ fade: function(i, done) { var conf = this.getConf(), speed = conf.fadeOutSpeed, panes = this.getPanes(); if (speed) { panes.fadeOut(speed); } else { panes.hide(); } panes.eq(i).fadeIn(conf.fadeInSpeed, done); }, // for basic accordions slide: function(i, done) { this.getPanes().slideUp(200); this.getPanes().eq(i).slideDown(400, done); }, /** * AJAX effect */ ajax: function(i, done) { this.getPanes().eq(0).load(this.getTabs().eq(i).attr("href"), done); } }; var w; /** * Horizontal accordion * * @deprecated will be replaced with a more robust implementation */ $.tools.tabs.addEffect("horizontal", function(i, done) { // store original width of a pane into memory if (!w) { w = this.getPanes().eq(0).width(); } // set current pane's width to zero this.getCurrentPane().animate({width: 0}, function() { $(this).hide(); }); // grow opened pane to it's original width this.getPanes().eq(i).animate({width: w}, function() { $(this).show(); done.call(); }); }); function Tabs(root, paneSelector, conf) { var self = this, trigger = root.add(this), tabs = root.find(conf.tabs), panes = paneSelector.jquery ? paneSelector : root.children(paneSelector), current; // make sure tabs and panes are found if (!tabs.length) { tabs = root.children(); } if (!panes.length) { panes = root.parent().find(paneSelector); } if (!panes.length) { panes = $(paneSelector); } // public methods $.extend(this, { click: function(i, e) { var tab = tabs.eq(i); if (typeof i == 'string' && i.replace("#", "")) { tab = tabs.filter("[href*=" + i.replace("#", "") + "]"); i = Math.max(tabs.index(tab), 0); } if (conf.rotate) { var last = tabs.length -1; if (i < 0) { return self.click(last, e); } if (i > last) { return self.click(0, e); } } if (!tab.length) { if (current >= 0) { return self; } i = conf.initialIndex; tab = tabs.eq(i); } // current tab is being clicked if (i === current) { return self; } // possibility to cancel click action e = e || $.Event(); e.type = "onBeforeClick"; trigger.trigger(e, [i]); if (e.isDefaultPrevented()) { return; } // call the effect effects[conf.effect].call(self, i, function() { // onClick callback e.type = "onClick"; trigger.trigger(e, [i]); }); // default behaviour current = i; tabs.removeClass(conf.current); tab.addClass(conf.current); return self; }, getConf: function() { return conf; }, getTabs: function() { return tabs; }, getPanes: function() { return panes; }, getCurrentPane: function() { return panes.eq(current); }, getCurrentTab: function() { return tabs.eq(current); }, getIndex: function() { return current; }, next: function() { return self.click(current + 1); }, prev: function() { return self.click(current - 1); }, destroy: function() { tabs.unbind(conf.event).removeClass(conf.current); panes.find("a[href^=#]").unbind("click.T"); return self; } }); // callbacks $.each("onBeforeClick,onClick".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.history && $.fn.history) { $.tools.history.init(tabs); conf.event = 'history'; } // setup click actions for each tab tabs.each(function(i) { $(this).bind(conf.event, function(e) { self.click(i, e); return e.preventDefault(); }); }); // cross tab anchor link panes.find("a[href^=#]").bind("click.T", function(e) { self.click($(this).attr("href"), e); }); // open initial tab if (location.hash && conf.tabs === "a" && root.find(conf.tabs + location.hash)) { self.click(location.hash); } else { if (conf.initialIndex === 0 || conf.initialIndex > 0) { self.click(conf.initialIndex); } } } // jQuery plugin implementation $.fn.tabs = function(paneSelector, conf) { // return existing instance var el = this.data("tabs"); if (el) { el.destroy(); this.removeData("tabs"); } if ($.isFunction(conf)) { conf = {onBeforeClick: conf}; } // setup conf conf = $.extend({}, $.tools.tabs.conf, conf); this.each(function() { el = new Tabs($(this), paneSelector, conf); $(this).data("tabs", el); }); return conf.api ? el: this; }; }) (jQuery); |
CKEDITOR.dialog.add('specialchar',function(a){var b,c=a.lang.specialChar,d=function(k){var l=a.getSelection(),m=l.getRanges(),n,o;a.fire('saveSnapshot');for(var p=0,q=m.length;p<q;p++){n=m[p];n.deleteContents();o=CKEDITOR.dom.element.createFromHtml(k);n.insertNode(o);}n.moveToPosition(o,CKEDITOR.POSITION_AFTER_END);n.select();a.fire('saveSnapshot');},e=function(k){var l,m;if(k.data)l=k.data.getTarget();else l=new CKEDITOR.dom.element(k);if(l.getName()=='a'&&(m=l.getChild(0).getHtml())){l.removeClass('cke_light_background');b.hide();if(CKEDITOR.env.gecko)d(m);else a.insertHtml(m);}},f=CKEDITOR.tools.addFunction(e),g,h=function(k,l){var m;l=l||k.data.getTarget();if(l.getName()=='span')l=l.getParent();if(l.getName()=='a'&&(m=l.getChild(0).getHtml())){if(g)i(null,g);var n=b.getContentElement('info','htmlPreview').getElement();b.getContentElement('info','charPreview').getElement().setHtml(m);n.setHtml(CKEDITOR.tools.htmlEncode(m));l.getParent().addClass('cke_light_background');g=l;}},i=function(k,l){l=l||k.data.getTarget();if(l.getName()=='span')l=l.getParent();if(l.getName()=='a'){b.getContentElement('info','charPreview').getElement().setHtml(' ');b.getContentElement('info','htmlPreview').getElement().setHtml(' ');l.getParent().removeClass('cke_light_background');g=undefined;}},j=CKEDITOR.tools.addFunction(function(k){k=new CKEDITOR.dom.event(k);var l=k.getTarget(),m,n,o=k.getKeystroke(),p=a.lang.dir=='rtl';switch(o){case 38:if(m=l.getParent().getParent().getPrevious()){n=m.getChild([l.getParent().getIndex(),0]);n.focus();i(null,l);h(null,n);}k.preventDefault();break;case 40:if(m=l.getParent().getParent().getNext()){n=m.getChild([l.getParent().getIndex(),0]);if(n&&n.type==1){n.focus();i(null,l);h(null,n);}}k.preventDefault();break;case 32:e({data:k});k.preventDefault();break;case p?37:39:case 9:if(m=l.getParent().getNext()){n=m.getChild(0);if(n.type==1){n.focus();i(null,l);h(null,n);k.preventDefault(true);}else i(null,l);}else if(m=l.getParent().getParent().getNext()){n=m.getChild([0,0]);if(n&&n.type==1){n.focus();i(null,l);h(null,n);k.preventDefault(true);}else i(null,l);}break;case p?39:37:case CKEDITOR.SHIFT+9:if(m=l.getParent().getPrevious()){n=m.getChild(0);n.focus();i(null,l);h(null,n);k.preventDefault(true);}else if(m=l.getParent().getParent().getPrevious()){n=m.getLast().getChild(0);n.focus();i(null,l);h(null,n);k.preventDefault(true);}else i(null,l);break;default:return;}});return{title:c.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,chars:['!','"','#','$','%','&',"'",'(',')','*','+','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','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','[',']','^','_','`','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','{','|','}','~','€(EURO SIGN)','‘(LEFT SINGLE QUOTATION MARK)','’(RIGHT SINGLE QUOTATION MARK)','“(LEFT DOUBLE QUOTATION MARK)','”(RIGHT DOUBLE QUOTATION MARK)','–(EN DASH)','—(EM DASH)','¡(INVERTED EXCLAMATION MARK)','¢(CENT SIGN)','£(POUND SIGN)','¤(CURRENCY SIGN)','¥(YEN SIGN)','¦(BROKEN BAR)','§(SECTION SIGN)','¨(DIAERESIS)','©(COPYRIGHT SIGN)','ª(FEMININE ORDINAL INDICATOR)','«(LEFT-POINTING DOUBLE ANGLE QUOTATION MARK)','¬(NOT SIGN)','®(REGISTERED SIGN)','¯(MACRON)','°(DEGREE SIGN)','±(PLUS-MINUS SIGN)','²(SUPERSCRIPT TWO)','³(SUPERSCRIPT THREE)','´(ACUTE ACCENT)','µ(MICRO SIGN)','¶(PILCROW SIGN)','·(MIDDLE DOT)','¸(CEDILLA)','¹(SUPERSCRIPT ONE)','º(MASCULINE ORDINAL INDICATOR)','»(RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK)','¼(VULGAR FRACTION ONE QUARTER)','½(VULGAR FRACTION ONE HALF)','¾(VULGAR FRACTION THREE QUARTERS)','¿(INVERTED QUESTION MARK)','À(LATIN CAPITAL LETTER A WITH GRAVE)','Á(LATIN CAPITAL LETTER A WITH ACUTE)','Â(LATIN CAPITAL LETTER A WITH CIRCUMFLEX)','Ã(LATIN CAPITAL LETTER A WITH TILDE)','Ä(LATIN CAPITAL LETTER A WITH DIAERESIS)','Å(LATIN CAPITAL LETTER A WITH RING ABOVE)','Æ(LATIN CAPITAL LETTER AE)','Ç(LATIN CAPITAL LETTER C WITH CEDILLA)','È(LATIN CAPITAL LETTER E WITH GRAVE)','É(LATIN CAPITAL LETTER E WITH ACUTE)','Ê(LATIN CAPITAL LETTER E WITH CIRCUMFLEX)','Ë(LATIN CAPITAL LETTER E WITH DIAERESIS)','Ì(LATIN CAPITAL LETTER I WITH GRAVE)','Í(LATIN CAPITAL LETTER I WITH ACUTE)','Î(LATIN CAPITAL LETTER I WITH CIRCUMFLEX)','Ï(LATIN CAPITAL LETTER I WITH DIAERESIS)','Ð(LATIN CAPITAL LETTER ETH)','Ñ(LATIN CAPITAL LETTER N WITH TILDE)','Ò(LATIN CAPITAL LETTER O WITH GRAVE)','Ó(LATIN CAPITAL LETTER O WITH ACUTE)','Ô(LATIN CAPITAL LETTER O WITH CIRCUMFLEX)','Õ(LATIN CAPITAL LETTER O WITH TILDE)','Ö(LATIN CAPITAL LETTER O WITH DIAERESIS)','×(MULTIPLICATION SIGN)','Ø(LATIN CAPITAL LETTER O WITH STROKE)','Ù(LATIN CAPITAL LETTER U WITH GRAVE)','Ú(LATIN CAPITAL LETTER U WITH ACUTE)','Û(LATIN CAPITAL LETTER U WITH CIRCUMFLEX)','Ü(LATIN CAPITAL LETTER U WITH DIAERESIS)','Ý(LATIN CAPITAL LETTER Y WITH ACUTE)','Þ(LATIN CAPITAL LETTER THORN)','ß(LATIN SMALL LETTER SHARP S)','à(LATIN SMALL LETTER A WITH GRAVE)','á(LATIN SMALL LETTER A WITH ACUTE)','â(LATIN SMALL LETTER A WITH CIRCUMFLEX)','ã(LATIN SMALL LETTER A WITH TILDE)','ä(LATIN SMALL LETTER A WITH DIAERESIS)','å(LATIN SMALL LETTER A WITH RING ABOVE)','æ(LATIN SMALL LETTER AE)','ç(LATIN SMALL LETTER C WITH CEDILLA)','è(LATIN SMALL LETTER E WITH GRAVE)','é(LATIN SMALL LETTER E WITH ACUTE)','ê(LATIN SMALL LETTER E WITH CIRCUMFLEX)','ë(LATIN SMALL LETTER E WITH DIAERESIS)','ì(LATIN SMALL LETTER I WITH GRAVE)','í(LATIN SMALL LETTER I WITH ACUTE)','î(LATIN SMALL LETTER I WITH CIRCUMFLEX)','ï(LATIN SMALL LETTER I WITH DIAERESIS)','ð(LATIN SMALL LETTER ETH)','ñ(LATIN SMALL LETTER N WITH TILDE)','ò(LATIN SMALL LETTER O WITH GRAVE)','ó(LATIN SMALL LETTER O WITH ACUTE)','ô(LATIN SMALL LETTER O WITH CIRCUMFLEX)','õ(LATIN SMALL LETTER O WITH TILDE)','ö(LATIN SMALL LETTER O WITH DIAERESIS)','÷(DIVISION SIGN)','ø(LATIN SMALL LETTER O WITH STROKE)','ù(LATIN SMALL LETTER U WITH GRAVE)','ú(LATIN SMALL LETTER U WITH ACUTE)','û(LATIN SMALL LETTER U WITH CIRCUMFLEX)','ü(LATIN SMALL LETTER U WITH DIAERESIS)','ü(LATIN SMALL LETTER U WITH DIAERESIS)','ý(LATIN SMALL LETTER Y WITH ACUTE)','þ(LATIN SMALL LETTER THORN)','ÿ(LATIN SMALL LETTER Y WITH DIAERESIS)','Œ(LATIN CAPITAL LIGATURE OE)','œ(LATIN SMALL LIGATURE OE)','Ŵ(LATIN CAPITAL LETTER W WITH CIRCUMFLEX)','Ŷ(LATIN CAPITAL LETTER Y WITH CIRCUMFLEX)','ŵ(LATIN SMALL LETTER W WITH CIRCUMFLEX)','ŷ(LATIN SMALL LETTER Y WITH CIRCUMFLEX)','‚(SINGLE LOW-9 QUOTATION MARK)','‛(SINGLE HIGH-REVERSED-9 QUOTATION MARK)','„(DOUBLE LOW-9 QUOTATION MARK)','…(HORIZONTAL ELLIPSIS)','™(TRADE MARK SIGN)','►(BLACK RIGHT-POINTING POINTER)','•(BULLET)','→(RIGHTWARDS ARROW)','⇒(RIGHTWARDS DOUBLE ARROW)','⇔(LEFT RIGHT DOUBLE ARROW)','♦(BLACK DIAMOND SUIT)','≈(ALMOST EQUAL TO)'],onLoad:function(){var k=this.definition.charColumns,l=this.definition.chars,m=['<table role="listbox" aria-labelledby="specialchar_table_label" style="width: 320px; height: 100%; border-collapse: separate;" align="center" cellspacing="2" cellpadding="2" border="0">'],n=0,o=l.length,p,q; while(n<o){m.push('<tr>');for(var r=0;r<k;r++,n++){if(p=l[n]){q='';p=p.replace(/\((.*?)\)/,function(s,t){q=t;return '';});q=q||p;m.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(n+1)+'"',' aria-setsize="'+o+'"',' aria-labelledby="cke_specialchar_label_'+n+'"',' style="cursor: inherit; display: block; height: 1.25em; margin-top: 0.25em; text-align: center;" title="',CKEDITOR.tools.htmlEncode(q),'" onkeydown="CKEDITOR.tools.callFunction( '+j+', event, this )"'+' onclick="CKEDITOR.tools.callFunction('+f+', this); return false;"'+' tabindex="-1">'+'<span style="margin: 0 auto;cursor: inherit">'+p+'</span>'+'<span class="cke_voice_label" id="cke_specialchar_label_'+n+'">'+q+'</span></a>');}else m.push('<td class="cke_dark_background"> ');m.push('</td>');}m.push('</tr>');}m.push('</tbody></table>','<span id="specialchar_table_label" class="cke_voice_label">'+c.options+'</span>');this.getContentElement('info','charContainer').getElement().setHtml(m.join(''));},contents:[{id:'info',label:a.lang.common.generalTab,title:a.lang.common.generalTab,padding:0,align:'top',elements:[{type:'hbox',align:'top',widths:['320px','90px'],children:[{type:'html',id:'charContainer',html:'',onMouseover:h,onMouseout:i,focus:function(){var k=this.getElement().getElementsByTag('a').getItem(0);setTimeout(function(){k.focus();h(null,k);});},onShow:function(){var k=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){k.focus();h(null,k);});},onLoad:function(k){b=k.sender;}},{type:'hbox',align:'top',widths:['100%'],children:[{type:'vbox',align:'top',children:[{type:'html',html:'<div></div>'},{type:'html',id:'charPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div> </div>'},{type:'html',id:'htmlPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div> </div>'}]}]}]}]}]};}); | CKEDITOR.dialog.add('specialchar',function(a){var b,c=a.lang.specialChar,d=function(k){var l=a.getSelection(),m=l.getRanges(true),n,o;a.fire('saveSnapshot');for(var p=m.length-1;p>=0;p--){n=m[p];n.deleteContents();o=CKEDITOR.dom.element.createFromHtml(k);n.insertNode(o);}if(n){n.moveToPosition(o,CKEDITOR.POSITION_AFTER_END);n.select();}a.fire('saveSnapshot');},e=function(k){var l,m;if(k.data)l=k.data.getTarget();else l=new CKEDITOR.dom.element(k);if(l.getName()=='a'&&(m=l.getChild(0).getHtml())){l.removeClass('cke_light_background');b.hide();if(CKEDITOR.env.gecko)d(m);else a.insertHtml(m);}},f=CKEDITOR.tools.addFunction(e),g,h=function(k,l){var m;l=l||k.data.getTarget();if(l.getName()=='span')l=l.getParent();if(l.getName()=='a'&&(m=l.getChild(0).getHtml())){if(g)i(null,g);var n=b.getContentElement('info','htmlPreview').getElement();b.getContentElement('info','charPreview').getElement().setHtml(m);n.setHtml(CKEDITOR.tools.htmlEncode(m));l.getParent().addClass('cke_light_background');g=l;}},i=function(k,l){l=l||k.data.getTarget();if(l.getName()=='span')l=l.getParent();if(l.getName()=='a'){b.getContentElement('info','charPreview').getElement().setHtml(' ');b.getContentElement('info','htmlPreview').getElement().setHtml(' ');l.getParent().removeClass('cke_light_background');g=undefined;}},j=CKEDITOR.tools.addFunction(function(k){k=new CKEDITOR.dom.event(k);var l=k.getTarget(),m,n,o=k.getKeystroke(),p=a.lang.dir=='rtl';switch(o){case 38:if(m=l.getParent().getParent().getPrevious()){n=m.getChild([l.getParent().getIndex(),0]);n.focus();i(null,l);h(null,n);}k.preventDefault();break;case 40:if(m=l.getParent().getParent().getNext()){n=m.getChild([l.getParent().getIndex(),0]);if(n&&n.type==1){n.focus();i(null,l);h(null,n);}}k.preventDefault();break;case 32:e({data:k});k.preventDefault();break;case p?37:39:case 9:if(m=l.getParent().getNext()){n=m.getChild(0);if(n.type==1){n.focus();i(null,l);h(null,n);k.preventDefault(true);}else i(null,l);}else if(m=l.getParent().getParent().getNext()){n=m.getChild([0,0]);if(n&&n.type==1){n.focus();i(null,l);h(null,n);k.preventDefault(true);}else i(null,l);}break;case p?39:37:case CKEDITOR.SHIFT+9:if(m=l.getParent().getPrevious()){n=m.getChild(0);n.focus();i(null,l);h(null,n);k.preventDefault(true);}else if(m=l.getParent().getParent().getPrevious()){n=m.getLast().getChild(0);n.focus();i(null,l);h(null,n);k.preventDefault(true);}else i(null,l);break;default:return;}});return{title:c.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,chars:['!','"','#','$','%','&',"'",'(',')','*','+','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','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','[',']','^','_','`','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','{','|','}','~','€(EURO SIGN)','‘(LEFT SINGLE QUOTATION MARK)','’(RIGHT SINGLE QUOTATION MARK)','“(LEFT DOUBLE QUOTATION MARK)','”(RIGHT DOUBLE QUOTATION MARK)','–(EN DASH)','—(EM DASH)','¡(INVERTED EXCLAMATION MARK)','¢(CENT SIGN)','£(POUND SIGN)','¤(CURRENCY SIGN)','¥(YEN SIGN)','¦(BROKEN BAR)','§(SECTION SIGN)','¨(DIAERESIS)','©(COPYRIGHT SIGN)','ª(FEMININE ORDINAL INDICATOR)','«(LEFT-POINTING DOUBLE ANGLE QUOTATION MARK)','¬(NOT SIGN)','®(REGISTERED SIGN)','¯(MACRON)','°(DEGREE SIGN)','±(PLUS-MINUS SIGN)','²(SUPERSCRIPT TWO)','³(SUPERSCRIPT THREE)','´(ACUTE ACCENT)','µ(MICRO SIGN)','¶(PILCROW SIGN)','·(MIDDLE DOT)','¸(CEDILLA)','¹(SUPERSCRIPT ONE)','º(MASCULINE ORDINAL INDICATOR)','»(RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK)','¼(VULGAR FRACTION ONE QUARTER)','½(VULGAR FRACTION ONE HALF)','¾(VULGAR FRACTION THREE QUARTERS)','¿(INVERTED QUESTION MARK)','À(LATIN CAPITAL LETTER A WITH GRAVE)','Á(LATIN CAPITAL LETTER A WITH ACUTE)','Â(LATIN CAPITAL LETTER A WITH CIRCUMFLEX)','Ã(LATIN CAPITAL LETTER A WITH TILDE)','Ä(LATIN CAPITAL LETTER A WITH DIAERESIS)','Å(LATIN CAPITAL LETTER A WITH RING ABOVE)','Æ(LATIN CAPITAL LETTER AE)','Ç(LATIN CAPITAL LETTER C WITH CEDILLA)','È(LATIN CAPITAL LETTER E WITH GRAVE)','É(LATIN CAPITAL LETTER E WITH ACUTE)','Ê(LATIN CAPITAL LETTER E WITH CIRCUMFLEX)','Ë(LATIN CAPITAL LETTER E WITH DIAERESIS)','Ì(LATIN CAPITAL LETTER I WITH GRAVE)','Í(LATIN CAPITAL LETTER I WITH ACUTE)','Î(LATIN CAPITAL LETTER I WITH CIRCUMFLEX)','Ï(LATIN CAPITAL LETTER I WITH DIAERESIS)','Ð(LATIN CAPITAL LETTER ETH)','Ñ(LATIN CAPITAL LETTER N WITH TILDE)','Ò(LATIN CAPITAL LETTER O WITH GRAVE)','Ó(LATIN CAPITAL LETTER O WITH ACUTE)','Ô(LATIN CAPITAL LETTER O WITH CIRCUMFLEX)','Õ(LATIN CAPITAL LETTER O WITH TILDE)','Ö(LATIN CAPITAL LETTER O WITH DIAERESIS)','×(MULTIPLICATION SIGN)','Ø(LATIN CAPITAL LETTER O WITH STROKE)','Ù(LATIN CAPITAL LETTER U WITH GRAVE)','Ú(LATIN CAPITAL LETTER U WITH ACUTE)','Û(LATIN CAPITAL LETTER U WITH CIRCUMFLEX)','Ü(LATIN CAPITAL LETTER U WITH DIAERESIS)','Ý(LATIN CAPITAL LETTER Y WITH ACUTE)','Þ(LATIN CAPITAL LETTER THORN)','ß(LATIN SMALL LETTER SHARP S)','à(LATIN SMALL LETTER A WITH GRAVE)','á(LATIN SMALL LETTER A WITH ACUTE)','â(LATIN SMALL LETTER A WITH CIRCUMFLEX)','ã(LATIN SMALL LETTER A WITH TILDE)','ä(LATIN SMALL LETTER A WITH DIAERESIS)','å(LATIN SMALL LETTER A WITH RING ABOVE)','æ(LATIN SMALL LETTER AE)','ç(LATIN SMALL LETTER C WITH CEDILLA)','è(LATIN SMALL LETTER E WITH GRAVE)','é(LATIN SMALL LETTER E WITH ACUTE)','ê(LATIN SMALL LETTER E WITH CIRCUMFLEX)','ë(LATIN SMALL LETTER E WITH DIAERESIS)','ì(LATIN SMALL LETTER I WITH GRAVE)','í(LATIN SMALL LETTER I WITH ACUTE)','î(LATIN SMALL LETTER I WITH CIRCUMFLEX)','ï(LATIN SMALL LETTER I WITH DIAERESIS)','ð(LATIN SMALL LETTER ETH)','ñ(LATIN SMALL LETTER N WITH TILDE)','ò(LATIN SMALL LETTER O WITH GRAVE)','ó(LATIN SMALL LETTER O WITH ACUTE)','ô(LATIN SMALL LETTER O WITH CIRCUMFLEX)','õ(LATIN SMALL LETTER O WITH TILDE)','ö(LATIN SMALL LETTER O WITH DIAERESIS)','÷(DIVISION SIGN)','ø(LATIN SMALL LETTER O WITH STROKE)','ù(LATIN SMALL LETTER U WITH GRAVE)','ú(LATIN SMALL LETTER U WITH ACUTE)','û(LATIN SMALL LETTER U WITH CIRCUMFLEX)','ü(LATIN SMALL LETTER U WITH DIAERESIS)','ü(LATIN SMALL LETTER U WITH DIAERESIS)','ý(LATIN SMALL LETTER Y WITH ACUTE)','þ(LATIN SMALL LETTER THORN)','ÿ(LATIN SMALL LETTER Y WITH DIAERESIS)','Œ(LATIN CAPITAL LIGATURE OE)','œ(LATIN SMALL LIGATURE OE)','Ŵ(LATIN CAPITAL LETTER W WITH CIRCUMFLEX)','Ŷ(LATIN CAPITAL LETTER Y WITH CIRCUMFLEX)','ŵ(LATIN SMALL LETTER W WITH CIRCUMFLEX)','ŷ(LATIN SMALL LETTER Y WITH CIRCUMFLEX)','‚(SINGLE LOW-9 QUOTATION MARK)','‛(SINGLE HIGH-REVERSED-9 QUOTATION MARK)','„(DOUBLE LOW-9 QUOTATION MARK)','…(HORIZONTAL ELLIPSIS)','™(TRADE MARK SIGN)','►(BLACK RIGHT-POINTING POINTER)','•(BULLET)','→(RIGHTWARDS ARROW)','⇒(RIGHTWARDS DOUBLE ARROW)','⇔(LEFT RIGHT DOUBLE ARROW)','♦(BLACK DIAMOND SUIT)','≈(ALMOST EQUAL TO)'],onLoad:function(){var k=this.definition.charColumns,l=this.definition.chars,m=CKEDITOR.tools.getNextId()+'_specialchar_table_label',n=['<table role="listbox" aria-labelledby="'+m+'"'+' style="width: 320px; height: 100%; border-collapse: separate;"'+' align="center" cellspacing="2" cellpadding="2" border="0">'],o=0,p=l.length,q,r; while(o<p){n.push('<tr>');for(var s=0;s<k;s++,o++){if(q=l[o]){r='';q=q.replace(/\((.*?)\)/,function(u,v){r=v;return '';});r=r||q;var t='cke_specialchar_label_'+o+'_'+CKEDITOR.tools.getNextNumber();n.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(o+1)+'"',' aria-setsize="'+p+'"',' aria-labelledby="'+t+'"',' style="cursor: inherit; display: block; height: 1.25em; margin-top: 0.25em; text-align: center;" title="',CKEDITOR.tools.htmlEncode(r),'" onkeydown="CKEDITOR.tools.callFunction( '+j+', event, this )"'+' onclick="CKEDITOR.tools.callFunction('+f+', this); return false;"'+' tabindex="-1">'+'<span style="margin: 0 auto;cursor: inherit">'+q+'</span>'+'<span class="cke_voice_label" id="'+t+'">'+r+'</span></a>');}else n.push('<td class="cke_dark_background"> ');n.push('</td>');}n.push('</tr>');}n.push('</tbody></table>','<span id="'+m+'" class="cke_voice_label">'+c.options+'</span>');this.getContentElement('info','charContainer').getElement().setHtml(n.join(''));},contents:[{id:'info',label:a.lang.common.generalTab,title:a.lang.common.generalTab,padding:0,align:'top',elements:[{type:'hbox',align:'top',widths:['320px','90px'],children:[{type:'html',id:'charContainer',html:'',onMouseover:h,onMouseout:i,focus:function(){var k=this.getElement().getElementsByTag('a').getItem(0);setTimeout(function(){k.focus();h(null,k);},0);},onShow:function(){var k=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){k.focus();h(null,k);},0);},onLoad:function(k){b=k.sender;}},{type:'hbox',align:'top',widths:['100%'],children:[{type:'vbox',align:'top',children:[{type:'html',html:'<div></div>'},{type:'html',id:'charPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div> </div>'},{type:'html',id:'htmlPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div> </div>'}]}]}]}]}]};}); | CKEDITOR.dialog.add('specialchar',function(a){var b,c=a.lang.specialChar,d=function(k){var l=a.getSelection(),m=l.getRanges(),n,o;a.fire('saveSnapshot');for(var p=0,q=m.length;p<q;p++){n=m[p];n.deleteContents();o=CKEDITOR.dom.element.createFromHtml(k);n.insertNode(o);}n.moveToPosition(o,CKEDITOR.POSITION_AFTER_END);n.select();a.fire('saveSnapshot');},e=function(k){var l,m;if(k.data)l=k.data.getTarget();else l=new CKEDITOR.dom.element(k);if(l.getName()=='a'&&(m=l.getChild(0).getHtml())){l.removeClass('cke_light_background');b.hide();if(CKEDITOR.env.gecko)d(m);else a.insertHtml(m);}},f=CKEDITOR.tools.addFunction(e),g,h=function(k,l){var m;l=l||k.data.getTarget();if(l.getName()=='span')l=l.getParent();if(l.getName()=='a'&&(m=l.getChild(0).getHtml())){if(g)i(null,g);var n=b.getContentElement('info','htmlPreview').getElement();b.getContentElement('info','charPreview').getElement().setHtml(m);n.setHtml(CKEDITOR.tools.htmlEncode(m));l.getParent().addClass('cke_light_background');g=l;}},i=function(k,l){l=l||k.data.getTarget();if(l.getName()=='span')l=l.getParent();if(l.getName()=='a'){b.getContentElement('info','charPreview').getElement().setHtml(' ');b.getContentElement('info','htmlPreview').getElement().setHtml(' ');l.getParent().removeClass('cke_light_background');g=undefined;}},j=CKEDITOR.tools.addFunction(function(k){k=new CKEDITOR.dom.event(k);var l=k.getTarget(),m,n,o=k.getKeystroke(),p=a.lang.dir=='rtl';switch(o){case 38:if(m=l.getParent().getParent().getPrevious()){n=m.getChild([l.getParent().getIndex(),0]);n.focus();i(null,l);h(null,n);}k.preventDefault();break;case 40:if(m=l.getParent().getParent().getNext()){n=m.getChild([l.getParent().getIndex(),0]);if(n&&n.type==1){n.focus();i(null,l);h(null,n);}}k.preventDefault();break;case 32:e({data:k});k.preventDefault();break;case p?37:39:case 9:if(m=l.getParent().getNext()){n=m.getChild(0);if(n.type==1){n.focus();i(null,l);h(null,n);k.preventDefault(true);}else i(null,l);}else if(m=l.getParent().getParent().getNext()){n=m.getChild([0,0]);if(n&&n.type==1){n.focus();i(null,l);h(null,n);k.preventDefault(true);}else i(null,l);}break;case p?39:37:case CKEDITOR.SHIFT+9:if(m=l.getParent().getPrevious()){n=m.getChild(0);n.focus();i(null,l);h(null,n);k.preventDefault(true);}else if(m=l.getParent().getParent().getPrevious()){n=m.getLast().getChild(0);n.focus();i(null,l);h(null,n);k.preventDefault(true);}else i(null,l);break;default:return;}});return{title:c.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,chars:['!','"','#','$','%','&',"'",'(',')','*','+','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','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','[',']','^','_','`','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','{','|','}','~','€(EURO SIGN)','‘(LEFT SINGLE QUOTATION MARK)','’(RIGHT SINGLE QUOTATION MARK)','“(LEFT DOUBLE QUOTATION MARK)','”(RIGHT DOUBLE QUOTATION MARK)','–(EN DASH)','—(EM DASH)','¡(INVERTED EXCLAMATION MARK)','¢(CENT SIGN)','£(POUND SIGN)','¤(CURRENCY SIGN)','¥(YEN SIGN)','¦(BROKEN BAR)','§(SECTION SIGN)','¨(DIAERESIS)','©(COPYRIGHT SIGN)','ª(FEMININE ORDINAL INDICATOR)','«(LEFT-POINTING DOUBLE ANGLE QUOTATION MARK)','¬(NOT SIGN)','®(REGISTERED SIGN)','¯(MACRON)','°(DEGREE SIGN)','±(PLUS-MINUS SIGN)','²(SUPERSCRIPT TWO)','³(SUPERSCRIPT THREE)','´(ACUTE ACCENT)','µ(MICRO SIGN)','¶(PILCROW SIGN)','·(MIDDLE DOT)','¸(CEDILLA)','¹(SUPERSCRIPT ONE)','º(MASCULINE ORDINAL INDICATOR)','»(RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK)','¼(VULGAR FRACTION ONE QUARTER)','½(VULGAR FRACTION ONE HALF)','¾(VULGAR FRACTION THREE QUARTERS)','¿(INVERTED QUESTION MARK)','À(LATIN CAPITAL LETTER A WITH GRAVE)','Á(LATIN CAPITAL LETTER A WITH ACUTE)','Â(LATIN CAPITAL LETTER A WITH CIRCUMFLEX)','Ã(LATIN CAPITAL LETTER A WITH TILDE)','Ä(LATIN CAPITAL LETTER A WITH DIAERESIS)','Å(LATIN CAPITAL LETTER A WITH RING ABOVE)','Æ(LATIN CAPITAL LETTER AE)','Ç(LATIN CAPITAL LETTER C WITH CEDILLA)','È(LATIN CAPITAL LETTER E WITH GRAVE)','É(LATIN CAPITAL LETTER E WITH ACUTE)','Ê(LATIN CAPITAL LETTER E WITH CIRCUMFLEX)','Ë(LATIN CAPITAL LETTER E WITH DIAERESIS)','Ì(LATIN CAPITAL LETTER I WITH GRAVE)','Í(LATIN CAPITAL LETTER I WITH ACUTE)','Î(LATIN CAPITAL LETTER I WITH CIRCUMFLEX)','Ï(LATIN CAPITAL LETTER I WITH DIAERESIS)','Ð(LATIN CAPITAL LETTER ETH)','Ñ(LATIN CAPITAL LETTER N WITH TILDE)','Ò(LATIN CAPITAL LETTER O WITH GRAVE)','Ó(LATIN CAPITAL LETTER O WITH ACUTE)','Ô(LATIN CAPITAL LETTER O WITH CIRCUMFLEX)','Õ(LATIN CAPITAL LETTER O WITH TILDE)','Ö(LATIN CAPITAL LETTER O WITH DIAERESIS)','×(MULTIPLICATION SIGN)','Ø(LATIN CAPITAL LETTER O WITH STROKE)','Ù(LATIN CAPITAL LETTER U WITH GRAVE)','Ú(LATIN CAPITAL LETTER U WITH ACUTE)','Û(LATIN CAPITAL LETTER U WITH CIRCUMFLEX)','Ü(LATIN CAPITAL LETTER U WITH DIAERESIS)','Ý(LATIN CAPITAL LETTER Y WITH ACUTE)','Þ(LATIN CAPITAL LETTER THORN)','ß(LATIN SMALL LETTER SHARP S)','à(LATIN SMALL LETTER A WITH GRAVE)','á(LATIN SMALL LETTER A WITH ACUTE)','â(LATIN SMALL LETTER A WITH CIRCUMFLEX)','ã(LATIN SMALL LETTER A WITH TILDE)','ä(LATIN SMALL LETTER A WITH DIAERESIS)','å(LATIN SMALL LETTER A WITH RING ABOVE)','æ(LATIN SMALL LETTER AE)','ç(LATIN SMALL LETTER C WITH CEDILLA)','è(LATIN SMALL LETTER E WITH GRAVE)','é(LATIN SMALL LETTER E WITH ACUTE)','ê(LATIN SMALL LETTER E WITH CIRCUMFLEX)','ë(LATIN SMALL LETTER E WITH DIAERESIS)','ì(LATIN SMALL LETTER I WITH GRAVE)','í(LATIN SMALL LETTER I WITH ACUTE)','î(LATIN SMALL LETTER I WITH CIRCUMFLEX)','ï(LATIN SMALL LETTER I WITH DIAERESIS)','ð(LATIN SMALL LETTER ETH)','ñ(LATIN SMALL LETTER N WITH TILDE)','ò(LATIN SMALL LETTER O WITH GRAVE)','ó(LATIN SMALL LETTER O WITH ACUTE)','ô(LATIN SMALL LETTER O WITH CIRCUMFLEX)','õ(LATIN SMALL LETTER O WITH TILDE)','ö(LATIN SMALL LETTER O WITH DIAERESIS)','÷(DIVISION SIGN)','ø(LATIN SMALL LETTER O WITH STROKE)','ù(LATIN SMALL LETTER U WITH GRAVE)','ú(LATIN SMALL LETTER U WITH ACUTE)','û(LATIN SMALL LETTER U WITH CIRCUMFLEX)','ü(LATIN SMALL LETTER U WITH DIAERESIS)','ü(LATIN SMALL LETTER U WITH DIAERESIS)','ý(LATIN SMALL LETTER Y WITH ACUTE)','þ(LATIN SMALL LETTER THORN)','ÿ(LATIN SMALL LETTER Y WITH DIAERESIS)','Œ(LATIN CAPITAL LIGATURE OE)','œ(LATIN SMALL LIGATURE OE)','Ŵ(LATIN CAPITAL LETTER W WITH CIRCUMFLEX)','Ŷ(LATIN CAPITAL LETTER Y WITH CIRCUMFLEX)','ŵ(LATIN SMALL LETTER W WITH CIRCUMFLEX)','ŷ(LATIN SMALL LETTER Y WITH CIRCUMFLEX)','‚(SINGLE LOW-9 QUOTATION MARK)','‛(SINGLE HIGH-REVERSED-9 QUOTATION MARK)','„(DOUBLE LOW-9 QUOTATION MARK)','…(HORIZONTAL ELLIPSIS)','™(TRADE MARK SIGN)','►(BLACK RIGHT-POINTING POINTER)','•(BULLET)','→(RIGHTWARDS ARROW)','⇒(RIGHTWARDS DOUBLE ARROW)','⇔(LEFT RIGHT DOUBLE ARROW)','♦(BLACK DIAMOND SUIT)','≈(ALMOST EQUAL TO)'],onLoad:function(){var k=this.definition.charColumns,l=this.definition.chars,m=['<table role="listbox" aria-labelledby="specialchar_table_label" style="width: 320px; height: 100%; border-collapse: separate;" align="center" cellspacing="2" cellpadding="2" border="0">'],n=0,o=l.length,p,q;while(n<o){m.push('<tr>');for(var r=0;r<k;r++,n++){if(p=l[n]){q='';p=p.replace(/\((.*?)\)/,function(s,t){q=t;return '';});q=q||p;m.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(n+1)+'"',' aria-setsize="'+o+'"',' aria-labelledby="cke_specialchar_label_'+n+'"',' style="cursor: inherit; display: block; height: 1.25em; margin-top: 0.25em; text-align: center;" title="',CKEDITOR.tools.htmlEncode(q),'" onkeydown="CKEDITOR.tools.callFunction( '+j+', event, this )"'+' onclick="CKEDITOR.tools.callFunction('+f+', this); return false;"'+' tabindex="-1">'+'<span style="margin: 0 auto;cursor: inherit">'+p+'</span>'+'<span class="cke_voice_label" id="cke_specialchar_label_'+n+'">'+q+'</span></a>');}else m.push('<td class="cke_dark_background"> ');m.push('</td>');}m.push('</tr>');}m.push('</tbody></table>','<span id="specialchar_table_label" class="cke_voice_label">'+c.options+'</span>');this.getContentElement('info','charContainer').getElement().setHtml(m.join(''));},contents:[{id:'info',label:a.lang.common.generalTab,title:a.lang.common.generalTab,padding:0,align:'top',elements:[{type:'hbox',align:'top',widths:['320px','90px'],children:[{type:'html',id:'charContainer',html:'',onMouseover:h,onMouseout:i,focus:function(){var k=this.getElement().getElementsByTag('a').getItem(0);setTimeout(function(){k.focus();h(null,k);});},onShow:function(){var k=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){k.focus();h(null,k);});},onLoad:function(k){b=k.sender;}},{type:'hbox',align:'top',widths:['100%'],children:[{type:'vbox',align:'top',children:[{type:'html',html:'<div></div>'},{type:'html',id:'charPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div> </div>'},{type:'html',id:'htmlPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div> </div>'}]}]}]}]}]};}); |
WT_DECLARE_WT_MEMBER(1,"WDialog",function(g,b){function k(a){a=c.pageCoordinates(a||window.event);j=true;b.style.left=c.pxself(b,"left")+a.x-h+"px";b.style.top=c.pxself(b,"top")+a.y-i+"px";h=a.x;i=a.y}jQuery.data(b,"obj",this);var l=this,e=$(b).find(".titlebar").first().get(0),c=g.WT,h,i,j=false;if(e){e.onmousedown=function(a){a=a||window.event;c.capture(e);a=c.pageCoordinates(a);h=a.x;i=a.y;e.onmousemove=k};e.onmouseup=function(){e.onmousemove=null;c.capture(null)}}this.centerDialog=function(){if(b.parentNode== null){b=e=null;this.centerDialog=function(){}}else if(b.style.display!="none"){if(!j){var a=c.windowSize(),f=b.offsetWidth,d=b.offsetHeight;b.style.left=Math.round((a.x-f)/2+(c.isIE6?document.documentElement.scrollLeft:0))+"px";b.style.top=Math.round((a.y-d)/2+(c.isIE6?document.documentElement.scrollTop:0))+"px";b.style.marginLeft="0px";b.style.marginTop="0px";b.style.width!=null&&b.style.height!=null&&l.wtResize(b,f,d)}b.style.visibility="visible"}};this.wtResize=function(a,f,d){d-=2;f-=2;a.style.height= d+"px";a.style.width=f+"px";a=a.lastChild;d-=a.previousSibling.offsetHeight+8;if(d>0){a.style.height=d+"px";g.layoutsAdjust&&g.layoutsAdjust()}}}); | WT_DECLARE_WT_MEMBER(1,"WDialog",function(g,b){function k(a){var c=a||window.event;a=d.pageCoordinates(c);c=d.windowCoordinates(c);var e=d.windowSize();if(c.x>0&&c.x<e.x&&c.y>0&&c.y<e.y){j=true;b.style.left=d.pxself(b,"left")+a.x-h+"px";b.style.top=d.pxself(b,"top")+a.y-i+"px";h=a.x;i=a.y}}jQuery.data(b,"obj",this);var l=this,f=$(b).find(".titlebar").first().get(0),d=g.WT,h,i,j=false;if(f){f.onmousedown=function(a){a=a||window.event;d.capture(f);a=d.pageCoordinates(a);h=a.x;i=a.y;f.onmousemove=k}; f.onmouseup=function(){f.onmousemove=null;d.capture(null)}}this.centerDialog=function(){if(b.parentNode==null){b=f=null;this.centerDialog=function(){}}else if(b.style.display!="none"){if(!j){var a=d.windowSize(),c=b.offsetWidth,e=b.offsetHeight;b.style.left=Math.round((a.x-c)/2+(d.isIE6?document.documentElement.scrollLeft:0))+"px";b.style.top=Math.round((a.y-e)/2+(d.isIE6?document.documentElement.scrollTop:0))+"px";b.style.marginLeft="0px";b.style.marginTop="0px";b.style.width!=null&&b.style.height!= null&&l.wtResize(b,c,e)}b.style.visibility="visible"}};this.wtResize=function(a,c,e){e-=2;c-=2;a.style.height=e+"px";a.style.width=c+"px";a=a.lastChild;e-=a.previousSibling.offsetHeight+8;if(e>0){a.style.height=e+"px";g.layoutsAdjust&&g.layoutsAdjust()}}}); | WT_DECLARE_WT_MEMBER(1,"WDialog",function(g,b){function k(a){a=c.pageCoordinates(a||window.event);j=true;b.style.left=c.pxself(b,"left")+a.x-h+"px";b.style.top=c.pxself(b,"top")+a.y-i+"px";h=a.x;i=a.y}jQuery.data(b,"obj",this);var l=this,e=$(b).find(".titlebar").first().get(0),c=g.WT,h,i,j=false;if(e){e.onmousedown=function(a){a=a||window.event;c.capture(e);a=c.pageCoordinates(a);h=a.x;i=a.y;e.onmousemove=k};e.onmouseup=function(){e.onmousemove=null;c.capture(null)}}this.centerDialog=function(){if(b.parentNode==null){b=e=null;this.centerDialog=function(){}}else if(b.style.display!="none"){if(!j){var a=c.windowSize(),f=b.offsetWidth,d=b.offsetHeight;b.style.left=Math.round((a.x-f)/2+(c.isIE6?document.documentElement.scrollLeft:0))+"px";b.style.top=Math.round((a.y-d)/2+(c.isIE6?document.documentElement.scrollTop:0))+"px";b.style.marginLeft="0px";b.style.marginTop="0px";b.style.width!=null&&b.style.height!=null&&l.wtResize(b,f,d)}b.style.visibility="visible"}};this.wtResize=function(a,f,d){d-=2;f-=2;a.style.height=d+"px";a.style.width=f+"px";a=a.lastChild;d-=a.previousSibling.offsetHeight+8;if(d>0){a.style.height=d+"px";g.layoutsAdjust&&g.layoutsAdjust()}}}); |
CKEDITOR.themes.add('default',(function(){function a(b,c){var d,e;e=b.config.sharedSpaces;e=e&&e[c];e=e&&CKEDITOR.document.getById(e);if(e){var f='<span class="cke_shared"><span class="'+b.skinClass+' cke_editor_'+b.name+'">'+'<span class="'+CKEDITOR.env.cssClass+'">'+'<span class="cke_wrapper cke_'+b.lang.dir+'">'+'<span class="cke_editor">'+'<div class="cke_'+c+'">'+'</div></span></span></span></span></span>',g=e.append(CKEDITOR.dom.element.createFromHtml(f,e.getDocument()));if(e.getCustomData('cke_hasshared'))g.hide();else e.setCustomData('cke_hasshared',1);d=g.getChild([0,0,0,0]);b.on('focus',function(){for(var h=0,i,j=e.getChildren();i=j.getItem(h);h++){if(i.type==CKEDITOR.NODE_ELEMENT&&!i.equals(g)&&i.hasClass('cke_shared'))i.hide();}g.show();});b.on('destroy',function(){g.remove();});}return d;};return{build:function(b,c){var d=b.name,e=b.element,f=b.elementMode;if(!e||f==CKEDITOR.ELEMENT_MODE_NONE)return;if(f==CKEDITOR.ELEMENT_MODE_REPLACE)e.hide();var g=b.fire('themeSpace',{space:'top',html:''}).html,h=b.fire('themeSpace',{space:'contents',html:''}).html,i=b.fireOnce('themeSpace',{space:'bottom',html:''}).html,j=h&&b.config.height,k=b.config.tabIndex||b.element.getAttribute('tabindex')||0;if(!h)j='auto';else if(!isNaN(j))j+='px';var l='',m=b.config.width;if(m){if(!isNaN(m))m+='px';l+='width: '+m+';';}var n=g&&a(b,'top'),o=a(b,'bottom');n&&(n.setHtml(g),g='');o&&(o.setHtml(i),i='');var p=CKEDITOR.dom.element.createFromHtml(['<span id="cke_',d,'" onmousedown="return false;" class="',b.skinClass,' cke_editor_',d,'" dir="',b.lang.dir,'" title="',CKEDITOR.env.gecko?' ':'','" lang="',b.langCode,'" role="application" aria-labelledby="cke_',d,'_arialbl"'+(l?' style="'+l+'"':'')+'>'+'<span id="cke_',d,'_arialbl" class="cke_voice_label">'+b.lang.editor+'</span>'+'<span class="',CKEDITOR.env.cssClass,'" role="presentation"><span class="cke_wrapper cke_',b.lang.dir,'" role="presentation"><table class="cke_editor" border="0" cellspacing="0" cellpadding="0" role="presentation"><tbody><tr',g?'':' style="display:none"','><td id="cke_top_',d,'" class="cke_top" role="presentation">',g,'</td></tr><tr',h?'':' style="display:none"','><td id="cke_contents_',d,'" class="cke_contents" style="height:',j,'" role="presentation">',h,'</td></tr><tr',i?'':' style="display:none"','><td id="cke_bottom_',d,'" class="cke_bottom" role="presentation">',i,'</td></tr></tbody></table><style>.',b.skinClass,'{visibility:hidden;}</style></span></span></span>'].join(''));p.getChild([1,0,0,0,0]).unselectable(); p.getChild([1,0,0,0,2]).unselectable();if(f==CKEDITOR.ELEMENT_MODE_REPLACE)p.insertAfter(e);else e.append(p);b.container=p;p.disableContextMenu();b.fireOnce('themeLoaded');b.fireOnce('uiReady');},buildDialog:function(b){var c=CKEDITOR.tools.getNextNumber(),d=CKEDITOR.dom.element.createFromHtml(['<div class="cke_editor_'+b.name.replace('.','\\.')+'_dialog cke_skin_',b.skinName,'" dir="',b.lang.dir,'" lang="',b.langCode,'" role="dialog" aria-labelledby="%title#"><table class="cke_dialog',' '+CKEDITOR.env.cssClass,' cke_',b.lang.dir,'" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="%body" role="presentation"><div id="%title#" class="%title" role="presentation"></div><a id="%close_button#" class="%close_button" href="javascript:void(0)" title="'+b.lang.common.close+'" role="button"><span class="cke_label">X</span></a>'+'<div id="%tabs#" class="%tabs" role="tablist"></div>'+'<table class="%contents" role="presentation"><tr>'+'<td id="%contents#" class="%contents" role="presentation"></td>'+'</tr></table>'+'<div id="%footer#" class="%footer" role="presentation"></div>'+'</div>'+'<div id="%tl#" class="%tl"></div>'+'<div id="%tc#" class="%tc"></div>'+'<div id="%tr#" class="%tr"></div>'+'<div id="%ml#" class="%ml"></div>'+'<div id="%mr#" class="%mr"></div>'+'<div id="%bl#" class="%bl"></div>'+'<div id="%bc#" class="%bc"></div>'+'<div id="%br#" class="%br"></div>'+'</td></tr>'+'</table>',CKEDITOR.env.ie?'':'<style>.cke_dialog{visibility:hidden;}</style>','</div>'].join('').replace(/#/g,'_'+c).replace(/%/g,'cke_dialog_')),e=d.getChild([0,0,0,0,0]),f=e.getChild(0),g=e.getChild(1);f.unselectable();g.unselectable();return{element:d,parts:{dialog:d.getChild(0),title:f,close:g,tabs:e.getChild(2),contents:e.getChild([3,0,0,0]),footer:e.getChild(4)}};},destroy:function(b){var c=b.container;c.clearCustomData();b.element.clearCustomData();if(CKEDITOR.env.ie){c.setStyle('display','none');var d=document.body.createTextRange();d.moveToElementText(c.$);try{d.select();}catch(e){}}if(c)c.remove();if(b.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE)b.element.show();delete b.element;}};})());CKEDITOR.editor.prototype.getThemeSpace=function(a){var b='cke_'+a,c=this._[b]||(this._[b]=CKEDITOR.document.getById(b+'_'+this.name));return c;};CKEDITOR.editor.prototype.resize=function(a,b,c,d){var e=/^\d+$/;if(e.test(a))a+='px';var f=this.container,g=CKEDITOR.document.getById('cke_contents_'+this.name),h=d?f.getChild(1):f;CKEDITOR.env.webkit&&h.setStyle('display','none'); | CKEDITOR.themes.add('default',(function(){function a(b,c){var d,e;e=b.config.sharedSpaces;e=e&&e[c];e=e&&CKEDITOR.document.getById(e);if(e){var f='<span class="cke_shared"><span class="'+b.skinClass+' cke_editor_'+b.name+'">'+'<span class="'+CKEDITOR.env.cssClass+'">'+'<span class="cke_wrapper cke_'+b.lang.dir+'">'+'<span class="cke_editor">'+'<div class="cke_'+c+'">'+'</div></span></span></span></span></span>',g=e.append(CKEDITOR.dom.element.createFromHtml(f,e.getDocument()));if(e.getCustomData('cke_hasshared'))g.hide();else e.setCustomData('cke_hasshared',1);d=g.getChild([0,0,0,0]);b.on('focus',function(){for(var h=0,i,j=e.getChildren();i=j.getItem(h);h++){if(i.type==CKEDITOR.NODE_ELEMENT&&!i.equals(g)&&i.hasClass('cke_shared'))i.hide();}g.show();});b.on('destroy',function(){g.remove();});}return d;};return{build:function(b,c){var d=b.name,e=b.element,f=b.elementMode;if(!e||f==CKEDITOR.ELEMENT_MODE_NONE)return;if(f==CKEDITOR.ELEMENT_MODE_REPLACE)e.hide();var g=b.fire('themeSpace',{space:'top',html:''}).html,h=b.fire('themeSpace',{space:'contents',html:''}).html,i=b.fireOnce('themeSpace',{space:'bottom',html:''}).html,j=h&&b.config.height,k=b.config.tabIndex||b.element.getAttribute('tabindex')||0;if(!h)j='auto';else if(!isNaN(j))j+='px';var l='',m=b.config.width;if(m){if(!isNaN(m))m+='px';l+='width: '+m+';';}var n=g&&a(b,'top'),o=a(b,'bottom');n&&(n.setHtml(g),g='');o&&(o.setHtml(i),i='');var p=CKEDITOR.dom.element.createFromHtml(['<span id="cke_',d,'" onmousedown="return false;" class="',b.skinClass,' cke_editor_',d,'" dir="',b.lang.dir,'" title="',CKEDITOR.env.gecko?' ':'','" lang="',b.langCode,'"'+(CKEDITOR.env.webkit?' tabindex="'+k+'"':'')+' role="application"'+' aria-labelledby="cke_',d,'_arialbl"'+(l?' style="'+l+'"':'')+'>'+'<span id="cke_',d,'_arialbl" class="cke_voice_label">'+b.lang.editor+'</span>'+'<span class="',CKEDITOR.env.cssClass,'" role="presentation"><span class="cke_wrapper cke_',b.lang.dir,'" role="presentation"><table class="cke_editor" border="0" cellspacing="0" cellpadding="0" role="presentation"><tbody><tr',g?'':' style="display:none"',' role="presentation"><td id="cke_top_',d,'" class="cke_top" role="presentation">',g,'</td></tr><tr',h?'':' style="display:none"',' role="presentation"><td id="cke_contents_',d,'" class="cke_contents" style="height:',j,'" role="presentation">',h,'</td></tr><tr',i?'':' style="display:none"',' role="presentation"><td id="cke_bottom_',d,'" class="cke_bottom" role="presentation">',i,'</td></tr></tbody></table><style>.',b.skinClass,'{visibility:hidden;}</style></span></span></span>'].join('')); p.getChild([1,0,0,0,0]).unselectable();p.getChild([1,0,0,0,2]).unselectable();if(f==CKEDITOR.ELEMENT_MODE_REPLACE)p.insertAfter(e);else e.append(p);b.container=p;p.disableContextMenu();b.fireOnce('themeLoaded');b.fireOnce('uiReady');},buildDialog:function(b){var c=CKEDITOR.tools.getNextNumber(),d=CKEDITOR.dom.element.createFromHtml(['<div class="cke_editor_'+b.name.replace('.','\\.')+'_dialog cke_skin_',b.skinName,'" dir="',b.lang.dir,'" lang="',b.langCode,'" role="dialog" aria-labelledby="%title#"><table class="cke_dialog',' '+CKEDITOR.env.cssClass,' cke_',b.lang.dir,'" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="%body" role="presentation"><div id="%title#" class="%title" role="presentation"></div><a id="%close_button#" class="%close_button" href="javascript:void(0)" title="'+b.lang.common.close+'" role="button"><span class="cke_label">X</span></a>'+'<div id="%tabs#" class="%tabs" role="tablist"></div>'+'<table class="%contents" role="presentation"><tr>'+'<td id="%contents#" class="%contents" role="presentation"></td>'+'</tr></table>'+'<div id="%footer#" class="%footer" role="presentation"></div>'+'</div>'+'<div id="%tl#" class="%tl"></div>'+'<div id="%tc#" class="%tc"></div>'+'<div id="%tr#" class="%tr"></div>'+'<div id="%ml#" class="%ml"></div>'+'<div id="%mr#" class="%mr"></div>'+'<div id="%bl#" class="%bl"></div>'+'<div id="%bc#" class="%bc"></div>'+'<div id="%br#" class="%br"></div>'+'</td></tr>'+'</table>',CKEDITOR.env.ie?'':'<style>.cke_dialog{visibility:hidden;}</style>','</div>'].join('').replace(/#/g,'_'+c).replace(/%/g,'cke_dialog_')),e=d.getChild([0,0,0,0,0]),f=e.getChild(0),g=e.getChild(1);f.unselectable();g.unselectable();return{element:d,parts:{dialog:d.getChild(0),title:f,close:g,tabs:e.getChild(2),contents:e.getChild([3,0,0,0]),footer:e.getChild(4)}};},destroy:function(b){var c=b.container;c.clearCustomData();b.element.clearCustomData();if(c)c.remove();if(b.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE)b.element.show();delete b.element;}};})());CKEDITOR.editor.prototype.getThemeSpace=function(a){var b='cke_'+a,c=this._[b]||(this._[b]=CKEDITOR.document.getById(b+'_'+this.name));return c;};CKEDITOR.editor.prototype.resize=function(a,b,c,d){var e=this.container,f=CKEDITOR.document.getById('cke_contents_'+this.name),g=d?e.getChild(1):e;CKEDITOR.env.webkit&&g.setStyle('display','none');g.setSize('width',a,true);if(CKEDITOR.env.webkit){g.$.offsetWidth;g.setStyle('display','');}var h=c?0:(g.$.offsetHeight||0)-(f.$.clientHeight||0); | CKEDITOR.themes.add('default',(function(){function a(b,c){var d,e;e=b.config.sharedSpaces;e=e&&e[c];e=e&&CKEDITOR.document.getById(e);if(e){var f='<span class="cke_shared"><span class="'+b.skinClass+' cke_editor_'+b.name+'">'+'<span class="'+CKEDITOR.env.cssClass+'">'+'<span class="cke_wrapper cke_'+b.lang.dir+'">'+'<span class="cke_editor">'+'<div class="cke_'+c+'">'+'</div></span></span></span></span></span>',g=e.append(CKEDITOR.dom.element.createFromHtml(f,e.getDocument()));if(e.getCustomData('cke_hasshared'))g.hide();else e.setCustomData('cke_hasshared',1);d=g.getChild([0,0,0,0]);b.on('focus',function(){for(var h=0,i,j=e.getChildren();i=j.getItem(h);h++){if(i.type==CKEDITOR.NODE_ELEMENT&&!i.equals(g)&&i.hasClass('cke_shared'))i.hide();}g.show();});b.on('destroy',function(){g.remove();});}return d;};return{build:function(b,c){var d=b.name,e=b.element,f=b.elementMode;if(!e||f==CKEDITOR.ELEMENT_MODE_NONE)return;if(f==CKEDITOR.ELEMENT_MODE_REPLACE)e.hide();var g=b.fire('themeSpace',{space:'top',html:''}).html,h=b.fire('themeSpace',{space:'contents',html:''}).html,i=b.fireOnce('themeSpace',{space:'bottom',html:''}).html,j=h&&b.config.height,k=b.config.tabIndex||b.element.getAttribute('tabindex')||0;if(!h)j='auto';else if(!isNaN(j))j+='px';var l='',m=b.config.width;if(m){if(!isNaN(m))m+='px';l+='width: '+m+';';}var n=g&&a(b,'top'),o=a(b,'bottom');n&&(n.setHtml(g),g='');o&&(o.setHtml(i),i='');var p=CKEDITOR.dom.element.createFromHtml(['<span id="cke_',d,'" onmousedown="return false;" class="',b.skinClass,' cke_editor_',d,'" dir="',b.lang.dir,'" title="',CKEDITOR.env.gecko?' ':'','" lang="',b.langCode,'" role="application" aria-labelledby="cke_',d,'_arialbl"'+(l?' style="'+l+'"':'')+'>'+'<span id="cke_',d,'_arialbl" class="cke_voice_label">'+b.lang.editor+'</span>'+'<span class="',CKEDITOR.env.cssClass,'" role="presentation"><span class="cke_wrapper cke_',b.lang.dir,'" role="presentation"><table class="cke_editor" border="0" cellspacing="0" cellpadding="0" role="presentation"><tbody><tr',g?'':' style="display:none"','><td id="cke_top_',d,'" class="cke_top" role="presentation">',g,'</td></tr><tr',h?'':' style="display:none"','><td id="cke_contents_',d,'" class="cke_contents" style="height:',j,'" role="presentation">',h,'</td></tr><tr',i?'':' style="display:none"','><td id="cke_bottom_',d,'" class="cke_bottom" role="presentation">',i,'</td></tr></tbody></table><style>.',b.skinClass,'{visibility:hidden;}</style></span></span></span>'].join(''));p.getChild([1,0,0,0,0]).unselectable();p.getChild([1,0,0,0,2]).unselectable();if(f==CKEDITOR.ELEMENT_MODE_REPLACE)p.insertAfter(e);else e.append(p);b.container=p;p.disableContextMenu();b.fireOnce('themeLoaded');b.fireOnce('uiReady');},buildDialog:function(b){var c=CKEDITOR.tools.getNextNumber(),d=CKEDITOR.dom.element.createFromHtml(['<div class="cke_editor_'+b.name.replace('.','\\.')+'_dialog cke_skin_',b.skinName,'" dir="',b.lang.dir,'" lang="',b.langCode,'" role="dialog" aria-labelledby="%title#"><table class="cke_dialog',' '+CKEDITOR.env.cssClass,' cke_',b.lang.dir,'" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="%body" role="presentation"><div id="%title#" class="%title" role="presentation"></div><a id="%close_button#" class="%close_button" href="javascript:void(0)" title="'+b.lang.common.close+'" role="button"><span class="cke_label">X</span></a>'+'<div id="%tabs#" class="%tabs" role="tablist"></div>'+'<table class="%contents" role="presentation"><tr>'+'<td id="%contents#" class="%contents" role="presentation"></td>'+'</tr></table>'+'<div id="%footer#" class="%footer" role="presentation"></div>'+'</div>'+'<div id="%tl#" class="%tl"></div>'+'<div id="%tc#" class="%tc"></div>'+'<div id="%tr#" class="%tr"></div>'+'<div id="%ml#" class="%ml"></div>'+'<div id="%mr#" class="%mr"></div>'+'<div id="%bl#" class="%bl"></div>'+'<div id="%bc#" class="%bc"></div>'+'<div id="%br#" class="%br"></div>'+'</td></tr>'+'</table>',CKEDITOR.env.ie?'':'<style>.cke_dialog{visibility:hidden;}</style>','</div>'].join('').replace(/#/g,'_'+c).replace(/%/g,'cke_dialog_')),e=d.getChild([0,0,0,0,0]),f=e.getChild(0),g=e.getChild(1);f.unselectable();g.unselectable();return{element:d,parts:{dialog:d.getChild(0),title:f,close:g,tabs:e.getChild(2),contents:e.getChild([3,0,0,0]),footer:e.getChild(4)}};},destroy:function(b){var c=b.container;c.clearCustomData();b.element.clearCustomData();if(CKEDITOR.env.ie){c.setStyle('display','none');var d=document.body.createTextRange();d.moveToElementText(c.$);try{d.select();}catch(e){}}if(c)c.remove();if(b.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE)b.element.show();delete b.element;}};})());CKEDITOR.editor.prototype.getThemeSpace=function(a){var b='cke_'+a,c=this._[b]||(this._[b]=CKEDITOR.document.getById(b+'_'+this.name));return c;};CKEDITOR.editor.prototype.resize=function(a,b,c,d){var e=/^\d+$/;if(e.test(a))a+='px';var f=this.container,g=CKEDITOR.document.getById('cke_contents_'+this.name),h=d?f.getChild(1):f;CKEDITOR.env.webkit&&h.setStyle('display','none'); |
Sonatype.Events.addListener('userViewInit', function(cardPanel, rec) { var config = { payload : rec, tabTitle : 'Config' }; cardPanel.add(rec.data.source == 'default' ? new Sonatype.repoServer.DefaultUserEditor(config) : new Sonatype.repoServer.UserMappingEditor(config)); }); | function( conn, response, options ) { if ( response.responseText ) { var statusResp = Ext.decode(response.responseText); if ( statusResp ) { this.grid.totalRecords = statusResp.totalCount; if ( statusResp.tooManyResults ) { this.grid.setWarningLabel( 'Too many results, please refine the search condition.' ); } else { this.grid.clearWarningLabel(); } } } }, this, { single: true } ); | Sonatype.Events.addListener('userViewInit', function(cardPanel, rec) { var config = { payload : rec, tabTitle : 'Config' }; cardPanel.add(rec.data.source == 'default' ? new Sonatype.repoServer.DefaultUserEditor(config) : new Sonatype.repoServer.UserMappingEditor(config)); }); |
return [$(window).width(), $(document).height()]; | return [$(document).width(), $(document).height()]; | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; var tool; tool = $.tools.expose = { conf: { maskId: 'exposeMask', loadSpeed: 'slow', closeSpeed: 'fast', closeOnClick: true, closeOnEsc: true, // css settings zIndex: 9998, opacity: 0.8, startOpacity: 0, color: '#fff', // callbacks onLoad: null, onClose: null } }; /* one of the greatest headaches in the tool. finally made it */ 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()]; } function call(fn) { if (fn) { return fn.call($.mask); } } var mask, exposed, loaded, config, overlayIndex; $.mask = { load: function(conf, els) { // already loaded ? if (loaded) { return this; } // configuration if (typeof conf == 'string') { conf = {color: conf}; } // use latest config conf = conf || config; config = conf = $.extend($.extend({}, tool.conf), conf); // get the mask mask = $("#" + conf.maskId); // or create it if (!mask.length) { mask = $('<div/>').attr("id", conf.maskId); $("body").append(mask); } // set position and dimensions var size = viewport(); mask.css({ position:'absolute', top: 0, left: 0, width: size[0], height: size[1], display: 'none', opacity: conf.startOpacity, zIndex: conf.zIndex }); if (conf.color) { mask.css("backgroundColor", conf.color); } // onBeforeLoad if (call(conf.onBeforeLoad) === false) { return this; } // esc button if (conf.closeOnEsc) { $(document).bind("keydown.mask", function(e) { if (e.keyCode == 27) { $.mask.close(e); } }); } // mask click closes if (conf.closeOnClick) { mask.bind("click.mask", function(e) { $.mask.close(e); }); } // resize mask when window is resized $(window).bind("resize.mask", function() { $.mask.fit(); }); // exposed elements if (els && els.length) { overlayIndex = els.eq(0).css("zIndex"); // make sure element is positioned absolutely or relatively $.each(els, function() { var el = $(this); if (!/relative|absolute|fixed/i.test(el.css("position"))) { el.css("position", "relative"); } }); // make elements sit on top of the mask exposed = els.css({ zIndex: Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)}); } // reveal mask mask.css({display: 'block'}).fadeTo(conf.loadSpeed, conf.opacity, function() { $.mask.fit(); call(conf.onLoad); }); loaded = true; return this; }, close: function() { if (loaded) { // onBeforeClose if (call(config.onBeforeClose) === false) { return this; } mask.fadeOut(config.closeSpeed, function() { call(config.onClose); if (exposed) { exposed.css({zIndex: overlayIndex}); } }); // unbind various event listeners $(document).unbind("keydown.mask"); mask.unbind("click.mask"); $(window).unbind("resize.mask"); loaded = false; } return this; }, fit: function() { if (loaded) { var size = viewport(); mask.css({width: size[0], height: size[1]}); } }, getMask: function() { return mask; }, isLoaded: function() { return loaded; }, getConf: function() { return config; }, getExposed: function() { return exposed; } }; $.fn.mask = function(conf) { $.mask.load(conf); return this; }; $.fn.expose = function(conf) { $.mask.load(conf, this); return this; };})(jQuery); |
this.STEP(func); }.bind(this)); | this.step(func); }.bind(this)); | funcarray.each(function(func){ this.STEP(func); }.bind(this)); |
return (ret[1] === acc); })) | return (macro === acc); })) | if (legalAccents.detect(function(acc) { return (ret[1] === acc); })) |
if (el.style.display != 'none') { if (!moved) { var ws = WT.windowSize(); var w = el.offsetWidth, h = el.offsetHeight; el.style.left = Math.round((ws.x - w)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - h)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; | if (!moved) { var ws = WT.windowSize(); var w = el.offsetWidth, h = el.offsetHeight; el.style.left = Math.round((ws.x - w)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - h)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; | function(APP, el) { jQuery.data(el, 'obj', this); var self = this; var titlebar = $(el).find(".titlebar").first().get(0); var WT = APP.WT; var dsx, dsy; var moved = false; function handleMove(event) { var e = event||window.event; var nowxy = WT.pageCoordinates(e); var wxy = WT.windowCoordinates(e); var wsize = WT.windowSize(); if (wxy.x > 0 && wxy.x < wsize.x && wxy.y > 0 && wxy.y < wsize.y) { moved = true; el.style.left = (WT.pxself(el, 'left') + nowxy.x - dsx) + 'px'; el.style.top = (WT.pxself(el, 'top') + nowxy.y - dsy) + 'px'; dsx = nowxy.x; dsy = nowxy.y; } }; if (titlebar) { titlebar.onmousedown = function(event) { var e = event||window.event; WT.capture(titlebar); var pc = WT.pageCoordinates(e); dsx = pc.x; dsy = pc.y; titlebar.onmousemove = handleMove; }; titlebar.onmouseup = function(event) { titlebar.onmousemove = null; WT.capture(null); }; } this.centerDialog = function() { if (el.parentNode == null) { el = titlebar = null; this.centerDialog = function() { }; return; } if (el.style.display != 'none') { if (!moved) { var ws = WT.windowSize(); var w = el.offsetWidth, h = el.offsetHeight; el.style.left = Math.round((ws.x - w)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - h)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; if (el.style.width != null && el.style.height != null) self.wtResize(el, w, h); } el.style.visibility = 'visible'; } }; this.wtResize = function(self, w, h) { h -= 2; w -= 2; // 2 = dialog border self.style.height= h + 'px'; self.style.width= w + 'px'; var c = self.lastChild; var t = c.previousSibling; h -= t.offsetHeight + 8; // 8 = body padding if (h > 0) { c.style.height = h + 'px'; if (APP.layouts) APP.layouts.adjust(); } }; }); |
if (el.style.width != null && el.style.height != null) self.wtResize(el, w, h); } el.style.visibility = 'visible'; | if (el.style.width != null && el.style.height != null) self.wtResize(el, w, h); | function(APP, el) { jQuery.data(el, 'obj', this); var self = this; var titlebar = $(el).find(".titlebar").first().get(0); var WT = APP.WT; var dsx, dsy; var moved = false; function handleMove(event) { var e = event||window.event; var nowxy = WT.pageCoordinates(e); var wxy = WT.windowCoordinates(e); var wsize = WT.windowSize(); if (wxy.x > 0 && wxy.x < wsize.x && wxy.y > 0 && wxy.y < wsize.y) { moved = true; el.style.left = (WT.pxself(el, 'left') + nowxy.x - dsx) + 'px'; el.style.top = (WT.pxself(el, 'top') + nowxy.y - dsy) + 'px'; dsx = nowxy.x; dsy = nowxy.y; } }; if (titlebar) { titlebar.onmousedown = function(event) { var e = event||window.event; WT.capture(titlebar); var pc = WT.pageCoordinates(e); dsx = pc.x; dsy = pc.y; titlebar.onmousemove = handleMove; }; titlebar.onmouseup = function(event) { titlebar.onmousemove = null; WT.capture(null); }; } this.centerDialog = function() { if (el.parentNode == null) { el = titlebar = null; this.centerDialog = function() { }; return; } if (el.style.display != 'none') { if (!moved) { var ws = WT.windowSize(); var w = el.offsetWidth, h = el.offsetHeight; el.style.left = Math.round((ws.x - w)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - h)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; if (el.style.width != null && el.style.height != null) self.wtResize(el, w, h); } el.style.visibility = 'visible'; } }; this.wtResize = function(self, w, h) { h -= 2; w -= 2; // 2 = dialog border self.style.height= h + 'px'; self.style.width= w + 'px'; var c = self.lastChild; var t = c.previousSibling; h -= t.offsetHeight + 8; // 8 = body padding if (h > 0) { c.style.height = h + 'px'; if (APP.layouts) APP.layouts.adjust(); } }; }); |
this.discoverContext = function() { | this.discoverContext = function(noGLHandler) { | function(APP, canvas) { jQuery.data(canvas, 'obj', this); var self = this; var WT = APP.WT; var vec3 = WT.glMatrix.vec3; var mat3 = WT.glMatrix.mat3; var mat4 = WT.glMatrix.mat4; this.ctx = null; // Placeholders for the initializeGL and paintGL functions, // which will be overwritten by whatever is rendered this.initializeGL = function() {}; this.paintGL = function() {}; var dragPreviousXY = null; var lookAtCenter = null; var lookAtUpDir = null; var lookAtPitchRate = 0; var lookAtYawRate = 0; var cameraMatrix = null; var walkFrontRate = 0; var walkYawRate = 0; this.discoverContext = function() { if (canvas.getContext) { this.ctx = canvas.getContext('experimental-webgl'); if (this.ctx == null) { this.ctx = canvas.getContext('webgl'); } //if (this.ctx == null) { // console.log('WGLWidget: failed to get a webgl context'); //} } return this.ctx; } this.setLookAtParams = function(matrix, center, up, pitchRate, yawRate) { cameraMatrix = matrix; lookAtCenter = center; lookAtUpDir = up; lookAtPitchRate = pitchRate; lookAtYawRate = yawRate; }; this.mouseDragLookAt = function(o, event) { var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var s=vec3.create(); s[0]=cameraMatrix[0]; s[1]=cameraMatrix[4]; s[2]=cameraMatrix[8]; var r=mat4.create(); mat4.identity(r); mat4.translate(r, lookAtCenter); mat4.rotate(r, dy * lookAtPitchRate, s); mat4.rotate(r, dx * lookAtYawRate, lookAtUpDir); vec3.negate(lookAtCenter); mat4.translate(r, lookAtCenter); vec3.negate(lookAtCenter); mat4.multiply(cameraMatrix,r,cameraMatrix); //console.log('mouseDragLookAt after: ' + mat4.str(cameraMatrix)); // Repaint! //console.log('mouseDragLookAt: repaint'); this.paintGl(); // store mouse coord for next action dragPreviousXY = WT.pageCoordinates(event); }; // Mouse wheel = zoom in/out this.mouseWheelLookAt = function(o, event) { WT.cancelEvent(event); //alert('foo'); var d = WT.wheelDelta(event); var s = Math.pow(1.2, d); mat4.translate(cameraMatrix, lookAtCenter); mat4.scale(cameraMatrix, [s, s, s]); vec3.negate(lookAtCenter); mat4.translate(cameraMatrix, lookAtCenter); vec3.negate(lookAtCenter); // Repaint! this.paintGl(); }; this.setWalkParams = function(matrix, frontRate, yawRate) { cameraMatrix = matrix; walkFrontRate = frontRate; walkYawRate = yawRate; }; this.mouseDragWalk = function(o, event){ var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var r=mat4.create(); mat4.identity(r); mat4.rotateY(r, dx * walkYawRate); var t=vec3.create(); t[0]=0; t[1]=0; t[2]=-walkFrontRate * dy; mat4.translate(r, t); mat4.multiply(r, cameraMatrix, cameraMatrix); this.paintGl(); dragPreviousXY = WT.pageCoordinates(event); } this.mouseDown = function(o, event) { WT.capture(null); WT.capture(canvas); dragPreviousXY = WT.pageCoordinates(event); }; this.mouseUp = function(o, event) { if (dragPreviousXY != null) dragPreviousXY = null; }; }); |
this.ctx = canvas.getContext('experimental-webgl'); | try { this.ctx = canvas.getContext('webgl'); } catch (e) {} | function(APP, canvas) { jQuery.data(canvas, 'obj', this); var self = this; var WT = APP.WT; var vec3 = WT.glMatrix.vec3; var mat3 = WT.glMatrix.mat3; var mat4 = WT.glMatrix.mat4; this.ctx = null; // Placeholders for the initializeGL and paintGL functions, // which will be overwritten by whatever is rendered this.initializeGL = function() {}; this.paintGL = function() {}; var dragPreviousXY = null; var lookAtCenter = null; var lookAtUpDir = null; var lookAtPitchRate = 0; var lookAtYawRate = 0; var cameraMatrix = null; var walkFrontRate = 0; var walkYawRate = 0; this.discoverContext = function() { if (canvas.getContext) { this.ctx = canvas.getContext('experimental-webgl'); if (this.ctx == null) { this.ctx = canvas.getContext('webgl'); } //if (this.ctx == null) { // console.log('WGLWidget: failed to get a webgl context'); //} } return this.ctx; } this.setLookAtParams = function(matrix, center, up, pitchRate, yawRate) { cameraMatrix = matrix; lookAtCenter = center; lookAtUpDir = up; lookAtPitchRate = pitchRate; lookAtYawRate = yawRate; }; this.mouseDragLookAt = function(o, event) { var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var s=vec3.create(); s[0]=cameraMatrix[0]; s[1]=cameraMatrix[4]; s[2]=cameraMatrix[8]; var r=mat4.create(); mat4.identity(r); mat4.translate(r, lookAtCenter); mat4.rotate(r, dy * lookAtPitchRate, s); mat4.rotate(r, dx * lookAtYawRate, lookAtUpDir); vec3.negate(lookAtCenter); mat4.translate(r, lookAtCenter); vec3.negate(lookAtCenter); mat4.multiply(cameraMatrix,r,cameraMatrix); //console.log('mouseDragLookAt after: ' + mat4.str(cameraMatrix)); // Repaint! //console.log('mouseDragLookAt: repaint'); this.paintGl(); // store mouse coord for next action dragPreviousXY = WT.pageCoordinates(event); }; // Mouse wheel = zoom in/out this.mouseWheelLookAt = function(o, event) { WT.cancelEvent(event); //alert('foo'); var d = WT.wheelDelta(event); var s = Math.pow(1.2, d); mat4.translate(cameraMatrix, lookAtCenter); mat4.scale(cameraMatrix, [s, s, s]); vec3.negate(lookAtCenter); mat4.translate(cameraMatrix, lookAtCenter); vec3.negate(lookAtCenter); // Repaint! this.paintGl(); }; this.setWalkParams = function(matrix, frontRate, yawRate) { cameraMatrix = matrix; walkFrontRate = frontRate; walkYawRate = yawRate; }; this.mouseDragWalk = function(o, event){ var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var r=mat4.create(); mat4.identity(r); mat4.rotateY(r, dx * walkYawRate); var t=vec3.create(); t[0]=0; t[1]=0; t[2]=-walkFrontRate * dy; mat4.translate(r, t); mat4.multiply(r, cameraMatrix, cameraMatrix); this.paintGl(); dragPreviousXY = WT.pageCoordinates(event); } this.mouseDown = function(o, event) { WT.capture(null); WT.capture(canvas); dragPreviousXY = WT.pageCoordinates(event); }; this.mouseUp = function(o, event) { if (dragPreviousXY != null) dragPreviousXY = null; }; }); |
this.ctx = canvas.getContext('webgl'); | try { this.ctx = canvas.getContext('experimental-webgl'); } catch (e) {} | function(APP, canvas) { jQuery.data(canvas, 'obj', this); var self = this; var WT = APP.WT; var vec3 = WT.glMatrix.vec3; var mat3 = WT.glMatrix.mat3; var mat4 = WT.glMatrix.mat4; this.ctx = null; // Placeholders for the initializeGL and paintGL functions, // which will be overwritten by whatever is rendered this.initializeGL = function() {}; this.paintGL = function() {}; var dragPreviousXY = null; var lookAtCenter = null; var lookAtUpDir = null; var lookAtPitchRate = 0; var lookAtYawRate = 0; var cameraMatrix = null; var walkFrontRate = 0; var walkYawRate = 0; this.discoverContext = function() { if (canvas.getContext) { this.ctx = canvas.getContext('experimental-webgl'); if (this.ctx == null) { this.ctx = canvas.getContext('webgl'); } //if (this.ctx == null) { // console.log('WGLWidget: failed to get a webgl context'); //} } return this.ctx; } this.setLookAtParams = function(matrix, center, up, pitchRate, yawRate) { cameraMatrix = matrix; lookAtCenter = center; lookAtUpDir = up; lookAtPitchRate = pitchRate; lookAtYawRate = yawRate; }; this.mouseDragLookAt = function(o, event) { var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var s=vec3.create(); s[0]=cameraMatrix[0]; s[1]=cameraMatrix[4]; s[2]=cameraMatrix[8]; var r=mat4.create(); mat4.identity(r); mat4.translate(r, lookAtCenter); mat4.rotate(r, dy * lookAtPitchRate, s); mat4.rotate(r, dx * lookAtYawRate, lookAtUpDir); vec3.negate(lookAtCenter); mat4.translate(r, lookAtCenter); vec3.negate(lookAtCenter); mat4.multiply(cameraMatrix,r,cameraMatrix); //console.log('mouseDragLookAt after: ' + mat4.str(cameraMatrix)); // Repaint! //console.log('mouseDragLookAt: repaint'); this.paintGl(); // store mouse coord for next action dragPreviousXY = WT.pageCoordinates(event); }; // Mouse wheel = zoom in/out this.mouseWheelLookAt = function(o, event) { WT.cancelEvent(event); //alert('foo'); var d = WT.wheelDelta(event); var s = Math.pow(1.2, d); mat4.translate(cameraMatrix, lookAtCenter); mat4.scale(cameraMatrix, [s, s, s]); vec3.negate(lookAtCenter); mat4.translate(cameraMatrix, lookAtCenter); vec3.negate(lookAtCenter); // Repaint! this.paintGl(); }; this.setWalkParams = function(matrix, frontRate, yawRate) { cameraMatrix = matrix; walkFrontRate = frontRate; walkYawRate = yawRate; }; this.mouseDragWalk = function(o, event){ var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var r=mat4.create(); mat4.identity(r); mat4.rotateY(r, dx * walkYawRate); var t=vec3.create(); t[0]=0; t[1]=0; t[2]=-walkFrontRate * dy; mat4.translate(r, t); mat4.multiply(r, cameraMatrix, cameraMatrix); this.paintGl(); dragPreviousXY = WT.pageCoordinates(event); } this.mouseDown = function(o, event) { WT.capture(null); WT.capture(canvas); dragPreviousXY = WT.pageCoordinates(event); }; this.mouseUp = function(o, event) { if (dragPreviousXY != null) dragPreviousXY = null; }; }); |
if (this.ctx == null) { var alternative = canvas.firstChild; var parentNode = canvas.parentNode; parentNode.replaceChild(alternative, canvas); noGLHandler(); } | function(APP, canvas) { jQuery.data(canvas, 'obj', this); var self = this; var WT = APP.WT; var vec3 = WT.glMatrix.vec3; var mat3 = WT.glMatrix.mat3; var mat4 = WT.glMatrix.mat4; this.ctx = null; // Placeholders for the initializeGL and paintGL functions, // which will be overwritten by whatever is rendered this.initializeGL = function() {}; this.paintGL = function() {}; var dragPreviousXY = null; var lookAtCenter = null; var lookAtUpDir = null; var lookAtPitchRate = 0; var lookAtYawRate = 0; var cameraMatrix = null; var walkFrontRate = 0; var walkYawRate = 0; this.discoverContext = function() { if (canvas.getContext) { this.ctx = canvas.getContext('experimental-webgl'); if (this.ctx == null) { this.ctx = canvas.getContext('webgl'); } //if (this.ctx == null) { // console.log('WGLWidget: failed to get a webgl context'); //} } return this.ctx; } this.setLookAtParams = function(matrix, center, up, pitchRate, yawRate) { cameraMatrix = matrix; lookAtCenter = center; lookAtUpDir = up; lookAtPitchRate = pitchRate; lookAtYawRate = yawRate; }; this.mouseDragLookAt = function(o, event) { var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var s=vec3.create(); s[0]=cameraMatrix[0]; s[1]=cameraMatrix[4]; s[2]=cameraMatrix[8]; var r=mat4.create(); mat4.identity(r); mat4.translate(r, lookAtCenter); mat4.rotate(r, dy * lookAtPitchRate, s); mat4.rotate(r, dx * lookAtYawRate, lookAtUpDir); vec3.negate(lookAtCenter); mat4.translate(r, lookAtCenter); vec3.negate(lookAtCenter); mat4.multiply(cameraMatrix,r,cameraMatrix); //console.log('mouseDragLookAt after: ' + mat4.str(cameraMatrix)); // Repaint! //console.log('mouseDragLookAt: repaint'); this.paintGl(); // store mouse coord for next action dragPreviousXY = WT.pageCoordinates(event); }; // Mouse wheel = zoom in/out this.mouseWheelLookAt = function(o, event) { WT.cancelEvent(event); //alert('foo'); var d = WT.wheelDelta(event); var s = Math.pow(1.2, d); mat4.translate(cameraMatrix, lookAtCenter); mat4.scale(cameraMatrix, [s, s, s]); vec3.negate(lookAtCenter); mat4.translate(cameraMatrix, lookAtCenter); vec3.negate(lookAtCenter); // Repaint! this.paintGl(); }; this.setWalkParams = function(matrix, frontRate, yawRate) { cameraMatrix = matrix; walkFrontRate = frontRate; walkYawRate = yawRate; }; this.mouseDragWalk = function(o, event){ var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var r=mat4.create(); mat4.identity(r); mat4.rotateY(r, dx * walkYawRate); var t=vec3.create(); t[0]=0; t[1]=0; t[2]=-walkFrontRate * dy; mat4.translate(r, t); mat4.multiply(r, cameraMatrix, cameraMatrix); this.paintGl(); dragPreviousXY = WT.pageCoordinates(event); } this.mouseDown = function(o, event) { WT.capture(null); WT.capture(canvas); dragPreviousXY = WT.pageCoordinates(event); }; this.mouseUp = function(o, event) { if (dragPreviousXY != null) dragPreviousXY = null; }; }); |
|
} | }; | function(APP, canvas) { jQuery.data(canvas, 'obj', this); var self = this; var WT = APP.WT; var vec3 = WT.glMatrix.vec3; var mat3 = WT.glMatrix.mat3; var mat4 = WT.glMatrix.mat4; this.ctx = null; // Placeholders for the initializeGL and paintGL functions, // which will be overwritten by whatever is rendered this.initializeGL = function() {}; this.paintGL = function() {}; var dragPreviousXY = null; var lookAtCenter = null; var lookAtUpDir = null; var lookAtPitchRate = 0; var lookAtYawRate = 0; var cameraMatrix = null; var walkFrontRate = 0; var walkYawRate = 0; this.discoverContext = function() { if (canvas.getContext) { this.ctx = canvas.getContext('experimental-webgl'); if (this.ctx == null) { this.ctx = canvas.getContext('webgl'); } //if (this.ctx == null) { // console.log('WGLWidget: failed to get a webgl context'); //} } return this.ctx; } this.setLookAtParams = function(matrix, center, up, pitchRate, yawRate) { cameraMatrix = matrix; lookAtCenter = center; lookAtUpDir = up; lookAtPitchRate = pitchRate; lookAtYawRate = yawRate; }; this.mouseDragLookAt = function(o, event) { var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var s=vec3.create(); s[0]=cameraMatrix[0]; s[1]=cameraMatrix[4]; s[2]=cameraMatrix[8]; var r=mat4.create(); mat4.identity(r); mat4.translate(r, lookAtCenter); mat4.rotate(r, dy * lookAtPitchRate, s); mat4.rotate(r, dx * lookAtYawRate, lookAtUpDir); vec3.negate(lookAtCenter); mat4.translate(r, lookAtCenter); vec3.negate(lookAtCenter); mat4.multiply(cameraMatrix,r,cameraMatrix); //console.log('mouseDragLookAt after: ' + mat4.str(cameraMatrix)); // Repaint! //console.log('mouseDragLookAt: repaint'); this.paintGl(); // store mouse coord for next action dragPreviousXY = WT.pageCoordinates(event); }; // Mouse wheel = zoom in/out this.mouseWheelLookAt = function(o, event) { WT.cancelEvent(event); //alert('foo'); var d = WT.wheelDelta(event); var s = Math.pow(1.2, d); mat4.translate(cameraMatrix, lookAtCenter); mat4.scale(cameraMatrix, [s, s, s]); vec3.negate(lookAtCenter); mat4.translate(cameraMatrix, lookAtCenter); vec3.negate(lookAtCenter); // Repaint! this.paintGl(); }; this.setWalkParams = function(matrix, frontRate, yawRate) { cameraMatrix = matrix; walkFrontRate = frontRate; walkYawRate = yawRate; }; this.mouseDragWalk = function(o, event){ var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var r=mat4.create(); mat4.identity(r); mat4.rotateY(r, dx * walkYawRate); var t=vec3.create(); t[0]=0; t[1]=0; t[2]=-walkFrontRate * dy; mat4.translate(r, t); mat4.multiply(r, cameraMatrix, cameraMatrix); this.paintGl(); dragPreviousXY = WT.pageCoordinates(event); } this.mouseDown = function(o, event) { WT.capture(null); WT.capture(canvas); dragPreviousXY = WT.pageCoordinates(event); }; this.mouseUp = function(o, event) { if (dragPreviousXY != null) dragPreviousXY = null; }; }); |
this.paintGl(); | this.paintGL(); | function(APP, canvas) { jQuery.data(canvas, 'obj', this); var self = this; var WT = APP.WT; var vec3 = WT.glMatrix.vec3; var mat3 = WT.glMatrix.mat3; var mat4 = WT.glMatrix.mat4; this.ctx = null; // Placeholders for the initializeGL and paintGL functions, // which will be overwritten by whatever is rendered this.initializeGL = function() {}; this.paintGL = function() {}; var dragPreviousXY = null; var lookAtCenter = null; var lookAtUpDir = null; var lookAtPitchRate = 0; var lookAtYawRate = 0; var cameraMatrix = null; var walkFrontRate = 0; var walkYawRate = 0; this.discoverContext = function() { if (canvas.getContext) { this.ctx = canvas.getContext('experimental-webgl'); if (this.ctx == null) { this.ctx = canvas.getContext('webgl'); } //if (this.ctx == null) { // console.log('WGLWidget: failed to get a webgl context'); //} } return this.ctx; } this.setLookAtParams = function(matrix, center, up, pitchRate, yawRate) { cameraMatrix = matrix; lookAtCenter = center; lookAtUpDir = up; lookAtPitchRate = pitchRate; lookAtYawRate = yawRate; }; this.mouseDragLookAt = function(o, event) { var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var s=vec3.create(); s[0]=cameraMatrix[0]; s[1]=cameraMatrix[4]; s[2]=cameraMatrix[8]; var r=mat4.create(); mat4.identity(r); mat4.translate(r, lookAtCenter); mat4.rotate(r, dy * lookAtPitchRate, s); mat4.rotate(r, dx * lookAtYawRate, lookAtUpDir); vec3.negate(lookAtCenter); mat4.translate(r, lookAtCenter); vec3.negate(lookAtCenter); mat4.multiply(cameraMatrix,r,cameraMatrix); //console.log('mouseDragLookAt after: ' + mat4.str(cameraMatrix)); // Repaint! //console.log('mouseDragLookAt: repaint'); this.paintGl(); // store mouse coord for next action dragPreviousXY = WT.pageCoordinates(event); }; // Mouse wheel = zoom in/out this.mouseWheelLookAt = function(o, event) { WT.cancelEvent(event); //alert('foo'); var d = WT.wheelDelta(event); var s = Math.pow(1.2, d); mat4.translate(cameraMatrix, lookAtCenter); mat4.scale(cameraMatrix, [s, s, s]); vec3.negate(lookAtCenter); mat4.translate(cameraMatrix, lookAtCenter); vec3.negate(lookAtCenter); // Repaint! this.paintGl(); }; this.setWalkParams = function(matrix, frontRate, yawRate) { cameraMatrix = matrix; walkFrontRate = frontRate; walkYawRate = yawRate; }; this.mouseDragWalk = function(o, event){ var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var r=mat4.create(); mat4.identity(r); mat4.rotateY(r, dx * walkYawRate); var t=vec3.create(); t[0]=0; t[1]=0; t[2]=-walkFrontRate * dy; mat4.translate(r, t); mat4.multiply(r, cameraMatrix, cameraMatrix); this.paintGl(); dragPreviousXY = WT.pageCoordinates(event); } this.mouseDown = function(o, event) { WT.capture(null); WT.capture(canvas); dragPreviousXY = WT.pageCoordinates(event); }; this.mouseUp = function(o, event) { if (dragPreviousXY != null) dragPreviousXY = null; }; }); |
panel.grid.store.on( 'load', function( store, records, options ) { store.sort( 'version', 'desc' ); }, this ); | Sonatype.Events.addListener('searchTypeInit', function(searchTypes, panel) { searchTypes.splice( 0, 0, { value : 'quick', text : 'Keyword Search', scope : panel, handler : panel.switchSearchType, defaultQuickSearch : true, store : null, showArtifactContainer : function( record ) { return false; }, columnModel : new Ext.grid.ColumnModel({ columns: [ { id: 'group', header: "Group", dataIndex: 'groupId', sortable:true }, { id: 'artifact', header: "Artifact", dataIndex: 'artifactId', sortable:true }, { id: 'version', header: "Version", dataIndex: 'version', sortable:true, renderer: panel.grid.formatVersionLink }, { id: 'packaging', header: "Packaging", dataIndex: 'packaging', sortable:true, renderer: panel.grid.formatPackagingLink }, { id: 'classifier', header: "Classifier", dataIndex: 'classifier', sortable:true, renderer: panel.grid.formatClassifierLink } ] }), quickSearchCheckHandler : function(panel, value) { return true; }, quickSearchHandler : function(panel, value) { panel.getTopToolbar().items.itemAt(1).setRawValue(value); }, searchHandler : function(panel) { var value = panel.getTopToolbar().items.itemAt(1).getRawValue(); if (value) { panel.grid.store.baseParams = {}; panel.grid.store.baseParams['q'] = value; panel.grid.store.baseParams['collapseresults'] = true; panel.fetchRecords(panel); } }, applyBookmarkHandler : function(panel, data) { panel.extraData = null; panel.getTopToolbar().items.itemAt(1).setRawValue(data[1]); panel.startSearch(panel, false); }, getBookmarkHandler : function(panel) { var result = panel.searchTypeButton.value; result += '~'; result += panel.getTopToolbar().items.itemAt(1).getRawValue(); return result; }, panelItems : [ { xtype : 'nexussearchfield', name : 'single-search-field', searchPanel : panel, width : 300 } ] }); }); | panel.grid.store.on( 'load', function( store, records, options ) { store.sort( 'version', 'desc' ); }, this ); |
$(self).bind(name, fn); | if (fn) { $(self).bind(name, fn); } | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.scrollable = { conf: { activeClass: 'active', circular: false, clonedClass: 'cloned', disabledClass: 'disabled', easing: 'swing', initialIndex: 0, item: null, items: '.items', keyboard: true, mousewheel: false, next: '.next', prev: '.prev', speed: 400, vertical: false, wheelSpeed: 0 } }; // get hidden element's width or height even though it's hidden function dim(el, key) { var v = parseInt(el.css(key), 10); if (v) { return v; } var s = el[0].currentStyle; return s && s.width && parseInt(s.width, 10); } function find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } var current; // constructor function Scrollable(root, conf) { // current instance var self = this, fire = root.add(self), itemWrap = root.children(), index = 0, vertical = conf.vertical; if (!current) { current = self; } if (itemWrap.length > 1) { itemWrap = $(conf.items, root); } // methods $.extend(self, { getConf: function() { return conf; }, getIndex: function() { return index; }, getSize: function() { return self.getItems().size(); }, getNaviButtons: function() { return prev.add(next); }, getRoot: function() { return root; }, getItemWrap: function() { return itemWrap; }, getItems: function() { return itemWrap.children(conf.item).not("." + conf.clonedClass); }, move: function(offset, time) { return self.seekTo(index + offset, time); }, next: function(time) { return self.move(1, time); }, prev: function(time) { return self.move(-1, time); }, begin: function(time) { return self.seekTo(0, time); }, end: function(time) { return self.seekTo(self.getSize() -1, time); }, focus: function() { current = self; return self; }, addItem: function(item) { item = $(item); if (!conf.circular) { itemWrap.append(item); } else { itemWrap.children("." + conf.clonedClass + ":last").before(item); itemWrap.children("." + conf.clonedClass + ":first").replaceWith(item.clone().addClass(conf.clonedClass)); } fire.trigger("onAddItem", [item]); return self; }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { // ensure numeric index if (!i.jquery) { i *= 1; } // avoid seeking from end clone to the beginning if (conf.circular && i === 0 && index == -1 && time !== 0) { return self; } // check that index is sane if (!conf.circular && i < 0 || i > self.getSize() || i < -1) { return self; } var item = i; if (i.jquery) { i = self.getItems().index(i); } else { item = self.getItems().eq(i); } // onBeforeSeek var e = $.Event("onBeforeSeek"); if (!fn) { fire.trigger(e, [i, time]); if (e.isDefaultPrevented() || !item.length) { return self; } } var props = vertical ? {top: -item.position().top} : {left: -item.position().left}; index = i; current = self; if (time === undefined) { time = conf.speed; } itemWrap.animate(props, time, conf.easing, fn || function() { fire.trigger("onSeek", [i]); }); return self; } }); // callbacks $.each(['onBeforeSeek', 'onSeek', 'onAddItem'], function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // circular loop if (conf.circular) { var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap), cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); cloned1.add(cloned2).addClass(conf.clonedClass); self.onBeforeSeek(function(e, i, time) { if (e.isDefaultPrevented()) { return; } /* 1. animate to the clone without event triggering 2. seek to correct position with 0 speed */ if (i == -1) { self.seekTo(cloned1, time, function() { self.end(0); }); return e.preventDefault(); } else if (i == self.getSize()) { self.seekTo(cloned2, time, function() { self.begin(0); }); } }); // seek over the cloned item self.seekTo(0, 0, function() {}); } // next/prev buttons var prev = find(root, conf.prev).click(function() { self.prev(); }), next = find(root, conf.next).click(function() { self.next(); }); if (!conf.circular && self.getSize() > 1) { self.onBeforeSeek(function(e, i) { setTimeout(function() { if (!e.isDefaultPrevented()) { prev.toggleClass(conf.disabledClass, i <= 0); next.toggleClass(conf.disabledClass, i >= self.getSize() -1); } }, 1); }); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { if (conf.mousewheel) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; } }); } if (conf.keyboard) { $(document).bind("keydown.scrollable", function(evt) { // skip certain conditions if (!conf.keyboard || evt.altKey || evt.ctrlKey || $(evt.target).is(":input")) { return; } // does this instance have focus? if (conf.keyboard != 'static' && current != self) { return; } var key = evt.keyCode; if (vertical && (key == 38 || key == 40)) { self.move(key == 38 ? -1 : 1); return evt.preventDefault(); } if (!vertical && (key == 37 || key == 39)) { self.move(key == 37 ? -1 : 1); return evt.preventDefault(); } }); } // initial index if (conf.initialIndex) { self.seekTo(conf.initialIndex, 0, function() {}); } } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.data("scrollable"); if (el) { return el; } conf = $.extend({}, $.tools.scrollable.conf, conf); this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
var el = els().eq(index); if (!e.isDefaultPrevented() && el.length) { els().removeClass(cls).eq(index).addClass(cls); } | setTimeout(function() { if (!e.isDefaultPrevented()) { var el = els().eq(index); if (!e.isDefaultPrevented() && el.length) { els().removeClass(cls).eq(index).addClass(cls); } } }, 1); | (function($) { var t = $.tools.scrollable; t.navigator = { conf: { navi: '.navi', naviItem: null, activeClass: 'active', indexed: false, idPrefix: null, // 1.2 history: false } }; function find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } // jQuery plugin implementation $.fn.navigator = function(conf) { // configuration if (typeof conf == 'string') { conf = {navi: conf}; } conf = $.extend({}, t.navigator.conf, conf); var ret; this.each(function() { var api = $(this).data("scrollable"), navi = find(api.getRoot(), conf.navi), buttons = api.getNaviButtons(), cls = conf.activeClass, history = conf.history && $.fn.history; // @deprecated stuff if (api) { ret = api; } api.getNaviButtons = function() { return buttons.add(navi); }; function doClick(el, i, e) { api.seekTo(i); if (history) { if (location.hash) { location.hash = el.attr("href").replace("#", ""); } } else { return e.preventDefault(); } } function els() { return navi.find(conf.naviItem || '> *'); } function addItem(i) { var item = $("<" + (conf.naviItem || 'a') + "/>").click(function(e) { doClick($(this), i, e); }).attr("href", "#" + i); // index number / id attribute if (i === 0) { item.addClass(cls); } if (conf.indexed) { item.text(i + 1); } if (conf.idPrefix) { item.attr("id", conf.idPrefix + i); } return item.appendTo(navi); } // generate navigator if (els().length) { els().each(function(i) { $(this).click(function(e) { doClick($(this), i, e); }); }); } else { $.each(api.getItems(), function(i) { addItem(i); }); } // activate correct entry api.onBeforeSeek(function(e, index) { var el = els().eq(index); if (!e.isDefaultPrevented() && el.length) { els().removeClass(cls).eq(index).addClass(cls); } }); function doHistory(evt, hash) { var el = els().eq(hash.replace("#", "")); if (!el.length) { el = els().filter("[href=" + hash + "]"); } el.click(); } // new item being added api.onAddItem(function(e, item) { item = addItem(api.getItems().index(item)); if (history) { item.history(doHistory); } }); if (history) { els().history(doHistory); } }); return conf.api ? ret : this; }; })(jQuery); |
if(window_top > $(this).offset().top) { show_lazy_graph($(this)); | if(window_top > $(this).position().top) { show_lazy_graph(this); | $('.gc-img').each(function() { window_top = $(window).height() + $(window).scrollTop(); if(window_top > $(this).offset().top) { show_lazy_graph($(this)); } }); |
WT_DECLARE_WT_MEMBER(1,"WSuggestionPopup",function(s,f,x,C,q,y,t){function c(a){return $(a).hasClass("Wt-suggest-onedit")||$(a).hasClass("Wt-suggest-dropdown")}function g(){return f.style.display!="none"}function d(){f.style.display="none"}function m(a){console.log("global"+t);e.positionAtWidget(f.id,a.id,e.Vertical,t)}function o(a){a=e.target(a||window.event);if(a.className!="content"){for(;a&&!e.hasTag(a,"DIV");)a=a.parentNode;a&&u(a)}}function u(a){var b=a.firstChild,k=e.getElement(i),l=b.innerHTML; b=b.getAttribute("sug");k.focus();s.emit(f,"select",a.id,k.id);x(k,l,b);d();i=null}function z(a,b){for(a=b?a.nextSibling:a.previousSibling;a;a=b?a.nextSibling:a.previousSibling)if(e.hasTag(a,"DIV"))if(a.style.display!="none")return a;return null}function F(a){var b=a.parentNode;if(a.offsetTop+a.offsetHeight>b.scrollTop+b.clientHeight)b.scrollTop=a.offsetTop+a.offsetHeight-b.clientHeight;else if(a.offsetTop<b.scrollTop)b.scrollTop=a.offsetTop}$(".Wt-domRoot").add(f);jQuery.data(f,"obj",this);var A= this,e=s.WT,n=null,i=null,G=false,H=null,I=null,B=null,D=null,r=false;this.defaultValue=y;this.showPopup=function(){f.style.display="";D=n=null};this.editMouseMove=function(a,b){if(c(a))a.style.cursor=e.widgetCoordinates(a,b).x>a.offsetWidth-16?"default":""};this.editClick=function(a,b){if(c(a))if(e.widgetCoordinates(a,b).x>a.offsetWidth-16)if(i!=a.id||!g()){d();i=a.id;r=true;A.refilter()}else{i=null;d()}};this.editKeyDown=function(a,b){if(!c(a))return true;if(i!=a.id)if($(a).hasClass("Wt-suggest-onedit")){i= a.id;r=false}else if($(a).hasClass("Wt-suggest-dropdown")&&b.keyCode==40){i=a.id;r=true}else{i=null;return true}var k=n?e.getElement(n):null;if(g()&&k)if(b.keyCode==13||b.keyCode==9){u(k);e.cancelEvent(b);setTimeout(function(){a.focus()},0);return false}else if(b.keyCode==40||b.keyCode==38||b.keyCode==34||b.keyCode==33){if(b.type.toUpperCase()=="KEYDOWN"){G=true;e.cancelEvent(b,e.CancelDefaultAction)}if(b.type.toUpperCase()=="KEYPRESS"&&G==true){e.cancelEvent(b);return false}var l=k,p=b.keyCode== 40||b.keyCode==34;b=b.keyCode==34||b.keyCode==33?f.clientHeight/k.offsetHeight:1;var j;for(j=0;l&&j<b;++j){var v=z(l,p);if(!v)break;l=v}if(l&&e.hasTag(l,"DIV")){k.className="";l.className="sel";n=l.id}return false}return b.keyCode!=13&&b.keyCode!=9};this.filtered=function(a){H=a;A.refilter()};this.refilter=function(){var a=n?e.getElement(n):null,b=e.getElement(i),k=C(b),l=f.lastChild.childNodes,p=k(null);D=b.value;if(q)if(p.length<q&&!r){d();return}else{var j=p.substring(0,q);if(j!=H){if(j!=I){I= j;s.emit(f,"filter",j)}if(!r){d();return}}}var v=j=null;p=r&&p.length==0;var w,J;w=0;for(J=l.length;w<J;++w){var h=l[w];if(e.hasTag(h,"DIV")){if(h.orig==null)h.orig=h.firstChild.innerHTML;var E=k(h.orig),K=p||E.match;if(E.suggestion!=h.firstChild.innerHTML)h.firstChild.innerHTML=E.suggestion;if(K){if(h.style.display!="")h.style.display="";if(j==null)j=h;if(w==this.defaultValue)v=h}else if(h.style.display!="none")h.style.display="none";if(h.className!="")h.className=""}}if(j==null)d();else{if(!g()){m(b); A.showPopup();a=null}if(!a||a.style.display=="none"){a=v||j;a.parentNode.scrollTop=0;n=a.id}a.className="sel";F(a)}};this.editKeyUp=function(a,b){if(i!=null)if(c(a))if(!((b.keyCode==13||b.keyCode==9)&&f.style.display=="none"))if(b.keyCode==27||b.keyCode==37||b.keyCode==39){f.style.display="none";if(b.keyCode==27){i=null;$(a).hasClass("Wt-suggest-dropdown")?d():a.blur()}}else if(a.value!=D)A.refilter();else(a=n?e.getElement(n):null)&&F(a)};f.lastChild.onclick=o;f.lastChild.onscroll=function(){if(B){clearTimeout(B); var a=e.getElement(i);a&&a.focus()}};this.delayHide=function(a){B=setTimeout(function(){B=null;if(f&&(a==null||i==a.id))d()},300)}}); | WT_DECLARE_WT_MEMBER(1,"WSuggestionPopup",function(s,f,w,C,q,x,y){function c(a){return $(a).hasClass("Wt-suggest-onedit")||$(a).hasClass("Wt-suggest-dropdown")}function g(){return f.style.display!="none"}function d(){f.style.display="none"}function m(a){e.positionAtWidget(f.id,a.id,e.Vertical,y)}function o(a){a=e.target(a||window.event);if(a.className!="content"){for(;a&&!e.hasTag(a,"DIV");)a=a.parentNode;a&&t(a)}}function t(a){var b=a.firstChild,k=e.getElement(i),l=b.innerHTML;b=b.getAttribute("sug"); k.focus();s.emit(f,"select",a.id,k.id);w(k,l,b);d();i=null}function z(a,b){for(a=b?a.nextSibling:a.previousSibling;a;a=b?a.nextSibling:a.previousSibling)if(e.hasTag(a,"DIV"))if(a.style.display!="none")return a;return null}function F(a){var b=a.parentNode;if(a.offsetTop+a.offsetHeight>b.scrollTop+b.clientHeight)b.scrollTop=a.offsetTop+a.offsetHeight-b.clientHeight;else if(a.offsetTop<b.scrollTop)b.scrollTop=a.offsetTop}$(".Wt-domRoot").add(f);jQuery.data(f,"obj",this);var A=this,e=s.WT,n=null,i=null, G=false,H=null,I=null,B=null,D=null,r=false;this.defaultValue=x;this.showPopup=function(){f.style.display="";D=n=null};this.editMouseMove=function(a,b){if(c(a))a.style.cursor=e.widgetCoordinates(a,b).x>a.offsetWidth-16?"default":""};this.editClick=function(a,b){if(c(a))if(e.widgetCoordinates(a,b).x>a.offsetWidth-16)if(i!=a.id||!g()){d();i=a.id;r=true;A.refilter()}else{i=null;d()}};this.editKeyDown=function(a,b){if(!c(a))return true;if(i!=a.id)if($(a).hasClass("Wt-suggest-onedit")){i=a.id;r=false}else if($(a).hasClass("Wt-suggest-dropdown")&& b.keyCode==40){i=a.id;r=true}else{i=null;return true}var k=n?e.getElement(n):null;if(g()&&k)if(b.keyCode==13||b.keyCode==9){t(k);e.cancelEvent(b);setTimeout(function(){a.focus()},0);return false}else if(b.keyCode==40||b.keyCode==38||b.keyCode==34||b.keyCode==33){if(b.type.toUpperCase()=="KEYDOWN"){G=true;e.cancelEvent(b,e.CancelDefaultAction)}if(b.type.toUpperCase()=="KEYPRESS"&&G==true){e.cancelEvent(b);return false}var l=k,p=b.keyCode==40||b.keyCode==34;b=b.keyCode==34||b.keyCode==33?f.clientHeight/ k.offsetHeight:1;var j;for(j=0;l&&j<b;++j){var u=z(l,p);if(!u)break;l=u}if(l&&e.hasTag(l,"DIV")){k.className="";l.className="sel";n=l.id}return false}return b.keyCode!=13&&b.keyCode!=9};this.filtered=function(a){H=a;A.refilter()};this.refilter=function(){var a=n?e.getElement(n):null,b=e.getElement(i),k=C(b),l=f.lastChild.childNodes,p=k(null);D=b.value;if(q)if(p.length<q&&!r){d();return}else{var j=p.substring(0,q);if(j!=H){if(j!=I){I=j;s.emit(f,"filter",j)}if(!r){d();return}}}var u=j=null;p=r&&p.length== 0;var v,J;v=0;for(J=l.length;v<J;++v){var h=l[v];if(e.hasTag(h,"DIV")){if(h.orig==null)h.orig=h.firstChild.innerHTML;var E=k(h.orig),K=p||E.match;if(E.suggestion!=h.firstChild.innerHTML)h.firstChild.innerHTML=E.suggestion;if(K){if(h.style.display!="")h.style.display="";if(j==null)j=h;if(v==this.defaultValue)u=h}else if(h.style.display!="none")h.style.display="none";if(h.className!="")h.className=""}}if(j==null)d();else{if(!g()){m(b);A.showPopup();a=null}if(!a||a.style.display=="none"){a=u||j;a.parentNode.scrollTop= 0;n=a.id}a.className="sel";F(a)}};this.editKeyUp=function(a,b){if(i!=null)if(c(a))if(!((b.keyCode==13||b.keyCode==9)&&f.style.display=="none"))if(b.keyCode==27||b.keyCode==37||b.keyCode==39){f.style.display="none";if(b.keyCode==27){i=null;$(a).hasClass("Wt-suggest-dropdown")?d():a.blur()}}else if(a.value!=D)A.refilter();else(a=n?e.getElement(n):null)&&F(a)};f.lastChild.onclick=o;f.lastChild.onscroll=function(){if(B){clearTimeout(B);var a=e.getElement(i);a&&a.focus()}};this.delayHide=function(a){B= setTimeout(function(){B=null;if(f&&(a==null||i==a.id))d()},300)}}); | WT_DECLARE_WT_MEMBER(1,"WSuggestionPopup",function(s,f,x,C,q,y,t){function c(a){return $(a).hasClass("Wt-suggest-onedit")||$(a).hasClass("Wt-suggest-dropdown")}function g(){return f.style.display!="none"}function d(){f.style.display="none"}function m(a){console.log("global"+t);e.positionAtWidget(f.id,a.id,e.Vertical,t)}function o(a){a=e.target(a||window.event);if(a.className!="content"){for(;a&&!e.hasTag(a,"DIV");)a=a.parentNode;a&&u(a)}}function u(a){var b=a.firstChild,k=e.getElement(i),l=b.innerHTML;b=b.getAttribute("sug");k.focus();s.emit(f,"select",a.id,k.id);x(k,l,b);d();i=null}function z(a,b){for(a=b?a.nextSibling:a.previousSibling;a;a=b?a.nextSibling:a.previousSibling)if(e.hasTag(a,"DIV"))if(a.style.display!="none")return a;return null}function F(a){var b=a.parentNode;if(a.offsetTop+a.offsetHeight>b.scrollTop+b.clientHeight)b.scrollTop=a.offsetTop+a.offsetHeight-b.clientHeight;else if(a.offsetTop<b.scrollTop)b.scrollTop=a.offsetTop}$(".Wt-domRoot").add(f);jQuery.data(f,"obj",this);var A=this,e=s.WT,n=null,i=null,G=false,H=null,I=null,B=null,D=null,r=false;this.defaultValue=y;this.showPopup=function(){f.style.display="";D=n=null};this.editMouseMove=function(a,b){if(c(a))a.style.cursor=e.widgetCoordinates(a,b).x>a.offsetWidth-16?"default":""};this.editClick=function(a,b){if(c(a))if(e.widgetCoordinates(a,b).x>a.offsetWidth-16)if(i!=a.id||!g()){d();i=a.id;r=true;A.refilter()}else{i=null;d()}};this.editKeyDown=function(a,b){if(!c(a))return true;if(i!=a.id)if($(a).hasClass("Wt-suggest-onedit")){i=a.id;r=false}else if($(a).hasClass("Wt-suggest-dropdown")&&b.keyCode==40){i=a.id;r=true}else{i=null;return true}var k=n?e.getElement(n):null;if(g()&&k)if(b.keyCode==13||b.keyCode==9){u(k);e.cancelEvent(b);setTimeout(function(){a.focus()},0);return false}else if(b.keyCode==40||b.keyCode==38||b.keyCode==34||b.keyCode==33){if(b.type.toUpperCase()=="KEYDOWN"){G=true;e.cancelEvent(b,e.CancelDefaultAction)}if(b.type.toUpperCase()=="KEYPRESS"&&G==true){e.cancelEvent(b);return false}var l=k,p=b.keyCode==40||b.keyCode==34;b=b.keyCode==34||b.keyCode==33?f.clientHeight/k.offsetHeight:1;var j;for(j=0;l&&j<b;++j){var v=z(l,p);if(!v)break;l=v}if(l&&e.hasTag(l,"DIV")){k.className="";l.className="sel";n=l.id}return false}return b.keyCode!=13&&b.keyCode!=9};this.filtered=function(a){H=a;A.refilter()};this.refilter=function(){var a=n?e.getElement(n):null,b=e.getElement(i),k=C(b),l=f.lastChild.childNodes,p=k(null);D=b.value;if(q)if(p.length<q&&!r){d();return}else{var j=p.substring(0,q);if(j!=H){if(j!=I){I=j;s.emit(f,"filter",j)}if(!r){d();return}}}var v=j=null;p=r&&p.length==0;var w,J;w=0;for(J=l.length;w<J;++w){var h=l[w];if(e.hasTag(h,"DIV")){if(h.orig==null)h.orig=h.firstChild.innerHTML;var E=k(h.orig),K=p||E.match;if(E.suggestion!=h.firstChild.innerHTML)h.firstChild.innerHTML=E.suggestion;if(K){if(h.style.display!="")h.style.display="";if(j==null)j=h;if(w==this.defaultValue)v=h}else if(h.style.display!="none")h.style.display="none";if(h.className!="")h.className=""}}if(j==null)d();else{if(!g()){m(b);A.showPopup();a=null}if(!a||a.style.display=="none"){a=v||j;a.parentNode.scrollTop=0;n=a.id}a.className="sel";F(a)}};this.editKeyUp=function(a,b){if(i!=null)if(c(a))if(!((b.keyCode==13||b.keyCode==9)&&f.style.display=="none"))if(b.keyCode==27||b.keyCode==37||b.keyCode==39){f.style.display="none";if(b.keyCode==27){i=null;$(a).hasClass("Wt-suggest-dropdown")?d():a.blur()}}else if(a.value!=D)A.refilter();else(a=n?e.getElement(n):null)&&F(a)};f.lastChild.onclick=o;f.lastChild.onscroll=function(){if(B){clearTimeout(B);var a=e.getElement(i);a&&a.focus()}};this.delayHide=function(a){B=setTimeout(function(){B=null;if(f&&(a==null||i==a.id))d()},300)}}); |
lazies = lconf === true ? self.getItems() : root.find(lconf.select || lconf); | if (lconf === true) { lconf = "img, :backgroundImage"; } lazies = root.find(lconf.select || lconf); | (function($) { // static constructs $.tools = $.tools || {}; $.tools.scrollable = { conf: { // basics size: 5, vertical: false, speed: 400, keyboard: true, // by default this is the same as size keyboardSteps: null, // other disabledClass: 'disabled', hoverClass: null, clickable: true, activeClass: 'active', easing: 'swing', loop: false, items: '.items', item: null, // navigational elements prev: '.prev', next: '.next', prevPage: '.prevPage', nextPage: '.nextPage', api: false, // 1.2 mousewheel: false, wheelSpeed: 0, lazyload: false // CALLBACKS: onBeforeSeek, onSeek, onReload } }; var current; // constructor function Scrollable(root, conf) { // current instance var self = this, $self = $(this), horizontal = !conf.vertical, wrap = root.children(), index = 0, forward; if (!current) { current = self; } // bind all callbacks from configuration $.each(conf, function(name, fn) { if ($.isFunction(fn)) { $self.bind(name, fn); } }); if (wrap.length > 1) { wrap = $(conf.items, root); } // navigational items can be anywhere when globalNav = true function find(query) { var els = $(query); return conf.globalNav ? els : root.parent().find(query); } // to be used by plugins root.data("finder", find); // get handle to navigational elements var prev = find(conf.prev), next = find(conf.next), prevPage = find(conf.prevPage), nextPage = find(conf.nextPage); // methods $.extend(self, { getIndex: function() { return index; }, getClickIndex: function() { var items = self.getItems(); return items.index(items.filter("." + conf.activeClass)); }, getConf: function() { return conf; }, getSize: function() { return self.getItems().size(); }, getPageAmount: function() { return Math.ceil(this.getSize() / conf.size); }, getPageIndex: function() { return Math.ceil(index / conf.size); }, getNaviButtons: function() { return prev.add(next).add(prevPage).add(nextPage); }, getRoot: function() { return root; }, getItemWrap: function() { return wrap; }, getItems: function() { return wrap.children(conf.item); }, getVisibleItems: function() { return self.getItems().slice(index, index + conf.size); }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { if (i < 0) { i = 0; } // nothing happens if (index === i) { return self; } // function given as second argument if ($.isFunction(time)) { fn = time; } // seeking exceeds the end if (i > self.getSize() - conf.size) { return conf.loop ? self.begin() : this.end(); } var item = self.getItems().eq(i); if (!item.length) { return self; } // onBeforeSeek var e = $.Event("onBeforeSeek"); $self.trigger(e, [i]); if (e.isDefaultPrevented()) { return self; } // get the (possibly altered) speed if (time === undefined || $.isFunction(time)) { time = conf.speed; } function callback() { if (fn) { fn.call(self, i); } $self.trigger("onSeek", [i]); } if (horizontal) { wrap.animate({left: -item.position().left}, time, conf.easing, callback); } else { wrap.animate({top: -item.position().top}, time, conf.easing, callback); } current = self; index = i; // onStart e = $.Event("onStart"); $self.trigger(e, [i]); if (e.isDefaultPrevented()) { return self; } /* default behaviour */ // prev/next buttons disabled flags prev.add(prevPage).toggleClass(conf.disabledClass, i === 0); next.add(nextPage).toggleClass(conf.disabledClass, i >= self.getSize() - conf.size); return self; }, move: function(offset, time, fn) { forward = offset > 0; return this.seekTo(index + offset, time, fn); }, next: function(time, fn) { return this.move(1, time, fn); }, prev: function(time, fn) { return this.move(-1, time, fn); }, movePage: function(offset, time, fn) { forward = offset > 0; var steps = conf.size * offset; var i = index % conf.size; if (i > 0) { steps += (offset > 0 ? -i : conf.size - i); } return this.move(steps, time, fn); }, prevPage: function(time, fn) { return this.movePage(-1, time, fn); }, nextPage: function(time, fn) { return this.movePage(1, time, fn); }, setPage: function(page, time, fn) { return this.seekTo(page * conf.size, time, fn); }, begin: function(time, fn) { forward = false; return this.seekTo(0, time, fn); }, end: function(time, fn) { forward = true; var to = this.getSize() - conf.size; return to > 0 ? this.seekTo(to, time, fn) : self; }, reload: function() { $self.trigger("onReload"); return self; }, focus: function() { current = self; return self; }, getLoader: function() { return loader; }, click: function(i) { var item = self.getItems().eq(i), klass = conf.activeClass, size = conf.size; // check that i is sane if (i < 0 || i >= self.getSize()) { return self; } // size == 1 if (size == 1) { if (conf.loop) { return self.next(); } if (i === 0 || i == self.getSize() -1) { forward = (forward === undefined) ? true : !forward; } return forward === false ? self.prev() : self.next(); } // size == 2 if (size == 2) { if (i == index) { i--; } self.getItems().removeClass(klass); item.addClass(klass); return self.seekTo(i, time, fn); } if (!item.hasClass(klass)) { self.getItems().removeClass(klass); item.addClass(klass); var delta = Math.floor(size / 2); var to = i - delta; // next to last item must work if (to > self.getSize() - size) { to = self.getSize() - size; } if (to !== i) { return self.seekTo(to); } } return self; }, // bind / unbind bind: function(name, fn) { $self.bind(name, fn); return self; }, unbind: function(name) { $self.unbind(name); return self; } }); // callbacks $.each("onBeforeSeek,onStart,onSeek,onReload".split(","), function(i, ev) { self[ev] = function(fn) { return self.bind(ev, fn); }; }); // prev button prev.addClass(conf.disabledClass).click(function() { self.prev(); }); // next button next.click(function() { self.next(); }); // prev page button nextPage.click(function() { self.nextPage(); }); if (self.getSize() < conf.size) { next.add(nextPage).addClass(conf.disabledClass); } // next page button prevPage.addClass(conf.disabledClass).click(function() { self.prevPage(); }); // hover var hc = conf.hoverClass, keyId = "keydown." + Math.random().toString().substring(10); self.onReload(function() { // hovering if (hc) { self.getItems().hover(function() { $(this).addClass(hc); }, function() { $(this).removeClass(hc); }); } // clickable if (conf.clickable) { self.getItems().each(function(i) { $(this).unbind("click.scrollable").bind("click.scrollable", function(e) { if ($(e.target).is("a")) { return; } return self.click(i); }); }); } // keyboard if (conf.keyboard) { // keyboard works on one instance at the time. thus we need to unbind first $(document).unbind(keyId).bind(keyId, function(evt) { // do nothing with CTRL / ALT buttons if (evt.altKey || evt.ctrlKey) { return; } // do nothing for unstatic and unfocused instances if (conf.keyboard != 'static' && current != self) { return; } var s = conf.keyboardSteps; if (horizontal && (evt.keyCode == 37 || evt.keyCode == 39)) { self.move(evt.keyCode == 37 ? -s : s); return evt.preventDefault(); } if (!horizontal && (evt.keyCode == 38 || evt.keyCode == 40)) { self.move(evt.keyCode == 38 ? -s : s); return evt.preventDefault(); } return true; }); } else { $(document).unbind(keyId); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; }); } }); // lazyload support. all logic is here. var lconf = $.tools.lazyload && conf.lazyload, loader, lazies; if (lconf) { lazies = lconf === true ? self.getItems() : root.find(lconf.select || lconf); if (typeof lconf != 'object') { lconf = {}; } $.extend(lconf, { growParent: root, api: true}, lconf); loader = lazies.lazyload(lconf); function load(ev, i) { var els = self.getItems().slice(i, i + conf.size); els.each(function() { els = els.add($(this).find(":unloaded")); }); loader.load(els); } self.onBeforeSeek(load); load(null, 0); } self.reload(); } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.eq(typeof conf == 'number' ? conf : 0).data("scrollable"); if (el) { return el; } var globals = $.extend({}, $.tools.scrollable.conf); conf = $.extend(globals, conf); conf.keyboardSteps = conf.keyboardSteps || conf.size; this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
(function(){function a(h){return h.type==CKEDITOR.NODE_TEXT&&h.getLength()>0;};function b(h){return!(h.type==CKEDITOR.NODE_ELEMENT&&h.isBlockBoundary(CKEDITOR.tools.extend({},CKEDITOR.dtd.$empty,CKEDITOR.dtd.$nonEditable)));};var c=function(){var h=this;return{textNode:h.textNode,offset:h.offset,character:h.textNode?h.textNode.getText().charAt(h.offset):null,hitMatchBoundary:h._.matchBoundary};},d=['find','replace'],e=[['txtFindFind','txtFindReplace'],['txtFindCaseChk','txtReplaceCaseChk'],['txtFindWordChk','txtReplaceWordChk'],['txtFindCyclic','txtReplaceCyclic']];function f(h){var i,j,k,l;i=h==='find'?1:0;j=1-i;var m,n=e.length;for(m=0;m<n;m++){k=this.getContentElement(d[i],e[m][i]);l=this.getContentElement(d[j],e[m][j]);l.setValue(k.getValue());}};var g=function(h,i){var j=new CKEDITOR.style(CKEDITOR.tools.extend({fullMatch:true,childRule:function(){return false;}},h.config.find_highlight)),k=function(w,x){var y=new CKEDITOR.dom.walker(w);y.guard=x?b:null;y.evaluator=a;y.breakOnFalse=true;this._={matchWord:x,walker:y,matchBoundary:false};};k.prototype={next:function(){return this.move();},back:function(){return this.move(true);},move:function(w){var y=this;var x=y.textNode;if(x===null)return c.call(y);y._.matchBoundary=false;if(x&&w&&y.offset>0){y.offset--;return c.call(y);}else if(x&&y.offset<x.getLength()-1){y.offset++;return c.call(y);}else{x=null;while(!x){x=y._.walker[w?'previous':'next'].call(y._.walker);if(y._.matchWord&&!x||y._.walker._.end)break;if(!x&&!b(y._.walker.current))y._.matchBoundary=true;}y.textNode=x;if(x)y.offset=w?x.getLength()-1:0;else y.offset=0;}return c.call(y);}};var l=function(w,x){this._={walker:w,cursors:[],rangeLength:x,highlightRange:null,isMatched:false};};l.prototype={toDomRange:function(){var w=new CKEDITOR.dom.range(h.document),x=this._.cursors;if(x.length<1){var y=this._.walker.textNode;if(y)w.setStartAfter(y);else return null;}else{var z=x[0],A=x[x.length-1];w.setStart(z.textNode,z.offset);w.setEnd(A.textNode,A.offset+1);}return w;},updateFromDomRange:function(w){var z=this;var x,y=new k(w);z._.cursors=[];do{x=y.next();if(x.character)z._.cursors.push(x);}while(x.character)z._.rangeLength=z._.cursors.length;},setMatched:function(){this._.isMatched=true;},clearMatched:function(){this._.isMatched=false;},isMatched:function(){return this._.isMatched;},highlight:function(){var y=this;if(y._.cursors.length<1)return;if(y._.highlightRange)y.removeHighlight();var w=y.toDomRange();j.applyToRange(w);y._.highlightRange=w;var x=w.startContainer; if(x.type!=CKEDITOR.NODE_ELEMENT)x=x.getParent();x.scrollIntoView();y.updateFromDomRange(w);},removeHighlight:function(){var w=this;if(!w._.highlightRange)return;j.removeFromRange(w._.highlightRange);w.updateFromDomRange(w._.highlightRange);w._.highlightRange=null;},moveBack:function(){var y=this;var w=y._.walker.back(),x=y._.cursors;if(w.hitMatchBoundary)y._.cursors=x=[];x.unshift(w);if(x.length>y._.rangeLength)x.pop();return w;},moveNext:function(){var y=this;var w=y._.walker.next(),x=y._.cursors;if(w.hitMatchBoundary)y._.cursors=x=[];x.push(w);if(x.length>y._.rangeLength)x.shift();return w;},getEndCharacter:function(){var w=this._.cursors;if(w.length<1)return null;return w[w.length-1].character;},getNextCharacterRange:function(w){var x,y,z=this._.cursors;if(x=z[z.length-1])y=new k(m(x));else y=this._.walker;return new l(y,w);},getCursors:function(){return this._.cursors;}};function m(w,x){var y=new CKEDITOR.dom.range();y.setStart(w.textNode,x?w.offset:w.offset+1);y.setEndAt(h.document.getBody(),CKEDITOR.POSITION_BEFORE_END);return y;};function n(w){var x=new CKEDITOR.dom.range();x.setStartAt(h.document.getBody(),CKEDITOR.POSITION_AFTER_START);x.setEnd(w.textNode,w.offset);return x;};var o=0,p=1,q=2,r=function(w,x){var y=[-1];if(x)w=w.toLowerCase();for(var z=0;z<w.length;z++){y.push(y[z]+1);while(y[z+1]>0&&w.charAt(z)!=w.charAt(y[z+1]-1))y[z+1]=y[y[z+1]-1]+1;}this._={overlap:y,state:0,ignoreCase:!!x,pattern:w};};r.prototype={feedCharacter:function(w){var x=this;if(x._.ignoreCase)w=w.toLowerCase();for(;;){if(w==x._.pattern.charAt(x._.state)){x._.state++;if(x._.state==x._.pattern.length){x._.state=0;return q;}return p;}else if(!x._.state)return o;else x._.state=x._.overlap[x._.state];}return null;},reset:function(){this._.state=0;}};var s=/[.,"'?!;: \u0085\u00a0\u1680\u280e\u2028\u2029\u202f\u205f\u3000]/,t=function(w){if(!w)return true;var x=w.charCodeAt(0);return x>=9&&x<=13||x>=8192&&x<=8202||s.test(w);},u={searchRange:null,matchRange:null,find:function(w,x,y,z,A,B){var K=this;if(!K.matchRange)K.matchRange=new l(new k(K.searchRange),w.length);else{K.matchRange.removeHighlight();K.matchRange=K.matchRange.getNextCharacterRange(w.length);}var C=new r(w,!x),D=o,E='%';while(E!==null){K.matchRange.moveNext();while(E=K.matchRange.getEndCharacter()){D=C.feedCharacter(E);if(D==q)break;if(K.matchRange.moveNext().hitMatchBoundary)C.reset();}if(D==q){if(y){var F=K.matchRange.getCursors(),G=F[F.length-1],H=F[0],I=new k(n(H),true),J=new k(m(G),true);if(!(t(I.back().character)&&t(J.next().character)))continue; }K.matchRange.setMatched();if(A!==false)K.matchRange.highlight();return true;}}K.matchRange.clearMatched();K.matchRange.removeHighlight();if(z&&!B){K.searchRange=v(true);K.matchRange=null;return arguments.callee.apply(K,Array.prototype.slice.call(arguments).concat([true]));}return false;},replaceCounter:0,replace:function(w,x,y,z,A,B,C){var H=this;var D=false;if(H.matchRange&&H.matchRange.isMatched()&&!H.matchRange._.isReplaced){H.matchRange.removeHighlight();var E=H.matchRange.toDomRange(),F=h.document.createText(y);if(!C){var G=h.getSelection();G.selectRanges([E]);h.fire('saveSnapshot');}E.deleteContents();E.insertNode(F);if(!C){G.selectRanges([E]);h.fire('saveSnapshot');}H.matchRange.updateFromDomRange(E);if(!C)H.matchRange.highlight();H.matchRange._.isReplaced=true;H.replaceCounter++;D=true;}else D=H.find(x,z,A,B,!C);return D;}};function v(w){var x,y=h.getSelection(),z=h.document.getBody();if(y&&!w){x=y.getRanges()[0].clone();x.collapse(true);}else{x=new CKEDITOR.dom.range();x.setStartAt(z,CKEDITOR.POSITION_AFTER_START);}x.setEndAt(z,CKEDITOR.POSITION_BEFORE_END);return x;};return{title:h.lang.findAndReplace.title,resizable:CKEDITOR.DIALOG_RESIZE_NONE,minWidth:350,minHeight:165,buttons:[CKEDITOR.dialog.cancelButton],contents:[{id:'find',label:h.lang.findAndReplace.find,title:h.lang.findAndReplace.find,accessKey:'',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindFind',label:h.lang.findAndReplace.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',align:'left',style:'width:100%',label:h.lang.findAndReplace.find,onClick:function(){var w=this.getDialog();if(!u.find(w.getValueOf('find','txtFindFind'),w.getValueOf('find','txtFindCaseChk'),w.getValueOf('find','txtFindWordChk'),w.getValueOf('find','txtFindCyclic')))alert(h.lang.findAndReplace.notFoundMsg);}}]},{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtFindCaseChk',isChanged:false,style:'margin-top:28px',label:h.lang.findAndReplace.matchCase},{type:'checkbox',id:'txtFindWordChk',isChanged:false,label:h.lang.findAndReplace.matchWord},{type:'checkbox',id:'txtFindCyclic',isChanged:false,'default':true,label:h.lang.findAndReplace.matchCyclic}]}]},{id:'replace',label:h.lang.findAndReplace.replace,accessKey:'M',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindReplace',label:h.lang.findAndReplace.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',align:'left',style:'width:100%',label:h.lang.findAndReplace.replace,onClick:function(){var w=this.getDialog(); if(!u.replace(w,w.getValueOf('replace','txtFindReplace'),w.getValueOf('replace','txtReplace'),w.getValueOf('replace','txtReplaceCaseChk'),w.getValueOf('replace','txtReplaceWordChk'),w.getValueOf('replace','txtReplaceCyclic')))alert(h.lang.findAndReplace.notFoundMsg);}}]},{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtReplace',label:h.lang.findAndReplace.replaceWith,isChanged:false,labelLayout:'horizontal',accessKey:'R'},{type:'button',align:'left',style:'width:100%',label:h.lang.findAndReplace.replaceAll,isChanged:false,onClick:function(){var w=this.getDialog(),x;u.replaceCounter=0;u.searchRange=v(true);if(u.matchRange){u.matchRange.removeHighlight();u.matchRange=null;}h.fire('saveSnapshot');while(u.replace(w,w.getValueOf('replace','txtFindReplace'),w.getValueOf('replace','txtReplace'),w.getValueOf('replace','txtReplaceCaseChk'),w.getValueOf('replace','txtReplaceWordChk'),false,true)){}if(u.replaceCounter){alert(h.lang.findAndReplace.replaceSuccessMsg.replace(/%1/,u.replaceCounter));h.fire('saveSnapshot');}else alert(h.lang.findAndReplace.notFoundMsg);}}]},{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtReplaceCaseChk',isChanged:false,label:h.lang.findAndReplace.matchCase},{type:'checkbox',id:'txtReplaceWordChk',isChanged:false,label:h.lang.findAndReplace.matchWord},{type:'checkbox',id:'txtReplaceCyclic',isChanged:false,'default':true,label:h.lang.findAndReplace.matchCyclic}]}]}],onLoad:function(){var w=this,x,y,z=false;this.on('hide',function(){z=false;});this.on('show',function(){z=true;});this.selectPage=CKEDITOR.tools.override(this.selectPage,function(A){return function(B){A.call(w,B);var C=w._.tabs[B],D,E,F;E=B==='find'?'txtFindFind':'txtFindReplace';F=B==='find'?'txtFindWordChk':'txtReplaceWordChk';x=w.getContentElement(B,E);y=w.getContentElement(B,F);if(!C.initialized){D=CKEDITOR.document.getById(x._.inputId);C.initialized=true;}if(z)f.call(this,B);};});},onShow:function(){u.searchRange=v();this.selectPage(i);},onHide:function(){var w;if(u.matchRange&&u.matchRange.isMatched()){u.matchRange.removeHighlight();h.focus();w=u.matchRange.toDomRange();if(w)h.getSelection().selectRanges([w]);}delete u.matchRange;},onFocus:function(){if(i=='replace')return this.getContentElement('replace','txtFindReplace');else return this.getContentElement('find','txtFindFind');}};};CKEDITOR.dialog.add('find',function(h){return g(h,'find');});CKEDITOR.dialog.add('replace',function(h){return g(h,'replace');});})(); | (function(){var a;function b(i){return i.type==CKEDITOR.NODE_TEXT&&i.getLength()>0&&(!a||!i.isReadOnly());};function c(i){return!(i.type==CKEDITOR.NODE_ELEMENT&&i.isBlockBoundary(CKEDITOR.tools.extend({},CKEDITOR.dtd.$empty,CKEDITOR.dtd.$nonEditable)));};var d=function(){var i=this;return{textNode:i.textNode,offset:i.offset,character:i.textNode?i.textNode.getText().charAt(i.offset):null,hitMatchBoundary:i._.matchBoundary};},e=['find','replace'],f=[['txtFindFind','txtFindReplace'],['txtFindCaseChk','txtReplaceCaseChk'],['txtFindWordChk','txtReplaceWordChk'],['txtFindCyclic','txtReplaceCyclic']];function g(i){var j,k,l,m;j=i==='find'?1:0;k=1-j;var n,o=f.length;for(n=0;n<o;n++){l=this.getContentElement(e[j],f[n][j]);m=this.getContentElement(e[k],f[n][k]);m.setValue(l.getValue());}};var h=function(i,j){var k=new CKEDITOR.style(CKEDITOR.tools.extend({fullMatch:true,childRule:function(){return false;}},i.config.find_highlight)),l=function(x,y){var z=new CKEDITOR.dom.walker(x);z.guard=y?c:null;z.evaluator=b;z.breakOnFalse=true;this._={matchWord:y,walker:z,matchBoundary:false};};l.prototype={next:function(){return this.move();},back:function(){return this.move(true);},move:function(x){var z=this;var y=z.textNode;if(y===null)return d.call(z);z._.matchBoundary=false;if(y&&x&&z.offset>0){z.offset--;return d.call(z);}else if(y&&z.offset<y.getLength()-1){z.offset++;return d.call(z);}else{y=null;while(!y){y=z._.walker[x?'previous':'next'].call(z._.walker);if(z._.matchWord&&!y||z._.walker._.end)break;if(!y&&!c(z._.walker.current))z._.matchBoundary=true;}z.textNode=y;if(y)z.offset=x?y.getLength()-1:0;else z.offset=0;}return d.call(z);}};var m=function(x,y){this._={walker:x,cursors:[],rangeLength:y,highlightRange:null,isMatched:false};};m.prototype={toDomRange:function(){var x=new CKEDITOR.dom.range(i.document),y=this._.cursors;if(y.length<1){var z=this._.walker.textNode;if(z)x.setStartAfter(z);else return null;}else{var A=y[0],B=y[y.length-1];x.setStart(A.textNode,A.offset);x.setEnd(B.textNode,B.offset+1);}return x;},updateFromDomRange:function(x){var A=this;var y,z=new l(x);A._.cursors=[];do{y=z.next();if(y.character)A._.cursors.push(y);}while(y.character)A._.rangeLength=A._.cursors.length;},setMatched:function(){this._.isMatched=true;},clearMatched:function(){this._.isMatched=false;},isMatched:function(){return this._.isMatched;},highlight:function(){var A=this;if(A._.cursors.length<1)return;if(A._.highlightRange)A.removeHighlight();var x=A.toDomRange(),y=x.createBookmark(); k.applyToRange(x);x.moveToBookmark(y);A._.highlightRange=x;var z=x.startContainer;if(z.type!=CKEDITOR.NODE_ELEMENT)z=z.getParent();z.scrollIntoView();A.updateFromDomRange(x);},removeHighlight:function(){var y=this;if(!y._.highlightRange)return;var x=y._.highlightRange.createBookmark();k.removeFromRange(y._.highlightRange);y._.highlightRange.moveToBookmark(x);y.updateFromDomRange(y._.highlightRange);y._.highlightRange=null;},isReadOnly:function(){if(!this._.highlightRange)return 0;return this._.highlightRange.startContainer.isReadOnly();},moveBack:function(){var z=this;var x=z._.walker.back(),y=z._.cursors;if(x.hitMatchBoundary)z._.cursors=y=[];y.unshift(x);if(y.length>z._.rangeLength)y.pop();return x;},moveNext:function(){var z=this;var x=z._.walker.next(),y=z._.cursors;if(x.hitMatchBoundary)z._.cursors=y=[];y.push(x);if(y.length>z._.rangeLength)y.shift();return x;},getEndCharacter:function(){var x=this._.cursors;if(x.length<1)return null;return x[x.length-1].character;},getNextCharacterRange:function(x){var y,z,A=this._.cursors;if((y=A[A.length-1])&&y.textNode)z=new l(n(y));else z=this._.walker;return new m(z,x);},getCursors:function(){return this._.cursors;}};function n(x,y){var z=new CKEDITOR.dom.range();z.setStart(x.textNode,y?x.offset:x.offset+1);z.setEndAt(i.document.getBody(),CKEDITOR.POSITION_BEFORE_END);return z;};function o(x){var y=new CKEDITOR.dom.range();y.setStartAt(i.document.getBody(),CKEDITOR.POSITION_AFTER_START);y.setEnd(x.textNode,x.offset);return y;};var p=0,q=1,r=2,s=function(x,y){var z=[-1];if(y)x=x.toLowerCase();for(var A=0;A<x.length;A++){z.push(z[A]+1);while(z[A+1]>0&&x.charAt(A)!=x.charAt(z[A+1]-1))z[A+1]=z[z[A+1]-1]+1;}this._={overlap:z,state:0,ignoreCase:!!y,pattern:x};};s.prototype={feedCharacter:function(x){var y=this;if(y._.ignoreCase)x=x.toLowerCase();for(;;){if(x==y._.pattern.charAt(y._.state)){y._.state++;if(y._.state==y._.pattern.length){y._.state=0;return r;}return q;}else if(!y._.state)return p;else y._.state=y._.overlap[y._.state];}return null;},reset:function(){this._.state=0;}};var t=/[.,"'?!;: \u0085\u00a0\u1680\u280e\u2028\u2029\u202f\u205f\u3000]/,u=function(x){if(!x)return true;var y=x.charCodeAt(0);return y>=9&&y<=13||y>=8192&&y<=8202||t.test(x);},v={searchRange:null,matchRange:null,find:function(x,y,z,A,B,C){var L=this;if(!L.matchRange)L.matchRange=new m(new l(L.searchRange),x.length);else{L.matchRange.removeHighlight();L.matchRange=L.matchRange.getNextCharacterRange(x.length);}var D=new s(x,!y),E=p,F='%';while(F!==null){L.matchRange.moveNext(); while(F=L.matchRange.getEndCharacter()){E=D.feedCharacter(F);if(E==r)break;if(L.matchRange.moveNext().hitMatchBoundary)D.reset();}if(E==r){if(z){var G=L.matchRange.getCursors(),H=G[G.length-1],I=G[0],J=new l(o(I),true),K=new l(n(H),true);if(!(u(J.back().character)&&u(K.next().character)))continue;}L.matchRange.setMatched();if(B!==false)L.matchRange.highlight();return true;}}L.matchRange.clearMatched();L.matchRange.removeHighlight();if(A&&!C){L.searchRange=w(true);L.matchRange=null;return arguments.callee.apply(L,Array.prototype.slice.call(arguments).concat([true]));}return false;},replaceCounter:0,replace:function(x,y,z,A,B,C,D){var I=this;a=1;var E=false;if(I.matchRange&&I.matchRange.isMatched()&&!I.matchRange._.isReplaced&&!I.matchRange.isReadOnly()){I.matchRange.removeHighlight();var F=I.matchRange.toDomRange(),G=i.document.createText(z);if(!D){var H=i.getSelection();H.selectRanges([F]);i.fire('saveSnapshot');}F.deleteContents();F.insertNode(G);if(!D){H.selectRanges([F]);i.fire('saveSnapshot');}I.matchRange.updateFromDomRange(F);if(!D)I.matchRange.highlight();I.matchRange._.isReplaced=true;I.replaceCounter++;E=true;}else E=I.find(y,A,B,C,!D);a=0;return E;}};function w(x){var y,z=i.getSelection(),A=i.document.getBody();if(z&&!x){y=z.getRanges()[0].clone();y.collapse(true);}else{y=new CKEDITOR.dom.range();y.setStartAt(A,CKEDITOR.POSITION_AFTER_START);}y.setEndAt(A,CKEDITOR.POSITION_BEFORE_END);return y;};return{title:i.lang.findAndReplace.title,resizable:CKEDITOR.DIALOG_RESIZE_NONE,minWidth:350,minHeight:165,buttons:[CKEDITOR.dialog.cancelButton],contents:[{id:'find',label:i.lang.findAndReplace.find,title:i.lang.findAndReplace.find,accessKey:'',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindFind',label:i.lang.findAndReplace.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',align:'left',style:'width:100%',label:i.lang.findAndReplace.find,onClick:function(){var x=this.getDialog();if(!v.find(x.getValueOf('find','txtFindFind'),x.getValueOf('find','txtFindCaseChk'),x.getValueOf('find','txtFindWordChk'),x.getValueOf('find','txtFindCyclic')))alert(i.lang.findAndReplace.notFoundMsg);}}]},{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtFindCaseChk',isChanged:false,style:'margin-top:28px',label:i.lang.findAndReplace.matchCase},{type:'checkbox',id:'txtFindWordChk',isChanged:false,label:i.lang.findAndReplace.matchWord},{type:'checkbox',id:'txtFindCyclic',isChanged:false,'default':true,label:i.lang.findAndReplace.matchCyclic}]}]},{id:'replace',label:i.lang.findAndReplace.replace,accessKey:'M',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindReplace',label:i.lang.findAndReplace.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',align:'left',style:'width:100%',label:i.lang.findAndReplace.replace,onClick:function(){var x=this.getDialog(); if(!v.replace(x,x.getValueOf('replace','txtFindReplace'),x.getValueOf('replace','txtReplace'),x.getValueOf('replace','txtReplaceCaseChk'),x.getValueOf('replace','txtReplaceWordChk'),x.getValueOf('replace','txtReplaceCyclic')))alert(i.lang.findAndReplace.notFoundMsg);}}]},{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtReplace',label:i.lang.findAndReplace.replaceWith,isChanged:false,labelLayout:'horizontal',accessKey:'R'},{type:'button',align:'left',style:'width:100%',label:i.lang.findAndReplace.replaceAll,isChanged:false,onClick:function(){var x=this.getDialog(),y;v.replaceCounter=0;v.searchRange=w(true);if(v.matchRange){v.matchRange.removeHighlight();v.matchRange=null;}i.fire('saveSnapshot');while(v.replace(x,x.getValueOf('replace','txtFindReplace'),x.getValueOf('replace','txtReplace'),x.getValueOf('replace','txtReplaceCaseChk'),x.getValueOf('replace','txtReplaceWordChk'),false,true)){}if(v.replaceCounter){alert(i.lang.findAndReplace.replaceSuccessMsg.replace(/%1/,v.replaceCounter));i.fire('saveSnapshot');}else alert(i.lang.findAndReplace.notFoundMsg);}}]},{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtReplaceCaseChk',isChanged:false,label:i.lang.findAndReplace.matchCase},{type:'checkbox',id:'txtReplaceWordChk',isChanged:false,label:i.lang.findAndReplace.matchWord},{type:'checkbox',id:'txtReplaceCyclic',isChanged:false,'default':true,label:i.lang.findAndReplace.matchCyclic}]}]}],onLoad:function(){var x=this,y,z,A=false;this.on('hide',function(){A=false;});this.on('show',function(){A=true;});this.selectPage=CKEDITOR.tools.override(this.selectPage,function(B){return function(C){B.call(x,C);var D=x._.tabs[C],E,F,G;F=C==='find'?'txtFindFind':'txtFindReplace';G=C==='find'?'txtFindWordChk':'txtReplaceWordChk';y=x.getContentElement(C,F);z=x.getContentElement(C,G);if(!D.initialized){E=CKEDITOR.document.getById(y._.inputId);D.initialized=true;}if(A)g.call(this,C);};});},onShow:function(){v.searchRange=w();this.selectPage(j);},onHide:function(){var x;if(v.matchRange&&v.matchRange.isMatched()){v.matchRange.removeHighlight();i.focus();x=v.matchRange.toDomRange();if(x)i.getSelection().selectRanges([x]);}delete v.matchRange;},onFocus:function(){if(j=='replace')return this.getContentElement('replace','txtFindReplace');else return this.getContentElement('find','txtFindFind');}};};CKEDITOR.dialog.add('find',function(i){return h(i,'find');});CKEDITOR.dialog.add('replace',function(i){return h(i,'replace');});})(); | (function(){function a(h){return h.type==CKEDITOR.NODE_TEXT&&h.getLength()>0;};function b(h){return!(h.type==CKEDITOR.NODE_ELEMENT&&h.isBlockBoundary(CKEDITOR.tools.extend({},CKEDITOR.dtd.$empty,CKEDITOR.dtd.$nonEditable)));};var c=function(){var h=this;return{textNode:h.textNode,offset:h.offset,character:h.textNode?h.textNode.getText().charAt(h.offset):null,hitMatchBoundary:h._.matchBoundary};},d=['find','replace'],e=[['txtFindFind','txtFindReplace'],['txtFindCaseChk','txtReplaceCaseChk'],['txtFindWordChk','txtReplaceWordChk'],['txtFindCyclic','txtReplaceCyclic']];function f(h){var i,j,k,l;i=h==='find'?1:0;j=1-i;var m,n=e.length;for(m=0;m<n;m++){k=this.getContentElement(d[i],e[m][i]);l=this.getContentElement(d[j],e[m][j]);l.setValue(k.getValue());}};var g=function(h,i){var j=new CKEDITOR.style(CKEDITOR.tools.extend({fullMatch:true,childRule:function(){return false;}},h.config.find_highlight)),k=function(w,x){var y=new CKEDITOR.dom.walker(w);y.guard=x?b:null;y.evaluator=a;y.breakOnFalse=true;this._={matchWord:x,walker:y,matchBoundary:false};};k.prototype={next:function(){return this.move();},back:function(){return this.move(true);},move:function(w){var y=this;var x=y.textNode;if(x===null)return c.call(y);y._.matchBoundary=false;if(x&&w&&y.offset>0){y.offset--;return c.call(y);}else if(x&&y.offset<x.getLength()-1){y.offset++;return c.call(y);}else{x=null;while(!x){x=y._.walker[w?'previous':'next'].call(y._.walker);if(y._.matchWord&&!x||y._.walker._.end)break;if(!x&&!b(y._.walker.current))y._.matchBoundary=true;}y.textNode=x;if(x)y.offset=w?x.getLength()-1:0;else y.offset=0;}return c.call(y);}};var l=function(w,x){this._={walker:w,cursors:[],rangeLength:x,highlightRange:null,isMatched:false};};l.prototype={toDomRange:function(){var w=new CKEDITOR.dom.range(h.document),x=this._.cursors;if(x.length<1){var y=this._.walker.textNode;if(y)w.setStartAfter(y);else return null;}else{var z=x[0],A=x[x.length-1];w.setStart(z.textNode,z.offset);w.setEnd(A.textNode,A.offset+1);}return w;},updateFromDomRange:function(w){var z=this;var x,y=new k(w);z._.cursors=[];do{x=y.next();if(x.character)z._.cursors.push(x);}while(x.character)z._.rangeLength=z._.cursors.length;},setMatched:function(){this._.isMatched=true;},clearMatched:function(){this._.isMatched=false;},isMatched:function(){return this._.isMatched;},highlight:function(){var y=this;if(y._.cursors.length<1)return;if(y._.highlightRange)y.removeHighlight();var w=y.toDomRange();j.applyToRange(w);y._.highlightRange=w;var x=w.startContainer;if(x.type!=CKEDITOR.NODE_ELEMENT)x=x.getParent();x.scrollIntoView();y.updateFromDomRange(w);},removeHighlight:function(){var w=this;if(!w._.highlightRange)return;j.removeFromRange(w._.highlightRange);w.updateFromDomRange(w._.highlightRange);w._.highlightRange=null;},moveBack:function(){var y=this;var w=y._.walker.back(),x=y._.cursors;if(w.hitMatchBoundary)y._.cursors=x=[];x.unshift(w);if(x.length>y._.rangeLength)x.pop();return w;},moveNext:function(){var y=this;var w=y._.walker.next(),x=y._.cursors;if(w.hitMatchBoundary)y._.cursors=x=[];x.push(w);if(x.length>y._.rangeLength)x.shift();return w;},getEndCharacter:function(){var w=this._.cursors;if(w.length<1)return null;return w[w.length-1].character;},getNextCharacterRange:function(w){var x,y,z=this._.cursors;if(x=z[z.length-1])y=new k(m(x));else y=this._.walker;return new l(y,w);},getCursors:function(){return this._.cursors;}};function m(w,x){var y=new CKEDITOR.dom.range();y.setStart(w.textNode,x?w.offset:w.offset+1);y.setEndAt(h.document.getBody(),CKEDITOR.POSITION_BEFORE_END);return y;};function n(w){var x=new CKEDITOR.dom.range();x.setStartAt(h.document.getBody(),CKEDITOR.POSITION_AFTER_START);x.setEnd(w.textNode,w.offset);return x;};var o=0,p=1,q=2,r=function(w,x){var y=[-1];if(x)w=w.toLowerCase();for(var z=0;z<w.length;z++){y.push(y[z]+1);while(y[z+1]>0&&w.charAt(z)!=w.charAt(y[z+1]-1))y[z+1]=y[y[z+1]-1]+1;}this._={overlap:y,state:0,ignoreCase:!!x,pattern:w};};r.prototype={feedCharacter:function(w){var x=this;if(x._.ignoreCase)w=w.toLowerCase();for(;;){if(w==x._.pattern.charAt(x._.state)){x._.state++;if(x._.state==x._.pattern.length){x._.state=0;return q;}return p;}else if(!x._.state)return o;else x._.state=x._.overlap[x._.state];}return null;},reset:function(){this._.state=0;}};var s=/[.,"'?!;: \u0085\u00a0\u1680\u280e\u2028\u2029\u202f\u205f\u3000]/,t=function(w){if(!w)return true;var x=w.charCodeAt(0);return x>=9&&x<=13||x>=8192&&x<=8202||s.test(w);},u={searchRange:null,matchRange:null,find:function(w,x,y,z,A,B){var K=this;if(!K.matchRange)K.matchRange=new l(new k(K.searchRange),w.length);else{K.matchRange.removeHighlight();K.matchRange=K.matchRange.getNextCharacterRange(w.length);}var C=new r(w,!x),D=o,E='%';while(E!==null){K.matchRange.moveNext();while(E=K.matchRange.getEndCharacter()){D=C.feedCharacter(E);if(D==q)break;if(K.matchRange.moveNext().hitMatchBoundary)C.reset();}if(D==q){if(y){var F=K.matchRange.getCursors(),G=F[F.length-1],H=F[0],I=new k(n(H),true),J=new k(m(G),true);if(!(t(I.back().character)&&t(J.next().character)))continue;}K.matchRange.setMatched();if(A!==false)K.matchRange.highlight();return true;}}K.matchRange.clearMatched();K.matchRange.removeHighlight();if(z&&!B){K.searchRange=v(true);K.matchRange=null;return arguments.callee.apply(K,Array.prototype.slice.call(arguments).concat([true]));}return false;},replaceCounter:0,replace:function(w,x,y,z,A,B,C){var H=this;var D=false;if(H.matchRange&&H.matchRange.isMatched()&&!H.matchRange._.isReplaced){H.matchRange.removeHighlight();var E=H.matchRange.toDomRange(),F=h.document.createText(y);if(!C){var G=h.getSelection();G.selectRanges([E]);h.fire('saveSnapshot');}E.deleteContents();E.insertNode(F);if(!C){G.selectRanges([E]);h.fire('saveSnapshot');}H.matchRange.updateFromDomRange(E);if(!C)H.matchRange.highlight();H.matchRange._.isReplaced=true;H.replaceCounter++;D=true;}else D=H.find(x,z,A,B,!C);return D;}};function v(w){var x,y=h.getSelection(),z=h.document.getBody();if(y&&!w){x=y.getRanges()[0].clone();x.collapse(true);}else{x=new CKEDITOR.dom.range();x.setStartAt(z,CKEDITOR.POSITION_AFTER_START);}x.setEndAt(z,CKEDITOR.POSITION_BEFORE_END);return x;};return{title:h.lang.findAndReplace.title,resizable:CKEDITOR.DIALOG_RESIZE_NONE,minWidth:350,minHeight:165,buttons:[CKEDITOR.dialog.cancelButton],contents:[{id:'find',label:h.lang.findAndReplace.find,title:h.lang.findAndReplace.find,accessKey:'',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindFind',label:h.lang.findAndReplace.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',align:'left',style:'width:100%',label:h.lang.findAndReplace.find,onClick:function(){var w=this.getDialog();if(!u.find(w.getValueOf('find','txtFindFind'),w.getValueOf('find','txtFindCaseChk'),w.getValueOf('find','txtFindWordChk'),w.getValueOf('find','txtFindCyclic')))alert(h.lang.findAndReplace.notFoundMsg);}}]},{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtFindCaseChk',isChanged:false,style:'margin-top:28px',label:h.lang.findAndReplace.matchCase},{type:'checkbox',id:'txtFindWordChk',isChanged:false,label:h.lang.findAndReplace.matchWord},{type:'checkbox',id:'txtFindCyclic',isChanged:false,'default':true,label:h.lang.findAndReplace.matchCyclic}]}]},{id:'replace',label:h.lang.findAndReplace.replace,accessKey:'M',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindReplace',label:h.lang.findAndReplace.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',align:'left',style:'width:100%',label:h.lang.findAndReplace.replace,onClick:function(){var w=this.getDialog();if(!u.replace(w,w.getValueOf('replace','txtFindReplace'),w.getValueOf('replace','txtReplace'),w.getValueOf('replace','txtReplaceCaseChk'),w.getValueOf('replace','txtReplaceWordChk'),w.getValueOf('replace','txtReplaceCyclic')))alert(h.lang.findAndReplace.notFoundMsg);}}]},{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtReplace',label:h.lang.findAndReplace.replaceWith,isChanged:false,labelLayout:'horizontal',accessKey:'R'},{type:'button',align:'left',style:'width:100%',label:h.lang.findAndReplace.replaceAll,isChanged:false,onClick:function(){var w=this.getDialog(),x;u.replaceCounter=0;u.searchRange=v(true);if(u.matchRange){u.matchRange.removeHighlight();u.matchRange=null;}h.fire('saveSnapshot');while(u.replace(w,w.getValueOf('replace','txtFindReplace'),w.getValueOf('replace','txtReplace'),w.getValueOf('replace','txtReplaceCaseChk'),w.getValueOf('replace','txtReplaceWordChk'),false,true)){}if(u.replaceCounter){alert(h.lang.findAndReplace.replaceSuccessMsg.replace(/%1/,u.replaceCounter));h.fire('saveSnapshot');}else alert(h.lang.findAndReplace.notFoundMsg);}}]},{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtReplaceCaseChk',isChanged:false,label:h.lang.findAndReplace.matchCase},{type:'checkbox',id:'txtReplaceWordChk',isChanged:false,label:h.lang.findAndReplace.matchWord},{type:'checkbox',id:'txtReplaceCyclic',isChanged:false,'default':true,label:h.lang.findAndReplace.matchCyclic}]}]}],onLoad:function(){var w=this,x,y,z=false;this.on('hide',function(){z=false;});this.on('show',function(){z=true;});this.selectPage=CKEDITOR.tools.override(this.selectPage,function(A){return function(B){A.call(w,B);var C=w._.tabs[B],D,E,F;E=B==='find'?'txtFindFind':'txtFindReplace';F=B==='find'?'txtFindWordChk':'txtReplaceWordChk';x=w.getContentElement(B,E);y=w.getContentElement(B,F);if(!C.initialized){D=CKEDITOR.document.getById(x._.inputId);C.initialized=true;}if(z)f.call(this,B);};});},onShow:function(){u.searchRange=v();this.selectPage(i);},onHide:function(){var w;if(u.matchRange&&u.matchRange.isMatched()){u.matchRange.removeHighlight();h.focus();w=u.matchRange.toDomRange();if(w)h.getSelection().selectRanges([w]);}delete u.matchRange;},onFocus:function(){if(i=='replace')return this.getContentElement('replace','txtFindReplace');else return this.getContentElement('find','txtFindFind');}};};CKEDITOR.dialog.add('find',function(h){return g(h,'find');});CKEDITOR.dialog.add('replace',function(h){return g(h,'replace');});})(); |
titlebar.onmousedown = function(event) { var e = event||window.event; WT.capture(titlebar); var pc = WT.pageCoordinates(e); dsx = pc.x; dsy = pc.y; | if (titlebar) { titlebar.onmousedown = function(event) { var e = event||window.event; WT.capture(titlebar); var pc = WT.pageCoordinates(e); dsx = pc.x; dsy = pc.y; | function(APP, el) { jQuery.data(el, 'obj', this); var self = this; var titlebar = $(el).find(".titlebar").first().get(0); var WT = APP.WT; var dsx, dsy; var moved = false; function handleMove(event) { var e = event||window.event; var nowxy = WT.pageCoordinates(e); moved = true; el.style.left = (WT.pxself(el, 'left') + nowxy.x - dsx) + 'px'; el.style.top = (WT.pxself(el, 'top') + nowxy.y - dsy) + 'px'; dsx = nowxy.x; dsy = nowxy.y; }; titlebar.onmousedown = function(event) { var e = event||window.event; WT.capture(titlebar); var pc = WT.pageCoordinates(e); dsx = pc.x; dsy = pc.y; titlebar.onmousemove = handleMove; }; titlebar.onmouseup = function(event) { titlebar.onmousemove = null; WT.capture(null); }; this.centerDialog = function() { if (el.parentNode == null) { el = titlebar = null; this.centerDialog = function() { }; return; } if (el.style.display != 'none') { if (!moved) { var ws = WT.windowSize(); el.style.left = Math.round((ws.x - el.clientWidth)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - el.clientHeight)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; } el.style.visibility = 'visible'; } }; this.wtResize = function(self, w, h) { h -= 2; w -= 2; // 2 = dialog border self.style.height= h + 'px'; self.style.width= w + 'px'; var c = self.lastChild; var t = c.previousSibling; h -= t.offsetHeight + 8; // 8 = body padding if (h > 0) c.style.height = h + 'px'; }; }); |
WT.capture(null); }; | WT.capture(null); }; } | function(APP, el) { jQuery.data(el, 'obj', this); var self = this; var titlebar = $(el).find(".titlebar").first().get(0); var WT = APP.WT; var dsx, dsy; var moved = false; function handleMove(event) { var e = event||window.event; var nowxy = WT.pageCoordinates(e); moved = true; el.style.left = (WT.pxself(el, 'left') + nowxy.x - dsx) + 'px'; el.style.top = (WT.pxself(el, 'top') + nowxy.y - dsy) + 'px'; dsx = nowxy.x; dsy = nowxy.y; }; titlebar.onmousedown = function(event) { var e = event||window.event; WT.capture(titlebar); var pc = WT.pageCoordinates(e); dsx = pc.x; dsy = pc.y; titlebar.onmousemove = handleMove; }; titlebar.onmouseup = function(event) { titlebar.onmousemove = null; WT.capture(null); }; this.centerDialog = function() { if (el.parentNode == null) { el = titlebar = null; this.centerDialog = function() { }; return; } if (el.style.display != 'none') { if (!moved) { var ws = WT.windowSize(); el.style.left = Math.round((ws.x - el.clientWidth)/2 + (WT.isIE6 ? document.documentElement.scrollLeft : 0)) + 'px'; el.style.top = Math.round((ws.y - el.clientHeight)/2 + (WT.isIE6 ? document.documentElement.scrollTop : 0)) + 'px'; el.style.marginLeft='0px'; el.style.marginTop='0px'; } el.style.visibility = 'visible'; } }; this.wtResize = function(self, w, h) { h -= 2; w -= 2; // 2 = dialog border self.style.height= h + 'px'; self.style.width= w + 'px'; var c = self.lastChild; var t = c.previousSibling; h -= t.offsetHeight + 8; // 8 = body padding if (h > 0) c.style.height = h + 'px'; }; }); |
lazies = lconf === true ? panes : root.find(lconf.select || lconf); | if (lconf === true) { lconf = "img, :backgroundImage"; } lazies = root.find(lconf.select || lconf); | (function($) { // static constructs $.tools = $.tools || {}; $.tools.tabs = { version: '@VERSION', conf: { tabs: 'a', current: 'current', onBeforeClick: null, onClick: null, effect: 'default', initialIndex: 0, event: 'click', api: false, rotate: false, // 1.2 lazyload: false, history: false }, addEffect: function(name, fn) { effects[name] = fn; } }, effects = { // simple "toggle" effect 'default': function(i, done) { this.getPanes().hide().eq(i).show(); done.call(); }, /* configuration: - fadeOutSpeed (positive value does "crossfading") - fadeInSpeed */ fade: function(i, done) { var conf = this.getConf(), speed = conf.fadeOutSpeed, panes = this.getPanes(); if (speed) { panes.fadeOut(speed); } else { panes.hide(); } panes.eq(i).fadeIn(conf.fadeInSpeed, done); }, // for basic accordions slide: function(i, done) { this.getPanes().slideUp(200); this.getPanes().eq(i).slideDown(400, done); }, /** * AJAX effect * * @deprecated use util.loader instead */ ajax: function(i, done) { this.getPanes().eq(0).load(this.getTabs().eq(i).attr("href"), done); } }; var w; /** * Horizontal accordion * * @deprecated will be replaced with a more robust implementation */ $.tools.tabs.addEffect("horizontal", function(i, done) { // store original width of a pane into memory if (!w) { w = this.getPanes().eq(0).width(); } // set current pane's width to zero this.getCurrentPane().animate({width: 0}, function() { $(this).hide(); }); // grow opened pane to it's original width this.getPanes().eq(i).animate({width: w}, function() { $(this).show(); done.call(); }); }); function Tabs(tabs, panes, conf) { var self = this, $self = $(this), root = panes.parent(), current; // public methods $.extend(this, { click: function(i, e) { var pane = self.getCurrentPane(), tab = tabs.eq(i); if (typeof i == 'string' && i.replace("#", "")) { tab = tabs.filter("[href*=" + i.replace("#", "") + "]"); i = Math.max(tabs.index(tab), 0); } if (conf.rotate) { var last = tabs.length -1; if (i < 0) { return self.click(last, e); } if (i > last) { return self.click(0, e); } } if (!tab.length) { if (current >= 0) { return self; } i = conf.initialIndex; tab = tabs.eq(i); } // current tab is being clicked if (i === current) { return self; } // possibility to cancel click action e = e || $.Event(); e.type = "onBeforeClick"; $self.trigger(e, [i]); if (e.isDefaultPrevented()) { return; } // call the effect effects[conf.effect].call(self, i, function() { // onClick callback e.type = "onClick"; $self.trigger(e, [i]); }); // default behaviour current = i; tabs.removeClass(conf.current); tab.addClass(conf.current); return self; }, getConf: function() { return conf; }, getTabs: function() { return tabs; }, getPanes: function() { return panes; }, getCurrentPane: function() { return panes.eq(current); }, getCurrentTab: function() { return tabs.eq(current); }, getLoader: function() { return loader; }, getIndex: function() { return current; }, next: function() { return self.click(current + 1); }, prev: function() { return self.click(current - 1); }, bind: function(name, fn) { $self.bind(name, fn); return self; }, onBeforeClick: function(fn) { return this.bind("onBeforeClick", fn); }, onClick: function(fn) { return this.bind("onClick", fn); }, unbind: function(name) { $self.unbind(name); return self; } }); // bind all callbacks from configuration $.each(conf, function(name, fn) { if ($.isFunction(fn)) { $self.bind(name, fn); } }); // setup click actions for each tab tabs.each(function(i) { $(this).bind(conf.event, function(e) { self.click(i, e); return false; }); }); // cross tab anchor link panes.find("a[href^=#]").click(function(e) { self.click($(this).attr("href"), e); }); // history support if (conf.history && $.fn.history) { // enable history support tabs.history(function(evt, hash) { if (!hash || hash == '#') { hash = conf.initialIndex; } self.click(hash); }); // tab clicks perform their original action tabs.click(function(e) { location.hash = $(this).attr("href").replace("#", ""); }); } // lazyload support. all logic is here. var lconf = $.tools.lazyload && conf.lazyload, loader, lazies; if (lconf) { lazies = lconf === true ? panes : root.find(lconf.select || lconf); if (typeof lconf != 'object') { lconf = {}; } $.extend(lconf, { growParent: root, api: true}, lconf); loader = lazies.lazyload(lconf); self.onBeforeClick(function(e, i) { loader.load(panes.eq(i).find(":unloaded").andSelf()); }); } // open initial tab if (location.hash) { self.click(location.hash); } else { if (conf.initialIndex === 0 || conf.initialIndex > 0) { self.click(conf.initialIndex); } } } // jQuery plugin implementation $.fn.tabs = function(query, conf) { // return existing instance var el = this.eq(typeof conf == 'number' ? conf : 0).data("tabs"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeClick: conf}; } // setup options var globals = $.extend({}, $.tools.tabs.conf), len = this.length; conf = $.extend(globals, conf); // install tabs for each items in jQuery this.each(function(i) { var root = $(this); // find tabs var els = root.find(conf.tabs); if (!els.length) { els = root.children(); } // find panes var panes = query.jquery ? query : root.children(query); if (!panes.length) { panes = len == 1 ? $(query) : root.parent().find(query); } el = new Tabs(els, panes, conf); root.data("tabs", el); }); return conf.api ? el: this; }; }) (jQuery); |
return self.seekTo(i, time, fn); | return self.seekTo(i); | (function($) { // static constructs $.tools = $.tools || {}; $.tools.scrollable = { conf: { // basics size: 5, vertical: false, speed: 400, keyboard: true, // by default this is the same as size keyboardSteps: null, // other disabledClass: 'disabled', hoverClass: null, clickable: true, activeClass: 'active', easing: 'swing', loop: false, items: '.items', item: null, // navigational elements prev: '.prev', next: '.next', prevPage: '.prevPage', nextPage: '.nextPage', api: false, // 1.2 mousewheel: false, wheelSpeed: 0, lazyload: false // CALLBACKS: onBeforeSeek, onSeek, onReload } }; var current; // constructor function Scrollable(root, conf) { // current instance var self = this, $self = $(this), horizontal = !conf.vertical, wrap = root.children(), index = 0, forward; if (!current) { current = self; } // bind all callbacks from configuration $.each(conf, function(name, fn) { if ($.isFunction(fn)) { $self.bind(name, fn); } }); if (wrap.length > 1) { wrap = $(conf.items, root); } // navigational items can be anywhere when globalNav = true function find(query) { var els = $(query); return conf.globalNav ? els : root.parent().find(query); } // to be used by plugins root.data("finder", find); // get handle to navigational elements var prev = find(conf.prev), next = find(conf.next), prevPage = find(conf.prevPage), nextPage = find(conf.nextPage); // methods $.extend(self, { getIndex: function() { return index; }, getClickIndex: function() { var items = self.getItems(); return items.index(items.filter("." + conf.activeClass)); }, getConf: function() { return conf; }, getSize: function() { return self.getItems().size(); }, getPageAmount: function() { return Math.ceil(this.getSize() / conf.size); }, getPageIndex: function() { return Math.ceil(index / conf.size); }, getNaviButtons: function() { return prev.add(next).add(prevPage).add(nextPage); }, getRoot: function() { return root; }, getItemWrap: function() { return wrap; }, getItems: function() { return wrap.children(conf.item); }, getVisibleItems: function() { return self.getItems().slice(index, index + conf.size); }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { if (i < 0) { i = 0; } // nothing happens if (index === i) { return self; } // function given as second argument if ($.isFunction(time)) { fn = time; } // seeking exceeds the end if (i > self.getSize() - conf.size) { return conf.loop ? self.begin() : this.end(); } var item = self.getItems().eq(i); if (!item.length) { return self; } // onBeforeSeek var e = $.Event("onBeforeSeek"); $self.trigger(e, [i]); if (e.isDefaultPrevented()) { return self; } // get the (possibly altered) speed if (time === undefined || $.isFunction(time)) { time = conf.speed; } function callback() { if (fn) { fn.call(self, i); } $self.trigger("onSeek", [i]); } if (horizontal) { wrap.animate({left: -item.position().left}, time, conf.easing, callback); } else { wrap.animate({top: -item.position().top}, time, conf.easing, callback); } current = self; index = i; // onStart e = $.Event("onStart"); $self.trigger(e, [i]); if (e.isDefaultPrevented()) { return self; } /* default behaviour */ // prev/next buttons disabled flags prev.add(prevPage).toggleClass(conf.disabledClass, i === 0); next.add(nextPage).toggleClass(conf.disabledClass, i >= self.getSize() - conf.size); return self; }, move: function(offset, time, fn) { forward = offset > 0; return this.seekTo(index + offset, time, fn); }, next: function(time, fn) { return this.move(1, time, fn); }, prev: function(time, fn) { return this.move(-1, time, fn); }, movePage: function(offset, time, fn) { forward = offset > 0; var steps = conf.size * offset; var i = index % conf.size; if (i > 0) { steps += (offset > 0 ? -i : conf.size - i); } return this.move(steps, time, fn); }, prevPage: function(time, fn) { return this.movePage(-1, time, fn); }, nextPage: function(time, fn) { return this.movePage(1, time, fn); }, setPage: function(page, time, fn) { return this.seekTo(page * conf.size, time, fn); }, begin: function(time, fn) { forward = false; return this.seekTo(0, time, fn); }, end: function(time, fn) { forward = true; var to = this.getSize() - conf.size; return to > 0 ? this.seekTo(to, time, fn) : self; }, reload: function() { $self.trigger("onReload"); return self; }, focus: function() { current = self; return self; }, getLoader: function() { return loader; }, click: function(i) { var item = self.getItems().eq(i), klass = conf.activeClass, size = conf.size; // check that i is sane if (i < 0 || i >= self.getSize()) { return self; } // size == 1 if (size == 1) { if (conf.loop) { return self.next(); } if (i === 0 || i == self.getSize() -1) { forward = (forward === undefined) ? true : !forward; } return forward === false ? self.prev() : self.next(); } // size == 2 if (size == 2) { if (i == index) { i--; } self.getItems().removeClass(klass); item.addClass(klass); return self.seekTo(i, time, fn); } if (!item.hasClass(klass)) { self.getItems().removeClass(klass); item.addClass(klass); var delta = Math.floor(size / 2); var to = i - delta; // next to last item must work if (to > self.getSize() - size) { to = self.getSize() - size; } if (to !== i) { return self.seekTo(to); } } return self; }, // bind / unbind bind: function(name, fn) { $self.bind(name, fn); return self; }, unbind: function(name) { $self.unbind(name); return self; } }); // callbacks $.each("onBeforeSeek,onStart,onSeek,onReload".split(","), function(i, ev) { self[ev] = function(fn) { return self.bind(ev, fn); }; }); // prev button prev.addClass(conf.disabledClass).click(function() { self.prev(); }); // next button next.click(function() { self.next(); }); // prev page button nextPage.click(function() { self.nextPage(); }); if (self.getSize() < conf.size) { next.add(nextPage).addClass(conf.disabledClass); } // next page button prevPage.addClass(conf.disabledClass).click(function() { self.prevPage(); }); // hover var hc = conf.hoverClass, keyId = "keydown." + Math.random().toString().substring(10); self.onReload(function() { // hovering if (hc) { self.getItems().hover(function() { $(this).addClass(hc); }, function() { $(this).removeClass(hc); }); } // clickable if (conf.clickable) { self.getItems().each(function(i) { $(this).unbind("click.scrollable").bind("click.scrollable", function(e) { if ($(e.target).is("a")) { return; } return self.click(i); }); }); } // keyboard if (conf.keyboard) { // keyboard works on one instance at the time. thus we need to unbind first $(document).unbind(keyId).bind(keyId, function(evt) { // do nothing with CTRL / ALT buttons if (evt.altKey || evt.ctrlKey) { return; } // do nothing for unstatic and unfocused instances if (conf.keyboard != 'static' && current != self) { return; } var s = conf.keyboardSteps; if (horizontal && (evt.keyCode == 37 || evt.keyCode == 39)) { self.move(evt.keyCode == 37 ? -s : s); return evt.preventDefault(); } if (!horizontal && (evt.keyCode == 38 || evt.keyCode == 40)) { self.move(evt.keyCode == 38 ? -s : s); return evt.preventDefault(); } return true; }); } else { $(document).unbind(keyId); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; }); } }); // lazyload support. all logic is here. var lconf = $.tools.lazyload && conf.lazyload, loader, lazies; if (lconf) { lazies = lconf === true ? self.getItems() : root.find(lconf.select || lconf); if (typeof lconf != 'object') { lconf = {}; } $.extend(lconf, { growParent: root, api: true}, lconf); loader = lazies.lazyload(lconf); function load(ev, i) { var els = self.getItems().slice(i, i + conf.size); els.each(function() { els = els.add($(this).find(":unloaded")); }); loader.load(els); } self.onBeforeSeek(load); load(null, 0); } self.reload(); } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.eq(typeof conf == 'number' ? conf : 0).data("scrollable"); if (el) { return el; } var globals = $.extend({}, $.tools.scrollable.conf); conf = $.extend(globals, conf); conf.keyboardSteps = conf.keyboardSteps || conf.size; this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
conf[key] = parseFloat(val, 10); | if (val || val === 0) {; conf[key] = parseFloat(val, 10); } | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool; tool = $.tools.slider = { conf: { min: 0, max: 100, step: 0, // Specifies the value granularity of the element's value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: false, speed: 200, // set to null if not needed sliderClass: 'slider', progressClass: 'progress', handleClass: 'handle' } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function dim(el, key) { return parseInt(el.css(key), 10); } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>").data("slider", self), value, // current value origo, // handle's start point len, // length of the slider pos, // current position of the handle progress, // progress "bar" handle; // drag handle // create slider input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes into configuration $.each("min,max,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); var range = conf.max - conf.min; /* replace build-in range element for cross browser consistency NOTE: input.attr("type", "text") throws exception by the browser */ if (input[0].getAttribute("type") == 'range') { var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")).val(input.val()); input.replaceWith(tmp); input = tmp; } if (conf.hideInput) { input.hide(); } var fire = input.add(this); // flesh and bone of this tool function seek(x, e) { // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.step) { x = toSteps(x, conf.step, len); } // calculate value var v = round(x / len * range + conf.min, conf.decimals); // onSlide e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } if (v != value) { // move handle & resize progress var isClick = e && e.originalEvent && e.originalEvent.type == "click", speed = isClick ? conf.speed : 0, callback = isClick ? function() { e.type = "change"; fire.trigger(e, [v]); } : null; if (conf.vertical) { handle.animate({top: -(x - len)}, speed, callback); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed, callback); progress.animate({width: x}, speed); } value = v; pos = x; input.val(v); } return self; } $.extend(self, { setValue: function(val, e) { val = parseFloat(val); if (!val || val == value) { return self; } var x = (val - conf.min) * (len / range); return seek(x, e); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e); }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); } }); // callbacks $.each("onSlide,change".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // dragging handle.bind("drag", function(e) { if (input.is(":disabled")) { return false; } if (!origo) { init(); } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { if (!e.isDefaultPrevented()) { e.type = "change"; fire.trigger(e, [value]); } }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } var fix = handle.width() / 2; if (!origo) { init(); } seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); }); input.blur(function(e) { self.setValue($(this).val(), e); }); function init() { if (conf.vertical) { len = dim(root, "height") - dim(handle, "height"); origo = root.offset().top + len; } else { len = dim(root, "width") - dim(handle, "width"); origo = root.offset().left; } } init(); self.setValue(input.val() || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current, key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(e.keyCode) != -1, down = $([74, 72, 40, 34, 37]).index(e.keyCode) != -1; if ((up || down) && !(e.shiftKey || e.altKey) && slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if (up) { slider.step(e.ctrlKey || key == 33 ? 5 : 1, e); // DOWN: j=74, h=72, down=40, pagedown=34, left=37 } else if (down) { slider.step(e.ctrlKey || key == 34 ? -5 : -1, e); } return e.preventDefault(); } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return els; }; }) (jQuery); |
var v = round(x / len * range + conf.min, conf.decimals); | var isClick = e && e.originalEvent && e.originalEvent.type == "click", v = round(x / len * range + conf.min, conf.decimals); | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool; tool = $.tools.slider = { conf: { min: 0, max: 100, step: 0, // Specifies the value granularity of the element's value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: false, speed: 200, // set to null if not needed sliderClass: 'slider', progressClass: 'progress', handleClass: 'handle' } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function dim(el, key) { return parseInt(el.css(key), 10); } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>").data("slider", self), value, // current value origo, // handle's start point len, // length of the slider pos, // current position of the handle progress, // progress "bar" handle; // drag handle // create slider input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes into configuration $.each("min,max,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); var range = conf.max - conf.min; /* replace build-in range element for cross browser consistency NOTE: input.attr("type", "text") throws exception by the browser */ if (input[0].getAttribute("type") == 'range') { var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")).val(input.val()); input.replaceWith(tmp); input = tmp; } if (conf.hideInput) { input.hide(); } var fire = input.add(this); // flesh and bone of this tool function seek(x, e) { // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.step) { x = toSteps(x, conf.step, len); } // calculate value var v = round(x / len * range + conf.min, conf.decimals); // onSlide e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } if (v != value) { // move handle & resize progress var isClick = e && e.originalEvent && e.originalEvent.type == "click", speed = isClick ? conf.speed : 0, callback = isClick ? function() { e.type = "change"; fire.trigger(e, [v]); } : null; if (conf.vertical) { handle.animate({top: -(x - len)}, speed, callback); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed, callback); progress.animate({width: x}, speed); } value = v; pos = x; input.val(v); } return self; } $.extend(self, { setValue: function(val, e) { val = parseFloat(val); if (!val || val == value) { return self; } var x = (val - conf.min) * (len / range); return seek(x, e); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e); }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); } }); // callbacks $.each("onSlide,change".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // dragging handle.bind("drag", function(e) { if (input.is(":disabled")) { return false; } if (!origo) { init(); } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { if (!e.isDefaultPrevented()) { e.type = "change"; fire.trigger(e, [value]); } }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } var fix = handle.width() / 2; if (!origo) { init(); } seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); }); input.blur(function(e) { self.setValue($(this).val(), e); }); function init() { if (conf.vertical) { len = dim(root, "height") - dim(handle, "height"); origo = root.offset().top + len; } else { len = dim(root, "width") - dim(handle, "width"); origo = root.offset().left; } } init(); self.setValue(input.val() || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current, key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(e.keyCode) != -1, down = $([74, 72, 40, 34, 37]).index(e.keyCode) != -1; if ((up || down) && !(e.shiftKey || e.altKey) && slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if (up) { slider.step(e.ctrlKey || key == 33 ? 5 : 1, e); // DOWN: j=74, h=72, down=40, pagedown=34, left=37 } else if (down) { slider.step(e.ctrlKey || key == 34 ? -5 : -1, e); } return e.preventDefault(); } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return els; }; }) (jQuery); |
e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } | if (value !== undefined && !isClick) { e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } } | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool; tool = $.tools.slider = { conf: { min: 0, max: 100, step: 0, // Specifies the value granularity of the element's value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: false, speed: 200, // set to null if not needed sliderClass: 'slider', progressClass: 'progress', handleClass: 'handle' } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function dim(el, key) { return parseInt(el.css(key), 10); } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>").data("slider", self), value, // current value origo, // handle's start point len, // length of the slider pos, // current position of the handle progress, // progress "bar" handle; // drag handle // create slider input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes into configuration $.each("min,max,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); var range = conf.max - conf.min; /* replace build-in range element for cross browser consistency NOTE: input.attr("type", "text") throws exception by the browser */ if (input[0].getAttribute("type") == 'range') { var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")).val(input.val()); input.replaceWith(tmp); input = tmp; } if (conf.hideInput) { input.hide(); } var fire = input.add(this); // flesh and bone of this tool function seek(x, e) { // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.step) { x = toSteps(x, conf.step, len); } // calculate value var v = round(x / len * range + conf.min, conf.decimals); // onSlide e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } if (v != value) { // move handle & resize progress var isClick = e && e.originalEvent && e.originalEvent.type == "click", speed = isClick ? conf.speed : 0, callback = isClick ? function() { e.type = "change"; fire.trigger(e, [v]); } : null; if (conf.vertical) { handle.animate({top: -(x - len)}, speed, callback); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed, callback); progress.animate({width: x}, speed); } value = v; pos = x; input.val(v); } return self; } $.extend(self, { setValue: function(val, e) { val = parseFloat(val); if (!val || val == value) { return self; } var x = (val - conf.min) * (len / range); return seek(x, e); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e); }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); } }); // callbacks $.each("onSlide,change".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // dragging handle.bind("drag", function(e) { if (input.is(":disabled")) { return false; } if (!origo) { init(); } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { if (!e.isDefaultPrevented()) { e.type = "change"; fire.trigger(e, [value]); } }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } var fix = handle.width() / 2; if (!origo) { init(); } seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); }); input.blur(function(e) { self.setValue($(this).val(), e); }); function init() { if (conf.vertical) { len = dim(root, "height") - dim(handle, "height"); origo = root.offset().top + len; } else { len = dim(root, "width") - dim(handle, "width"); origo = root.offset().left; } } init(); self.setValue(input.val() || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current, key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(e.keyCode) != -1, down = $([74, 72, 40, 34, 37]).index(e.keyCode) != -1; if ((up || down) && !(e.shiftKey || e.altKey) && slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if (up) { slider.step(e.ctrlKey || key == 33 ? 5 : 1, e); // DOWN: j=74, h=72, down=40, pagedown=34, left=37 } else if (down) { slider.step(e.ctrlKey || key == 34 ? -5 : -1, e); } return e.preventDefault(); } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return els; }; }) (jQuery); |
var isClick = e && e.originalEvent && e.originalEvent.type == "click", speed = isClick ? conf.speed : 0, callback = isClick ? function() { | var speed = isClick ? conf.speed : 0, fn = isClick ? function() { | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool; tool = $.tools.slider = { conf: { min: 0, max: 100, step: 0, // Specifies the value granularity of the element's value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: false, speed: 200, // set to null if not needed sliderClass: 'slider', progressClass: 'progress', handleClass: 'handle' } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function dim(el, key) { return parseInt(el.css(key), 10); } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>").data("slider", self), value, // current value origo, // handle's start point len, // length of the slider pos, // current position of the handle progress, // progress "bar" handle; // drag handle // create slider input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes into configuration $.each("min,max,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); var range = conf.max - conf.min; /* replace build-in range element for cross browser consistency NOTE: input.attr("type", "text") throws exception by the browser */ if (input[0].getAttribute("type") == 'range') { var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")).val(input.val()); input.replaceWith(tmp); input = tmp; } if (conf.hideInput) { input.hide(); } var fire = input.add(this); // flesh and bone of this tool function seek(x, e) { // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.step) { x = toSteps(x, conf.step, len); } // calculate value var v = round(x / len * range + conf.min, conf.decimals); // onSlide e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } if (v != value) { // move handle & resize progress var isClick = e && e.originalEvent && e.originalEvent.type == "click", speed = isClick ? conf.speed : 0, callback = isClick ? function() { e.type = "change"; fire.trigger(e, [v]); } : null; if (conf.vertical) { handle.animate({top: -(x - len)}, speed, callback); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed, callback); progress.animate({width: x}, speed); } value = v; pos = x; input.val(v); } return self; } $.extend(self, { setValue: function(val, e) { val = parseFloat(val); if (!val || val == value) { return self; } var x = (val - conf.min) * (len / range); return seek(x, e); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e); }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); } }); // callbacks $.each("onSlide,change".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // dragging handle.bind("drag", function(e) { if (input.is(":disabled")) { return false; } if (!origo) { init(); } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { if (!e.isDefaultPrevented()) { e.type = "change"; fire.trigger(e, [value]); } }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } var fix = handle.width() / 2; if (!origo) { init(); } seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); }); input.blur(function(e) { self.setValue($(this).val(), e); }); function init() { if (conf.vertical) { len = dim(root, "height") - dim(handle, "height"); origo = root.offset().top + len; } else { len = dim(root, "width") - dim(handle, "width"); origo = root.offset().left; } } init(); self.setValue(input.val() || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current, key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(e.keyCode) != -1, down = $([74, 72, 40, 34, 37]).index(e.keyCode) != -1; if ((up || down) && !(e.shiftKey || e.altKey) && slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if (up) { slider.step(e.ctrlKey || key == 33 ? 5 : 1, e); // DOWN: j=74, h=72, down=40, pagedown=34, left=37 } else if (down) { slider.step(e.ctrlKey || key == 34 ? -5 : -1, e); } return e.preventDefault(); } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return els; }; }) (jQuery); |
handle.animate({top: -(x - len)}, speed, callback); | handle.animate({top: -(x - len)}, speed, fn); | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool; tool = $.tools.slider = { conf: { min: 0, max: 100, step: 0, // Specifies the value granularity of the element's value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: false, speed: 200, // set to null if not needed sliderClass: 'slider', progressClass: 'progress', handleClass: 'handle' } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function dim(el, key) { return parseInt(el.css(key), 10); } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>").data("slider", self), value, // current value origo, // handle's start point len, // length of the slider pos, // current position of the handle progress, // progress "bar" handle; // drag handle // create slider input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes into configuration $.each("min,max,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); var range = conf.max - conf.min; /* replace build-in range element for cross browser consistency NOTE: input.attr("type", "text") throws exception by the browser */ if (input[0].getAttribute("type") == 'range') { var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")).val(input.val()); input.replaceWith(tmp); input = tmp; } if (conf.hideInput) { input.hide(); } var fire = input.add(this); // flesh and bone of this tool function seek(x, e) { // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.step) { x = toSteps(x, conf.step, len); } // calculate value var v = round(x / len * range + conf.min, conf.decimals); // onSlide e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } if (v != value) { // move handle & resize progress var isClick = e && e.originalEvent && e.originalEvent.type == "click", speed = isClick ? conf.speed : 0, callback = isClick ? function() { e.type = "change"; fire.trigger(e, [v]); } : null; if (conf.vertical) { handle.animate({top: -(x - len)}, speed, callback); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed, callback); progress.animate({width: x}, speed); } value = v; pos = x; input.val(v); } return self; } $.extend(self, { setValue: function(val, e) { val = parseFloat(val); if (!val || val == value) { return self; } var x = (val - conf.min) * (len / range); return seek(x, e); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e); }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); } }); // callbacks $.each("onSlide,change".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // dragging handle.bind("drag", function(e) { if (input.is(":disabled")) { return false; } if (!origo) { init(); } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { if (!e.isDefaultPrevented()) { e.type = "change"; fire.trigger(e, [value]); } }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } var fix = handle.width() / 2; if (!origo) { init(); } seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); }); input.blur(function(e) { self.setValue($(this).val(), e); }); function init() { if (conf.vertical) { len = dim(root, "height") - dim(handle, "height"); origo = root.offset().top + len; } else { len = dim(root, "width") - dim(handle, "width"); origo = root.offset().left; } } init(); self.setValue(input.val() || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current, key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(e.keyCode) != -1, down = $([74, 72, 40, 34, 37]).index(e.keyCode) != -1; if ((up || down) && !(e.shiftKey || e.altKey) && slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if (up) { slider.step(e.ctrlKey || key == 33 ? 5 : 1, e); // DOWN: j=74, h=72, down=40, pagedown=34, left=37 } else if (down) { slider.step(e.ctrlKey || key == 34 ? -5 : -1, e); } return e.preventDefault(); } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return els; }; }) (jQuery); |
handle.animate({left: x}, speed, callback); | handle.animate({left: x}, speed, fn); | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool; tool = $.tools.slider = { conf: { min: 0, max: 100, step: 0, // Specifies the value granularity of the element's value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: false, speed: 200, // set to null if not needed sliderClass: 'slider', progressClass: 'progress', handleClass: 'handle' } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function dim(el, key) { return parseInt(el.css(key), 10); } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>").data("slider", self), value, // current value origo, // handle's start point len, // length of the slider pos, // current position of the handle progress, // progress "bar" handle; // drag handle // create slider input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes into configuration $.each("min,max,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); var range = conf.max - conf.min; /* replace build-in range element for cross browser consistency NOTE: input.attr("type", "text") throws exception by the browser */ if (input[0].getAttribute("type") == 'range') { var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")).val(input.val()); input.replaceWith(tmp); input = tmp; } if (conf.hideInput) { input.hide(); } var fire = input.add(this); // flesh and bone of this tool function seek(x, e) { // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.step) { x = toSteps(x, conf.step, len); } // calculate value var v = round(x / len * range + conf.min, conf.decimals); // onSlide e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } if (v != value) { // move handle & resize progress var isClick = e && e.originalEvent && e.originalEvent.type == "click", speed = isClick ? conf.speed : 0, callback = isClick ? function() { e.type = "change"; fire.trigger(e, [v]); } : null; if (conf.vertical) { handle.animate({top: -(x - len)}, speed, callback); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed, callback); progress.animate({width: x}, speed); } value = v; pos = x; input.val(v); } return self; } $.extend(self, { setValue: function(val, e) { val = parseFloat(val); if (!val || val == value) { return self; } var x = (val - conf.min) * (len / range); return seek(x, e); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e); }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); } }); // callbacks $.each("onSlide,change".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // dragging handle.bind("drag", function(e) { if (input.is(":disabled")) { return false; } if (!origo) { init(); } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { if (!e.isDefaultPrevented()) { e.type = "change"; fire.trigger(e, [value]); } }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } var fix = handle.width() / 2; if (!origo) { init(); } seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); }); input.blur(function(e) { self.setValue($(this).val(), e); }); function init() { if (conf.vertical) { len = dim(root, "height") - dim(handle, "height"); origo = root.offset().top + len; } else { len = dim(root, "width") - dim(handle, "width"); origo = root.offset().left; } } init(); self.setValue(input.val() || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current, key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(e.keyCode) != -1, down = $([74, 72, 40, 34, 37]).index(e.keyCode) != -1; if ((up || down) && !(e.shiftKey || e.altKey) && slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if (up) { slider.step(e.ctrlKey || key == 33 ? 5 : 1, e); // DOWN: j=74, h=72, down=40, pagedown=34, left=37 } else if (down) { slider.step(e.ctrlKey || key == 34 ? -5 : -1, e); } return e.preventDefault(); } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return els; }; }) (jQuery); |
if (!val || val == value) { return self; } | if (val === NaN || val == value) { return self; } | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool; tool = $.tools.slider = { conf: { min: 0, max: 100, step: 0, // Specifies the value granularity of the element's value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: false, speed: 200, // set to null if not needed sliderClass: 'slider', progressClass: 'progress', handleClass: 'handle' } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function dim(el, key) { return parseInt(el.css(key), 10); } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>").data("slider", self), value, // current value origo, // handle's start point len, // length of the slider pos, // current position of the handle progress, // progress "bar" handle; // drag handle // create slider input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes into configuration $.each("min,max,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); var range = conf.max - conf.min; /* replace build-in range element for cross browser consistency NOTE: input.attr("type", "text") throws exception by the browser */ if (input[0].getAttribute("type") == 'range') { var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")).val(input.val()); input.replaceWith(tmp); input = tmp; } if (conf.hideInput) { input.hide(); } var fire = input.add(this); // flesh and bone of this tool function seek(x, e) { // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.step) { x = toSteps(x, conf.step, len); } // calculate value var v = round(x / len * range + conf.min, conf.decimals); // onSlide e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } if (v != value) { // move handle & resize progress var isClick = e && e.originalEvent && e.originalEvent.type == "click", speed = isClick ? conf.speed : 0, callback = isClick ? function() { e.type = "change"; fire.trigger(e, [v]); } : null; if (conf.vertical) { handle.animate({top: -(x - len)}, speed, callback); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed, callback); progress.animate({width: x}, speed); } value = v; pos = x; input.val(v); } return self; } $.extend(self, { setValue: function(val, e) { val = parseFloat(val); if (!val || val == value) { return self; } var x = (val - conf.min) * (len / range); return seek(x, e); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e); }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); } }); // callbacks $.each("onSlide,change".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // dragging handle.bind("drag", function(e) { if (input.is(":disabled")) { return false; } if (!origo) { init(); } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { if (!e.isDefaultPrevented()) { e.type = "change"; fire.trigger(e, [value]); } }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } var fix = handle.width() / 2; if (!origo) { init(); } seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); }); input.blur(function(e) { self.setValue($(this).val(), e); }); function init() { if (conf.vertical) { len = dim(root, "height") - dim(handle, "height"); origo = root.offset().top + len; } else { len = dim(root, "width") - dim(handle, "width"); origo = root.offset().left; } } init(); self.setValue(input.val() || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current, key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(e.keyCode) != -1, down = $([74, 72, 40, 34, 37]).index(e.keyCode) != -1; if ((up || down) && !(e.shiftKey || e.altKey) && slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if (up) { slider.step(e.ctrlKey || key == 33 ? 5 : 1, e); // DOWN: j=74, h=72, down=40, pagedown=34, left=37 } else if (down) { slider.step(e.ctrlKey || key == 34 ? -5 : -1, e); } return e.preventDefault(); } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return els; }; }) (jQuery); |
self.setValue(input.val() || conf.min); | self.setValue(input.val() || conf.value || conf.min); | (function($) { $.tools = $.tools || {version: '@VERSION'}; var current, tool; tool = $.tools.slider = { conf: { min: 0, max: 100, step: 0, // Specifies the value granularity of the element's value (onSlide callbacks) value: 0, decimals: 2, vertical: false, keyboard: true, hideInput: false, speed: 200, // set to null if not needed sliderClass: 'slider', progressClass: 'progress', handleClass: 'handle' } }; function toSteps(value, size, max) { var step = max / size; return Math.round(value / step) * step; } function round(value, decimals) { var n = Math.pow(10, decimals); return Math.round(value * n) / n; } function dim(el, key) { return parseInt(el.css(key), 10); } function Slider(input, conf) { // private variables var self = this, root = $("<div><div/><a/></div>").data("slider", self), value, // current value origo, // handle's start point len, // length of the slider pos, // current position of the handle progress, // progress "bar" handle; // drag handle // create slider input.before(root); handle = root.addClass(conf.sliderClass).find("a").addClass(conf.handleClass); progress = root.find("div").addClass(conf.progressClass); // get (HTML5) attributes into configuration $.each("min,max,step,value".split(","), function(i, key) { var val = input.attr(key); conf[key] = parseFloat(val, 10); }); var range = conf.max - conf.min; /* replace build-in range element for cross browser consistency NOTE: input.attr("type", "text") throws exception by the browser */ if (input[0].getAttribute("type") == 'range') { var tmp = $('<input/>') .attr("type", "text") .addClass(input.attr("className")) .attr("name", input.attr("name")) .attr("disabled", input.attr("disabled")).val(input.val()); input.replaceWith(tmp); input = tmp; } if (conf.hideInput) { input.hide(); } var fire = input.add(this); // flesh and bone of this tool function seek(x, e) { // fit inside the slider x = Math.min(Math.max(0, x), len); // increment in steps if (conf.step) { x = toSteps(x, conf.step, len); } // calculate value var v = round(x / len * range + conf.min, conf.decimals); // onSlide e = e || $.Event(); e.type = "onSlide"; fire.trigger(e, [v]); if (e.isDefaultPrevented()) { return self; } if (v != value) { // move handle & resize progress var isClick = e && e.originalEvent && e.originalEvent.type == "click", speed = isClick ? conf.speed : 0, callback = isClick ? function() { e.type = "change"; fire.trigger(e, [v]); } : null; if (conf.vertical) { handle.animate({top: -(x - len)}, speed, callback); progress.animate({height: x}, speed); } else { handle.animate({left: x}, speed, callback); progress.animate({width: x}, speed); } value = v; pos = x; input.val(v); } return self; } $.extend(self, { setValue: function(val, e) { val = parseFloat(val); if (!val || val == value) { return self; } var x = (val - conf.min) * (len / range); return seek(x, e); }, getValue: function() { return value; }, getConf: function() { return conf; }, getProgress: function() { return progress; }, getHandle: function() { return handle; }, getInput: function() { return input; }, step: function(am, e) { var x = Math.max(len / conf.step || conf.size || 10, 2); return seek(pos + x * am, e); }, next: function() { return this.step(1); }, prev: function() { return this.step(-1); } }); // callbacks $.each("onSlide,change".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // dragging handle.bind("drag", function(e) { if (input.is(":disabled")) { return false; } if (!origo) { init(); } seek(conf.vertical ? origo - e.offsetY : e.offsetX - origo, e); }).bind("dragend", function(e) { if (!e.isDefaultPrevented()) { e.type = "change"; fire.trigger(e, [value]); } }).click(function(e) { return e.preventDefault(); }); // clicking root.click(function(e) { if (input.is(":disabled")) { return false; } var fix = handle.width() / 2; if (!origo) { init(); } seek(conf.vertical ? origo - e.pageY + fix : e.pageX - origo - fix, e); }); input.blur(function(e) { self.setValue($(this).val(), e); }); function init() { if (conf.vertical) { len = dim(root, "height") - dim(handle, "height"); origo = root.offset().top + len; } else { len = dim(root, "width") - dim(handle, "width"); origo = root.offset().left; } } init(); self.setValue(input.val() || conf.min); } if (tool.conf.keyboard) { $(document).keydown(function(e) { var el = $(e.target), slider = el.data("slider") || current, key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(e.keyCode) != -1, down = $([74, 72, 40, 34, 37]).index(e.keyCode) != -1; if ((up || down) && !(e.shiftKey || e.altKey) && slider) { // UP: k=75, l=76, up=38, pageup=33, right=39 if (up) { slider.step(e.ctrlKey || key == 33 ? 5 : 1, e); // DOWN: j=74, h=72, down=40, pagedown=34, left=37 } else if (down) { slider.step(e.ctrlKey || key == 34 ? -5 : -1, e); } return e.preventDefault(); } }); $(document).click(function(e) { var el = $(e.target); current = el.data("slider") || el.parent().data("slider"); }); } // jQuery plugin implementation $.fn.slider = function(conf) { // return existing instance var el = this.data("slider"), els; if (el) { return el; } // extend configuration with globals conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slider($(this), $.extend({}, conf)); var input = el.getInput().data("slider", el); els = els ? els.add(input) : input; }); return els; }; }) (jQuery); |
$('#select-all').live('click', function(){ $('.selectable').addClass('selected'); return false; }); $('#select-none').live('click', function(){ $('.selectable').removeClass('selected'); return false; }); | $(document).ready(function() { $("#loading").ajaxStart(function() { $(this).show(); }); $("#loading").ajaxStop(function() { $(this).hide(); $('.sortable').sortable(); }); $('#hosts').load('cgi-bin/collection.modified.cgi'); $('#menu-tabs').tabs(); $(".date-field").datepicker(); $("#clock").jclock(); $("#clock-server").jclock(); $("#clock-server-slider").slider(); $('button').button(); $('#show-ruler-checkbox').click(function(){ if ($(this).attr('checked')) { $('#ruler').fadeIn(); } else { $('#ruler').fadeOut(); } }); $('#ruler').draggable( { axis: 'x' } ); $('#hosts a, #plugins a').live('click', load_url); $('li.graph-image .ui-icon-close').live('click', function() { $(this).parent().parent().parent().remove(); }); $("#slide-menu-container .ui-widget-header").click(function() { $("#slide-menu-container .ui-widget-content").slideToggle("slow"); $(this).toggleClass("active"); return false; }); $('.icons, .fg-button').livequery(function() { $(this).each(function() { $(this).hover(function() { $(this).addClass('ui-state-hover'); }, function() { $(this).removeClass('ui-state-hover'); }); }); }); $("#host-filter").live('keyup', function() { var searchText = $(this).val(); $("#hosts li").hide(); if (searchText == "") { $("#hosts li").show(); } else { $("#hosts li:contains(" + searchText + ")").show(); } $(this).focus(); }); $('#hosts a, #plugins a').live('click', function() { $(this).addClass("selected"); }); $("#timespan-menu li").live( 'click', function() { $("#timespan-menu li").each(function() { $(this).removeClass("selected"); }); var timespan = $(this).html(); $("li.graph-image li").hide(); $("li.graph-image li." + timespan).show(); $("#timespan-menu li:contains(" + timespan + ")").addClass( "selected"); });}); |
|
this.each(function(i) { | this.each(function() { | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.tabs = { conf: { tabs: 'a', current: 'current', onBeforeClick: null, onClick: null, effect: 'default', initialIndex: 0, event: 'click', api: false, rotate: false, // 1.2 lazyload: false, history: false }, addEffect: function(name, fn) { effects[name] = fn; } }; var effects = { // simple "toggle" effect 'default': function(i, done) { this.getPanes().hide().eq(i).show(); done.call(); }, /* configuration: - fadeOutSpeed (positive value does "crossfading") - fadeInSpeed */ fade: function(i, done) { var conf = this.getConf(), speed = conf.fadeOutSpeed, panes = this.getPanes(); if (speed) { panes.fadeOut(speed); } else { panes.hide(); } panes.eq(i).fadeIn(conf.fadeInSpeed, done); }, // for basic accordions slide: function(i, done) { this.getPanes().slideUp(200); this.getPanes().eq(i).slideDown(400, done); }, /** * AJAX effect * * @deprecated use lazyload instead */ ajax: function(i, done) { this.getPanes().eq(0).load(this.getTabs().eq(i).attr("href"), done); } }; var w; /** * Horizontal accordion * * @deprecated will be replaced with a more robust implementation */ $.tools.tabs.addEffect("horizontal", function(i, done) { // store original width of a pane into memory if (!w) { w = this.getPanes().eq(0).width(); } // set current pane's width to zero this.getCurrentPane().animate({width: 0}, function() { $(this).hide(); }); // grow opened pane to it's original width this.getPanes().eq(i).animate({width: w}, function() { $(this).show(); done.call(); }); }); function Tabs(root, paneSelector, conf) { var self = this, trigger = root.add(this), tabs = root.find(conf.tabs), panes = paneSelector.jquery ? paneSelector : root.children(paneSelector), current; // make sure tabs and panes are found if (!tabs.length) { tabs = root.children(); } if (!panes.length) { panes = root.parent().find(paneSelector); } if (!panes.length) { panes = $(paneSelector); } // public methods $.extend(this, { click: function(i, e) { var pane = self.getCurrentPane(), tab = tabs.eq(i); if (typeof i == 'string' && i.replace("#", "")) { tab = tabs.filter("[href*=" + i.replace("#", "") + "]"); i = Math.max(tabs.index(tab), 0); } if (conf.rotate) { var last = tabs.length -1; if (i < 0) { return self.click(last, e); } if (i > last) { return self.click(0, e); } } if (!tab.length) { if (current >= 0) { return self; } i = conf.initialIndex; tab = tabs.eq(i); } // current tab is being clicked if (i === current) { return self; } // possibility to cancel click action e = e || $.Event(); e.type = "onBeforeClick"; trigger.trigger(e, [i]); if (e.isDefaultPrevented()) { return; } // call the effect effects[conf.effect].call(self, i, function() { // onClick callback e.type = "onClick"; trigger.trigger(e, [i]); }); // default behaviour current = i; tabs.removeClass(conf.current); tab.addClass(conf.current); return self; }, getConf: function() { return conf; }, getTabs: function() { return tabs; }, getPanes: function() { return panes; }, getCurrentPane: function() { return panes.eq(current); }, getCurrentTab: function() { return tabs.eq(current); }, getIndex: function() { return current; }, next: function() { return self.click(current + 1); }, prev: function() { return self.click(current - 1); } }); // callbacks $.each("onBeforeClick,onClick".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; }; }); // setup click actions for each tab tabs.each(function(i) { $(this).bind(conf.event, function(e) { self.click(i, e); return e.preventDefault(); }); }); // cross tab anchor link panes.find("a[href^=#]").click(function(e) { self.click($(this).attr("href"), e); }); // history support if (conf.history && $.fn.history) { // enable history support tabs.history(function(evt, hash) { if (!hash || hash == '#') { hash = conf.initialIndex; } self.click(hash); }); // tab clicks perform their original action tabs.click(function(e) { location.hash = $(this).attr("href").replace("#", ""); }); } // lazyload support. all logic is here. var lconf = $.tools.lazyload && conf.lazyload, loader; if (lconf) { // lazyload configuration if (typeof lconf != 'object') { lconf = { select: lconf }; } if (typeof lconf.select != 'string') { lconf.select = "img, :backgroundImage"; } $.extend(lconf, { growParent: panes.parent(), api: true }, lconf); // initialize lazyload loader = panes.parent().find(lconf.select).lazyload(lconf); self.onBeforeClick(function(e, i) { loader.load(panes.eq(i).find(":unloaded").andSelf()); }); } // open initial tab if (location.hash) { self.click(location.hash); } else { if (conf.initialIndex === 0 || conf.initialIndex > 0) { self.click(conf.initialIndex); } } } // jQuery plugin implementation $.fn.tabs = function(paneSelector, conf) { // return existing instance var el = this.data("tabs"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeClick: conf}; } // setup conf conf = $.extend({}, $.tools.tabs.conf, conf); this.each(function(i) { el = new Tabs($(this), paneSelector, conf); $(this).data("tabs", el); }); return conf.api ? el: this; }; }) (jQuery); |
Sonatype.Events.addListener( 'nexusNavigationInit', function( nexusPanel ) { if ( Sonatype.lib.Permissions.checkPermission( 'nexus:index', Sonatype.lib.Permissions.READ ) ) { nexusPanel.add({ title: 'Artifact Search', id: 'st-nexus-search', items: [ Ext.apply( { repoPanel: this, id: 'quick-search--field', width: 140 }, SEARCH_FIELD_CONFIG ), { title: 'Advanced Search', tabCode: Sonatype.repoServer.SearchPanel, tabId: 'nexus-search', tabTitle: 'Search' } ] | Sonatype.Events.addListener('nexusNavigationInit', function(nexusPanel) { if (Sonatype.lib.Permissions.checkPermission('nexus:index', Sonatype.lib.Permissions.READ)) { nexusPanel.add({ title : 'Artifact Search', id : 'st-nexus-search', items : [Ext.apply({ repoPanel : this, id : 'quick-search--field', width : 140 }, SEARCH_FIELD_CONFIG), { title : 'Advanced Search', tabCode : Sonatype.repoServer.SearchPanel, tabId : 'nexus-search', tabTitle : 'Search' }] }); } | Sonatype.Events.addListener( 'nexusNavigationInit', function( nexusPanel ) { if ( Sonatype.lib.Permissions.checkPermission( 'nexus:index', Sonatype.lib.Permissions.READ ) ) { nexusPanel.add({ title: 'Artifact Search', id: 'st-nexus-search', items: [ Ext.apply( { repoPanel: this, id: 'quick-search--field', width: 140 }, SEARCH_FIELD_CONFIG ), { title: 'Advanced Search', tabCode: Sonatype.repoServer.SearchPanel, tabId: 'nexus-search', tabTitle: 'Search' } ] }); }}); |
} }); | Sonatype.Events.addListener( 'nexusNavigationInit', function( nexusPanel ) { if ( Sonatype.lib.Permissions.checkPermission( 'nexus:index', Sonatype.lib.Permissions.READ ) ) { nexusPanel.add({ title: 'Artifact Search', id: 'st-nexus-search', items: [ Ext.apply( { repoPanel: this, id: 'quick-search--field', width: 140 }, SEARCH_FIELD_CONFIG ), { title: 'Advanced Search', tabCode: Sonatype.repoServer.SearchPanel, tabId: 'nexus-search', tabTitle: 'Search' } ] }); }}); |
|
$.post($(this).attr("href"), function(data) { | $.get($(this).attr("href"), function(data) { | (function($) {$(document).ready(function() { /** * Handle the OpenID information Box. * It will open / hide the little popup */ $("#ShowOpenIDdesc").click(function() { if($("#OpenIDDescription").hasClass("showing")) { $("#OpenIDDescription").hide().removeClass("showing"); } else { $("#OpenIDDescription").show().addClass("showing"); } return false; }); $("#HideOpenIDdesc").click(function() { $("#OpenIDDescription").hide(); return false; }); /** * BBCode Tools * While editing / replying to a post you can get a little popup * with all the BBCode tags */ $("#BBCodeHint").click(function() { if($("#BBTagsHolder").hasClass("showing")) { $(this).text("View Formatting Help"); $("#BBTagsHolder").hide().removeClass("showing"); } else { $(this).text("Hide Formatting Help"); $("#BBTagsHolder").show().addClass("showing"); } return false; }); /** * MultiFile Uploader called on Reply and Edit Forms */ $('#Form_ReplyForm_Attachment').MultiFile(); $('#Form_EditPostForm_Attachment').MultiFile(); /** * Delete post Link. * Add a popup to make sure user actually wants to do * the dirty and remove that wonderful post */ $('.postModifiers a.deletelink').click(function(){ if($(this).attr('id')== 'firstPost') { if(!confirm("Are you sure you wish to delete this thread?\nNote: This will delete ALL posts in this thread.")) return false; } else { if(!confirm("Are you sure you wish to delete this post?")) return false; } var id = $(this).attr("rel"); $.post($(this).attr("href"), function(data) { if(data == 1) { // was successful $("ul#Posts li#post"+id).fadeOut(); } else eval(data); }); return false; }); /** * Mark Post as Spam Link. * It needs to warn the user that the post will be deleted */ $('.postModifiers a.markAsSpamLink').click(function(){ if(!confirm("Are you sure you wish to mark this post as spam?")) return false; var id = $(this).attr("rel"); $.post($(this).attr("href"), function(data) { if(data == 1) { // was successful $("ul#Posts li#post"+id).fadeOut(); } }); return false; }); /** * Delete an Attachment via AJAX */ $('a.deleteAttachment').click(function() { if(!confirm("Are you sure you wish to delete this Attachment")) return false; var id = $(this).attr("rel"); $.post($(this).attr("href"), function(data) { if(data == 1) { $("#CurrentAttachments li.attachment-"+id).fadeOut(); // hide the deleted attachment } }); return false; }); /** * Do the Subscribe / Unsubscribe button */ $("td.replyButton a.subscribe").click(function() { $.post($(this).attr("href"), function(data) { if(data == 1) { $("td.replyButton a.subscribe").fadeOut().hide(); $("td.replyButton a.unsubscribe").fadeIn(); } }); return false; }); $("td.replyButton a.unsubscribe").click(function() { $.post($(this).attr("href"), function(data) { if(data == 1) { $("td.replyButton a.unsubscribe").fadeOut().hide(); $("td.replyButton a.subscribe").fadeIn(); } }); return false; });})})(jQuery); |
if (!conf.circular && self.getSize() > 2) { | if (!conf.circular && self.getSize() > 1) { | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.scrollable = { conf: { activeClass: 'active', circular: false, clonedClass: 'cloned', disabledClass: 'disabled', easing: 'swing', initialIndex: 0, item: null, items: '.items', keyboard: true, mousewheel: false, next: '.next', prev: '.prev', speed: 400, vertical: false, wheelSpeed: 0 } }; // get hidden element's width or height even though it's hidden function dim(el, key) { var v = parseInt(el.css(key), 10); if (v) { return v; } var s = el[0].currentStyle; return s && s.width && parseInt(s.width, 10); } function find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } var current; // constructor function Scrollable(root, conf) { // current instance var self = this, fire = root.add(self), itemWrap = root.children(), index = 0, forward, vertical = conf.vertical; if (!current) { current = self; } if (itemWrap.length > 1) { itemWrap = $(conf.items, root); } // methods $.extend(self, { getConf: function() { return conf; }, getIndex: function() { return index; }, getSize: function() { return self.getItems().size(); }, getNaviButtons: function() { return prev.add(next); }, getRoot: function() { return root; }, getItemWrap: function() { return itemWrap; }, getItems: function() { return itemWrap.children(conf.item).not("." + conf.clonedClass); }, move: function(offset, time) { return self.seekTo(index + offset, time); }, next: function(time) { return self.move(1, time); }, prev: function(time) { return self.move(-1, time); }, begin: function(time) { return self.seekTo(0, time); }, end: function(time) { return self.seekTo(self.getSize() -1, time); }, focus: function() { current = self; return self; }, addItem: function(item) { item = $(item); if (!conf.circular) { itemWrap.append(item); } else { $(".cloned:last").before(item); $(".cloned:first").replaceWith(item.clone().addClass(conf.clonedClass)); } fire.trigger("onAddItem", [item]); return self; }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { // check that index is sane if (!conf.circular && i < 0 || i > self.getSize()) { return self; } var item = i; if (i.jquery) { i = self.getItems().index(i); } else { item = self.getItems().eq(i); } // onBeforeSeek var e = $.Event("onBeforeSeek"); if (!fn) { fire.trigger(e, [i, time]); if (e.isDefaultPrevented() || !item.length) { return self; } } var props = vertical ? {top: -item.position().top} : {left: -item.position().left}; itemWrap.animate(props, time, conf.easing, fn || function() { fire.trigger("onSeek", [i]); }); current = self; index = i; return self; } }); // callbacks $.each(['onBeforeSeek', 'onSeek', 'onAddItem'], function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // circular loop if (conf.circular) { var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap), cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); cloned1.add(cloned2).addClass(conf.clonedClass); self.onBeforeSeek(function(e, i, time) { if (e.isDefaultPrevented()) { return; } /* 1. animate to the clone without event triggering 2. seek to correct position with 0 speed */ if (i == -1) { self.seekTo(cloned1, time, function() { self.end(0); }); return e.preventDefault(); } else if (i == self.getSize()) { self.seekTo(cloned2, time, function() { self.begin(0); }); } }); // seek over the cloned item self.seekTo(0, 0); } // next/prev buttons var prev = find(root, conf.prev).click(function() { self.prev(); }), next = find(root, conf.next).click(function() { self.next(); }); if (!conf.circular && self.getSize() > 2) { self.onBeforeSeek(function(e, i) { prev.toggleClass(conf.disabledClass, i <= 0); next.toggleClass(conf.disabledClass, i >= self.getSize() -1); }); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { if (conf.mousewheel) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; } }); } if (conf.keyboard) { $(document).bind("keydown.scrollable", function(evt) { // skip certain conditions if (!conf.keyboard || evt.altKey || evt.ctrlKey || $(evt.target).is(":input")) { return; } // does this instance have focus? if (conf.keyboard != 'static' && current != self) { return; } var key = evt.keyCode; if (vertical && (key == 38 || key == 40)) { self.move(key == 38 ? -1 : 1); return evt.preventDefault(); } if (!vertical && (key == 37 || key == 39)) { self.move(key == 37 ? -1 : 1); return evt.preventDefault(); } }); } // initial index $(self).trigger("onBeforeSeek", [conf.initialIndex]); } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.data("scrollable"); if (el) { return el; } conf = $.extend({}, $.tools.scrollable.conf, conf); this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
$('#defaultLanguageContainer').show(); | $('#defaultLanguage option').attr('disabled', 'disabled'); $('#languages input:checked').each(function() { $('#defaultLanguage option[value='+ $(this).val() +']').attr('disabled', ''); }); | $(document).ready(function() { // Step 1 - requirements $('a.toggleInformation').bind('click', function(evt) { evt.preventDefault(); $('#requirementsInformation').toggle(); }); // Step 3 - general settings (modules, languages, ...) if($('#languageTypeMultiple').is(':checked')) { $('#languages').show(); $('#defaultLanguageContainer').show(); } if($('#languageTypeSingle').is(':checked')) $('#language').show(); // multiple languages $('#languageTypeMultiple').bind('click', function() { if($('#languageTypeMultiple').is(':checked')) { $('#languages').show(); $('#language').hide(); $('#defaultLanguageContainer').show(); } }); // single languages $('#languageTypeSingle').bind('click', function() { if($('#languageTypeSingle').is(':checked')) { $('#languages').hide(); $('#language').show(); $('#defaultLanguageContainer').hide(); } }); // Step 5 - confirmation $('#showPassword').bind('change', function(evt) { evt.preventDefault(); // show password if($(this).is(':checked')) { $('#plainPassword').show(); $('#fakePassword').hide(); } else { $('#plainPassword').hide(); $('#fakePassword').show(); } });}); |
$('#defaultLanguageContainer').hide(); | $('#defaultLanguage option').attr('disabled', ''); | $(document).ready(function() { // Step 1 - requirements $('a.toggleInformation').bind('click', function(evt) { evt.preventDefault(); $('#requirementsInformation').toggle(); }); // Step 3 - general settings (modules, languages, ...) if($('#languageTypeMultiple').is(':checked')) { $('#languages').show(); $('#defaultLanguageContainer').show(); } if($('#languageTypeSingle').is(':checked')) $('#language').show(); // multiple languages $('#languageTypeMultiple').bind('click', function() { if($('#languageTypeMultiple').is(':checked')) { $('#languages').show(); $('#language').hide(); $('#defaultLanguageContainer').show(); } }); // single languages $('#languageTypeSingle').bind('click', function() { if($('#languageTypeSingle').is(':checked')) { $('#languages').hide(); $('#language').show(); $('#defaultLanguageContainer').hide(); } }); // Step 5 - confirmation $('#showPassword').bind('change', function(evt) { evt.preventDefault(); // show password if($(this).is(':checked')) { $('#plainPassword').show(); $('#fakePassword').hide(); } else { $('#plainPassword').hide(); $('#fakePassword').show(); } });}); |
$('#plugins a').each(function() { $(this).removeClass('selected'); | $('.gc-img').each(function() { window_top = $(window).height() + $(window).scrollTop(); if(window_top > $(this).offset().top) { show_lazy_graph($(this)); } | $('#plugins a').each(function() { $(this).removeClass('selected'); }); |
if ( !checkedNewVersion ){ | if ( !checkedNewVersion && Sonatype.lib.Permissions.checkPermission('nexus:status', Sonatype.lib.Permissions.READ) && !Ext.isEmpty( Sonatype.utils.editionShort ) && !Ext.isEmpty( Sonatype.utils.versionShort )){ | Sonatype.Events.addListener( 'nexusStatus', function() { if ( !checkedNewVersion ){ Ext.Ajax.request( { method: 'GET', suppressStatus: [404,401,-1], url: Sonatype.config.servicePath + '/lvo/nexus-' + Sonatype.utils.editionShort.substr( 0, 3 ).toLowerCase() + '/' + Sonatype.utils.versionShort, success: function( response, options ) { checkedNewVersion = true; var r = Ext.decode( response.responseText ); if ( r.response != null && r.response.isSuccessful && r.response.version ) { Sonatype.utils.postWelcomePageAlert( '<span style="color:#000">' + '<b>UPGRADE AVAILABLE:</b> ' + 'Nexus ' + Sonatype.utils.edition + ' ' + r.response.version + ' is now available. ' + '<a href="' + r.response.url + '" target="_blank">Download now!</a>' + '</span>' ); } }, failure: function() { checkedNewVersion = true; } }); }} ); |
var form = '#' + UID; | var formContainer = '#' + UID; | $(document).ready(function() { var validator = null; var title = $(callingButton).text() // Assign title to calling button's text var okButton = localizedButtons[0]; var cancelButton = localizedButtons[1]; var UID = new Date().getTime(); var form = '#' + UID; // Construct action to perform when OK and Cancels buttons are clicked var dialogOptions = {}; dialogOptions[okButton] = function() { validator = $(form).find('form').validate(); // Post to server and construct callback if ($(form).find('form').valid()) { $.post( $(form).attr("action"), $(form).serialize(), function(returnString) { if (returnString.status == true) { updateItem(actType, actOnId, returnString.content); $('#' + UID).dialog("close"); } else { // Display errors in error list $('#formErrors .formErrorList').html(returnString.content); } }, "json" ); } }; dialogOptions[cancelButton] = function() { $(this).dialog("close"); }; // Construct dialog var $dialog = $('<div id=' + UID + '></div>').dialog({ title: title, autoOpen: false, width: 600, modal: true, draggable: false, buttons: dialogOptions, open:function(event,ui) { $(this).load(url, null, function() { $('#loading').throbber("disable"); }); $(this).html("<div id='loading' class='throbber'></div>"); $('#loading').throbber({ bgcolor: "#CED7E1", speed: 1, }); $('#loading').throbber("enable"); }, close:function() { // Reset form validation errors and inputs on close if (validator != null) { validator.resetForm(); } clearFormFields(form); } }); // Tell the calling button to open this modal on click $(callingButton).live("click", (function() { $dialog.dialog('open') return false; })); }); |
validator = $(form).find('form').validate(); | $form = $(formContainer).find('form'); validator = $form.validate(); | $(document).ready(function() { var validator = null; var title = $(callingButton).text() // Assign title to calling button's text var okButton = localizedButtons[0]; var cancelButton = localizedButtons[1]; var UID = new Date().getTime(); var form = '#' + UID; // Construct action to perform when OK and Cancels buttons are clicked var dialogOptions = {}; dialogOptions[okButton] = function() { validator = $(form).find('form').validate(); // Post to server and construct callback if ($(form).find('form').valid()) { $.post( $(form).attr("action"), $(form).serialize(), function(returnString) { if (returnString.status == true) { updateItem(actType, actOnId, returnString.content); $('#' + UID).dialog("close"); } else { // Display errors in error list $('#formErrors .formErrorList').html(returnString.content); } }, "json" ); } }; dialogOptions[cancelButton] = function() { $(this).dialog("close"); }; // Construct dialog var $dialog = $('<div id=' + UID + '></div>').dialog({ title: title, autoOpen: false, width: 600, modal: true, draggable: false, buttons: dialogOptions, open:function(event,ui) { $(this).load(url, null, function() { $('#loading').throbber("disable"); }); $(this).html("<div id='loading' class='throbber'></div>"); $('#loading').throbber({ bgcolor: "#CED7E1", speed: 1, }); $('#loading').throbber("enable"); }, close:function() { // Reset form validation errors and inputs on close if (validator != null) { validator.resetForm(); } clearFormFields(form); } }); // Tell the calling button to open this modal on click $(callingButton).live("click", (function() { $dialog.dialog('open') return false; })); }); |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.