diff --git a/etemplate/js/etemplate2.min.js b/etemplate/js/etemplate2.min.js new file mode 100644 index 0000000000..1c5b0d5c92 --- /dev/null +++ b/etemplate/js/etemplate2.min.js @@ -0,0 +1,32 @@ +/*! build Tue Mar 01 2016 15:22:03 */ + +function et2_loadXMLFromURL(_url,_callback,_context){"undefined"==typeof _context&&(_context=null);var win;try{opener&&opener.etemplate2&&(win=opener)}catch(e){}"undefined"==typeof win&&(win=top),win.jQuery.ajax({url:_url,context:_context,type:"GET",dataType:"xml",success:function(_data,_status,_xmlhttp){_callback.call(_context,_data.documentElement)},error:function(_xmlhttp,_err){egw().debug("error","Loading eTemplate from "+_url+" failed! "+_xmlhttp.status+" "+_xmlhttp.statusText)}})}function et2_directChildrenByTagName(_node,_tagName){_tagName=_tagName.toLowerCase();for(var result=[],i=0;i<_node.childNodes.length;i++)_tagName==_node.childNodes[i].nodeName.toLowerCase()&&result.push(_node.childNodes[i]);return result}function et2_filteredNodeIterator(_node,_callback,_context){for(var i=0;i<_node.childNodes.length;i++){var node=_node.childNodes[i],nodeName=node.nodeName.toLowerCase();"#"!=nodeName.charAt(0)&&_callback.call(_context,node,nodeName)}}function et2_readAttrWithDefault(_node,_name,_default){var val=_node.getAttribute(_name);return null===val?_default:val}function et2_evalBool(_val){return"string"!=typeof _val||"false"!=_val&&"0"!=_val?!!_val:!1}function et2_form_name(_cname,_name){for(var parts=[],i=0;i0&&(parts=parts.concat(name.replace(/]/g,"").split("[")))}var name=parts.shift();return parts.length?name+"["+parts.join("][")+"]":name}function et2_checkType(_val,_type,_attr,_widget){function _err(){var res=et2_typeDefaults[_type];return"undefined"!=typeof _val&&_val&&egw.debug("warn","Widget %o: '"+_val+"' was not of specified _type '"+_type+(null!=_attr?"' for attribute '"+_attr+"' ":"")+"and is now '"+res+"'",_widget),res}if("undefined"==typeof _attr&&(_attr=null),"any"==_type)return _val;if(_val===et2_typeDefaults[_type])return _val;if("boolean"==_type){if(_val===!0||_val===!1)return _val;if("string"==typeof _val){var lcv=_val.toLowerCase();if("true"===lcv||"false"===lcv||""===lcv)return"true"===_val;if("0"===lcv||"1"===lcv)return"1"===_val}else if("number"==typeof _val)return 0!=_val;return _err()}if("string"==_type||"html"==_type||"rawstring"==_type)return"number"==typeof _val?_val.toString():"string"==typeof _val?"string"==_type?html_entity_decode(_val):_val:"object"==typeof _val&&jQuery.isEmptyObject(_val)?"":_err();if("float"==_type)return"number"==typeof _val?_val:isNaN(_val)?_err():parseFloat(_val);if("integer"==_type)return parseInt(_val)==_val?parseInt(_val):_err();if("dimension"==_type)return"auto"==_val?_val:isNaN(_val)?"string"==typeof _val&&(_val.indexOf("px")==_val.length-2&&!isNaN(_val.split("px")[0])||_val.indexOf("%")==_val.length-1&&!isNaN(_val.split("%")[0]))?_val:_err():parseFloat(_val)+"px";if("js"==_type){if("function"==typeof _val||"undefined"==typeof _val)return _val;if(_val&&(_val=_val.replace(/window\.close\(\)/g,"egw(window).close()")),"string"==typeof _val&&"app."==_val.substr(0,4)&&window.app){for(var parts=_val.split("."),func=parts.pop(),parent=window,i=0;istart&&(start+=end),end="undefined"==typeof len?end:0>len?len+end:len+start,start>=str.length||0>start||start>end?"":str.slice(start,end)}function et2_csvSplit(_str,_num,_delimiter,_enclosure){if("undefined"!=typeof _str&&null!=_str||(_str=""),"undefined"==typeof _num&&(_num=null),"undefined"==typeof _delimiter&&(_delimiter=","),"undefined"==typeof _enclosure&&(_enclosure='"'),-1==_str.indexOf(_enclosure))return null===_num?_str.split(_delimiter):_str.split(_delimiter,_num);for(var parts=_str.split(_delimiter),n=0;"undefined"!=typeof parts[n];n++){var part=parts[n];if(part.charAt(0)===_enclosure){for(var m=n;"undefined"!=typeof parts[m+1]&&parts[n].substr(-1)!==_enclosure;)parts[n]+=_delimiter+parts[++m],delete parts[m];parts[n]=et2_substr(parts[n].replace(new RegExp(_enclosure+_enclosure,"g"),_enclosure),1,-1),n=m}}return parts=et2_arrayValues(parts),null!==_num&&_num>0&&_num0&&(parts[_num-1]=parts.slice(_num-1,parts.length).join(_delimiter),parts=parts.slice(0,_num)),parts}function et2_activateLinks(_content){function _splitPush(_matches,_proc){if(_matches){_match=!0;for(var i=1;i<_matches.length;i++)"undefined"==typeof _matches[i]&&(_matches[i]="");var splitted=_content.split(_matches[0]),left=splitted.shift();left&&(arr=arr.concat(et2_activateLinks(left))),_proc(_matches),_content=splitted.join(_matches[0])}}var _match=!1,arr=[],mail_regExp=/(mailto:)?([a-z0-9._-]+)@([a-z0-9_-]+)\.([a-z0-9._-]+)/i,protocol="(http:\\/\\/|(ftp:\\/\\/|https:\\/\\/))",domain="([\\w-]+\\.[\\w-.]+)",subdir="([\\w\\-\\.,@?^=%&;:\\/~\\+#]*[\\w\\-\\@?^=%&\\/~\\+#])?",http_regExp=new RegExp(protocol+domain+subdir,"i"),domain="www(\\.[\\w-.]+)",subdir="([\\w\\-\\.,@?^=%&:\\/~\\+#]*[\\w\\-\\@?^=%&\\/~\\+#])?",www_regExp=new RegExp(domain+subdir,"i");do{if(_match=!1,!_content)break;_splitPush(_content.match(mail_regExp),function(_matches){arr.push({href:(_matches[1]?"":"mailto:")+_matches[0],text:_matches[2]+"@"+_matches[3]+"."+_matches[4]})}),_splitPush(_content.match(http_regExp),function(_matches){arr.push({href:_matches[0],text:_matches[2]+_matches[3]+_matches[4]})}),_splitPush(_content.match(www_regExp),function(_matches){arr.push({href:"http://"+_matches[0],text:_matches[0]})})}while(_match);return arr.push(_content),arr}function et2_insertLinkText(_text,_node,_target){if(!_node)return void egw.debug("warn","et2_insertLinkText called without node",_text,_node,_target);for(var i=_node.childNodes.length-1;i>=0;i--)_node.removeChild(_node.childNodes[i]);for(var i=0;i<_text.length;i++){var s=_text[i];if("string"==typeof s||"number"==typeof s)for(var lines=s.split?s.split("\n"):[s],j=0;j_ar2.bottom)}function et2_rangeIntersectDir(_ar1,_ar2){return _ar1.bottom<_ar2.top?-1:_ar1.top>_ar2.bottom?1:0}function et2_rangeEqual(_ar1,_ar2){return _ar1.top===_ar2.top&&_ar1.bottom===_ar2.bottom}function et2_rangeSubstract(_ar1,_ar2){var res=[_ar1];et2_rangeIntersect(_ar1,_ar2)&&(res=[et2_bounds(_ar1.top,_ar2.top),et2_bounds(_ar2.bottom,_ar1.bottom)]);for(var i=res.length-1;i>=0;i--)res[i].bottom-res[i].top<=0&&res.splice(i,1);return res}function html_entity_decode(_str){return _str&&-1!=_str.indexOf("&")?jQuery(""+_str+"").text():_str}function et2_arrayMgrs_expand(_owner,_mgrs,_data,_row){var result={};for(var key in _mgrs)if(result[key]=_mgrs[key],"undefined"!=typeof _data[key]){var rowData={};rowData[_row]=_data[key],result[key]=_mgrs[key].openPerspective(_owner,rowData,_row)}return result}function et2_register_widget(_constructor,_types){"use strict";for(var i=0;i<_types.length;i++){var type=_types[i].toLowerCase();et2_registry[type]&&egw.debug("warn","Widget class registered for "+type+" will be overwritten."),et2_registry[type]=_constructor}}function et2_createWidget(_name,_attrs,_parent){"use strict";"undefined"==typeof _attrs&&(_attrs={}),"undefined"==typeof _parent&&(_parent=null);var nodeName=_attrs.type=_name,readonly=_attrs.readonly="undefined"==typeof _attrs.readonly?!1:_attrs.readonly,constructor="undefined"==typeof et2_registry[nodeName]?et2_placeholder:et2_registry[nodeName];return readonly&&"undefined"!=typeof et2_registry[nodeName+"_ro"]&&(constructor=et2_registry[nodeName+"_ro"]),constructor.prototype.generateAttributeSet(_attrs),new constructor(_parent,_attrs)}function et2_action_object_impl(widget,node){var aoi=new egwActionObjectInterface,objectNode=node;return aoi.getWidget=function(){return widget},aoi.doGetDOMNode=function(){return objectNode?objectNode:widget.getDOMNode()},aoi.doSetState=function(_state,_outerCall){},aoi.doTriggerEvent=function(_event,_data){switch(_event){case EGW_AI_DRAG_OVER:$j(this.node).addClass("ui-state-active");break;case EGW_AI_DRAG_OUT:$j(this.node).removeClass("ui-state-active")}},aoi}function expose(widget){"use strict";var IMAGE_DEFAULT={title:egw.lang("loading"),href:"",type:"image/png",thumbnail:"",loading:!0},mime_regex=new RegExp(/(video\/(mp4|ogg|webm))|(image\/:*(?!tif|x-xcf|pdf))/);navigator.userAgent.match(/(MSIE|Trident)/)&&mime_regex.compile(/(video\/mp4)|(image\/:*(?!tif|x-xcf|pdf))/);var gallery=null,find_nextmatch=function(widget){for(var current=widget,nextmatch=null;null==nextmatch&¤t;)current=current.getParent(),"undefined"!=typeof current&¤t.instanceOf(et2_nextmatch)&&(nextmatch=current);return null!=nextmatch&&null!=nextmatch.controller&&nextmatch.dom_id.match(/filemanager/,"ig")?nextmatch:null},read_from_nextmatch=function(nm,images,start_at){start_at||(start_at=0);for(var image_index=start_at,stop=Math.max.apply(null,Object.keys(nm.controller._indexMap)),i=start_at;stop>=i;i++)if(nm.controller._indexMap[i]&&nm.controller._indexMap[i].uid){var uid=nm.controller._indexMap[i].uid;if(uid){var data=egw.dataGetUIDdata(uid);if(data&&data.data&&data.data.mime&&mime_regex.test(data.data.mime)){var media=this.getMedia(data.data);images[image_index++]=jQuery.extend({},data.data,media[0])}}}else images[image_index++]=IMAGE_DEFAULT},set_slide=function(index,image){for(var active=index==gallery.index;index>gallery.getNumber();)gallery.add([jQuery.extend({},IMAGE_DEFAULT)]);if(image.loading)return void(gallery.slidesContainer.find('[data-index="'+index+'"]').hasClass(gallery.options.slideErrorClass)&&$j(gallery.slides[index]).addClass(gallery.options.slideLoadingClass).removeClass(gallery.options.slideErrorClass));$j(gallery.slides[index]).removeClass(gallery.options.slideLoadingClass);var new_index=gallery.num;gallery.add([image]),gallery.list[index]=gallery.list[new_index],gallery.list.splice(new_index,1);var dom_nodes=["indicators","slides"];for(var i in dom_nodes){var var_name=dom_nodes[i];$j(gallery[var_name][index]).remove(),gallery[var_name][index]=gallery[var_name][new_index];var node=$j(gallery[var_name][index]);node.attr("data-index",index).insertAfter($j("[data-index='"+(index-1)+"']",node.parent())),active&&node.addClass(gallery.options.activeIndicatorClass),gallery[var_name].splice(new_index,1)}active&&(gallery.activeIndicator=$j(gallery.indicators[index])),gallery.positions[index]=active?0:index>gallery.index?gallery.slideWidth:-gallery.slideWidth,gallery.positions.splice(new_index,1),gallery.elements[index]&&(delete gallery.elements[index],gallery.loadElement(index)),gallery.num-=1};return widget.extend([et2_IExposable],{init:function(){this._super.apply(this,arguments),this.mime_regexp=mime_regex;var self=this;this.expose_options={container:"#blueimp-gallery",slidesContainer:"div",titleElement:"h3",displayClass:"blueimp-gallery-display",controlsClass:"blueimp-gallery-controls",singleClass:"blueimp-gallery-single",leftEdgeClass:"blueimp-gallery-left",rightEdgeClass:"blueimp-gallery-right",playingClass:"blueimp-gallery-playing",slideClass:"slide",slideLoadingClass:"",slideErrorClass:"slide-error",slideContentClass:"slide-content",toggleClass:"toggle",prevClass:"prev",nextClass:"next",closeClass:"close",playPauseClass:"play-pause",fullscreenClass:"fullscreen",typeProperty:"type",titleProperty:"title",urlProperty:"href",displayTransition:!0,clearSlides:!0,stretchImages:!0,toggleControlsOnReturn:!0,toggleSlideshowOnSpace:!0,enableKeyboardNavigation:!0,closeOnEscape:!0,closeOnSlideClick:!1,closeOnSwipeUpOrDown:!0,emulateTouchEvents:!0,stopTouchEventsPropagation:!1,hidePageScrollbars:!0,disableScroll:!0,carousel:!0,continuous:!1,unloadElements:!0,startSlideshow:!1,slideshowInterval:3e3,index:0,preloadRange:2,transitionSpeed:400,hideControlsOnSlideshow:!0,toggleFullscreenOnSlideShow:!0,slideshowTransitionSpeed:void 0,indicatorContainer:"ol",activeIndicatorClass:"active",thumbnailProperty:"thumbnail",thumbnailIndicators:!0,thumbnailWithImgTag:!0,onopen:jQuery.proxy(this.expose_onopen,this),onopened:jQuery.proxy(this.expose_onopened,this),onslide:function(index,slide){self.expose_onslide.apply(self,[this,index,slide])},onslideend:function(index,slide){self.expose_onslideend.apply(self,[this,index,slide])},onslidecomplete:function(index,slide){self.expose_onslidecomplete.apply(self,[this,index,slide])},onclose:jQuery.proxy(this.expose_onclose,this),onclosed:jQuery.proxy(this.expose_onclosed,this)};var $body=jQuery("body");if(0==$body.find("#blueimp-gallery").length){var $expose_node=jQuery(document.createElement("div")).attr({id:"blueimp-gallery",class:"blueimp-gallery"});$expose_node.append('

×
    '),$body.append($expose_node)}},set_value:function(_value){if("undefined"!=typeof this._super&&(this._super.apply(this,arguments),this.options.expose_view)){var self=this;_value&&"string"==typeof _value.mime&&_value.mime.match(mime_regex,"ig")&&"undefined"!=typeof _value.download_url&&"undefined"!=typeof this.options.expose_view&&this.options.expose_view&&jQuery(this.node).on("click",function(event){event.altKey||event.ctrlKey||event.shiftKey||event.metaKey||self._init_blueimp_gallery(event,_value),event.stopImmediatePropagation()}).addClass("et2_clickable")}},_init_blueimp_gallery:function(event,_value){var mediaContent=[],nm=find_nextmatch(this),current_index=0;if(nm&&!this._is_target_indepth(nm,event.target)){var current_entry=nm.controller.getRowByNode(event.target);read_from_nextmatch.call(this,nm,mediaContent);for(var i=0;i0&&(res=!0)}return res},expose_onopen:function(event){},expose_onopened:function(event){var nm=find_nextmatch(this),self=this;if(nm){var total_count=nm.controller._grid.getTotalCount();if(total_count>=gallery.num){var $indicator=gallery.container.find(".indicator");$indicator.off().addClass("paginating").swipe(function(event,direction,distance){if(direction==jQuery.fn.swipe.directions.LEFT)distance*=-1;else if(direction!=jQuery.fn.swipe.directions.RIGHT)return;$j(this).css("left",min(0,parseInt($j(this).css("left"))-30*distance)+"px")}),$indicator.bind("mousewheel DOMMousewheel",function(event,_delta){var delta=_delta||event.originalEvent.wheelDelta/120;if(!(delta>0&&parseInt($j(this).css("left"))>gallery.container.width()/2)){if(0>delta&&$j(this).width()+parseInt($j(this).css("left"))=index?1:-1;break}if(!gallery.list[index+direction]||gallery.list[index+direction].loading||total_count>gallery.getNumber()&&index+ET2_DATAVIEW_STEPSIZE>gallery.getNumber()){var start=Math.max(0,direction>0?index:index-ET2_DATAVIEW_STEPSIZE),end=Math.min(total_count-1,start+ET2_DATAVIEW_STEPSIZE);nm.controller._gridCallback(start,end);var images=[];read_from_nextmatch.call(this,nm,images,start);for(var i in images)set_slide(i,images[i])}}},expose_onslidecomplete:function(gallery,index,slide){},expose_onclose:function(event){var nm=find_nextmatch(this);nm&&!this._is_target_indepth(nm)&&(gallery.container.find(".indicator").removeClass("paginating").off("mousewheel").off("swipe"),nm.applyFilters({col_filter:{mime:""}}))},expose_onclosed:function(event){}})}function date(format,timestamp){var jsdate,f,formatChrCb,that=this,formatChr=/\\?([a-z])/gi,_pad=function(n,c){return(n+="").length4||21>j?"th":{1:"st",2:"nd",3:"rd"}[j%10]||"th"},w:function(){return jsdate.getDay()},z:function(){var a=new Date(f.Y(),f.n()-1,f.j()),b=new Date(f.Y(),0,1);return Math.round((a-b)/864e5)+1},W:function(){var a=new Date(f.Y(),f.n()-1,f.j()-f.N()+3),b=new Date(a.getFullYear(),0,4);return _pad(1+Math.round((a-b)/864e5/7),2)},F:function(){return txt_words[6+f.n()]},m:function(){return _pad(f.n(),2)},M:function(){return f.F().slice(0,3)},n:function(){return jsdate.getMonth()+1},t:function(){return new Date(f.Y(),f.n(),0).getDate()},L:function(){return 1===new Date(f.Y(),1,29).getMonth()|0},o:function(){var n=f.n(),W=f.W(),Y=f.Y();return Y+(12===n&&9>W?-1:1===n&&W>9)},Y:function(){return jsdate.getFullYear()},y:function(){return(f.Y()+"").slice(-2)},a:function(){return jsdate.getHours()>11?"pm":"am"},A:function(){return f.a().toUpperCase()},B:function(){var H=3600*jsdate.getUTCHours(),i=60*jsdate.getUTCMinutes(),s=jsdate.getUTCSeconds();return _pad(Math.floor((H+i+s+3600)/86.4)%1e3,3)},g:function(){return f.G()%12||12},G:function(){return jsdate.getHours()},h:function(){return _pad(f.g(),2)},H:function(){return _pad(f.G(),2)},i:function(){return _pad(jsdate.getMinutes(),2)},s:function(){return _pad(jsdate.getSeconds(),2)},u:function(){return _pad(1e3*jsdate.getMilliseconds(),6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)"},I:function(){var a=new Date(f.Y(),0),c=Date.UTC(f.Y(),0),b=new Date(f.Y(),6),d=Date.UTC(f.Y(),6);return 0+(a-c!==b-d)},O:function(){var a=jsdate.getTimezoneOffset();return(a>0?"-":"+")+_pad(Math.abs(a/60*100),4)},P:function(){var O=f.O();return O.substr(0,3)+":"+O.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-jsdate.getTimezoneOffset()},c:function(){return"Y-m-d\\Th:i:sP".replace(formatChr,formatChrCb)},r:function(){return"D, d M Y H:i:s O".replace(formatChr,formatChrCb)},U:function(){return jsdate.getTime()/1e3|0}},this.date=function(format,timestamp){return that=this,jsdate="undefined"==typeof timestamp?new Date:timestamp instanceof Date?new Date(timestamp):new Date(1e3*timestamp),format.replace(formatChr,formatChrCb)},this.date(format,timestamp)}function et2_dataview_rowAOI(_node){"use strict";var aoi=new egwActionObjectInterface;aoi.node=_node,aoi.selectMode=EGW_SELECTMODE_DEFAULT,aoi.checkBox=null,aoi.doGetDOMNode=function(){return aoi.node},$j(_node).mousedown(egwPreventSelect);var selectHandler=function(e,_params){if(egwUnfocus(),_node.onselectstart=null,e.target!=aoi.checkBox){var selected=egwBitIsSet(aoi.getState(),EGW_AO_STATE_SELECTED),state=egwGetShiftState(e);if(_params&&egwIsMobile())switch(_params.swip){case"left":case"right":state=1,_egw_active_menu&&_egw_active_menu.hide();break;case"up":case"down":return}switch(aoi.selectMode){case EGW_SELECTMODE_DEFAULT:aoi.updateState(EGW_AO_STATE_SELECTED,!egwBitIsSet(state,EGW_AO_SHIFT_STATE_MULTI)||!selected,state);break;case EGW_SELECTMODE_TOGGLE:aoi.updateState(EGW_AO_STATE_SELECTED,!selected,egwSetBit(state,EGW_AO_SHIFT_STATE_MULTI,!0))}}};return egwIsMobile()?$j(_node).swipe({allowPageScroll:"vertical",swipe:function(event,direction){selectHandler(event,{swip:direction})},click:function(event){selectHandler(event)}}):$j(_node).click(selectHandler),$j(aoi.checkBox).change(function(){aoi.updateState(EGW_AO_STATE_SELECTED,this.checked,EGW_AO_SHIFT_STATE_MULTI)}),aoi.doSetState=function(_state){var selected=egwBitIsSet(_state,EGW_AO_STATE_SELECTED);this.checkBox&&(this.checkBox.checked=selected),$j(this.node).toggleClass("focused",egwBitIsSet(_state,EGW_AO_STATE_FOCUSED)),$j(this.node).toggleClass("selected",selected)},aoi}function nm_action(_action,_senders,_target,_ids){if(!_action.checkbox||_action.data&&"undefined"!=typeof _action.data.nm_action){if("undefined"!=typeof _action.data&&_action.data||(_action.data={}),"undefined"==typeof _action.data.nm_action&&"popup"==_action.type&&(_action.data.nm_action="submit"),"undefined"==typeof _ids){for(var nm=null,action=_action;null==nm&&null!=action;)null!=action.data&&action.data.nextmatch&&(nm=action.data.nextmatch),action=action.parent;nm&&(_ids=nm.getSelection(),_action.data.nextmatch=nm)}for(var idsArr=_ids.ids,i=0;i=0?'"'+id.replace(/"/g,'""')+'"':id)+(i=0?egw_open_id=egw_open_id.split(":")[params.shift(params[2])]:params.length>1&&""==params[0]&&-1!=params[1].indexOf("from=merge")?params.shift():params.shift(params[2])),params.length>1&&""==params[0]&&-1!=params[1].indexOf("from=merge")&¶ms.shift();var extra=params.join("-");egw(app,window).open(egw_open_id,app,type,extra,target);break;case"open_popup":if(null==nm_popup_action){nm_open_popup(_action,_ids.ids);break}case"submit":var checkboxes=mgr.getActionsByAttr("checkbox",!0),checkbox_values={};if(checkboxes)for(var i in checkboxes)checkbox_values[checkboxes[i].id]=checkboxes[i].checked;var nextmatch=_action.data.nextmatch;if(!nextmatch&&_senders.length&&(nextmatch=_senders[0]._context._widget),nextmatch){var old_value=nextmatch.getValue,value=nextmatch.getValue();jQuery.extend(value,this.activeFilters,{selected:idsArr,select_all:_ids.all,checkboxes:checkbox_values}),value[nextmatch.options.settings.action_var]=_action.id,nextmatch.getValue=function(){return value},_action.data.postSubmit?nextmatch.getInstanceManager().postSubmit():nextmatch.getInstanceManager().submit(),"open_popup"==_action.data.nm_action&&(nextmatch.refresh(idsArr),nextmatch.getValue=old_value)}else egw().debug("error","Missing nextmatch widget, could not submit",_action)}}}function fetchAll(ids,nextmatch,callback){if(!nextmatch||!nextmatch.controller)return!1;var selection=nextmatch.getSelection();if(!selection.all)return!1;if(nextmatch.controller._grid&&nextmatch.controller._grid.getTotalCount()>ids.length){var idsArr=[],count=idsArr.length,total=nextmatch.controller._grid.getTotalCount(),cancel=!1,dialog=et2_dialog.show_dialog(function(){count=total,cancel=!0},egw.lang("Loading"),egw.lang("please wait..."),{},[{button_id:et2_dialog.CANCEL_BUTTON,text:"cancel",id:"dialog[cancel]",image:"cancel"}]);do nextmatch.controller.dataFetch({start:count,num_rows:200},function(data){if(data&&data.order)for(var i=0;i=total&&(dialog.destroy(),cancel||callback.call(this,idsArr))},this),count+=200;while(total>count);return!0}return!1}function doLongTask(idsArr,all,_action,nextmatch){if(all||idsArr.length>1||"undefined"==typeof _action.data.egw_open){if(all){var fetching=fetchAll(idsArr,nextmatch,function(idsArr){et2_dialog.long_task(null,_action.data.message||_action.caption,_action.data.title,_action.data.menuaction,idsArr)});if(fetching)return!0}return et2_dialog.long_task(null,_action.data.message||_action.caption,_action.data.title,_action.data.menuaction,idsArr),!0}return!1}function nm_compare_field(_action,_senders,_target){var value=!1,field=document.getElementById(_action.data.fieldId);if(field)value=$j(field).val();else{var nextmatch=_action.data.nextmatch;if(!nextmatch&&_senders.length&&(nextmatch=_senders[0]._context._widget),!nextmatch)return!1;field=nextmatch.getWidgetById(_action.data.fieldId),value=field.getValue()}return field?"!"==_action.data.fieldValue.substr(0,1)?value!=_action.data.fieldValue.substr(1):value==_action.data.fieldValue:!1}function nm_open_popup(_action,_selected){var uid;"undefined"!=typeof _action.data.nextmatch?uid=_action.data.nextmatch.getInstanceManager().uniqueId:"undefined"!=typeof _selected[0]&&(uid=_selected[0].manager.data.nextmatch.getInstanceManager().uniqueId);var popup=jQuery("#"+(uid||"")+"_"+_action.id+"_popup").first()||jQuery("[id*='"+_action.id+"_popup']").first();if(popup){nm_popup_action=_action,_selected.length&&"object"==typeof _selected[0]?(_action.data.nextmatch=_selected[0]._context._widget,nm_popup_ids=_selected):(egw().debug("warn","Not proper format for IDs, should be array of egwActionObject",_selected),nm_popup_ids=_selected);var dialog=jQuery(".action_popup-content",popup);if(0==dialog.length&&(dialog=jQuery(document.createElement("div")).addClass("action_popup-content"),1==popup.children().length?dialog.append(popup.children().children().slice(1,popup.children().children().length-1)):dialog.append(popup.children().slice(1,popup.children().length-1)),dialog.appendTo(popup)),1==dialog.length){var dialog_parent=dialog.parent(),d_buttons=[],action=_action;popup.show();var buttons=jQuery("button:visible",popup).each(function(index){var but=jQuery(this);if(but.hide(),but.attr("id"))var widget_id=but.attr("id").replace(_action.data.nextmatch.getInstanceManager().uniqueId+"_",""),button=nm_popup_action.data.nextmatch.getRoot().getWidgetById(widget_id);d_buttons.push({text:but.text(),click:button&&button.onclick?function(e){dialog.dialog("close"),nm_popup_action=action,button.onclick.apply(button,e.currentTarget)}:function(e){dialog.dialog("close"),nm_popup_action=null}})}),dialog_width=dialog.outerWidth(!0);popup.hide(),dialog.dialog({title:jQuery(".promptheader",popup).text(),modal:!0,buttons:d_buttons,minWidth:dialog_width,close:function(event,ui){dialog.dialog("destroy"),dialog.appendTo(dialog_parent),buttons.show()}})}nm_popup_action=null,nm_popup_senders=null}}function nm_submit_popup(button){if(nm_popup_action.data.nextmatch){var widget_id=$j(button).attr("id").replace(nm_popup_action.data.nextmatch.getInstanceManager().uniqueId+"_","");nm_popup_action.data.nextmatch.getRoot().getWidgetById(widget_id).clicked=!0}if(nm_popup_ids.length&&"object"!=typeof nm_popup_ids[0]){var ids={ids:[]};for(var i in nm_popup_ids)nm_popup_ids[i]&&ids.ids.push(nm_popup_ids[i])}nm_action(nm_popup_action,nm_popup_ids,button,ids),nm_hide_popup(button,null),nm_popup_ids=null}function nm_hide_popup(element,div_id){var prefix=element.id.substring(0,element.id.indexOf("[")),popup=div_id?document.getElementById(div_id):jQuery("#"+prefix+"_popup").get(0)||jQuery("[id*='"+prefix+"_popup']").get(0);return popup&&(popup.style.display="none"),nm_popup_action=null,nm_popup_senders=null,!1}function nm_activate_link(_action,_senders){$j(_senders[0].iface.getDOMNode()).find(".et2_clickable:first").trigger("click")}function dtmlXMLLoaderObject(t,e,n,i){return this.xmlDoc="",this.async="undefined"!=typeof n?n:!0,this.onloadAction=t||null,this.mainObject=e||null,this.waitCall=null,this.rSeed=i||!1,this}function callerFunction(t,e){return this.handler=function(n){return n||(n=window.event),t(n,e),!0},this.handler}function getAbsoluteLeft(t){return getOffset(t).left}function getAbsoluteTop(t){return getOffset(t).top}function getOffsetSum(t){for(var e=0,n=0;t;)e+=parseInt(t.offsetTop),n+=parseInt(t.offsetLeft),t=t.offsetParent;return{top:e,left:n}}function getOffsetRect(t){var e=t.getBoundingClientRect(),n=document.body,i=document.documentElement,a=window.pageYOffset||i.scrollTop||n.scrollTop,s=window.pageXOffset||i.scrollLeft||n.scrollLeft,r=i.clientTop||n.clientTop||0,o=i.clientLeft||n.clientLeft||0,d=e.top+a-r,l=e.left+s-o;return{top:Math.round(d),left:Math.round(l)}}function getOffset(t){return t.getBoundingClientRect?getOffsetRect(t):getOffsetSum(t); +}function convertStringToBoolean(t){switch("string"==typeof t&&(t=t.toLowerCase()),t){case"1":case"true":case"yes":case"y":case 1:case!0:return!0;default:return!1}}function getUrlSymbol(t){return-1!=t.indexOf("?")?"&":"?"}function dhtmlDragAndDropObject(){return window.dhtmlDragAndDrop?window.dhtmlDragAndDrop:(this.lastLanding=0,this.dragNode=0,this.dragStartNode=0,this.dragStartObject=0,this.tempDOMU=null,this.tempDOMM=null,this.waitDrag=0,window.dhtmlDragAndDrop=this,this)}function _dhtmlxError(){return this.catches||(this.catches=[]),this}function dhtmlXHeir(t,e){for(var n in e)"function"==typeof e[n]&&(t[n]=e[n]);return t}function dhtmlxEvent(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)}function dhtmlxDetachEvent(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n)}function dhtmlxDnD(t,e){e&&(this._settings=e),dhtmlxEventable(this),dhtmlxEvent(t,"mousedown",dhtmlx.bind(function(e){this.dragStart(t,e)},this))}function dataProcessor(t){return this.serverProcessor=t,this.action_param="!nativeeditor_status",this.object=null,this.updatedRows=[],this.autoUpdate=!0,this.updateMode="cell",this._tMode="GET",this.post_delim="_",this._waitMode=0,this._in_progress={},this._invalid={},this.mandatoryFields=[],this.messages=[],this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"},this.enableUTFencoding(!0),dhtmlxEventable(this),this}function itempickerDocumentAction(context,data){"use strict";var formid="itempicker_action_form",form="
    ";$j("body").append(form),$j("#"+formid).submit().remove()}function etemplate2(_container,_menuaction){"undefined"==typeof _menuaction&&(_menuaction="home.etemplate_new.ajax_process_content.etemplate"),this.DOMContainer=_container,this.menuaction=_menuaction,this.uniqueId=_container.getAttribute("id")?_container.getAttribute("id").replace(".","-"):"",this.widgetContainer=null}function etemplate2_handle_load(_type,_response){var data=_response.data;if(jQuery.isArray(data["refresh-opener"])&&window.opener){var egw=window.egw(opener);egw.refresh.apply(egw,data["refresh-opener"])}var egw=window.egw(window);if("object"==typeof data.data&&"string"==typeof data.data.app_header&&(egw.app_header(data.data.app_header,data.data.currentapp||null),delete data.data.app_header),jQuery.isArray(data.message)&&egw.message.apply(egw,data.message),data["window-close"])return"string"==typeof data["window-close"]&&"true"!==data["window-close"]&&alert(data["window-close"]),egw.close(),!0;if(data["window-focus"]&&window.focus(),window.framework&&jQuery.isArray(data.setSidebox)&&window.framework.setSidebox.apply(window.framework,data.setSidebox),"string"==typeof data.url&&"object"==typeof data.data){if("function"==typeof this.load)return this.load(data.name,data.url,data.data),!0;var node=document.getElementById(data.DOMNodeID);if(node){if(node.children.length){var old=etemplate2.getById(node.id);old&&old.clear()}var et2=new etemplate2(node);return et2.load(data.name,data.url,data.data),!0}egw.debug("error","Could not find target node %s",data.DOMNodeId)}throw"Error while parsing et2_load response"}function etemplate2_handle_validation_error(_type,_response){for(var id in _response.data){var widget=this.widgetContainer.getWidgetById(id);if(widget){widget.showMessage(_response.data[id],"validation_error");for(var tmpWidget=widget;tmpWidget._parent&&"tabbox"!=tmpWidget._type;)tmpWidget=tmpWidget._parent;"tabbox"==tmpWidget._type&&tmpWidget.activateTab(widget)}}egw().debug("warn","Validation errors",_response.data)}function etemplate2_handle_assign(type,res,req){if("undefined"!=typeof res.data.id&&"undefined"!=typeof res.data.key&&"undefined"!=typeof res.data.value){if("undefined"==typeof res.data.etemplate_exec_id||res.data.etemplate_exec_id!=this.etemplate_exec_id)return!1;if("etemplate_exec_id"==res.data.key)return this.etemplate_exec_id=res.data.value,!0;if(null==this.widgetContainer)return egw.debug("warn","Tried to call assign on an un-loaded etemplate",res.data),!1;var widget=this.widgetContainer.getWidgetById(res.data.id);if(widget){if("function"!=typeof widget["set_"+res.data.key])return egw.debug("warn","Cannot set %s attribute %s via JSON assign, no set_%s()",res.data.id,res.data.key,res.data.key),!1;try{return widget["set_"+res.data.key].call(widget,res.data.value),!0}catch(e){egw.debug("error","When assigning %s on %s via AJAX, \n"+(e.message||e+""),res.data.key,res.data.id,widget)}}return!1}throw"Invalid parameters"}function xajax_eT_wrapper(obj,widget){if(egw().debug("warn","xajax_eT_wrapper() is deprecated, replace with widget.getInstanceManager().submit()"),"object"==typeof obj){if($j("div.popupManual div.noPrint").hide(),$j("div.ajax-loader").show(),"undefined"==typeof widget&&obj.id)for(var et2=etemplate2.getByApplication(egw_getAppName()),i=0;i=0){for(var result="_"+_variable.variable,i=0;i<_variable.accessExpressions.length;i++)result+="["+_php_compileString(_vars,_variable.accessExpressions[i])+"]";return"(typeof _"+_variable.variable+' != "undefined" && typeof '+result+'!="undefined" && '+result+" != null ? "+result+':"")'}_throwCompilerErr("Variable $"+_variable.variable+" is not defined.")}function _php_compileString(_vars,_string){_string instanceof Array||(_string=[_string]);for(var parts=[],hasString=!1,i=0;i<_string.length;i++){var part=_string[i];"string"==typeof part?(hasString=!0,parts.push("'"+part.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'")):parts.push(_php_compileVariable(_vars,part))}return hasString||parts.push('""'),parts.join(" + ")}function _php_compileJSCode(_vars,_tree){return"return "+_php_compileString(_vars,_tree)+";"}var STATE_DEFAULT=0,STATE_ESCAPED=1,STATE_CURLY_BRACE_OPEN=2,STATE_EXPECT_CURLY_BRACE_CLOSE=3,STATE_EXPECT_RECT_BRACE_CLOSE=4,STATE_EXPR_BEGIN=5,STATE_EXPR_END=6,PHP_VAR_PREG=/^([A-Za-z0-9_]+)/;this.et2_compilePHPExpression=function(_expr,_vars){"undefined"==typeof _vars&&(_vars=[]);try{var parser=_php_parser(_expr),syntaxTree=[];_php_parseDoubleQuoteString(parser,syntaxTree);var js=_php_compileJSCode(_vars,syntaxTree);egw.debug("log","Compiled PHP "+_expr+" --> "+js)}catch(e){return egw.debug("warn","Error compiling PHP "+_expr+" --> using it literally ("+("string"==typeof e?e:e.message)+")!"),function(){return _expr}}for(var attrs=[],i=0;i<_vars.length;i++)attrs.push("_"+_vars[i]);return attrs.push(js),Function.apply(Function,attrs)}}).call(window);var et2_arrayMgr=function(){"use strict";return Class.extend({splitIds:!0,init:function(_data,_parentMgr){if("undefined"==typeof _parentMgr&&(_parentMgr=null),this.parentMgr=_parentMgr,"undefined"!=typeof _data&&_data||(egw.debug("log","No data passed to content array manager. Probably a mismatch between template namespaces and data."),_data={}),this.splitIds)for(var key in _data){var indexes=key.replace(/[/g,"[").split("[");if(indexes.length>1){for(var value=_data[key],target=_data,i=0;i1){indexes=[indexes.shift(),indexes.join("[")],indexes[1]=indexes[1].substring(0,indexes[1].length-1);var children=indexes[1].split("][");children.length&&(indexes=jQuery.merge([indexes[0]],children))}return indexes},getPath:function(_path){return"undefined"==typeof _path&&(_path=[]),null!=this.perspectiveData.key&&(_path=this.perspectiveData.key.replace(/]/g,"").split("[").concat(_path)),null!=this.parentMgr&&(_path=this.parentMgr.getPath(_path)),_path},getEntry:function(_key,_referenceInto,_skipEmpty){"undefined"==typeof _referenceInto&&(_referenceInto=!1),"undefined"==typeof _skipEmpty&&(_skipEmpty=!1);for(var indexes=this.explodeKey(_key),entry=this.data,i=0;i=0&&(null!=this.perspectiveData.row||!_ident.match(/\$\{?row\}?/))){var row=this.perspectiveData.row,row_cont=this.data[row]||{},cont=this.data,_cont=this.data,proto=this.constructor.prototype;if("undefined"==typeof proto.compiledExpressions[_ident])try{null==this.perspectiveData.row?proto.compiledExpressions[_ident]=et2_compilePHPExpression(_ident,["cont","_cont"]):proto.compiledExpressions[_ident]=et2_compilePHPExpression(_ident,["row","cont","row_cont","_cont"])}catch(e){proto.compiledExpressions[_ident]=null,egw.debug("error","Error while compiling PHP->JS ",e)}if(proto.compiledExpressions[_ident])try{_ident=null==this.perspectiveData.row?proto.compiledExpressions[_ident](cont,_cont):proto.compiledExpressions[_ident](row,cont,row_cont,_cont)}catch(e){egw.debug("log","object"==typeof e?e.message:e),_ident=null}}return is_index_in_content&&(_ident="@"==_ident.charAt(1)?this.getRoot().getEntry(_ident.substr(2)):this.getEntry(_ident.substr(1))),_ident},parseBoolExpression:function(_expression){if("!"==_expression.charAt(0))return!this.parseBoolExpression(_expression.substr(1));var parts=_expression.split("="),val=this.expandName(parts[0]);if("undefined"!=typeof parts[1]){var checkVal=this.expandName(parts[1]);return"/"==checkVal.charAt(0)?!!new RegExp(checkVal.substr(1,checkVal.length-2)).test(val):val==checkVal}return et2_evalBool(val)},openPerspective:function(_owner,_root,_row){var root="string"==typeof _root?this.data[_root]:null==_root?this.data:_root;"undefined"==typeof root&&"string"==typeof _root&&(root=this.getEntry(_root));var constructor=this.isReadOnly?et2_readonlysArrayMgr:et2_arrayMgr,mgr=new constructor(root,this);return mgr.perspectiveData.owner=_owner,"string"==typeof _root&&(mgr.perspectiveData.key=_root),"undefined"!=typeof _row&&(mgr.perspectiveData.row=_row),mgr}})}.call(this),et2_readonlysArrayMgr=function(){"use strict";return et2_arrayMgr.extend({isReadOnly:function(_id,_attr,_parent){var entry=null;if(null!=_id){(_id.indexOf("$")>=0||_id.indexOf("@")>=0)&&(_id=this.expandName(_id));for(var mgr=this;mgr.parentMgr&&jQuery.isEmptyObject(mgr.data);)mgr=mgr.parentMgr;entry=mgr.getEntry(_id)}return"undefined"!=typeof entry&&"object"!=typeof entry?entry:"undefined"!=typeof _attr&&null!==_attr?et2_evalBool(_attr):"undefined"!=typeof _parent&&_parent?!0:(entry=this.getEntry("__ALL__"),null!==entry&&"undefined"!=typeof entry)},expandName:function(ident){return this.perspectiveData.owner.getArrayMgr("content").expandName(ident)}})}.call(this),et2_registry={},et2_widget=function(){"use strict";return ClassWithAttributes.extend({attributes:{id:{name:"ID",type:"string",description:"Unique identifier of the widget"},no_lang:{name:"No translation",type:"boolean",default:!1,description:"If true, no translations are made for this widget"},span:{ignore:!0},type:{name:"Widget type",type:"string",ignore:!0,description:"What kind of widget this is"},readonly:{ignore:!0}},legacyOptions:[],createNamespace:!1,init:function(_parent,_attrs){"undefined"==typeof _parent&&(_parent=null),"undefined"==typeof _attrs&&(_attrs={}),this._mgrs={},this._inst=null,this._children=[],this._type=_attrs.type,this.id=_attrs.id,null!=_parent&&_parent.addChild(this),this.supportedWidgetClasses=[et2_widget],_attrs.id&&this.createNamespace&&this.checkCreateNamespace(),this.id,this.transformAttributes(_attrs),this.options=et2_cloneObject(_attrs)},destroy:function(){for(var i=this._children.length-1;i>=0;i--)this._children[i].free();"undefined"!=typeof this._parent&&null!==this._parent&&this._parent.removeChild(this);for(var key in this._mgrs)this._mgrs[key]&&this._mgrs[key].owner==this&&this._mgrs[key].free()},clone:function(_parent){"undefined"==typeof _parent&&(_parent=null);var copy=new this.constructor(_parent,this.options);return copy.assign(this),copy},assign:function(_obj){"undefined"==typeof _obj._children&&this.egw().debug("log","Foo!");for(var i=0;i<_obj._children.length;i++)_obj._children[i].clone(this);this.setArrayMgrs(_obj.mgrs)},getParent:function(){return this._parent},getChildren:function(){return this._children},getRoot:function(){return null!=this._parent?this._parent.getRoot():this},addChild:function(_node){this.insertChild(_node,this._children.length)},insertChild:function(_node,_idx){this.isOfSupportedWidgetClass(_node)?(_node._parent&&_node._parent.removeChild(_node),_node._parent=this,this._children.splice(_idx,0,_node),_node.implements(et2_IDOMNode)&&this.implements(et2_IDOMNode)&&_node.parentNode&&(_node.detachFromDOM(),_node.parentNode=this.getDOMNode(_node),_node.attachToDOM())):this.egw().debug("error","Widget "+_node._type+" is not supported by this widget class",this)},removeChild:function(_node){var idx=this._children.indexOf(_node);idx>=0&&(_node._parent=null,this._children.splice(idx,1))},getWidgetById:function(_id){if(this.id==_id)return this;if(!this._children)return null;for(var i=0;i0){if(_target.id&&this.getArrayMgr("modifications").getEntry(_target.id)){var mod=this.getArrayMgr("modifications").getEntry(_target.id);"undefined"!=typeof mod.options&&(attrValue=_attrsObj[i].value=mod.options)}"@"!=attrValue.charAt(0)&&-1==attrValue.indexOf("$")||(attrValue=mgr.expandName(attrValue));for(var splitted=et2_csvSplit(attrValue+""),j=0;j_proto.legacyOptions.length&&(attrValue=splitted.slice(j));var attr=_proto.attributes[_proto.legacyOptions[j]];"boolean"==attr.type?attrValue=mgr.parseBoolExpression(attrValue):"object"!=typeof attrValue&&(attrValue=mgr.expandName(attrValue)),_target[_proto.legacyOptions[j]]=attrValue}}else{if(null!=mgr&&"undefined"!=typeof _proto.attributes[attrName]){var attr=_proto.attributes[attrName];attrValue="boolean"==attr.type?mgr.parseBoolExpression(attrValue):mgr.expandName(attrValue)}_target[attrName]=attrValue}}},transformAttributes:function(_attrs){if(this.id&&("string"!=typeof this.id&&console.log(this.id),this.getArrayMgr("modifications"))){var data=this.getArrayMgr("modifications").getEntry(this.id);if(this.createNamespace&&this.getArrayMgr("modifications").perspectiveData.owner==this&&(data=this.getArrayMgr("modifications").data),"object"==typeof data)for(var key in data)_attrs[key]=data[key]}for(var key in _attrs)_attrs[key]&&"undefined"!=typeof this.attributes[key]&&(this.attributes[key].translate===!0||"!no_lang"===this.attributes[key].translate&&!_attrs.no_lang)&&(_attrs[key]=this.egw().lang(_attrs[key],"%s"))},createElementFromNode:function(_node){var attributes={},_nodeName=attributes.type=_node.getAttribute("type")?_node.getAttribute("type"):_node.nodeName.toLowerCase(),readonly=attributes.readonly=this.getArrayMgr("readonlys")?this.getArrayMgr("readonlys").isReadOnly(_node.getAttribute("id"),_node.getAttribute("readonly"),"undefined"!=typeof this.readonly?this.readonly:this.options.readonly):!1,modifications=this.getArrayMgr("modifications");if(modifications&&_node.getAttribute("id")){var entry=modifications.getEntry(_node.getAttribute("id"));if(null==entry){var entry=modifications.data[_node.getAttribute("id")];if(entry)this.egw().debug("warn","getEntry("+_node.getAttribute("id")+") failed, but the data is there.",modifications,entry);else var entry=modifications.getRoot().getEntry(_node.getAttribute("id"))}entry&&entry.type&&(_nodeName=attributes.type=entry.type),entry=null}("@"==_nodeName.charAt(0)||_nodeName.indexOf("$")>=0)&&(_nodeName=attributes.type=this.getArrayMgr("content").expandName(_nodeName));var constructor="undefined"==typeof et2_registry[_nodeName]?et2_placeholder:et2_registry[_nodeName];readonly&&"undefined"!=typeof et2_registry[_nodeName+"_ro"]&&(constructor=et2_registry[_nodeName+"_ro"]),this.parseXMLAttrs(_node.attributes,attributes,constructor.prototype),constructor.prototype.generateAttributeSet(attributes);var widget=new constructor(this,attributes);return widget.loadFromXML(_node),widget},loadFromXML:function(_node){for(var i=0;i<_node.childNodes.length;i++){var node=_node.childNodes[i],widgetType=node.nodeName.toLowerCase();"#comment"!=widgetType&&("#text"!=widgetType?this.createElementFromNode(node):node.data.replace(/^\s+|\s+$/g,"")&&this.loadContent(node.data))}},loadContent:function(_content){},loadingFinished:function(promises){if(this.initAttributes(this.options),"undefined"==typeof promises){promises=[];var warn_if_deferred=!0}var loadChildren=function(){for(var i=0;iidx||idx>=this.parentNode.childNodes.length-1?this.parentNode.appendChild(node):this.parentNode.insertBefore(node,this.parentNode.childNodes[idx]),this._attachSet={node:node,parent:this.parentNode},!0}return!1},isAttached:function(){return null!=this.parentNode},getSurroundings:function(){return this._surroundingsMgr||(this._surroundingsMgr=new et2_surroundingsMgr(this)),this._surroundingsMgr},set_parent_node:function(_node){if("string"==typeof _node){var parent=$j("#"+_node);0==parent.length?this.egw().debug("warn",'Unable to find DOM parent node with ID "%s" for widget %o.',_node,this):this.setParentDOMNode(parent.get(0))}else this.setParentDOMNode(_node)},setParentDOMNode:function(_node){_node!=this.parentNode&&(this.detachFromDOM(),this.parentNode=_node,this.attachToDOM())},getParentDOMNode:function(){return this.parentNode},getDOMIndex:function(){if(this._parent){var idx=0,children=this._parent.getChildren();if(children&&children.indexOf)return children.indexOf(this);egw.debug("warn","No Array.indexOf(), falling back to looping. ");for(var i=0;i0){var hasPlaceholder=et2_hasChild(this._widgetSurroundings,this._widgetPlaceholder);if(hasPlaceholder||(this._widgetPlaceholder=document.createElement("span"),this._widgetSurroundings.push(this._widgetPlaceholder),this._ownPlaceholder=!0),1==this._widgetSurroundings.length)this._widgetSurroundings[0]==this._widgetPlaceholder?this._widgetContainer=null:this._widgetContainer=this._widgetSurroundings[0];else{this._widgetContainer=document.createElement("span");for(var i=0;i1?parts.pop():null,template_name=parts.pop(),xml=null,templates=etemplate2.prototype.templates;if(!(xml=templates[template_name])){if(template_name.indexOf(".")<0){var root=_parent?_parent.getRoot():null,top_name=root&&root._inst?root._inst.name:null;top_name&&template_name.indexOf(".")<0&&(template_name=top_name+"."+template_name)}if(xml=templates[template_name],!xml){var url=this.options.url;if(!this.options.url){var splitted=template_name.split(".");url=this.getRoot()._inst.template_base_url+splitted.shift()+"/templates/default/"+splitted.join(".")+".xet"+(cache_buster?"?download="+cache_buster:"")}return-1==url.indexOf("?")&&(url+="?download="+(new Date).valueOf()),void((this.options.url||splitted.length)&&et2_loadXMLFromURL(url,function(_xmldoc){for(var i=0;i<_xmldoc.childNodes.length;i++){var template=_xmldoc.childNodes[i];"template"==template.nodeName.toLowerCase()&&(templates[template.getAttribute("id")]=template)}"undefined"!=typeof templates[template_name]&&this.loadFromXML(templates[template_name]),this.loading.resolve()},this))}}null!==xml&&"undefined"!=typeof xml?(this.egw().debug("log","Loading template from XML: ",template_name),this.loadFromXML(xml),this.loading.resolve()):(this.egw().debug("warn","Unable to find XML for ",template_name),this.loading.reject())}else this.loading.resolve()},checkCreateNamespace:function(){if(this.content){var old_id=this.id;this.id=this.content,this._super.apply(this,arguments),this.id=old_id}},getDOMNode:function(){return this.div},doLoadingFinished:function(){return this._super.apply(this,arguments),this.loading.done(jQuery.proxy(function(){$j(this).trigger("load")},this.div)),this.loading.promise()}})}.call(this);et2_register_widget(et2_template,["template"]);var et2_grid=function(){"use strict";return et2_DOMWidget.extend([et2_IDetachedDOM,et2_IAligned,et2_IResizeable],{createNamespace:!0,attributes:{border:{ignore:!0},align:{name:"Align",type:"string",default:"left",description:"Position of this element in the parent hbox"},spacing:{ignore:!0},padding:{ignore:!0},sortable:{name:"Sortable callback",type:"string",default:et2_no_init,description:"PHP function called when user sorts the grid. Setting this enables sorting the grid rows. The callback will be passed the ID of the grid and the new order of the rows."}},init:function(){this.table=$j(document.createElement("table")).addClass("et2_grid"),this.thead=$j(document.createElement("thead")).appendTo(this.table),this.tfoot=$j(document.createElement("tfoot")).appendTo(this.table),this.tbody=$j(document.createElement("tbody")).appendTo(this.table),this._super.apply(this,arguments),this.rowCount=0,this.columnCount=0,this.cells=[],this.rowData=[],this.colData=[],this.managementArray=[],this.template_node=null,this.wrapper=null},destroy:function(){this._super.call(this,arguments)},_initCells:function(_colData,_rowData){for(var w=_colData.length,h=_rowData.length,cells=new Array(h),y=0;h>y;y++){cells[y]=new Array(w);for(var x=0;w>x;x++)cells[y][x]={td:null,widget:null,colData:_colData[x],rowData:_rowData[y],disabled:_colData[x].disabled||_rowData[y].disabled,class:_colData[x].class,colSpan:1,autoColSpan:!1,rowSpan:1,autoRowSpan:!1,width:_colData[x].width,x:x,y:y}}return cells},_getColDataEntry:function(){return{width:"auto",class:"",align:"",span:"1",disabled:!1}},_getRowDataEntry:function(){return{height:"auto",class:"",valign:"top",span:"1",disabled:!1}},_getCell:function(_cells,_x,_y){if(_y>=0&&_y<_cells.length){var row=_cells[_y];if(_x>=0&&_x0||value.indexOf("$")>0){var ident=content.expandName(value);for("@"!=value[0]&&(ident=content.getEntry(ident,!1,!0));null!=ident&&1e3>rowIndex;)rowData[rowIndex]=jQuery.extend({},rowDataEntry),content.perspectiveData.row=++rowIndex,ident=content.expandName(value),"@"!=value[0]&&(ident=content.getEntry(ident,!1,!0));return void(rowIndex>=1e3&&egw.debug("error","Problem in autorepeat fallback: too many rows for '%s'. Use a nextmatch, or start debugging.",value))}}};et2_filteredNodeIterator(this.lastRowNode,check,this),cont=!1,content.perspectiveData=currentPerspective}rowIndex<=rowData.length-1&&(this.lastRowNode=null)},_fillCells:function(cells,columns,rows){var h=cells.length,w=h>0?cells[0].length:0,currentPerspective=jQuery.extend({},this.getArrayMgr("content").perspectiveData),x=0;et2_filteredNodeIterator(columns,function(node,nodeName){function _readColNode(node,nodeName){if(y>=h)return void this.egw().debug("warn","Skipped grid cell in column, '"+nodeName+"'");var cell=this._getCell(cells,x,y);node.getAttribute("span")?cell.rowSpan=node.getAttribute("span"):(cell.rowSpan=cell.colData.span,cell.autoRowSpan=!0),"all"==cell.rowSpan&&(cell.rowSpan=cells.length);for(var span=cell.rowSpan=this._forceNumber(cell.rowSpan),widget=this.createElementFromNode(node,nodeName),i=0;span>i&&y=w)return void("description"!=nodeName&&this.egw().debug("warn","Skipped grid cell in row, '"+nodeName+"'"));var cell=this._getCell(cells,x,y);node.getAttribute("span")?cell.colSpan=node.getAttribute("span"):(cell.colSpan=cell.rowData.span,cell.autoColSpan=!0),"all"==cell.colSpan&&(cell.colSpan=cells[y].length);var span=cell.colSpan=this._forceNumber(cell.colSpan);if(node.getAttribute("align")&&(cell.align=node.getAttribute("align")),"nextmatch-"==nodeName.substr(0,10)&&(cell.nm_id=node.getAttribute("id")),node.getAttribute("class")&&(cell.class+=(cell.class?" ":"")+node.getAttribute("class")),!cell.disabled){if(!nm){var mgrs=this.getArrayMgrs();for(var name in mgrs)this.getArrayMgr(name).perspectiveData.row=y;this._getCell(cells,x,y).rowData.id&&(this._getCell(cells,x,y).rowData.id=this.getArrayMgr("content").expandName(this._getCell(cells,x,y).rowData.id)),this._getCell(cells,x,y).rowData.class&&(this._getCell(cells,x,y).rowData.class=this.getArrayMgr("content").expandName(this._getCell(cells,x,y).rowData.class))}var widget=this.createElementFromNode(node,nodeName)}for(var i=0;span>i&&xy;y++){var x=0;et2_filteredNodeIterator(this.lastRowNode,readRowNode,this)}for(var name in this.getArrayMgrs())this.getArrayMgr(name).perspectiveData=currentPerspective},_expandLastCells:function(_cells){for(var h=_cells.length,w=h>0?_cells[0].length:0,y=0;h>y;y++)for(var x=w-1;x>=0;x--){var cell=_cells[y][x];if(null!=cell.widget){cell.autoColSpan&&(cell.colSpan=w-x);break}}for(var x=0;w>x;x++)for(var y=h-1;y>=0;y--){var cell=_cells[y][x];if(null!=cell.widget){cell.autoRowSpan&&(cell.rowSpan=h-y);break}}},loadFromXML:function(_node){this.template_node=_node;var rowsElems=et2_directChildrenByTagName(_node,"rows"),columnsElems=et2_directChildrenByTagName(_node,"columns");if(1!=rowsElems.length||1!=columnsElems.length)throw"Error while parsing grid, none or multiple rows or columns tags!";var columns=columnsElems[0],rows=rowsElems[0],colData=[],rowData=[];this._fetchRowColData(columns,rows,colData,rowData);var cells=this._initCells(colData,rowData);this._fillCells(cells,columns,rows),this._expandLastCells(cells),this.createTableFromCells(cells,colData,rowData)},createTableFromCells:function(_cells,_colData,_rowData){this.managementArray=[],this.cells=_cells,this.colData=_colData,this.rowData=_rowData;for(var h=this.rowCount=_cells.length,w=this.columnCount=h>0?_cells[0].length:0,y=0;h>y;y++){var parent=(_cells[y],this.tbody);switch(this.rowData[y].part){case"header":this.tbody.children().length||this.tfoot.children().length||(parent=this.thead);break;case"footer":this.tbody.children().length||(parent=this.tfoot)}var tr=$j(document.createElement("tr")).appendTo(parent).addClass(this.rowData[y].class);this.rowData[y].disabled&&tr.hide(),"auto"!=this.rowData[y].height&&tr.height(this.rowData[y].height),this.rowData[y].valign&&tr.attr("valign",this.rowData[y].valign),this.rowData[y].id&&tr.attr("id",this.rowData[y].id);for(var x=0;w>x;){var cell=this._getCell(_cells,x,y);if(null==cell.td&&null!=cell.widget){var td=$j(document.createElement("td")).appendTo(tr).addClass(cell.class);cell.disabled&&(td.hide(),cell.widget.options=cell.disabled),"auto"!=cell.width&&td.width(cell.width),cell.align&&td.attr("align",cell.align),this.managementArray.push({cell:td[0],widget:cell.widget,disabled:cell.disabled});var cs=x==w-1?w-x:Math.min(w-x,cell.colSpan),rs=y==h-1?h-y:Math.min(h-y,cell.rowSpan);cs>1&&td.attr("colspan",cs),rs>1&&td.attr("rowspan",rs);for(var sx=x;x+cs>sx;sx++)for(var sy=y;y+rs>sy;sy++)this._getCell(_cells,sx,sy).td=td;x+=cell.colSpan}else x++}}},getDOMNode:function(_sender){if(_sender==this||"undefined"==typeof _sender)return null!=this.wrapper?this.wrapper[0]:this.table[0];for(var i=0;i').parent(),this.height&&wrapper.css("height",this.height)),wrapper.css("overflow",_value),!wrapper.length||_value&&null!=_value&&"visible"!==_value||this.table.unwrap()},set_align:function(_value){this.align=_value},get_align:function(_value){return this.align},set_value:function(_value){for(var i=0;i=0;i--)this._children[i].free();for(var key in this._mgrs)this._mgrs[key]&&this._mgrs[key].owner==this&&this._mgrs[key].free()}})}.call(this),et2_placeholder=function(){"use strict";return et2_baseWidget.extend([et2_IDetachedDOM],{init:function(){this._super.apply(this,arguments),this.attrNodes={},this.visible=!1,this.placeDiv=$j(document.createElement("span")).addClass("et2_placeholder");var headerNode=$j(document.createElement("span")).text(this._type||"").addClass("et2_caption").appendTo(this.placeDiv),attrsCntr=$j(document.createElement("span")).appendTo(this.placeDiv).hide();headerNode.click(this,function(e){e.data.visible=!e.data.visible,e.data.visible?attrsCntr.show():attrsCntr.hide()});for(var key in this.options)"undefined"!=typeof this.options[key]&&("undefined"==typeof this.attrNodes[key]&&(this.attrNodes[key]=$j(document.createElement("span")).addClass("et2_attr"),attrsCntr.append(this.attrNodes[key])),this.attrNodes[key].text(key+"="+this.options[key]));this.setDOMNode(this.placeDiv[0])},getDetachedAttributes:function(_attrs){_attrs.push("value")},getDetachedNodes:function(){return[this.placeDiv[0]]},setDetachedAttributes:function(_nodes,_values){this.placeDiv=jQuery(_nodes[0])}})}.call(this),et2_box=function(){"use strict";return et2_baseWidget.extend([et2_IDetachedDOM],{attributes:{rows:{ignore:!0},cols:{ignore:!0}},createNamespace:!0,init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("et2_"+this._type).addClass("et2_box_widget"),this.setDOMNode(this.div[0])},loadFromXML:function(_node){if("box"!=this._type)return this._super.apply(this,arguments);for(var childIndex=0,repeatNode=null,i=0;i<_node.childNodes.length;i++){var node=_node.childNodes[i],widgetType=node.nodeName.toLowerCase();if("#comment"!=widgetType)if("#text"!=widgetType){var id=et2_readAttrWithDefault(node,"id","");id.indexOf("$")<0||"box"!=widgetType?(this.createElementFromNode(node),childIndex++):repeatNode=node}else node.data.replace(/^\s+|\s+$/g,"")&&this.loadContent(node.data)}if(null!=repeatNode){var currentPerspective=this.getArrayMgr("content").perspectiveData;for(childIndex;"undefined"!=typeof this.getArrayMgr("content").data[childIndex]&&this.getArrayMgr("content").data[childIndex];childIndex++){var mgrs=this.getArrayMgrs();for(var name in mgrs)this.getArrayMgr(name).getEntry(childIndex)&&(this.getArrayMgr(name).perspectiveData.row=childIndex);this.createElementFromNode(repeatNode)}for(var name in this.getArrayMgrs())this.getArrayMgr(name).perspectiveData=currentPerspective}},getDetachedAttributes:function(_attrs){_attrs.push("data")},getDetachedNodes:function(){return[this.getDOMNode()]},setDetachedAttributes:function(_nodes,_values){if(_values.data)for(var pairs=_values.data.split(/,/g),i=0;iMath.min(pos,A._max,splitter._DA-bar._DA-B._min)?bar.addClass(opts.barDockedClass).css(opts.origin,range):bar.removeClass(opts.barDockedClass).css(opts.origin,limit),bar._DA=bar[0][opts.pxSplit]):resplit(pos),setBarState(pos==limit?opts.barActiveClass:opts.barLimitClass)}function endSplitMouse(evt){setBarState(opts.barNormalClass),bar.addClass(opts.barHoverClass);var pos=A._posSplit+evt[opts.eventPos];opts.outline&&(zombie.remove(),zombie=null,resplit(pos)),panes.css("-webkit-user-select","text").find("iframe").andSelf().filter("iframe").removeClass(opts.iframeClass),$(document).unbind("mousemove"+opts.eventNamespace+" mouseup"+opts.eventNamespace)}function resplit(pos){bar._DA=bar[0][opts.pxSplit],opts.dockPane==A&&posMath.min(pos,A._max,splitter._DA-bar._DA-B._min)?(bar.addClass(opts.barDockedClass),bar._DA=bar[0][opts.pxSplit],pos=opts.dockPane==A?0:splitter._DA-bar._DA,null==bar._pos&&(bar._pos=A[0][opts.pxSplit])):(bar.removeClass(opts.barDockedClass),bar._DA=bar[0][opts.pxSplit],bar._pos=null,pos=Math.max(A._min,splitter._DA-B._max,Math.min(pos,A._max,splitter._DA-bar._DA-B._min))),bar.css(opts.origin,pos).css(opts.fixed,splitter._DF),A.css(opts.origin,0).css(opts.split,pos).css(opts.fixed,splitter._DF),B.css(opts.origin,pos+bar._DA).css(opts.split,splitter._DA-bar._DA-pos).css(opts.fixed,splitter._DF),panes.trigger("resize"+opts.eventNamespace)}function dimSum(jq,dims){for(var sum=0,i=1;i*",splitter[0]).addClass(opts.paneClass).css({position:"absolute","z-index":"1","-moz-outline-style":"none"}),A=$(panes[0]),B=$(panes[1]);opts.dockPane=opts.dock&&(/right|bottom/.test(opts.dock)?B:A);var focuser=$('').attr({accessKey:opts.accessKey,tabIndex:opts.tabIndex,title:opts.splitbarClass}).bind("focus"+opts.eventNamespace,function(){this.focus(),bar.addClass(opts.barActiveClass)}).bind("keydown"+opts.eventNamespace,function(e){var key=e.which||e.keyCode,dir=key==opts["key"+opts.side1]?1:key==opts["key"+opts.side2]?-1:0;dir&&resplit(A[0][opts.pxSplit]+dir*opts.pxPerKey,!1)}).bind("blur"+opts.eventNamespace,function(){bar.removeClass(opts.barActiveClass)}),bar=$("
    ").insertAfter(A).addClass(opts.barClass).addClass(opts.barStateClass).append(focuser).attr({unselectable:"on"}).css({position:"absolute","user-select":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","z-index":"100"}).bind("mousedown"+opts.eventNamespace,startSplitMouse).bind("mouseover"+opts.eventNamespace,function(){$(this).addClass(opts.barHoverClass)}).bind("mouseout"+opts.eventNamespace,function(){$(this).removeClass(opts.barHoverClass)});/^(auto|default|)$/.test(bar.css("cursor"))&&bar.css("cursor",opts.cursor),bar._DA=bar[0][opts.pxSplit],splitter._PBF=dimSum(splitter,"border"+opts.side3+"Width","border"+opts.side4+"Width"),splitter._PBA=dimSum(splitter,"border"+opts.side1+"Width","border"+opts.side2+"Width"),A._pane=opts.side1,B._pane=opts.side2,$.each([A,B],function(){this._splitter_style=this.style,this._min=opts["min"+this._pane]||dimSum(this,"min-"+opts.split),this._max=opts["max"+this._pane]||dimSum(this,"max-"+opts.split)||9999,this._init=opts["size"+this._pane]===!0?parseInt($.curCSS(this[0],opts.split),10):opts["size"+this._pane]});var initPos=A._init;isNaN(B._init)||(initPos=splitter[0][opts.pxSplit]-splitter._PBA-B._init-bar._DA),opts.cookie&&($.cookie||alert("jQuery.splitter(): jQuery cookie plugin required"),initPos=parseInt($.cookie(opts.cookie),10),$(window).bind("unload"+opts.eventNamespace,function(){var state=String(bar.css(opts.origin));$.cookie(opts.cookie,state,{expires:opts.cookieExpires||365,path:opts.cookiePath||document.location.pathname})})),isNaN(initPos)&&(initPos=Math.round((splitter[0][opts.pxSplit]-splitter._PBA-bar._DA)/2)),opts.anchorToWindow&&(opts.resizeTo=window),opts.resizeTo?(splitter._hadjust=dimSum(splitter,"borderTopWidth","borderBottomWidth","marginBottom"),splitter._hmin=Math.max(dimSum(splitter,"minHeight"),20),$(window).bind("resize"+opts.eventNamespace,function(){var top=splitter.offset().top,eh=$(opts.resizeTo).height();splitter.css("height",Math.max(eh-top-splitter._hadjust,splitter._hmin)+"px"),splitter.trigger("resize")}).trigger("resize"+opts.eventNamespace)):opts.resizeToWidth&&$(window).bind("resize"+opts.eventNamespace,function(){splitter.trigger("resize")}),opts.dock&&(splitter.bind("toggleDock"+opts.eventNamespace,function(){var pw=opts.dockPane[0][opts.pxSplit];splitter.trigger(pw?"dock":"undock")}).bind("dock"+opts.eventNamespace,function(){var pw=A[0][opts.pxSplit];if(pw&&!bar.hasClass("splitter-bar-horizontal-docked")&&!bar.hasClass("splitter-bar-vertical-docked")){bar._pos=pw;var x={};x[opts.origin]=opts.dockPane==A?0:splitter[0][opts.pxSplit]-splitter._PBA-bar[0][opts.pxSplit],bar.animate(x,opts.dockSpeed||1,opts.dockEasing,function(){bar.addClass(opts.barDockedClass),resplit(x[opts.origin]+1)})}}).bind("undock"+opts.eventNamespace,function(){var pw=opts.dockPane[0][opts.pxSplit];if(!pw){(null==bar._pos||Math.abs(bar._pos-splitter._DA-bar._DA)<20)&&(bar._pos=splitter._DA/2);var x={};x[opts.origin]=bar._pos+"px",bar.removeClass(opts.barDockedClass).animate(x,opts.undockSpeed||opts.dockSpeed||1,opts.undockEasing||opts.dockEasing,function(){resplit(bar._pos),bar._pos=null})}}),opts.dockKey&&$('').attr({accessKey:opts.dockKey,tabIndex:-1}).appendTo(bar).bind("focus",function(){splitter.trigger("toggleDock"),this.blur()}),bar.bind("dblclick",function(){splitter.trigger("toggleDock")})),splitter.bind("destroy"+opts.eventNamespace,function(){$([window,document]).unbind(opts.eventNamespace),bar.unbind().remove(),panes.removeClass(opts.paneClass),splitter.removeClass(opts.splitterClass).add(panes).unbind(opts.eventNamespace).attr("style",function(el){return this._splitter_style||""}),splitter=bar=focuser=panes=A=B=opts=args=null}).bind("resize"+opts.eventNamespace,function(e,size){e.target==this&&(splitter._DF=splitter[0][opts.pxFixed]-splitter._PBF,splitter._DA=splitter[0][opts.pxSplit]-splitter._PBA,splitter._DF<=0||splitter._DA<=0||(resplit(isNaN(size)?opts.sizeRight||opts.sizeBottom?splitter._DA-B[0][opts.pxSplit]-bar._DA:A[0][opts.pxSplit]:size),setBarState(opts.barNormalClass)))}).trigger("resize",[initPos])}})}}(jQuery);var et2_split=function(){"use strict";return et2_DOMWidget.extend([et2_IResizeable,et2_IPrint],{attributes:{orientation:{name:"Orientation",description:"Horizontal or vertical (v or h)",default:"v",type:"string"},outline:{name:"Outline",description:"Use a 'ghosted' copy of the splitbar and does not resize the panes until the mouse button is released. Reduces flickering or unwanted re-layout during resize",default:!1,type:"boolean"},dock_side:{name:"Dock",description:"Allow the user to 'Dock' the splitbar to one side of the splitter, essentially hiding one pane and using the entire splitter area for the other pane. One of leftDock, rightDock, topDock, bottomDock.",default:et2_no_init,type:"string"},width:{default:"100%"},overflow:{ignore:!0},no_lang:{ignore:!0},rows:{ignore:!0},cols:{ignore:!0}},DOCK_TOLERANCE:15,init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("et2_split"),this.dynheight=new et2_dynheight(this.getParent().getDOMNode()||this.getInstanceManager().DOMContainer,this.div,100),this.left=$j("
    Top / Left
    ").appendTo(this.div),this.right=$j("
    Bottom / Right
    ").appendTo(this.div),this.loading=jQuery.Deferred(),this.stop_resize=!1},destroy:function(){this.left.next().off("mouseup"),this.div.trigger("destroy"),this.dynheight.free(),this._super.apply(this,arguments),0==this._children.length&&this.div.empty(),this.div.remove()},loadFromXML:function(){this._super.apply(this,arguments),this._children.length>0&&(this._children[0]&&(this.left.detach(),this.left=$j(this._children[0].getDOMNode(this._children[0])).appendTo(this.div)),this._children[1]&&(this.right.detach(),this.right=$j(this._children[1].getDOMNode(this._children[1])).appendTo(this.div)));for(var i=0;i activates widget"},tabindex:{name:"Tab index",type:"integer",default:et2_no_init,description:"Specifies the tab order of a widget when the 'tab' button is used for navigating."},background_image:{name:"Add image in front of text",type:"boolean",description:"Adds image in front of text instead of just using an image with text as tooltip",default:et2_no_init},novalidate:{name:"Do NOT validate form",type:"boolean",description:"Do NOT validate form before submitting it",default:!1},needed:{ignore:!0}},legacyOptions:["image","ro_image"],init:function(){return this._super.apply(this,arguments),this.label="",this.clicked=!1,this.btn=null,this.image=null,this.options.background_image||!this.options.image&&!this.options.ro_image?(this.options.readonly||(this.btn=$j(document.createElement("button")).addClass("et2_button").attr({type:"button"}),this.setDOMNode(this.btn[0])),void(this.options.image&&this.set_image(this.options.image))):(this.image=jQuery(document.createElement("img")).addClass("et2_button et2_button_icon"),void this.setDOMNode(this.image[0]))},transformAttributes:function(_attrs){if(this.id&&"undefined"==typeof _attrs.background_image&&!_attrs.image)for(var image in et2_button.default_background_images)if(this.id.match(et2_button.default_background_images[image])){_attrs.image=image,_attrs.background_image=!0;break}for(var name in et2_button.default_classes)if(this.id.match(et2_button.default_classes[name])){_attrs.class=("undefined"==typeof _attrs.class?"":_attrs.class+" ")+name;break}this._super.apply(this,arguments)},set_accesskey:function(key){jQuery(this.node).attr("accesskey",key)},set_image:function(_image){this.options.image=_image,this.update_image()},set_ro_image:function(_image){this.options.ro_image=_image,this.update_image()},update_image:function(_image){if(this.isInTree()&&(this.options.background_image||null!=this.image)){"undefined"==typeof _image&&(_image=this.options.readonly?this.options.ro_image:this.options.image),_image.match(/^[0-9]+\%$/)&&(_image="");var found_image=!1;if(""!=_image){var src=this.egw().image(_image);src?found_image=!0:"/"!=_image[0]&&"http"!=_image.substr(0,4)||(src=image,found_image=!0),found_image&&(null!=this.image?this.image.attr("src",src):this.options.background_image&&(this.btn.css("background-image","url("+src+")"),this.btn.addClass("et2_button_with_image")))}found_image||(this.set_label(this.label),this.btn&&(this.btn.css("background-image",""),this.btn.removeClass("et2_button_with_image")))}},set_readonly:function(_ro){_ro!=this.options.readonly&&(this.options.readonly=_ro,this.image&&this.update_image(),(this.btn||this.image)&&(this.btn||this.image).toggleClass("et2_clickable",!_ro).toggleClass("et2_button_ro",_ro).css("cursor",_ro?"default":"pointer"))},attachToDOM:function(){this._super.apply(this,arguments),this.options.readonly&&(this.btn||this.image)&&(this.btn||this.image).removeClass("et2_clickable").addClass("et2_button_ro").css("cursor","default")},getDOMNode:function(){return this.btn?this.btn[0]:this.image?this.image[0]:null},click:function(_ev){return this.options.readonly?!1:(this.clicked=!0,this._super.apply(this,arguments)?("buttononly"!=this._type&&this.getInstanceManager().submit(this,!1,this.options.novalidate),this.clicked=!1,!0):(this.clicked=!1,!1))},set_label:function(_value){this.btn&&(this.label=_value,this.btn.text(_value),_value&&!this.image?this.btn.addClass("et2_button_text"):this.btn.removeClass("et2_button_text")),this.image&&(this.image.attr("alt",_value),this.options.statustext||this.image.attr("title",_value))},set_tabindex:function(index){jQuery(this.btn).attr("tabindex",index)},isDirty:function(){return!1},resetDirty:function(){},getValue:function(){return this.clicked?!0:null},isValid:function(){return!0},getDetachedAttributes:function(_attrs){_attrs.push("label","value","class","image","ro_image","onclick","background_image")},getDetachedNodes:function(){return[null!=this.btn?this.btn[0]:null,null!=this.image?this.image[0]:null]},setDetachedAttributes:function(_nodes,_values){this.btn="#"!=_nodes[0].nodeName[0]?jQuery(_nodes[0]):null,this.image=jQuery(_nodes[1]),"undefined"!=typeof _values.id&&this.set_id(_values.id),"undefined"!=typeof _values.label&&this.set_label(_values.label),"undefined"!=typeof _values.value,"undefined"!=typeof _values.image&&this.set_image(_values.image),"undefined"!=typeof _values.ro_image&&this.set_ro_image(_values.ro_image),"undefined"!=typeof _values.class&&this.set_class(_values.class),"undefined"!=typeof _values.onclick&&(this.options.onclick=_values.onclick);var type=this._type,attrs=jQuery.extend(_values,this.options),parent=this._parent;jQuery(this.getDOMNode()).bind("click.et2_baseWidget",this,function(e){var widget=et2_createWidget(type,attrs,parent);return e.data=widget,e.data.set_id(_values.id),e.data.click.call(e.data,e)})}})}.call(this);et2_register_widget(et2_button,["button","buttononly"]),jQuery.extend(et2_button,{default_background_images:{save:/save(&|\]|$)/,apply:/apply(&|\]|$)/,cancel:/cancel(&|\]|$)/,delete:/delete(&|\]|$)/,edit:/edit(&|\[\]|$)/,next:/(next|continue)(&|\]|$)/,finish:/finish(&|\]|$)/,back:/(back|previous)(&|\]|$)/,copy:/copy(&|\]|$)/,more:/more(&|\]|$)/,check:/(yes|check)(&|\]|$)/,cancelled:/no(&|\]|$)/,ok:/ok(&|\]|$)/,close:/close(&|\]|$)/,add:/(add(&|\]|$)|create)/},default_classes:{et2_button_cancel:/cancel(&|\]|$)/,et2_button_question:/(yes|no)(&|\]|$)/,et2_button_delete:/delete(&|\]|$)/}});var et2_valueWidget=function(){"use strict";return et2_baseWidget.extend({attributes:{label:{name:"Label",default:"",type:"string",description:"The label is displayed by default in front (for radiobuttons behind) each widget (if not empty). If you want to specify a different position, use a '%s' in the label, which gets replaced by the widget itself. Eg. '%s Name' to have the label Name behind a checkbox. The label can contain variables, as descript for name. If the label starts with a '@' it is replaced by the value of the content-array at this index (with the '@'-removed and after expanding the variables).",translate:!0},value:{name:"Value",description:"The value of the widget",type:"rawstring",default:et2_no_init}},transformAttributes:function(_attrs){if(this._super.apply(this,arguments),this.id){var contentMgr=this.getArrayMgr("content");if(null!=contentMgr){var val=contentMgr.getEntry(this.id,!1,!0);null!==val&&(_attrs.value=val)}this.createNamespace&&this.getArrayMgr("content").perspectiveData.owner==this&&(_attrs.value=this.getArrayMgr("content").data)}},set_label:function(_value){if(_value!=this.label){if(_value){null==this._labelContainer&&(this._labelContainer=$j(document.createElement("label")).addClass("et2_label"),this.getSurroundings().insertDOMNode(this._labelContainer[0])),this._labelContainer.empty();var ph=document.createElement("span");this.getSurroundings().setWidgetPlaceholder(ph);for(var parts=et2_csvSplit(_value,2,"%s"),i=0;ilocX?locX=0:locX>barW&&(locX=barW),0>locY?locY=0:locY>barH&&(locY=barH),val.call($this,"xy",{x:locX/barW*rangeX+minX,y:locY/barH*rangeY+minY})},draw=function(){var arrowOffsetX=0,arrowOffsetY=0,barW=bar.w,barH=bar.h,arrowW=arrow.w,arrowH=arrow.h;setTimeout(function(){rangeX>0&&(arrowOffsetX=x==maxX?barW:x/rangeX*barW|0),rangeY>0&&(arrowOffsetY=y==maxY?barH:y/rangeY*barH|0),arrowW>=barW?arrowOffsetX=(barW>>1)-(arrowW>>1):arrowOffsetX-=arrowW>>1,arrowH>=barH?arrowOffsetY=(barH>>1)-(arrowH>>1):arrowOffsetY-=arrowH>>1,arrow.css({left:arrowOffsetX+"px",top:arrowOffsetY+"px"})},0)},val=function(name,value,context){var set=void 0!==value;if(!set)switch(void 0!==name&&null!=name||(name="xy"),name.toLowerCase()){case"x":return x;case"y":return y;case"xy":default:return{x:x,y:y}}if(null==context||context!=$this){var newX,newY,changed=!1;switch(null==name&&(name="xy"),name.toLowerCase()){case"x":newX=value&&(value.x&&0|value.x||0|value)||0;break;case"y":newY=value&&(value.y&&0|value.y||0|value)||0;break;case"xy":default:newX=value&&value.x&&0|value.x||0,newY=value&&value.y&&0|value.y||0}null!=newX&&(minX>newX?newX=minX:newX>maxX&&(newX=maxX),x!=newX&&(x=newX,changed=!0)),null!=newY&&(minY>newY?newY=minY:newY>maxY&&(newY=maxY),y!=newY&&(y=newY,changed=!0)),changed&&fireChangeEvents.call($this,context||$this)}},range=function(name,value){var set=void 0!==value;if(!set)switch(void 0!==name&&null!=name||(name="all"),name.toLowerCase()){case"minx":return minX;case"maxx":return maxX;case"rangex":return{minX:minX,maxX:maxX,rangeX:rangeX};case"miny":return minY;case"maxy":return maxY;case"rangey":return{minY:minY,maxY:maxY,rangeY:rangeY};case"all":default:return{minX:minX,maxX:maxX,rangeX:rangeX,minY:minY,maxY:maxY,rangeY:rangeY}}var newMinX,newMaxX,newMinY,newMaxY;switch(null==name&&(name="all"),name.toLowerCase()){case"minx":newMinX=value&&(value.minX&&0|value.minX||0|value)||0;break;case"maxx":newMaxX=value&&(value.maxX&&0|value.maxX||0|value)||0;break;case"rangex":newMinX=value&&value.minX&&0|value.minX||0,newMaxX=value&&value.maxX&&0|value.maxX||0;break;case"miny":newMinY=value&&(value.minY&&0|value.minY||0|value)||0;break;case"maxy":newMaxY=value&&(value.maxY&&0|value.maxY||0|value)||0;break;case"rangey":newMinY=value&&value.minY&&0|value.minY||0,newMaxY=value&&value.maxY&&0|value.maxY||0;break;case"all":default:newMinX=value&&value.minX&&0|value.minX||0,newMaxX=value&&value.maxX&&0|value.maxX||0,newMinY=value&&value.minY&&0|value.minY||0,newMaxY=value&&value.maxY&&0|value.maxY||0}null!=newMinX&&minX!=newMinX&&(minX=newMinX,rangeX=maxX-minX),null!=newMaxX&&maxX!=newMaxX&&(maxX=newMaxX,rangeX=maxX-minX),null!=newMinY&&minY!=newMinY&&(minY=newMinY,rangeY=maxY-minY),null!=newMaxY&&maxY!=newMaxY&&(maxY=newMaxY,rangeY=maxY-minY)},bind=function(callback){$.isFunction(callback)&&changeEvents.push(callback)},unbind=function(callback){if($.isFunction(callback))for(var i;-1!=(i=$.inArray(callback,changeEvents));)changeEvents.splice(i,1)},destroy=function(){$(document).unbind("mouseup",mouseUp).unbind("mousemove",mouseMove),bar.unbind("mousedown",mouseDown),bar=null,arrow=null,changeEvents=null};$.extend(!0,$this,{val:val,range:range,bind:bind,unbind:unbind,destroy:destroy}),arrow.src=options.arrow&&options.arrow.image,arrow.w=options.arrow&&options.arrow.width||arrow.width(),arrow.h=options.arrow&&options.arrow.height||arrow.height(),bar.w=options.map&&options.map.width||bar.width(),bar.h=options.map&&options.map.height||bar.height(),bar.bind("mousedown",mouseDown),bind.call($this,draw)},ColorValuePicker=function(picker,color,bindedHex,alphaPrecision){var $this=this,inputs=picker.find("td.Text input"),red=inputs.eq(3),green=inputs.eq(4),blue=inputs.eq(5),alpha=inputs.length>7?inputs.eq(6):null,hue=inputs.eq(0),saturation=inputs.eq(1),value=inputs.eq(2),hex=inputs.eq(inputs.length>7?7:6),ahex=inputs.length>7?inputs.eq(8):null,keyDown=function(e){ +if(""!=e.target.value||e.target==hex.get(0)||(null==bindedHex||e.target==bindedHex.get(0))&&null!=bindedHex){if(!validateKey(e))return e;switch(e.target){case red.get(0):switch(e.keyCode){case 38:return red.val(setValueInRange.call($this,(red.val()<<0)+1,0,255)),color.val("r",red.val(),e.target),!1;case 40:return red.val(setValueInRange.call($this,(red.val()<<0)-1,0,255)),color.val("r",red.val(),e.target),!1}break;case green.get(0):switch(e.keyCode){case 38:return green.val(setValueInRange.call($this,(green.val()<<0)+1,0,255)),color.val("g",green.val(),e.target),!1;case 40:return green.val(setValueInRange.call($this,(green.val()<<0)-1,0,255)),color.val("g",green.val(),e.target),!1}break;case blue.get(0):switch(e.keyCode){case 38:return blue.val(setValueInRange.call($this,(blue.val()<<0)+1,0,255)),color.val("b",blue.val(),e.target),!1;case 40:return blue.val(setValueInRange.call($this,(blue.val()<<0)-1,0,255)),color.val("b",blue.val(),e.target),!1}break;case alpha&&alpha.get(0):switch(e.keyCode){case 38:return alpha.val(setValueInRange.call($this,parseFloat(alpha.val())+1,0,100)),color.val("a",Math.precision(255*alpha.val()/100,alphaPrecision),e.target),!1;case 40:return alpha.val(setValueInRange.call($this,parseFloat(alpha.val())-1,0,100)),color.val("a",Math.precision(255*alpha.val()/100,alphaPrecision),e.target),!1}break;case hue.get(0):switch(e.keyCode){case 38:return hue.val(setValueInRange.call($this,(hue.val()<<0)+1,0,360)),color.val("h",hue.val(),e.target),!1;case 40:return hue.val(setValueInRange.call($this,(hue.val()<<0)-1,0,360)),color.val("h",hue.val(),e.target),!1}break;case saturation.get(0):switch(e.keyCode){case 38:return saturation.val(setValueInRange.call($this,(saturation.val()<<0)+1,0,100)),color.val("s",saturation.val(),e.target),!1;case 40:return saturation.val(setValueInRange.call($this,(saturation.val()<<0)-1,0,100)),color.val("s",saturation.val(),e.target),!1}break;case value.get(0):switch(e.keyCode){case 38:return value.val(setValueInRange.call($this,(value.val()<<0)+1,0,100)),color.val("v",value.val(),e.target),!1;case 40:return value.val(setValueInRange.call($this,(value.val()<<0)-1,0,100)),color.val("v",value.val(),e.target),!1}}}},keyUp=function(e){if(""!=e.target.value||e.target==hex.get(0)||(null==bindedHex||e.target==bindedHex.get(0))&&null!=bindedHex){if(!validateKey(e))return e;switch(e.target){case red.get(0):red.val(setValueInRange.call($this,red.val(),0,255)),color.val("r",red.val(),e.target);break;case green.get(0):green.val(setValueInRange.call($this,green.val(),0,255)),color.val("g",green.val(),e.target);break;case blue.get(0):blue.val(setValueInRange.call($this,blue.val(),0,255)),color.val("b",blue.val(),e.target);break;case alpha&&alpha.get(0):alpha.val(setValueInRange.call($this,alpha.val(),0,100)),color.val("a",Math.precision(255*alpha.val()/100,alphaPrecision),e.target);break;case hue.get(0):hue.val(setValueInRange.call($this,hue.val(),0,360)),color.val("h",hue.val(),e.target);break;case saturation.get(0):saturation.val(setValueInRange.call($this,saturation.val(),0,100)),color.val("s",saturation.val(),e.target);break;case value.get(0):value.val(setValueInRange.call($this,value.val(),0,100)),color.val("v",value.val(),e.target);break;case hex.get(0):hex.val(hex.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6)),bindedHex&&bindedHex.val(hex.val()),color.val("hex",""!=hex.val()?hex.val():null,e.target);break;case bindedHex&&bindedHex.get(0):bindedHex.val(bindedHex.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6)),hex.val(bindedHex.val()),color.val("hex",""!=bindedHex.val()?bindedHex.val():null,e.target);break;case ahex&&ahex.get(0):ahex.val(ahex.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,2)),color.val("a",null!=ahex.val()?parseInt(ahex.val(),16):null,e.target)}}},blur=function(e){if(null!=color.val())switch(e.target){case red.get(0):red.val(color.val("r"));break;case green.get(0):green.val(color.val("g"));break;case blue.get(0):blue.val(color.val("b"));break;case alpha&&alpha.get(0):alpha.val(Math.precision(100*color.val("a")/255,alphaPrecision));break;case hue.get(0):hue.val(color.val("h"));break;case saturation.get(0):saturation.val(color.val("s"));break;case value.get(0):value.val(color.val("v"));break;case hex.get(0):case bindedHex&&bindedHex.get(0):hex.val(color.val("hex")),bindedHex&&bindedHex.val(color.val("hex"));break;case ahex&&ahex.get(0):ahex.val(color.val("ahex").substring(6))}},validateKey=function(e){switch(e.keyCode){case 9:case 16:case 29:case 37:case 39:return!1;case"c".charCodeAt():case"v".charCodeAt():if(e.ctrlKey)return!1}return!0},setValueInRange=function(value,min,max){return""==value||isNaN(value)?min:value>max?max:min>value?min:value},colorChanged=function(ui,context){var all=ui.val("all");context!=red.get(0)&&red.val(null!=all?all.r:""),context!=green.get(0)&&green.val(null!=all?all.g:""),context!=blue.get(0)&&blue.val(null!=all?all.b:""),alpha&&context!=alpha.get(0)&&alpha.val(null!=all?Math.precision(100*all.a/255,alphaPrecision):""),context!=hue.get(0)&&hue.val(null!=all?all.h:""),context!=saturation.get(0)&&saturation.val(null!=all?all.s:""),context!=value.get(0)&&value.val(null!=all?all.v:""),context!=hex.get(0)&&(bindedHex&&context!=bindedHex.get(0)||!bindedHex)&&hex.val(null!=all?all.hex:""),bindedHex&&context!=bindedHex.get(0)&&context!=hex.get(0)&&bindedHex.val(null!=all?all.hex:""),ahex&&context!=ahex.get(0)&&ahex.val(null!=all?all.ahex.substring(6):"")},destroy=function(){red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).unbind("keyup",keyUp).unbind("blur",blur),red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).unbind("keydown",keyDown),color.unbind(colorChanged),red=null,green=null,blue=null,alpha=null,hue=null,saturation=null,value=null,hex=null,ahex=null};$.extend(!0,$this,{destroy:destroy}),red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).bind("keyup",keyUp).bind("blur",blur),red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).bind("keydown",keyDown),color.bind(colorChanged)};$.jPicker={List:[],Color:function(init){var r,g,b,a,h,s,v,$this=this,changeEvents=new Array,fireChangeEvents=function(context){for(var i=0;i255&&(newV.r=255),r!=newV.r&&(r=newV.r,changed=!0);break;case"g":if(hsv)continue;rgb=!0,newV.g=value&&value.g&&0|value.g||value&&0|value||0,newV.g<0?newV.g=0:newV.g>255&&(newV.g=255),g!=newV.g&&(g=newV.g,changed=!0);break;case"b":if(hsv)continue;rgb=!0,newV.b=value&&value.b&&0|value.b||value&&0|value||0,newV.b<0?newV.b=0:newV.b>255&&(newV.b=255),b!=newV.b&&(b=newV.b,changed=!0);break;case"a":newV.a=value&&null!=value.a?0|value.a:null!=value?0|value:255,newV.a<0?newV.a=0:newV.a>255&&(newV.a=255),a!=newV.a&&(a=newV.a,changed=!0);break;case"h":if(rgb)continue;hsv=!0,newV.h=value&&value.h&&0|value.h||value&&0|value||0,newV.h<0?newV.h=0:newV.h>360&&(newV.h=360),h!=newV.h&&(h=newV.h,changed=!0);break;case"s":if(rgb)continue;hsv=!0,newV.s=value&&null!=value.s?0|value.s:null!=value?0|value:100,newV.s<0?newV.s=0:newV.s>100&&(newV.s=100),s!=newV.s&&(s=newV.s,changed=!0);break;case"v":if(rgb)continue;hsv=!0,newV.v=value&&null!=value.v?0|value.v:null!=value?0|value:100,newV.v<0?newV.v=0:newV.v>100&&(newV.v=100),v!=newV.v&&(v=newV.v,changed=!0)}if(changed){if(rgb){r=r||0,g=g||0,b=b||0;var ret=ColorMethods.rgbToHsv({r:r,g:g,b:b});h=ret.h,s=ret.s,v=ret.v}else if(hsv){h=h||0,s=null!=s?s:100,v=null!=v?v:100;var ret=ColorMethods.hsvToRgb({h:h,s:s,v:v});r=ret.r,g=ret.g,b=ret.b}a=null!=a?a:255,fireChangeEvents.call($this,context||$this)}}}},bind=function(callback){$.isFunction(callback)&&changeEvents.push(callback)},unbind=function(callback){if($.isFunction(callback))for(var i;-1!=(i=$.inArray(callback,changeEvents));)changeEvents.splice(i,1)},destroy=function(){changeEvents=null};$.extend(!0,$this,{val:val,bind:bind,unbind:unbind,destroy:destroy}),init&&(null!=init.ahex?val("ahex",init):null!=init.hex?val((null!=init.a?"a":"")+"hex",null!=init.a?{ahex:init.hex+ColorMethods.intToHex(init.a)}:init):null!=init.r&&null!=init.g&&null!=init.b?val("rgb"+(null!=init.a?"a":""),init):null!=init.h&&null!=init.s&&null!=init.v&&val("hsv"+(null!=init.a?"a":""),init))},ColorMethods:{hexToRgba:function(hex){if(hex=this.validateHex(hex),""==hex)return{r:null,g:null,b:null,a:null};var r="00",g="00",b="00",a="255";return 6==hex.length&&(hex+="ff"),hex.length>6?(r=hex.substring(0,2),g=hex.substring(2,4),b=hex.substring(4,6),a=hex.substring(6,hex.length)):(hex.length>4&&(r=hex.substring(4,hex.length),hex=hex.substring(0,4)),hex.length>2&&(g=hex.substring(2,hex.length),hex=hex.substring(0,2)),hex.length>0&&(b=hex.substring(0,hex.length))),{r:this.hexToInt(r),g:this.hexToInt(g),b:this.hexToInt(b),a:this.hexToInt(a)}},validateHex:function(hex){return hex=hex.toLowerCase().replace(/[^a-f0-9]/g,""),hex.length>8&&(hex=hex.substring(0,8)),hex},rgbaToHex:function(rgba){return this.intToHex(rgba.r)+this.intToHex(rgba.g)+this.intToHex(rgba.b)+this.intToHex(rgba.a)},intToHex:function(dec){var result=(0|dec).toString(16);return 1==result.length&&(result="0"+result),result.toLowerCase()},hexToInt:function(hex){return parseInt(hex,16)},rgbToHsv:function(rgb){var delta,r=rgb.r/255,g=rgb.g/255,b=rgb.b/255,hsv={h:0,s:0,v:0},min=0,max=0;return r>=g&&r>=b?(max=r,min=g>b?b:g):g>=b&&g>=r?(max=g,min=r>b?b:r):(max=b,min=g>r?r:g),hsv.v=max,hsv.s=max?(max-min)/max:0,hsv.s?(delta=max-min,r==max?hsv.h=(g-b)/delta:g==max?hsv.h=2+(b-r)/delta:hsv.h=4+(r-g)/delta,hsv.h=parseInt(60*hsv.h),hsv.h<0&&(hsv.h+=360)):hsv.h=0,hsv.s=100*hsv.s|0,hsv.v=100*hsv.v|0,hsv},hsvToRgb:function(hsv){var rgb={r:0,g:0,b:0,a:100},h=hsv.h,s=hsv.s,v=hsv.v;if(0==s)0==v?rgb.r=rgb.g=rgb.b=0:rgb.r=rgb.g=rgb.b=255*v/100|0;else{360==h&&(h=0),h/=60,s/=100,v/=100;var i=0|h,f=h-i,p=v*(1-s),q=v*(1-s*f),t=v*(1-s*(1-f));switch(i){case 0:rgb.r=v,rgb.g=t,rgb.b=p;break;case 1:rgb.r=q,rgb.g=v,rgb.b=p;break;case 2:rgb.r=p,rgb.g=v,rgb.b=t;break;case 3:rgb.r=p,rgb.g=q,rgb.b=v;break;case 4:rgb.r=t,rgb.g=p,rgb.b=v;break;case 5:rgb.r=v,rgb.g=p,rgb.b=q}rgb.r=255*rgb.r|0,rgb.g=255*rgb.g|0,rgb.b=255*rgb.b|0}return rgb}}};var Color=$.jPicker.Color,List=$.jPicker.List,ColorMethods=$.jPicker.ColorMethods;$.fn.jPicker=function(options){var $arguments=arguments;return this.each(function(){var $this=this,settings=$.extend(!0,{},$.fn.jPicker.defaults,options);"input"==$($this).get(0).nodeName.toLowerCase()&&($.extend(!0,settings,{window:{bindToInput:!0,expandable:!0,input:$($this)}}),""==$($this).val()?(settings.color.active=new Color({hex:null}),settings.color.current=new Color({hex:null})):ColorMethods.validateHex($($this).val())&&(settings.color.active=new Color({hex:$($this).val(),a:settings.color.active.val("a")}),settings.color.current=new Color({hex:$($this).val(),a:settings.color.active.val("a")}))),settings.window.expandable?$($this).after('    '):settings.window.liveUpdate=!1;var isLessThanIE7=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,container=null,colorMapDiv=null,colorBarDiv=null,colorMapL1=null,colorMapL2=null,colorMapL3=null,colorBarL1=null,colorBarL2=null,colorBarL3=null,colorBarL4=null,colorBarL5=null,colorBarL6=null,colorMap=null,colorBar=null,colorPicker=null,elementStartX=null,elementStartY=null,pageStartX=null,pageStartY=null,activePreview=null,currentPreview=null,okButton=null,cancelButton=null,grid=null,iconColor=null,iconAlpha=null,iconImage=null,moveBar=null,setColorMode=function(colorMode){var rgbMap,rgbBar,active=color.active,hex=(images.clientPath,active.val("hex"));switch(settings.color.mode=colorMode,colorMode){case"h":if(setTimeout(function(){setBG.call($this,colorMapDiv,"transparent"),setImgLoc.call($this,colorMapL1,0),setAlpha.call($this,colorMapL1,100),setImgLoc.call($this,colorMapL2,260),setAlpha.call($this,colorMapL2,100),setBG.call($this,colorBarDiv,"transparent"),setImgLoc.call($this,colorBarL1,0),setAlpha.call($this,colorBarL1,100),setImgLoc.call($this,colorBarL2,260),setAlpha.call($this,colorBarL2,100),setImgLoc.call($this,colorBarL3,260),setAlpha.call($this,colorBarL3,100),setImgLoc.call($this,colorBarL4,260),setAlpha.call($this,colorBarL4,100),setImgLoc.call($this,colorBarL6,260),setAlpha.call($this,colorBarL6,100)},0),colorMap.range("all",{minX:0,maxX:100,minY:0,maxY:100}),colorBar.range("rangeY",{minY:0,maxY:360}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("s"),y:100-active.val("v")},colorMap),colorBar.val("y",360-active.val("h"),colorBar);break;case"s":if(setTimeout(function(){setBG.call($this,colorMapDiv,"transparent"),setImgLoc.call($this,colorMapL1,-260),setImgLoc.call($this,colorMapL2,-520),setImgLoc.call($this,colorBarL1,-260),setImgLoc.call($this,colorBarL2,-520),setImgLoc.call($this,colorBarL6,260),setAlpha.call($this,colorBarL6,100)},0),colorMap.range("all",{minX:0,maxX:360,minY:0,maxY:100}),colorBar.range("rangeY",{minY:0,maxY:100}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("h"),y:100-active.val("v")},colorMap),colorBar.val("y",100-active.val("s"),colorBar);break;case"v":if(setTimeout(function(){setBG.call($this,colorMapDiv,"000000"),setImgLoc.call($this,colorMapL1,-780),setImgLoc.call($this,colorMapL2,260),setBG.call($this,colorBarDiv,hex),setImgLoc.call($this,colorBarL1,-520),setImgLoc.call($this,colorBarL2,260),setAlpha.call($this,colorBarL2,100),setImgLoc.call($this,colorBarL6,260),setAlpha.call($this,colorBarL6,100)},0),colorMap.range("all",{minX:0,maxX:360,minY:0,maxY:100}),colorBar.range("rangeY",{minY:0,maxY:100}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("h"),y:100-active.val("s")},colorMap),colorBar.val("y",100-active.val("v"),colorBar);break;case"r":if(rgbMap=-1040,rgbBar=-780,colorMap.range("all",{minX:0,maxX:255,minY:0,maxY:255}),colorBar.range("rangeY",{minY:0,maxY:255}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("b"),y:255-active.val("g")},colorMap),colorBar.val("y",255-active.val("r"),colorBar);break;case"g":if(rgbMap=-1560,rgbBar=-1820,colorMap.range("all",{minX:0,maxX:255,minY:0,maxY:255}),colorBar.range("rangeY",{minY:0,maxY:255}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("b"),y:255-active.val("r")},colorMap),colorBar.val("y",255-active.val("g"),colorBar);break;case"b":if(rgbMap=-2080,rgbBar=-2860,colorMap.range("all",{minX:0,maxX:255,minY:0,maxY:255}),colorBar.range("rangeY",{minY:0,maxY:255}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("r"),y:255-active.val("g")},colorMap),colorBar.val("y",255-active.val("b"),colorBar);break;case"a":if(setTimeout(function(){setBG.call($this,colorMapDiv,"transparent"),setImgLoc.call($this,colorMapL1,-260),setImgLoc.call($this,colorMapL2,-520),setImgLoc.call($this,colorBarL1,260),setImgLoc.call($this,colorBarL2,260),setAlpha.call($this,colorBarL2,100),setImgLoc.call($this,colorBarL6,0),setAlpha.call($this,colorBarL6,100)},0),colorMap.range("all",{minX:0,maxX:360,minY:0,maxY:100}),colorBar.range("rangeY",{minY:0,maxY:255}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("h"),y:100-active.val("v")},colorMap),colorBar.val("y",255-active.val("a"),colorBar);break;default:throw"Invalid Mode"}switch(colorMode){case"h":break;case"s":case"v":case"a":setTimeout(function(){setAlpha.call($this,colorMapL1,100),setAlpha.call($this,colorBarL1,100),setImgLoc.call($this,colorBarL3,260),setAlpha.call($this,colorBarL3,100),setImgLoc.call($this,colorBarL4,260),setAlpha.call($this,colorBarL4,100)},0);break;case"r":case"g":case"b":setTimeout(function(){setBG.call($this,colorMapDiv,"transparent"),setBG.call($this,colorBarDiv,"transparent"),setAlpha.call($this,colorBarL1,100),setAlpha.call($this,colorMapL1,100),setImgLoc.call($this,colorMapL1,rgbMap),setImgLoc.call($this,colorMapL2,rgbMap-260),setImgLoc.call($this,colorBarL1,rgbBar-780),setImgLoc.call($this,colorBarL2,rgbBar-520),setImgLoc.call($this,colorBarL3,rgbBar),setImgLoc.call($this,colorBarL4,rgbBar-260),setImgLoc.call($this,colorBarL6,260),setAlpha.call($this,colorBarL6,100)},0)}null!=active.val("ahex")&&activeColorChanged.call($this,active)},activeColorChanged=function(ui,context){(null==context||context!=colorBar&&context!=colorMap)&&positionMapAndBarArrows.call($this,ui,context),setTimeout(function(){updatePreview.call($this,ui),updateMapVisuals.call($this,ui),updateBarVisuals.call($this,ui)},0)},mapValueChanged=function(ui,context){var active=color.active;if(context==colorMap||null!=active.val()){var xy=ui.val("all");switch(settings.color.mode){case"h":active.val("sv",{s:xy.x,v:100-xy.y},context);break;case"s":case"a":active.val("hv",{h:xy.x,v:100-xy.y},context);break;case"v":active.val("hs",{h:xy.x,s:100-xy.y},context);break;case"r":active.val("gb",{g:255-xy.y,b:xy.x},context);break;case"g":active.val("rb",{r:255-xy.y,b:xy.x},context);break;case"b":active.val("rg",{r:xy.x,g:255-xy.y},context)}}},colorBarValueChanged=function(ui,context){var active=color.active;if(context==colorBar||null!=active.val())switch(settings.color.mode){case"h":active.val("h",{h:360-ui.val("y")},context);break;case"s":active.val("s",{s:100-ui.val("y")},context);break;case"v":active.val("v",{v:100-ui.val("y")},context);break;case"r":active.val("r",{r:255-ui.val("y")},context);break;case"g":active.val("g",{g:255-ui.val("y")},context);break;case"b":active.val("b",{b:255-ui.val("y")},context);break;case"a":active.val("a",255-ui.val("y"),context)}},positionMapAndBarArrows=function(ui,context){if(context!=colorMap)switch(settings.color.mode){case"h":var sv=ui.val("sv");colorMap.val("xy",{x:null!=sv?sv.s:100,y:100-(null!=sv?sv.v:100)},context);break;case"s":case"a":var hv=ui.val("hv");colorMap.val("xy",{x:hv&&hv.h||0,y:100-(null!=hv?hv.v:100)},context);break;case"v":var hs=ui.val("hs");colorMap.val("xy",{x:hs&&hs.h||0,y:100-(null!=hs?hs.s:100)},context);break;case"r":var bg=ui.val("bg");colorMap.val("xy",{x:bg&&bg.b||0,y:255-(bg&&bg.g||0)},context);break;case"g":var br=ui.val("br");colorMap.val("xy",{x:br&&br.b||0,y:255-(br&&br.r||0)},context);break;case"b":var rg=ui.val("rg");colorMap.val("xy",{x:rg&&rg.r||0,y:255-(rg&&rg.g||0)},context)}if(context!=colorBar)switch(settings.color.mode){case"h":colorBar.val("y",360-(ui.val("h")||0),context);break;case"s":var s=ui.val("s");colorBar.val("y",100-(null!=s?s:100),context);break;case"v":var v=ui.val("v");colorBar.val("y",100-(null!=v?v:100),context);break;case"r":colorBar.val("y",255-(ui.val("r")||0),context);break;case"g":colorBar.val("y",255-(ui.val("g")||0),context);break;case"b":colorBar.val("y",255-(ui.val("b")||0),context);break;case"a":var a=ui.val("a");colorBar.val("y",255-(null!=a?a:255),context)}},updatePreview=function(ui){try{var all=ui.val("all");activePreview.css({backgroundColor:all&&"#"+all.hex||"transparent"}),setAlpha.call($this,activePreview,all&&Math.precision(100*all.a/255,4)||0)}catch(e){}},updateMapVisuals=function(ui){switch(settings.color.mode){case"h":setBG.call($this,colorMapDiv,new Color({h:ui.val("h")||0,s:100,v:100}).val("hex"));break;case"s":case"a":var s=ui.val("s");setAlpha.call($this,colorMapL2,100-(null!=s?s:100));break;case"v":var v=ui.val("v");setAlpha.call($this,colorMapL1,null!=v?v:100);break;case"r":setAlpha.call($this,colorMapL2,Math.precision((ui.val("r")||0)/255*100,4));break;case"g":setAlpha.call($this,colorMapL2,Math.precision((ui.val("g")||0)/255*100,4));break;case"b":setAlpha.call($this,colorMapL2,Math.precision((ui.val("b")||0)/255*100))}var a=ui.val("a");setAlpha.call($this,colorMapL3,Math.precision(100*(255-(a||0))/255,4))},updateBarVisuals=function(ui){switch(settings.color.mode){case"h":var a=ui.val("a");setAlpha.call($this,colorBarL5,Math.precision(100*(255-(a||0))/255,4));break;case"s":var hva=ui.val("hva"),saturatedColor=new Color({h:hva&&hva.h||0,s:100,v:null!=hva?hva.v:100});setBG.call($this,colorBarDiv,saturatedColor.val("hex")),setAlpha.call($this,colorBarL2,100-(null!=hva?hva.v:100)),setAlpha.call($this,colorBarL5,Math.precision(100*(255-(hva&&hva.a||0))/255,4));break;case"v":var hsa=ui.val("hsa"),valueColor=new Color({h:hsa&&hsa.h||0,s:null!=hsa?hsa.s:100,v:100});setBG.call($this,colorBarDiv,valueColor.val("hex")),setAlpha.call($this,colorBarL5,Math.precision(100*(255-(hsa&&hsa.a||0))/255,4));break;case"r":case"g":case"b":var hValue=0,vValue=0,rgba=ui.val("rgba");"r"==settings.color.mode?(hValue=rgba&&rgba.b||0,vValue=rgba&&rgba.g||0):"g"==settings.color.mode?(hValue=rgba&&rgba.b||0,vValue=rgba&&rgba.r||0):"b"==settings.color.mode&&(hValue=rgba&&rgba.r||0,vValue=rgba&&rgba.g||0);var middle=vValue>hValue?hValue:vValue;setAlpha.call($this,colorBarL2,hValue>vValue?Math.precision((hValue-vValue)/(255-vValue)*100,4):0),setAlpha.call($this,colorBarL3,vValue>hValue?Math.precision((vValue-hValue)/(255-hValue)*100,4):0),setAlpha.call($this,colorBarL4,Math.precision(middle/255*100,4)),setAlpha.call($this,colorBarL5,Math.precision(100*(255-(rgba&&rgba.a||0))/255,4));break;case"a":var a=ui.val("a");setBG.call($this,colorBarDiv,ui.val("hex")||"000000"),setAlpha.call($this,colorBarL5,null!=a?0:100),setAlpha.call($this,colorBarL6,null!=a?100:0)}},setBG=function(el,c){el.css({backgroundColor:c&&6==c.length&&"#"+c||"transparent"})},setImg=function(img,src){!isLessThanIE7||-1==src.indexOf("AlphaBar.png")&&-1==src.indexOf("Bars.png")&&-1==src.indexOf("Maps.png")?img.css({backgroundImage:"url('"+src+"')"}):(img.attr("pngSrc",src),img.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')"}))},setImgLoc=function(img,y){img.css({top:y+"px"})},setAlpha=function(obj,alpha){if(obj.css({visibility:alpha>0?"visible":"hidden"}),alpha>0&&100>alpha)if(isLessThanIE7){var src=obj.attr("pngSrc");null==src||-1==src.indexOf("AlphaBar.png")&&-1==src.indexOf("Bars.png")&&-1==src.indexOf("Maps.png")?obj.css({opacity:Math.precision(alpha/100,4)}):obj.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+alpha+")"})}else obj.css({opacity:Math.precision(alpha/100,4)});else if(0==alpha||100==alpha)if(isLessThanIE7){var src=obj.attr("pngSrc");null==src||-1==src.indexOf("AlphaBar.png")&&-1==src.indexOf("Bars.png")&&-1==src.indexOf("Maps.png")?obj.css({opacity:""}):obj.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')"})}else obj.css({opacity:""})},revertColor=function(){color.active.val("ahex",color.current.val("ahex"))},commitColor=function(){color.current.val("ahex",color.active.val("ahex"))},radioClicked=function(e){$(this).parents("tbody:first").find('input:radio[value!="'+e.target.value+'"]').removeAttr("checked"),setColorMode.call($this,e.target.value)},currentClicked=function(){revertColor.call($this)},cancelClicked=function(){revertColor.call($this),settings.window.expandable&&hide.call($this),$.isFunction(cancelCallback)&&cancelCallback.call($this,color.active,cancelButton)},okClicked=function(){commitColor.call($this),settings.window.expandable&&hide.call($this),$.isFunction(commitCallback)&&commitCallback.call($this,color.active,okButton)},iconImageClicked=function(){show.call($this)},currentColorChanged=function(ui,context){var hex=ui.val("hex");currentPreview.css({backgroundColor:hex&&"#"+hex||"transparent"}),setAlpha.call($this,currentPreview,Math.precision(100*(ui.val("a")||0)/255,4))},expandableColorChanged=function(ui,context){var hex=ui.val("hex"),va=ui.val("va");iconColor.css({backgroundColor:hex&&"#"+hex||"transparent"}),setAlpha.call($this,iconAlpha,Math.precision(100*(255-(va&&va.a||0))/255,4)),settings.window.bindToInput&&settings.window.updateInputColor&&settings.window.input.css({backgroundColor:hex&&"#"+hex||"transparent",color:null==va||va.v>75?"#000000":"#ffffff"})},moveBarMouseDown=function(e){settings.window.element,settings.window.page;elementStartX=parseInt(container.css("left")),elementStartY=parseInt(container.css("top")),pageStartX=e.pageX,pageStartY=e.pageY,$(document).bind("mousemove",documentMouseMove).bind("mouseup",documentMouseUp),e.preventDefault()},documentMouseMove=function(e){return container.css({left:elementStartX-(pageStartX-e.pageX)+"px",top:elementStartY-(pageStartY-e.pageY)+"px"}),settings.window.expandable&&!$.support.boxModel&&container.prev().css({left:container.css("left"),top:container.css("top")}),e.stopPropagation(),e.preventDefault(),!1},documentMouseUp=function(e){return $(document).unbind("mousemove",documentMouseMove).unbind("mouseup",documentMouseUp),e.stopPropagation(),e.preventDefault(),!1},quickPickClicked=function(e){return e.preventDefault(),e.stopPropagation(),color.active.val("ahex",$(this).attr("title")||null,e.target),!1},commitCallback=$.isFunction($arguments[1])&&$arguments[1]||null,liveCallback=$.isFunction($arguments[2])&&$arguments[2]||null,cancelCallback=$.isFunction($arguments[3])&&$arguments[3]||null,show=function(){color.current.val("ahex",color.active.val("ahex"));var attachIFrame=function(){if(settings.window.expandable&&!$.support.boxModel){var table=container.find("table:first");container.before("");var f=document.frames[fid];f.document.open(),f.document.write(""),f.document.close(),f.fid=fid;var fwin=document.getElementById(fid);fwin.style.cssText="position:absolute;top:0;left:0;display:none;z-index:99999;",f.show=function(px,py,pw,ph,baseElement){py=py+baseElement.getBoundingClientRect().top+Math.max(document.body.scrollTop,document.documentElement.scrollTop),px=px+baseElement.getBoundingClientRect().left+Math.max(document.body.scrollLeft,document.documentElement.scrollLeft),fwin.style.width=pw+"px",fwin.style.height=ph+"px",fwin.style.posLeft=px,fwin.style.posTop=py,fwin.style.display="block"},f_hide=function(e){return window.event&&window.event.srcElement&&window.event.srcElement.tagName&&"select"==window.event.srcElement.tagName.toLowerCase()?!0:void(fwin.style.display="none")},f.hide=f_hide,document.attachEvent("onclick",f_hide),document.attachEvent("onkeydown",f_hide)}return f}}null==dropdown_menu_hack.menu&&(dropdown_menu_hack.menu=window.createPopup(),document.attachEvent("onkeydown",dropdown_menu_hack.menu.hide)),el.menu=dropdown_menu_hack.menu,el.contentOptions=new Array,el.contentIndex=el.selectedIndex,el.contentHTML=el.outerHTML;for(var i=0;i=selectBox.length&&(do_onchange||(selectBox.length&&""==selectBox.options[0].value&&(selectBox.options[0]=null),selectBox.multiple=!0,selectBox.size=4),selectBox.options[selectBox.length]=new Option(label,value,!1,!0)),selectBox.onchange&&do_onchange&&selectBox.onchange()}function _egw_json_escape_string(input){for(var len=input.length,res="",i=0;len>i;i++)switch(input.charAt(i)){case'"':res+='\\"';break;case"\n":res+="\\n";break;case"\r":res+="\\r";break;case"\\":res+="\\\\";break;case"/":res+="\\/";break;case"\b":res+="\\b";break;case"\f":res+="\\f";break;case" ":res+="\\t";break;default:res+=input.charAt(i)}return res}function _egw_json_encode_simple(input){switch(input.constructor){case String:return'"'+_egw_json_escape_string(input)+'"';case Number:return input.toString();case Boolean:return input?"true":"false";default:return null}}function egw_json_encode(input){return egw.debug("warn","Function %s is deprecated, use egw.jsonEncode() instead",arguments.callee.name),egw.jsonEncode(input)}function egw_json_register_plugin(_callback,_context){egw.debug("warn","Function %s is deprecated",arguments.callee.name),"undefined"==typeof _context&&(_context=window),_egw_json_plugins[_egw_json_plugins.length]={callback:_callback,context:_context}}function _egw_json_plugin_handle(_type,_response,_context){for(var i=0;i<_egw_json_plugins.length;i++)try{var plugin=_egw_json_plugins[i],context=plugin.context;if(plugin.context||"undefined"==typeof _context||(context=_context),plugin.callback.call(context,_type,_response))return!0}catch(e){"undefined"!=typeof console&&console.log(e)}return!1}function egw_json_request(_menuaction,_parameters,_context){egw.debug("warn","Function %s is deprecated",arguments.callee.name),this.context=window.document,"undefined"!=typeof _context&&(this.context=_context),"undefined"!=typeof _parameters?this.parameters=_parameters:this.parameters=new Array,_menuaction.match(/json.php\?menuaction=[a-z_0-9]*\.[a-z_0-9]*\.[a-z_0-9]*/i)?this.url=_menuaction:this.url=this._assembleAjaxUrl(_menuaction),this.request=null,this.sender=null,this.callback=null,this.alertHandler=this.alertFunc,this.onLoadFinish=null,this.loadedJSFiles={},this.handleResponseDone=!1,this.app=null,window.egw_alertHandler&&(this.alertHandler=window.egw_alertHandler)}function _egw_json_debug_log(_msg,_e){"undefined"!=typeof console&&"undefined"!=typeof console.log&&console.log(_msg,_e)}function egw_json_getFormValues(_form,_filterClass){egw.debug("warn","Function %s is deprecated",arguments.callee.name);var elem=null;elem="object"==typeof _form?_form:document.getElementsByName(_form)[0];var serialized=new Object;return"undefined"!=typeof elem&&elem&&elem.childNodes&&("undefined"==typeof _filterClass&&(_filterClass=null),_egw_json_getFormValues(serialized,elem.childNodes,_filterClass)),serialized}function _egw_json_getFormValues(serialized,children,_filterClass){egw.debug("warn","Function %s is deprecated",arguments.callee.name);for(var i=0;i=0){var n=name,k=n.substr(0,n.indexOf("[")),a=n.substr(n.indexOf("["));"undefined"==typeof serialized[k]&&(serialized[k]=new Object);for(var p=serialized;0!=a.length;){var sa=a.substr(0,a.indexOf("]")+1),lk=k,lp=p;a=a.substr(a.indexOf("]")+1),p=p[k],k=sa.substr(1,sa.length-2),""==k&&("select-multiple"==child.type?(k=lk,p=lp):k=_egw_json_getObjectLength(p)),"undefined"==typeof p[k]&&(p[k]=new Object)}p[k]=values}else"undefined"!=typeof values&&(serialized[name]=values)}}function dtmlXMLLoaderObject(a,b,c,d){return this.xmlDoc="",this.async="undefined"!=typeof c?c:!0,this.onloadAction=a||null,this.mainObject=b||null,this.waitCall=null,this.rSeed=d||!1,this}function callerFunction(a,b){return this.handler=function(c){return c||(c=window.event),a(c,b),!0}}function getAbsoluteLeft(a){return getOffset(a).left}function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){for(var b=0,c=0;a;)b+=parseInt(a.offsetTop),c+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:b,left:c}}function getOffsetRect(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,g=window.pageXOffset||d.scrollLeft||c.scrollLeft,f=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-f,k=b.left+g-h;return{top:Math.round(i),left:Math.round(k)}}function getOffset(a){return a.getBoundingClientRect?getOffsetRect(a):getOffsetSum(a)}function convertStringToBoolean(a){switch("string"==typeof a&&(a=a.toLowerCase()),a){case"1":case"true":case"yes":case"y":case 1:case!0:return!0;default:return!1}}function getUrlSymbol(a){return-1!=a.indexOf("?")?"&":"?"}function dhtmlDragAndDropObject(){return window.dhtmlDragAndDrop?window.dhtmlDragAndDrop:(this.dragStartObject=this.dragStartNode=this.dragNode=this.lastLanding=0,this.tempDOMM=this.tempDOMU=null,this.waitDrag=0,window.dhtmlDragAndDrop=this,this)}function j(){return this.catches||(this.catches=[]),this}function dhtmlXHeir(a,b){for(var c in b)"function"==typeof b[c]&&(a[c]=b[c]);return a}function dhtmlxEvent(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}function xmlPointer(data){this.d=data}function dhtmlXTreeObject(htmlObject,width,height,rootId){if(_isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e){}"object"!=typeof htmlObject?this.parentObject=document.getElementById(htmlObject):this.parentObject=htmlObject,this.parentObject.style.overflow="hidden",this._itim_dg=!0,this.dlmtr=",",this.dropLower=!1,this.enableIEImageFix(),this.xmlstate=0,this.mytype="tree",this.smcheck=!0,this.width=width,this.height=height,this.rootId=rootId,this.childCalc=null,this.def_img_x="18px",this.def_img_y="18px",this.def_line_img_x="18px",this.def_line_img_y="18px",this._dragged=new Array,this._selected=new Array,this.style_pointer="pointer",this._aimgs=!0,this.htmlcA=" [",this.htmlcB="]",this.lWin=window,this.cMenu=0,this.mlitems=0,this.iconURL="",this.dadmode=0,this.slowParse=!1,this.autoScroll=!0,this.hfMode=0,this.nodeCut=new Array,this.XMLsource=0,this.XMLloadingWarning=0,this._idpull={},this._pullSize=0,this.treeLinesOn=!0,this.tscheck=!1,this.timgen=!0,this.dpcpy=!1,this._ld_id=null,this._oie_onXLE=[],this.imPath=window.dhx_globalImgPath||"",this.checkArray=new Array("iconUncheckAll.gif","iconCheckAll.gif","iconCheckGray.gif","iconUncheckDis.gif","iconCheckDis.gif","iconCheckDis.gif"),this.radioArray=new Array("radio_off.gif","radio_on.gif","radio_on.gif","radio_off.gif","radio_on.gif","radio_on.gif"),this.lineArray=new Array("line2.gif","line3.gif","line4.gif","blank.gif","blank.gif","line1.gif"),this.minusArray=new Array("minus2.gif","minus3.gif","minus4.gif","minus.gif","minus5.gif"),this.plusArray=new Array("plus2.gif","plus3.gif","plus4.gif","plus.gif","plus5.gif"),this.imageArray=new Array("leaf.gif","folderOpen.gif","folderClosed.gif"),this.cutImg=new Array(0,0,0),this.cutImage="but_cut.gif",dhtmlxEventable(this),this.dragger=new dhtmlDragAndDropObject,this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this),this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none",this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow",this.allTree=this._createSelf(),this.allTree.appendChild(this.htmlNode.htmlNode),dhtmlx.$customScroll&&dhtmlx.CustomScroll.enable(this),_isFF&&(this.allTree.childNodes[0].width="100%",this.allTree.childNodes[0].style.overflow="hidden");var self=this;return this.allTree.onselectstart=new Function("return false;"),_isMacOS&&(this.allTree.oncontextmenu=function(e){return self._doContClick(e||window.event,!0)}),this.allTree.onmousedown=function(e){return self._doContClick(e||window.event)},this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,!0,this.no_cashe),_isIE&&this.preventIECashing(!0),window.addEventListener&&window.addEventListener("unload",function(){try{self.destructor()}catch(e){}},!1),window.attachEvent&&window.attachEvent("onunload",function(){try{self.destructor()}catch(e){}}),this.setImagesPath=this.setImagePath,this.setIconsPath=this.setIconPath,dhtmlx.image_path&&this.setImagePath(dhtmlx.image_path),dhtmlx.skin&&this.setSkin(dhtmlx.skin),this}function cObject(){return this}function dhtmlXTreeItemObject(itemId,itemText,parentObject,treeObject,actionHandler,mode){return this.htmlNode="",this.acolor="",this.scolor="",this.tr=0,this.childsCount=0,this.tempDOMM=0,this.tempDOMU=0,this.dragSpan=0,this.dragMove=0,this.span=0,this.closeble=1,this.childNodes=new Array,this.userData=new cObject,this.checkstate=0,this.treeNod=treeObject,this.label=itemText,this.parentObject=parentObject,this.actionHandler=actionHandler,this.images=new Array(treeObject.imageArray[0],treeObject.imageArray[1],treeObject.imageArray[2]),this.id=treeObject._globalIdStorageAdd(itemId,this),this.treeNod.checkBoxOff?this.htmlNode=this.treeNod._createItem(1,this,mode):this.htmlNode=this.treeNod._createItem(0,this,mode),this.htmlNode.objBelong=this,this}function jsonPointer(data,parent){this.d=data,this.dp=parent}function egwActionStoreJSON(_data,_obj,_setterOnly){for(var key in _data)"_"!=key.charAt(0)&&("function"==typeof _obj["set_"+key]?_obj["set_"+key](_data[key]):"undefined"==typeof _obj[key]||_setterOnly?"data"===_setterOnly&&("undefined"==typeof _data.data&&(_data.data={}),_data.data[key]=_data[key],_obj.set_data(_data.data)):_obj[key]=_data[key])}function egwSetBit(_set,_bit,_state){return _state?_set|=_bit:_set&=~_bit}function egwBitIsSet(_set,_bit){return(_set&_bit)>0}function egwObjectLength(_obj){var len=0;for(var k in _obj)len++;return len}function egwGetShiftState(e){var state=EGW_AO_SHIFT_STATE_NONE;return state=egwSetBit(state,EGW_AO_SHIFT_STATE_MULTI,e.ctrlKey||e.metaKey),state=egwSetBit(state,EGW_AO_SHIFT_STATE_BLOCK,e.shiftKey)}function egwPreventSelect(e){return egwGetShiftState(e)>EGW_AO_SHIFT_STATE_NONE?(this.onselectstart=function(){return!1},!1):!0}function egwResetPreventSelect(elem){}function egwUnfocus(){document.activeElement&&document.activeElement.blur()}function egwCallAbstract(_obj,_fn,_args){if(_fn)return _fn.apply(_obj,_args);throw"egw_action Exception: Abstract function call in JS code."}function egwArraysEqual(_ar1,_ar2){for(var result=_ar1.length==_ar2.length,i=0;i<_ar1.length;i++)result=result&&_ar1[i]==_ar2[i];return result}function egwQueueCallback(_proc,_args,_context,_id){if(_proc){var cur_id=0;cur_id="undefined"==typeof _egwQueuedCallbacks[_id]?_egwQueuedCallbacks[_id]=1:++_egwQueuedCallbacks[_id],window.setTimeout(function(){_egwQueuedCallbacks[_id]==cur_id&&(_proc.apply(_context,_args),delete _egwQueuedCallbacks[_id])},0)}}function egwEventQueue(){this.events={},this.key_id=0}function egwFnct(_context,_default,_acceptedTypes){"undefined"==typeof _context&&(_context=null),"undefined"==typeof _default&&(_default=!1),"undefined"==typeof _acceptedTypes&&(_acceptedTypes=["boolean"]),this.context=_context,this.acceptedTypes=_acceptedTypes,this.fnct=null,this.value=null,this.isDefault=!1,this.setValue(_default)}function egwIsMobile(){if(null==_egw_mobileBrowser){var ua=navigator.userAgent;_egw_mobileBrowser=ua.match(/iPhone/i)||ua.match(/iPad/i)||ua.match(/iPod/)||ua.match(/Android/i)||ua.match(/SymbianOS/i)}return _egw_mobileBrowser}function str_repeat(i,m){for(var o=[];m>0;o[--m]=i);return o.join("")}function sprintf(){for(var a,m,p,c,x,i=0,f=arguments[i++],o=[],s="";f;){if(m=/^[^\x25]+/.exec(f))o.push(m[0]);else if(m=/^\x25{2}/.exec(f))o.push("%");else{if(!(m=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)))throw'Invalid sprintf format "'+arguments[0]+'"';if(null==(a=arguments[m[1]||i++])||void 0==a)throw"Too few arguments.";if(/[^s]/.test(m[7])&&"number"!=typeof a)throw"Expecting number but found "+typeof a;switch(m[7]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a);break;case"e":a=m[6]?a.toExponential(m[6]):a.toExponential();break;case"f":a=m[6]?parseFloat(a).toFixed(m[6]):parseFloat(a);break;case"o":a="number"==typeof a?a.toString(8):JSON.stringify(a);break;case"s":a=(a=String(a))&&m[6]?a.substring(0,m[6]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}a=/[def]/.test(m[7])&&m[2]&&a>=0?"+"+a:a,c=m[3]?"0"==m[3]?"0":m[3].charAt(1):" ",x=m[5]-String(a).length-s.length,p=m[5]?str_repeat(c,x):"",o.push(s+(m[4]?a+p:p+a))}f=f.substring(m[0].length)}return o.join("")}function egw_getActionManager(_id,_create,_search_depth){"undefined"==typeof _create&&(_create=!0),"undefined"==typeof _search_depth&&(_search_depth=Number.MAX_VALUE);var res=egw_globalActionManager;return null==egw_globalActionManager&&(res=egw_globalActionManager=new egwActionManager),"undefined"!=typeof _id&&null!=_id&&(res=egw_globalActionManager.getActionById(_id,_search_depth),null==res&&_create&&(res=egw_globalActionManager.addAction("actionManager",_id))),res}function egw_getObjectManager(_id,_create,_search_depth){"undefined"==typeof _create&&(_create=!0),"undefined"==typeof _search_depth&&(_search_depth=Number.MAX_VALUE);var res=egw_globalObjectManager;return null==res&&(res=egw_globalObjectManager=new egwActionObjectManager("_egwGlobalObjectManager",egw_getActionManager())),"undefined"!=typeof _id&&null!=_id&&(res=egw_globalObjectManager.getObjectById(_id,_search_depth),null==res&&_create&&(res=new egwActionObjectManager(_id,egw_getActionManager(_id,!0,_search_depth)),egw_globalObjectManager.addObject(res))),res}function egw_getAppObjectManager(_create){return egw_getObjectManager(egw_getAppName(),_create,1)}function egw_getAppActionManager(_create){return egw_getActionManager(egw_getAppName(),_create,1)}function egwActionHandler(_executeEvent){this.execute=_executeEvent}function egwAction(_parent,_id,_caption,_iconUrl,_onExecute,_allowOnMultiple){if(_parent&&("string"!=typeof _id||!_id)&&"actionManager"!=_parent.type)throw"egwAction _id must be a non-empty string!";"undefined"==typeof _caption&&(_caption=""),"undefined"==typeof _iconUrl&&(_iconUrl=""),"undefined"==typeof _onExecute&&(_onExecute=null),"undefined"==typeof _allowOnMultiple&&(_allowOnMultiple=!0),this.id=_id,this.caption=_caption,this.iconUrl=_iconUrl,this.allowOnMultiple=_allowOnMultiple,this.enabled=new egwFnct(this,!0),this.hideOnDisabled=!1,this.data={},this.type="default",this.canHaveChildren=!1,this.parent=_parent,this.children=[],this.onExecute=new egwFnct(this,null,[]),null!==_onExecute&&this.set_onExecute(_onExecute),this.hideOnMobile=!1}function _egwActionTreeContains(_tree,_elem){for(var i=0;i<_tree.length;i++){if(_tree[i].action==_elem)return _tree[i];if("undefined"!=typeof _tree[i].children){var elem=_egwActionTreeContains(_tree[i].children,_elem);if(elem)return elem}}return null}function egwActionManager(_parent,_id){"undefined"==typeof _parent&&(_parent=null),"undefined"==typeof _id&&(_id=!1);var action=new egwAction(_parent,_id);return action.type="actionManager",action.canHaveChildren=!0,action}function egwActionImplementation(){this.doRegisterAction=function(){throw"Abstract function call: registerAction"},this.doUnregisterAction=function(){throw"Abstract function call: unregisterAction"},this.doExecuteImplementation=function(){throw"Abstract function call: executeImplementation"},this.type=""}function egwActionLink(_manager){this.enabled=!0,this.visible=!0,this.actionId="",this.actionObj=null,this.manager=_manager}function egwActionObject(_id,_parent,_iface,_manager,_flags){"undefined"==typeof _manager&&"object"==typeof _parent&&_parent&&(_manager=_parent.manager),"undefined"==typeof _flags&&(_flags=0),this.id=_id,this.parent=_parent,this.children=[],this.actionLinks=[],this.manager=_manager,this.flags=_flags,this.data=null,this.setSelectedCallback=null,this.registeredImpls=[],this.selectedChildren=[],this.focusedChild=null,this.setAOI(_iface)}function egwActionObjectInterface(){this.doGetDOMNode=function(){return null},this.doSetState=function(_state,_outerCall){},this.doTriggerEvent=function(_event,_data){return!1},this.doMakeVisible=function(){},this._state=EGW_AO_STATE_NORMAL||EGW_AO_STATE_VISIBLE,this.stateChangeCallback=null,this.stateChangeContext=null,this.reconnectActionsCallback=null,this.reconnectActionsContext=null}function egwActionObjectManager(_id,_manager){var ao=new egwActionObject(_id,null,new egwActionObjectInterface,_manager,EGW_AO_FLAG_IS_CONTAINER);return ao.triggerCallback=function(){return!1},ao}function egw_keycode_makeValid(_keyCode){var idx=EGW_VALID_KEYS.indexOf(_keyCode);return idx>=0?_keyCode:-1}function _egw_nodeIsInInput(_node){if(null!=_node&&_node!=document){var tagName=_node.tagName.toLowerCase();return"input"==tagName||"select"==tagName||"textarea"==tagName||"button"==tagName?!0:_egw_nodeIsInInput(_node.parentNode)}return!1}function egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt){return"_"+_keyCode+"_"+(_shift?"S":"")+(_ctrl?"C":"")+(_alt?"A":"")}function egw_registerGlobalShortcut(_keyCode,_shift,_ctrl,_alt,_handler,_context){var idx=egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt);egw_registeredShortcuts[idx]={handler:_handler,context:_context,shortcut:{keyCode:_keyCode,shift:_shift,ctrl:_ctrl,alt:_alt}}}function egw_unregisterGlobalShortcut(_keyCode,_shift,_ctrl,_alt){var idx=egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt);delete egw_registeredShortcuts[idx]}function egw_keyHandler(_keyCode,_shift,_ctrl,_alt){var idx=egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt);if("undefined"!=typeof egw_registeredShortcuts[idx]){var shortcut=egw_registeredShortcuts[idx],result=shortcut.handler.call(shortcut.context,shortcut.shortcut);if(result)return result}var appMgr=egw_getAppObjectManager(!1);if(appMgr){var focusedObject=appMgr.getFocusedObject();if(!focusedObject){for(var cntr=null,i=0;i0&&(cntr.children[0].setFocused(!0),focusedObject=cntr.children[0])}if(focusedObject){var cntr=focusedObject.getContainerRoot(),handled=!1;return cntr&&(handled=cntr.handleKeyPress(_keyCode,_shift,_ctrl,_alt)),handled?handled:focusedObject.executeActionImplementation({keyEvent:{keyCode:_keyCode,shift:_shift,ctrl:_ctrl,alt:_alt}},"popup",EGW_AO_EXEC_SELECTED)}}return!1}function _egwGenMenuItem(_parent,_id,_caption,_iconUrl,_onClick){"undefined"==typeof _parent&&(_parent=null),"undefined"==typeof _id&&(_id=""),"undefined"==typeof _caption&&(_caption=""),"undefined"==typeof _iconUrl&&(_iconUrl=""),"undefined"==typeof _onClick&&(_onClick=null);var item=new egwMenuItem(_parent,_id);return item.set_caption(_caption),item.set_iconUrl(_iconUrl),item.set_onClick(_onClick),item}function _egwGenMenuStructure(_elements,_parent){for(var items=[],i=0;i<_elements.length;i++){var obj=_elements[i],item=new egwMenuItem(_parent,null);for(var key in obj)"children"==key&&obj[key].constructor===Array?item.children=_egwGenMenuStructure(obj[key],item):"id"!=key&&"caption"!=key&&"iconUrl"!=key&&"checkbox"!=key&&"checked"!=key&&"groupIndex"!=key&&"enabled"!=key&&"default"!=key&&"onClick"!=key&&"hint"!=key&&"shortcutCaption"!=key||item["set_"+key](obj[key]);items.push(item)}return items}function _egwSearchMenuItem(_elements,_id){for(var i=0;i<_elements.length;i++){if(_elements[i].id===_id)return _elements[i];var item=_egwSearchMenuItem(_elements[i].children,_id);if(item)return item}return null}function _egwSetMenuOnClick(_elements,_onClick){for(var i=0;i<_elements.length;i++)null===_elements[i].onClick&&(_elements[i].onClick=_onClick),_egwSetMenuOnClick(_elements[i].children,_onClick)}function egwMenu(){this.children=[],this.instance=null}function egwMenuItem(_parent,_id){this.id=_id,this.caption="",this.checkbox=!1,this.checked=!1,this.groupIndex=0,this.enabled=!0,this.iconUrl="",this.onClick=null,this.default=!1,this.data=null,this.shortcutCaption=null,this.children=[],this.parent=_parent}function egwPopupAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple){var action=new egwAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple);return action.type="popup",action.canHaveChildren=["popup"],action.default=!1,action.order=0,action.group=0,action.hint=!1,action.checkbox=!1,action.radioGroup=0,action.checked=!1,action.shortcut=null,action.set_default=function(_value){action.default=_value},action.set_order=function(_value){action.order=_value},action.set_group=function(_value){action.group=_value},action.set_hint=function(_value){action.hint=_value},action.set_checkbox=function(_value){action.checkbox=_value},action.set_checked=function(_value){action.checked=_value},action.set_radioGroup=function(_value){action.radioGroup=_value},action.set_shortcut=function(_value){if(_value){var sc={keyCode:-1,shift:!1,ctrl:!1,alt:!1};"object"==typeof _value&&"undefined"!=typeof _value.keyCode&&"undefined"!=typeof _value.caption&&(sc.keyCode=_value.keyCode,sc.caption=_value.caption,sc.shift="undefined"==typeof _value.shift?!1:_value.shift,sc.ctrl="undefined"==typeof _value.ctrl?!1:_value.ctrl,sc.alt="undefined"==typeof _value.alt?!1:_value.alt),this.shortcut=sc}else this.shortcut=!1},action}function getPopupImplementation(){return _popupActionImpl||(_popupActionImpl=new egwPopupActionImplementation),_popupActionImpl}function egwPopupActionImplementation(){var ai=new egwActionImplementation;return ai.type="popup",ai.auto_paste=!0,ai._registerDefault=function(_node,_callback,_context){var defaultHandler=function(e){if(egwIsMobile&&"A"==e.target.tagName)return!0;if("undefined"!=typeof document.selection&&"undefined"!=typeof document.selection.empty)document.selection.empty();else if("undefined"!=typeof window.getSelection){var sel=window.getSelection();sel.removeAllRanges()}return _callback.call(_context,"default",ai),e.stopPropagation(),e.cancelBubble=!0,_egw_active_menu&&1==e.which&&_egw_active_menu.hide(),!1};egwIsMobile()?$j(_node).bind("click",defaultHandler):_node.ondblclick=defaultHandler},ai._getDefaultLink=function(_links){var defaultAction=null;for(var k in _links)if(_links[k].actionObj.default&&_links[k].enabled){ +defaultAction=_links[k].actionObj;break}return defaultAction},ai._searchShortcut=function(_key,_objs,_links){for(var i=0;i<_objs.length;i++){var sc=_objs[i].shortcut;if(sc&&sc.keyCode==_key.keyCode&&sc.shift==_key.shift&&sc.ctrl==_key.ctrl&&sc.alt==_key.alt&&"popup"==_objs[i].type&&("undefined"==typeof _links[_objs[i].id]||_links[_objs[i].id].enabled))return _objs[i];var obj=this._searchShortcut(_key,_objs[i].children,_links);if(obj)return obj}},ai._searchShortcutInLinks=function(_key,_links){var objs=[];for(var k in _links)_links[k].enabled&&objs.push(_links[k].actionObj);return ai._searchShortcut(_key,objs,_links)},ai._handleKeyPress=function(_key,_selected,_links,_target){if(_key.keyCode==EGW_KEY_ENTER&&!_key.ctrl&&!_key.shift&&!_key.alt){var defaultAction=this._getDefaultLink(_links);if(defaultAction)return defaultAction.execute(_selected),!0}if(_key.keyCode==EGW_KEY_MENU&&!_key.ctrl)return this.doExecuteImplementation({posx:0,posy:0},_selected,_links,_target);var obj=this._searchShortcutInLinks(_key,_links);return obj?(obj.execute(_selected),!0):!1},ai._registerContext=function(_node,_callback,_context){var contextHandler=function(e){if(egwIsMobile()&&(3==e.originalEvent.which,jQuery(".nm-mob-header .nm_action_header").toggleClass("back",_egw_active_menu)),e||(e=window.event),_egw_active_menu)_egw_active_menu.hide();else if(!e.ctrlKey&&3==e.which||0===e.which){var _xy=ai._getPageXY(e),_implContext={event:e,posx:_xy.posx,posy:_xy.posy};_callback.call(_context,_implContext,ai)}return e.cancelBubble=!e.ctrlKey||1==e.which,e.stopPropagation&&e.cancelBubble&&e.stopPropagation(),!e.cancelBubble};$j(_node).on("contextmenu",contextHandler)},ai.doRegisterAction=function(_aoi,_callback,_context){var node=_aoi.getDOMNode();return node?(this._registerDefault(node,_callback,_context),this._registerContext(node,_callback,_context),!0):!1},ai.doUnregisterAction=function(_aoi){},ai.doExecuteImplementation=function(_context,_selected,_links,_target){if("undefined"==typeof _target&&(_target=null),ai._context=_context,"object"==typeof _context&&"object"==typeof _context.keyEvent)return ai._handleKeyPress(_context.keyEvent,_selected,_links,_target);if("default"!=_context){if(("number"!=typeof _context.posx||"number"!=typeof _context.posy)&&"undefined"!=typeof _context.id){var node=_context;x=$j(node).offset().left,y=$j(node).offset().top,_context={posx:x,posy:y}}var menu=ai._buildMenu(_links,_selected,_target);return menu.showAt(_context.posx,_context.posy),!0}var defaultAction=ai._getDefaultLink(_links);return defaultAction&&defaultAction.execute(_selected),!1},ai._groupLayers=function(_layer,_links,_parentGroup){for(var link_groups={},i=0;i<_layer.children.length;i++){var actionObj=_layer.children[i].action,grp=actionObj.group;"undefined"==typeof link_groups[grp]&&(link_groups[grp]=[]);var visible=!0,enabled=!0;"undefined"!=typeof _links[actionObj.id]&&(visible=_links[actionObj.id].visible,enabled=_links[actionObj.id].enabled);for(var inserted=!1,groupObj={actionObj:actionObj,visible:visible,enabled:enabled,groups:[]},j=0;jactionObj.order){inserted=!0,link_groups[grp].splice(j,0,groupObj);break}}inserted||link_groups[grp].push(groupObj),_layer.children[i].children.length>0&&this._groupLayers(_layer.children[i],_links,groupObj)}var groups=[];for(var k in link_groups)groups.push({grp:k,links:link_groups[k]});groups.sort(function(a,b){var ia=parseInt(a.grp),ib=parseInt(b.grp);return ia>ib?1:ib>ia?-1:0});for(var groups2=[],i=0;i0&&this._groupLayers(tree.root[0],_links,groups);var menu=new egwMenu;return this._buildMenuLayer(menu,groups.groups,_selected,!0,_target),menu},ai._getPageXY=function(event){var scrollTop=document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop,scrollLeft=document.body.scrollLeft?document.body.scrollLeft:document.documentElement.scrollLeft;return{posx:event.clientX+scrollLeft,posy:event.clientY+scrollTop}},ai._addCopyPaste=function(_links,_selected){var drag=_selected[0].getSelectedLinks("drag").links,drop=_selected[0].getSelectedLinks("drop").links;if(drag&&!jQuery.isEmptyObject(drag)||drop&&!jQuery.isEmptyObject(drop)){var mgr=_selected[0].manager,copy_action=mgr.getActionById("egw_copy"),add_action=mgr.getActionById("egw_copy_add"),clipboard_action=mgr.getActionById("egw_os_clipboard"),paste_action=mgr.getActionById("egw_paste");if(this._context.event){var ui={position:{top:0,left:0},offset:{top:0,left:0}},event=this._context.event.originalEvent;ui.position={top:event.pageY,left:event.pageX},ui.offset={top:event.offsetY,left:event.offsetX}}if(drag&&!jQuery.isEmptyObject(drag)){null==copy_action&&(copy_action=mgr.addAction("popup","egw_copy",egw.lang("Copy to clipboard"),egw.image("copy"),function(action,selected){var clipboard={type:[],selected:[]};for(var k in drag)drag[k].enabled&&drag[k].actionObj.dragType.length>0&&(clipboard.type=clipboard.type.concat(drag[k].actionObj.dragType));clipboard.type=jQuery.unique(clipboard.type);for(var k in selected)selected[k].id&&clipboard.selected.push({id:selected[k].id,data:selected[k].data});egw.setSessionItem("phpgwapi","egw_clipboard",JSON.stringify(clipboard))},!0),copy_action.group=2.5),null==add_action&&(add_action=mgr.addAction("popup","egw_copy_add",egw.lang("Add to clipboard"),egw.image("copy"),function(action,selected){var clipboard=JSON.parse(egw.getSessionItem("phpgwapi","egw_clipboard"))||{type:[],selected:[]};for(var k in drag)drag[k].enabled&&drag[k].actionObj.dragType.length>0&&(clipboard.type=clipboard.type.concat(drag[k].actionObj.dragType));clipboard.type=jQuery.unique(clipboard.type);for(var k in selected)selected[k].id&&clipboard.selected.push({id:selected[k].id,data:selected[k].data});egw.setSessionItem("phpgwapi","egw_clipboard",JSON.stringify(clipboard))},!0),add_action.group=2.5),null==clipboard_action&&(clipboard_action=mgr.addAction("popup","egw_os_clipboard",egw.lang("Copy to OS clipboard"),egw.image("copy"),function(action){document.queryCommandSupported("copy")&&$j(action.data.target).trigger("copy")},!0),clipboard_action.group=2.5);var os_clipboard_caption=this._context.event.originalEvent.target.innerHTML.trim();clipboard_action.set_caption(egw.lang('Copy "%1"',os_clipboard_caption.length>20?os_clipboard_caption.substring(0,20)+"...":os_clipboard_caption)),clipboard_action.data.target=this._context.event.originalEvent.target,$j(clipboard_action.data.target).off("copy").on("copy",function(event){var target=$j(clipboard_action.data.target),old_select=target.css("user-select");target.css("user-select","all");var range=document.createRange();range.selectNode(clipboard_action.data.target),window.getSelection().removeAllRanges(),window.getSelection().addRange(range),target.css("user-select",old_select);var successful=!1;try{"undefined"!=typeof event.target.setActive&&window.clipboardData&&window.clipboardData.setData("Text",$j(clipboard_action.data.target).text().trim()),event.clipboardData&&(event.clipboardData.setData("text/plain",$j(clipboard_action.data.target).text().trim()),event.clipboardData.setData("text/html",$j(clipboard_action.data.target).html())),egw.message(egw.lang("Use Ctrl-C/Cmd-C to copy")),successful=document.execCommand("copy")}catch(err){}return successful?(egw.message(""),window.getSelection().removeAllRanges(),target.css("user-select",old_select),!1):void 0}),"undefined"==typeof _links[copy_action.id]&&(_links[copy_action.id]={actionObj:copy_action,enabled:!0,visible:!0,cnt:0}),"undefined"==typeof _links[add_action.id]&&(_links[add_action.id]={actionObj:add_action,enabled:!0,visible:!0,cnt:0}),"undefined"==typeof _links[clipboard_action.id]&&(_links[clipboard_action.id]={actionObj:clipboard_action,enabled:os_clipboard_caption.length>0,visible:os_clipboard_caption.length>0,cnt:0})}if(drop&&!jQuery.isEmptyObject(drop)){var paste_exec=function(action,selected){var clipboard=JSON.parse(egw.getSessionItem("phpgwapi","egw_clipboard"));drop[action.id].actionObj.ui=ui,drop[action.id].actionObj.paste=!0,drop[action.id].actionObj.execute(clipboard.selected,selected[0]),drop[action.id].actionObj.paste=!1},clipboard=JSON.parse(egw.getSessionItem("phpgwapi","egw_clipboard"))||{type:[],selected:[]};null==paste_action&&(paste_action=mgr.addAction("popup","egw_paste",egw.lang("Paste"),egw.image("editpaste"),paste_exec,!0),paste_action.group=2.5,paste_action.order=9,paste_action.canHaveChildren.push("drop"));var hint=egw.lang("Clipboard")+":\n["+clipboard.type.join(",")+"]\n";paste_action.set_hint(hint);for(var i=0;i0;)paste_action.children[0].remove();if(null==clipboard||"object"!=typeof clipboard.type)return;for(var k in drop){var drop_clone=jQuery.extend({},drop[k].actionObj);drop_clone.parent=paste_action,drop_clone.onExecute=new egwFnct(this,null,[]),drop_clone.set_onExecute(paste_exec),paste_action.children.push(drop_clone),paste_action.allowOnMultiple=paste_action.allowOnMultiple&&drop_clone.allowOnMultiple,_links[k]=jQuery.extend({},drop[k]),_links[k].actionObj=drop_clone,_links[k].enabled=!1,_links[k].visible=!1;for(var i=0;i1?"entries":"entry")||egw.app_name()),index=0,i=0;i<_selected.length;i++){var row=$j(_selected[i].iface.getDOMNode()).clone();if(row&&(rows.push(row),table.append(row)),index++,index==maxRows){var spanCnt=$j(document.createElement("span")).addClass("et2_egw_action_ddHelper_itemsCnt").appendTo(div);spanCnt.text(_selected.length+" "+itemLabel);var restRows=_selected.length-maxRows;restRows&&moreRow.text(_selected.length-maxRows+" "+egw.lang("more %1 selected ...",itemLabel)),table.append(moreRow);break}}var text=$j(document.createElement("div")).addClass("et2_egw_action_ddHelper_tip");if(div.append(text),"draggable"in document.createElement("span")&&navigator&&navigator.userAgent.indexOf("Chrome")>=0&&"filemanager"==egw.app_name()){var key=["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform)<0?egw.lang("Alt"):egw.lang("Command ⌘");text.text(egw.lang("Hold [%1] and [%2] key to drag %3 to your desktop",key,egw.lang("Shift ⇧"),itemLabel))}return div},ai.doRegisterAction=function(_aoi,_callback,_context){var node=_aoi.getDOMNode();if(node){if(node.onselectstart=function(){return!1},!(window.FileReader&&"draggable"in document.createElement("span")))return;var action=null,groups=_context.getActionImplementationGroups();if(!groups.drag)return;for(var i=0;i-1){action=groups.drag[i].link.actionObj;break}return action?(jQuery.event.props.push("dataTransfer"),$j(node).off("mousedown").on("mousedown",function(event){var dragOut=_context.isDragOut(event);if($j(this).attr("draggable",dragOut?"true":""),$j(node).draggable("option","disabled",dragOut),dragOut)$j(node).removeClass("ui-draggable-disabled ui-state-disabled");else if(_context.isSelection(event)?($j(node).draggable("disable"),$j(node).removeClass("ui-draggable-disabled ui-state-disabled")):3!=event.which&&document.getSelection().removeAllRanges(),!dragOut||!this.addEventListener)return}).on("mouseup",function(event){_context.isSelection(event)&&$j(node).draggable("enable")}).on("dragstart",function(event){if(!_context.isSelection(event)&&null!=event.dataTransfer){event.dataTransfer.effectAllowed="copy";var selected=[_context];_context.parent.setAllSelected(!1),_context.setSelected(!0);for(var i=0;i$target.innerWidth()?!1:null!=ai.helper},revert:function(valid){var dTarget=this;if(valid)return!1;var tipTelorance=10,helperTop=ai.helper.position().top;if(helperTop>=dTarget.offset().top&&helperTop<=dTarget.height()+dTarget.offset().top+tipTelorance){var key=["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform)<0?egw.lang("Ctrl"):egw.lang("Command ⌘");egw.message(egw.lang("Hold [%1] key to select text eg. to copy it",key),"info")}return!0},refreshPositions:!0,scroll:!1,iframeFix:!0,delay:300}),!0}return!1},ai.doUnregisterAction=function(_aoi){var node=_aoi.getDOMNode();node&&$j(node).data("uiDraggable")&&$j(node).draggable("destroy")},ai.doExecuteImplementation=function(_context,_selected,_links){this.helper=null;var hasLink=!1;this.ddTypes=[],this.selected=_selected;for(var k in _links)if(_links[k].visible){hasLink=!0,!this.helper&&_links[k].actionObj.onExecute.hasHandler()&&(this.helper=_links[k].actionObj.execute(_selected));for(var type=$j.isArray(_links[k].actionObj.dragType)?_links[k].actionObj.dragType:[_links[k].actionObj.dragType],i=0;i1&&(enabled=!1),enabled||(links[k].enabled=!1,links[k].visible=!links[k].actionObj.hideOnDisabled)}var cnt=0,lnk=null;for(var k in links)links[k].enabled&&links[k].visible&&(lnk=links[k],cnt+=1+links[k].actionObj.children.length,lnk.actionObj.ui=ui);if(1==cnt&&window.setTimeout(function(){lnk.actionObj.execute(selected,_context)},0),cnt>1){var popup=getPopupImplementation(),pos=popup._getPageXY(event.originalEvent);popup.auto_paste=!1,window.setTimeout(function(){popup.doExecuteImplementation(pos,selected,links,_context),popup.auto_paste=!0},0)}$j("body").css({cursor:"auto"}),_aoi.triggerEvent(EGW_AI_DRAG_OUT,{event:event,ui:ui})},over:function(event,ui){_aoi.triggerEvent(EGW_AI_DRAG_OVER,{event:event,ui:ui})},out:function(event,ui){_aoi.triggerEvent(EGW_AI_DRAG_OUT,{event:event,ui:ui})},tolerance:"pointer",hoverClass:"drop-hover",greedy:!0}),!0):!1},ai.doUnregisterAction=function(_aoi){var node=_aoi.getDOMNode();node&&$j(node).data("uiDroppable")&&$j(node).droppable("destroy")},ai._fetchAccepted=function(_links){var accepted=[];for(var k in _links)for(var i=0;i<_links[k].actionObj.acceptedTypes.length;i++){var type=_links[k].actionObj.acceptedTypes[i];-1==accepted.indexOf(type)&&accepted.push(type)}return accepted},ai.doExecuteImplementation=function(_context,_selected,_links){return"links"==_context?_links:void 0},ai}function dhtmlxTree_getNode(_tree,_itemId){var node=_tree._globalIdStorageFind(_itemId);return null!=node?$j("tr:first",node.htmlNode):void 0}function dhtmlxtreeItemAOI(_tree,_itemId){var aoi=new egwActionObjectInterface;return aoi.node=dhtmlxTree_getNode(_tree,_itemId),aoi.id=_itemId,aoi.doGetDOMNode=function(){return aoi.node},aoi.doTriggerEvent=function(_event){_event==EGW_AI_DRAG_OVER&&$j(this.node).addClass("draggedOver"),_event==EGW_AI_DRAG_OUT&&$j(this.node).removeClass("draggedOver")},aoi.doSetState=function(_state){_tree&&_tree.focusItem&&(egwBitIsSet(_state,EGW_AO_STATE_FOCUSED)&&_tree.focusItem(this.id),egwBitIsSet(_state,EGW_AO_STATE_SELECTED)&&_tree.selectItem(this.id,!1))},aoi}function dhtmlXMenuObject(baseId,skin){var main_self=this;if(this.addBaseIdAsContextZone=null,this.isDhtmlxMenuObject=!0,this.skin=null!=skin?skin:"undefined"!=typeof dhtmlx&&"string"==typeof dhtmlx.skin?dhtmlx.skin:"dhx_skyblue",this.imagePath="",this._isIE6=!1,_isIE&&(this._isIE6=null==window.XMLHttpRequest),null==baseId)this.base=document.body;else{var baseObj="string"==typeof baseId?document.getElementById(baseId):baseId;if(null!=baseObj){for(this.base=baseObj,this.base.id||(this.base.id=(new Date).valueOf());this.base.childNodes.length>0;)this.base.removeChild(this.base.childNodes[0]);this.base.className+=" dhtmlxMenu_"+this.skin+"_Middle dir_left",this.base._autoSkinUpdate=!0,this.base.oncontextmenu&&(this.base._oldContextMenuHandler=this.base.oncontextmenu),this.addBaseIdAsContextZone=this.base.id,this.base.onselectstart=function(e){return e=e||event,e.returnValue=!1,!1},this.base.oncontextmenu=function(e){return e=e||event,e.returnValue=!1,!1}}else this.base=document.body}if(this.topId="dhxWebMenuTopId",!this.extendedModule){for(var t=function(){alert(this.i18n.dhxmenuextalert)},extMethods=new Array("setItemEnabled","setItemDisabled","isItemEnabled","_changeItemState","getItemText","setItemText","loadFromHTML","hideItem","showItem","isItemHidden","_changeItemVisible","setUserData","getUserData","setOpenMode","setWebModeTimeout","enableDynamicLoading","_updateLoaderIcon","getItemImage","setItemImage","clearItemImage","setAutoShowMode","setAutoHideMode","setContextMenuHideAllMode","getContextMenuHideAllMode","setVisibleArea","setTooltip","getTooltip","setHotKey","getHotKey","setItemSelected","setTopText","setRTL","setAlign","setHref","clearHref","getCircuit","_clearAllSelectedSubItemsInPolygon","_checkArrowsState","_addUpArrow","_addDownArrow","_removeUpArrow","_removeDownArrow","_isArrowExists","_doScrollUp","_doScrollDown","_countPolygonItems","setOverflowHeight","_getRadioImgObj","_setRadioState","_radioOnClickHandler","getRadioChecked","setRadioChecked","addRadioButton","_getCheckboxState","_setCheckboxState","_readLevel","_updateCheckboxImage","_checkboxOnClickHandler","setCheckboxState","getCheckboxState","addCheckbox","serialize"),q=0;qthis.menuY1+this.menuY2){var t0=Math.floor((this.menuY2-this.menuY1-35)/24);this.limit=t0}else this.limit=0,null!=this.idPull["arrowup_"+id]&&this._removeUpArrow(String(id).replace(this.idPrefix,"")),null!=this.idPull["arrowdown_"+id]&&this._removeDownArrow(String(id).replace(this.idPrefix,""));if(this.limit>0&&this.limit0&&(this.limitmx&&!this._rtl&&(x=srcX-w+2),xx&&(x=0),y+h>my&&null!=this.menuY2&&(y=Math.max(srcY+srcH-h+2,this._isVisibleArea?this.menuY1+2:2),this.context&&this.idPrefix+this.topId==id&&null!=arrowDown&&(y-=2),null==this.itemPull[id]||this.context||this.itemPull[id].parent==this.idPrefix+this.topId&&(y-=this.base.offsetHeight)),this.idPull[pId].style.left=x+"px",this.idPull[pId].style.top=y+arrUpH+"px","undefined"!=typeof this._menuEffect&&this._menuEffect!==!1)this._showPolygonEffect(pId);else if(this.idPull[pId].style.visibility="",this.limit>0&&this.limit0;)this._openedPolygons.pop();var i=this._getSubItemToDeselectByPolygon(parentId);this._removeSubItemFromSelected(-1,-1);for(var q=0;q0&&(m=j)}return m},this._getMenuNodes=function(node){var m=new Array;for(var a in this.itemPull)this.itemPull[a].parent==node&&(m[m.length]=a);return m},this._genStr=function(w){for(var s="",z="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",q=0;w>q;q++)s+=z.charAt(Math.round(Math.random()*(z.length-1)));return s},this.getItemType=function(id){return id=this.idPrefix+id,null==this.itemPull[id]?null:this.itemPull[id].type},this.forEachItem=function(handler){for(var a in this.itemPull)handler(String(a).replace(this.idPrefix,""))},this._clearAndHide=function(){for(main_self.menuSelected=-1,main_self.menuLastClicked=-1;main_self._openedPolygons.length>0;)main_self._openedPolygons.pop();for(var q=0;q0,this.dLoad&&item.complex&&(item.loaded="no"),this.itemPull[item.id]=item;for(var w=0;w1&&(item._menuOpenTM=window.setTimeout(function(){main_self._showPolygon(pId,level)},delay),isShow=!0)}}isShow||main_self._showPolygon(pId,level)}main_self.itemPull[main_self.idPrefix+parentId].loaded="yes",1==main_self.loaderIcon&&main_self._updateLoaderIcon(main_self.idPrefix+parentId,!1)}this.destructor(),main_self.callEvent("onXLE",[])}else{var t=this.getXMLTopNode("menu");main_self._buildMenu(t,null),main_self.init(),main_self.callEvent("onXLE",[]),main_self._doOnLoad()}},this._xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window),this._showSubLevelItem=function(id,back){null!=document.getElementById("arrow_"+this.idPrefix+id)&&(document.getElementById("arrow_"+this.idPrefix+id).style.display=back?"none":""),null!=document.getElementById("image_"+this.idPrefix+id)&&(document.getElementById("image_"+this.idPrefix+id).style.display=back?"none":""),null!=document.getElementById(this.idPrefix+id)&&(document.getElementById(this.idPrefix+id).style.display=back?"":"none")},this._hideSubLevelItem=function(id){this._showSubLevelItem(id,!0)},this.idPrefix=this._genStr(12),this._bodyClick=function(e){e=e||event,2==e.button||_isOpera&&1==e.ctrlKey||(main_self.context?main_self.contextAutoHide&&(!_isOpera||main_self._isContextMenuVisible()&&_isOpera)&&main_self._hideContextMenu():main_self._clearAndHide&&main_self._clearAndHide())},this._bodyContext=function(e){e=e||event;var t=String((e.srcElement||e.target).className);if(-1==t.search("dhtmlxMenu")||-1==t.search("SubLevelArea")){for(var toHide=!0,testZone=e.target||e.srcElement;null!=testZone;)null!=testZone.id&&main_self.isContextZone(testZone.id)&&(toHide=!1),testZone==document.body&&(toHide=!1),testZone=testZone.parentNode;toHide&&main_self.hideContextMenu()}},"undefined"!=typeof window.addEventListener?(window.addEventListener("click",this._bodyClick,!1),window.addEventListener("contextmenu",this._bodyContext,!1)):(document.body.attachEvent("onclick",this._bodyClick),document.body.attachEvent("oncontextmenu",this._bodyContext)),this._UID=this._genStr(32),dhtmlxMenuObjectLiveInstances[this._UID]=this,dhtmlxEventable(this),this}function egwMenuImpl(_structure){this.dhtmlxmenu=new dhtmlXMenuObject,this.dhtmlxmenu.setSkin("egw"),this.dhtmlxmenu.renderAsContextMenu();var self=this;this.dhtmlxmenu.attachEvent("onClick",function(id){if(id){var elem=self.dhtmlxmenu.getUserData(id,"egw_menu");if(elem&&elem.onClick){elem.checkbox&&self.dhtmlxmenu.setContextMenuHideAllMode(!1);var res=elem.onClick(elem);if(elem.checkbox&&(res===!1||res===!0)){var checked=res;0!=elem.groupIndex?self.dhtmlxmenu.setRadioChecked(id,checked):self.dhtmlxmenu.setCheckboxState(id,checked)}}}}),this.dhtmlxmenu.attachEvent("onRadioClick",function(group,idChecked,idClicked,zoneId,casState){if(idClicked){var elem=self.dhtmlxmenu.getUserData(idClicked,"egw_menu");elem&&elem.set_checked(!0)}return!0}),this.dhtmlxmenu.attachEvent("onCheckboxClick",function(id,state,zoneId,casState){if(id){var elem=self.dhtmlxmenu.getUserData(id,"egw_menu");elem&&elem.set_checked(!state)}return!0}),this._translateStructure(_structure,this.dhtmlxmenu.topId,0)}!function(global,factory){"object"==typeof module&&"object"==typeof module.exports?module.exports=global.document?factory(global,!0):function(w){if(!w.document)throw new Error("jQuery requires a window with a document");return factory(w)}:factory(global)}("undefined"!=typeof window?window:this,function(window,noGlobal){function isArraylike(obj){var length=obj.length,type=jQuery.type(obj);return"function"===type||jQuery.isWindow(obj)?!1:1===obj.nodeType&&length?!0:"array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj}function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier))return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not});if(qualifier.nodeType)return jQuery.grep(elements,function(elem){return elem===qualifier!==not});if("string"==typeof qualifier){if(risSimple.test(qualifier))return jQuery.filter(qualifier,elements,not);qualifier=jQuery.filter(qualifier,elements)}return jQuery.grep(elements,function(elem){return jQuery.inArray(elem,qualifier)>=0!==not})}function sibling(cur,dir){do cur=cur[dir];while(cur&&1!==cur.nodeType);return cur}function createOptions(options){var object=optionsCache[options]={};return jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function detach(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1)):(document.detachEvent("onreadystatechange",completed),window.detachEvent("onload",completed))}function completed(){(document.addEventListener||"load"===event.type||"complete"===document.readyState)&&(detach(),jQuery.ready())}function dataAttr(elem,key,data){if(void 0===data&&1===elem.nodeType){var name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();if(data=elem.getAttribute(name),"string"==typeof data){try{data="true"===data?!0:"false"===data?!1:"null"===data?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data}catch(e){}jQuery.data(elem,key,data)}else data=void 0}return data}function isEmptyDataObject(obj){var name;for(name in obj)if(("data"!==name||!jQuery.isEmptyObject(obj[name]))&&"toJSON"!==name)return!1;return!0}function internalData(elem,name,data,pvt){if(jQuery.acceptData(elem)){var ret,thisCache,internalKey=jQuery.expando,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if(id&&cache[id]&&(pvt||cache[id].data)||void 0!==data||"string"!=typeof name)return id||(id=isNode?elem[internalKey]=deletedIds.pop()||jQuery.guid++:internalKey),cache[id]||(cache[id]=isNode?{}:{toJSON:jQuery.noop}),"object"!=typeof name&&"function"!=typeof name||(pvt?cache[id]=jQuery.extend(cache[id],name):cache[id].data=jQuery.extend(cache[id].data,name)),thisCache=cache[id],pvt||(thisCache.data||(thisCache.data={}),thisCache=thisCache.data),void 0!==data&&(thisCache[jQuery.camelCase(name)]=data),"string"==typeof name?(ret=thisCache[name],null==ret&&(ret=thisCache[jQuery.camelCase(name)])):ret=thisCache,ret}}function internalRemoveData(elem,name,pvt){if(jQuery.acceptData(elem)){var thisCache,i,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(cache[id]){if(name&&(thisCache=pvt?cache[id]:cache[id].data)){jQuery.isArray(name)?name=name.concat(jQuery.map(name,jQuery.camelCase)):name in thisCache?name=[name]:(name=jQuery.camelCase(name),name=name in thisCache?[name]:name.split(" ")),i=name.length;for(;i--;)delete thisCache[name[i]];if(pvt?!isEmptyDataObject(thisCache):!jQuery.isEmptyObject(thisCache))return}(pvt||(delete cache[id].data,isEmptyDataObject(cache[id])))&&(isNode?jQuery.cleanData([elem],!0):support.deleteExpando||cache!=cache.window?delete cache[id]:cache[id]=null)}}}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(err){}}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement)for(;list.length;)safeFrag.createElement(list.pop());return safeFrag}function getAll(context,tag){var elems,elem,i=0,found=typeof context.getElementsByTagName!==strundefined?context.getElementsByTagName(tag||"*"):typeof context.querySelectorAll!==strundefined?context.querySelectorAll(tag||"*"):void 0;if(!found)for(found=[],elems=context.childNodes||context;null!=(elem=elems[i]);i++)!tag||jQuery.nodeName(elem,tag)?found.push(elem):jQuery.merge(found,getAll(elem,tag));return void 0===tag||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],found):found}function fixDefaultChecked(elem){rcheckableType.test(elem.type)&&(elem.defaultChecked=elem.checked)}function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(11!==content.nodeType?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem}function disableScript(elem){return elem.type=(null!==jQuery.find.attr(elem,"type"))+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function setGlobalEval(elems,refElements){for(var elem,i=0;null!=(elem=elems[i]);i++)jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"))}function cloneCopyEvent(src,dest){if(1===dest.nodeType&&jQuery.hasData(src)){var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle,curData.events={};for(type in events)for(i=0,l=events[type].length;l>i;i++)jQuery.event.add(dest,type,events[type][i])}curData.data&&(curData.data=jQuery.extend({},curData.data))}}function fixCloneNodeIssues(src,dest){var nodeName,e,data;if(1===dest.nodeType){if(nodeName=dest.nodeName.toLowerCase(),!support.noCloneEvent&&dest[jQuery.expando]){data=jQuery._data(dest);for(e in data.events)jQuery.removeEvent(dest,e,data.handle);dest.removeAttribute(jQuery.expando)}"script"===nodeName&&dest.text!==src.text?(disableScript(dest).text=src.text,restoreScript(dest)):"object"===nodeName?(dest.parentNode&&(dest.outerHTML=src.outerHTML),support.html5Clone&&src.innerHTML&&!jQuery.trim(dest.innerHTML)&&(dest.innerHTML=src.innerHTML)):"input"===nodeName&&rcheckableType.test(src.type)?(dest.defaultChecked=dest.checked=src.checked,dest.value!==src.value&&(dest.value=src.value)):"option"===nodeName?dest.defaultSelected=dest.selected=src.defaultSelected:"input"!==nodeName&&"textarea"!==nodeName||(dest.defaultValue=src.defaultValue)}}function actualDisplay(name,doc){var style,elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=window.getDefaultComputedStyle&&(style=window.getDefaultComputedStyle(elem[0]))?style.display:jQuery.css(elem[0],"display");return elem.detach(),display}function defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];return display||(display=actualDisplay(nodeName,doc),"none"!==display&&display||(iframe=(iframe||jQuery("'),a.join("")})}},fileButton:function(b,c,d){var e=this;if(!(3>arguments.length)){a.call(this,c),c.validate&&(this.validate=c.validate);var f=CKEDITOR.tools.extend({},c),m=f.onClick;f.className=(f.className?f.className+" ":"")+"cke_dialog_ui_button",f.onClick=function(a){var d=c.for;m&&!1===m.call(this,a)||(b.getContentElement(d[0],d[1]).submit(),this.disable())},b.on("load",function(){b.getContentElement(c.for[0],c.for[1])._.buttons.push(e)}),CKEDITOR.ui.dialog.button.call(this,b,f,d)}},html:function(){var a=/^\s*<[\w:]+\s+([^>]*)?>/,b=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,c=/\/$/;return function(d,e,f){if(!(3>arguments.length)){var m=[],l=e.html;"<"!=l.charAt(0)&&(l=""+l+"");var r=e.focus;if(r){var w=this.focus;this.focus=function(){("function"==typeof r?r:w).call(this),this.fire("focus")},e.isFocusable&&(this.isFocusable=this.isFocusable),this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,d,e,m,"span",null,null,""),m=m.join("").match(a),l=l.match(b)||["","",""],c.test(l[1])&&(l[1]=l[1].slice(0,-1),l[2]="/"+l[2]),f.push([l[1]," ",m[1]||"",l[2]].join(""))}}}(),fieldset:function(a,b,c,d,e){var f=e.label;this._={children:b},CKEDITOR.ui.dialog.uiElement.call(this,a,e,d,"fieldset",null,null,function(){var a=[];f&&a.push(""+f+"");for(var b=0;bb.getChildCount()?new CKEDITOR.dom.text(a,CKEDITOR.document).appendTo(b):b.getChild(0).$.nodeValue=a,this},getLabel:function(){var a=CKEDITOR.document.getById(this._.labelId);return!a||1>a.getChildCount()?"":a.getChild(0).getText()},eventProcessors:d},!0),CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var a=this.getElement();a&&a.removeClass("cke_disabled")},disable:function(){this._.disabled=!0,this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(a,b){this.on("click",function(){b.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0),CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},focus:function(){var a=this.selectParentTab();setTimeout(function(){var b=a.getInputElement();b&&b.$.focus()},0)},select:function(){var a=this.selectParentTab();setTimeout(function(){var b=a.getInputElement();b&&(b.$.focus(),b.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(a){if(this.bidi){var b=a&&a.charAt(0);(b="‪"==b?"ltr":"‫"==b?"rtl":null)&&(a=a.slice(1)),this.setDirectionMarker(b)}return a||(a=""),CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},getValue:function(){var a=CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);if(this.bidi&&a){var b=this.getDirectionMarker();b&&(a=("ltr"==b?"‪":"‫")+a)}return a},setDirectionMarker:function(a){var b=this.getInputElement();a?b.setAttributes({dir:a,"data-cke-dir-marker":a}):this.getDirectionMarker()&&b.removeAttributes(["dir","data-cke-dir-marker"])},getDirectionMarker:function(){return this.getInputElement().data("cke-dir-marker")},keyboardFocusable:!0},c,!0),CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput,CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(a,b,c){var d=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),e=this.getInputElement().$;return d.$.text=a,d.$.value=void 0===b||null===b?a:b,void 0===c||null===c?CKEDITOR.env.ie?e.add(d.$):e.add(d.$,null):e.add(d.$,c),this},remove:function(a){return this.getInputElement().$.remove(a),this},clear:function(){for(var a=this.getInputElement().$;0','
    "].join("")),c.$.close(),h=0;hb-a;c--)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function e(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),c=b+1;b+a>c;c++)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function b(a,b){for(var c=a.$.getElementsByTagName("input"),d=0,g=c.length;g>d;d++){var e=new CKEDITOR.dom.element(c[d]);"text"==e.getAttribute("type").toLowerCase()&&(b?(e.setAttribute("value",e.getCustomData("fake_value")||""),e.removeCustomData("fake_value")):(e.setCustomData("fake_value",e.getAttribute("value")),e.setAttribute("value","")))}}function c(a,b){var c=this.getInputElement();c&&(a?c.removeAttribute("aria-invalid"):c.setAttribute("aria-invalid",!0)),a||(this.select?this.select():this.focus()),b&&alert(b),this.fire("validated",{valid:a,msg:b})}function d(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function m(a){var b=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",p).output({id:CKEDITOR.tools.getNextNumber(),editorId:a.id,langDir:a.lang.dir,langCode:a.langCode,editorDialogClass:"cke_editor_"+a.name.replace(/\./g,"\\.")+"_dialog",closeTitle:a.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),c=b.getChild([0,0,0,0,0]),d=c.getChild(0),e=c.getChild(1);return a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c),!CKEDITOR.env.ie||CKEDITOR.env.quirks||CKEDITOR.env.edge||(a="javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())",CKEDITOR.dom.element.createFromHtml('').appendTo(c.getParent())),d.unselectable(),e.unselectable(),{element:b,parts:{dialog:b.getChild(0),title:d,close:e,tabs:c.getChild(2),contents:c.getChild([3,0,0,0]),footer:c.getChild([3,0,1,0])}}}function l(a,b,c){this.element=b,this.focusIndex=c,this.tabIndex=0,this.isFocusable=function(){return!b.getAttribute("disabled")&&b.isVisible()},this.focus=function(){a._.currentFocusIndex=this.focusIndex,this.element.focus()},b.on("keydown",function(a){a.data.getKeystroke()in{32:1,13:1}&&this.fire("click")}),b.on("focus",function(){this.fire("mouseover")}),b.on("blur",function(){this.fire("mouseout")})}function f(a){function b(){a.layout()}var c=CKEDITOR.document.getWindow();c.on("resize",b),a.on("hide",function(){c.removeListener("resize",b)})}function h(a,b){this._={dialog:a},CKEDITOR.tools.extend(this,b)}function k(a){function b(c){var h=a.getSize(),m=CKEDITOR.document.getWindow().getViewPaneSize(),l=c.data.$.screenX,n=c.data.$.screenY,r=l-d.x,u=n-d.y;d={x:l,y:n},e.x+=r,e.y+=u,a.move(e.x+k[3]m.width-h.width-f?m.width-h.width+("rtl"==g.lang.dir?0:k[1]):e.x,e.y+k[0]m.height-h.height-f?m.height-h.height+k[2]:e.y,1),c.data.preventDefault()}function c(){if(CKEDITOR.document.removeListener("mousemove",b),CKEDITOR.document.removeListener("mouseup",c),CKEDITOR.env.ie6Compat){var a=x.getChild(0).getFrameDocument();a.removeListener("mousemove",b),a.removeListener("mouseup",c)}}var d=null,e=null,g=a.getParentEditor(),f=g.config.dialog_magnetDistance,k=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof f&&(f=20),a.parts.title.on("mousedown",function(g){if(d={x:g.data.$.screenX,y:g.data.$.screenY},CKEDITOR.document.on("mousemove",b), +CKEDITOR.document.on("mouseup",c),e=a.getPosition(),CKEDITOR.env.ie6Compat){var f=x.getChild(0).getFrameDocument();f.on("mousemove",b),f.on("mouseup",c)}g.data.preventDefault()},a)}function g(a){function b(c){var n="rtl"==g.lang.dir,r=l.width,u=l.height,w=r+(c.data.$.screenX-m.x)*(n?-1:1)*(a._.moved?1:2),z=u+(c.data.$.screenY-m.y)*(a._.moved?1:2),t=a._.element.getFirst(),t=n&&t.getComputedStyle("right"),p=a.getPosition();p.y+z>h.height&&(z=h.height-p.y),(n?t:p.x)+w>h.width&&(w=h.width-(n?t:p.x)),e!=CKEDITOR.DIALOG_RESIZE_WIDTH&&e!=CKEDITOR.DIALOG_RESIZE_BOTH||(r=Math.max(d.minWidth||0,w-f)),e!=CKEDITOR.DIALOG_RESIZE_HEIGHT&&e!=CKEDITOR.DIALOG_RESIZE_BOTH||(u=Math.max(d.minHeight||0,z-k)),a.resize(r,u),a._.moved||a.layout(),c.data.preventDefault()}function c(){if(CKEDITOR.document.removeListener("mouseup",c),CKEDITOR.document.removeListener("mousemove",b),n&&(n.remove(),n=null),CKEDITOR.env.ie6Compat){var a=x.getChild(0).getFrameDocument();a.removeListener("mouseup",c),a.removeListener("mousemove",b)}}var d=a.definition,e=d.resizable;if(e!=CKEDITOR.DIALOG_RESIZE_NONE){var f,k,h,m,l,n,g=a.getParentEditor(),r=CKEDITOR.tools.addFunction(function(d){l=a.getSize();var e=a.parts.contents;e.$.getElementsByTagName("iframe").length&&(n=CKEDITOR.dom.element.createFromHtml('
    '),e.append(n)),k=l.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks)),f=l.width-a.parts.contents.getSize("width",1),m={x:d.screenX,y:d.screenY},h=CKEDITOR.document.getWindow().getViewPaneSize(),CKEDITOR.document.on("mousemove",b),CKEDITOR.document.on("mouseup",c),CKEDITOR.env.ie6Compat&&(e=x.getChild(0).getFrameDocument(),e.on("mousemove",b),e.on("mouseup",c)),d.preventDefault&&d.preventDefault()});a.on("load",function(){var b="";e==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":e==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical"),b=CKEDITOR.dom.element.createFromHtml('
    '+("ltr"==g.lang.dir?"◢":"◣")+"
    "),a.parts.footer.append(b,1)}),g.on("destroy",function(){CKEDITOR.tools.removeFunction(r)})}}function n(a){a.data.preventDefault(1)}function q(a){var b=CKEDITOR.document.getWindow(),c=a.config,d=c.dialog_backgroundCoverColor||"white",e=c.dialog_backgroundCoverOpacity,g=c.baseFloatZIndex,c=CKEDITOR.tools.genKey(d,e,g),f=C[c];f?f.show():(g=['
    '],CKEDITOR.env.ie6Compat&&(d="",g.push('')),g.push("
    "),f=CKEDITOR.dom.element.createFromHtml(g.join("")),f.setOpacity(void 0!==e?e:.5),f.on("keydown",n),f.on("keypress",n),f.on("keyup",n),f.appendTo(CKEDITOR.document.getBody()),C[c]=f),a.focusManager.add(f),x=f,a=function(){var a=b.getViewPaneSize();f.setStyles({width:a.width+"px",height:a.height+"px"})};var k=function(){var a=b.getScrollPosition(),c=CKEDITOR.dialog._.currentTop;if(f.setStyles({left:a.x+"px",top:a.y+"px"}),c)do a=c.getPosition(),c.move(a.x,a.y);while(c=c._.parentDialog)};if(y=a,b.on("resize",a),a(),CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus(),CKEDITOR.env.ie6Compat){var h=function(){k(),arguments.callee.prevScrollHandler.apply(this,arguments)};b.$.setTimeout(function(){h.prevScrollHandler=window.onscroll||function(){},window.onscroll=h},0),k()}}function t(a){x&&(a.focusManager.remove(x),a=CKEDITOR.document.getWindow(),x.hide(),a.removeListener("resize",y),CKEDITOR.env.ie6Compat&&a.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||null},0),y=null)}var u=CKEDITOR.tools.cssLength,p='';CKEDITOR.dialog=function(b,f){function h(){var a=x._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;b>c;c++)a[c].focusIndex=c}function l(a){var b=x._.focusList;if(a=a||0,!(1>b.length)){var c=x._.currentFocusIndex;x._.tabBarMode&&0>a&&(c=0);try{b[c].getInputElement().$.blur()}catch(d){}var e=c,g=10?b:0)+"px"},b[e?"right":"left"]=(a>0?a:0)+"px",d.setStyles(b),c&&(this._.moved=1))},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var a=this._.element,b=this.definition;a.getParent()&&a.getParent().equals(CKEDITOR.document.getBody())?a.setStyle("display","block"):a.appendTo(CKEDITOR.document.getBody()),this.resize(this._.contentSize&&this._.contentSize.width||b.width||b.minWidth,this._.contentSize&&this._.contentSize.height||b.height||b.minHeight),this.reset(),this.selectPage(this.definition.contents[0].id),null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex),this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10),null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,q(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,this._.parentDialog.getElement().getFirst().$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2),CKEDITOR.dialog._.currentTop=this),a.on("keydown",D),a.on("keyup",G),this._.hasFocus=!1;for(var c in b.contents)if(b.contents[c]){var a=b.contents[c],d=this._.tabs[a.id],e=a.requiredContent,g=0;if(d){for(var k in this._.contents[a.id]){var h=this._.contents[a.id][k];"hbox"!=h.type&&"vbox"!=h.type&&h.getInputElement()&&(h.requiredContent&&!this._.editor.activeFilter.check(h.requiredContent)?h.disable():(h.enable(),g++))}!g||e&&!this._.editor.activeFilter.check(e)?d[0].addClass("cke_dialog_tab_disabled"):d[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout(),f(this),this.parts.dialog.setStyle("visibility",""),this.fireOnce("load",{}),CKEDITOR.ui.fire("ready",this),this.fire("show",{}),this._.editor.fire("dialogShow",this),this._.parentDialog||this._.editor.focusManager.lock(),this.foreach(function(a){a.setInitValue&&a.setInitValue()})},100,this)},layout:function(){var a=this.parts.dialog,b=this.getSize(),c=CKEDITOR.document.getWindow().getViewPaneSize(),d=(c.width-b.width)/2,e=(c.height-b.height)/2;CKEDITOR.env.ie6Compat||(b.height+(e>0?e:0)>c.height||b.width+(d>0?d:0)>c.width?a.setStyle("position","absolute"):a.setStyle("position","fixed")),this.move(this._.moved?this._.position.x:d,this._.moved?this._.position.y:e)},foreach:function(a){for(var b in this._.contents)for(var c in this._.contents[b])a.call(this,this._.contents[b][c]);return this},reset:function(){var a=function(a){a.reset&&a.reset(1)};return function(){return this.foreach(a),this}}(),setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur(),b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{}),this._.editor.fire("dialogHide",this),this.selectPage(this._.tabIdList[0]);var a=this._.element;for(a.setStyle("display","none"),this.parts.dialog.setStyle("visibility","hidden"),I(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else t(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=10;else{CKEDITOR.dialog._.currentZIndex=null,a.removeListener("keydown",D),a.removeListener("keyup",G);var c=this._.editor;c.focus(),setTimeout(function(){c.focusManager.unlock(),CKEDITOR.env.iOS&&c.window.focus()},0)}delete this._.parentDialog,this.foreach(function(a){a.resetInitValue&&a.resetInitValue()}),this.setState(CKEDITOR.DIALOG_STATE_IDLE)}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],c=a.label?' title="'+CKEDITOR.tools.htmlEncode(a.label)+'"':"",d=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),e=this._.contents[a.id]={},g=d.getChild(),f=0;d=g.shift();)d.notAllowed||"hbox"==d.type||"vbox"==d.type||f++,e[d.id]=d,"function"==typeof d.getChild&&g.push.apply(g,d.getChild());f||(a.hidden=!0),b=CKEDITOR.dom.element.createFromHtml(b.join("")),b.setAttribute("role","tabpanel"),d=CKEDITOR.env,e="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber(),c=CKEDITOR.dom.element.createFromHtml(['"].join("")),b.setAttribute("aria-labelledby",e),this._.tabs[a.id]=[c,b],this._.tabIdList.push(a.id),!a.hidden&&this._.pageCount++,this._.lastTab=c,this.updateStyle(),b.setAttribute("name",a.id),b.appendTo(this.parts.contents),c.unselectable(),this.parts.tabs.append(c),a.accessKey&&(E(this,this,"CTRL+"+a.accessKey,K,H),this._.accessKeyMap["CTRL+"+a.accessKey]=a.id)}},selectPage:function(a){if(this._.currentTabId!=a&&!this._.tabs[a][0].hasClass("cke_dialog_tab_disabled")&&!1!==this.fire("selectPage",{page:a,currentPage:this._.currentTabId})){for(var c in this._.tabs){var d=this._.tabs[c][0],e=this._.tabs[c][1];c!=a&&(d.removeClass("cke_dialog_tab_selected"),e.hide()),e.setAttribute("aria-hidden",c!=a)}var g=this._.tabs[a];g[0].addClass("cke_dialog_tab_selected"),CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?(b(g[1]),g[1].show(),setTimeout(function(){b(g[1],1)},0)):g[1].show(),this._.currentTabId=a,this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,a)}},updateStyle:function(){this.parts.dialog[(1===this._.pageCount?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(b){var c=this._.tabs[b]&&this._.tabs[b][0];c&&1!=this._.pageCount&&c.isVisible()&&(b==this._.currentTabId&&this.selectPage(a.call(this)),c.hide(),this._.pageCount--,this.updateStyle())},showPage:function(a){(a=this._.tabs[a]&&this._.tabs[a][0])&&(a.show(),this._.pageCount++,this.updateStyle())},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(a,b){var c=this._.contents[a];return c&&c[b]},getValueOf:function(a,b){return this.getContentElement(a,b).getValue()},setValueOf:function(a,b,c){return this.getContentElement(a,b).setValue(c)},getButton:function(a){return this._.buttons[a]},click:function(a){return this._.buttons[a].click()},disableButton:function(a){return this._.buttons[a].disable()},enableButton:function(a){return this._.buttons[a].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(a,b){if("undefined"==typeof b)b=this._.focusList.length,this._.focusList.push(new l(this,a,b));else{this._.focusList.splice(b,0,new l(this,a,b));for(var c=b+1;c=0;d--)c[d].dialog!=a&&c[d].uiElement!=a||c.splice(d,1);0===c.length&&delete A[b]}},H=function(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])},K=function(){};!function(){CKEDITOR.ui.dialog={uiElement:function(a,b,c,d,e,g,f){if(!(4>arguments.length)){var k=(d.call?d(b):d)||"div",h=["<",k," "],m=(e&&e.call?e(b):e)||{},l=(g&&g.call?g(b):g)||{},n=(f&&f.call?f.call(this,a,b):f)||"",w=this.domId=l.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(m.display="none",this.notAllowed=!0),l.id=w;var r={};b.type&&(r["cke_dialog_ui_"+b.type]=1),b.className&&(r[b.className]=1),b.disabled&&(r.cke_disabled=1);for(var u=l.class&&l.class.split?l.class.split(" "):[],w=0;w=0;w--)""===r[w]&&r.splice(w,1);0",n,""),c.push(h.join("")),(this._||(this._={})).dialog=a,"boolean"==typeof b.isChanged&&(this.isChanged=function(){return b.isChanged}),"function"==typeof b.isChanged&&(this.isChanged=b.isChanged),"function"==typeof b.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(c){a.call(this,b.setValue.call(this,c))}})),"function"==typeof b.getValue&&(this.getValue=CKEDITOR.tools.override(this.getValue,function(a){return function(){return b.getValue.call(this,a.call(this))}})),CKEDITOR.event.implementOn(this),this.registerEvents(b),this.accessKeyUp&&this.accessKeyDown&&b.accessKey&&E(this,a,"CTRL+"+b.accessKey);var z=this;a.on("load",function(){var b=z.getInputElement();if(b){var c=z.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=!1,a._.hasFocus=!0,z.fire("focus"),c&&this.addClass(c)}),b.on("blur",function(){z.fire("blur"),c&&this.removeClass(c)})}}),CKEDITOR.tools.extend(this,b),this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=z.focusIndex}))}},hbox:function(a,b,c,d,e){if(!(4>arguments.length)){this._||(this._={});var h,g=this._.children=b,f=e&&e.widths||null,k=e&&e.height||null,m={role:"presentation"};e&&e.align&&(m.align=e.align),CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"hbox"},d,"table",{},m,function(){var a=[''];for(h=0;h",c[h],"")}return a.push(""),a.join("")})}},vbox:function(a,b,c,d,e){if(!(3>arguments.length)){this._||(this._={});var g=this._.children=b,f=e&&e.width||null,h=e&&e.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"vbox"},d,"div",null,{role:"presentation"},function(){var b=['");for(var d=0;d")}return b.push("
    "),b.join("")})}}}}(),CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(a,b){return this.getInputElement().setValue(a),!b&&this.fire("change",{value:a}),this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return!1},selectParentTab:function(){for(var a=this.getInputElement();(a=a.getParent())&&-1==a.$.className.search("cke_dialog_page_contents"););return a?(a=a.getAttribute("name"),this._.dialog._.currentTabId!=a&&this._.dialog.selectPage(a),this):this},focus:function(){return this.selectParentTab().getInputElement().focus(),this},registerEvents:function(a){var c,e,b=/^on([A-Z]\w+)/,d=function(a,b,c,d){b.on("load",function(){a.getInputElement().on(c,d,a)})};for(e in a)(c=e.match(b))&&(this.eventProcessors[e]?this.eventProcessors[e].call(this,this._.dialog,a[e]):d(this,this._.dialog,c[1].toLowerCase(),a[e]));return this},eventProcessors:{onLoad:function(a,b){a.on("load",b,this)},onShow:function(a,b){a.on("show",b,this)},onHide:function(a,b){a.on("hide",b,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var a=this.getElement();this.getInputElement().setAttribute("disabled","true"),a.addClass("cke_disabled")},enable:function(){var a=this.getElement();this.getInputElement().removeAttribute("disabled"),a.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){return!(!this.isEnabled()||!this.isVisible())}},CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getChild:function(a){return 1>arguments.length?this._.children.concat():(a.splice||(a=[a]),2>a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?this._.children[a[0]].getChild(a.slice(1,a.length)):null)}},!0),CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox,function(){var a={build:function(a,b,c){for(var e,d=b.children,g=[],f=[],h=0;h=700}]],italic:["em","i",["span",function(a){return"italic"==a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s","strike",["span",function(a){return"line-through"==a.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},d=a.config,m=a.lang.basicstyles;b("Bold",m.bold,"bold",d.coreStyles_bold),b("Italic",m.italic,"italic",d.coreStyles_italic),b("Underline",m.underline,"underline",d.coreStyles_underline),b("Strike",m.strike,"strike",d.coreStyles_strike),b("Subscript",m.subscript,"subscript",d.coreStyles_subscript),b("Superscript",m.superscript,"superscript",d.coreStyles_superscript),a.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}}),CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"},CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"},CKEDITOR.config.coreStyles_underline={element:"u"},CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"},CKEDITOR.config.coreStyles_subscript={element:"sub"},CKEDITOR.config.coreStyles_superscript={element:"sup"},function(){function a(a,b,c,d){if(!a.isReadOnly()&&!a.equals(c.editable())){CKEDITOR.dom.element.setMarker(d,a,"bidi_processed",1),d=a;for(var e=c.editable();(d=d.getParent())&&!d.equals(e);)if(d.getCustomData("bidi_processed"))return a.removeStyle("direction"),void a.removeAttribute("dir");d="useComputedState"in c.config?c.config.useComputedState:1,(d?a.getComputedStyle("direction"):a.getStyle("direction")||a.hasAttribute("dir"))!=b&&(a.removeStyle("direction"),d?(a.removeAttribute("dir"),b!=a.getComputedStyle("direction")&&a.setAttribute("dir",b)):a.setAttribute("dir",b),c.forceNextSelectionCheck())}}function e(a,b,c){var d=a.getCommonAncestor(!1,!0);if(a=a.clone(),a.enlarge(c==CKEDITOR.ENTER_BR?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS),a.checkBoundaryOfElement(d,CKEDITOR.START)&&a.checkBoundaryOfElement(d,CKEDITOR.END)){for(var e;d&&d.type==CKEDITOR.NODE_ELEMENT&&(e=d.getParent())&&1==e.getChildCount()&&!(d.getName()in b);)d=e;return d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in b&&d}}function b(b){return{context:"p",allowedContent:{"h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td":{propertiesOnly:!0,attributes:"dir"}},requiredContent:"p[dir]",refresh:function(a,b){var d,c=a.config.useComputedState,c=void 0===c||c;if(!c){d=b.lastElement;for(var e=a.editable();d&&!(d.getName()in l||d.equals(e));){var g=d.getParent();if(!g)break;d=g}}d=d||b.block||b.blockLimit,d.equals(a.editable())&&(e=a.getSelection().getRanges()[0].getEnclosedNode())&&e.type==CKEDITOR.NODE_ELEMENT&&(d=e),d&&(c=c?d.getComputedStyle("direction"):d.getStyle("direction")||d.getAttribute("dir"),a.getCommand("bidirtl").setState("rtl"==c?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),a.getCommand("bidiltr").setState("ltr"==c?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)),c=(b.block||b.blockLimit||a.editable()).getDirection(1),c!=(a._.selDir||a.lang.dir)&&(a._.selDir=c,a.fire("contentDirChanged",c))},exec:function(c){var f=c.getSelection(),h=c.config.enterMode,k=f.getRanges();if(k&&k.length){for(var w,l={},r=f.createBookmarks(),k=k.createIterator(),z=0;w=k.getNextRange(1);){var B=w.getEnclosedNode();B&&(!B||B.type==CKEDITOR.NODE_ELEMENT&&B.getName()in m)||(B=e(w,d,h)),B&&a(B,b,c,l);var v=new CKEDITOR.dom.walker(w),y=r[z].startNode,C=r[z++].endNode;v.evaluator=function(a){var c,b=h==CKEDITOR.ENTER_P?"p":"div";return(c=(a?a.type==CKEDITOR.NODE_ELEMENT:!1)&&a.getName()in d)&&((b=a.is(b))&&(b=(b=a.getParent())?b.type==CKEDITOR.NODE_ELEMENT:!1),c=!(b&&a.getParent().is("blockquote"))),!!(c&&a.getPosition(y)&CKEDITOR.POSITION_FOLLOWING&&(a.getPosition(C)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_CONTAINS)==CKEDITOR.POSITION_PRECEDING)};for(;B=v.next();)a(B,b,c,l);for(w=w.createIterator(),w.enlargeBr=h!=CKEDITOR.ENTER_BR;B=w.getNextParagraph(h==CKEDITOR.ENTER_P?"p":"div");)a(B,b,c,l)}CKEDITOR.dom.element.clearAllMarkers(l),c.forceNextSelectionCheck(),f.selectBookmarks(r),c.focus()}}}}function c(a){var b=a==f.setAttribute,c=a==f.removeAttribute,d=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;return function(e,f){if(!this.isReadOnly()){var h;if(h=e==(b||c?"dir":"direction")||"style"==e&&(c||d.test(f))){a:{h=this;for(var k=h.getDocument().getBody().getParent();h;){if(h.equals(k)){h=!1;break a}h=h.getParent()}h=!0}h=!h}if(h&&(h=this.getDirection(1),k=a.apply(this,arguments),h!=this.getDirection(1)))return this.getDocument().fire("dirChanged",this),k}return a.apply(this,arguments)}}var d={table:1,ul:1,ol:1,blockquote:1,div:1},m={},l={};CKEDITOR.tools.extend(m,d,{tr:1,p:1,div:1,li:1}),CKEDITOR.tools.extend(l,m,{td:1}),CKEDITOR.plugins.add("bidi",{init:function(a){function c(b,d,e,f,h){a.addCommand(e,new CKEDITOR.command(a,f)),a.ui.addButton&&a.ui.addButton(b,{label:d,command:e,toolbar:"bidi,"+h})}if(!a.blockless){var d=a.lang.bidi;c("BidiLtr",d.ltr,"bidiltr",b("ltr"),10),c("BidiRtl",d.rtl,"bidirtl",b("rtl"),20),a.on("contentDom",function(){a.document.on("dirChanged",function(b){a.fire("dirChanged",{node:b.data,dir:b.data.getDirection(1)})})}),a.on("contentDirChanged",function(b){b=(a.lang.dir!=b.data?"add":"remove")+"Class";var c=a.ui.space(a.config.toolbarLocation);c&&c[b]("cke_mixed_dir_content")})}}});for(var f=CKEDITOR.dom.element.prototype,h=["setStyle","removeStyle","setAttribute","removeAttribute"],k=0;kl.length&&(b=a.document.createElement(a.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),f=m.shift(),d.insertNode(b),b.append(new CKEDITOR.dom.text("\ufeff",a.document)),d.moveToBookmark(f),d.selectNodeContents(b),d.collapse(!0),f=d.createBookmark(),l.push(b),m.unshift(f)),h=l[0].getParent(),d=[],f=0;f=0;f--){d=l[f];a:{h=d;for(var k=0,g=h.getChildCount(),n=void 0;g>k&&(n=h.getChild(k));k++)if(n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary()){h=!1;break a}h=!0}h&&d.remove()}if(a.config.enterMode==CKEDITOR.ENTER_BR)for(d=!0;b.length;)if(k=b.shift(),"div"==k.getName()){for(f=new CKEDITOR.dom.documentFragment(a.document),!d||!k.getPrevious()||k.getPrevious().type==CKEDITOR.NODE_ELEMENT&&k.getPrevious().isBlockBoundary()||f.append(a.document.createElement("br")),d=k.getNext()&&!(k.getNext().type==CKEDITOR.NODE_ELEMENT&&k.getNext().isBlockBoundary());k.getFirst();)k.getFirst().remove().appendTo(f);d&&f.append(a.document.createElement("br")),f.replace(k),d=!1}}c.selectBookmarks(m),a.focus()}},refresh:function(a,b){this.setState(a.elementPath(b.block||b.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(e){e.blockless||(e.addCommand("blockquote",a),e.ui.addButton&&e.ui.addButton("Blockquote",{label:e.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"}))}})}(),function(){function a(a,b,c){return b.type||(b.type="auto"),c&&!1===a.fire("beforePaste",b)||!b.dataValue&&b.dataTransfer.isEmpty()?!1:(b.dataValue||(b.dataValue=""),CKEDITOR.env.gecko&&"drop"==b.method&&a.toolbox&&a.once("afterPaste",function(){a.toolbox.focus()}),a.fire("paste",b))}function e(b){function c(){var a=b.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var d=function(a){A.initPasteDataTransfer(a,b),a.data.preventDefault()};a.on("copy",d),a.on("cut",d),a.on("cut",function(){b.extractSelectedHtml()},null,null,999)}a.on(A.mainPasteEvent,function(a){"beforepaste"==A.mainPasteEvent&&D||y(a)}),"beforepaste"==A.mainPasteEvent&&(a.on("paste",function(a){G||(f(),a.data.preventDefault(),y(a),k("paste")||b.openDialog("paste"))}),a.on("contextmenu",h,null,null,0),a.on("beforepaste",function(a){!a.data||a.data.$.ctrlKey||a.data.$.shiftKey||h()},null,null,0)),a.on("beforecut",function(){!D&&m(b)});var e;a.attachListener(CKEDITOR.env.ie?a:b.document.getDocumentElement(),"mouseup",function(){e=setTimeout(function(){C()},0)}),b.on("destroy",function(){clearTimeout(e)}),a.on("keyup",C)}function d(a){return{type:a,canUndo:"cut"==a,startDisabled:!0,exec:function(){"cut"==this.type&&m();var a,c=this.type;if(CKEDITOR.env.ie)a=k(c);else try{a=b.document.$.execCommand(c,!1,null)}catch(d){a=!1}return a||b.showNotification(b.lang.clipboard[this.type+"Error"]),a}}}function e(){return{canUndo:!1,async:!0,exec:function(b,c){var d=function(c,d){c&&a(b,c,!!d),b.fire("afterCommandExec",{name:"paste",command:e,returnValue:!!c})},e=this;"string"==typeof c?d({dataValue:c,method:"paste",dataTransfer:A.initPasteDataTransfer()},1):b.getClipboardData(d)}}}function f(){G=1,setTimeout(function(){G=0},100)}function h(){D=1,setTimeout(function(){D=0},10)}function k(a){var c=b.document,d=c.getBody(),e=!1,f=function(){e=!0};return d.on(a,f),7]+data-cke-bookmark[^<]*?<\/span>/gi,""),e&&a(b,d)})}function C(){if("wysiwyg"==b.mode){var a=x("paste");b.getCommand("cut").setState(x("cut")),b.getCommand("copy").setState(x("copy")),b.getCommand("paste").setState(a),b.fire("pasteState",a)}}function x(a){if(E&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=b.getSelection();var c=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var A=CKEDITOR.plugins.clipboard,D=0,G=0,E=0;!function(){b.on("key",v),b.on("contentDom",c),b.on("selectionChange",function(a){E=a.data.selection.getRanges()[0].checkReadOnly(),C()}),b.contextMenu&&b.contextMenu.addListener(function(a,b){return E=b.getRanges()[0].checkReadOnly(),{cut:x("cut"),copy:x("copy"),paste:x("paste")}})}(),function(){function a(c,d,e,f,h){var k=b.lang.clipboard[d];b.addCommand(d,e),b.ui.addButton&&b.ui.addButton(c,{label:k,command:d,toolbar:"clipboard,"+f}),b.addMenuItems&&b.addMenuItem(d,{label:k,command:d,group:"clipboard",order:h})}a("Cut","cut",d("cut"),10,1),a("Copy","copy",d("copy"),20,4),a("Paste","paste",e(),30,8)}(),b.getClipboardData=function(a,c){function d(a){a.removeListener(),a.cancel(),c(a.data)}function e(a){a.removeListener(),a.cancel(),m=!0,c({type:k,dataValue:a.data,method:"paste"})}function f(){this.customTitle=a&&a.title}var h=!1,k="auto",m=!1;c||(c=a,a=null),b.on("paste",d,null,null,0),b.on("beforePaste",function(a){a.removeListener(),h=!0,k=a.data.type},null,null,1e3),!1===B()&&(b.removeListener("paste",d),h&&b.fire("pasteDialog",f)?(b.on("pasteDialogCommit",e),b.on("dialogHide",function(a){a.removeListener(),a.data.removeListener("pasteDialogCommit",e),setTimeout(function(){m||c(null)},10)})):c(null))}}function b(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&&!a.match(/^(
    <\/div>|
    [^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!a.match(/^([^<]|)*$/gi)&&!a.match(/^(

    ([^<]|)*<\/p>|(\r\n))*$/gi))return"html"}else{if(!CKEDITOR.env.gecko)return"html";if(!a.match(/^([^<]|)*$/gi))return"html"}return"htmlifiedtext"}function c(a,b){function c(a){return CKEDITOR.tools.repeat("

    ",~~(a/2))+(1==a%2?"
    ":"")}return b=b.replace(/\s+/g," ").replace(/> +<").replace(/
    /gi,"
    "),b=b.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()}),b.match(/^[^<]$/)?b:(CKEDITOR.env.webkit&&-1")&&(b=b.replace(/^(

    (
    |)<\/div>)(?!$|(
    (
    |)<\/div>))/g,"
    ").replace(/^(
    (
    |)<\/div>){2}(?!$)/g,"
    "),b.match(/
    (
    |)<\/div>/)&&(b="

    "+b.replace(/(

    (
    |)<\/div>)+/g,function(a){return c(a.split("
    ").length+1)})+"

    "),b=b.replace(/<\/div>
    /g,"
    "),b=b.replace(/<\/?div>/g,"")),CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(b=b.replace(/^

    $/,"
    ")),-1
    ")&&(b="

    "+b.replace(/(
    ){2,}/g,function(a){return c(a.length/4)})+"

    ")),l(a,b))}function d(){function a(){var c,b={};for(c in CKEDITOR.dtd)"$"!=c.charAt(0)&&"div"!=c&&"span"!=c&&(b[c]=1);return b}var b={};return{get:function(c){return"plain-text"==c?b.plainText||(b.plainText=new CKEDITOR.filter("br")):"semantic-content"==c?((c=b.semanticContent)||(c=new CKEDITOR.filter,c.allow({$1:{elements:a(),attributes:!0,styles:!1,classes:!1}}),c=b.semanticContent=c),c):c?new CKEDITOR.filter(c):null}}}function m(a,b,c){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var d=new CKEDITOR.htmlParser.basicWriter;return c.applyTo(b,!0,!1,a.activeEnterMode),b.writeHtml(d),d.getHtml()}function l(a,b){return a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p>

    )+/g,function(a){return CKEDITOR.tools.repeat("
    ",a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"<$1div>")),b}function f(a){a.data.preventDefault(),a.data.$.dataTransfer.dropEffect="none"}function h(b){var c=CKEDITOR.plugins.clipboard;b.on("contentDom",function(){function d(c,e,f){e.select(),a(b,{dataTransfer:f,method:"drop"},1),f.sourceEditor.fire("saveSnapshot"),f.sourceEditor.editable().extractHtmlFromRange(c),f.sourceEditor.getSelection().selectRanges([c]),f.sourceEditor.fire("saveSnapshot")}function e(d,f){d.select(),a(b,{dataTransfer:f,method:"drop"},1),c.resetDragDataTransfer()}function f(a,c,d){var e={$:a.data.$,target:a.data.getTarget()};c&&(e.dragRange=c),d&&(e.dropRange=d),!1===b.fire(a.name,e)&&a.data.preventDefault()}function h(a){return a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent()),a.getChildCount()}var k=b.editable(),m=CKEDITOR.plugins.clipboard.getDropTarget(b),l=b.ui.space("top"),B=b.ui.space("bottom");c.preventDefaultDropOnElement(l),c.preventDefaultDropOnElement(B),k.attachListener(m,"dragstart",f),k.attachListener(b,"dragstart",c.resetDragDataTransfer,c,null,1),k.attachListener(b,"dragstart",function(a){c.initDragDataTransfer(a,b)},null,null,2),k.attachListener(b,"dragstart",function(){var a=c.dragRange=b.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(c.dragStartContainerChildCount=a?h(a.startContainer):null,c.dragEndContainerChildCount=a?h(a.endContainer):null)},null,null,100),k.attachListener(m,"dragend",f),k.attachListener(b,"dragend",c.initDragDataTransfer,c,null,1),k.attachListener(b,"dragend",c.resetDragDataTransfer,c,null,100),k.attachListener(m,"dragover",function(a){var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&&a.data.preventDefault()}),k.attachListener(m,"drop",function(a){a.data.preventDefault();var d=a.data.getTarget();if(!d.isReadOnly()||d.type==CKEDITOR.NODE_ELEMENT&&d.is("html")){var d=c.getRangeAtDropPosition(a,b),e=c.dragRange;d&&f(a,e,d)}}),k.attachListener(b,"drop",c.initDragDataTransfer,c,null,1),k.attachListener(b,"drop",function(a){if(a=a.data){var f=a.dropRange,h=a.dragRange,k=a.dataTransfer;k.getTransferType(b)==CKEDITOR.DATA_TRANSFER_INTERNAL?setTimeout(function(){c.internalDrop(h,f,k,b)},0):k.getTransferType(b)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?d(h,f,k):e(f,k)}},null,null,9999)})}CKEDITOR.plugins.add("clipboard",{requires:"dialog",init:function(a){var f,k=d();a.config.forcePasteAsPlainText?f="plain-text":a.config.pasteFilter?f=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(f="semantic-content"),a.pasteFilter=k.get(f),e(a),h(a),CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js")),a.on("paste",function(b){if(b.data.dataTransfer||(b.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer),!b.data.dataValue){var c=b.data.dataTransfer,d=c.getData("text/html");d?(b.data.dataValue=d,b.data.type="html"):(d=c.getData("text/plain"))&&(b.data.dataValue=a.editable().transformPlainTextToHtml(d),b.data.type="text")}},null,null,1),a.on("paste",function(a){var b=a.data.dataValue,c=CKEDITOR.dtd.$block;if(-1 <\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"    ")})),-1')&&(a.data.startsWithEOL=1,a.data.preSniffing="html",b=b.replace(/
    /,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1")),b.match(/^<[^<]+cke_(editable|contents)/i)){var d,e,f=new CKEDITOR.dom.element("div");for(f.setHtml(b);1==f.getChildCount()&&(d=f.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")||d.hasClass("cke_contents"));)f=e=d;e&&(b=e.getHtml().replace(/
    $/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,d){return d.toLowerCase()in c?(a.data.preSniffing="html","<"+d):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)>


    <\/div>$/,function(b,d){return d in c?(a.data.endsWithEOL=1,""):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)
    $/,"$1")),a.data.dataValue=b},null,null,3),a.on("paste",function(d){d=d.data;var h,e=d.type,f=d.dataValue,l=a.config.clipboard_defaultContentType||"html",n=d.dataTransfer.getTransferType(a);h="html"==e||"html"==d.preSniffing?"html":b(f),"htmlifiedtext"==h&&(f=c(a.config,f)),"text"==e&&"html"==h?f=m(a,f,k.get("plain-text")):n==CKEDITOR.DATA_TRANSFER_EXTERNAL&&a.pasteFilter&&!d.dontFilter&&(f=m(a,f,a.pasteFilter)),d.startsWithEOL&&(f='
    '+f),d.endsWithEOL&&(f+='
    '),"auto"==e&&(e="html"==h||"html"==l?"html":"text"),d.type=e,d.dataValue=f,delete d.preSniffing,delete d.startsWithEOL,delete d.endsWithEOL},null,null,6),a.on("paste",function(b){b=b.data,b.dataValue&&(a.insertHtml(b.dataValue,b.type,b.range),setTimeout(function(){a.fire("afterPaste")},0))},null,null,1e3),a.on("pasteDialog",function(b){setTimeout(function(){a.openDialog("paste",b.data)},0)})}}),CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:!CKEDITOR.env.ie&&!CKEDITOR.env.iOS,isCustomDataTypesSupported:!CKEDITOR.env.ie,isFileApiSupported:!CKEDITOR.env.ie||9CKEDITOR.env.version||b.isInline()?b:a.document},fixSplitNodesAfterDrop:function(a,b,c,d){function e(a,c,d){var f=a;return f.type==CKEDITOR.NODE_TEXT&&(f=a.getParent()),f.equals(c)&&d!=c.getChildCount()?(a=b.startContainer.getChild(b.startOffset-1),c=b.startContainer.getChild(b.startOffset),a&&a.type==CKEDITOR.NODE_TEXT&&c&&c.type==CKEDITOR.NODE_TEXT&&(d=a.getLength(),a.setText(a.getText()+c.getText()),c.remove(),b.setStart(a,d),b.collapse(!0)),!0):void 0}var f=b.startContainer;"number"==typeof d&&"number"==typeof c&&f.type==CKEDITOR.NODE_ELEMENT&&(e(a.startContainer,f,c)||e(a.endContainer,f,d))},isDropRangeAffectedByDragRange:function(a,b){var c=b.startContainer,d=b.endOffset;return!!(a.endContainer.equals(c)&&a.endOffset<=d||a.startContainer.getParent().equals(c)&&a.startContainer.getIndex()CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(b,c,f.dragStartContainerChildCount,f.dragEndContainerChildCount),(m=this.isDropRangeAffectedByDragRange(b,c))||(k=b.createBookmark(!1)),f=c.clone().createBookmark(!1),m&&(k=b.createBookmark(!1)),b=k.startNode,c=k.endNode,m=f.startNode,c&&b.getPosition(m)&CKEDITOR.POSITION_PRECEDING&&c.getPosition(m)&CKEDITOR.POSITION_FOLLOWING&&m.insertBefore(b),b=e.createRange(),b.moveToBookmark(k),h.extractHtmlFromRange(b,1),c=e.createRange(),c.moveToBookmark(f),a(e,{dataTransfer:d,method:"drop",range:c},1),e.fire("unlockSnapshot")},getRangeAtDropPosition:function(a,b){var c=a.data.$,d=c.clientX,e=c.clientY,f=b.getSelection(!0).getRanges()[0],h=b.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint)c=b.document.$.caretRangeFromPoint(d,e),h.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset),h.collapse(!0);else if(c.rangeParent)h.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),h.collapse(!0);else{if(CKEDITOR.env.ie&&8m&&!k;m++){if(!k)try{c.moveToPoint(d,e-m),k=!0}catch(l){}if(!k)try{c.moveToPoint(d,e+m),k=!0}catch(v){}}if(k){var y="cke-temp-"+(new Date).getTime();c.pasteHTML('');var C=b.document.getById(y);h.moveToPosition(C,CKEDITOR.POSITION_BEFORE_START),C.remove()}else{var D,x=b.document.$.elementFromPoint(d,e),A=new CKEDITOR.dom.element(x);if(A.equals(b.editable())||"html"==A.getName())return f&&f.startContainer&&!f.startContainer.equals(b.editable())?f:null;D=A.getClientRect(),d/i,bodyRegExp:/([\s\S]*)<\/body>/i,fragmentRegExp:/\x3c!--(?:Start|End)Fragment--\x3e/g,data:{},files:[],normalizeType:function(a){return a=a.toLowerCase(),"text"==a||"text/plain"==a?"Text":"url"==a?"URL":a}},this.id=this.getData(k),this.id||(this.id="Text"==k?"":"cke-"+CKEDITOR.tools.getUniqueId()),"Text"!=k)try{this.$.setData(k,this.id)}catch(c){}b&&(this.sourceEditor=b,this.setData("text/html",b.getSelectedHtml(1)),"Text"==k||this.getData("text/plain")||this.setData("text/plain",b.getSelection().getSelectedText()))},CKEDITOR.DATA_TRANSFER_INTERNAL=1,CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2,CKEDITOR.DATA_TRANSFER_EXTERNAL=3,CKEDITOR.plugins.clipboard.dataTransfer.prototype={getData:function(a){a=this._.normalizeType(a);var b=this._.data[a];if(void 0===b||null===b||""===b)try{b=this.$.getData(a)}catch(c){}return void 0!==b&&null!==b&&""!==b||(b=""),"text/html"==a?(b=b.replace(this._.metaRegExp,""),(a=this._.bodyRegExp.exec(b))&&a.length&&(b=a[1],b=b.replace(this._.fragmentRegExp,""))):"Text"==a&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==b.substring(0,7)&&(b=""),b},setData:function(a,b){if(a=this._.normalizeType(a),this._.data[a]=b,CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"URL"==a||"Text"==a){"Text"==k&&"Text"==a&&(this.id=b);try{this.$.setData(a,b)}catch(c){}}},getTransferType:function(a){return this.sourceEditor?this.sourceEditor==a?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function a(c){c=b._.normalizeType(c);var d=b.getData(c);d&&(b._.data[c]=d)}if(this.$){var c,d,b=this;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(c=0;c {label}{arrowHtml}',e=CKEDITOR.addTemplate("buttonArrow",''+(CKEDITOR.env.hc?"▼":"")+""),b=CKEDITOR.addTemplate("button",a);CKEDITOR.plugins.add("button",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}}),CKEDITOR.UI_BUTTON="button",CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(b){b.execCommand(a.command)}}),this._={}},CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}},CKEDITOR.ui.button.prototype={render:function(a,d){function m(){var b=a.mode;b&&(b=this.modes[b]?void 0!==p[b]?p[b]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,b=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:b,this.setState(b),this.refresh&&this.refresh())}var g,l=CKEDITOR.env,f=this._.id=CKEDITOR.tools.getNextId(),h="",k=this.command;this._.editor=a;var n={id:f,button:this,editor:a,focus:function(){CKEDITOR.document.getById(f).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},q=CKEDITOR.tools.addFunction(function(a){return n.onkey?(a=new CKEDITOR.dom.event(a),!1!==n.onkey(n,a.getKeystroke())):void 0}),t=CKEDITOR.tools.addFunction(function(a){var b;return n.onfocus&&(b=!1!==n.onfocus(n,new CKEDITOR.dom.event(a))),b}),u=0;if(n.clickFn=g=CKEDITOR.tools.addFunction(function(){u&&(a.unlockSelection(1),u=0),n.execute(),l.iOS&&a.focus()}),this.modes){var p={};a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(p[a.mode]=this._.state)},this),a.on("activeFilterChange",m,this),a.on("mode",m,this),!this.readOnly&&a.on("readOnly",m,this)}else k&&(k=a.getCommand(k))&&(k.on("state",function(){this.setState(k.state)},this),h+=k.state==CKEDITOR.TRISTATE_ON?"on":k.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");this.directional&&a.on("contentDirChanged",function(b){var d=CKEDITOR.document.getById(this._.id),e=d.getFirst();b=b.data,b!=a.lang.dir?d.addClass("cke_"+b):d.removeClass("cke_ltr").removeClass("cke_rtl"),e.setAttribute("style",CKEDITOR.skin.getIconStyle(w,"rtl"==b,this.icon,this.iconOffset))},this),k||(h+="off");var r=this.name||this.command,w=r;return this.icon&&!/\./.test(this.icon)&&(w=this.icon,this.icon=null),h={id:f,name:r,iconName:w,label:this.label,cls:this.className||"",state:h,ariaDisabled:"disabled"==h?"true":"false",title:this.title,titleJs:l.gecko&&!l.hc?"":(this.title||"").replace("'",""),hasArrow:this.hasArrow?"true":"false",keydownFn:q,focusFn:t,clickFn:g,style:CKEDITOR.skin.getIconStyle(w,"rtl"==a.lang.dir,this.icon,this.iconOffset),arrowHtml:this.hasArrow?e.output():""},b.output(h,d),this.onRender&&this.onRender(),n},setState:function(a){if(this._.state==a)return!1;this._.state=a;var b=CKEDITOR.document.getById(this._.id);return b?(b.setState(a,"cke_button"),a==CKEDITOR.TRISTATE_DISABLED?b.setAttribute("aria-disabled",!0):b.removeAttribute("aria-disabled"),this.hasArrow?(a=a==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label,CKEDITOR.document.getById(this._.id+"_label").setText(a)):a==CKEDITOR.TRISTATE_ON?b.setAttribute("aria-pressed",!0):b.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var b=this;return this.allowedContent||this.requiredContent||!this.command||(b=a.getCommand(this.command)||b),this._.feature=b}},CKEDITOR.ui.prototype.addButton=function(a,b){this.add(a,CKEDITOR.UI_BUTTON,b)}}(),CKEDITOR.plugins.add("panelbutton",{requires:"button",onLoad:function(){function a(a){var b=this._;b.state!=CKEDITOR.TRISTATE_DISABLED&&(this.createPanel(a),b.on?b.panel.hide():b.panel.showBlock(this._.id,this.document.getById(this._.id),4))}CKEDITOR.ui.panelButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(e){var b=e.panel||{};delete e.panel,this.base(e),this.document=b.parent&&b.parent.getDocument()||CKEDITOR.document,b.block={attributes:b.attributes},this.hasArrow=b.toolbarRelated=!0,this.click=a,this._={panelDefinition:b}},statics:{handler:{create:function(a){return new CKEDITOR.ui.panelButton(a)}}},proto:{createPanel:function(a){var b=this._;if(!b.panel){var c=this._.panelDefinition,d=this._.panelDefinition.block,m=c.parent||CKEDITOR.document.getBody(),l=this._.panel=new CKEDITOR.ui.floatPanel(a,m,c),c=l.addBlock(b.id,d),f=this;l.onShow=function(){f.className&&this.element.addClass(f.className+"_panel"),f.setState(CKEDITOR.TRISTATE_ON),b.on=1,f.editorFocus&&a.focus(),f.onOpen&&f.onOpen()},l.onHide=function(c){f.className&&this.element.getFirst().removeClass(f.className+"_panel"),f.setState(f.modes&&f.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),b.on=0,!c&&f.onClose&&f.onClose()},l.onEscape=function(){l.hide(1),f.document.getById(b.id).focus()},this.onBlock&&this.onBlock(l,c),c.onHide=function(){b.on=0,f.setState(CKEDITOR.TRISTATE_OFF)}}}}})},beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANELBUTTON,CKEDITOR.ui.panelButton.handler)}}),CKEDITOR.UI_PANELBUTTON="panelbutton",function(){CKEDITOR.plugins.add("panel",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}}),CKEDITOR.UI_PANEL="panel",CKEDITOR.ui.panel=function(a,b){b&&CKEDITOR.tools.extend(this,b),CKEDITOR.tools.extend(this,{className:"",css:[]}),this.id=CKEDITOR.tools.getNextId(),this.document=a,this.isFramed=this.forceIFrame||this.css.length,this._={blocks:{}}},CKEDITOR.ui.panel.handler={create:function(a){return new CKEDITOR.ui.panel(a)}};var a=CKEDITOR.addTemplate("panel",''),e=CKEDITOR.addTemplate("panel-frame",''),b=CKEDITOR.addTemplate("panel-frame-inner",'{css}');CKEDITOR.ui.panel.prototype={render:function(c,d){this.getHolderElement=function(){var a=this._.holder;if(!a){if(this.isFramed){var a=this.document.getById(this.id+"_frame"),c=a.getParent(),a=a.getFrameDocument();CKEDITOR.env.iOS&&c.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"}),c=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=!0,this.onLoad&&this.onLoad()},this)),a.write(b.output(CKEDITOR.tools.extend({css:CKEDITOR.tools.buildStyleHtml(this.css),onload:"window.parent.CKEDITOR.tools.callFunction("+c+");"},m))),a.getWindow().$.CKEDITOR=CKEDITOR,a.on("keydown",function(a){var b=a.data.getKeystroke(),c=this.document.getById(this.id).getAttribute("dir");this._.onKeyDown&&!1===this._.onKeyDown(b)?a.data.preventDefault():(27==b||b==("rtl"==c?39:37))&&this.onEscape&&!1===this.onEscape(b)&&a.data.preventDefault()},this),a=a.getBody(),a.unselectable(),CKEDITOR.env.air&&CKEDITOR.tools.callFunction(c)}else a=this.document.getById(this.id);this._.holder=a}return a};var m={editorId:c.id,id:this.id,langCode:c.langCode,dir:c.lang.dir,cls:this.className,frame:"",env:CKEDITOR.env.cssClass,"z-index":c.config.baseFloatZIndex+1};if(this.isFramed){var l=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())":"";m.frame=e.output({id:this.id+"_frame",src:l})}return l=a.output(m),d&&d.push(l),l},addBlock:function(a,b){return b=this._.blocks[a]=b instanceof CKEDITOR.ui.panel.block?b:new CKEDITOR.ui.panel.block(this.getHolderElement(),b),this._.currentBlock||this.showBlock(a),b},getBlock:function(a){return this._.blocks[a]},showBlock:function(a){a=this._.blocks[a];var b=this._.currentBlock,e=!this.forceIFrame||CKEDITOR.env.ie?this._.holder:this.document.getById(this.id+"_frame");return b&&b.hide(),this._.currentBlock=a,CKEDITOR.fire("ariaWidget",e),a._.focusIndex=-1,this._.onKeyDown=a.onKeyDown&&CKEDITOR.tools.bind(a.onKeyDown,a),a.show(),a},destroy:function(){this.element&&this.element.remove()}},CKEDITOR.ui.panel.block=CKEDITOR.tools.createClass({$:function(a,b){this.element=a.append(a.getDocument().createElement("div",{attributes:{tabindex:-1,class:"cke_panel_block"},styles:{display:"none"}})),b&&CKEDITOR.tools.extend(this,b),this.element.setAttributes({role:this.attributes.role||"presentation","aria-label":this.attributes["aria-label"],title:this.attributes.title||this.attributes["aria-label"]}),this.keys={},this._.focusIndex=-1,this.element.disableContextMenu()},_:{markItem:function(a){-1!=a&&(a=this.element.getElementsByTag("a").getItem(this._.focusIndex=a),CKEDITOR.env.webkit&&a.getDocument().getWindow().focus(),a.focus(),this.onMark&&this.onMark(a))}},proto:{show:function(){this.element.setStyle("display","")},hide:function(){this.onHide&&!0===this.onHide.call(this)||this.element.setStyle("display","none")},onKeyDown:function(a,b){var e=this.keys[a];switch(e){case"next":for(var f,l=this._.focusIndex,e=this.element.getElementsByTag("a");f=e.getItem(++l);)if(f.getAttribute("_cke_focus")&&f.$.offsetWidth){this._.focusIndex=l,f.focus();break}return f||b?!1:(this._.focusIndex=-1,this.onKeyDown(a,1));case"prev":for(l=this._.focusIndex,e=this.element.getElementsByTag("a");l>0&&(f=e.getItem(--l));){if(f.getAttribute("_cke_focus")&&f.$.offsetWidth){this._.focusIndex=l,f.focus();break}f=null}return f||b?!1:(this._.focusIndex=e.count(),this.onKeyDown(a,1));case"click":case"mouseup":return l=this._.focusIndex,(f=l>=0&&this.element.getElementsByTag("a").getItem(l))&&(f.$[e]?f.$[e]():f.$["on"+e]()),!1}return!0}}})}(),CKEDITOR.plugins.add("floatpanel",{requires:"panel"}),function(){function a(a,c,d,m,l){l=CKEDITOR.tools.genKey(c.getUniqueId(),d.getUniqueId(),a.lang.dir,a.uiColor||"",m.css||"",l||"");var f=e[l];return f||(f=e[l]=new CKEDITOR.ui.panel(c,m),f.element=d.append(CKEDITOR.dom.element.createFromHtml(f.render(a),c)),f.element.setStyles({display:"none",position:"absolute"})),f}var e={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(b,c,d,e){function l(){g.hide()}d.forceIFrame=1,d.toolbarRelated&&b.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(c=CKEDITOR.document.getById("cke_"+b.name));var f=c.getDocument();e=a(b,f,c,d,e||0);var h=e.element,k=h.getFirst(),g=this;h.disableContextMenu(),this.element=h,this._={editor:b,panel:e,parentElement:c,definition:d,document:f,iframe:k,children:[],dir:b.lang.dir,showBlockParams:null},b.on("mode",l),b.on("resize",l),f.getWindow().on("resize",function(){this.reposition()},this)},proto:{addBlock:function(a,c){return this._.panel.addBlock(a,c)},addListBlock:function(a,c){return this._.panel.addListBlock(a,c)},getBlock:function(a){return this._.panel.getBlock(a)},showBlock:function(a,c,d,e,l,f){var h=this._.panel,k=h.showBlock(a);this._.showBlockParams=[].slice.call(arguments),this.allowBlur(!1);var g=this._.editor.editable();this._.returnFocus=g.hasFocus?g:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement),this._.hideTimeout=0;var n=this.element,g=this._.iframe,g=CKEDITOR.env.ie&&!CKEDITOR.env.edge?g:new CKEDITOR.dom.window(g.$.contentWindow),q=n.getDocument(),t=this._.parentElement.getPositionedAncestor(),u=c.getDocumentPosition(q),q=t?t.getDocumentPosition(q):{x:0,y:0},p="rtl"==this._.dir,r=u.x+(e||0)-q.x,w=u.y+(l||0)-q.y;!p||1!=d&&4!=d?p||2!=d&&3!=d||(r+=c.$.offsetWidth-1):r+=c.$.offsetWidth,3!=d&&4!=d||(w+=c.$.offsetHeight-1),this._.panel._.offsetParentId=c.getId(),n.setStyles({top:w+"px",left:0,display:""}),n.setOpacity(0),n.getFirst().removeStyle("width"),this._.editor.focusManager.add(g),this._.blurSet||(CKEDITOR.event.useCapture=!0,g.on("blur",function(a){function b(){delete this._.returnFocus,this.hide()}this.allowBlur()&&a.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&this.visible&&!this._.activeChild&&(CKEDITOR.env.iOS?this._.hideTimeout||(this._.hideTimeout=CKEDITOR.tools.setTimeout(b,0,this)):b.call(this))},this),g.on("focus",function(){this._.focused=!0,this.hideChild(),this.allowBlur(!0)},this),CKEDITOR.env.iOS&&(g.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this),g.on("touchend",function(){this._.hideTimeout=0,this.focus()},this)),CKEDITOR.event.useCapture=!1,this._.blurSet=1),h.onEscape=CKEDITOR.tools.bind(function(a){return this.onEscape&&!1===this.onEscape(a)?!1:void 0},this),CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.tools.bind(function(){var a=n;if(a.removeStyle("width"),k.autoSize){var b=k.element.getDocument(),b=(CKEDITOR.env.webkit?k.element:b.getBody()).$.scrollWidth;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&b>0&&(b+=(a.$.offsetWidth||0)-(a.$.clientWidth||0)+3),a.setStyle("width",b+10+"px"),b=k.element.$.scrollHeight,CKEDITOR.env.ie&&CKEDITOR.env.quirks&&b>0&&(b+=(a.$.offsetHeight||0)-(a.$.clientHeight||0)+3),a.setStyle("height",b+"px"),h._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");p&&(r-=n.$.offsetWidth),n.setStyle("left",r+"px");var b=h.element.getWindow(),a=n.$.getBoundingClientRect(),b=b.getViewPaneSize(),c=a.width||a.right-a.left,d=a.height||a.bottom-a.top,e=p?a.right:b.width-a.left,g=p?b.width-a.right:a.left;p?c>e&&(r=g>c?r+c:b.width>c?r-a.left:r-a.right+b.width):c>e&&(r=g>c?r-c:b.width>c?r-a.right+b.width:r-a.left),c=a.top,b.height-a.topd?w-d:b.height>d?w-a.bottom+b.height:w-a.top),CKEDITOR.env.ie&&(b=a=new CKEDITOR.dom.element(n.$.offsetParent),"html"==b.getName()&&(b=b.getDocument().getBody()),"rtl"==b.getComputedStyle("direction")&&(r=CKEDITOR.env.ie8Compat?r-2*n.getDocument().getDocumentElement().$.scrollLeft:r-(a.$.scrollWidth-a.$.clientWidth)));var m,a=n.getFirst();(m=a.getCustomData("activePanel"))&&m.onHide&&m.onHide.call(this,1),a.setCustomData("activePanel",this),n.setStyles({top:w+"px",left:r+"px"}),n.setOpacity(1),f&&f()},this);h.isLoaded?a():h.onLoad=a,CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus(),k.element.focus(),CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=a),this.allowBlur(!0),this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this),this.visible=1,this.onShow&&this.onShow.call(this)},reposition:function(){var a=this._.showBlockParams;this.visible&&this._.showBlockParams&&(this.hide(),this.showBlock.apply(this,a))},focus:function(){if(CKEDITOR.env.webkit){var a=CKEDITOR.document.getActive();a&&!a.equals(this._.iframe)&&a.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var a=this._.iframe.getFrameDocument().getActive();a&&a.is("a")&&(this._.lastFocused=a)},hide:function(a){!this.visible||this.onHide&&!0===this.onHide.call(this)||(this.hideChild(),CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur(),this.element.setStyle("display","none"),this.visible=0,this.element.getFirst().removeCustomData("activePanel"),(a=a&&this._.returnFocus)&&(CKEDITOR.env.webkit&&a.type&&a.getWindow().$.focus(),a.focus()),delete this._.lastFocused,this._.showBlockParams=null,this._.editor.fire("panelHide",this))},allowBlur:function(a){var c=this._.panel;return void 0!==a&&(c.allowBlur=a),c.allowBlur},showAsChild:function(a,c,d,e,l,f){this._.activeChild==a&&a._.panel._.offsetParentId==d.getId()||(this.hideChild(),a.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=a,this._.focused=!1,a.showBlock(c,d,e,l,f),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){a.element.getChild(0).$.style.cssText+=""},100))},hideChild:function(a){var c=this._.activeChild;c&&(delete c.onHide,delete this._.activeChild,c.hide(),a&&this.focus())}}}),CKEDITOR.on("instanceDestroyed",function(){var c,a=CKEDITOR.tools.isEmpty(CKEDITOR.instances);for(c in e){var d=e[c];a?d.destroy():d.element.hide()}a&&(e={})})}(),CKEDITOR.plugins.add("colorbutton",{requires:"panelbutton,floatpanel",init:function(a){function e(c,e,h,k){var g=new CKEDITOR.style(d["colorButton_"+e+"Style"]),n=CKEDITOR.tools.getNextId()+"_colorBox";a.ui.add(c,CKEDITOR.UI_PANELBUTTON,{label:h,title:h,modes:{wysiwyg:1},editorFocus:0,toolbar:"colors,"+k,allowedContent:g,requiredContent:g,panel:{css:CKEDITOR.skin.getPath("editor"),attributes:{role:"listbox","aria-label":m.panelTitle}},onBlock:function(c,d){d.autoSize=!0,d.element.addClass("cke_colorblock"),d.element.setHtml(b(c,e,n)),d.element.getDocument().getBody().setStyle("overflow","hidden"),CKEDITOR.ui.fire("ready",this);var g=d.keys,h="rtl"==a.lang.dir;g[h?37:39]="next",g[40]="next",g[9]="next",g[h?39:37]="prev",g[38]="prev",g[CKEDITOR.SHIFT+9]="prev",g[32]="click"},refresh:function(){a.activeFilter.check(g)||this.setState(CKEDITOR.TRISTATE_DISABLED)},onOpen:function(){var c,b=a.getSelection(),b=b&&b.getStartElement(),b=a.elementPath(b);if(b){b=b.block||b.blockLimit||a.document.getBody();do c=b&&b.getComputedStyle("back"==e?"background-color":"color")||"transparent";while("back"==e&&"transparent"==c&&b&&(b=b.getParent()));return c&&"transparent"!=c||(c="#ffffff"),this._.panel._.iframe.getFrameDocument().getById(n).setStyle("background-color",c),c}}})}function b(b,e,h){var k=[],g=d.colorButton_colors.split(","),n=a.plugins.colordialog&&!1!==d.colorButton_enableMore,q=g.length+(n?2:1),t=CKEDITOR.tools.addFunction(function(e,f){function g(a){this.removeListener("ok",g),this.removeListener("cancel",g),"ok"==a.name&&h(this.getContentElement("picker","selectedColor").getValue(),f)}var h=arguments.callee;if("?"==e)a.openDialog("colordialog",function(){this.on("ok",g),this.on("cancel",g)});else{if(a.focus(),b.hide(),a.fire("saveSnapshot"),a.removeStyle(new CKEDITOR.style(d["colorButton_"+f+"Style"],{color:"inherit"})),e){var k=d["colorButton_"+f+"Style"];k.childRule="back"==f?function(a){return c(a)}:function(a){return!(a.is("a")||a.getElementsByTag("a").count())||c(a)},a.applyStyle(new CKEDITOR.style(k,{color:e}))}a.fire("saveSnapshot")}});for(k.push('
    ',m.auto,'
    '),h=0;h");var u=g[h].split("/"),p=u[0],r=u[1]||p;u[1]||(p="#"+p.replace(/^(.)(.)(.)$/,"$1$1$2$2$3$3")),u=a.lang.colorbutton.colors[r]||r,k.push('')}return n&&k.push('"),k.push("
    ',m.more,"
    "),k.join("")}function c(a){return"false"==a.getAttribute("contentEditable")||a.getAttribute("data-nostyle")}var d=a.config,m=a.lang.colorbutton;CKEDITOR.env.hc||(e("TextColor","fore",m.textColorTitle,10),e("BGColor","back",m.bgColorTitle,20))}}),CKEDITOR.config.colorButton_colors="000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF",CKEDITOR.config.colorButton_foreStyle={element:"span",styles:{color:"#(color)"},overrides:[{element:"font",attributes:{color:null}}]},CKEDITOR.config.colorButton_backStyle={element:"span",styles:{"background-color":"#(color)"}},CKEDITOR.plugins.colordialog={requires:"dialog",init:function(a){var e=new CKEDITOR.dialogCommand("colordialog");e.editorFocus=!1,a.addCommand("colordialog",e),CKEDITOR.dialog.add("colordialog",this.path+"dialogs/colordialog.js"),a.getColorFromDialog=function(b,c){var d=function(a){this.removeListener("ok",d),this.removeListener("cancel",d),a="ok"==a.name?this.getValueOf("picker","selectedColor"):null,b.call(c,a)},e=function(a){a.on("ok",d),a.on("cancel",d)};a.execCommand("colordialog"),a._.storedDialogs&&a._.storedDialogs.colordialog?e(a._.storedDialogs.colordialog):CKEDITOR.on("dialogDefinition",function(a){if("colordialog"==a.data.name){var b=a.data.definition;a.removeListener(),b.onLoad=CKEDITOR.tools.override(b.onLoad,function(a){return function(){e(this),b.onLoad=a,"function"==typeof a&&a.call(this)}})}})}}},CKEDITOR.plugins.add("colordialog",CKEDITOR.plugins.colordialog),CKEDITOR.plugins.add("menu",{requires:"floatpanel",beforeInit:function(a){for(var e=a.config.menu_groups.split(","),b=a._.menuGroups={},c=a._.menuItems={},d=0;db.group?1:a.orderb.order?1:0})}var e=''),b=CKEDITOR.addTemplate("menuItem",e+'{label}{arrowHtml}'),c=CKEDITOR.addTemplate("menuArrow",'{label}');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(a,b){b=this._.definition=b||{},this.id=CKEDITOR.tools.getNextId(),this.editor=a,this.items=[],this._.listeners=[],this._.level=b.level||1;var c=CKEDITOR.tools.extend({},b.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),e=c.block.attributes=c.attributes||{};!e.role&&(e.role="menu"),this._.panelDefinition=c},_:{onShow:function(){var a=this.editor.getSelection(),b=a&&a.getStartElement(),c=this.editor.elementPath(),e=this._.listeners;this.removeAll();for(var h=0;h'],t=h.length,u=t&&h[0].group,p=0;t>p;p++){var r=h[p];u!=r.group&&(q.push(''),u=r.group),r.render(this,p,q)}q.push("
    "),n.setHtml(q.join("")),CKEDITOR.ui.fire("ready",this),this.parent?this.parent._.panel.showAsChild(g,this.id,b,c,e,f):g.showBlock(this.id,b,c,e,f),k.fire("menuShow",[g])}},addListener:function(a){this._.listeners.push(a)},hide:function(a){this._.onHide&&this._.onHide(),this._.panel&&this._.panel.hide(a)}}}),CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,b,c){CKEDITOR.tools.extend(this,c,{order:0,className:"cke_menubutton__"+b}),this.group=a._.menuGroups[this.group],this.editor=a,this.name=b},proto:{render:function(a,e,l){var f=a.id+String(e),h="undefined"==typeof this.state?CKEDITOR.TRISTATE_OFF:this.state,k="",g=h==CKEDITOR.TRISTATE_ON?"on":h==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(k=' aria-checked="'+(h==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var n=this.getItems,q="&#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",t=this.name;this.icon&&!/\./.test(this.icon)&&(t=this.icon),a={id:f,name:this.name,iconName:t,label:this.label,cls:this.className||"",state:g,hasPopup:n?"true":"false",disabled:h==CKEDITOR.TRISTATE_DISABLED,title:this.label,href:"javascript:void('"+(this.label||"").replace("'")+"')",hoverFn:a._.itemOverFn,moveOutFn:a._.itemOutFn,clickFn:a._.itemClickFn,index:e,iconStyle:CKEDITOR.skin.getIconStyle(t,"rtl"==this.editor.lang.dir,t==this.icon?null:this.icon,this.iconOffset),arrowHtml:n?c.output({label:q}):"",role:this.role?this.role:"menuitem",ariaChecked:k},b.output(a,l)}}})}(),CKEDITOR.config.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div",CKEDITOR.plugins.add("contextmenu",{requires:"menu",onLoad:function(){CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({base:CKEDITOR.menu,$:function(a){this.base.call(this,a,{panel:{className:"cke_menu_panel",attributes:{"aria-label":a.lang.contextmenu.options}}})},proto:{addTarget:function(a,e){if(a.on("contextmenu",function(a){a=a.data;var c=CKEDITOR.env.webkit?b:CKEDITOR.env.mac?a.$.metaKey:a.$.ctrlKey;if(!e||!c){if(a.preventDefault(),CKEDITOR.env.mac&&CKEDITOR.env.webkit){var c=this.editor,l=new CKEDITOR.dom.elementPath(a.getTarget(),c.editable()).contains(function(a){return a.hasAttribute("contenteditable")},!0);l&&"false"==l.getAttribute("contenteditable")&&c.getSelection().fake(l)}var l=a.getTarget().getDocument(),f=a.getTarget().getDocument().getDocumentElement(),c=!l.equals(CKEDITOR.document),l=l.getWindow().getScrollPosition(),h=c?a.$.clientX:a.$.pageX||l.x+a.$.clientX,k=c?a.$.clientY:a.$.pageY||l.y+a.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(f,null,h,k)},CKEDITOR.env.ie?200:0,this)}},this),CKEDITOR.env.webkit){var b,c=function(){b=0};a.on("keydown",function(a){b=CKEDITOR.env.mac?a.data.$.metaKey:a.data.$.ctrlKey}),a.on("keyup",c),a.on("contextmenu",c)}},open:function(a,e,b,c){this.editor.focus(),a=a||CKEDITOR.document.getDocumentElement(),this.editor.selectionChange(1),this.show(a,e,b,c)}}})},beforeInit:function(a){var e=a.contextMenu=new CKEDITOR.plugins.contextMenu(a);a.on("contentDom",function(){e.addTarget(a.editable(),!1!==a.config.browserContextMenuOnCtrl)}),a.addCommand("contextMenu",{exec:function(){a.contextMenu.open(a.document.getBody())}}),a.setKeystroke(CKEDITOR.SHIFT+121,"contextMenu"),a.setKeystroke(CKEDITOR.CTRL+CKEDITOR.SHIFT+121,"contextMenu")}}),function(){function a(a){var b=this.att;a=a&&a.hasAttribute(b)&&a.getAttribute(b)||"",void 0!==a&&this.setValue(a)}function e(){for(var a,b=0;b '),delete g.list}var k,h=a.ui.spaceId("path"),g=a._.elementsPath,n=g.idBase;b.html+=''+a.lang.elementspath.eleLabel+' ',a.on("uiReady",function(){var b=a.ui.space("path");b&&a.focusManager.add(b,1)}),g.onClick=l;var q=CKEDITOR.tools.addFunction(l),t=CKEDITOR.tools.addFunction(function(b,c){var f,e=g.idBase;switch(c=new CKEDITOR.dom.event(c),f="rtl"==a.lang.dir,c.getKeystroke()){case f?39:37:case 9:return(f=CKEDITOR.document.getById(e+(b+1)))||(f=CKEDITOR.document.getById(e+"0")),f.focus(),!1;case f?37:39:case CKEDITOR.SHIFT+9:return(f=CKEDITOR.document.getById(e+(b-1)))||(f=CKEDITOR.document.getById(e+(g.list.length-1))),f.focus(),!1;case 27:return a.focus(),!1;case 13:case 32:return l(b),!1}return!0});a.on("selectionChange",function(){for(var v,b=[],e=g.list=[],f=[],l=g.filters,m=!0,B=a.elementPath().elements,y=B.length;y--;){var C=B[y],x=0;v=C.data("cke-display-name")?C.data("cke-display-name"):C.data("cke-real-element-type")?C.data("cke-real-element-type"):C.getName(),(m=C.hasAttribute("contenteditable")?"true"==C.getAttribute("contenteditable"):m)||C.hasAttribute("contenteditable")||(x=1);for(var A=0;Al;l++)v=f[l],m=a.lang.elementspath.eleTitle.replace(/%1/,v),v=c.output({id:n+l,label:m,text:v,jsTitle:"javascript:void('"+v+"')",index:l,keyDownFn:t,clickFn:q}),b.unshift(v);k||(k=CKEDITOR.document.getById(h)),f=k,f.setHtml(b.join("")+' '),a.fire("elementsPathUpdate",{space:f})}),a.on("readOnly",f),a.on("contentDomUnload",f),a.addCommand("elementsPathFocus",e.toolbarFocus),a.setKeystroke(CKEDITOR.ALT+122,"elementsPathFocus")}var e={toolbarFocus:{editorFocus:!1,readOnly:1,exec:function(a){(a=CKEDITOR.document.getById(a._.elementsPath.idBase+"0"))&&a.focus(CKEDITOR.env.ie||CKEDITOR.env.air)}}},b="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(b+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(b+=' onblur="this.style.cssText = this.style.cssText;"');var c=CKEDITOR.addTemplate("pathItem",'{text}');CKEDITOR.plugins.add("elementspath",{init:function(b){b._.elementsPath={idBase:"cke_elementspath_"+CKEDITOR.tools.getNextNumber()+"_",filters:[]},b.on("uiSpace",function(c){"bottom"==c.data.space&&a(b,c.data)})}})}(),function(){function a(a,b,c){c=a.config.forceEnterMode||c,"wysiwyg"==a.mode&&(b||(b=a.activeEnterMode),a.elementPath().isContextFor("p")||(b=CKEDITOR.ENTER_BR,c=1),a.fire("saveSnapshot"),b==CKEDITOR.ENTER_BR?l(a,b,null,c):f(a,b,null,c),a.fire("saveSnapshot"))}function e(a){a=a.getSelection().getRanges(!0);for(var b=a.length-1;b>0;b--)a[b].deleteContents();return a[0]}function b(a){var b=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&"true"==a.getAttribute("contenteditable")},!0);return a.root.equals(b)?a:(b=new CKEDITOR.dom.range(b),b.moveToRange(a),b)}CKEDITOR.plugins.add("enterkey",{init:function(b){b.addCommand("enter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(b){a(b)}}),b.addCommand("shiftEnter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(b){a(b,b.activeShiftEnterMode,1)}}),b.setKeystroke([[13,"enter"],[CKEDITOR.SHIFT+13,"shiftEnter"]])}});var c=CKEDITOR.dom.walker.whitespaces(),d=CKEDITOR.dom.walker.bookmark();CKEDITOR.plugins.enterkey={enterBlock:function(a,f,m,q){if(m=m||e(a)){m=b(m);var B,t=m.document,u=m.checkStartOfBlock(),p=m.checkEndOfBlock(),r=a.elementPath(m.startContainer),w=r.block,z=f==CKEDITOR.ENTER_DIV?"div":"p";if(u&&p){if(w&&(w.is("li")||w.getParent().is("li"))){w.is("li")||(w=w.getParent()),m=w.getParent(),B=m.getParent(),q=!w.hasPrevious();var v=!w.hasNext(),z=a.getSelection(),y=z.createBookmarks(),u=w.getDirection(1),p=w.getAttribute("class"),C=w.getAttribute("style"),x=B.getDirection(1)!=u;if(a=a.enterMode!=CKEDITOR.ENTER_BR||x||C||p,B.is("li"))q||v?(q&&v&&m.remove(),w[v?"insertAfter":"insertBefore"](B)):w.breakParent(B);else{if(a)r.block.is("li")?(B=t.createElement(f==CKEDITOR.ENTER_P?"p":"div"),x&&B.setAttribute("dir",u),C&&B.setAttribute("style",C),p&&B.setAttribute("class",p),w.moveChildren(B)):B=r.block,q||v?B[q?"insertBefore":"insertAfter"](m):(w.breakParent(m),B.insertAfter(m));else if(w.appendBogus(!0),q||v)for(;t=w[q?"getFirst":"getLast"]();)t[q?"insertBefore":"insertAfter"](m);else for(w.breakParent(m);t=w.getLast();)t.insertAfter(m);w.remove()}return void z.selectBookmarks(y)}if(w&&w.getParent().is("blockquote"))return w.breakParent(w.getParent()),w.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||w.getPrevious().remove(),w.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||w.getNext().remove(),m.moveToElementEditStart(w),void m.select()}else if(w&&w.is("pre")&&!p)return void l(a,f,m,q);if(u=m.splitBlock(z)){if(f=u.previousBlock,w=u.nextBlock,r=u.wasStartOfBlock,a=u.wasEndOfBlock,w?(y=w.getParent(),y.is("li")&&(w.breakParent(y),w.move(w.getNext(),1))):f&&(y=f.getParent())&&y.is("li")&&(f.breakParent(y),y=f.getNext(),m.moveToElementEditStart(y),f.move(f.getPrevious())),r||a){if(f?(f.is("li")||!h.test(f.getName())&&!f.is("pre"))&&(B=f.clone()):w&&(B=w.clone()),B?q&&!B.is("li")&&B.renameNode(z):y&&y.is("li")?B=y:(B=t.createElement(z),f&&(v=f.getDirection())&&B.setAttribute("dir",v)),t=u.elementPath)for(q=0,z=t.elements.length;z>q&&(y=t.elements[q],!y.equals(t.block)&&!y.equals(t.blockLimit));q++)CKEDITOR.dtd.$removeEmpty[y.getName()]&&(y=y.clone(),B.moveChildren(y),B.append(y));B.appendBogus(),B.getParent()||m.insertNode(B),B.is("li")&&B.removeAttribute("value"),!CKEDITOR.env.ie||!r||a&&f.getChildCount()||(m.moveToElementEditStart(a?f:B),m.select()),m.moveToElementEditStart(r&&!a?w:B)}else w.is("li")&&(B=m.clone(),B.selectNodeContents(w),B=new CKEDITOR.dom.walker(B),B.evaluator=function(a){return!(d(a)||c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in CKEDITOR.dtd.$inline&&!(a.getName()in CKEDITOR.dtd.$empty))},(y=B.next())&&y.type==CKEDITOR.NODE_ELEMENT&&y.is("ul","ol")&&(CKEDITOR.env.needsBrFiller?t.createElement("br"):t.createText(" ")).insertBefore(y)),w&&m.moveToElementEditStart(w);m.select(),m.scrollIntoView()}}},enterBr:function(a,b,c,d){if(c=c||e(a)){var m=c.document,l=c.checkEndOfBlock(),p=new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()),r=p.block,w=r&&p.block.getName();d||"li"!=w?(!d&&l&&h.test(w)?(l=r.getDirection())?(m=m.createElement("div"),m.setAttribute("dir",l),m.insertAfter(r),c.setStart(m,0)):(m.createElement("br").insertAfter(r),CKEDITOR.env.gecko&&m.createText("").insertAfter(r),c.setStartAt(r.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START)):(a="pre"==w&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?m.createText("\r"):m.createElement("br"),c.deleteContents(),c.insertNode(a),CKEDITOR.env.needsBrFiller?(m.createText("\ufeff").insertAfter(a),l&&(r||p.blockLimit).appendBogus(),a.getNext().$.nodeValue="",c.setStartAt(a.getNext(),CKEDITOR.POSITION_AFTER_START)):c.setStartAt(a,CKEDITOR.POSITION_AFTER_END)),c.collapse(!0),c.select(),c.scrollIntoView()):f(a,b,c,d)}}};var m=CKEDITOR.plugins.enterkey,l=m.enterBr,f=m.enterBlock,h=/^h[1-6]$/}(),function(){function a(a,b){var c={},d=[],m={nbsp:" ",shy:"­",gt:">",lt:"<",amp:"&",apos:"'",quot:'"'};if(a=a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(a,e){var f=b?"&"+e+";":m[e];return c[f]=b?m[e]:"&"+e+";",d.push(f),""}),!b&&a){a=a.split(",");var f,l=document.createElement("div");for(l.innerHTML="&"+a.join(";&")+";",f=l.innerHTML,l=null,l=0;le&&(e=640),420>b&&(b=420);var d=parseInt((window.screen.height-b)/2,10),m=parseInt((window.screen.width-e)/2,10);c=(c||"location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes")+",width="+e+",height="+b+",top="+d+",left="+m;var l=window.open("",null,c,!0);if(!l)return!1;try{-1==navigator.userAgent.toLowerCase().indexOf(" chrome/")&&(l.moveTo(m,d),l.resizeTo(e,b)),l.focus(),l.location.href=a}catch(f){window.open(a,null,c,!0)}return!0}}),function(){function a(a,b){var c=[];if(!b)return a;for(var d in b)c.push(d+"="+encodeURIComponent(b[d]));return a+(-1!=a.indexOf("?")?"&":"?")+c.join("&")}function e(a){return a+="",a.charAt(0).toUpperCase()+a.substr(1)}function b(){var b=this.getDialog(),c=b.getParentEditor();c._.filebrowserSe=this;var d=c.config["filebrowser"+e(b.getName())+"WindowWidth"]||c.config.filebrowserWindowWidth||"80%",b=c.config["filebrowser"+e(b.getName())+"WindowHeight"]||c.config.filebrowserWindowHeight||"70%",f=this.filebrowser.params||{};f.CKEditor=c.name,f.CKEditorFuncNum=c._.filebrowserFn,f.langCode||(f.langCode=c.langCode),f=a(this.filebrowser.url,f),c.popup(f,d,b,c.config.filebrowserWindowFeatures||c.config.fileBrowserWindowFeatures)}function c(){var a=this.getDialog();return a.getParentEditor()._.filebrowserSe=this,!(!a.getContentElement(this.for[0],this.for[1]).getInputElement().$.value||!a.getContentElement(this.for[0],this.for[1]).getAction())}function d(b,c,d){var e=d.params||{};e.CKEditor=b.name,e.CKEditorFuncNum=b._.filebrowserFn,e.langCode||(e.langCode=b.langCode),c.action=a(d.url,e),c.filebrowser=d}function m(a,f,g,l){if(l&&l.length)for(var q,t=l.length;t--;)if(q=l[t],"hbox"!=q.type&&"vbox"!=q.type&&"fieldset"!=q.type||m(a,f,g,q.children),q.filebrowser)if("string"==typeof q.filebrowser&&(q.filebrowser={action:"fileButton"==q.type?"QuickUpload":"Browse",target:q.filebrowser}),"Browse"==q.filebrowser.action){var u=q.filebrowser.url;void 0===u&&(u=a.config["filebrowser"+e(f)+"BrowseUrl"],void 0===u&&(u=a.config.filebrowserBrowseUrl)),u&&(q.onClick=b,q.filebrowser.url=u,q.hidden=!1)}else if("QuickUpload"==q.filebrowser.action&&q.for&&(u=q.filebrowser.url,void 0===u&&(u=a.config["filebrowser"+e(f)+"UploadUrl"],void 0===u&&(u=a.config.filebrowserUploadUrl)),u)){var p=q.onClick;q.onClick=function(a){var b=a.sender;return p&&!1===p.call(b,a)?!1:c.call(b,a)},q.filebrowser.url=u,q.hidden=!1,d(a,g.getContents(q.for[0]).get(q.for[1]),q.filebrowser)}}function l(a,b,c){if(-1!==c.indexOf(";")){c=c.split(";");for(var d=0;dw.height-r.bottom?"pin":"bottom"),f=w.width/2,f=d.floatSpacePreferRight?"right":0p.width?"rtl"==d.contentsLangDirection?"right":"left":f-r.left>r.right-f?"left":"right",p.width>w.width?(f="left",n=0):(n="left"==f?0w.width&&(f="left"==f?"right":"left",n=0)),h.setStyle(f,b(("pin"==k?C:v)+n+("pin"==k?0:"left"==f?B:-B)))):(k="pin",g("pin"),l(f))}}}();if(m){var f=new CKEDITOR.template('
    "+(a.title?'{voiceLabel}':" ")+'
    '),h=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(f.output({content:m,id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(d.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),k=CKEDITOR.tools.eventsBuffer(500,l),g=CKEDITOR.tools.eventsBuffer(100,l);h.unselectable(),h.on("mousedown",function(a){a=a.data,a.getTarget().hasAscendant("a",1)||a.preventDefault()}),a.on("focus",function(b){l(b),a.on("change",k.input),e.on("scroll",g.input),e.on("resize",g.input)}),a.on("blur",function(){h.hide(),a.removeListener("change",k.input),e.removeListener("scroll",g.input),e.removeListener("resize",g.input)}),a.on("destroy",function(){e.removeListener("scroll",g.input),e.removeListener("resize",g.input),h.clearCustomData(),h.remove()}),a.focusManager.hasFocus&&h.show(),a.focusManager.add(h,1)}}var e=CKEDITOR.document.getWindow(),b=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(b){b.on("loaded",function(){a(this)},null,null,20)}})}(),CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var a=CKEDITOR.addTemplate("panel-list",''),e=CKEDITOR.addTemplate("panel-list-item",''),b=CKEDITOR.addTemplate("panel-list-group",'

    {label}

    '),c=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,b){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),b))},CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,b){b=b||{};var c=b.attributes||(b.attributes={});(this.multiSelect=!!b.multiSelect)&&(c["aria-multiselectable"]=!0),!c.role&&(c.role="listbox"),this.base.apply(this,arguments),this.element.setAttribute("role",c.role),c=this.keys,c[40]="next",c[9]="next",c[38]="prev",c[CKEDITOR.SHIFT+9]="prev",c[32]=CKEDITOR.env.ie?"mouseup":"click",CKEDITOR.env.ie&&(c[13]="mouseup"),this._.pendingHtml=[],this._.pendingList=[],this._.items={},this._.groups={}},_:{close:function(){if(this._.started){var b=a.output({items:this._.pendingList.join("")});this._.pendingList=[],this._.pendingHtml.push(b),delete this._.started}},getClick:function(){return this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var b=this.toggle(a);this.onClick&&this.onClick(a,b)},this)),this._.click}},proto:{add:function(a,b,l){var f=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0),this._.items[a]=f;var h;h=CKEDITOR.tools.htmlEncodeAttr(a).replace(c,"\\'"),a={id:f,val:h,onclick:CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(l||a),text:b||a},this._.pendingList.push(e.output(a))},startGroup:function(a){this._.close();var c=CKEDITOR.tools.getNextId();this._.groups[a]=c,this._.pendingHtml.push(b.output({id:c,label:a}))},commit:function(){this._.close(),this.element.appendHtml(this._.pendingHtml.join("")),delete this._.size,this._.pendingHtml=[]},toggle:function(a){var b=this.isMarked(a);return b?this.unmark(a):this.mark(a),!b},hideGroup:function(a){var b=(a=this.element.getDocument().getById(this._.groups[a]))&&a.getNext();a&&(a.setStyle("display","none"),b&&"ul"==b.getName()&&b.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var e,a=this._.items,b=this._.groups,c=this.element.getDocument();for(e in a)c.getById(a[e]).setStyle("display","");for(var h in b)a=c.getById(b[h]),e=a.getNext(),a.setStyle("display",""),e&&"ul"==e.getName()&&e.setStyle("display","")},mark:function(a){this.multiSelect||this.unmarkAll(),a=this._.items[a];var b=this.element.getDocument().getById(a);b.addClass("cke_selected"),this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0),this.onMark&&this.onMark(b)},unmark:function(a){var b=this.element.getDocument();a=this._.items[a];var c=b.getById(a);c.removeClass("cke_selected"),b.getById(a+"_option").removeAttribute("aria-selected"),this.onUnmark&&this.onUnmark(c)},unmarkAll:function(){var c,a=this._.items,b=this.element.getDocument();for(c in a){var e=a[c];b.getById(e).removeClass("cke_selected"),b.getById(e+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var c,b=this.element.getElementsByTag("a"),e=-1;if(a){for(c=this.element.getDocument().getById(this._.items[a]).getFirst();a=b.getItem(++e);)if(a.equals(c)){this._.focusIndex=e;break}}else this.element.focus();c&&setTimeout(function(){c.focus()},0)}}})}}),CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}}),function(){var a='{label}{label}'+(CKEDITOR.env.hc?"▼":CKEDITOR.env.air?" ":"")+""),e=CKEDITOR.addTemplate("combo",a);CKEDITOR.UI_RICHCOMBO="richcombo",CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(a){CKEDITOR.tools.extend(this,a,{canGroup:!1,title:a.label,modes:{wysiwyg:1},editorFocus:1}),a=this.panel||{},delete this.panel,this.id=CKEDITOR.tools.getNextNumber(),this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document,a.className="cke_combopanel",a.block={multiSelect:a.multiSelect,attributes:a.attributes},a.toolbarRelated=!0,this._={panelDefinition:a,items:{}}},proto:{renderHtml:function(a){var c=[];return this.render(a,c),c.join("")},render:function(a,c){function d(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var c=this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(c=CKEDITOR.TRISTATE_DISABLED),this.setState(c),this.setValue(""),c!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var m=CKEDITOR.env,l="cke_"+this.id,f=CKEDITOR.tools.addFunction(function(c){q&&(a.unlockSelection(1),q=0),k.execute(c)},this),h=this,k={id:l,combo:this,focus:function(){CKEDITOR.document.getById(l).getChild(1).focus()},execute:function(c){var d=h._;if(d.state!=CKEDITOR.TRISTATE_DISABLED)if(h.createPanel(a),d.on)d.panel.hide();else{h.commit();var e=h.getValue();e?d.list.mark(e):d.list.unmarkAll(),d.panel.showBlock(h.id,new CKEDITOR.dom.element(c),4)}},clickFn:f};a.on("activeFilterChange",d,this),a.on("mode",d,this),a.on("selectionChange",d,this),!this.readOnly&&a.on("readOnly",d,this);var g=CKEDITOR.tools.addFunction(function(c,d){c=new CKEDITOR.dom.event(c);var e=c.getKeystroke();switch(40==e&&a.once("panelShow",function(a){a.data._.panel._.currentBlock.onKeyDown(40)}),e){case 13:case 32:case 40:CKEDITOR.tools.callFunction(f,d);break;default:k.onkey(k,e)}c.preventDefault()}),n=CKEDITOR.tools.addFunction(function(){k.onfocus&&k.onfocus()}),q=0;return k.keyDownFn=g,m={id:l,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:m.gecko&&!m.hc?"":(this.title||"").replace("'",""),keydownFn:g,focusFn:n,clickFn:f},e.output(m,c),this.onRender&&this.onRender(),k},createPanel:function(a){if(!this._.panel){var c=this._.panelDefinition,d=this._.panelDefinition.block,e=c.parent||CKEDITOR.document.getBody(),l="cke_combopanel__"+this.name,f=new CKEDITOR.ui.floatPanel(a,e,c),h=f.addListBlock(this.id,d),k=this; +f.onShow=function(){this.element.addClass(l),k.setState(CKEDITOR.TRISTATE_ON),k._.on=1,k.editorFocus&&!a.focusManager.hasFocus&&a.focus(),k.onOpen&&k.onOpen(),a.once("panelShow",function(){h.focus(!h.multiSelect&&k.getValue())})},f.onHide=function(c){this.element.removeClass(l),k.setState(k.modes&&k.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),k._.on=0,!c&&k.onClose&&k.onClose()},f.onEscape=function(){f.hide(1)},h.onClick=function(a,b){k.onClick&&k.onClick.call(k,a,b),f.hide()},this._.panel=f,this._.list=h,f.getBlock(this.id).onHide=function(){k._.on=0,k.setState(CKEDITOR.TRISTATE_OFF)},this.init&&this.init()}},setValue:function(a,c){this._.value=a;var d=this.document.getById("cke_"+this.id+"_text");d&&(a||c?d.removeClass("cke_combo_inlinelabel"):(c=this.label,d.addClass("cke_combo_inlinelabel")),d.setText("undefined"!=typeof c?c:a))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(a){this._.list.mark(a)},hideItem:function(a){this._.list.hideItem(a)},hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,c,d){this._.items[a]=d||a,this._.list.add(a,c,d)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this)),this._.committed=1},setState:function(a){if(this._.state!=a){var c=this.document.getById("cke_"+this.id);c.setState(a,"cke_combo"),a==CKEDITOR.TRISTATE_DISABLED?c.setAttribute("aria-disabled",!0):c.removeAttribute("aria-disabled"),this._.state=a}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}}),CKEDITOR.ui.prototype.addRichCombo=function(a,c){this.add(a,CKEDITOR.UI_RICHCOMBO,c)}}(),function(){function a(a,c,d,m,l,f,h,k){var g=a.config,n=new CKEDITOR.style(h),q=l.split(";");l=[];for(var t={},u=0;u"),b&&b.indent&&(this._.indentation+=this.indentationChars)),b&&b.breakAfterOpen&&this.lineBreak(),"pre"==a&&(this._.inPre=1)},attribute:function(a,e){"string"==typeof e&&(this.forceSimpleAmpersand&&(e=e.replace(/&/g,"&")),e=CKEDITOR.tools.htmlEncodeAttr(e)),this._.output.push(" ",a,'="',e,'"')},closeTag:function(a){var e=this._.rules[a];e&&e.indent&&(this._.indentation=this._.indentation.substr(this.indentationChars.length)),this._.indent?this.indentation():e&&e.breakBeforeClose&&(this.lineBreak(),this.indentation()),this._.output.push(""),"pre"==a&&(this._.inPre=0),e&&e.breakAfterClose&&(this.lineBreak(),this._.needsSpace=e.needsSpace),this._.afterCloser=1},text:function(a){this._.indent&&(this.indentation(),!this._.inPre&&(a=CKEDITOR.tools.ltrim(a))),this._.output.push(a)},comment:function(a){this._.indent&&this.indentation(),this._.output.push("")},lineBreak:function(){!this._.inPre&&0(c+=g?1:-1))return;c=Math.min(c,b.length),c=Math.max(c,0),a.$.className=CKEDITOR.tools.ltrim(a.$.className.replace(this.classNameRegex,"")),c>0&&a.addClass(b[c-1])}else{b=e(a,c),c=parseInt(a.getStyle(b),10);var m=d.config.indentOffset||40;if(isNaN(c)&&(c=0),c+=(g?1:-1)*m,0>c)return;c=Math.max(c,0),c=Math.ceil(c/m)*m,a.setStyle(b,c?c+(d.config.indentUnit||"px"):""),""===a.getAttribute("style")&&a.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,a,"indent_processed",1)}}function e(a,b){return"ltr"==(b||a.getComputedStyle("direction"))?"margin-left":"margin-right"}var b=CKEDITOR.dtd.$listItem,c=CKEDITOR.dtd.$list,d=CKEDITOR.TRISTATE_DISABLED,m=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(l){function f(){h.specificDefinition.apply(this,arguments),this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:!0,styles:k?null:"margin-left,margin-right",classes:k||null}},this.enterBr&&(this.allowedContent.div=!0),this.requiredContent=(this.enterBr?"div":"p")+(k?"("+k.join(",")+")":"{margin-left}"),this.jobs={20:{refresh:function(a,c){var f=c.block||c.blockLimit;if(!f.is(b))var h=f.getAscendant(b),f=h&&c.contains(h)||f;if(f.is(b)&&(f=f.getParent()),this.enterBr||this.getContext(c)){if(k){var h=k,f=f.$.className.match(this.classNameRegex),l=this.isIndent,h=f?l?f[1]!=h.slice(-1):!0:l;return h?m:d}return this.isIndent?m:f?CKEDITOR[0>=(parseInt(f.getStyle(e(f)),10)||0)?"TRISTATE_DISABLED":"TRISTATE_OFF"]:d}return d},exec:function(b){var e,d=b.getSelection(),d=d&&d.getRanges()[0];if(e=b.elementPath().contains(c))a.call(this,e,k);else for(d=d.createIterator(),b=b.config.enterMode,d.enforceRealBlocks=!0,d.enlargeBr=b!=CKEDITOR.ENTER_BR;e=d.getNextParagraph(b==CKEDITOR.ENTER_P?"p":"div");)e.isReadOnly()||a.call(this,e,k);return!0}}}}var h=CKEDITOR.plugins.indent,k=l.config.indentClasses;h.registerCommands(l,{indentblock:new f(l,"indentblock",!0),outdentblock:new f(l,"outdentblock")}),CKEDITOR.tools.extend(f.prototype,h.specificDefinition.prototype,{context:{div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:k?new RegExp("(?:^|\\s+)("+k.join("|")+")(?=$|\\s)"):null})}})}(),function(){function a(a){function c(e){for(var h=t.startContainer,m=t.endContainer;h&&!h.getParent().equals(e);)h=h.getParent();for(;m&&!m.getParent().equals(e);)m=m.getParent();if(!h||!m)return!1;for(var u=h,h=[],p=!1;!p;)u.equals(m)&&(p=!0),h.push(u),u=u.getNext();if(1>h.length)return!1;for(u=e.getParents(!0),m=0;m0){var q=p[m].parent;p[m].parent=new CKEDITOR.dom.element(q.getName(),q.getDocument())}for(m=h.getCustomData("listarray_index")+1;my;m++)p[m].indent+=u;if(h=CKEDITOR.plugins.list.arrayToList(p,g,null,a.config.enterMode,e.getDirection()),!d.isIndent){var x;if((x=e.getParent())&&x.is("li"))for(var D,u=h.listNode.getChildren(),A=[],m=u.count()-1;m>=0;m--)(D=u.getItem(m))&&D.is&&D.is("li")&&A.push(D)}if(h&&h.listNode.replace(e),A&&A.length)for(m=0;m=0;q--)for(k=f[q].createIterator(),k.enlargeBr=e!=CKEDITOR.ENTER_BR;g=k.getNextParagraph(e==CKEDITOR.ENTER_P?"p":"div");)if(!g.isReadOnly()){g.removeAttribute("align"),g.removeStyle("text-align");var t=h&&(g.$.className=CKEDITOR.tools.ltrim(g.$.className.replace(this.cssClassRegex,""))),u=this.state==CKEDITOR.TRISTATE_OFF&&(!n||a(g,!0)!=this.value);h?u?g.addClass(h):t||g.removeAttribute("class"):u&&g.setStyle("text-align",this.value)}b.focus(),b.forceNextSelectionCheck(),d.selectBookmarks(l)}},refresh:function(b,d){var e=d.block||d.blockLimit;this.setState("body"!=e.getName()&&a(e,this.editor.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}},CKEDITOR.plugins.add("justify",{init:function(a){if(!a.blockless){var d=new e(a,"justifyleft","left"),m=new e(a,"justifycenter","center"),l=new e(a,"justifyright","right"),f=new e(a,"justifyblock","justify");a.addCommand("justifyleft",d),a.addCommand("justifycenter",m),a.addCommand("justifyright",l),a.addCommand("justifyblock",f),a.ui.addButton&&(a.ui.addButton("JustifyLeft",{label:a.lang.justify.left,command:"justifyleft",toolbar:"align,10"}),a.ui.addButton("JustifyCenter",{label:a.lang.justify.center,command:"justifycenter",toolbar:"align,20"}),a.ui.addButton("JustifyRight",{label:a.lang.justify.right,command:"justifyright",toolbar:"align,30"}),a.ui.addButton("JustifyBlock",{label:a.lang.justify.block,command:"justifyblock",toolbar:"align,40"})),a.on("dirChanged",b)}}})}(),CKEDITOR.plugins.add("menubutton",{requires:"button,menu",onLoad:function(){var a=function(a){var b=this._,c=b.menu;b.state!==CKEDITOR.TRISTATE_DISABLED&&(b.on&&c?c.hide():(b.previousState=b.state,c||(c=b.menu=new CKEDITOR.menu(a,{panel:{className:"cke_menu_panel",attributes:{"aria-label":a.lang.common.options}}}),c.onHide=CKEDITOR.tools.bind(function(){var c=this.command?a.getCommand(this.command).modes:this.modes;this.setState(!c||c[a.mode]?b.previousState:CKEDITOR.TRISTATE_DISABLED),b.on=0},this),this.onMenu&&c.addListener(this.onMenu)),this.setState(CKEDITOR.TRISTATE_ON),b.on=1,setTimeout(function(){c.show(CKEDITOR.document.getById(b.id),4)},0)))};CKEDITOR.ui.menuButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(e){delete e.panel,this.base(e),this.hasArrow=!0,this.click=a},statics:{handler:{create:function(a){return new CKEDITOR.ui.menuButton(a)}}}})},beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler)}}),CKEDITOR.UI_MENUBUTTON="menubutton",function(){CKEDITOR.plugins.add("language",{requires:"menubutton",init:function(a){var m,l,f,h,e=a.config.language_list||["ar:Arabic:rtl","fr:French","es:Spanish"],b=this,c=a.lang.language,d={};for(a.addCommand("language",{allowedContent:"span[!lang,!dir]",requiredContent:"span[lang,dir]",contextSensitive:!0,exec:function(a,b){var c=d["language_"+b];c&&a[c.style.checkActive(a.elementPath(),a)?"removeStyle":"applyStyle"](c.style)},refresh:function(a){this.setState(b.getCurrentLangElement(a)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}}),h=0;he;e++)b=a.charCodeAt(e),d.push(b);return"String.fromCharCode("+d.join(",")+")"}function b(b,c){var f,g,d=b.plugins.link,e=d.compiledProtectionFunction.params;g=[d.compiledProtectionFunction.name,"("];for(var h=0;h0&&g.push(","),g.push("'",f?a(encodeURIComponent(c[d])):"","'");return g.push(")"),g.join("")}function c(a){a=a.config.emailProtection||"";var b;return a&&"encode"!=a&&(b={},a.replace(/^([^(]+)\(([^)]+)\)$/,function(a,c,d){b.name=c,b.params=[],d.replace(/[^,\s]+/g,function(a){b.params.push(a)})})),b}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function a(b){return c.replace(/%1/g,"rtl"==b?"right":"left").replace(/%2/g,"cke_contents_"+b)}var b="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",c=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+b+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+b+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(a("ltr")+a("rtl"))},init:function(a){var b="a[!href]";CKEDITOR.dialog.isTabEnabled(a,"link","advanced")&&(b=b.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)")),CKEDITOR.dialog.isTabEnabled(a,"link","target")&&(b=b.replace("]",",target,onclick]")),a.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:b,requiredContent:"a[href]"})),a.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"})),a.addCommand("unlink",new CKEDITOR.unlinkCommand),a.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand),a.setKeystroke(CKEDITOR.CTRL+76,"link"),a.ui.addButton&&(a.ui.addButton("Link",{label:a.lang.link.toolbar,command:"link",toolbar:"links,10"}),a.ui.addButton("Unlink",{label:a.lang.link.unlink,command:"unlink",toolbar:"links,20"}),a.ui.addButton("Anchor",{label:a.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"})),CKEDITOR.dialog.add("link",this.path+"dialogs/link.js"),CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js"),a.on("doubleclick",function(b){var c=CKEDITOR.plugins.link.getSelectedLink(a)||b.data.element;c.isReadOnly()||(c.is("a")?(b.data.dialog=!c.getAttribute("name")||c.getAttribute("href")&&c.getChildCount()?"link":"anchor",b.data.link=c):CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,c)&&(b.data.dialog="anchor"))},null,null,0),a.on("doubleclick",function(b){b.data.dialog in{link:1,anchor:1}&&b.data.link&&a.getSelection().selectElement(b.data.link)},null,null,20),a.addMenuItems&&a.addMenuItems({anchor:{label:a.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:a.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:a.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:a.lang.link.unlink,command:"unlink",group:"link",order:5}}),a.contextMenu&&a.contextMenu.addListener(function(b){if(!b||b.isReadOnly())return null;if(b=CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b),!b&&!(b=CKEDITOR.plugins.link.getSelectedLink(a)))return null;var c={};return b.getAttribute("href")&&b.getChildCount()&&(c={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF}),b&&b.hasAttribute("name")&&(c.anchor=c.removeAnchor=CKEDITOR.TRISTATE_OFF),c}),this.compiledProtectionFunction=c(a)},afterInit:function(a){a.dataProcessor.dataFilter.addRules({elements:{a:function(b){return b.attributes.name?b.children.length?null:a.createFakeParserElement(b,"cke_anchor","anchor"):null}}});var b=a._.elementsPath&&a._.elementsPath.filters;b&&b.push(function(b,c){return"a"!=c||!CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b)&&(!b.getAttribute("name")||b.getAttribute("href")&&b.getChildCount())?void 0:"anchor"})}});var d=/^javascript:/,m=/^mailto:([^?]+)(?:\?(.+))?$/,l=/subject=([^;?:@&=$,\/]*)/,f=/body=([^;?:@&=$,\/]*)/,h=/^#(.*)$/,k=/^((?:http|https|ftp|news):\/\/)?(.*)$/,g=/^(_(?:self|top|parent|blank))$/,n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,q=/^javascript:([^(]+)\(([^)]+)\)$/,t=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,u=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,p={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType",class:"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(a){var b=a.getSelection(),c=b.getSelectedElement();return c&&c.is("a")?c:(b=b.getRanges()[0])?(b.shrink(CKEDITOR.SHRINK_TEXT),a.elementPath(b.getCommonAncestor()).contains("a",1)):null},getEditorAnchors:function(a){for(var f,b=a.editable(),c=b.isInline()&&!a.plugins.divarea?a.document:b,b=c.getElementsByTag("a"),c=c.getElementsByTag("img"),d=[],e=0;f=b.getItem(e++);)(f.data("cke-saved-name")||f.hasAttribute("name"))&&d.push({name:f.data("cke-saved-name")||f.getAttribute("name"),id:f.getAttribute("id")});for(e=0;f=c.getItem(e++);)(f=this.tryRestoreFakeAnchor(a,f))&&d.push({name:f.getAttribute("name"),id:f.getAttribute("id")});return d},fakeAnchor:!0,tryRestoreFakeAnchor:function(a,b){if(b&&b.data("cke-real-element-type")&&"anchor"==b.data("cke-real-element-type")){var c=a.restoreRealElement(b);if(c.data("cke-saved-name"))return c}},parseLinkAttributes:function(a,b){var y,c=b&&(b.data("cke-saved-href")||b.getAttribute("href"))||"",e=a.plugins.link.compiledProtectionFunction,v=a.config.emailProtection,C={};if(c.match(d)&&("encode"==v?c=c.replace(n,function(a,b,c){return"mailto:"+String.fromCharCode.apply(String,b.split(","))+(c&&c.replace(/\\'/g,"'"))}):v&&c.replace(q,function(a,b,c){if(b==e.name){C.type="email",a=C.email={},b=/(^')|('$)/g,c=c.match(/[^,\s]+/g);for(var f,g,d=c.length,h=0;d>h;h++)f=decodeURIComponent,g=c[h].replace(b,"").replace(/\\'/g,"'"),g=f(g),f=e.params[h].toLowerCase(),a[f]=g;a.address=[a.name,a.domain].join("@")}})),!C.type)if(v=c.match(h))C.type="anchor",C.anchor={},C.anchor.name=C.anchor.id=v[1];else if(v=c.match(m)){y=c.match(l),c=c.match(f),C.type="email";var x=C.email={};x.address=v[1],y&&(x.subject=decodeURIComponent(y[1])),c&&(x.body=decodeURIComponent(c[1]))}else c&&(y=c.match(k))&&(C.type="url",C.url={},C.url.protocol=y[1],C.url.url=y[2]);if(b){if(c=b.getAttribute("target"))C.target={type:c.match(g)?c:"frame",name:c};else if(c=(c=b.data("cke-pa-onclick")||b.getAttribute("onclick"))&&c.match(t))for(C.target={type:"popup",name:c[1]};v=u.exec(c[2]);)"yes"!=v[2]&&"1"!=v[2]||v[1]in{height:1,width:1,top:1,left:1}?isFinite(v[2])&&(C.target[v[1]]=v[2]):C.target[v[1]]=!0;var A,c={};for(A in p)(v=b.getAttribute(A))&&(c[p[A]]=v);(A=b.data("cke-saved-name")||c.advName)&&(c.advName=A),CKEDITOR.tools.isEmpty(c)||(C.advanced=c)}return C},getLinkAttributes:function(c,d){var f=c.config.emailProtection||"",g={};switch(d.type){case"url":var f=d.url&&void 0!==d.url.protocol?d.url.protocol:"http://",h=d.url&&CKEDITOR.tools.trim(d.url.url)||"";g["data-cke-saved-href"]=0===h.indexOf("/")?h:f+h;break;case"anchor":f=d.anchor&&d.anchor.id,g["data-cke-saved-href"]="#"+(d.anchor&&d.anchor.name||f||"");break;case"email":var k=d.email,h=k.address;switch(f){case"":case"encode":var l=encodeURIComponent(k.subject||""),m=encodeURIComponent(k.body||""),k=[];l&&k.push("subject="+l),m&&k.push("body="+m),k=k.length?"?"+k.join("&"):"","encode"==f?(f=["javascript:void(location.href='mailto:'+",e(h)],k&&f.push("+'",a(k),"'"),f.push(")")):f=["mailto:",h,k];break;default:f=h.split("@",2),k.name=f[0],k.domain=f[1],f=["javascript:",b(c,k)]}g["data-cke-saved-href"]=f.join("")}if(d.target)if("popup"==d.target.type){for(var f=["window.open(this.href, '",d.target.name||"","', '"],u="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),h=u.length,l=function(a){d.target[a]&&u.push(a+"="+d.target[a])},k=0;h>k;k++)u[k]+=d.target[u[k]]?"=yes":"=no";l("width"),l("left"),l("height"),l("top"),f.push(u.join(","),"'); return false;"),g["data-cke-pa-onclick"]=f.join("")}else"notSet"!=d.target.type&&d.target.name&&(g.target=d.target.name);if(d.advanced){for(var n in p)(f=d.advanced[p[n]])&&(g[n]=f);g.name&&(g["data-cke-saved-name"]=g.name)}g["data-cke-saved-href"]&&(g.href=g["data-cke-saved-href"]),n={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1},d.advanced&&CKEDITOR.tools.extend(n,p);for(var t in g)delete n[t];return{set:g,removed:CKEDITOR.tools.objectKeys(n)}}},CKEDITOR.unlinkCommand=function(){},CKEDITOR.unlinkCommand.prototype={exec:function(a){var b=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});a.removeStyle(b)},refresh:function(a,b){var c=b.lastElement&&b.lastElement.getAscendant("a",!0);c&&"a"==c.getName()&&c.getAttribute("href")&&c.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]"},CKEDITOR.removeAnchorCommand=function(){},CKEDITOR.removeAnchorCommand.prototype={exec:function(a){var d,b=a.getSelection(),c=b.createBookmarks();b&&(d=b.getSelectedElement())&&(d.getChildCount()?d.is("a"):CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,d))?d.remove(1):(d=CKEDITOR.plugins.link.getSelectedLink(a))&&(d.hasAttribute("href")?(d.removeAttributes({name:1,"data-cke-saved-name":1}),d.removeClass("cke_anchor")):d.remove(1)),b.selectBookmarks(c)},requiredContent:"a[name]"},CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,linkShowTargetTab:!0})}(),function(){function a(a,b,c){function d(c){!(l=k[c?"getFirst":"getLast"]())||l.is&&l.isBlockBoundary()||!(m=b.root[c?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))||m.is&&m.isBlockBoundary({br:1})||a.document.createElement("br")[c?"insertBefore":"insertAfter"](l)}for(var e=CKEDITOR.plugins.list.listToArray(b.root,c),f=[],g=0;ge[g-1].indent+1){for(f=e[g-1].indent+1-e[g].indent,h=e[g].indent;e[g]&&e[g].indent>=h;)e[g].indent+=f,g++;g--}var l,m,k=CKEDITOR.plugins.list.arrayToList(e,c,null,a.config.enterMode,b.root.getAttribute("dir")).listNode;d(!0),d(),k.replace(b.root),a.fire("contentDomInvalidated")}function e(a,b){this.name=a,this.context=this.type=b,this.allowedContent=b+" li",this.requiredContent=b}function b(a,b,c,d){for(var e,f;e=a[d?"getLast":"getFirst"](t);)(f=e.getDirection(1))!==b.getDirection(1)&&e.setAttribute("dir",f),e.remove(),c?e[d?"insertBefore":"insertAfter"](c):b.append(e,d)}function c(a){function c(d){var e=a[d?"getPrevious":"getNext"](g);e&&e.type==CKEDITOR.NODE_ELEMENT&&e.is(a.getName())&&(b(a,e,null,!d),a.remove(),a=e)}c(),c(1)}function d(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function m(a,d,e){a.fire("saveSnapshot"),e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var f=e.extractContents();d.trim(!1,!0);var h=d.createBookmark(),k=new CKEDITOR.dom.elementPath(d.startContainer),m=k.block,k=k.lastElement.getAscendant("li",1)||m,t=new CKEDITOR.dom.elementPath(e.startContainer),q=t.contains(CKEDITOR.dtd.$listItem),t=t.contains(CKEDITOR.dtd.$list);for(m?(m=m.getBogus())&&m.remove():t&&(m=t.getPrevious(g))&&n(m)&&m.remove(),(m=f.getLast())&&m.type==CKEDITOR.NODE_ELEMENT&&m.is("br")&&m.remove(),(m=d.startContainer.getChild(d.startOffset))?f.insertBefore(m):d.startContainer.append(f),q&&(f=l(q))&&(k.contains(q)?(b(f,q.getParent(),q),f.remove()):k.append(f));e.checkStartOfBlock()&&e.checkEndOfBlock()&&(t=e.startPath(),f=t.block,f);)f.is("li")&&(k=f.getParent(),f.equals(k.getLast(g))&&f.equals(k.getFirst(g))&&(f=k)),e.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START),f.remove();e=e.clone(),f=a.editable(),e.setEndAt(f,CKEDITOR.POSITION_BEFORE_END),e=new CKEDITOR.dom.walker(e),e.evaluator=function(a){return g(a)&&!n(a)},(e=e.next())&&e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in CKEDITOR.dtd.$list&&c(e),d.moveToBookmark(h),d.select(),a.fire("saveSnapshot")}function l(a){return(a=a.getLast(g))&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in f?a:null}var f={ol:1,ul:1},h=CKEDITOR.dom.walker.whitespaces(),k=CKEDITOR.dom.walker.bookmark(),g=function(a){return!(h(a)||k(a))},n=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(a,b,c,d,e){if(!f[a.getName()])return[];d||(d=0),c||(c=[]);for(var g=0,h=a.getChildCount();h>g;g++){var k=a.getChild(g);if(k.type==CKEDITOR.NODE_ELEMENT&&k.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(k,b,c,d+1),"li"==k.$.nodeName.toLowerCase()){var m={parent:a,indent:d,element:k,contents:[]};e?m.grandparent=e:(m.grandparent=a.getParent(),m.grandparent&&"li"==m.grandparent.$.nodeName.toLowerCase()&&(m.grandparent=m.grandparent.getParent())),b&&CKEDITOR.dom.element.setMarker(b,k,"listarray_index",c.length),c.push(m);for(var t,l=0,n=k.getChildCount();n>l;l++)t=k.getChild(l),t.type==CKEDITOR.NODE_ELEMENT&&f[t.getName()]?CKEDITOR.plugins.list.listToArray(t,b,c,d+1,m.grandparent):m.contents.push(t)}}return c},arrayToList:function(a,b,c,d,e){if(c||(c=0),!a||a.length=m.$.documentMode&&D.append(m.createText(" ")),D.append(t.listNode),t=t.nextIndex;else{if(-1!=H.indent||c||!h)return null;f[h.getName()]?(D=H.element.clone(!1,!0),G!=h.getDirection(1)&&D.setAttribute("dir",G)):D=new CKEDITOR.dom.documentFragment(m);var P,O,n=h.getDirection(1)!=G,K=H.element,F=K.getAttribute("class"),N=K.getAttribute("style"),R=D.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(d!=CKEDITOR.ENTER_BR||n||N||F),T=H.contents.length;for(h=0;T>h;h++)if(P=H.contents[h],k(P)&&T>1)R?O=P.clone(1,1):D.append(P.clone(1,1));else if(P.type==CKEDITOR.NODE_ELEMENT&&P.isBlockBoundary()){n&&!P.getDirection()&&P.setAttribute("dir",G),E=P;var Y=K.getAttribute("style");Y&&E.setAttribute("style",Y.replace(/([^;])$/,"$1;")+(E.getAttribute("style")||"")),F&&P.addClass(F),E=null,O&&(D.append(O),O=null),D.append(P.clone(1,1))}else R?(E||(E=m.createElement(I),D.append(E),n&&E.setAttribute("dir",G)),N&&E.setAttribute("style",N),F&&E.setAttribute("class",F),O&&(E.append(O),O=null),E.append(P.clone(1,1))):D.append(P.clone(1,1));O&&((E||D).append(O),O=null),D.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&t!=a.length-1&&(CKEDITOR.env.needsBrFiller&&(G=D.getLast())&&G.type==CKEDITOR.NODE_ELEMENT&&G.is("br")&&G.remove(),(G=D.getLast(g))&&G.type==CKEDITOR.NODE_ELEMENT&&G.is(CKEDITOR.dtd.$block)||D.append(m.createElement("br"))),G=D.$.nodeName.toLowerCase(),"div"!=G&&"p"!=G||D.appendBogus(),l.append(D),n=null,t++}if(E=null,a.length<=t||Math.max(a[t].indent,0)=0&&(G=x[E]);E--)if(f[G.getName()]&&D.contains(G)){D.removeCustomData("list_group_object_"+n),(x=G.getCustomData("list_group_object"))?x.contents.push(t):(x={root:G,contents:[t]},k.push(x),CKEDITOR.dom.element.setMarker(l,G,"list_group_object",x)),A=1;break}A||(A=D,A.getCustomData("list_group_object_"+n)?A.getCustomData("list_group_object_"+n).contents.push(t):(x={root:A,contents:[t]},CKEDITOR.dom.element.setMarker(l,A,"list_group_object_"+n,x),k.push(x)))}}for(G=[];0t&&(A=x.listNode.getChild(t));t++)A.getName()==this.type&&m.push(A);x.listNode.replace(n.root),h.fire("contentDomInvalidated")}else{for(A=b,m=x,t=G,D=m.contents,h=m.root.getDocument(),n=[],1==D.length&&D[0].equals(m.root)&&(x=h.createElement("div"),D[0].moveChildren&&D[0].moveChildren(x),D[0].append(x),D[0]=x),m=m.contents[0].getParent(),E=0;En.length)){for(D=n[n.length-1].getNext(),E=h.createElement(this.type),t.push(E),I=t=void 0;n.length;)t=n.shift(),I=h.createElement("li"),H=t,H.is("pre")||q.test(H.getName())||"false"==H.getAttribute("contenteditable")?t.appendTo(I):(t.copyAttributes(I),x&&t.getDirection()&&(I.removeStyle("direction"),I.removeAttribute("dir")),t.moveChildren(I),t.remove()),I.appendTo(E);x&&A&&E.setAttribute("dir",x),D?E.insertBefore(D):E.appendTo(m)}}else this.state==CKEDITOR.TRISTATE_ON&&f[x.root.getName()]&&a.call(this,b,x,l);for(E=0;Eb&&c>a}function l(a,b){if(a.data("cke-editable"))return null;for(b||(a=a.getParent());a&&!a.data("cke-editable");){if(a.hasAttribute("contenteditable"))return a;a=a.getParent()}return null}function f(a){var b=a.doc,c=G('',b),d=CKEDITOR.getUrl(this.path+"images/"+(E.hidpi?"hidpi/":"")+"icon"+(a.rtl?"-rtl":"")+".png");for(A(c,{attach:function(){return this.wrap.getParent()||this.wrap.appendTo(a.editable,!0),this},lineChildren:[A(G('',b),{base:Q+"height:17px;width:17px;"+(a.rtl?"left":"right")+":17px;background:url("+d+") center no-repeat "+a.boxColor+";cursor:pointer;"+(E.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(E.hidpi?"background-size: 9px 10px;":""),looks:["top:-8px; border-radius: 2px;","top:-17px; border-radius: 2px 2px 0px 0px;","top:-1px; border-radius: 0px 0px 2px 2px;"]}),A(G(V,b),{base:aa+"left:0px;border-left-color:"+a.boxColor+";",looks:["border-width:8px 0 8px 8px;top:-8px","border-width:8px 0 0 8px;top:-8px","border-width:0 0 8px 8px;top:0px"]}),A(G(V,b),{base:aa+"right:0px;border-right-color:"+a.boxColor+";",looks:["border-width:8px 8px 8px 0;top:-8px","border-width:8px 8px 0 0;top:-8px","border-width:0 8px 8px 0;top:0px"]})],detach:function(){return this.wrap.getParent()&&this.wrap.remove(),this},mouseNear:function(){v(a,this);var b=a.holdDistance,c=this.size;return!!(c&&m(a.mouse.y,c.top-b,c.bottom+b)&&m(a.mouse.x,c.left-b,c.right+b))},place:function(){var b=a.view,c=a.editable,d=a.trigger,e=d.upper,f=d.lower,g=e||f,h=g.getParent(),k={};this.trigger=d,e&&v(a,e,!0),f&&v(a,f,!0),v(a,h,!0),a.inInlineMode&&y(a,!0),h.equals(c)?(k.left=b.scroll.x,k.right=-b.scroll.x,k.width=""):(k.left=g.size.left-g.size.margin.left+b.scroll.x-(a.inInlineMode?b.editable.left+b.editable.border.left:0),k.width=g.size.outerWidth+g.size.margin.left+g.size.margin.right+b.scroll.x,k.right=""),e&&f?k.top=e.size.margin.bottom===f.size.margin.top?0|e.size.bottom+e.size.margin.bottom/2:e.size.margin.bottomE.version?" ":M,f=a.hotNode&&a.hotNode.getText()==d&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!c;h(a,function(d){f&&a.hotNode&&a.hotNode.remove(),d[c?"insertAfter":"insertBefore"](b),d.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!c}),a.lastCmdDirection=!!c}),E.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView(),a.line.detach()}return function(f){f=f.getSelection().getStartElement();var g;if(f=f.getAscendant(L,1),!p(a,f)&&f&&!f.equals(a.editable)&&!f.contains(a.editable)){(g=l(f))&&"false"==g.getAttribute("contenteditable")&&(f=g),a.element=f,g=d(a,f,!c);var h;n(g)&&g.is(a.triggers)&&g.is(J)&&(!d(a,g,!c)||(h=d(a,g,!c))&&n(h)&&h.is(a.triggers))?e(g):(h=b(a,f),n(h)&&(d(a,h,!c)?(f=d(a,h,!c))&&n(f)&&f.is(a.triggers)&&e(h):e(h)))}}}()}}function g(a,b){if(!b||b.type!=CKEDITOR.NODE_ELEMENT||!b.$)return!1;var c=a.line;return c.wrap.equals(b)||c.wrap.contains(b)}function n(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.$}function q(a){if(!n(a))return!1;var b;return(b=t(a))||(n(a)?(b={left:1,right:1,center:1},b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])):b=!1),b}function t(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function u(a,b){return n(b)?b.is(a.triggers):null}function p(a,b){if(!b)return!1;for(var c=b.getParents(1),d=c.length;d--;)for(var e=a.tabuList.length;e--;)if(c[d].hasAttribute(a.tabuList[e]))return!0;return!1}function r(a,b,c){return(b=b[c?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&!b.is(U)}))?(v(a,b),c?b.size.top>a.mouse.y:b.size.bottom(a.inInlineMode?d.editable.top+d.editable.height/2:Math.min(d.editable.height,d.pane.height)/2),b=b[h?"getLast":"getFirst"](function(a){return!(ba(a)||X(a))});return b?(g(a,b)&&(b=a.line.wrap[h?"getPrevious":"getNext"](function(a){return!(ba(a)||X(a))})),n(b)&&!q(b)&&u(a,b)?(v(a,b),!h&&0<=b.size.top&&m(c.y,0,b.size.top+f)?(a=a.inInlineMode||0===d.scroll.y?T:Y,new e([null,b,F,P,a])):h&&b.size.bottom<=d.pane.height&&m(c.y,b.size.bottom-f,d.pane.height)?(a=a.inInlineMode||m(b.size.bottom,d.pane.height-f,d.pane.height)?O:Y,new e([b,null,N,P,a])):null):null):null}function z(a){var c=a.mouse,f=a.view,g=a.triggerOffset,h=b(a);if(!h)return null;v(a,h);var l,p,g=Math.min(g,0|h.size.outerHeight/2),k=[];if(m(c.y,h.size.top-1,h.size.top+g))p=!1;else{if(!m(c.y,h.size.bottom-g,h.size.bottom+1))return null;p=!0}if(q(h)||r(a,h,p)||h.getParent().is(W))return null;var t=d(a,h,!p);if(t){if(t&&t.type==CKEDITOR.NODE_TEXT)return null;if(n(t)){if(q(t)||!u(a,t)||t.getParent().is(W))return null;k=[t,h][p?"reverse":"concat"]().concat([R,P])}}else h.equals(a.editable[p?"getLast":"getFirst"](a.isRelevant))?(y(a),p&&m(c.y,h.size.bottom-g,f.pane.height)&&m(h.size.bottom,f.pane.height-g,f.pane.height)?l=O:m(c.y,0,h.size.top+g)&&(l=T)):l=Y,k=[null,h][p?"reverse":"concat"]().concat([p?N:F,P,l,h.equals(a.editable[p?"getLast":"getFirst"](a.isRelevant))?p?O:T:Y]);return 0 in k?new e(k):null}function B(a,b,c,d){for(var e=b.getDocumentPosition(),f={},g={},h={},k={},m=ca.length;m--;)f[ca[m]]=parseInt(b.getComputedStyle.call(b,"border-"+ca[m]+"-width"),10)||0,h[ca[m]]=parseInt(b.getComputedStyle.call(b,"padding-"+ca[m]),10)||0,g[ca[m]]=parseInt(b.getComputedStyle.call(b,"margin-"+ca[m]),10)||0; +return c&&!d||C(a,d),k.top=e.y-(c?0:a.view.scroll.y),k.left=e.x-(c?0:a.view.scroll.x),k.outerWidth=b.$.offsetWidth,k.outerHeight=b.$.offsetHeight,k.height=k.outerHeight-(h.top+h.bottom+f.top+f.bottom),k.width=k.outerWidth-(h.left+h.right+f.left+f.right),k.bottom=k.top+k.outerHeight,k.right=k.left+k.outerWidth,a.inInlineMode&&(k.scroll={top:b.$.scrollTop,left:b.$.scrollLeft}),A({border:f,padding:h,margin:g,ignoreScroll:c},k,!0)}function v(a,b,c){if(!n(b))return b.size=null;if(b.size){if(b.size.ignoreScroll==c&&b.size.date>new Date-S)return null}else b.size={};return A(b.size,B(a,b,c),{date:+new Date},!0)}function y(a,b){a.view.editable=B(a,a.editable,b,!0)}function C(a,b){a.view||(a.view={});var c=a.view;if(!(!b&&c&&c.date>new Date-S)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();A(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth-d.width,height:a.doc.$.documentElement.scrollHeight-d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},!0)}}function x(a,b,c,d){for(var f=d,g=d,h=0,k=!1,m=!1,l=a.view.pane.height,n=a.mouse;n.y+hd.left-e.x&&cd.top-e.y&&bCKEDITOR.env.version,H=CKEDITOR.dtd,K={},F=128,N=64,R=32,P=16,T=4,O=2,Y=1,M=" ",W=H.$listItem,U=H.$tableContent,J=A({},H.$nonEditable,H.$empty),L=H.$block,S=100,Q="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",aa=Q+"border-color:transparent;display:block;border-style:solid;",V=""+M+"";K[CKEDITOR.ENTER_BR]="br",K[CKEDITOR.ENTER_P]="p",K[CKEDITOR.ENTER_DIV]="div",e.prototype={set:function(a,b,c){return this.properties=a+b+(c||Y),this},is:function(a){return(this.properties&a)==a}};var da=function(){function a(b,c){var d=b.$.elementFromPoint(c.x,c.y);return d&&d.nodeType?new CKEDITOR.dom.element(d):null}return function(b,c,d){if(!b.mouse)return null;var e=b.doc,f=b.line.wrap;d=d||b.mouse;var h=a(e,d);return c&&g(b,h)&&(f.hide(),h=a(e,d),f.show()),!h||h.type!=CKEDITOR.NODE_ELEMENT||!h.$||E.ie&&9>E.version&&!b.boundary.equals(h)&&!b.boundary.contains(h)?null:h}}(),ba=CKEDITOR.dom.walker.whitespaces(),X=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),ea=function(){function b(e){var g,h,k,f=e.element;if(!n(f)||f.contains(e.editable)||f.isReadOnly())return null;if(k=x(e,function(a,b){return!b.equals(a)},function(a,b){return da(a,!0,b)},f),g=k.upper,h=k.lower,a(e,g,h))return k.set(R,8);if(g&&f.contains(g))for(;!g.getParent().equals(f);)g=g.getParent();else g=f.getFirst(function(a){return d(e,a)});if(h&&f.contains(h))for(;!h.getParent().equals(f);)h=h.getParent();else h=f.getLast(function(a){return d(e,a)});if(!g||!h)return null;if(v(e,g),v(e,h),!m(e.mouse.y,g.size.top,h.size.bottom))return null;for(var l,p,u,t,f=Number.MAX_VALUE;h&&!h.equals(g)&&(p=g.getNext(e.isRelevant));)l=Math.abs(c(e,g,p)-e.mouse.y),f>l&&(f=l,u=g,t=p),g=p,v(e,g);return u&&t&&m(e.mouse.y,u.size.top,t.size.bottom)?(k.upper=u,k.lower=t,k.set(R,8)):null}function d(a,b){return!(b&&b.type==CKEDITOR.NODE_TEXT||X(b)||q(b)||g(a,b)||b.type==CKEDITOR.NODE_ELEMENT&&b.$&&b.is("br"))}return function(c){var e,d=b(c);if(e=d){e=d.upper;var f=d.lower;e=!e||!f||q(f)||q(e)||f.equals(e)||e.equals(f)||f.contains(e)||e.contains(f)?!1:!!(u(c,e)&&u(c,f)&&a(c,e,f))}return e?d:null}}(),ca=["top","left","right","bottom"]}(),CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51,CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52,function(){function a(a){if(!a||a.type!=CKEDITOR.NODE_ELEMENT||"form"!=a.getName())return[];for(var b=[],c=["style","className"],d=0;d=0;c--){var d=b[c][0],e=b[c][1];e?d.insertBefore(e):d.appendTo(a)}}function b(b,c){var d=a(b),h={},k=b.$;return c||(h.class=k.className||"",k.className=""),h.inline=k.style.cssText||"",c||(k.style.cssText="position: static; overflow: visible"),e(d),h}function c(b,c){var d=a(b),h=b.$;"class"in c&&(h.className=c.class),"inline"in c&&(h.style.cssText=c.inline),e(d)}function d(a){if(!a.editable().isInline()){var c,b=CKEDITOR.instances;for(c in b){var d=b[c];"wysiwyg"!=d.mode||d.readOnly||(d=d.document.getBody(),d.setAttribute("contentEditable",!1),d.setAttribute("contentEditable",!0))}a.editable().hasFocus&&(a.toolbox.focus(),a.focus())}}CKEDITOR.plugins.add("maximize",{init:function(a){function e(){var b=k.getViewPaneSize();a.resize(b.width,b.height,null,!0)}if(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var g,n,q,f=a.lang,h=CKEDITOR.document,k=h.getWindow(),t=CKEDITOR.TRISTATE_OFF;a.addCommand("maximize",{modes:{wysiwyg:!CKEDITOR.env.iOS,source:!CKEDITOR.env.iOS},readOnly:1,editorFocus:!1,exec:function(){var u=a.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}),p=a.ui.space("contents");if("wysiwyg"==a.mode){var r=a.getSelection();g=r&&r.getRanges(),n=k.getScrollPosition()}else{var w=a.editable().$;g=!CKEDITOR.env.ie&&[w.selectionStart,w.selectionEnd],n=[w.scrollLeft,w.scrollTop]}if(this.state==CKEDITOR.TRISTATE_OFF){for(k.on("resize",e),q=k.getScrollPosition(),r=a.container;r=r.getParent();)r.setCustomData("maximize_saved_styles",b(r)),r.setStyle("z-index",a.config.baseFloatZIndex-5);p.setCustomData("maximize_saved_styles",b(p,!0)),u.setCustomData("maximize_saved_styles",b(u,!0)),p={overflow:CKEDITOR.env.webkit?"":"hidden",width:0,height:0},h.getDocumentElement().setStyles(p),!CKEDITOR.env.gecko&&h.getDocumentElement().setStyle("position","fixed"),CKEDITOR.env.gecko&&CKEDITOR.env.quirks||h.getBody().setStyles(p),CKEDITOR.env.ie?setTimeout(function(){k.$.scrollTo(0,0)},0):k.$.scrollTo(0,0),u.setStyle("position",CKEDITOR.env.gecko&&CKEDITOR.env.quirks?"fixed":"absolute"),u.$.offsetLeft,u.setStyles({"z-index":a.config.baseFloatZIndex-5,left:"0px",top:"0px"}),u.addClass("cke_maximized"),e(),p=u.getDocumentPosition(),u.setStyles({left:-1*p.x+"px",top:-1*p.y+"px"}),CKEDITOR.env.gecko&&d(a)}else if(this.state==CKEDITOR.TRISTATE_ON){k.removeListener("resize",e);for(var r=[p,u],z=0;z ').children[0];b.children.length=0,b.add(d),d=b.attributes,delete d["aria-label"],delete d.contenteditable,delete d.title}return c}}},{applyToAll:!0,priority:5}),d&&d.addRules({elements:{div:function(a){if(a.attributes["data-cke-pagebreak"])b(a);else if(m.test(a.attributes.style)){var c=a.children[0];c&&"span"==c.name&&l.test(c.attributes.style)&&b(a)}}}})}}),CKEDITOR.plugins.pagebreakCmd={exec:function(e){var b=e.document.createElement("div",{attributes:a(e.lang.pagebreak.alt)});e.insertElement(b)},context:"div",allowedContent:{div:{styles:"!page-break-after"},span:{match:function(a){return(a=a.parent)&&"div"==a.name&&a.styles&&a.styles["page-break-after"]},styles:"display"}},requiredContent:"div{page-break-after}"}}(),function(){function a(a,c,d){var e=CKEDITOR.cleanWord;return e?d():(a=CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile||c+"filter/default.js"),CKEDITOR.scriptLoader.load(a,d,null,!0)),!e}function e(a){a.data.type="html"}CKEDITOR.plugins.add("pastefromword",{requires:"clipboard",init:function(b){var c=0,d=this.path;b.addCommand("pastefromword",{canUndo:!1,async:!0,exec:function(a){var b=this;c=1,a.once("beforePaste",e),a.getClipboardData({title:a.lang.pastefromword.title},function(c){c&&a.fire("paste",{type:"html",dataValue:c.dataValue,method:"paste",dataTransfer:CKEDITOR.plugins.clipboard.initPasteDataTransfer()}),a.fire("afterCommandExec",{name:"pastefromword",command:b,returnValue:!!c})})}}),b.ui.addButton&&b.ui.addButton("PasteFromWord",{label:b.lang.pastefromword.toolbar,command:"pastefromword",toolbar:"clipboard,50"}),b.on("pasteState",function(a){b.getCommand("pastefromword").setState(a.data)}),b.on("paste",function(e){var l=e.data,f=l.dataValue;if(f&&(c||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(f))){l.dontFilter=!0;var h=a(b,d,function(){h?b.fire("paste",l):(!b.config.pasteFromWordPromptCleanup||c||confirm(b.lang.pastefromword.confirmCleanup))&&(l.dataValue=CKEDITOR.cleanWord(f,b)),c=0});h&&e.cancel()}},null,null,3)}})}(),function(){var a={canUndo:!1,async:!0,exec:function(e){e.getClipboardData({title:e.lang.pastetext.title},function(b){b&&e.fire("paste",{type:"text",dataValue:b.dataValue,method:"paste",dataTransfer:CKEDITOR.plugins.clipboard.initPasteDataTransfer()}),e.fire("afterCommandExec",{name:"pastetext",command:a,returnValue:!!b})})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(e){e.addCommand("pastetext",a),e.ui.addButton&&e.ui.addButton("PasteText",{label:e.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"}),e.config.forcePasteAsPlainText&&e.on("beforePaste",function(a){"html"!=a.data.type&&(a.data.type="text")}),e.on("pasteState",function(a){e.getCommand("pastetext").setState(a.data)})}})}(),function(){var a,e={modes:{wysiwyg:1,source:1},canUndo:!1,readOnly:1,exec:function(b){var c,d=b.config,e=d.baseHref?'':"";if(d.fullPage)c=b.getData().replace(//,"$&"+e).replace(/[^>]*(?=<\/title>)/,"$& — "+b.lang.preview.preview);else{var d="'+e+""+b.lang.preview.preview+""+CKEDITOR.tools.buildStyleHtml(b.config.contentsCss)+""+d+b.getData()+""}e=640,d=420,l=80;try{var f=window.screen,e=Math.round(.8*f.width),d=Math.round(.7*f.height),l=Math.round(.1*f.width)}catch(h){}if(!1===b.fire("contentPreview",b={dataValue:c}))return!1;var k,f="";return CKEDITOR.env.ie&&(window._cke_htmlToLoad=b.dataValue,k="javascript:void( (function(){document.open();"+("("+CKEDITOR.tools.fixDomain+")();").replace(/\/\/.*?\n/g,"").replace(/parent\./g,"window.opener.")+"document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad = null;})() )",f=""),CKEDITOR.env.gecko&&(window._cke_htmlToLoad=b.dataValue,f=CKEDITOR.getUrl(a+"preview.html")),f=window.open(f,null,"toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+e+",height="+d+",left="+l),CKEDITOR.env.ie&&f&&(f.location=k),CKEDITOR.env.ie||CKEDITOR.env.gecko||(k=f.document,k.open(),k.write(b.dataValue),k.close()),!0}};CKEDITOR.plugins.add("preview",{init:function(b){b.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&(a=this.path,b.addCommand("preview",e),b.ui.addButton&&b.ui.addButton("Preview",{label:b.lang.preview.preview,command:"preview",toolbar:"document,40"}))}})}(),CKEDITOR.plugins.add("print",{init:function(a){a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&(a.addCommand("print",CKEDITOR.plugins.print),a.ui.addButton&&a.ui.addButton("Print",{label:a.lang.print.toolbar,command:"print",toolbar:"document,50"}))}}),CKEDITOR.plugins.print={exec:function(a){CKEDITOR.env.gecko?a.window.$.print():a.document.$.execCommand("Print")},canUndo:!1,readOnly:1,modes:{wysiwyg:1}},CKEDITOR.plugins.add("removeformat",{init:function(a){a.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat),a.ui.addButton&&a.ui.addButton("RemoveFormat",{label:a.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}}),CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(a){for(var f,e=a._.removeFormatRegex||(a._.removeFormatRegex=new RegExp("^(?:"+a.config.removeFormatTags.replace(/,/g,"|")+")$","i")),b=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),c=CKEDITOR.plugins.removeformat.filter,d=a.getSelection().getRanges(),m=d.createIterator(),l=function(a){return a.type==CKEDITOR.NODE_ELEMENT};f=m.getNextRange();){f.collapsed||f.enlarge(CKEDITOR.ENLARGE_ELEMENT);var h=f.createBookmark(),k=h.startNode,g=h.endNode,n=function(b){for(var h,d=a.elementPath(b),f=d.elements,g=1;(h=f[g])&&!h.equals(d.block)&&!h.equals(d.blockLimit);g++)e.test(h.getName())&&c(a,h)&&b.breakParent(h)};if(n(k),g)for(n(g),k=k.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);k&&!k.equals(g);)if(k.isReadOnly()){if(k.getPosition(g)&CKEDITOR.POSITION_CONTAINS)break;k=k.getNext(l)}else n=k.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),"img"==k.getName()&&k.data("cke-realelement")||!c(a,k)||(e.test(k.getName())?k.remove(1):(k.removeAttributes(b),a.fire("removeFormatCleanup",k))),k=n;f.moveToBookmark(h)}a.forceNextSelectionCheck(),a.getSelection().selectRanges(d)}}},filter:function(a,e){for(var b=a._.removeFormatFilters||[],c=0;ch.width&&(c.resize_minWidth=h.width),c.resize_minHeight>h.height&&(c.resize_minHeight=h.height),CKEDITOR.document.on("mousemove",e),CKEDITOR.document.on("mouseup",b),a.document&&(a.document.on("mousemove",e),a.document.on("mouseup",b)),d.preventDefault&&d.preventDefault()});a.on("destroy",function(){CKEDITOR.tools.removeFunction(n)}),a.on("uiSpace",function(b){if("bottom"==b.data.space){var c="";k&&!g&&(c=" cke_resizer_horizontal"),!k&&g&&(c=" cke_resizer_vertical");var e=''+("ltr"==m?"◢":"◣")+"";"ltr"==m&&"ltr"==c?b.data.html+=e:b.data.html=e+b.data.html}},a,null,100),a.on("maximize",function(b){a.ui.space("resizer")[b.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}}),function(){var a={readOnly:1,exec:function(a){if(a.fire("save")&&(a=a.element.$.form))try{a.submit()}catch(b){a.submit.click&&a.submit.click()}}};CKEDITOR.plugins.add("save",{init:function(e){e.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(e.addCommand("save",a).modes={wysiwyg:!!e.element.$.form},e.ui.addButton&&e.ui.addButton("Save",{label:e.lang.save.toolbar,command:"save",toolbar:"document,10"}))}})}(),function(){CKEDITOR.plugins.add("selectall",{init:function(a){a.addCommand("selectAll",{modes:{wysiwyg:1,source:1},exec:function(a){var b=a.editable();if(b.is("textarea"))a=b.$,CKEDITOR.env.ie?a.createTextRange().execCommand("SelectAll"):(a.selectionStart=0,a.selectionEnd=a.value.length),a.focus();else{if(b.is("body"))a.document.$.execCommand("SelectAll",!1,null);else{var c=a.createRange();c.selectNodeContents(b),c.select()}a.forceNextSelectionCheck(),a.selectionChange()}},canUndo:!1}),a.ui.addButton&&a.ui.addButton("SelectAll",{label:a.lang.selectall.toolbar,command:"selectAll",toolbar:"selection,10"})}})}(),function(){var a={readOnly:1,preserveState:!0,editorFocus:!1,exec:function(a){this.toggleState(),this.refresh(a)},refresh:function(a){if(a.document){var b=this.state!=CKEDITOR.TRISTATE_ON||a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&!a.focusManager.hasFocus?"removeClass":"attachClass";a.editable()[b]("cke_show_blocks")}}};CKEDITOR.plugins.add("showblocks",{onLoad:function(){var b,c,d,m,k,g,a="p div pre address blockquote h1 h2 h3 h4 h5 h6".split(" "),l=CKEDITOR.getUrl(this.path),f=!(CKEDITOR.env.ie&&9>CKEDITOR.env.version),h=f?":not([contenteditable=false]):not(.cke_show_blocks_off)":"";for(b=c=d=m="";k=a.pop();)g=a.length?",":"",b+=".cke_show_blocks "+k+h+g,d+=".cke_show_blocks.cke_contents_ltr "+k+h+g,m+=".cke_show_blocks.cke_contents_rtl "+k+h+g,c+=".cke_show_blocks "+k+h+"{background-image:url("+CKEDITOR.getUrl(l+"images/block_"+k+".png")+")}";CKEDITOR.addCss((b+"{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(c,d+"{background-position:top left;padding-left:8px}",m+"{background-position:top right;padding-right:8px}")),f||CKEDITOR.addCss(".cke_show_blocks [contenteditable=false],.cke_show_blocks .cke_show_blocks_off{border:none;padding-top:0;background-image:none}.cke_show_blocks.cke_contents_rtl [contenteditable=false],.cke_show_blocks.cke_contents_rtl .cke_show_blocks_off{padding-right:0}.cke_show_blocks.cke_contents_ltr [contenteditable=false],.cke_show_blocks.cke_contents_ltr .cke_show_blocks_off{padding-left:0}")},init:function(e){function b(){c.refresh(e)}if(!e.blockless){var c=e.addCommand("showblocks",a);c.canUndo=!1,e.config.startupOutlineBlocks&&c.setState(CKEDITOR.TRISTATE_ON),e.ui.addButton&&e.ui.addButton("ShowBlocks",{label:e.lang.showblocks.toolbar,command:"showblocks",toolbar:"tools,20"}),e.on("mode",function(){c.state!=CKEDITOR.TRISTATE_DISABLED&&c.refresh(e)}),e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(e.on("focus",b),e.on("blur",b)),e.on("contentDom",function(){c.state!=CKEDITOR.TRISTATE_DISABLED&&c.refresh(e)})}}})}(),function(){var a={preserveState:!0,editorFocus:!1,readOnly:1,exec:function(a){this.toggleState(),this.refresh(a)},refresh:function(a){if(a.document){var b=this.state==CKEDITOR.TRISTATE_ON?"attachClass":"removeClass";a.editable()[b]("cke_show_borders")}}};CKEDITOR.plugins.add("showborders",{modes:{wysiwyg:1},onLoad:function(){var a;a=(CKEDITOR.env.ie6Compat?[".%1 table.%2,",".%1 table.%2 td, .%1 table.%2 th","{","border : #d3d3d3 1px dotted","}"]:".%1 table.%2,;.%1 table.%2 > tr > td, .%1 table.%2 > tr > th,;.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,;.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,;.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th;{;border : #d3d3d3 1px dotted;}".split(";")).join("").replace(/%2/g,"cke_show_border").replace(/%1/g,"cke_show_borders "),CKEDITOR.addCss(a)},init:function(e){var b=e.addCommand("showborders",a);b.canUndo=!1,!1!==e.config.startupShowBorders&&b.setState(CKEDITOR.TRISTATE_ON),e.on("mode",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(e)},null,null,100),e.on("contentDom",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(e)}),e.on("removeFormatCleanup",function(a){a=a.data,e.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&a.is("table")&&(!a.hasAttribute("border")||0>=parseInt(a.getAttribute("border"),10))&&a.addClass("cke_show_border")})},afterInit:function(a){var b=a.dataProcessor;a=b&&b.dataFilter,b=b&&b.htmlFilter,a&&a.addRules({elements:{table:function(a){a=a.attributes;var b=a.class,e=parseInt(a.border,10);e&&!(0>=e)||b&&-1!=b.indexOf("cke_show_border")||(a.class=(b||"")+" cke_show_border")}}}),b&&b.addRules({elements:{table:function(a){a=a.attributes;var b=a.class;b&&(a.class=b.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/,""))}}})}}),CKEDITOR.on("dialogDefinition",function(a){var b=a.data.name;"table"!=b&&"tableProperties"!=b||(a=a.data.definition,b=a.getContents("info").get("txtBorder"),b.commit=CKEDITOR.tools.override(b.commit,function(a){return function(b,e){a.apply(this,arguments);var l=parseInt(this.getValue(),10);e[!l||0>=l?"addClass":"removeClass"]("cke_show_border")}}),(a=(a=a.getContents("advanced"))&&a.get("advCSSClasses"))&&(a.setup=CKEDITOR.tools.override(a.setup,function(a){return function(){a.apply(this,arguments),this.setValue(this.getValue().replace(/cke_show_border/,""))}}),a.commit=CKEDITOR.tools.override(a.commit,function(a){return function(b,e){a.apply(this,arguments),parseInt(e.getAttribute("border"),10)||e.addClass("cke_show_border")}})))})}(),CKEDITOR.plugins.add("smiley",{requires:"dialog",init:function(a){a.config.smiley_path=a.config.smiley_path||this.path+"images/",a.addCommand("smiley",new CKEDITOR.dialogCommand("smiley",{allowedContent:"img[alt,height,!src,title,width]",requiredContent:"img"})),a.ui.addButton&&a.ui.addButton("Smiley",{label:a.lang.smiley.toolbar,command:"smiley",toolbar:"insert,50"}),CKEDITOR.dialog.add("smiley",this.path+"dialogs/smiley.js")}}),CKEDITOR.config.smiley_images="regular_smile.png sad_smile.png wink_smile.png teeth_smile.png confused_smile.png tongue_smile.png embarrassed_smile.png omg_smile.png whatchutalkingabout_smile.png angry_smile.png angel_smile.png shades_smile.png devil_smile.png cry_smile.png lightbulb.png thumbs_down.png thumbs_up.png heart.png broken_heart.png kiss.png envelope.png".split(" "),CKEDITOR.config.smiley_descriptions="smiley;sad;wink;laugh;frown;cheeky;blush;surprise;indecision;angry;angel;cool;devil;crying;enlightened;no;yes;heart;broken heart;kiss;mail".split(";"),function(){CKEDITOR.plugins.add("sourcearea",{init:function(e){function b(){var a=d&&this.equals(CKEDITOR.document.getActive());this.hide(),this.setStyle("height",this.getParent().$.clientHeight+"px"),this.setStyle("width",this.getParent().$.clientWidth+"px"),this.show(),a&&this.focus()}if(e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var c=CKEDITOR.plugins.sourcearea;e.addMode("source",function(c){var d=e.ui.space("contents").getDocument().createElement("textarea");d.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",e.config.sourceAreaTabSize||4))),d.setAttribute("dir","ltr"),d.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu"),e.ui.space("contents").append(d),d=e.editable(new a(e,d)),d.setData(e.getData(1)),CKEDITOR.env.ie&&(d.attachListener(e,"resize",b,d),d.attachListener(CKEDITOR.document.getWindow(),"resize",b,d),CKEDITOR.tools.setTimeout(b,0,d)),e.fire("ariaWidget",this),c()}),e.addCommand("source",c.commands.source),e.ui.addButton&&e.ui.addButton("Source",{label:e.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"}),e.on("mode",function(){e.getCommand("source").setState("source"==e.mode?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var d=CKEDITOR.env.ie&&9==CKEDITOR.env.version}}});var a=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(a){this.setValue(a),this.status="ready",this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(a){this[(a?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){a.baseProto.detach.call(this),this.clearCustomData(),this.remove()}}})}(),CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(a){"wysiwyg"==a.mode&&a.fire("saveSnapshot"),a.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED),a.setMode("source"==a.mode?"wysiwyg":"source")},canUndo:!1}}},CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,en:1,"en-gb":1,eo:1,es:1,et:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,pl:1,pt:1,"pt-br":1,ru:1,si:1,sk:1,sl:1,sq:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(a){var e=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js"),a.addCommand("specialchar",{exec:function(){var b=a.langCode,b=e.availableLangs[b]?b:e.availableLangs[b.replace(/-.*/,"")]?b.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e.path+"dialogs/lang/"+b+".js"),function(){CKEDITOR.tools.extend(a.lang.specialchar,e.langEntries[b]),a.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1}),a.ui.addButton&&a.ui.addButton("SpecialChar",{label:a.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}}),CKEDITOR.config.specialChars="! " # $ % & ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ € ‘ ’ “ ” – — ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ Œ œ Ŵ Ŷ ŵ ŷ ‚ ‛ „ … ™ ► • → ⇒ ⇔ ♦ ≈".split(" "), +function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(a){var e=a.config,b=a.lang.stylescombo,c={},d=[],m=[];a.on("stylesSet",function(b){if(b=b.data.styles){for(var f,h,k,g=0,n=b.length;n>g;g++)f=b[g],a.blockless&&f.element in CKEDITOR.dtd.$block||(h=f.name,f=new CKEDITOR.style(f),a.filter.customConfig&&!a.filter.check(f))||(f._name=h,f._.enterMode=e.enterMode,f._.type=k=f.assignedTo||f.type,f._.weight=g+1e3*(k==CKEDITOR.STYLE_OBJECT?1:k==CKEDITOR.STYLE_BLOCK?2:3),c[h]=f,d.push(f),m.push(f));d.sort(function(a,b){return a._.weight-b._.weight})}}),a.ui.addRichCombo("Styles",{label:b.label,title:b.panelTitle,toolbar:"styles,10",allowedContent:m,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(e.contentsCss),multiSelect:!0,attributes:{"aria-label":b.panelTitle}},init:function(){var a,c,e,k,g,m;for(g=0,m=d.length;m>g;g++)a=d[g],c=a._name,k=a._.type,k!=e&&(this.startGroup(b["panelTitle"+String(k)]),e=k),this.add(c,a.type==CKEDITOR.STYLE_OBJECT?c:a.buildPreview(),c);this.commit()},onClick:function(b){a.focus(),a.fire("saveSnapshot"),b=c[b];var d=a.elementPath();a[b.checkActive(d,a)?"removeStyle":"applyStyle"](b),a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(b){var d=this.getValue();b=b.data.path.elements;for(var g,e=0,k=b.length;k>e;e++){g=b[e];for(var m in c)if(c[m].checkElementRemovable(g,!0,a))return void(m!=d&&this.setValue(m))}this.setValue("")},this)},onOpen:function(){var d=a.getSelection().getSelectedElement(),d=a.elementPath(d),e=[0,0,0,0];this.showAll(),this.unmarkAll();for(var h in c){var k=c[h],g=k._.type;k.checkApplicable(d,a,a.activeFilter)?e[g]++:this.hideItem(h),k.checkActive(d,a)&&this.mark(h)}e[CKEDITOR.STYLE_BLOCK]||this.hideGroup(b["panelTitle"+String(CKEDITOR.STYLE_BLOCK)]),e[CKEDITOR.STYLE_INLINE]||this.hideGroup(b["panelTitle"+String(CKEDITOR.STYLE_INLINE)]),e[CKEDITOR.STYLE_OBJECT]||this.hideGroup(b["panelTitle"+String(CKEDITOR.STYLE_OBJECT)])},refresh:function(){var b=a.elementPath();if(b){for(var d in c)if(c[d].checkApplicable(b,a,a.activeFilter))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}},reset:function(){c={},d=[]}})}})}(),function(){function a(a){return{editorFocus:!1,canUndo:!1,modes:{wysiwyg:1},exec:function(b){if(b.editable().hasFocus){var e,c=b.getSelection();if(e=new CKEDITOR.dom.elementPath(c.getCommonAncestor(),c.root).contains({td:1,th:1},1)){var c=b.createRange(),h=CKEDITOR.tools.tryThese(function(){var b=e.getParent().$.cells[e.$.cellIndex+(a?-1:1)];return b.parentNode.parentNode,b},function(){var b=e.getParent(),b=b.getAscendant("table").$.rows[b.$.rowIndex+(a?-1:1)];return b.cells[a?b.cells.length-1:0]});if(h||a){if(!h)return!0;h=new CKEDITOR.dom.element(h),c.moveToElementEditStart(h),c.checkStartOfBlock()&&c.checkEndOfBlock()||c.selectNodeContents(h)}else{for(var k=e.getAscendant("table").$,h=e.getParent().$.cells,k=new CKEDITOR.dom.element(k.insertRow(-1),b.document),g=0,n=h.length;n>g;g++)k.append(new CKEDITOR.dom.element(h[g],b.document).clone(!1,!1)).appendBogus();c.moveToElementEditStart(k)}return c.select(!0),!0}}return!1}}}var e={editorFocus:!1,modes:{wysiwyg:1,source:1}},b={exec:function(a){a.container.focusNext(!0,a.tabIndex)}},c={exec:function(a){a.container.focusPrevious(!0,a.tabIndex)}};CKEDITOR.plugins.add("tab",{init:function(d){for(var m=!1!==d.config.enableTabKeyTools,l=d.config.tabSpaces||0,f="";l--;)f+=" ";f&&d.on("key",function(a){9==a.data.keyCode&&(d.insertText(f),a.cancel())}),m&&d.on("key",function(a){(9==a.data.keyCode&&d.execCommand("selectNextCell")||a.data.keyCode==CKEDITOR.SHIFT+9&&d.execCommand("selectPreviousCell"))&&a.cancel()}),d.addCommand("blur",CKEDITOR.tools.extend(b,e)),d.addCommand("blurBack",CKEDITOR.tools.extend(c,e)),d.addCommand("selectNextCell",a()),d.addCommand("selectPreviousCell",a(!0))}})}(),CKEDITOR.dom.element.prototype.focusNext=function(a,e){var c,d,m,l,f,h,b=void 0===e?this.getTabIndex():e;if(0>=b)for(f=this.getNextSourceNode(a,CKEDITOR.NODE_ELEMENT);f;){if(f.isVisible()&&0===f.getTabIndex()){m=f;break}f=f.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(f=this.getDocument().getBody().getFirst();f=f.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!c)if(!d&&f.equals(this)){if(d=!0,a){if(!(f=f.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;c=1}}else d&&!this.contains(f)&&(c=1);if(f.isVisible()&&!(0>(h=f.getTabIndex()))){if(c&&h==b){m=f;break}h>b&&(!m||!l||l>h)?(m=f,l=h):m||0!==h||(m=f,l=h)}}m&&m.focus()},CKEDITOR.dom.element.prototype.focusPrevious=function(a,e){for(var c,d,m,f,b=void 0===e?this.getTabIndex():e,l=0,h=this.getDocument().getBody().getLast();h=h.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!c)if(!d&&h.equals(this)){if(d=!0,a){if(!(h=h.getPreviousSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;c=1}}else d&&!this.contains(h)&&(c=1);if(h.isVisible()&&!(0>(f=h.getTabIndex())))if(0>=b){if(c&&0===f){m=h;break}f>l&&(m=h,l=f)}else{if(c&&f==b){m=h;break}b>f&&(!m||f>l)&&(m=h,l=f)}}m&&m.focus()},CKEDITOR.plugins.add("table",{requires:"dialog",init:function(a){function e(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!a.blockless){var b=a.lang.table;a.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];"+(a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"]]})),a.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",e())),a.addCommand("tableDelete",e({exec:function(a){var b=a.elementPath().contains("table",1);if(b){var e=b.getParent(),l=a.editable();1!=e.getChildCount()||e.is("td","th")||e.equals(l)||(b=e),a=a.createRange(),a.moveToPosition(b,CKEDITOR.POSITION_BEFORE_START),b.remove(),a.select()}}})),a.ui.addButton&&a.ui.addButton("Table",{label:b.toolbar,command:"table",toolbar:"insert,30"}),CKEDITOR.dialog.add("table",this.path+"dialogs/table.js"),CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js"),a.addMenuItems&&a.addMenuItems({table:{label:b.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:b.deleteTable,command:"tableDelete",group:"table",order:1}}),a.on("doubleclick",function(a){a.data.element.is("table")&&(a.data.dialog="tableProperties")}),a.contextMenu&&a.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}}),function(){function a(a){function b(a){0k;k++){var l;1=h;h++){for(var k=f[h],l=new CKEDITOR.dom.element(e.$.rows[h]),m=0;m0?f[c-1]:null)||e.$.parentNode),h=d.length;h>=0;h--)b(d[h]);return e}return c instanceof CKEDITOR.dom.element&&(e=c.getAscendant("table"),1==e.$.rows.length?e.remove():c.remove()),null}function c(a,b){for(var c=b?1/0:0,d=0;de:e>c)&&(c=e)}return c}function d(b,d){for(var e=a(b),f=e[0].getAscendant("table"),g=c(e,1),e=c(e),g=d?g:e,h=CKEDITOR.tools.buildTableMap(f),f=[],e=[],k=h.length,l=0;k>l;l++)f.push(h[l][g]),e.push(d?h[l][g-1]:h[l][g+1]);for(l=0;k>l;l++)f[l]&&(1=0;k--)l(b[k]);d?f(d,!0):c&&c.remove()}else b instanceof CKEDITOR.dom.element&&(c=b.getParent(),1==c.getChildCount()?c.remove():b.remove())}function f(a,b){var c=a.getDocument(),d=CKEDITOR.document;CKEDITOR.env.ie&&10==CKEDITOR.env.version&&(d.focus(),c.focus()),c=new CKEDITOR.dom.range(c),c["moveToElementEdit"+(b?"End":"Start")](a)||(c.selectNodeContents(a),c.collapse(!b)),c.select(!0)}function h(a,b,c){if(a=a[b],"undefined"==typeof c)return a;for(b=0;a&&be.length)||(f=b.getCommonAncestor())&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("table"))return!1;var g;b=e[0],f=b.getAscendant("table");var k=CKEDITOR.tools.buildTableMap(f),l=k.length,m=k[0].length,n=b.getParent().$.rowIndex,q=h(k,n,b);if(c){var A;try{var D=parseInt(b.getAttribute("rowspan"),10)||1;g=parseInt(b.getAttribute("colspan"),10)||1,A=k["up"==c?n-D:"down"==c?n+D:n]["left"==c?q-g:"right"==c?q+g:q]}catch(G){return!1}if(!A||b.$==A)return!1;e["up"==c||"left"==c?"unshift":"push"](new CKEDITOR.dom.element(A))}c=b.getDocument();var E=n,D=A=0,I=!d&&new CKEDITOR.dom.documentFragment(c),H=0;for(c=0;c=m?b.removeAttribute("rowSpan"):b.$.rowSpan=A,A>=l?b.removeAttribute("colSpan"):b.$.colSpan=D,d=new CKEDITOR.dom.nodeList(f.$.rows),e=d.count(),c=e-1;c>=0;c--)f=d.getItem(c),f.$.cells.length||(f.remove(),e++);return b}function g(b,c){var d=a(b);if(11){n=Math.ceil(m/2);for(var q,m=Math.floor(m/2),e=k+n,f=new CKEDITOR.dom.element(f.$.rows[e]),g=h(g,e),e=d.clone(),k=0;kl){e.insertBefore(new CKEDITOR.dom.element(q));break}q=null}q||f.append(e)}else for(m=n=1,f=e.clone(),f.insertAfter(e),f.append(e=d.clone()),q=h(g,k),l=0;l1)e=Math.ceil(k/2),k=Math.floor(k/2);else{for(var k=e=1,l=[],m=0;ml;l++)for(var n=0,t=e[l].length;t>n;n++)e[l][n]==c.$&&(g=n),e[l][n]==d.$&&(h=n);for(l=g;h>=l;l++)for(n=0;nh;h++){b[e+h]||(b[e+h]=[]);for(var k=0;f>k;k++)b[e+h][d+k]=a[c].cells[m]}d+=f-1}}return b},function(){CKEDITOR.plugins.add("templates",{requires:"dialog",init:function(a){CKEDITOR.dialog.add("templates",CKEDITOR.getUrl(this.path+"dialogs/templates.js")),a.addCommand("templates",new CKEDITOR.dialogCommand("templates")),a.ui.addButton&&a.ui.addButton("Templates",{label:a.lang.templates.button,command:"templates",toolbar:"doctools,10"})}});var a={},e={};CKEDITOR.addTemplates=function(b,c){a[b]=c},CKEDITOR.getTemplates=function(b){return a[b]},CKEDITOR.loadTemplates=function(a,c){for(var d=[],m=0,l=a.length;l>m;m++)e[a[m]]||(d.push(a[m]),e[a[m]]=1);d.length?CKEDITOR.scriptLoader.load(d,c):setTimeout(c,0)}}(),CKEDITOR.config.templates_files=[CKEDITOR.getUrl("plugins/templates/templates/default.js")],CKEDITOR.config.templates_replaceContent=!0,function(){function a(a){function b(){for(var g=c(),h=CKEDITOR.tools.clone(a.config.toolbarGroups)||e(a),k=0;kb.order?-1:0>a.order?1:a.order',d.lang.toolbar.toolbars,"",''],e=!1!==d.config.toolbarStartupExpanded;d.config.toolbarCanCollapse&&d.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&k.push('":' style="display:none">'));for(var q=d.toolbox.toolbars,t=a(d),u=0;u"),m=g=0),"/"===z)k.push('');else{B=z.items||z;for(var v=0;v0&&(a.previous=r.items[A-1],a.previous.next=a),a.toolbar=r,a.onkey=l,a.onfocus=function(){d.toolbox.focusCommandExecuted||d.focus()}};if(y.type==CKEDITOR.UI_SEPARATOR)m=g&&y;else{if(C=!1!==y.canGroup,!r){p=CKEDITOR.tools.getNextId(),r={id:p,items:[]},w=z.name&&(d.lang.toolbar.toolbarGroups[z.name]||z.name),k.push(''),w&&k.push('',w,""),k.push('');var A=q.push(r)-1;A>0&&(r.previous=q[A-1],r.previous.next=r)}C?g||(k.push(''),g=1):g&&(k.push(""),g=0),m&&(x(m),m=0),x(y)}}}g&&(k.push(""),m=g=0),r&&k.push('')}}if(d.config.toolbarCanCollapse&&k.push(""),d.config.toolbarCanCollapse&&d.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var D=CKEDITOR.tools.addFunction(function(){d.execCommand("toolbarCollapse")});d.on("destroy",function(){CKEDITOR.tools.removeFunction(D)}),d.addCommand("toolbarCollapse",{readOnly:1,exec:function(a){var b=a.ui.space("toolbar_collapser"),c=b.getPrevious(),d=a.ui.space("contents"),e=c.getParent(),f=parseInt(d.$.style.height,10),g=e.$.offsetHeight,h=b.hasClass("cke_toolbox_collapser_min");h?(c.show(),b.removeClass("cke_toolbox_collapser_min"),b.setAttribute("title",a.lang.toolbar.toolbarCollapse)):(c.hide(),b.addClass("cke_toolbox_collapser_min"),b.setAttribute("title",a.lang.toolbar.toolbarExpand)),b.getFirst().setText(h?"▲":"◀"),d.setStyle("height",f-(e.$.offsetHeight-g)+"px"),a.fire("resize",{outerHeight:a.container.$.offsetHeight,contentsHeight:d.$.offsetHeight,outerWidth:a.container.$.offsetWidth})},modes:{wysiwyg:1,source:1}}),d.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse"),k.push('','',"")}k.push(""),c.data.html+=k.join("")}}),d.on("destroy",function(){if(this.toolbox){var a,c,d,e,b=0;for(a=this.toolbox.toolbars;b'),{}}}}})}}),CKEDITOR.ui.prototype.addToolbarGroup=function(a,b,c){var f=e(this.editor),h=0===b,k={name:a};if(c){if(c=CKEDITOR.tools.search(f,function(a){return a.name==c}))return!c.groups&&(c.groups=[]),b&&(b=CKEDITOR.tools.indexOf(c.groups,b),b>=0)?void c.groups.splice(b+1,0,a):void(h?c.groups.splice(0,0,a):c.groups.push(a));b=null}b&&(b=CKEDITOR.tools.indexOf(f,function(a){return a.name==b})),h?f.splice(0,0,a):"number"==typeof b?f.splice(b+1,0,k):f.push(a)}}(),CKEDITOR.UI_SEPARATOR="separator",CKEDITOR.config.toolbarLocation="top",function(){var a=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],e={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(c){function d(a){g.enabled&&!1!==a.data.command.canUndo&&g.save()}function e(){g.enabled=c.readOnly?!1:"wysiwyg"==c.mode,g.onChange()}var g=c.undoManager=new b(c),l=g.editingHandler=new m(g),q=c.addCommand("undo",{exec:function(){g.undo()&&(c.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),t=c.addCommand("redo",{exec:function(){g.redo()&&(c.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});c.setKeystroke([[a[0],"undo"],[a[1],"redo"],[a[2],"redo"]]),g.onChange=function(){q.setState(g.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),t.setState(g.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)},c.on("beforeCommandExec",d),c.on("afterCommandExec",d),c.on("saveSnapshot",function(a){g.save(a.data&&a.data.contentOnly)}),c.on("contentDom",l.attachListeners,l),c.on("instanceReady",function(){c.fire("saveSnapshot")}),c.on("beforeModeUnload",function(){"wysiwyg"==c.mode&&g.save(!0)}),c.on("mode",e),c.on("readOnly",e),c.ui.addButton&&(c.ui.addButton("Undo",{label:c.lang.undo.undo,command:"undo",toolbar:"undo,10"}),c.ui.addButton("Redo",{label:c.lang.undo.redo,command:"redo",toolbar:"undo,20"})),c.resetUndo=function(){g.reset(),c.fire("saveSnapshot")},c.on("updateSnapshot",function(){g.currentImage&&g.update()}),c.on("lockSnapshot",function(a){a=a.data,g.lock(a&&a.dontUpdate,a&&a.forceUpdate)}),c.on("unlockSnapshot",g.unlock,g)}}),CKEDITOR.plugins.undo={};var b=CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0],this.locked=null,this.previousKeyGroup=-1,this.limit=a.config.undoStackSize||20,this.strokesLimit=25,this.editor=a,this.reset()};b.prototype={type:function(a,c){var d=b.getKeyGroup(a),e=this.strokesRecorded[d]+1;c=c||e>=this.strokesLimit,this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange()),c?(e=0,this.editor.fire("saveSnapshot")):this.editor.fire("change"),this.strokesRecorded[d]=e,this.previousKeyGroup=d},keyGroupChanged:function(a){return b.getKeyGroup(a)!=this.previousKeyGroup},reset:function(){this.snapshots=[],this.index=-1,this.currentImage=null,this.hasRedo=this.hasUndo=!1,this.locked=null,this.resetType()},resetType:function(){this.strokesRecorded=[0,0],this.typing=!1,this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0),this.hasRedo=!!this.getNextImage(!1),this.resetType(),this.onChange()},save:function(a,b,d){var e=this.editor;if(this.locked||"ready"!=e.status||"wysiwyg"!=e.mode)return!1;var l=e.editable();if(!l||"ready"!=l.status)return!1;if(l=this.snapshots,b||(b=new c(e)),!1===b.contents)return!1;if(this.currentImage)if(b.equalsContent(this.currentImage)){if(a||b.equalsSelection(this.currentImage))return!1}else!1!==d&&e.fire("change");return l.splice(this.index+1,l.length-this.index-1),l.length==this.limit&&l.shift(),this.index=l.push(b)-1,this.currentImage=b,!1!==d&&this.refreshState(),!0},restoreImage:function(a){var c,b=this.editor;a.bookmarks&&(b.focus(),c=b.getSelection()),this.locked={level:999},this.editor.loadSnapshot(a.contents),a.bookmarks?c.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(c=this.editor.document.getBody().$.createTextRange(),c.collapse(!0),c.select()),this.locked=null,this.index=a.index,this.currentImage=this.snapshots[this.index],this.update(),this.refreshState(),b.fire("change")},getNextImage:function(a){var d,b=this.snapshots,c=this.currentImage;if(c)if(a){for(d=this.index-1;d>=0;d--)if(a=b[d],!c.equalsContent(a))return a.index=d,a}else for(d=this.index+1;d0&&this.currentImage.equalsContent(d[b-1]);)--b;d.splice(b,this.index-b+1,a),this.index=b,this.currentImage=a}},updateSelection:function(a){if(!this.snapshots.length)return!1;var b=this.snapshots,c=b[b.length-1];return c.equalsContent(a)&&!c.equalsSelection(a)?(this.currentImage=b[b.length-1]=a,!0):!1},lock:function(a,b){if(this.locked)this.locked.level++;else if(a)this.locked={level:1};else{var d=null;if(b)d=!0;else{var e=new c(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(e)&&(d=e)}this.locked={ +update:d,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var a=this.locked.update;if(this.locked=null,!0===a)this.update();else if(a){var b=new c(this.editor,!0);a.equalsContent(b)||this.update()}}}},b.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1},b.keyGroups={PRINTABLE:0,FUNCTIONAL:1},b.isNavigationKey=function(a){return!!b.navigationKeyCodes[a]},b.getKeyGroup=function(a){var c=b.keyGroups;return e[a]?c.FUNCTIONAL:c.PRINTABLE},b.getOppositeKeyGroup=function(a){var c=b.keyGroups;return a==c.FUNCTIONAL?c.PRINTABLE:c.FUNCTIONAL},b.ieFunctionalKeysBug=function(a){return CKEDITOR.env.ie&&b.getKeyGroup(a)==b.keyGroups.FUNCTIONAL};var c=CKEDITOR.plugins.undo.Image=function(a,b){this.editor=a,a.fire("beforeUndoImage");var c=a.getSnapshot();CKEDITOR.env.ie&&c&&(c=c.replace(/\s+data-cke-expando=".*?"/g,"")),this.contents=c,b||(this.bookmarks=(c=c&&a.getSelection())&&c.createBookmarks2(!0)),a.fire("afterUndoImage")},d=/\b(?:href|src|name)="[^"]*?"/gi;c.prototype={equalsContent:function(a){var b=this.contents;return a=a.contents,CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(b=b.replace(d,""),a=a.replace(d,"")),b==a},equalsSelection:function(a){var b=this.bookmarks;if(a=a.bookmarks,b||a){if(!b||!a||b.length!=a.length)return!1;for(var c=0;c=this.undoManager.strokesLimit&&(this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var d=this.undoManager;a=a.data.getKey();var e=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a),b.ieFunctionalKeysBug(a)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new c(d.editor,!0))||(e>0?d.type(a):b.isNavigationKey(a)&&this.onNavigationKey(!0))},onNavigationKey:function(a){var b=this.undoManager;!a&&b.save(!0,null,!1)||b.updateSelection(new c(b.editor)),b.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},attachListeners:function(){var a=this.undoManager.editor,c=a.editable(),d=this;c.attachListener(c,"keydown",function(a){d.onKeydown(a),b.ieFunctionalKeysBug(a.data.getKey())&&d.onInput()},null,null,999),c.attachListener(c,CKEDITOR.env.ie?"keypress":"input",d.onInput,d,null,999),c.attachListener(c,"keyup",d.onKeyup,d,null,999),c.attachListener(c,"paste",d.ignoreInputEventListener,d,null,999),c.attachListener(c,"drop",d.ignoreInputEventListener,d,null,999),c.attachListener(c.isInline()?c:a.document.getDocumentElement(),"click",function(){d.onNavigationKey()},null,null,999),c.attachListener(this.undoManager.editor,"blur",function(){d.keyEventsStack.remove(9)},null,null,999)}};var l=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};l.prototype={push:function(a){return a=this.stack.push({keyCode:a,inputs:0}),this.stack[a-1]},getLastIndex:function(a){if("number"!=typeof a)return this.stack.length-1;for(var b=this.stack.length;b--;)if(this.stack[b].keyCode==a)return b;return-1},getLast:function(a){return a=this.getLastIndex(a),-1!=a?this.stack[a]:null},increment:function(a){this.getLast(a).inputs++},remove:function(a){a=this.getLastIndex(a),-1!=a&&this.stack.splice(a,1)},resetInputs:function(a){if("number"==typeof a)this.getLast(a).inputs=0;else for(a=this.stack.length;a--;)this.stack[a].inputs=0},getTotalInputs:function(){for(var a=this.stack.length,b=0;a--;)b+=this.stack[a].inputs;return b},cleanUp:function(a){a=a.data.$,a.ctrlKey||a.metaKey||this.remove(17),a.shiftKey||this.remove(16),a.altKey||this.remove(18)}}}(),function(){function a(a){function b(a){var c=!1;g.attachListener(g,"keydown",function(){var b=f.getBody().getElementsByTag(a);if(!c){for(var d=0;dthis.$.offsetHeight){var d=c.createRange();d[33==b?"moveToElementEditStart":"moveToElementEditEnd"](this),d.select(),a.data.preventDefault()}}),CKEDITOR.env.ie&&this.attachListener(f,"blur",function(){try{f.$.selection.empty()}catch(a){}}),CKEDITOR.env.iOS&&this.attachListener(f,"touchend",function(){a.focus()}),h=c.document.getElementsByTag("title").getItem(0),h.data("cke-title",h.getText()),CKEDITOR.env.ie&&(c.document.$.title=this._.docTitle),CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready"),c.fire("contentDom"),this._.isPendingFocus&&(c.focus(),this._.isPendingFocus=!1),setTimeout(function(){c.fire("dataReady")},0)},0,this)}function e(a){function b(){var e;a.editable().attachListener(a,"selectionChange",function(){var b=a.getSelection().getSelectedElement();b&&(e&&(e.detachEvent("onresizestart",c),e=null),b.$.attachEvent("onresizestart",c),e=b.$)})}function c(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var e=a.document.$;e.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing),e.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(h){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&b(a)}function b(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");var c,b=[];for(c in CKEDITOR.dtd.$removeEmpty)b.push("html.CSS1Compat "+c+"[contenteditable=false]");a.push(b.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));return a.push("html{cursor:text;*cursor:auto}"),a.push("img,input,textarea{cursor:default}"),a.join("\n")}CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",requiredContent:"body"}),a.addMode("wysiwyg",function(b){function e(f){f&&f.removeListener(),a.editable(new c(a,h.$.contentWindow.document.body)),a.setData(a.getData(1),b)}var f="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",f=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(f)+"}())":"",h=CKEDITOR.dom.element.createFromHtml('');h.setStyles({width:"100%",height:"100%"}),h.addClass("cke_wysiwyg_frame").addClass("cke_reset"),f=a.ui.space("contents"),f.append(h);var k=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;k&&h.on("load",e);var g=a.title,n=a.fire("ariaEditorHelpLabel",{}).label;if(g&&(CKEDITOR.env.ie&&n&&(g+=", "+n),h.setAttribute("title",g)),n){var g=CKEDITOR.tools.getNextId(),q=CKEDITOR.dom.element.createFromHtml(''+n+"");f.append(q,1),h.setAttribute("aria-describedby",g)}a.on("beforeModeUnload",function(a){a.removeListener(),q&&q.remove()}),h.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"}),!k&&e(),a.fire("ariaWidget",h)})}}),CKEDITOR.editor.prototype.addContentsCss=function(a){var b=this.config,c=b.contentsCss;CKEDITOR.tools.isArray(c)||(b.contentsCss=c?[c]:[]),b.contentsCss.push(a)};var c=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments),this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(b){CKEDITOR.tools.setTimeout(a,0,this,b)},this),this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(a,c){var e=this.editor;if(c)this.setHtml(a),this.fixInitialSelection(),e.fire("dataReady");else{this._.isLoadingData=!0,e._.dataStore={id:1};var f=e.config,h=f.fullPage,k=f.docType,g=CKEDITOR.tools.buildStyleHtml(b()).replace(/