File Manager

Current Directory: /home/astoriaah/www/old15/administrator/components/com_jce/media/js
Viewing File: /home/astoriaah/www/old15/administrator/components/com_jce/media/js/core.min.js
/* jce - 2.6.26 | 2018-01-31 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2018 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ !function($){$.support.canvas=!1;$.fn.tooltip=function(options){function init(element){$(element).hasClass("wf-tooltip-cancel-ondrag")&&cancelOnDrag(element),$(element).click(function(e){if(e.preventDefault(),!("click"==options.trigger&&$(this).is(options.disabled)||"A"==this.nodeName||$("a",this).length||$(this).hasClass("wf-tooltip-cancel-ondrag"))){if("click"==options.trigger){if($(".uk-tooltip").is(":visible"))return end();start(e,element)}$(".uk-tooltip").hasClass("uk-tooltip-sticky")?unpin():pin(element)}}),$(element).on("tooltip:close",function(){return end(element)}),"hover"==options.trigger&&$(element).hover(function(e){if(!$(".uk-tooltip").hasClass("uk-tooltip-sticky")&&!$(this).hasClass("uk-tooltip-nohover"))return start(e,element)},function(e){if(!$(".uk-tooltip").hasClass("uk-tooltip-sticky")&&!$(this).hasClass("uk-tooltip-nohover"))return end(element)})}function createTips(){var $tips=$(".uk-tooltip");$tips.get(0)||($tips=$('<div class="tooltip uk-tooltip" role="tooltip" aria-hidden="true"><span class="close uk-icon uk-icon-close" title="Close">&times;</span><div class="tooltip-arrow"></div><div class="tooltip-inner uk-tooltip-inner"></div></div>').appendTo(options.parent),$(".uk-icon-close",$tips).click(function(){end()}).hide()),$tips.addClass("tooltip").addClass(options.className)}function start(e,element){createTips();var $tips=$(".uk-tooltip");if($tips.data("source",element),options.content)var h=options.content;else{var text=$(element).attr("title")||"",title="";if(/::/.test(text)){var parts=text.split("::");title=$.trim(parts[0]),text=$.trim(parts[1])}$(element).data("title",$(element).attr("title")).attr("title",""),$(element).attr("aria-describedby","uk-tooltip");var h="";title&&(h+="<h4>"+title+"</h4>"),text&&(h+="<p>"+text+"</p>")}$(".uk-tooltip-inner",$tips).html(h),$tips.show().addClass("in").attr("aria-hidden","false"),locate(e,element),$(element).trigger("tooltip:show"),window.setTimeout(function(){$tips.css("visibility","visible")},1)}function end(element){var $tips=$(".uk-tooltip"),element=$tips.data("source")||element;$(element).data("title")&&$(element).attr("title",$(element).data("title")),$(element).removeAttr("aria-describedby"),$tips.css("visibility","hidden").attr("aria-hidden","true").hide(),$(".uk-tooltip").attr("class","uk-tooltip").removeClass("in"),$(".uk-tooltip-inner").empty(),$(element).trigger("tooltip:hide"),unpin()}function cancelOnDrag(element){$(element).bind("mousedown",function(){$(this).addClass("nohover"),end(),$(this).data("title",$(this).attr("title")).attr("title","")}).bind("mouseup",function(){$(this).removeClass("nohover"),$(this).attr("title",$(this).data("title"))})}function pin(element){$(".uk-tooltip").addClass("uk-tooltip-sticky"),$(".uk-icon-close",".uk-tooltip").show(),$(window).on("click.tooltip-blur",function(e){var el=$(element).get(0),n=e.target;n==el||"LABEL"==el.nodeName&&$(el).attr("for")&&n==$("#"+$(el).attr("for")).get(0)||n==$(".uk-tooltip").get(0)||0===$(n).parents(".uk-tooltip").length&&end()})}function unpin(){$(".uk-tooltip").removeClass("uk-tooltip-sticky"),$(".uk-icon-close",".uk-tooltip").hide(),$(window).off("click.tooltip-blur")}function locate(e,element){createTips();var $tips=$(".uk-tooltip"),o=options.offsets,pos=$(e.target).offset(),parent=$tips.parent().position();pos.left=pos.left-parent.left,pos.top=pos.top-parent.top;var tip={width:$tips.outerWidth(),height:$tips.outerHeight()};pos=$.extend(pos,{width:$(e.target).outerWidth(),height:$(e.target).outerHeight()});var position=options.position,scrollTop=$(document).scrollTop();position=pos.top-tip.height<0||pos.top<scrollTop+tip.height+o.y?position.replace(/(top|center)\s+/,"bottom "):position.replace(/(bottom|center)\s+/,"top "),position=pos.left+tip.width>$(window).width()?position.replace("right","left"):position.replace("left","right");var style={"top center":{top:Math.max(pos.top-tip.height-o.y,10),left:Math.max(pos.left+pos.width/2-tip.width/2,5)},"bottom center":{top:Math.max(pos.top+pos.height+o.y,10),left:Math.max(pos.left+pos.width/2-tip.width/2,5)},"center right":{top:Math.max(pos.top-tip.height/2+pos.height/2,5),left:Math.max(pos.left+pos.width,10)},"center left":{top:Math.max(pos.top-tip.height/2+pos.height/2,5),left:Math.max(pos.left-tip.width,10)},"bottom right":{top:Math.max(pos.top-tip.height+o.y,5),left:Math.max(pos.left+pos.width,10)},"bottom left":{top:Math.max(pos.top-tip.height+pos.height+o.y,5),left:Math.max(pos.left-tip.width,10)},"top right":{top:Math.max(pos.top-tip.height-o.y,10),left:Math.max(pos.left+pos.width,10)},"top left":{top:Math.max(pos.top-tip.height-o.y,10),left:Math.max(pos.left-tip.width,10)}};$.each(position.split(" "),function(i,s){$tips.addClass(s).addClass("uk-tooltip-"+s)}),$tips.css(style[position])}return options=$.extend({speed:150,position:"top center",className:"",offsets:{x:16,y:16},width:200,fixed:!0,parent:"body",trigger:"hover",disabled:":disabled, .disabled"},options),this.each(function(){init(this)})},$.fn.tips=$.fn.tooltip}(jQuery),function($){var ColorPicker=function(element,options){this.options=$.extend(this.options,options),this.element=element,this._init()};ColorPicker.prototype={options:{color:"#FFFFFF",detail:50,speed:200,stylesheets:[],custom_colors:"",forcedHighContrastMode:!1,labels:{picker:"Picker",title:"Color Picker",palette:"Web Colors",named:"Named Colors",template:"Template Colors",custom:"Custom Colors",color:"Color",apply:"Apply",name:"Name"},dialog:!1,parent:"body"},_strhex:"0123456789abcdef",_colors:["#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033","#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099","#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff","#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033","#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399","#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff","#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333","#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399","#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff","#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633","#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699","#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff","#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633","#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999","#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff","#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933","#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999","#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff","#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33","#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99","#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff","#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33","#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99","#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff","#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33","#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99","#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"],_named:{"#F0F8FF":"AliceBlue","#FAEBD7":"AntiqueWhite","#7FFFD4":"Aquamarine","#F0FFFF":"Azure","#F5F5DC":"Beige","#FFE4C4":"Bisque","#000000":"Black","#FFEBCD":"BlanchedAlmond","#0000FF":"Blue","#8A2BE2":"BlueViolet","#A52A2A":"Brown","#DEB887":"BurlyWood","#5F9EA0":"CadetBlue","#7FFF00":"Chartreuse","#D2691E":"Chocolate","#FF7F50":"Coral","#6495ED":"CornflowerBlue","#FFF8DC":"Cornsilk","#DC143C":"Crimson","#00008B":"DarkBlue","#008B8B":"DarkCyan","#B8860B":"DarkGoldenRod","#A9A9A9":"DarkGray","#006400":"DarkGreen","#BDB76B":"DarkKhaki","#8B008B":"DarkMagenta","#556B2F":"DarkOliveGreen","#FF8C00":"Darkorange","#9932CC":"DarkOrchid","#8B0000":"DarkRed","#E9967A":"DarkSalmon","#8FBC8F":"DarkSeaGreen","#483D8B":"DarkSlateBlue","#2F4F4F":"DarkSlateGrey","#00CED1":"DarkTurquoise","#9400D3":"DarkViolet","#FF1493":"DeepPink","#00BFFF":"DeepSkyBlue","#696969":"DimGrey","#1E90FF":"DodgerBlue","#B22222":"FireBrick","#FFFAF0":"FloralWhite","#228B22":"ForestGreen","#DCDCDC":"Gainsboro","#F8F8FF":"GhostWhite","#FFD700":"Gold","#DAA520":"GoldenRod","#808080":"Grey","#008000":"Green","#ADFF2F":"GreenYellow","#F0FFF0":"HoneyDew","#FF69B4":"HotPink","#CD5C5C":"IndianRed","#4B0082":"Indigo","#FFFFF0":"Ivory","#F0E68C":"Khaki","#E6E6FA":"Lavender","#FFF0F5":"LavenderBlush","#7CFC00":"LawnGreen","#FFFACD":"LemonChiffon","#ADD8E6":"LightBlue","#F08080":"LightCoral","#E0FFFF":"LightCyan","#FAFAD2":"LightGoldenRodYellow","#D3D3D3":"LightGrey","#90EE90":"LightGreen","#FFB6C1":"LightPink","#FFA07A":"LightSalmon","#20B2AA":"LightSeaGreen","#87CEFA":"LightSkyBlue","#778899":"LightSlateGrey","#B0C4DE":"LightSteelBlue","#FFFFE0":"LightYellow","#00FF00":"Lime","#32CD32":"LimeGreen","#FAF0E6":"Linen","#FF00FF":"Magenta","#800000":"Maroon","#66CDAA":"MediumAquaMarine","#0000CD":"MediumBlue","#BA55D3":"MediumOrchid","#9370D8":"MediumPurple","#3CB371":"MediumSeaGreen","#7B68EE":"MediumSlateBlue","#00FA9A":"MediumSpringGreen","#48D1CC":"MediumTurquoise","#C71585":"MediumVioletRed","#191970":"MidnightBlue","#F5FFFA":"MintCream","#FFE4E1":"MistyRose","#FFE4B5":"Moccasin","#FFDEAD":"NavajoWhite","#000080":"Navy","#FDF5E6":"OldLace","#808000":"Olive","#6B8E23":"OliveDrab","#FFA500":"Orange","#FF4500":"OrangeRed","#DA70D6":"Orchid","#EEE8AA":"PaleGoldenRod","#98FB98":"PaleGreen","#AFEEEE":"PaleTurquoise","#D87093":"PaleVioletRed","#FFEFD5":"PapayaWhip","#FFDAB9":"PeachPuff","#CD853F":"Peru","#FFC0CB":"Pink","#DDA0DD":"Plum","#B0E0E6":"PowderBlue","#800080":"Purple","#FF0000":"Red","#BC8F8F":"RosyBrown","#4169E1":"RoyalBlue","#8B4513":"SaddleBrown","#FA8072":"Salmon","#F4A460":"SandyBrown","#2E8B57":"SeaGreen","#FFF5EE":"SeaShell","#A0522D":"Sienna","#C0C0C0":"Silver","#87CEEB":"SkyBlue","#6A5ACD":"SlateBlue","#708090":"SlateGrey","#FFFAFA":"Snow","#00FF7F":"SpringGreen","#4682B4":"SteelBlue","#D2B48C":"Tan","#008080":"Teal","#D8BFD8":"Thistle","#FF6347":"Tomato","#40E0D0":"Turquoise","#EE82EE":"Violet","#F5DEB3":"Wheat","#FFFFFF":"White","#F5F5F5":"WhiteSmoke","#FFFF00":"Yellow","#9ACD32":"YellowGreen"},_translate:function(s,d){var o=this.options,v=o.labels[s]||d||"";return"undefined"!=typeof tinyMCEPopup&&(v=tinyMCEPopup.getLang("colorpicker."+s,v)),v},_init:function(){var self=this;this.options;if(this._getStylesheetColors(),this.options.dialog){if($("#tab-content .colorpicker_generated").length)return;var color=$(this.element).val()||"#000000";/rgb/.test(color)&&(color=this._rgbToHex(color)),color&&color.indexOf("#")===-1&&(color="#"+color),$("#colorpicker_color").change(function(){var v=this.value;"#"===v.substr(0,1)&&(v=v.substring(1)),self._wheel&&self._wheel.setColor("#"+v),this.value=v}).change(),this._createTabs(),$("#colorpicker_insert").click(function(e){e.preventDefault(),self._insert()}),self._wheel&&self._wheel.setColor(color)}else this.options.widget?this.widget=$(this.options.widget):this.widget=$('<span class="colorpicker_widget"></span>').insertAfter(this.element),$(this.widget).css("background-color",$(this.element).val()||"#000000").tips({trigger:"click",position:"center right",content:'<div id="colorpicker" title="Color Picker">'+self._getContent()+"</div>",className:"wf-colorpicker",opacity:1,parent:this.options.parent}).on("tooltip:show",function(){var color=$(self.element).val()||"#000000";/rgb/.test(color)&&(color=this._rgbToHex(color)),"#"!==color.substr(0,1)&&(color="#"+color),$("#tab-content .colorpicker_generated").length||($("#colorpicker_tabs").html(function(i,h){return h.replace(/\{#(\w+)\}/gi,function(a,b){return self._translate(b)})}),$("#colorpicker").append('<div class="modal-footer uk-modal-footer"><div id="colorpicker_preview"><div id="colorpicker_preview_text" class="uk-form-icon uk-form-icon-both"><i class="uk-icon-hashtag"></i><input type="text" id="colorpicker_color" size="8" maxlength="8" value="'+color.substring(1)+'" aria-required="true" /><span class="uk-icon-none" id="colorpicker_preview_color" style="background-color: rgb(0, 0, 0);"></span></div></div><button type="button" class="btn btn-primary uk-button uk-button-primary" id="colorpicker_insert"><i class="uk-icon-check" />'+self._translate("apply","Apply")+"</button></div>"),$("#colorpicker_preview_color").css("background-color",color),$("#colorpicker_color").change(function(){var v=this.value;"#"===v.substr(0,1)&&(v=v.substring(1)),self._wheel&&self._wheel.setColor("#"+v),this.value=v}).change(),$("#colorpicker_insert").click(function(e){e.preventDefault(),self._insert()}),self._createTabs(),self._wheel&&self._wheel.setColor(color))})},_getContent:function(){var h="",o=this.options;return h+='<div id="colorpicker_tabs" class="uk-tabs">',h+='<ul class="nav nav-tabs uk-tab">',h+='<li class="active"><a href="#colorpicker_picker" aria-controls="colorpicker_picker" class="active">{#picker}</a></li>',h+='<li><a href="#colorpicker_web" aria-controls="colorpicker_web">{#palette}</a></li>',h+='<li><a href="#colorpicker_named" aria-controls="colorpicker_named">{#named}</a></li>',o.stylesheets.length&&(h+='<li><a href="#colorpicker_template" aria-controls="colorpicker_template">{#template}</a></li>'),h+="</ul>",h+='<div class="tab-content uk-switcher uk-tabs-panel">',h+='<div id="colorpicker_picker" data-type="picker" class="tab-pane uk-active"></div>',h+='<div id="colorpicker_web" data-type="web" class="tab-pane"></div>',h+='<div id="colorpicker_named" data-type="named" class="tab-pane"></div>',o.stylesheets.length&&(h+='<div id="colorpicker_template" data-type="template" class="tab-pane"></div>'),h+="</div>",h+="</div>"},_createTabs:function(){var self=this;$("#colorpicker_tabs").on("tabs.activate",function(e,tab,panel){var type=$(panel).data("type");self["_create"+type].call(self,$(panel)),$("#colorpicker_insert").css("visibility",function(){return"picker"===type?"visible":"hidden"})}).tabs(),self._createpicker($("#colorpicker_picker","#colorpicker_tabs"))},_blur:function(e){var t=this;if(e){if(e.target==this.picker||e.target==this.picker.colorpicker)return!1;var matched=!1;$(this.picker.colorpicker).find("*").each(function(){if(this==e.target)return matched=!0,!1}),matched||t.close()}},_close:function(){$(this.widget).trigger("tooltip:close"),$(this.element).trigger("colorpicker:close")},_insert:function(){var color=$("#colorpicker_color").val();"#"!==color.substr(0,1)&&(color="#"+color),$(this.element).trigger("colorpicker:insert",color),color&&($(this.element).val(color).removeClass("placeholder").change(),$(this.widget).css("background-color",color)),this._close()},_rgbToHex:function(c){var r,g,b,re=new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)","gi");if(!c)return c;var rgb=c.replace(re,"$1,$2,$3").split(",");return 3==rgb.length?(r=parseInt(rgb[0]).toString(16),g=parseInt(rgb[1]).toString(16),b=parseInt(rgb[2]).toString(16),r=1==r.length?"0"+r:r,g=1==g.length?"0"+g:g,b=1==b.length?"0"+b:b,"#"+r+g+b):c},_hexToRGB:function(c){var r,g,b;return c.indexOf("#")!=-1?(c=c.replace(new RegExp("[^0-9A-F]","gi"),""),r=parseInt(c.substring(0,2),16),g=parseInt(c.substring(2,4),16),b=parseInt(c.substring(4,6),16),{r:r,g:g,b:b}):null},_createpicker:function(parent){var self=this;$(parent).hasClass("colorpicker_generated")||(self._wheel=$.farbtastic(parent,$("#colorpicker_color").val(),function(color){self._showColor(color)}),$(parent).addClass("colorwheel colorpicker_generated"))},_createweb:function(parent){var self=this,h="";$(parent).hasClass("colorpicker_generated")||(h+='<div role="listbox" aria-labelledby="colorpicker_web" tabindex="0">',h+="<ul>",$.each(this._colors,function(i,v){h+='<li style="background-color:'+v+'"><span class="colorpicker_webblock" role="option" aria-labelledby="web_colors_'+i+'" title="'+v+'"></span></li>',self.options.forcedHighContrastMode&&(h+='<canvas class="mceColorSwatch" data-color="'+v+'"></canvas>'),h+='<span class="mceVoiceLabel" id="web_colors_'+i+'">'+v.toUpperCase()+"</span>"}),h+="</ul></div>",$(parent).append(h).append('<br style="clear:both;" />').addClass("colorpicker_generated"),$("span.colorpicker_webblock",parent).click(function(){self._insert()}).mouseover(function(){self._showColor($(this).attr("title"))}),this._paintCanvas(parent))},_createnamed:function(parent){var self=this,h="",i=0;$(parent).hasClass("colorpicker_generated")||(h+='<div role="listbox" aria-labelledby="colorpicker_named" tabindex="0">',h+="<ul>",$.each(this._named,function(k,v){h+='<li style="background-color:'+k+'"><span class="colorpicker_namedblock" aria-labelledby="named_colors_'+k+'" title="'+self._translate(k.replace(/[^\w]/g,""),v)+'"></span></li>',self.options.forcedHighContrastMode&&(h+='<canvas class="mceColorSwatch" data-color="'+v+'"></canvas>'),h+='<span class="mceVoiceLabel" id="named_colors_'+k+'">'+v.toUpperCase()+"</span>",i++}),h+="</ul></div>",$(parent).append(h).append('<br style="clear:both;" />').addClass("colorpicker_generated").append('<div id="colorpicker_colorname">'+this.options.labels.name+"</div>"),$("span.colorpicker_namedblock",parent).click(function(){self._insert()}).mouseover(function(){self._showColor($(this).parent("li").css("background-color"),$(this).attr("title"))}),this._paintCanvas(parent))},_createtemplate:function(parent){var self=this,h="";if(!$(parent).hasClass("colorpicker_generated")){if(this.template_colors){var templateColors=this.template_colors;"string"==$.type(this.template_colors)&&(templateColors=templateColors.split(",")),h+='<div role="listbox" aria-labelledby="colorpicker_template_label" tabindex="0">',h+="<ul>",$.each(templateColors,function(i,v){4==v.length&&(v+=v.substr(1)),h+='<li style="background-color:'+v+'"><span class="colorpicker_templateblock" aria-labelledby="template_colors_'+i+'" title="'+v+'"></span></li>',self.options.forcedHighContrastMode&&(h+='<canvas class="mceColorSwatch" data-color="'+v+'"></canvas>'),h+='<span class="mceVoiceLabel" id="template_colors_'+i+'">'+v.toUpperCase()+"</span>"}),h+="</ul></div>",$(parent).append(h)}if(this.options.custom_colors){var h="";$(parent).append('<p id="colorpicker_custom_label">'+this.options.labels.custom+"</p>");var customColors=this.options.custom_colors.split(",");h+='<div role="listbox" aria-labelledby="colorpicker_custom_label" tabindex="0">',h+="<ul>",$.each(customColors,function(i,v){4==v.length&&(v+=v.replace("#","")),h+='<li style="background-color:'+v+'"><span class="colorpicker_templateblock" aria-labelledby="custom_colors_'+i+'" title="'+v+'"></span></li>',self.options.forcedHighContrastMode&&(h+='<canvas class="mceColorSwatch" data-color="'+v+'"></canvas>'),h+='<span class="mceVoiceLabel" style="display:none;" id="custom_colors_'+i+'">'+v.toUpperCase()+"</span>",(i+1)%18==0&&(h+="</ul><ul>")}),h+="</div>",$(parent).append(h),this._paintCanvas(parent)}$(parent).addClass("colorpicker_generated"),$("span.colorpicker_templateblock",parent).click(function(){self._insert()}).mouseover(function(){self._showColor($(this).attr("title"))})}},_showColor:function(color,name){name&&$("#colorpicker_colorname").html(this.options.labels.name+": "+name),color=color.toLowerCase(),/rgb/.test(color)&&(color=this._rgbToHex(color)),$("#colorpicker_preview_color").css("background-color",color),$("#colorpicker_color").val(color.replace("#",""))},_changeFinalColor:function(color){/#/.test(color)||(color=this._rgbToHex(color)),color=color.toLowerCase(),$("#colorpicker_preview").css("background-color",color),$("#colorpicker_color").val(color.replace("#",""))},_paintCanvas:function(el){$("canvas.mceColorSwatch",el).each(function(){$canvas=$(this).get(0),$canvas.getContext&&(context=$canvas.getContext("2d"))&&(context.fillStyle=$canvas.getAttribute("data-color"),context.fillRect(0,0,10,10))})},_sort_colors:function(colors){var sorted=[],s=[];return $.each(colors,function(x,color){if(color=color.replace("#","").toLowerCase(),6==color.length){var condensed="";$.each(color.split(""),function(i,c){i%2==0&&(condensed+=c)});var color_str=condensed}var v=0;$.each(color_str.split(""),function(i,c){v+=parseInt(c,16)}),color&&(sorted[v+x]="#"+color)}),$.each(sorted,function(i,c){c&&s.push(c)}),s},_getStylesheetColors:function(){function addColor(s){$.inArray(s,colors)==-1&&colors.push(s)}function parseCSS(s){s.imports&&$.each(s.imports,function(i,r){parseCSS(r)}),$.each(s.cssRules||s.rules,function(i,r){switch(r.type||1){case 1:var css=r.cssText||r.style.cssText;css&&(hex=css.match(hexRe),rgb=css.match(rgbRe),rgb&&addColor(self._rgbToHex(rgb[0])),hex&&addColor(hex[0]));break;case 3:if(r.href.indexOf("://")!=-1)return;parseCSS(r.styleSheet)}})}function processStyleSheets(stylesheets){try{$.each(stylesheets,function(i,s){parseCSS(s)})}catch(ex){}return colors}var hex,rgb,self=this,o=this.options,colors=[],hexRe=/#[0-9a-f]{3,6}/gi,rgbRe=new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)","gi");if("string"==$.type(o.stylesheets[0])){var doc,el,ifr;if(document.getElementById("stylsheets_iframe"))return;var h='<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge">';$.each(o.stylesheets,function(i,s){h+='<link href="'+s+'" rel="stylesheet" type="text/css" />'}),h+="</head><body></body></html>",ifr=document.createElement("iframe"),$(ifr).attr({src:'javascript:""',id:"stylsheets_iframe"}).hide().appendTo("body").load(function(e){el=e.target,doc=el.contentWindow.document,doc&&doc.styleSheets&&(self.template_colors=processStyleSheets(doc.styleSheets)),$(ifr).remove()}),doc=ifr.contentWindow.document,doc&&(doc.open(),doc.write(h),doc.close())}else this.template_colors=processStyleSheets(o.stylesheets)}},$.fn.colorpicker=function(options){return this.each(function(){new ColorPicker(this,options)})}}(jQuery),function($){$.fn.farbtastic=function(callback){return $.farbtastic(this,callback),this},$.farbtastic=function(container,color,callback){var container=$(container).get(0);return container.farbtastic||(container.farbtastic=new $._farbtastic(container,color,callback))},$._farbtastic=function(container,color,callback){var fb=this;$(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');var e=$(".farbtastic",container);fb.wheel=$(".wheel",container).get(0),fb.radius=84,fb.square=100,fb.width=194,navigator.appVersion.match(/MSIE [0-6]\./)&&$("*",e).each(function(){if("none"!=this.currentStyle.backgroundImage){var image=this.currentStyle.backgroundImage;image=this.currentStyle.backgroundImage.substring(5,image.length-2),$(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"})}}),fb.linkTo=function(callback){return"object"==typeof fb.callback&&$(fb.callback).unbind("keyup",fb.updateValue),fb.color=null,"function"==typeof callback?fb.callback=callback:"object"!=typeof callback&&"string"!=typeof callback||(fb.callback=$(callback),fb.callback.bind("keyup",fb.updateValue),fb.callback.get(0).value&&fb.setColor(fb.callback.get(0).value)),this},fb.updateValue=function(event){this.value&&this.value!=fb.color&&fb.setColor(this.value)},fb.setColor=function(color){var unpack=fb.unpack(color);return fb.color!=color&&unpack&&(fb.color=color,fb.rgb=unpack,fb.hsl=fb.RGBToHSL(fb.rgb),fb.updateDisplay()),this},fb.setHSL=function(hsl){return fb.hsl=hsl,fb.rgb=fb.HSLToRGB(hsl),fb.color=fb.pack(fb.rgb),fb.updateDisplay(),this},fb.widgetCoords=function(event){var x,y,el=event.target||event.srcElement,reference=fb.wheel;if("undefined"!=typeof event.offsetX){for(var pos={x:event.offsetX,y:event.offsetY},e=el;e;)e.mouseX=pos.x,e.mouseY=pos.y,pos.x+=e.offsetLeft,pos.y+=e.offsetTop,e=e.offsetParent;for(var e=reference,offset={x:0,y:0};e;){if("undefined"!=typeof e.mouseX){x=e.mouseX-offset.x,y=e.mouseY-offset.y;break}offset.x+=e.offsetLeft,offset.y+=e.offsetTop,e=e.offsetParent}for(e=el;e;)e.mouseX=void 0,e.mouseY=void 0,e=e.offsetParent}else{var pos=fb.absolutePosition(reference);x=(event.pageX||0*(event.clientX+$("html").get(0).scrollLeft))-pos.x,y=(event.pageY||0*(event.clientY+$("html").get(0).scrollTop))-pos.y}return{x:x-fb.width/2,y:y-fb.width/2}},fb.mousedown=function(event){var pos=fb.widgetCoords(event);return fb.circleDrag=2*Math.max(Math.abs(pos.x),Math.abs(pos.y))>fb.square,fb.mousemove(event),!1},fb.touchconvert=function(e){var e=e.originalEvent.touches.item(0);return e},fb.touchmove=function(e){return fb.mousemove(fb.touchconvert(e)),event.preventDefault(),!1},fb.touchend=function(event){return $(document).unbind("touchmove",fb.touchmove),$(document).unbind("touchend",fb.touchend),document.dragging=!1,event.preventDefault(),!1},fb.mousemove=function(event){var pos=fb.widgetCoords(event);if(fb.circleDrag){var hue=Math.atan2(pos.x,-pos.y)/6.28;hue<0&&(hue+=1),fb.setHSL([hue,fb.hsl[1],fb.hsl[2]])}else{var sat=Math.max(0,Math.min(1,-(pos.x/fb.square)+.5)),lum=Math.max(0,Math.min(1,-(pos.y/fb.square)+.5));fb.setHSL([fb.hsl[0],sat,lum])}return!1},fb.mouseup=function(){$(document).unbind("mousemove",fb.mousemove),$(document).unbind("mouseup",fb.mouseup),document.dragging=!1},fb.updateDisplay=function(){var angle=6.28*fb.hsl[0];$(".h-marker",e).css({left:Math.round(Math.sin(angle)*fb.radius+fb.width/2)+"px",top:Math.round(-Math.cos(angle)*fb.radius+fb.width/2)+"px"}),$(".sl-marker",e).css({left:Math.round(fb.square*(.5-fb.hsl[1])+fb.width/2)+"px",top:Math.round(fb.square*(.5-fb.hsl[2])+fb.width/2)+"px"}),$(".color",e).css("backgroundColor",fb.pack(fb.HSLToRGB([fb.hsl[0],1,.5]))),"object"==typeof fb.callback?($(fb.callback).css({backgroundColor:fb.color,color:fb.hsl[2]>.5?"#000":"#fff"}),$(fb.callback).each(function(){this.value&&this.value!=fb.color&&(this.value=fb.color)})):"function"==typeof fb.callback&&fb.callback.call(fb,fb.color)},fb.absolutePosition=function(el){var r={x:el.offsetLeft,y:el.offsetTop};if(el.offsetParent){var tmp=fb.absolutePosition(el.offsetParent);r.x+=tmp.x,r.y+=tmp.y}return r},fb.pack=function(rgb){var r=Math.round(255*rgb[0]),g=Math.round(255*rgb[1]),b=Math.round(255*rgb[2]);return"#"+(r<16?"0":"")+r.toString(16)+(g<16?"0":"")+g.toString(16)+(b<16?"0":"")+b.toString(16)},fb.unpack=function(color){return 7==color.length?[parseInt("0x"+color.substring(1,3))/255,parseInt("0x"+color.substring(3,5))/255,parseInt("0x"+color.substring(5,7))/255]:4==color.length?[parseInt("0x"+color.substring(1,2))/15,parseInt("0x"+color.substring(2,3))/15,parseInt("0x"+color.substring(3,4))/15]:void 0},fb.HSLToRGB=function(hsl){var m1,m2,h=hsl[0],s=hsl[1],l=hsl[2];return m2=l<=.5?l*(s+1):l+s-l*s,m1=2*l-m2,[this.hueToRGB(m1,m2,h+.33333),this.hueToRGB(m1,m2,h),this.hueToRGB(m1,m2,h-.33333)]},fb.hueToRGB=function(m1,m2,h){return h=h<0?h+1:h>1?h-1:h,6*h<1?m1+(m2-m1)*h*6:2*h<1?m2:3*h<2?m1+(m2-m1)*(.66666-h)*6:m1},fb.RGBToHSL=function(rgb){var min,max,delta,h,s,l,r=rgb[0],g=rgb[1],b=rgb[2];return min=Math.min(r,Math.min(g,b)),max=Math.max(r,Math.max(g,b)),delta=max-min,l=(min+max)/2,s=0,l>0&&l<1&&(s=delta/(l<.5?2*l:2-2*l)),h=0,delta>0&&(max==r&&max!=g&&(h+=(g-b)/delta),max==g&&max!=b&&(h+=2+(b-r)/delta),max==b&&max!=r&&(h+=4+(r-g)/delta),h/=6),[h,s,l]},$("*",e).mousedown(function(e){document.dragging||($(document).bind("mousemove",fb.mousemove).bind("mouseup",fb.mouseup),document.dragging=!0),fb.mousedown(e)}),$("*",e).bind("touchstart",function(e){return document.dragging||($(document).bind("touchmove",fb.touchmove).bind("touchend",fb.touchend),document.dragging=!0),fb.mousedown(fb.touchconvert(e)),e.preventDefault(),!1}),fb.setColor("#000000"),callback&&fb.linkTo(callback)}}(jQuery),function($){$.fn.tabs=function(options){return this.each(function(){var el=this;return $(this).data("tabs")?this:($(this).find(".tab-content .tab-pane").first().addClass("active"),$(el).children(".nav-tabs").children("li").click(function(e){e.preventDefault();var panel=$(el).children(".tab-content").children(".tab-pane.active").get(0),tab=$(el).children(".nav-tabs").children("li.active").get(0);$(el).trigger("tabs.beforeactivate",[tab,panel]),$(el).children(".nav-tabs").children("li").removeClass("active"),$(el).children(".tab-content").children(".tab-pane").removeClass("active"),$(this).addClass("active");var panel=$(el).children(".tab-content").children(".tab-pane").eq($(this).index()).addClass("active").get(0);$(el).trigger("tabs.activate",[this,panel]),e.preventDefault()}).first().addClass("active"),void $(this).data("tabs",!0))})},$.fn.datalist=function(){return this.each(function(){var self=this,id=$(this).attr("id"),name=$(this).attr("name");$(this).attr("id",id+"-select").removeAttr("name"),$(this).parent().hasClass("ui-datalist")||$(this).wrap('<span class="ui-datalist" />');var value=$(this).val(),input=$(this).siblings('input[type="text"]');0===input.length&&(input=$('<input type="text" />').attr("id",id).attr("name",name).insertBefore(this)),$(input).prop("disabled",$(this).prop("disabled")).val(value),$(input).change(function(){$(self).trigger("datalist:change")}),$(this).change(function(){if("classlist"===this.id){var $tmp=$("<span/>").addClass($(this).siblings("input").val()).addClass(this.value);value=$tmp.attr("class")}$(input).val(this.value).change()})})},$.fn.repeatable=function(){return this.each(function(){var self=this;return $(this).data("ui-repeatable")?this:($(this).data("ui-repeatable",1),$(".ui-repeatable-create",this).click(function(e){var el=$(self).clone(!0,!0);$(el).find("input").val(""),$(self).trigger("repeatable:create",[self,$(el).get(0)]),$(el).insertAfter($(self).siblings(".ui-repeatable").add(self).last()),$(self).trigger("repeatable:change"),e.preventDefault()}),void $(".ui-repeatable-delete",this).click(function(e){$(this).parent().remove(),$(self).trigger("repeatable:change"),e.preventDefault()}))})}}(jQuery),function($){$.widget("ui.upload",{options:{labels:{browse:"Browse",alert:"Incorrect file type"},extensions:["xml"],readonly:!1,width:200,task:null,button:null,iframe:!1,report:null},_init:function(){var self=this;$(document).ready(function(){self._createUploader()})},_createUploader:function(){var iframe,self=this,o=this.options,re=".("+o.extensions.join("|")+")$",$form=$('form[name="adminForm"]');o.iframe&&(iframe=this.createIFrame());var $button=$("<button/>").html(o.labels.browse).prepend('<i class="icon-search" />&nbsp;').addClass("upload-browse btn"),$buttoncontainer=$("<div/>").addClass("upload_button_container").insertBefore(this.element).append(this.element),$inputcontainer=$("<div/>").addClass("upload_input_container").insertBefore($buttoncontainer),$input=$("<input/>").attr({type:"text",name:$(this.element).attr("name")+"_input",placeholder:$(this.element).attr("placeholder"),size:$(this.element).attr("size")||30}).addClass("upload_text").appendTo($inputcontainer);if(o.readonly&&$input.prop("readonly","readonly").appendTo($buttoncontainer),$('<span class="upload_clear close">&times;</span>').appendTo($inputcontainer).click(function(){$input.val("").focus(),$(self.element).val("")}),$button.click(function(e){e.preventDefault()}),$(this.element).css({opacity:0}),$button.insertBefore($(this.element)),o.button){o.submit;$(o.button).click(function(e){$input.hasClass("placeholder")&&$input.val(""),iframe&&$form.attr("target",iframe.name),($(self.element).val()||$input.val())&&($(this).addClass("ui-state-loading"),$('input[name="task"]').val(o.task||""),$form.submit()),e.preventDefault()}).appendTo($buttoncontainer), $('<span class="upload-input-wrapper"></span>').css({width:$button.outerWidth(),height:$button.outerHeight(!0)}).insertBefore(this.element).append(this.element)}window.XMLHttpRequest||($(this.element).addClass("ie_upload_input_file"),$input.addClass("ie_input_text"),$button.addClass("ie_button")),$(this.element).change(function(){var file=self.getFileName($(this).val());new RegExp(re).test(file)?$input.val(file).addClass("upload_file").removeClass("placeholder"):(alert(o.labels.alert),$(this).val(""))})},createIFrame:function(){var o=this.options,iframe=document.getElementById("upload_iframe");if(!iframe){iframe=document.createElement("iframe");var $form=$('form[name="adminForm"]');$(iframe).attr({src:'javascript:""',name:"upload_iframe",id:"upload_iframe"}).hide().load(function(e){var el,n=e.target;try{el=n.contentWindow.document||n.contentDocument||window.frames[n.id].document}catch(ex){return void alert("UPLOAD SECURITY ERROR")}if("about:blank"!=el.location.href){var result=el.body.innerHTML||el.documentElement.innerText||el.documentElement.textContent;if(""!=result&&($form.removeAttr("target"),document.getElementById(o.report)||$(".ui-jce").append('<div id="'+o.report+'"></div>'),$("div#"+o.report,".ui-jce").hide().html(result).fadeIn()),o.button){var btn=document.getElementById(o.button);$(btn).removeClass("loading")}}}).appendTo($form),$.support.cssFloat||(window.frames.upload_iframe.name="upload_iframe"),$("<input/>").attr({type:"hidden",name:"method"}).val("iframe").appendTo($form)}return iframe},getFileName:function(file){return file=file.replace(/\\/g,"/"),file.substring(file.lastIndexOf("/")+1)},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments)}})}(jQuery),function($){"undefined"==typeof Joomla&&(Joomla={}),Joomla.modal=function(el,url,width,height){var o={handler:"iframe",size:{x:Math.min($(window).width()-50,width),y:Math.min($(window).height()-60,height)},url:url,onOpen:function(){var w="auto";!$.support.cssFloat&&document.querySelector&&(w=Math.min($(window).width()-50,width)),$("#sbox-window").css({width:w,height:"auto"})}};return SqueezeBox.fromElement(el,o)},window.Wf={},Wf.core={options:{},init:function(){var self=this;$.support.cssFloat||($(".ui-jce").addClass("ie"),document.querySelector&&($.support.leadingWhitespace?$(".ui-jce").addClass("ie9"):$(".ui-jce").addClass("ie8"))),$('input[size="100"]').addClass("input-xlarge"),$('input[size="50"]').addClass("input-large"),$('input[size="10"]').addClass("input-small"),$('input[size="5"]').addClass("input-mini"),$("a.dialog").click(function(e){self.createDialog(e,{src:$(this).attr("href"),options:$(this).data("options")}),e.preventDefault()}),$(".wf-tooltip, .hasTip").tips({parent:".ui-jce"}),$(".ui-repeatable").repeatable().on("repeatable:change",function(){$(this).parent().find(":input[name]").addClass("isdirty")}),$('th input[type="checkbox"]',$("#profiles-list, #users-list")).click(function(){var n=$('td input[type="checkbox"]',$("#profiles-list, #users-list")).prop("checked",this.checked);$('input[name="boxchecked"]').val($(n).filter(":checked").length)}),$('td input[type="checkbox"]',$("#profiles-list, #users-list")).click(function(){var bc=$('input[name="boxchecked"]').val(),n=$('td input[type="checkbox"]',$("#profiles-list, #users-list")).length;$('th input[type="checkbox"]',$("#profiles-list, #users-list")).prop("checked",bc==n)}),$(".radio, .checkbox").addClass("inline"),$("#profiles-list tbody").sortable({handle:"span.sortable-handle",helper:function(e,tr){var $cells=tr.children(),$helper=tr.clone();return $helper.children().each(function(i){$(this).width($cells.eq(i).width())}),$helper},placeholder:"sortable-highlight",stop:function(e,ui){function end(){$("#profiles-list tbody").sortable("enable"),$(ui.item).removeClass("busy")}var n=this;$('input[name="task"]').val("saveorder");var cid=$('input[name^="cid"]',n).prop("checked",!0).serialize();$('input[name^="cid"]',n).prop("checked",!1),$("#profiles-list tbody").sortable("disable"),$(ui.item).addClass("busy");var order=[];$("tr",n).each(function(i){order.push("order[]="+i)}),$.ajax({type:"POST",url:"index.php",data:$("input[name]","#adminForm").not('input[name^="order"]').serialize()+"&"+cid+"&"+order.join("&")+"&tmpl=component",success:function(){end(),$("tr",n).each(function(i){$('input[name^="order"]',this).val(i+1),$('input[id^="cb"]',this).attr("id","cb"+i)})},error:function(){end()}})}}),$("span.order-up a","#profiles-list").click(function(e){$("input[name^=cid]",$(this).parents("tr")).prop("checked",!0),$('input[name="task"]').val("orderup"),$("#adminForm").submit(),e.preventDefault()}),$("span.order-down a","#profiles-list").click(function(e){$("input[name^=cid]",$(this).parents("tr")).prop("checked",!0),$('input[name="task"]').val("orderdown"),$("#adminForm").submit(),e.preventDefault()}),$("a.saveorder","#profiles-list").click(function(e){$('thead th input[type="checkbox"]',"#profiles-list").click(),$('input[name="task"]').val("saveorder"),$("#adminForm").submit(),e.preventDefault()}),$("[data-parameter-nested-item]").on("hide",function(){$(this).hide().find(":input").prop("disabled",!0)}).on("show",function(){$(this).show().find(":input").prop("disabled",!1)}).trigger("hide"),$(":input.parameter-nested-parent").change(function(){$(this).siblings("[data-parameter-nested-item]").trigger("hide").filter('[data-parameter-nested-item="'+this.value+'"]').trigger("show")}).change(),$(document).ready(function(){self._setDependants()}),$(document).ready(function(){$(".ui-jce").removeClass("loading")})},createDialog:function(el,o){var data={};return data="string"==$.type(o.options)?$.parseJSON(o.options.replace(/'/g,'"')):o.options,data=data||{width:640,height:480},Joomla.modal(el,o.src,data.width,data.height)},closeDialog:function(el){var win=window.parent;if("undefined"!=typeof win.SqueezeBox)return win.SqueezeBox.close()},_passwordWidget:function(el){var span=document.createElement("span");$(span).addClass("widget-password locked").insertAfter(el).click(function(){if(el=$(this).siblings('input[type="password"]'),$(this).hasClass("locked")){var input=document.createElement("input");$(el).hide(),$(input).attr({type:"text",size:$(el).attr("size"),value:$(el).val(),class:$(el).attr("class")}).insertAfter(el).change(function(){$(el).val(this.value).change()})}else{var n=$(this).siblings('input[type="text"]'),v=$(n).val();$(n).remove(),$(el).val(v).show()}$(this).toggleClass("locked")})},_setDependants:function(){$("[data-parent]").each(function(){var el=this,data=$(this).data("parent")||"",p=$(this).parents(".control-group");$(p).hide(),$.each(data.split(";"),function(i,s){if(s=/([\w\.]+)\[([\w,]+)\]/.exec(s),s&&s.length>2){var k=s[1],v=s[2].split(",");k=k.replace(/[^\w]+/g,"");var event="change."+k;$("#params"+k).on(event,function(){var ev=$(this).val();"array"!==$.type(ev)&&(ev=$.makeArray(ev));var state=$(ev).filter(v).length>0;state?($(el).removeClass("child-of-"+k),el.className.indexOf("child-of-")===-1&&$(p).show()):($(p).hide(),$(el).addClass("child-of-"+k)),$(el).trigger("visibility:toggle",state)}).on("visibility:toggle",function(e,state){state?$(el).parents(".control-group").show():$(el).parents(".control-group").hide()}).trigger(event)}})})}},$(document).ready(function(){Wf.core.init()})}(jQuery);