diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index e40636dbaf..a68ae3e715 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -403,7 +403,26 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { } elseif ($category == "provision" && $subcategory == "password" && $name == "var" ) { echo " \n"; - } else { + } + elseif ( + ($category == "theme" && $subcategory == "background_color_1" && $name == "text") || + ($category == "theme" && $subcategory == "background_color_2" && $name == "text") + ) { + // source: http://rightjs.org + echo " "; + echo " "; + echo " "; + echo " \n"; + echo " "; + } + else { echo " \n"; } echo "
\n"; diff --git a/resources/rightjs/colorpicker.png b/resources/rightjs/colorpicker.png new file mode 100644 index 0000000000..8cb302b025 Binary files /dev/null and b/resources/rightjs/colorpicker.png differ diff --git a/resources/rightjs/right-colorpicker-src.js b/resources/rightjs/right-colorpicker-src.js new file mode 100644 index 0000000000..d6e0406cdd --- /dev/null +++ b/resources/rightjs/right-colorpicker-src.js @@ -0,0 +1,1039 @@ +/** + * RightJS-UI Colorpicker v2.2.3 + * http://rightjs.org/ui/colorpicker + * + * Copyright (C) 2010-2012 Nikolay Nemshilov + */ +var Colorpicker = RightJS.Colorpicker = (function(document, Math, parseInt, RightJS) { +/** + * This module defines the basic widgets constructor + * it creates an abstract proxy with the common functionality + * which then we reuse and override in the actual widgets + * + * Copyright (C) 2010-2011 Nikolay Nemshilov + */ + +/** + * The widget units constructor + * + * @param String tag-name or Object methods + * @param Object methods + * @return Widget wrapper + */ +function Widget(tag_name, methods) { + if (!methods) { + methods = tag_name; + tag_name = 'DIV'; + } + + /** + * An Abstract Widget Unit + * + * Copyright (C) 2010 Nikolay Nemshilov + */ + var AbstractWidget = new RightJS.Class(RightJS.Element.Wrappers[tag_name] || RightJS.Element, { + /** + * The common constructor + * + * @param Object options + * @param String optional tag name + * @return void + */ + initialize: function(key, options) { + this.key = key; + var args = [{'class': 'rui-' + key}]; + + // those two have different constructors + if (!(this instanceof RightJS.Input || this instanceof RightJS.Form)) { + args.unshift(tag_name); + } + this.$super.apply(this, args); + + if (RightJS.isString(options)) { + options = RightJS.$(options); + } + + // if the options is another element then + // try to dynamically rewrap it with our widget + if (options instanceof RightJS.Element) { + this._ = options._; + if ('$listeners' in options) { + options.$listeners = options.$listeners; + } + options = {}; + } + this.setOptions(options, this); + + return (RightJS.Wrapper.Cache[RightJS.$uid(this._)] = this); + }, + + // protected + + /** + * Catches the options + * + * @param Object user-options + * @param Element element with contextual options + * @return void + */ + setOptions: function(options, element) { + if (element) { + options = RightJS.Object.merge(options, new Function("return "+( + element.get('data-'+ this.key) || '{}' + ))()); + } + + if (options) { + RightJS.Options.setOptions.call(this, RightJS.Object.merge(this.options, options)); + } + + return this; + } + }); + + /** + * Creating the actual widget class + * + */ + var Klass = new RightJS.Class(AbstractWidget, methods); + + // creating the widget related shortcuts + RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || RightJS([])); + + return Klass; +} + + +/** + * A shared button unit. + * NOTE: we use the DIV units instead of INPUTS + * so those buttons didn't interfere with + * the user's tab-index on his page + * + * Copyright (C) 2010-2011 Nikolay Nemshilov + */ +var Button = new RightJS.Class(RightJS.Element, { + /** + * Constructor + * + * @param String caption + * @param Object options + * @return void + */ + initialize: function(caption, options) { + this.$super('div', options); + this._.innerHTML = caption; + this.addClass('rui-button'); + this.on('selectstart', 'stopEvent'); + }, + + /** + * Disasbles the button + * + * @return Button this + */ + disable: function() { + return this.addClass('rui-button-disabled'); + }, + + /** + * Enables the button + * + * @return Button this + */ + enable: function() { + return this.removeClass('rui-button-disabled'); + }, + + /** + * Checks if the button is disabled + * + * @return Button this + */ + disabled: function() { + return this.hasClass('rui-button-disabled'); + }, + + /** + * Checks if the button is enabled + * + * @return Button this + */ + enabled: function() { + return !this.disabled(); + }, + + /** + * Overloading the method, so it fired the events + * only when the button is active + * + * @return Button this + */ + fire: function() { + if (this.enabled()) { + this.$super.apply(this, arguments); + } + return this; + } +}); + + +/** + * A shared module that toggles a widget visibility status + * in a uniformed way according to the options settings + * + * Copyright (C) 2010-2012 Nikolay Nemshilov + */ +var Toggler = { + /** + * Shows the element + * + * @param String fx-name + * @param Object fx-options + * @return Element this + */ + show: function(fx_name, fx_options) { + this.constructor.current = this; + return Toggler_toggle(this, 'show', fx_name, fx_options); + }, + + /** + * Hides the element + * + * @param String fx-name + * @param Object fx-options + * @return Element this + */ + hide: function(fx_name, fx_options) { + this.constructor.current = null; + return Toggler_toggle(this, 'hide', fx_name, fx_options); + }, + + /** + * Toggles the widget at the given element + * + * @param Element the related element + * @param String position right/bottom (bottom is the default) + * @param Boolean marker if the element should be resized to the element size + * @return Widget this + */ + showAt: function(element, where, resize) { + this.hide(null).shownAt = element = RightJS.$(element); + + // moves this element at the given one + Toggler_re_position.call(this, element, where, resize); + + return this.show(); + }, + + /** + * Toggles the widget at the given element + * + * @param Element the related element + * @param String position top/left/right/bottom (bottom is the default) + * @param Boolean marker if the element should be resized to the element size + * @return Widget this + */ + toggleAt: function(element, where, resize) { + return this.hidden() ? this.showAt(element, where, resize) : this.hide(); + } +}; + + +/** + * toggles the element's state according to the current settings + * + * @param event String 'show' or 'hide' the event name + * @param String an optional fx-name + * @param Object an optional fx-options hash + * @return void + */ +function Toggler_toggle(element, event, fx_name, fx_options) { + if ((event === 'hide' && element.visible()) || (event === 'show' && element.hidden())) { + if (RightJS.Fx) { + element.___fx = true; + + if (fx_name === undefined) { + fx_name = element.options.fxName; + + if (fx_options === undefined) { + fx_options = { + duration: element.options.fxDuration, + onFinish: function() { + element.___fx = false; + element.fire(event); + } + }; + + // hide on double time + if (event === 'hide') { + fx_options.duration = (RightJS.Fx.Durations[fx_options.duration] || + fx_options.duration) / 2; + } + } + } + } else { + // manually trigger the event if no fx were specified + element.___fx = false; + if (!fx_name) { element.fire(event); } + } + + return element.$super(fx_name, fx_options); + } else { + return element; + } +} + +/** + * Relatively positions the current element + * against the specified one + * + * NOTE: this function is called in a context + * of another element + * + * @param Element the target element + * @param String position 'right' or 'bottom' + * @param Boolean if `true` then the element size will be adjusted + * @return void + */ +function Toggler_re_position(element, where, resize) { + var anchor = this.reAnchor || (this.reAnchor = + new RightJS.Element('div', {'class': 'rui-re-anchor'})) + .insert(this), + + pos = anchor.insertTo(element, 'after').position(), + dims = element.dimensions(), target = this, + + border_top = parseInt(element.getStyle('borderTopWidth')), + border_left = parseInt(element.getStyle('borderLeftWidth')), + border_right = parseInt(element.getStyle('borderRightWidth')), + border_bottom = parseInt(element.getStyle('borderBottomWidth')), + + top = dims.top - pos.y + border_top, + left = dims.left - pos.x + border_left, + width = dims.width - border_left - border_right, + height = dims.height - border_top - border_bottom; + + // making the element to appear so we could read it's sizes + target.setStyle('visibility:hidden').show(null); + + if (where === 'right') { + left += width - target.size().x; + } else { // bottom + top += height; + } + + target.moveTo(left, top); + + if (resize) { + if (where === 'left' || where === 'right') { + target.setHeight(height); + } else { + target.setWidth(width); + } + } + + // rolling the invisibility back + target.setStyle('visibility:visible').hide(null); +} + +/** + * A shared module that provides for the widgets an ability + * to be assigned to an input element and work in pair with it + * + * NOTE: this module works in pair with the 'RePosition' module! + * + * Copyright (C) 2010 Nikolay Nemshilov + */ +var Assignable = { + /** + * Assigns the widget to serve the given input element + * + * Basically it puts the references of the current widget + * to the input and trigger objects so they could be recognized + * later, and it also synchronizes the changes between the input + * element and the widget + * + * @param {Element} input field + * @param {Element} optional trigger + * @return Widget this + */ + assignTo: function(input, trigger) { + input = RightJS.$(input); + trigger = RightJS.$(trigger); + + if (trigger) { + trigger[this.key] = this; + trigger.assignedInput = input; + } else { + input[this.key] = this; + } + + var on_change = RightJS(function() { + if (this.visible() && (!this.showAt || this.shownAt === input)) { + this.setValue(input.value()); + } + }).bind(this); + + input.on({ + keyup: on_change, + change: on_change + }); + + this.onChange(function() { + if (!this.showAt || this.shownAt === input) { + input.setValue(this.getValue()); + } + }); + + return this; + } +}; + + +/** + * The initialization files list + * + * Copyright (C) 2010 Nikolay Nemshilov + */ + +var R = RightJS, + $ = RightJS.$, + $w = RightJS.$w, + $$ = RightJS.$$, + $E = RightJS.$E, + $A = RightJS.$A, + isArray = RightJS.isArray, + Class = RightJS.Class, + Element = RightJS.Element, + Input = RightJS.Input; + + + + + + + + +/** + * The basic file for Colorpicker + * + * Copyright (C) 2010-2012 Nikolay Nemshilov + */ +var Colorpicker = new Widget({ + include: [Toggler, Assignable], + + extend: { + version: '2.2.3', + + EVENTS: $w('change show hide done'), + + Options: { + format: 'hex', // hex or rgb + + update: null, // an element to update with the color text + updateBg: null, // an element to update it's background color + updateBorder: null, // an element to update it's border color + updateColor: null, // an element to update it's text color + trigger: null, // a trigger element for the popup + + fxName: 'fade', // popup displaying fx + fxDuration: 'short', + + cssRule: '*[data-colorpicker]' + }, + + i18n: { + Done: 'Done' + }, + + // hides all the popup colorpickers on the page + hideAll: function() { + $$('div.rui-colorpicker').each(function(picker) { + if (picker instanceof Colorpicker && !picker.inlined()) { + picker.hide(); + } + }); + } + }, + + /** + * basic constructor + * + * @param Object options + */ + initialize: function(options) { + this + .$super('colorpicker', options) + .addClass('rui-panel') + .insert([ + this.field = new Field(), + this.colors = new Colors(), + this.controls = new Controls() + ]) + .on({ + mousedown: this.startTrack, + touchstart: this.startTrack, + + keyup: this.recalc, + blur: this.update, + focus: this.cancelTimer, + + done: this.done + }); + + // hooking up the elements to update + if (this.options.update) { this.assignTo(this.options.update, this.options.trigger); } + if (this.options.updateBg) { this.updateBg(this.options.updateBg); } + if (this.options.updateBorder) { this.updateBorder(this.options.updateBorder); } + if (this.options.updateColor) { this.updateColor(this.options.updateColor); } + + // setting up the initial values + this.tint = R([1, 0, 0]); + this.satur = 0; + this.bright = 1; + this.color = R([255, 255, 255]); + + this.recalc().update(); + }, + + /** + * Sets the color of the widget + * + * @param mixed value, Array or HEX or RGB value + * @return Colorpicker this + */ + setValue: function(value) { + var color = isArray(value) ? value : this.toColor(value); + if (color && color.length === 3) { + + // normalizing the data + color = color.map(function(value) { + return this.bound(parseInt(''+value), 0, 255); + }, this); + + this.color = color; + this.color2tint().update(); + + // reupdating the popup-state a bit later when we have the sizes + if (!this.colors.size().y) { + this.update.bind(this).delay(20); + } + } + return this; + }, + + /** + * Returns the value of the widget + * formatted according to the options + * + * @param Boolean if you need a clean RGB values array + * @return mixed value + */ + getValue: function(array) { + return array ? this.color : this[this.options.format === 'rgb' ? 'toRgb' : 'toHex'](); + }, + + /** + * Assigns the colorpicer to automatically update + * given element's background on changes + * + * @param mixed element reference + * @return Colorpicker this + */ + updateBg: function(element_ref) { + var element = $(element_ref); + if (element) { + this.onChange(R(function(color) { + element._.style.backgroundColor = this.toRgb(); + }).bind(this)); + } + return this; + }, + + /** + * Assigns the colorpicer to automatically update + * given element's text color on changes + * + * @param mixed element reference + * @return Colorpicker this + */ + updateColor: function(element_ref) { + var element = $(element_ref); + if (element) { + this.onChange(R(function(color) { + element._.style.color = this.toRgb(); + }).bind(this)); + } + return this; + }, + + /** + * Assigns the colorpicer to automatically update + * given element's border color on changes + * + * @param mixed element reference + * @return Colorpicker this + */ + updateBorder: function(element_ref) { + var element = $(element_ref); + if (element) { + this.onChange(R(function(color) { + element._.style.borderColor = this.toRgb(); + }).bind(this)); + } + return this; + }, + + + /** + * Inlines the widget into the given element + * + * @param Element reference + * @param String optional position + * @return Colorpicker this + */ + insertTo: function(element, position) { + return this + .$super(element, position) + .addClass('rui-colorpicker-inline'); + }, + + /** + * Checks if that's an inlined version of the widget + * + * @return Boolean check result + */ + inlined: function() { + return this.hasClass('rui-colorpicker-inline'); + }, + + /** + * Finalizes the action + * + * @return Colorpicker this + */ + done: function() { + if (!this.inlined()) { + this.hide(); + } + return this; + }, + +// protected + + // catching up the user options + setOptions: function(user_options) { + user_options = user_options || {}; + this.$super(user_options, $(user_options.trigger || user_options.update)); + }, + + // updates the preview and pointer positions + update: function() { + this.field._.style.backgroundColor = 'rgb('+ this.tint.map(function(c) { return Math.round(c*255); }) +')'; + + // updating the input fields + var color = this.color, controls = this.controls; + + controls.preview._.style.backgroundColor = controls.display._.value = this.toHex(); + + controls.rDisplay._.value = color[0]; + controls.gDisplay._.value = color[1]; + controls.bDisplay._.value = color[2]; + + // adjusting the field pointer position + var pointer = this.field.pointer._.style, + field = this.field.size(), + top = field.y - this.bright * field.y - 2, + left = this.satur * field.x - 2; + + pointer.top = this.bound(top, 0, field.y - 5) + 'px'; + pointer.left = this.bound(left, 0, field.x - 5) + 'px'; + + // adjusting the ting pointer position + var tint = this.tint, position; + field = this.colors.size(); + + if (tint[1] == 0) { // the red-blue section + position = tint[0] == 1 ? tint[2] : (2 - tint[0]); + } else if (tint[0] == 0) { // the blue-green section + position = 2 + (tint[2] == 1 ? tint[1] : (2 - tint[2])); + } else { // the green-red section + position = 4 + (tint[1] == 1 ? tint[0] : (2 - tint[1])); + } + + position = position / 6 * field.y; + + this.colors.pointer._.style.top = this.bound(position, 0, field.y - 4) + 'px'; + + // tracking the color change events + if (this.prevColor !== ''+this.color) { + this.fire('change', {value: this.color}); + this.prevColor = ''+ this.color; + } + + return this; + }, + + // recalculates the state after the input field changes + recalc: function(event) { + if (event) { + var field = event.target, value = field._.value, color = $A(this.color), changed=false; + + if (field === this.controls.display && /#\w{6}/.test(value)) { + // using the hex values + changed = color = this.toColor(value); + } else if (/^\d+$/.test(value)) { + // using the rgb values + color[field._.cIndex] = value; + changed = true; + } + + if (changed) { this.setValue(color); } + + } else { + this.tint2color(); + } + + return this; + }, + + // starts the mousemoves tracking + startTrack: function(event) { + this.stopTrack(); + this.cancelTimer(); + + if (event.target === this.field.pointer) { + event.target = this.field; + } else if (event.target === this.colors.pointer) { + event.target = this.colors; + } + + if (event.target === this.field || event.target === this.colors) { + event.stop(); + Colorpicker.tracking = this; + event.target.tracking = true; + this.trackMove(event); // jumping over there + } + }, + + // stops tracking the mousemoves + stopTrack: function() { + Colorpicker.tracking = false; + this.field.tracking = false; + this.colors.tracking = false; + }, + + // tracks the cursor moves over the fields + trackMove: function(event) { + var field, pos = event.position(), top, left; + + if (this.field.tracking) { + field = this.field.dimensions(); + } else if (this.colors.tracking) { + field = this.colors.dimensions(); + } + + if (field) { + top = this.bound(pos.y - field.top, 0, field.height); + left = this.bound(pos.x - field.left, 0, field.width); + + if (this.field.tracking) { + this.satur = left / field.width; + this.bright = 1 - top / field.height; + + } else if (this.colors.tracking) { + // preventing it from jumping to the top + if (top == field.height) { top = field.height - 0.1; } + + var step = field.height / 6, + tint = this.tint = [0, 0, 0], + stright = top % step / step, + reverse = 1 - stright; + + if (top < step) { + tint[0] = 1; + tint[2] = stright; + } else if (top < step * 2) { + tint[0] = reverse; + tint[2] = 1; + } else if (top < step * 3) { + tint[2] = 1; + tint[1] = stright; + } else if (top < step * 4) { + tint[2] = reverse; + tint[1] = 1; + } else if (top < step * 5) { + tint[1] = 1; + tint[0] = stright; + } else { + tint[1] = reverse; + tint[0] = 1; + } + } + + this.recalc().update(); + } + }, + + cancelTimer: function(event) { + R(function() { // IE has a lack of sync in here + if (this._hide_delay) { + this._hide_delay.cancel(); + this._hide_delay = null; + } + }).bind(this).delay(10); + } +}); + + +/** + * The colors field element + * + * Copyright (C) 2010-2011 + */ +var Field = new Class(Element, { + initialize: function(options) { + this.$super('div', {'class': 'field'}); + this.insert(this.pointer = $E('div', {'class': 'pointer'})); + } +}); + + +/** + * The tint picker block + * + * Copyright (C) 2010-2011 Nikolay Nemshilov + */ +var Colors = new Class(Element, { + initialize: function() { + this.$super('div', {'class': 'colors'}); + this.insert(this.pointer = $E('div', {'class': 'pointer'})); + } +}); + + +/** + * The controls block unit + * + * Copyright (C) 2010-2011 Nikolay Nemshilov + */ +var Controls = new Class(Element, { + initialize: function() { + this.$super('div', {'class': 'controls'}); + this.insert([ + this.preview = $E('div', {'class': 'preview', 'html': ' '}), + this.display = $E('input', {'type': 'text', 'class': 'display', maxlength: 7}), + $E('div', {'class': 'rgb-display'}).insert([ + $E('div').insert([$E('label', {html: 'R:'}), this.rDisplay = $E('input', {maxlength: 3, cIndex: 0})]), + $E('div').insert([$E('label', {html: 'G:'}), this.gDisplay = $E('input', {maxlength: 3, cIndex: 1})]), + $E('div').insert([$E('label', {html: 'B:'}), this.bDisplay = $E('input', {maxlength: 3, cIndex: 2})]) + ]), + this.button = new Button(Colorpicker.i18n.Done).onClick('fire', 'done') + ]); + } +}); + + +/** + * This module contains various caluculations logic for + * the Colorpicker widget + * + * Copyright (C) 2010 Nikolay Nemshilov + */ +Colorpicker.include({ + /** + * Converts the color to a RGB string value + * + * @param Array optional color + * @return String RGB value + */ + toRgb: function(color) { + return 'rgb('+ this.color.join(',') +')'; + }, + + /** + * Converts the color to a HEX string value + * + * @param Array optional color + * @return String HEX value + */ + toHex: function(color) { + return '#'+ this.color.map(function(c) { return (c < 16 ? '0' : '') + c.toString(16); }).join(''); + }, + + /** + * Converts a string value into an Array of color + * + * @param String value + * @return Array of color or null + */ + toColor: function(in_value) { + var value = in_value.toLowerCase(), match; + + if ((match = /rgb\((\d+),(\d+),(\d+)\)/.exec(value))) { + return [match[1], match[2], match[3]].map(parseInt); + + } else if (/#[\da-f]+/.test(value)) { + // converting the shortified hex in to the full-length version + if ((match = /^#([\da-f])([\da-f])([\da-f])$/.exec(value))) { + value = '#'+match[1]+match[1]+match[2]+match[2]+match[3]+match[3]; + } + + if ((match = /#([\da-f]{2})([\da-f]{2})([\da-f]{2})/.exec(value))) { + return [match[1], match[2], match[3]].map(function(n) { return parseInt(n, 16); }); + } + } + }, + + /** + * converts color into the tint, saturation and brightness values + * + * @return Colorpicker this + */ + color2tint: function() { + var color = $A(this.color).sort(function(a,b) { return a-b; }), + min = color[0], max = color[2]; + + this.bright = max / 255; + this.satur = 1 - min / (max || 1); + + this.tint.each(function(value, i) { + this.tint[i] = ((!min && !max) || min == max) ? i == 0 ? 1 : 0 : + (this.color[i] - min) / (max - min); + return this.tint[i]; + }, this); + + return this; + }, + + /** + * Converts tint, saturation and brightness into the actual RGB color + * + * @return Colorpicker this + */ + tint2color: function() { + var tint = this.tint, color = this.color; + + for (var i=0; i < 3; i++) { + color[i] = 1 + this.satur * (tint[i] - 1); + color[i] = Math.round(255 * color[i] * this.bright); + } + + return this; + }, + + /** + * bounds the value to the given limits + * + * @param {Number} value + * @param {Number} min value + * @param {Number} max value + * @return {Number} the value in bounds + */ + bound: function(in_value, min, max) { + var value = in_value; + + if (min < max) { + value = value < min ? min : value > max ? max : value; + } else { + if (value > max) { value = max; } + if (value < min) { value = min; } + } + + return value; + } +}); + + +/** + * The document level hooks for colorpicker + * + * Copyright (C) 2010-2012 Nikolay Nemshilov + */ + +function document_mouseup() { + if (Colorpicker.tracking) { + Colorpicker.tracking.stopTrack(); + } +} + +function document_mousemove(event) { + if (Colorpicker.tracking) { + Colorpicker.tracking.trackMove(event); + } +} + +$(document).on({ + mouseup: document_mouseup, + touchend: document_mouseup, + + mousemove: document_mousemove, + touchmove: document_mousemove, + + focus: function(event) { + var target = event.target instanceof Input ? event.target : null; + + Colorpicker.hideAll(); + + if (target && (target.colorpicker || target.match(Colorpicker.Options.cssRule))) { + + (target.colorpicker || new Colorpicker({update: target})) + .setValue(target.value()).showAt(target); + } + }, + + blur: function(event) { + var target = event.target, colorpicker = target.colorpicker; + + if (colorpicker) { + // we use the delay so it didn't get hidden when the user clicks the calendar itself + colorpicker._hide_delay = R(function() { + colorpicker.hide(); + }).delay(200); + } + }, + + click: function(event) { + var target = (event.target instanceof Element) ? event.target : null; + + if (target && (target.colorpicker || target.match(Colorpicker.Options.cssRule))) { + if (!(target instanceof Input)) { + event.stop(); + (target.colorpicker || new Colorpicker({trigger: target})) + .hide(null).toggleAt(target.assignedInput); + } + } else if (!event.find('div.rui-colorpicker')){ + Colorpicker.hideAll(); + } + }, + + keydown: function(event) { + var colorpicker = Colorpicker.current, name = ({ + 27: 'hide', // Escape + 13: 'done' // Enter + })[event.keyCode]; + + if (name && colorpicker && colorpicker.visible()) { + event.stop(); + colorpicker[name](); + } + } +}); + + +var embed_style = document.createElement('style'), + embed_rules = document.createTextNode("*.rui-button{display:inline-block; *display:inline; *zoom:1;height:1em;line-height:1em;margin:0;padding:.2em .5em;text-align:center;border:1px solid #CCC;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;cursor:pointer;color:#333;background-color:#FFF;user-select:none;-moz-user-select:none;-webkit-user-select:none} *.rui-button:hover{color:#111;border-color:#999;background-color:#DDD;box-shadow:#888 0 0 .1em;-moz-box-shadow:#888 0 0 .1em;-webkit-box-shadow:#888 0 0 .1em} *.rui-button:active{color:#000;border-color:#777;text-indent:1px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none} *.rui-button-disabled, *.rui-button-disabled:hover, *.rui-button-disabled:active{color:#888;background:#DDD;border-color:#CCC;cursor:default;text-indent:0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}div.rui-re-anchor{margin:0;padding:0;background:none;border:none;float:none;display:inline;position:absolute;z-index:9999}.rui-panel{margin:0;padding:.5em;position:relative;background-color:#EEE;border:1px solid #BBB;border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;box-shadow:.15em .3em .5em #BBB;-moz-box-shadow:.15em .3em .5em #BBB;-webkit-box-shadow:.15em .3em .5em #BBB;cursor:default}div.rui-colorpicker .field,div.rui-colorpicker .field *,div.rui-colorpicker .colors,div.rui-colorpicker .colors *{border:none;background:none;width:auto;height:auto;position:static;float:none;top:none;left:none;right:none;bottom:none;margin:0;padding:0;display:block;font-weight:normal;vertical-align:center}div.rui-colorpicker div.field,div.rui-colorpicker div.field div.pointer,div.rui-colorpicker div.colors,div.rui-colorpicker div.colors div.pointer{background:url(/resources/rightjs/colorpicker.png) no-repeat 0 0}div.rui-colorpicker div.field,div.rui-colorpicker div.colors,div.rui-colorpicker div.controls{display:inline-block; *display:inline; *zoom:1;position:relative;vertical-align:top;height:150px}div.rui-colorpicker div.field div.pointer,div.rui-colorpicker div.colors div.pointer{position:absolute;top:0px;left:0;width:9px;height:9px}div.rui-colorpicker input.display,div.rui-colorpicker div.preview,div.rui-colorpicker div.rgb-display,div.rui-colorpicker input.rui-ui-button{font-size:100%;display:block;width:auto;padding:0 .2em}div.rui-colorpicker input.display,div.rui-colorpicker div.preview,div.rui-colorpicker div.rgb-display input,div.rui-colorpicker input.rui-ui-button{border:1px solid #AAA;-moz-border-radius:.2em;-webkit-border-radius:.2em}div.rui-colorpicker div.field{width:150px;background-color:red;cursor:crosshair;margin-right:1.2em}div.rui-colorpicker div.field div.pointer{background-position:-170px 0;margin-left:-2px;margin-top:-2px}div.rui-colorpicker div.colors{width:16px;background-position:-150px 0;border-color:#EEE;cursor:pointer;margin-right:.6em}div.rui-colorpicker div.colors div.pointer{cursor:default;background-position:-170px -20px;margin-left:-8px;margin-top:-3px}div.rui-colorpicker div.controls{width:5em}div.rui-colorpicker div.preview{height:2em;background:white;border-color:#BBB}div.rui-colorpicker input.display{margin-top:.5em;background:#FFF;width:4.5em}div.rui-colorpicker div.rgb-display{padding:0;text-align:right;margin-top:.5em}div.rui-colorpicker div.rgb-display label{display:inline}div.rui-colorpicker div.rgb-display label:after{content:none}div.rui-colorpicker div.rgb-display input{vertical-align:top;font-size:100%;width:2em;text-align:right;margin-left:.2em;padding:0 .2em;background:#FFF;margin-bottom:1px;display:inline}div.rui-colorpicker div.rui-button{cursor:pointer;position:absolute;bottom:0;right:0;width:4em}div.rui-colorpicker-inline{display:inline-block; *display:inline; *zoom:1;position:relative;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;z-index:auto}"); + +embed_style.type = 'text/css'; +document.getElementsByTagName('head')[0].appendChild(embed_style); + +if(embed_style.styleSheet) { + embed_style.styleSheet.cssText = embed_rules.nodeValue; +} else { + embed_style.appendChild(embed_rules); +} + + +return Colorpicker; +})(document, Math, parseInt, RightJS); diff --git a/resources/rightjs/right-olds.js b/resources/rightjs/right-olds.js new file mode 100644 index 0000000000..c36669504d --- /dev/null +++ b/resources/rightjs/right-olds.js @@ -0,0 +1,9 @@ +/** + * The old browsers support module for RightJS + * + * Released under the terms of the MIT license + * Visit http://rightjs.org for more details + * + * Copyright (C) 2008-2012 Nikolay Nemshilov + */ +(function(a){function b(a,b){var c=document.createElement(b);c.setAttribute(a,";");return isFunction(c[a])}a.Browser.OLD&&a.Browser.IE&&(window.$=a.$=function(b){return function(c){var d=b(c);d&&d instanceof a.Element&&a.isString(c)&&d._.id!==c&&(d=a.$(document).first("#"+c));return d}}(a.$));if(!b("onsubmit","form")){var c=function(a){var b=$(a),c=b.target._,d=c.type,e=c.form,f;e&&(f=$(e).parent())&&(a.keyCode===13&&(d==="text"||d==="password")||a.type==="click"&&(d==="submit"||d==="image"))&&(b.type="submit",b.target=$(e),f.fire(b))};document.attachEvent("onclick",c),document.attachEvent("onkeypress",c)}if(!b("onchange","input")){var d=function(a){var b=a._,c=b.type;return c==="radio"||c==="checkbox"?b.checked:a.getValue()},e=function(a,b){var c=b.parent(),e=d(b);c&&""+b._prev_value!==""+e&&(b._prev_value=e,a.type="change",c.fire(a))},f=function(a){var b=$(a),c=b.target,d=c._.type,f=c._.tagName,g=d==="radio"||d==="checkbox";(b.type==="click"&&(g||f==="SELECT")||b.type==="keydown"&&(b.keyCode==13&&f!=="TEXTAREA"||d==="select-multiple"))&&e(b,c)},g=function(a){var b=$(a),c=b.target;c instanceof Input&&e(b,c)};document.attachEvent("onclick",f),document.attachEvent("onkeydown",f),document.attachEvent("onfocusout",g),document.attachEvent("onbeforeactivate",function(a){var b=$(a).target;b instanceof Input&&(b._prev_value=d(b))})}a.$E("p")._.getBoundingClientRect||a.Element.include({position:function(){var a=this._,b=a.offsetTop,c=a.offsetLeft,d=a.offsetParent;while(d)b+=d.offsetTop,c+=d.offsetLeft,d=d.offsetParent;return{x:c,y:b}}});var h=!!document.querySelector,i=!h;a.Browser.IE8L&&(i=!0);if(i){var j={" ":function(b,c){return a.$A(b.getElementsByTagName(c))},">":function(a,b){var c=[],d=a.firstChild;while(d)(b==="*"||d.tagName===b)&&c.push(d),d=d.nextSibling;return c},"+":function(a,b){while(a=a.nextSibling)if(a.tagName)return b==="*"||a.tagName===b?[a]:[];return[]},"~":function(a,b){var c=[];while(a=a.nextSibling)(b==="*"||a.tagName===b)&&c.push(a);return c}},k={not:function(b,c){return b.nodeType===1&&!a.$(b).match(c)},checked:function(a){return a.checked===!0},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},selected:function(a){return a.selected===!0},empty:function(a){return!a.firstChild},"first-child":function(a,b){while(a=a.previousSibling)if(a.nodeType===1&&(b===null||a.nodeName===b))return!1;return!0},"first-of-type":function(a){return k["first-child"](a,a.nodeName)},"last-child":function(a,b){while(a=a.nextSibling)if(a.nodeType===1&&(b===null||a.nodeName===b))return!1;return!0},"last-of-type":function(a){return k["last-child"](a,a.nodeName)},"only-child":function(a,b){return k["first-child"](a,b)&&k["last-child"](a,b)},"only-of-type":function(a){return k["only-child"](a,a.nodeName)},"nth-child":function(a,b,c,d){var e=1,f=b[0],g=b[1];while(a=d===!0?a.nextSibling:a.previousSibling)a.nodeType===1&&(c===undefined||a.nodeName===c)&&e++;return g===undefined?e===f:(e-g)%f===0&&(e-g)/f>=0},"nth-of-type":function(a,b){return k["nth-child"](a,b,a.nodeName)},"nth-last-child":function(a,b){return k["nth-child"](a,b,undefined,!0)},"nth-last-of-type":function(a,b){return k["nth-child"](a,b,a.nodeName,!0)}},l=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,m=/#([\w\-_]+)/,n=/^[\w\*]+/,o=/\.([\w\-\._]+)/,p=/:([\w\-]+)(\((.+?)\))*$/,q=/\[((?:[\w\-]*:)?[\w\-]+)\s*(?:([!\^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/,r={},s=function(a){if(!r[a]){var b,c,d,e,f,g,h,i,j,l={},s=a;while(i=s.match(q))f=f||{},f[i[1]]={o:i[2]||"",v:i[5]||i[6]||""},s=s.replace(i[0],"");if(i=s.match(p)){g=i[1],h=i[3]===""?null:i[3];if(g.startsWith("nth")){h=h.toLowerCase();if(h==="n")g=null,h=null;else{h==="odd"&&(h="2n+1"),h==="even"&&(h="2n");var t=/^([+\-]?\d*)?n([+\-]?\d*)?$/.exec(h);t?h=[t[1]==="-"?-1:parseInt(t[1],10)||1,parseInt(t[2],10)||0]:h=[parseInt(h,10),undefined]}}s=s.replace(i[0],"")}b=(s.match(m)||[1,null])[1],c=(s.match(n)||"*").toString().toUpperCase(),d=(s.match(o)||[1,""])[1].split(".").without(""),e=d.length,l.tag=c;if(b||d.length||f||g)b=b||!1,f=f||!1,g=g in k?k[g]:!1,d=e?d:!1,l.filter=function(a){var c,i=[],j=0,k=0,l=a.length,m;for(;j1&&(c=f(c));for(var i=0;i1?f(c):c}}return t[c]},v={},w={},x=function(a){if(!v[a]){l.lastIndex=0;var b=[],c=[],d=" ",e,f;while(e=l.exec(a))f=e[1],f==="+"||f===">"||f==="~"?d=f:(c.push([d,f]),d=" "),e[2]&&(b.push(u(c)),c=[]);b.push(u(c)),v[a]=b}return v[a]},y=function(a,b){var c=x(b),d=[];for(var e=0,f=c.length;e"+b+""+e[1];while(f--!==0)d=d.firstChild;b=d.childNodes;while(b.length!==0)bO.appendChild(b[0])}else for(var g=0,h=b.length,i;gb?1:a-1;c--)if(a.call(b,this[c],c,this))return this[c];return i};d.include({indexOf:k.indexOf||function(a,b){for(var c=b<0?h.max(0,this.length+b):b||0,d=this.length;c-1;b--)if(this[b]===a)return b;return-1},first:function(){return arguments.length?_(X,this,arguments):this[0]},last:function(){return arguments.length?_(Y,this,arguments):this[this.length-1]},random:function(){return this.length===0?i:this[h.random(this.length-1)]},size:function(){return this.length},clean:function(){this.length=0;return this},empty:function(){return this.length===0},clone:function(){return this.slice(0)},each:function(){_(R,this,arguments);return this},forEach:R,map:function(){return _(U,this,arguments)},filter:function(){return _(S,this,arguments)},reject:function(){return _(T,this,arguments)},some:function(a){return _(V,this,a?arguments:[ba])},every:function(a){return _(W,this,a?arguments:[ba])},walk:function(){this.map.apply(this,arguments).forEach(function(a,b){this[b]=a},this);return this},merge:function(){for(var a=this.clone(),b,c=0;c0;b=h.random(d-1),c=a[--d],a[d]=a[b],a[b]=c){}return a},sort:function(a){return Q.apply(this,a||!z(this[0])?arguments:[bb])},sortBy:function(){var a=Z(arguments,this);return this.sort(function(b,c){return bb(a[0].call(a[1],b),a[0].call(a[1],c))})},min:function(){return h.min.apply(h,this)},max:function(){return h.max.apply(h,this)},sum:function(){for(var a=0,b=0,c=this.length;b]+>/ig,"")},stripScripts:function(a){var b="",c=this.replace(/]*>([\s\S]*?)<\/script>/img,function(a,c){b+=c+"\n";return""});a===!0?t(b):x(a)&&a(b,c);return c},extractScripts:function(){var a="";this.stripScripts(function(b){a=b});return a},evalScripts:function(){this.stripScripts(!0);return this},camelize:function(){return this.replace(/(\-|_)+(.)?/g,function(a,b,c){return c?c.toUpperCase():""})},underscored:function(){return this.replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/\-/g,"_").toLowerCase()},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},dasherize:function(){return this.underscored().replace(/_/g,"-")},includes:function(a){return this.indexOf(a)!=-1},startsWith:function(a,b){return(b!==!0?this.indexOf(a):this.toLowerCase().indexOf(a.toLowerCase()))===0},endsWith:function(a,b){return this.length-(b!==!0?this.lastIndexOf(a):this.toLowerCase().lastIndexOf(a.toLowerCase()))===a.length},toInt:function(a){return parseInt(this,a===i?10:a)},toFloat:function(a){return parseFloat(a===!0?this:this.replace(",",".").replace(/(\d)-(\d)/,"$1.$2"))}}),e.prototype.include=e.prototype.includes,f.include({bind:function(){var a=J(arguments),b=a.shift(),c=this;return function(){return c.apply(b,a.length!==0||arguments.length!==0?a.concat(J(arguments)):a)}},bindAsEventListener:function(){var a=J(arguments),b=a.shift(),c=this;return function(d){return c.apply(b,[d].concat(a).concat(J(arguments)))}},curry:function(){return this.bind.apply(this,[this].concat(J(arguments)))},rcurry:function(){var a=J(arguments),b=this;return function(){return b.apply(b,J(arguments).concat(a))}},delay:function(){var a=J(arguments),b=a.shift(),c=new g(setTimeout(this.bind.apply(this,[this].concat(a)),b));c.cancel=function(){clearTimeout(this)};return c},periodical:function(){var a=J(arguments),b=a.shift(),c=new g(setInterval(this.bind.apply(this,[this].concat(a)),b));c.stop=function(){clearInterval(this)};return c},chain:function(){var a=J(arguments),b=a.shift(),c=this;return function(){var d=c.apply(c,arguments);b.apply(b,a);return d}}}),g.include({times:function(a,b){for(var c=0;c=a;d--)b.call(c,d);return this},to:function(a,b,c){var d=this+0,e=a,f=[],g=d;b=b||function(a){return a};if(e>d)for(;g<=e;g++)f.push(b.call(c,g));else for(;g>=e;g--)f.push(b.call(c,g));return f},abs:function(){return h.abs(this)},round:function(a){return a?parseFloat(this.toFixed(a)):h.round(this)},ceil:function(){return h.ceil(this)},floor:function(){return h.floor(this)},min:function(a){return thisa?a:this+0}}),RegExp.escape=function(a){return(""+a).replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1")},a.JSON||(a.JSON=function(){function g(a){return(a<10?"0":"")+a}function d(a){return a.replace(c,function(a){return b[a]||"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}var a=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,b={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;return{stringify:function(a){switch(typeof a){case"boolean":return e(a);case"number":return e(a+0);case"string":return'"'+d(a)+'"';case"object":if(a===null)return"null";if(B(a))return"["+J(a).map(JSON.stringify).join(",")+"]";if(m.call(a)==="[object Date]")return'"'+a.getUTCFullYear()+"-"+g(a.getUTCMonth()+1)+"-"+g(a.getUTCDate())+"T"+g(a.getUTCHours())+":"+g(a.getUTCMinutes())+":"+g(a.getUTCSeconds())+"."+g(a.getMilliseconds())+'Z"';var b=[],c;for(c in a)b.push('"'+c+'":'+JSON.stringify(a[c]));return"{"+b.join(",")+"}"}},parse:function(b){if(y(b)&&b){b=b.replace(a,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return(new f("return "+b))()}throw"JSON parse error: "+b}}}());var bc=j.Class=function(){var a=J(arguments).slice(0,2),b=a.pop()||{},c=a.pop(),d=arguments[2],e=function(){};!a.length&&!A(b)&&(c=b,b={}),!d&&c&&(c===bw||c.ancestors.include(bw))&&(d=bx()),d=s(d||function(){bi(this);return"initialize"in this?this.initialize.apply(this,arguments):this},bd),c=c||bc,e.prototype=c.prototype,d.prototype=new e,d.parent=c,d.prototype.constructor=d,d.ancestors=[];while(c)d.ancestors.push(c),c=c.parent;["extend","include"].each(function(a){a in b&&d[a].apply(d,N(b[a]))});return d.include(b)},bd={extend:function(){J(arguments).filter(A).each(function(a){s(this,bf(a,!0)),bg(this,a,!0)},this);return this},include:function(){var a=[this].concat(this.ancestors);J(arguments).filter(A).each(function(b){c.each(bf(b,!1),function(b,c){for(var d,e=0,f=a.length;e"),bs.OLD=bs.IE8L=bt=!0}catch(bv){}var bw=j.Wrapper=new bc({_:i,initialize:function(a){this._=a}});bw.Cache=q,bw.Cast=function(a){return a.tagName in bH?bH[a.tagName]:i};var bB=j.Document=new bc(bw,{win:function(){return bA(this._.defaultView||this._.parentWindow)}}),bC=bA(b),bD=j.Window=new bc(bw,{win:function(){return this},size:function(){var a=this._,b=a.document.documentElement;return a.innerWidth?{x:a.innerWidth,y:a.innerHeight}:{x:b.clientWidth,y:b.clientHeight}},scrolls:function(){var a=this._,b=a.document,c=b.body,d=b.documentElement;return a.pageXOffset||a.pageYOffset?{x:a.pageXOffset,y:a.pageYOffset}:c&&(c.scrollLeft||c.scrollTop)?{x:c.scrollLeft,y:c.scrollTop}:{x:d.scrollLeft,y:d.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=z(a)?null:E(a);f instanceof bG&&(a=f.position()),A(a)&&(e=a.y,d=a.x),A(c=c||b)&&j.Fx?(new cg.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),bE=j.Event=new bc(bw,{type:null,which:null,keyCode:null,target:null,currentTarget:null,relatedTarget:null,pageX:null,pageY:null,initialize:bz,stopPropagation:function(){this._.stopPropagation?this._.stopPropagation():this._.cancelBubble=!0,this.stopped=!0;return this},preventDefault:function(){this._.preventDefault?this._.preventDefault():this._.returnValue=!1;return this},stop:function(){return this.stopPropagation().preventDefault()},position:function(){return{x:this.pageX,y:this.pageY}},offset:function(){if(this.target instanceof bG){var a=this.target.position();return{x:this.pageX-a.x,y:this.pageY-a.y}}return null},find:function(a){if(this.target instanceof bw&&this.currentTarget instanceof bw){var b=this.target._,c=this.currentTarget.find(a,!0);while(b){if(c.indexOf(b)!==-1)return bA(b);b=b.parentNode}}return i}},bz),bF=[],bG=j.Element=new bc(bw,{initialize:function(a,b){bK(this,a,b)}},by),bH=bG.Wrappers={},bI={},bJ=function(a,c){return(a in bI?bI[a]:bI[a]=b.createElement(a)).cloneNode(!1)};bt&&(bJ=function(a,c){c!==i&&(a==="input"||a==="button")&&(a="<"+a+' name="'+c.name+'" type="'+c.type+'"'+(c.checked?" checked":"")+" />",delete c.name,delete c.type);return b.createElement(a)}),bG.include({parent:function(a){var b=this._.parentNode,c=b&&b.nodeType;return a?this.parents(a)[0]:c===1||c===9?bA(b):null},parents:function(a){return bL(this,"parentNode",a)},children:function(a){return this.find(a).filter(function(a){return a._.parentNode===this._},this)},siblings:function(a){return this.prevSiblings(a).reverse().concat(this.nextSiblings(a))},nextSiblings:function(a){return bL(this,"nextSibling",a)},prevSiblings:function(a){return bL(this,"previousSibling",a)},next:function(a){return!a&&this._.nextElementSibling!==i?bA(this._.nextElementSibling):this.nextSiblings(a)[0]},prev:function(a){return!a&&this._.previousElementSibling!==i?bA(this._.previousElementSibling):this.prevSiblings(a)[0]},remove:function(){var a=this._,b=a.parentNode;b&&b.removeChild(a);return this},insert:function(a,b){var c=null,d=this._;b=b===i?"bottom":b,typeof a!=="object"?c=a=""+a:a instanceof bG&&(a=a._),bM[b](d,a.nodeType===i?bQ(b==="bottom"||b==="top"?d:d.parentNode,a):a),c!==null&&c.evalScripts();return this},insertTo:function(a,b){E(a).insert(this,b);return this},append:function(a){return this.insert(y(a)?J(arguments).join(""):arguments)},update:function(a){if(typeof a!=="object"){a=""+a;try{this._.innerHTML=a}catch(b){return this.clean().insert(a)}a.evalScripts();return this}return this.clean().insert(a)},html:function(a){return a===i?this._.innerHTML:this.update(a)},text:function(a){return a===i?this._.textContent===i?this._.innerText:this._.textContent:this.update(this.doc()._.createTextNode(a))},replace:function(a){return this.insert(a,"instead")},wrap:function(a){var b=this._,c=b.parentNode;c&&(a=E(a)._,c.replaceChild(a,b),a.appendChild(b));return this},clean:function(){while(this._.firstChild)this._.removeChild(this._.firstChild);return this},empty:function(){return this.html().blank()},clone:function(){return new bG(this._.cloneNode(!0))},index:function(){var a=this._,b=a.parentNode.firstChild,c=0;while(b!==a)b.nodeType===1&&c++,b=b.nextSibling;return c}});var bM={bottom:function(a,b){a.appendChild(b)},top:function(a,b){a.firstChild!==null?a.insertBefore(b,a.firstChild):a.appendChild(b)},after:function(a,b){var c=a.parentNode,d=a.nextSibling;d!==null?c.insertBefore(b,d):c.appendChild(b)},before:function(a,b){a.parentNode.insertBefore(b,a)},instead:function(a,b){a.parentNode.replaceChild(b,a)}},bN={TBODY:["","
",2],TR:["","
",3],TD:["","
",4],COL:["","
",2],LEGEND:["
","
",2],AREA:["","",2],OPTION:["",2]};v(bN,{OPTGROUP:"OPTION",THEAD:"TBODY",TFOOT:"TBODY",TH:"TD"});var bO=b.createDocumentFragment(),bP=b.createElement("DIV");bG.include({setStyle:function(a,b){var c,d,e={},f=this._.style;b!==i?(e[a]=b,a=e):y(a)&&(a.split(";").each(function(a){var b=a.split(":").map("trim");b[0]&&b[1]&&(e[b[0]]=b[1])}),a=e);for(c in a)d=c.indexOf("-")<0?c:c.camelize(),bu&&c==="opacity"?f.filter="alpha(opacity="+a[c]*100+")":c==="float"&&(d=br?"styleFloat":"cssFloat"),f[d]=a[c];return this},getStyle:function(a){return bR(this._.style,a)||bR(this.computedStyles(),a)},computedStyles:o.currentStyle?function(){return this._.currentStyle||{}}:o.runtimeStyle?function(){return this._.runtimeStyle||{}}:function(){return this._.ownerDocument.defaultView.getComputedStyle(this._,null)},hasClass:function(a){return(" "+this._.className+" ").indexOf(" "+a+" ")!=-1},setClass:function(a){this._.className=a;return this},getClass:function(){return this._.className},addClass:function(a){var b=" "+this._.className+" ";b.indexOf(" "+a+" ")==-1&&(this._.className+=(b===" "?"":" ")+a);return this},removeClass:function(a){this._.className=(" "+this._.className+" ").replace(" "+a+" "," ").trim();return this},toggleClass:function(a){return this[this.hasClass(a)?"removeClass":"addClass"](a)},radioClass:function(a){this.siblings().each("removeClass",a);return this.addClass(a)}}),bG.include({set:function(a,b){if(typeof a==="string"){var c={};c[a]=b,a=c}var d,e=this._;for(d in a)d==="style"?this.setStyle(a[d]):(d in e||e.setAttribute(d,""+a[d]),d.substr(0,5)!=="data-"&&(e[d]=a[d]));return this},get:function(a){var b=this._,c=b[a]||b.getAttribute(a);return c===""?null:c},has:function(a){return this.get(a)!==null},erase:function(a){this._.removeAttribute(a);return this},hidden:function(){return this.getStyle("display")==="none"},visible:function(){return!this.hidden()},hide:function(a,b){this.visible()&&(this._d=this.getStyle("display"),this._.style.display="none");return this},show:function(){if(this.hidden()){var a=this._,b=this._d,c;if(!b||b==="none")c=G(a.tagName).insertTo(o),b=c.getStyle("display"),c.remove();b==="none"&&(b="block"),a.style.display=b}return this},toggle:function(){return this[this.visible()?"hide":"show"]()},radio:function(a,b){this.siblings().each("hide",a,b);return this.show()},data:function(a,b){var c,d,e,f,g,h;if(A(a))for(c in a)b=this.data(c,a[c]);else if(b===i){a="data-"+(""+a).dasherize();for(d={},e=!1,f=this._.attributes,h=0;hb.x&&a.xb.y&&a.y1)e=f.shift(),e.endsWith("]")&&(e=e.substr(0,e.length-1)),d[e]||(d[e]=f[0]==="]"?[]:{}),d=d[e];e=f.shift(),e.endsWith("]")&&(e=e.substr(0,e.length-1)),e===""?d.push(b.value()):d[e]=b.value()}});return a},serialize:function(){return c.toQueryString(this.values())},submit:function(){this._.submit();return this},reset:function(){this._.reset();return this}});bS("submit reset focus blur disable enable change");var bU=j.Input=bH.INPUT=bH.BUTTON=bH.SELECT=bH.TEXTAREA=bH.OPTGROUP=new bc(bG,{initialize:function(a,b){if(!a||A(a)&&!C(a))b=a||{},/textarea|select/.test(b.type||"")?(a=b.type,delete b.type):a="input";this.$super(a,b)},form:function(){return bA(this._.form)},insert:function(a,b){this.$super(a,b),this.find("option").each(function(a){a._.selected=!!a.get("selected")});return this},update:function(a){return this.clean().insert(a)},getValue:function(){return this._.type=="select-multiple"?this.find("option").map(function(a){return a._.selected?a._.value:null}).compact():this._.value},setValue:function(a){this._.type=="select-multiple"?(a=N(a).map(e),this.find("option").each(function(b){b._.selected=a.include(b._.value)})):this._.value=a;return this},value:function(a){return this[a===i?"getValue":"setValue"](a)},focus:function(){this._.focus(),this.focused=!0,br&&this.fire("focus",{bubbles:!1});return this},blur:function(){this._.blur(),this.focused=!1,br&&this.fire("blur",{bubbles:!1});return this},select:function(){this._.select();return this.focus()},disable:function(){this._.disabled=!0;return this.fire("disable")},enable:function(){this._.disabled=!1;return this.fire("enable")},disabled:function(a){return a===i?this._.disabled:this[a?"disable":"enable"]()},checked:function(a){a===i?a=this._.checked:(this._.checked=a,a=this);return a}});bt?(b.attachEvent("onfocusin",bV),b.attachEvent("onfocusout",bV)):(b.addEventListener("focus",bV,!0),b.addEventListener("blur",bV,!0));var bW=[],bX=!0;bS("mouseenter mouseleave"),[bG,bB].each("include",{delegate:function(a){var b=cb(arguments),c,d,e,f;for(c in b)for(d=0,f=b[c];d=200&&this.status<300},send:function(a){var b={},c=this.url,d=this.method.toLowerCase(),e=this.headers,f,g;if(d=="put"||d=="delete")b._method=d,d="post";var h=this.prepareData(this.params,this.prepareParams(a),b);this.urlEncoded&&d=="post"&&!e["Content-type"]&&this.setHeader("Content-type","application/x-www-form-urlencoded;charset="+this.encoding),d=="get"&&(h&&(c+=(c.include("?")?"&":"?")+h),h=null),g=this.xhr=this.createXhr(),this.fire("create"),g.open(d,c,this.async),g.onreadystatechange=this.stateChanged.bind(this);for(f in e)g.setRequestHeader(f,e[f]);g.send(h),this.fire("request"),this.async||this.stateChanged();return this},update:function(a,b){return this.onSuccess(function(b){a.update(b.text)}).send(b)},cancel:function(){var a=this.xhr;if(!a||a.canceled)return this;a.abort(),a.onreadystatechange=function(){},a.canceled=!0;return this.fire("cancel")},fire:function(a){return this.$super(a,this,this.xhr)},createXhr:function(){return this.jsonp?new ce.JSONP(this):this.form&&this.form.first("input[type=file]")?new ce.IFramed(this.form):"ActiveXObject"in a?new ActiveXObject("MSXML2.XMLHTTP"):new XMLHttpRequest},prepareParams:function(a){return a},prepareData:function(){return J(arguments).map(function(a){y(a)||(a=c.toQueryString(a));return a.blank()?null:a}).compact().join("&")},stateChanged:function(){var a=this.xhr;if(a.readyState==4&&!a.canceled){try{this.status=a.status}catch(b){this.status=0}this.text=this.responseText=a.responseText,this.xml=this.responseXML=a.responseXML,this.fire("complete").fire(this.successful()?"success":"failure")}},tryScripts:function(a){var b=this.getHeader("Content-type"),c=this.getHeader("X-JSON");c&&(this.json=this.responseJSON=this.headerJSON=JSON.parse(c)),this.evalResponse||this.evalJS&&/(ecma|java)script/i.test(b)?t(this.text):/json/.test(b)&&this.evalJSON?this.json=this.responseJSON=JSON.parse(this.text):this.evalScripts&&this.text.evalScripts()},initCallbacks:function(){this.on({create:"showSpinner",complete:"hideSpinner",cancel:"hideSpinner"}),this.on("complete","tryScripts"),ce.EVENTS.each(function(a){this.on(a,function(){ce.fire(a,this,this.xhr)})},this)},showSpinner:function(){ce.showSpinner.call(this,this)},hideSpinner:function(){ce.hideSpinner.call(this,this)}});s(bl(ce),{counter:0,showSpinner:function(a){ce.trySpinner(a,"show")},hideSpinner:function(a){ce.trySpinner(a,"hide")},trySpinner:function(a,b){var c=a||ce.Options,d=E(c.spinner);d&&d[b](c.spinnerFx,{duration:100})},countIn:function(){ce.counter++,ce.showSpinner()},countOut:function(){ce.counter--,ce.counter<1&&ce.hideSpinner()}}).on({create:"countIn",complete:"countOut",cancel:"countOut"}),bT.include({send:function(a){a=a||{},a.method=a.method||this._.method||"post",this.xhr=(new ce(this._.action||b.location.href,s({spinner:this.first(".spinner")},a))).onComplete(this.enable.bind(this)).onCancel(this.enable.bind(this)).send(this),this.disable.bind(this).delay(1);return this},cancelXhr:function(){this.xhr instanceof ce&&this.xhr.cancel();return this},remotize:function(a){this.remote||(this.on("submit",cf,a),this.remote=!0);return this},unremotize:function(){this.stopObserving("submit",cf),this.remote=!1;return this}}),ce.include({prepareParams:function(a){a&&a instanceof bT&&(this.form=a,a=a.values());return a}}),bG.include({load:function(a,b){(new ce(a,s({method:"get"},b))).update(this);return this}}),ce.Dummy={open:function(){},setRequestHeader:function(){},onreadystatechange:function(){}},ce.IFramed=new bc({include:ce.Dummy,initialize:function(a){this.form=a,this.id="xhr_"+(new Date).getTime(),this.form.doc().first("body").append('',"after"),E(this.id).on("load",this.onLoad.bind(this))},send:function(){this.form.set("target",this.id).submit()},onLoad:function(){this.status=200,this.readyState=4,this.form.set("target","");try{this.responseText=a[this.id].document.documentElement.innerHTML}catch(b){}this.onreadystatechange()},abort:function(){E(this.id).set("src","about:blank")}}),ce.JSONP=new bc({include:ce.Dummy,prefix:"jsonp",initialize:function(a){this.xhr=a,this.name=this.prefix+(new Date).getTime(),this.param=(y(a.jsonp)?a.jsonp:"callback")+"="+this.name,this.script=G("script",{charset:a.encoding,async:a.async})},open:function(a,b,c){this.url=b,this.method=a},send:function(b){a[this.name]=this.finish.bind(this),this.script.set("src",this.url+(this.url.include("?")?"&":"?")+this.param+"&"+b).insertTo(F("script").last(),"after")},finish:function(a){this.status=200,this.readyState=4,this.xhr.json=this.xhr.responseJSON=a,this.onreadystatechange()},abort:function(){a[this.name]=function(){}}});var cg=j.Fx=new bc(bk,{extend:{EVENTS:H("start finish cancel"),Durations:{"short":200,normal:400,"long":800},Options:{fps:bt?40:60,duration:"normal",transition:"default",queue:!0,engine:"css"}},initialize:function(a,b){this.$super(b),this.element=E(a),cj(this)},start:function(){if(ck(this,arguments))return this;cl(this),this.prepare.apply(this,arguments),cp(this);return this.fire("start",this)},finish:function(){cq(this),cm(this),this.fire("finish"),cn(this);return this},cancel:function(){cq(this),cm(this);return this.fire("cancel")},prepare:function(){},render:function(){}}),ch=[],ci=[],cr={"default":"(.25,.1,.25,1)",linear:"(0,0,1,1)","ease-in":"(.42,0,1,1)","ease-out":"(0,0,.58,1)","ease-in-out":"(.42,0,.58,1)","ease-out-in":"(0,.42,1,.58)"},cs={};e.COLORS={maroon:"#800000",red:"#ff0000",orange:"#ffA500",yellow:"#ffff00",olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",gray:"#808080",brown:"#a52a2a"},e.include({toHex:function(){var a=/^#(\w)(\w)(\w)$/.exec(this);a?a="#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:(a=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(this))?a="#"+a.slice(1).map(function(a){a=(a-0).toString(16);return a.length==1?"0"+a:a}).join(""):a=e.COLORS[this]||this;return a},toRgb:function(a){var b=/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(this.toHex()||"");b&&(b=b.slice(1).map("toInt",16),b=a?b:"rgb("+b+")");return b}}),bG.include({stop:function(){co(this);return this},hide:function(a,b){return a&&this.visible()?cu(this,a,["out",b]):this.$super()},show:function(a,b){return a&&!this.visible()?cu(this,a,["in",b]):this.$super()},toggle:function(a,b){return a?cu(this,a,["toggle",b]):this.$super()},remove:function(a,b){return a&&this.visible()?cu(this,a,["out",s(b||{},{onFinish:this.$super.bind(this)})]):this.$super()},morph:function(a,b){return cu(this,"morph",[a,b||{}])},highlight:function(){return cu(this,"highlight",arguments)},fade:function(){return cu(this,"fade",arguments)},slide:function(){return cu(this,"slide",arguments)},scroll:function(a,b){return cu(this,"scroll",[a,b||{}])},scrollTo:function(a,b){return A(b)?this.scroll(a,b):this.$super.apply(this,arguments)}});var cv=["WebkitT","OT","MozT","MsT","t"].first(function(a){return a+"ransition"in o.style}),cw=cv+"ransition",cx=cw+"Property",cy=cw+"Duration",cz=cw+"TimingFunction",cA={Sin:"cubic-bezier(.3,0,.6,1)",Cos:"cubic-bezier(0,.3,.6,0)",Log:"cubic-bezier(0,.6,.3,.8)",Exp:"cubic-bezier(.6,0,.8,.3)",Lin:"cubic-bezier(0,0,1,1)"};cg.Options.engine=cv===i||bq?"javascript":"native",cg.Morph=new bc(cg,{prepare:function(a){if(this.options.engine==="native"&&cv!==i)this.render=this.transition=function(){},cB.call(this,a);else{var b=cE(a),c=cJ(this.element,b),d=cK(this.element,a,b);cI(this.element,c,d),this.before=cH(c),this.after=cH(d)}},render:function(a){var b,c,d,e=this.element._.style,f,g,i;for(f in this.after){b=this.before[f],c=this.after[f];for(g=0,i=c.length;g