/*!@license
* Infragistics.Web.ClientUI HTML Editor localization resources 14.1.20141.1020
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
*/
(function($){$.ig=$.ig||{};if(!$.ig.HtmlEditor){$.ig.HtmlEditor={};$.extend($.ig.HtmlEditor,{locale:{boldButtonTitle:"Bold",italicButtonTitle:"Italic",underlineButtonTitle:"Underline",strikethroughButtonTitle:"Strikethrough",increaseFontSizeButtonTitle:"Increase Font Size",decreaseFontSizeButtonTitle:"Decrease Font Size",alignTextLeftButtonTitle:"Align Text Left",alignTextRightButtonTitle:"Align Text Right",alignTextCenterButtonTitle:"Center",justifyButtonTitle:"Justify",bulletsButtonTitle:"Bullets",numberingButtonTitle:"Numbering",decreaseIndentButtonTitle:"Decrease Indent",increaseIndentButtonTitle:"Increase Indent",insertPictureButtonTitle:"Insert Picture",fontColorButtonTitle:"Font Color",textHighlightButtonTitle:"Text Highlight Color",insertLinkButtonTitle:"Insert Hyperlink",insertTableButtonTitle:"Table",addRowButtonTitle:"Add Row",removeRowButtonTitle:"Remove Row",addColumnButtonTitle:"Add Column",removeColumnButtonTitle:"Remove Column",inserHRButtonTitle:"Insert Horizontal Rule",viewSourceButtonTitle:"View Source",cutButtonTitle:"Cut",copyButtonTitle:"Copy",pasteButtonTitle:"Paste",undoButtonTitle:"Undo",redoButtonTitle:"Redo",imageUrlDialogText:"Image URL:",imageAlternativeTextDialogText:"Alternative Text:",imageWidthDialogText:"Image Width:",imageHeihgtDialogText:"Image Height:",linkNavigateToUrlDialogText:"Navigate to URL:",linkDisplayTextDialogText:"Display Text:",linkOpenInDialogText:"Open In:",linkTargetNewWindowDialogText:"New Window",linkTargetSameWindowDialogText:"Same Window",linkTargetParentWindowDialogText:"Parent Window",linkTargetTopmostWindowDialogText:"Topmost Window",applyButtonTitle:"Apply",cancelButtonTitle:"Cancel",defaultToolbars:{textToolbar:"text manipulation toolbar",formattingToolbar:"text formatting toolbar",insertObjectToolbar:"objects insertion toolbar",copyPasteToolbar:"copy/paste toolbar"},fontNames:{win:[{text:"Times New Roman",value:"Times New Roman"},{text:"Arial",value:"Arial"},{text:"Arial Black",value:"Arial Black"},{text:"Helvetica",value:"Helvetica"},{text:"Comic Sans MS",value:"Comic Sans MS"},{text:"Courier New",value:"Courier New"},{text:"Georgia",value:"Georgia"},{text:"Impact",value:"Impact"},{text:"Lucida Console",value:"Lucida Console"},{text:"Lucida Sans Unicode",value:"Lucida Sans Unicode"},{text:"Palatino Linotype",value:"Palatino Linotype"},{text:"Tahoma",value:"Tahoma"},{text:"Trebuchet MS",value:"Trebuchet MS"},{text:"Verdana",value:"Verdana"},{text:"Symbol",value:"Symbol"},{text:"Webdings",value:"Webdings"},{text:"Wingdings",value:"Wingdings"},{text:"MS Sans Serif",value:"MS Sans Serif"},{text:"MS Serif",value:"MS Serif"}],mac:[{text:"Times New Roman",value:"Times New Roman"},{text:"Arial",value:"Arial"},{text:"Arial Black",value:"Arial Black"},{text:"Helvetica",value:"Helvetica"},{text:"Comic Sans MS",value:"Comic Sans MS"},{text:"Courier New",value:"Courier New"},{text:"Georgia",value:"Georgia"},{text:"Impact",value:"Impact"},{text:"Monaco",value:"Monaco"},{text:"Lucida Grande",value:"Lucida Grande"},{text:"Book Antiqua",value:"Book Antiqua"},{text:"Geneva",value:"Geneva"},{text:"Trebuchet MS",value:"Trebuchet"},{text:"Verdana",value:"Verdana"},{text:"Symbol",value:"Symbol"},{text:"Webdings",value:"Webdings"},{text:"Zapf Dingbats",value:"Zapf Dingbats"},{text:"New York",value:"New York"}]},fontSizes:[{text:"1",value:"7.5 pt"},{text:"2",value:"10 pt"},{text:"3",value:"12 pt"},{text:"4",value:"13.5 pt"},{text:"5",value:"18 pt"},{text:"6",value:"24 pt"},{text:"7",value:"36 pt"}],formatsList:[{text:"h1",value:"Heading 1"},{text:"h2",value:"Heading 2"},{text:"h3",value:"Heading 3"},{text:"h4",value:"Heading 4"},{text:"h5",value:"Heading 5"},{text:"h6",value:"Heading 6"},{text:"p",value:"Normal"}]}})}})(jQuery);/*!@license
 * Infragistics.Web.ClientUI HtmlEditor 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *   jquery-1.9.1.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *   infragistics.util.js
 *   infragistics.ui.shared.js
 *   infragistics.ui.toolbarbutton.js
 *   infragistics.ui.toolbar.js   
 *   infragistics.ui.popover.js
 *   infragistics.ui.splitbutton.js
 *   infragistics.ui.colorpicker.js
 *   infragistics.ui.colorpickersplitbutton.js
 *   infragistics.dataSource.js
 *   infragistics.ui.combo.js
 *   infragistics.ui.dialog.js
 *   infragistics.ui.htmleditor-en.js
 *   infragistics.ui.toolbar-en.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igHtmlEditor",{options:{showFormattingToolbar:true,showTextToolbar:true,showInsertObjectToolbar:true,showCopyPasteToolbar:true,width:725,height:350,toolbarSettings:[],customToolbars:[],inputName:"source",value:""},events:{rendered:"rendered",rendering:"rendering",actionExecuting:"actionExecuting",actionExecuted:"actionExecuted",toolbarCollapsing:"toolbarCollapsing",toolbarCollapsed:"toolbarCollapsed",toolbarExpanding:"toolbarExpanding",toolbarExpanded:"toolbarExpanded",cut:"cut",copy:"copy",paste:"paste",undo:"undo",redo:"redo"},css:{htmlEditor:"ui-widget ui-widget-content ui-corner-all ui-ightmleditor ui-helper-clearfix",htmlEditorContent:"ui-ightmleditor-content",toolbarsContainer:"ui-igtoolbars-holder",pathFinder:"ui-igPathFinder",workspaceIframe:"ui-widget-content"},defaultToolbars:[{name:"textToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.textToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"Bold",type:"button",scope:null,props:{allowToggling:{value:true},isBold:{value:false,action:"_isSelectedAction"},boldButtonTooltip:{value:$.ig.HtmlEditor.locale.boldButtonTitle,action:"_tooltipAction"},boldButtonIcon:{value:"ui-igbutton-bold",action:"_buttonIconAction"}}},{name:"Italic",type:"button",props:{isItalic:{value:false,action:"_isSelectedAction"},italicButtonTooltip:{value:$.ig.HtmlEditor.locale.italicButtonTitle,action:"_tooltipAction"},italicButtonIcon:{value:"ui-igbutton-italic",action:"_buttonIconAction"}}},{name:"Underline",type:"button",props:{isUnderline:{value:false,action:"_isSelectedAction"},underlineButtonTooltip:{value:$.ig.HtmlEditor.locale.underlineButtonTitle,action:"_tooltipAction"},underlineButtonIcon:{value:"ui-igbutton-underline",action:"_buttonIconAction"}}},{name:"Strikethrough",type:"button",props:{isStrikethrough:{value:false,action:"_isSelectedAction"},strikethroughButtonTooltip:{value:$.ig.HtmlEditor.locale.strikethroughButtonTitle,action:"_tooltipAction"},strikethroughButtonIcon:{value:"ui-igbutton-strikethrough",action:"_buttonIconAction"}}},{name:"fontFamily",type:"combo",scope:null,handler:"_fontNamePlg",props:{fontFamilyComboWidth:{value:135,action:"_comboWidthAction"},fontFamilyComboHeight:{value:"",action:"_comboHeightAction"},fontFamilies:{value:$.ig.HtmlEditor.locale.fontNames[/^win/gi.test(navigator.platform)?"win":"mac"],action:"_comboDataSourceAction"},selectedFontFamily:{value:"Times New Roman",action:"_comboSelectedItem"}}},{type:"combo",name:"fontSize",scope:null,handler:"_fontSizePlg",props:{fontSizeComboWidth:{value:75,action:"_comboWidthAction"},fontSizeComboHeight:{value:"",action:"_comboHeightAction"},fontSizes:{value:$.ig.HtmlEditor.locale.fontSizes,action:"_comboDataSourceAction"},selectedFontSize:{value:"1",action:"_comboSelectedItem"},fontSizeItemsListWidth:{value:100,action:"_comboDropDownListWidth"}}},{type:"combo",name:"formatsList",scope:null,handler:"_formatsListPlg",props:{formatsListComboWidth:{value:125,action:"_comboWidthAction"},formatsListComboHeight:{value:"",action:"_comboHeightAction"},formatsList:{value:$.ig.HtmlEditor.locale.formatsList,action:"_comboDataSourceAction"},selectedFormat:{value:"p",action:"_comboSelectedItem"}}}]},{name:"formattingToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.formattingToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"justifyleft",type:"button",props:{isJustifyleft:{value:false,action:"_isSelectedAction"},justifyleftButtonTooltip:{value:$.ig.HtmlEditor.locale.alignTextLeftButtonTitle,action:"_tooltipAction"},justifyleftButtonIcon:{value:"ui-igbutton-justifyleft",action:"_buttonIconAction"}}},{name:"justifycenter",type:"button",props:{isJustifycenter:{value:false,action:"_isSelectedAction"},justifycenterButtonTooltip:{value:$.ig.HtmlEditor.locale.alignTextCenterButtonTitle,action:"_tooltipAction"},justifycenterButtonIcon:{value:"ui-igbutton-justifycenter",action:"_buttonIconAction"}}},{name:"justifyright",type:"button",props:{isJustifyright:{value:false,action:"_isSelectedAction"},justifyrightButtonTooltip:{value:$.ig.HtmlEditor.locale.alignTextRightButtonTitle,action:"_tooltipAction"},justifyrightButtonIcon:{value:"ui-igbutton-justifyright",action:"_buttonIconAction"}}},{name:"justifyfull",type:"button",props:{isJustifyfull:{value:false,action:"_isSelectedAction"},justifyfullButtonTooltip:{value:$.ig.HtmlEditor.locale.justifyButtonTitle,action:"_tooltipAction"},justifyfullButtonIcon:{value:"ui-igbutton-justifyfull",action:"_buttonIconAction"}}},{name:"InsertUnorderedList",type:"button",props:{isUnorderedList:{value:false,action:"_isSelectedAction"},insertUnorderedListTooltip:{value:$.ig.HtmlEditor.locale.bulletsButtonTitle,action:"_tooltipAction"},insertUnorderedListButtonIcon:{value:"ui-igbutton-unorderedlist",action:"_buttonIconAction"}}},{name:"InsertOrderedList",type:"button",props:{isOrderedList:{value:false,action:"_isSelectedAction"},insertOrderedListTooltip:{value:$.ig.HtmlEditor.locale.numbersButtonTitle,action:"_tooltipAction"},insertOrderedListButtonIcon:{value:"ui-igbutton-orderedlist",action:"_buttonIconAction"}}},{name:"outdent",type:"button",props:{outdentButtonTooltip:{value:$.ig.HtmlEditor.locale.decreaseIndentButtonTitle,action:"_tooltipAction"},outdentButtonIcon:{value:"ui-igbutton-removeindent",action:"_buttonIconAction"}}},{name:"indent",type:"button",props:{indentTooltip:{value:$.ig.HtmlEditor.locale.increaseIndentButtonTitle,action:"_tooltipAction"},indentButtonIcon:{value:"ui-igbutton-indent",action:"_buttonIconAction"}}},{name:"textColor",type:"splitButtonColor",handler:"_fontColorPlg",props:{items:{value:[{name:"textColor",label:$.ig.HtmlEditor.locale.fontColorButtonTitle,iconClass:"ui-igbutton-forecolor"}]},defaultItemName:{value:"textColor"},selectedTextColor:{value:"red",action:"_spltButtonColorAction"}}},{name:"backgroundTextColor",type:"splitButtonColor",handler:"_fontBackgroundColorPlg",props:{items:{value:[{name:"backgroundTextColor",label:$.ig.HtmlEditor.locale.textHighlightButtonTitle,iconClass:"ui-igbutton-backcolor"}]},defaultItemName:{value:"backgroundTextColor"},selectedTextBackgroundColor:{value:"",action:"_spltButtonColorAction"}}}]},{name:"insertObjectToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.insertObjectToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"image",type:"button",handler:"_insertImageDialogPlg",props:{isImage:{value:false,action:"_isSelectedAction"},imageButtonTooltip:{value:$.ig.HtmlEditor.locale.insertPictureButtonTitle,action:"_tooltipAction"},imageButtonIcon:{value:"ui-igbutton-addimage",action:"_buttonIconAction"}}},{name:"link",type:"button",handler:"_insertLinkPlg",props:{isLink:{value:false,action:"_isSelectedAction"},linkButtonTooltip:{value:$.ig.HtmlEditor.locale.insertLinkButtonTitle,action:"_tooltipAction"},linkButtonIcon:{value:"ui-igbutton-addlink",action:"_buttonIconAction"}}},{name:"table",type:"button",handler:"_insertTablePlg",props:{isTable:{value:false,action:"_isSelectedAction"},tableButtonTooltip:{value:$.ig.HtmlEditor.locale.insertTableButtonTitle,action:"_tooltipAction"},tableButtonIcon:{value:"ui-igbutton-table",action:"_buttonIconAction"}}},{name:"addRow",type:"button",handler:"_addTableRowPlg",props:{allowToggling:{value:false},isAddRow:{value:false,action:"_isSelectedAction"},addRowButtonTooltip:{value:$.ig.HtmlEditor.locale.addRowButtonTitle,action:"_tooltipAction"},addRowButtonIcon:{value:"ui-igbutton-addrow",action:"_buttonIconAction"}}},{name:"addColumn",type:"button",handler:"_addTableColumnPlg",props:{allowToggling:{value:false},isAddColumn:{value:false,action:"_isSelectedAction"},addColumnButtonTooltip:{value:$.ig.HtmlEditor.locale.addColumnButtonTitle,action:"_tooltipAction"},addColumnButtonIcon:{value:"ui-igbutton-addcolumn",action:"_buttonIconAction"}}},{name:"removeRow",type:"button",handler:"_removeTableRowPlg",props:{allowToggling:{value:false},isRemoveRow:{value:false,action:"_isSelectedAction"},removeRowButtonTooltip:{value:$.ig.HtmlEditor.locale.removeRowButtonTitle,action:"_tooltipAction"},removeRowButtonIcon:{value:"ui-igbutton-removerow",action:"_buttonIconAction"}}},{name:"removeColumn",type:"button",handler:"_removeTableColumnPlg",props:{allowToggling:{value:false},isRemoveColumn:{value:false,action:"_isSelectedAction"},removeColumnButtonTooltip:{value:$.ig.HtmlEditor.locale.removeColumnButtonTitle,action:"_tooltipAction"},removeColumnButtonIcon:{value:"ui-igbutton-removecolumn",action:"_buttonIconAction"}}}]},{name:"copyPasteToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.copyPasteToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"copy",type:"button",scope:null,props:{isCopy:{value:false,action:"_isSelectedAction"},copyButtonTooltip:{value:$.ig.HtmlEditor.locale.copyButtonTitle,action:"_tooltipAction"},copyButtonIcon:{value:"ui-igbutton-copy",action:"_buttonIconAction"}}},{name:"cut",type:"button",scope:null,props:{isCut:{value:false,action:"_isSelectedAction"},cutButtonTooltip:{value:$.ig.HtmlEditor.locale.cutButtonTitle,action:"_tooltipAction"},cutButtonIcon:{value:"ui-igbutton-cut",action:"_buttonIconAction"}}},{name:"paste",type:"button",scope:null,props:{isPaste:{value:false,action:"_isSelectedAction"},pasteButtonTooltip:{value:$.ig.HtmlEditor.locale.pasteButtonTitle,action:"_tooltipAction"},pasteButtonIcon:{value:"ui-igbutton-paste",action:"_buttonIconAction"}}},{name:"undo",type:"button",scope:null,props:{allowToggling:{value:false},isUndo:{value:false,action:"_isSelectedAction"},undoButtonTooltip:{value:$.ig.HtmlEditor.locale.undoButtonTitle,action:"_tooltipAction"},undoButtonIcon:{value:"ui-igbutton-undo",action:"_buttonIconAction"}}},{name:"redo",type:"button",scope:null,props:{allowToggling:{value:false},isRedo:{value:false,action:"_isSelectedAction"},redoButtonTooltip:{value:$.ig.HtmlEditor.locale.redoButtonTitle,action:"_tooltipAction"},redoButtonIcon:{value:"ui-igbutton-redo",action:"_buttonIconAction"}}}]}],NODE:new $.ig.XmlNodeType,_toolbarsActiveState:{},_isDirty:false,_createWidget:function(){this._allToolbars=[];$.Widget.prototype._createWidget.apply(this,arguments)},_id:function(id){return this.element[0].id+id},widget:function(){return this.element},_render:function(){var html="",inputName=this.options.inputName;this.element.addClass(this.css.htmlEditor);html+='<div id="'+this._id("_toolbars")+'" class="'+this.css.toolbarsContainer+'"></div>';html+='<div id="'+this._id("_content")+'" class="'+this.css.htmlEditorContent+'">';html+='<iframe class="'+this.css.workspaceIframe+'" id="'+this._id("_editor")+'"></iframe>';html+='<textarea name="'+inputName+'" id="'+this._id("_source")+'"></textarea>';html+="</div>";$(html).appendTo(this.element);$("#"+this._id("_source")).hide();this.element.height(this.options.height);this.element.width(this.options.width)},_createWorkspace:function(content){var iFrameContent="<"+"!"+"DOCTYPE html"+">"+"<html>"+"<head>"+"<title>igHtmlEditor</title>"+"</head>"+'<body contentEditable="true" spellcheck="false" style="-webkit-tap-highlight-color: rgba(255, 255, 255, 0);">'+"<p>";if(!document.all){iFrameContent+="<br />"}iFrameContent+="</p></body>"+"</html>";this.workspace=this.element.find("#"+this._id("_editor"))[0];this.workspace.contentWindow.document.open("text/html","replace");this.workspace.contentWindow.document.write(iFrameContent);this.workspace.contentWindow.document.close();if(content&&content.length>0){$(this.workspace).contents().find("body").html(content)}if($.ig.util.isWebKit){this.workspace.contentWindow.document.body.contentEditable=true}if(!document.all){var showUI=false,comandValue=true;this.workspace.contentWindow.document.execCommand("styleWithCSS",showUI,comandValue)}},_getToolbar:function(index){if(!isNaN(parseInt(index,10))){return this._toolbars.eq(index)}if(typeof index==="string"){return this._toolbars.find("#"+this._id("_toolbars_"+index))}},_getToolbarSettings:function(name){return $.map(this.options.toolbarSettings,function(item){if(item.name===name){return item}})[0]},_getFirefoxVersion:function(){if($.ig.util.isFF){return parseInt(window.navigator.userAgent.match(/\bFirefox\/[0-9\.]+\b/)[0].split("/").reverse()[0],10)}},_create:function(){var noCancel=this._trigger(this.events.rendering,null,{owner:this}),content=this.options.value||this.element.html();this.element.empty();if(noCancel){this._render();this._allToolbars=$.extend(true,[],this.defaultToolbars.concat(this.options.customToolbars));this._toolbars=this.element.find("#"+this._id("_toolbars"));this._initToolbars(this.options,this._toolbars,this._allToolbars);this._setActiveToolbars();this._createWorkspace(content);this._domPathToolbar();this._resizeWorkspace();this._trigger(this.events.rendered,null,{owner:this})}},_resizeWorkspace:function(){var height=this.element.height();height-=$("#"+this._id("_toolbars")).outerHeight(true);height-=$(".ui-igbutton-viewsource").outerHeight(true);$("#"+this._id("_editor")).height(height);$("#"+this._id("_source")).height(height)},_init:function(){this._bindToToolbarEvents();this._bindWorkspaceEvents();this.sourceWindow=this.element.find("#"+this._id("_source"));this._initFontsCombos();this._initFormatsListCombo();this._initFontSizeCombo();this._analyser=new $.ig.ToolbarHelper(this.workspace.contentWindow,this._toolbars.children());var self=this;this._onSelectionChange(function(){self._initialWorkspaceFormatting()})},_initFontsCombos:function(){var fontFamiliesCombo=this._getToolbar("textToolbar").igToolbar("getItem","fontFamily").addClass("ui-combo-fontfamily");fontFamiliesCombo.igCombo("option",{itemTemplate:'<span style="font-family: ${value}" unselectable="on">${text}</span>'})},_initFormatsListCombo:function(){var formatsListCombo=this._getToolbar("textToolbar").igToolbar("getItem","formatsList");formatsListCombo.igCombo("option","itemTemplate",'<${text} unselectable="on">${value}</${text}>')},_initFontSizeCombo:function(){var fontSizesCombo=this._getToolbar("textToolbar").igToolbar("getItem","fontSize");fontSizesCombo.igCombo("option",{itemTemplate:'<span unselectable="on">${value}</span>'})},_setOption:function(name,value){var self=this,updatedItems=[];if(name===undefined||value===undefined){return}if(name==="toolbarSettings"){$.each(value,function(index,toolbar){$.each(toolbar,function(tbPropName,tbPropVal){if(tbPropName!=="name"){self._tbHash[toolbar.name][tbPropName].updateProperty(tbPropName,tbPropVal);updatedItems.push(self._tbHash[toolbar.name][tbPropName])}});self._getToolbar(self._allToolbars[index].name).igToolbar("option","items",updatedItems)})}else if(this._toolbarsActiveState[name]){this._showToolbar(this._toolbarsActiveState[name].name,value)}else if(name==="width"){this.element.width(value)}else if(name==="height"){this.element.find("#"+this._id("_editor")).height(value)}$.Widget.prototype._setOption.apply(this,arguments)},_showToolbar:function(name,show){if(show){this._getToolbar(name).removeClass("hidden").show()}else{this._getToolbar(name).addClass("hidden").hide()}},_setActiveToolbars:function(){var self=this,o=this.options;$.each(o,function(name,value){if(self._toolbarsActiveState[name]){self._toolbarsActiveState[name].value=value;o[name]=value}})},_initToolbars:function(options,toolbarsHolder,allToolbars){var toolbar,i,toolbarName,showToolbar,property,settings;this._tbHash=[];for(i=0;i<allToolbars.length;i++){settings=this._getToolbarSettings(allToolbars[i].name);$.extend(allToolbars[i],settings);toolbar=$('<span id="'+this._id("_toolbars")+"_"+allToolbars[i].name+'"></span>').appendTo(toolbarsHolder).igToolbar(allToolbars[i]);this._tbHash[allToolbars[i].name]=toolbar.igToolbar("getToolbarHash");showToolbar=$.camelCase("show-"+allToolbars[i].name);this._toolbarsActiveState[showToolbar]={name:allToolbars[i].name,value:true};if(!this._isToolbarActive(allToolbars[i].name)){toolbar.hide().addClass("hidden")}}for(i=0;i<options.toolbarSettings.length;i++){for(property in options.toolbarSettings[i]){if(options.toolbarSettings[i].hasOwnProperty(property)){toolbarName=options.toolbarSettings[i].name;if(this._tbHash[toolbarName].toolbarOpts[property]!==undefined&&property!=="name"){this._tbHash[toolbarName].toolbarOpts[property]=options.toolbarSettings[i][property];continue}if(this._tbHash[toolbarName][property]===undefined||this._tbHash[toolbarName]===undefined){continue}this._tbHash[toolbarName][property].getProperty(property).value=options.toolbarSettings[i][property]}}}},_initialWorkspaceFormatting:function(){var options=this.options,i,toolbar,property,commands={isBold:"bold",isItalic:"italic",isUnderline:"underline",isStrikethrough:"strikethrough"};for(i=0;i<options.toolbarSettings.length;i++){toolbar=options.toolbarSettings[i];for(property in toolbar){if(toolbar.hasOwnProperty(property)&&commands.hasOwnProperty(property)){this._execCommand(commands[property])}}}},_isToolbarActive:function(tbName){var key;for(key in this._toolbarsActiveState){if(this._toolbarsActiveState.hasOwnProperty(key)){if(this._toolbarsActiveState[key].name===tbName){return this._toolbarsActiveState[key].value}}}},_execCommand:function(name,args){this._selectionWrapperSaved.focus();this._selectionWrapperSaved.execCommand(name.toLowerCase(),args);this._onSelectionChange()},_hideDialogs:function(){this.element.find(":ui-igLinkPropertiesDialog").igLinkPropertiesDialog("hide");this.element.find(":ui-igTablePropertiesDialog").igTablePropertiesDialog("hide");this.element.find(":ui-igImagePropertiesDialog").igImagePropertiesDialog("hide")},_bindToToolbarEvents:function(){var self=this,events="igtoolbartoolbarbuttonclick igtoolbartoolbarcomboselected igtoolbartoolbarcustomitemclick "+"igtoolbarcollapsing igtoolbarcollapsed igtoolbarexpanding igtoolbarexpanded",splitBtnArrowSelector=".ui-splitbutton-arrow",toolbarEvents={igtoolbarcollapsing:this.events.toolbarCollapsing,igtoolbarcollapsed:this.events.toolbarCollapsed,igtoolbarexpanding:this.events.toolbarExpanding,igtoolbarexpanded:this.events.toolbarExpanded};this._toolbars.delegate(":ui-igToolbar",events,function _onToolbarItemClick(e,ui){var scope=ui.scope,handler=ui.handler,$eTarget=$(e.originalEvent.currentTarget),noCancel;delete ui.scope;delete ui.handler;self._hideDialogs();if($eTarget.is(splitBtnArrowSelector)){e.stopImmediatePropagation();return}if(toolbarEvents.hasOwnProperty(e.type)){self._resizeWorkspace();self._trigger(toolbarEvents[e.type],e,ui);return}ui.selectedItem=self._selectionWrapperSaved&&self._selectionWrapperSaved.getSelectedItem();noCancel=self._trigger(self.events.actionExecuting,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});if(noCancel){if(!handler&&!scope){self._execCommand(ui.name,ui.value)}else if(handler&&!scope){self[handler](self.workspace.contentWindow.document,ui)}else if(handler&&scope){handler.call(ui.scope,self.workspace.contentWindow.document,ui)}self._trigger(self.events.actionExecuted,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});e.stopImmediatePropagation()}})},_bindWorkspaceEvents:function(){var self=this,KEYS={webKitIE:{CTRLZ:90,CTRLY:89},moz:{CTRLZ:90,CTRLY:89}};$(this.workspace.contentWindow.document).find("html").bind("click",function(e){var target=$(e.target);if(target.is("html")){self.workspace.contentWindow.document.body.focus()}self._isDirty=true;self._hideDialogs();e.stopPropagation()}).bind("mouseup",function(e){self._onSelectionChange()});$(this.workspace.contentWindow.document).bind("keydown",function(e){self._isDirty=true;if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLZ||e.which===KEYS.moz.CTRLZ)){self._trigger(self.events.undo,e,{owner:self})}if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLY||e.which===KEYS.moz.CTRLY)){self._trigger(self.events.redo,e,{owner:self})}self._onSelectionChange()});$(this.workspace.contentWindow.document).bind("cut copy paste",function(e){self._trigger(e.type,e,{owner:self})});this.element.bind("ightmleditoractionexecuted",function(e,ui){if(ui.actionName.toLowerCase()===self.events.undo||ui.actionName.toLowerCase()===self.events.redo){self._trigger(ui.actionName.toLowerCase(),e,{owner:self});e.stopImmediatePropagation()}});$(document).click(function(e){var $tarParents=$(e.target).parents();if(!$tarParents.is(".ui-igpopover")&&!$tarParents.is(".ui-igcombo-list")){self._hideDialogs()}})},_viewSource:function(){var workspace=$(this.workspace),workSpaceBody=workspace.contents().find("body");if(workspace.is(":visible")){workSpaceBody.attr("contentEditable",false);this.sourceWindow.val($.trim(workSpaceBody.html()));workspace.hide();this.sourceWindow.show()}else{workSpaceBody.attr("contentEditable",true);workSpaceBody.html($.trim(this.sourceWindow.val()));workspace.show();this.sourceWindow.hide();this.sourceWindow.val(encodeURI(this.sourceWindow.val()))}},_viewSourcePlg:function(ui){this._viewSource()},_insertImageDialogPlg:function(workspace,plgUI){var image=$("<img>",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("img")){image=plgUI.selectedItem}this._imageDialog=$("#"+this._id("_imageDialog"));if(!this._imageDialog.length){this._imageDialog=$('<div id="'+this._id("_imageDialog")+'"></div>').appendTo(this.element).igImagePropertiesDialog({item:image,target:plgUI.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.image)}})}else{if(this._imageDialog.igImagePropertiesDialog("option","isHidden")){this._imageDialog.igImagePropertiesDialog("show",image)}else{this._imageDialog.igImagePropertiesDialog("hide",image)}}},_insertLinkPlg:function(workspace,ui){var self=this,selectedItem=this._selectionWrapperSaved.getSelectedItem(),selectedItemNodeType=selectedItem[0].nodeType,anchor=$("<a></a>",this.workspace.contentWindow.document);if(selectedItem.parent().is("a")){anchor=selectedItem.parent()}else if(selectedItemNodeType===this.NODE._Text||selectedItemNodeType===this.NODE._Element){anchor.html(this._selectionWrapperSaved.getSelectionAsText())}if(!this._insertLinkDialog){this._insertLinkDialog=$('<div id="'+this._id("_linkDialog")+'"></div>').appendTo(this.element).igLinkPropertiesDialog({item:anchor,target:ui.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.anchor)}})}else{if(this._insertLinkDialog.igLinkPropertiesDialog("option","isHidden")){this._insertLinkDialog.igLinkPropertiesDialog("show",anchor)}else{this._insertLinkDialog.igLinkPropertiesDialog("hide",anchor)}}},_fontNamePlg:function(workspace,ui){this._execCommand("fontname",ui.value)},_fontSizePlg:function(workspace,ui){this._execCommand("fontsize",ui.value)},_formatsListPlg:function(workspace,ui){this._execCommand("formatBlock","<"+ui.value+">")},_insertTablePlg:function(workspace,plgUI){var table=$("<table></table>",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("table")){table=plgUI.selectedItem}if(!this.insertTableDialog){this.insertTableDialog=$("<div id='"+this._id("_tableDialog")+"'</div>").appendTo(this.element).igTablePropertiesDialog({item:table,target:plgUI.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.insertTable(ui.table)}});return}if(this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("show",table);return}if(!this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("hide")}},_addTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addRow")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("addRow",selectedItem.parent().index())}},_removeTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeRow")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("removeRow",selectedItem.parent().index())}},_addTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("addColumn",selectedItem.index())}},_removeTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("removeColumn",selectedItem.index())}},_fontColorPlg:function(workspace,ui){this._execCommand("forecolor",ui.value)},_fontBackgroundColorPlg:function(workspace,ui){var command=this._getFirefoxVersion()?"hilitecolor":"backcolor";this._execCommand(command,ui.value)},_domPathToolbar:function(){var self=this,tableItemPref="#"+this._id("_toolbars_insertObjectToolbar_item_"),tableItemAddRowID=tableItemPref+"addRow",tableItemAddColID=tableItemPref+"addColumn",tableItemRemRowID=tableItemPref+"removeRow",tableItemRemColID=tableItemPref+"removeColumn",doNotEnableToolbarButtonsSelector=tableItemAddRowID+", "+tableItemAddColID+", "+tableItemRemRowID+", "+tableItemRemColID;this._viewSourceBtn=$('<div class="ui-igbutton-viewsource"></div>').appendTo(this.element).igButton({labelText:"&nbsp;",title:$.ig.HtmlEditor.locale.viewSourceButtonTitle,icons:{primary:"ui-igbutton-viewsource-icon"},onlyIcons:true,click:function(){self._viewSourcePlg();if(self._domPathToolbar.igPathFinder("option","disabled")){self._domPathToolbar.igPathFinder("option","disabled",false);self._toolbars.find(":ui-igToolbarButton").not(doNotEnableToolbarButtonsSelector).igToolbarButton("option","disabled",false).end().end().find(":ui-igCombo").igCombo("enable");self._analyser._disableUnsupportedItems();self._onSelectionChange()}else{self._domPathToolbar.igPathFinder("option","disabled",true);self._toolbars.find(":ui-igToolbarButton").igToolbarButton("option","disabled",true).end().find(":ui-igCombo").igCombo("disable")}}});this._domPathToolbar=$('<div id="'+this._id("_domPathToolbar")+'"></div>').appendTo(this.element).igPathFinder({click:function(e,ui){var selectionWrapper=self._selectionWrapperSaved;self.workspace.contentWindow.document.body.focus();if(self._domPathToolbar.igPathFinder("option","disabled")){return}e.preventDefault();if(ui.item.is("html")){selectionWrapper.select(ui.item.children("body"))}else if(ui.item.is("body")){selectionWrapper.select(ui.item)}else{selectionWrapper.select(ui.item)}}})},_cutPlg:function(){this._execCommand("cut")},_copyPlg:function(){this._execCommand("copy")},_pastePlg:function(){this._execCommand("paste")},_onSelectionChange:function(callback){var self=this,selectionWrapper,workSpaceBody=$(this.workspace).contents().find("body"),selectionCallback=callback||function(){var selectedItem=this.getSelectedItem();if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("span").length>0){selectedItem=selectedItem.children("span").first()}else if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("font").length>0){selectedItem=selectedItem.children("font").first()}if(selectedItem[0].nodeType===self.NODE._Text){selectedItem=selectedItem.parent()}self._analyser.analyse(selectedItem);if(selectedItem.length){self._domPathToolbar.igPathFinder("option","items",$.merge(selectedItem,selectedItem.parents()))}};selectionWrapper=new $.ig.SelectionWrapper(this.workspace.contentWindow,function(){self._selectionWrapperSaved=this;self.sourceWindow.val(encodeURI(workSpaceBody.html()));selectionCallback.call(this)})},_destroyPopovers:function(){var el=this.element[0];$(':data("igPopover")').each(function(){if($.contains(el,this)){$(this).igPopover("destroy")}})},getContent:function(format){if(format==="text"){return $(this.workspace).contents().find("body").text()}if(format==="html"){return $(this.workspace).contents().find("body").html()}},setContent:function(content,format){if(format==="text"){$(this.workspace).contents().find("body").text(content)}else if(format==="html"){$(this.workspace).contents().find("body").html(content)}this.sourceWindow.val(encodeURI(content))},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);$(this.workspace.contentWindow).undelegate();this._destroyPopovers();this._viewSourceBtn.igButton("destroy");this.element.removeClass(this.css.htmlEditor).find("#"+this._id("_content")).removeClass(this.css.htmlEditorContent).end().find("#"+this._id("_domPathToolbar")).removeClass(this.css.pathFinder).end().find("#"+this._id("_toolbars")).removeClass(this.css.toolbarsContainer).end().find(":ui-igToolbar").igToolbar("destroy").end().empty()},executeAction:function(actionName,args){this._selectionWrapperSaved.execCommand(actionName.toLowerCase(),args);this._onSelectionChange()},isDirty:function(){return this._isDirty},contentEditable:function(){return this.workspace},selection:function(){return this._selectionWrapperSaved._getSelection()},range:function(){return this._selectionWrapperSaved._getRange()},insertAtCaret:function(element){var el,range;if($.ig.util.isDomElement(element)){element=$(element)}if(element instanceof $){element=$("<div />").append(element).html()}else if(typeof element!=="string"){return}el=$(element,this._selectionWrapperSaved._document)[0];range=this.range();if(this._selectionWrapperSaved._isIeOld){range.pasteHTML(element)}else{range.insertNode(el)}}});$.widget("ui.igPathFinder",{options:{items:null},css:{button:"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-igbutton ui-widget-content",buttonLabel:"ui-button-text",stateDefault:"ui-state-default",firstButton:"ui-first-button",overflowMarker:"ui-igpathfinder-overflowMarker"},_create:function(){this._addStyles()},_addStyles:function(){this.element.addClass("ui-igPathFinder")},_setOption:function(name,value){$.Widget.prototype._setOption.apply(this,arguments);switch(name){case"items":this._updateToolbar();break;case"disabled":this.element.find("button").attr("disabled",value).attr("aria-disabled",value);break;default:break}},_addOverflowMarker:function(){var overflowMarker=$("<div>...</div>").addClass(this.css.overflowMarker).addClass(this.css.stateDefault);overflowMarker.prependTo(this.element)},_updateToolbar:function(){var i,parents,btn,buttonsList,self=this,o=this.options,path=[],html="",viewSrcBtn=$(".ui-igbutton-viewsource"),overflowMarkerWidth=20,maxWidth=viewSrcBtn.parent().width()-viewSrcBtn.outerWidth(true)-overflowMarkerWidth,maxWidthReached=false;if(o.items.length){o.items.each(function(index,element){html='<div aria-disabled="false" style="z-index:'+index+'" class="'+self.css.button+'">'+'<span class="'+self.css.buttonLabel+'">'+element.nodeName+"</span>"+"</div>";path.push(html)});this.element.empty();parents=$(o.items.toArray().reverse());buttonsList=$(path.reverse().join(""));for(i=buttonsList.length-1;i>=0&&!maxWidthReached;i--){buttonsList.removeClass(this.css.firstButton);btn=buttonsList.eq(i).addClass(this.css.firstButton).prependTo(this.element);if(i===0){maxWidth+=overflowMarkerWidth}if(this.element.outerWidth(true)>maxWidth){btn.remove();buttonsList.eq(i+1).addClass(this.css.firstButton);this._addOverflowMarker();maxWidthReached=true}}buttonsList.attr("disabled",o.disabled).attr("aria-disabled",o.disabled).mouseover(function(e){if(!o.disabled){$(this).addClass("ui-state-hover")}}).mouseleave(function(e){if(!o.disabled){$(this).removeClass("ui-state-hover")}}).click(function(e){if(!o.disabled){$(this).siblings(".ui-state-active").removeClass("ui-state-active");$(this).addClass("ui-state-active");self._trigger("click",e,{item:parents.eq(buttonsList.index(this))})}})}}});$.widget("ui.igHtmlEditorPopover",{options:{item:null,target:null,isHidden:true},css:{igHtmlEditorPropertiesDialog:"ui-ightmleditor-dialog",igHtmlEditorPropertiesDialogContainer:"ui-ightmleditor-dialog-container"},events:{apply:"applyform",cancel:"cancelform",show:"show",hide:"hide"},_id:function(id){return this.element[0].id+id
},_create:function(){this.element.igPopover({closeOnBlur:false,position:"balanced",direction:"bottom",renderCloseButton:false,showOn:null});this.poContent=this.element.igPopover("container");this._createForm()},_init:function(){this._item=this.options.item;this.poContent.addClass(this.css.igHtmlEditorPropertiesDialog);this.element.addClass(this.css.igHtmlEditorPropertiesDialogContainer);this._attachFormEvents();this.show(this._item)},_createForm:function(){},_attachFormEvents:function(){},_dataBind:function(item){},show:function(item){this._item=item;this._dataBind(item);this.options.isHidden=false;this.element.igPopover("show",this.options.target);this._trigger(this.events.show)},hide:function(){this.options.isHidden=true;if(this.options.target.igToolbarButton("option","isSelected")){this.options.target.igToolbarButton("toggle")}this.element.igPopover("hide");this._trigger(this.events.hide)}});$.widget("ui.igLinkPropertiesDialog",$.ui.igHtmlEditorPopover,{_txtUrl:"",_cbTarget:"",_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_cmbOpenIn")).igCombo({selectedItems:[{index:0}],enableClearButton:false,width:155});this.poContent.find("#"+this._id("_btnCancel")).igButton({click:function(){self.hide()}});this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){e.stopImmediatePropagation();self._item.attr({href:self._txtUrl.val(),target:self._cbTarget.val()}).html(self._displayText.val().length>0?self._displayText.val():self._txtUrl.val());self._trigger(self.events.apply,e,{anchor:self._item});self.hide()}});this.poContent.bind("keypress",function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){self.hide()}});this.element.bind("igpopovershown",function(e){self.poContent.find("#"+self._id("_linkHref")).focus()})},_createForm:function(){var html="";html+="<div>"+'<ol class="layoutList">'+"<li>"+'<label for="'+this._id("_linkHref")+'">'+$.ig.HtmlEditor.locale.linkNavigateToUrlDialogText+"</label>"+'<input autocomplete="off" id="'+this._id("_linkHref")+'" name="href" type="text" value="" />'+"</li>"+"<li>"+'<label for="'+this._id("_linkDisplayText")+'">'+$.ig.HtmlEditor.locale.linkDisplayTextDialogText+"</label>"+'<input autocomplete="off" id="'+this._id("_linkDisplayText")+'" name="href" type="text" value="" />'+"</li>"+"<li>"+'<label for="'+this._id("_cmbOpenIn")+'">'+$.ig.HtmlEditor.locale.linkOpenInDialogText+"</label>"+'<select id="'+this._id("_cmbOpenIn")+'" name="target">'+'<option value="_blank">'+$.ig.HtmlEditor.locale.linkTargetNewWindowDialogText+"</option>"+'<option value="_self">'+$.ig.HtmlEditor.locale.linkTargetSameWindowDialogText+"</option>"+'<option value="_parent">'+$.ig.HtmlEditor.locale.linkTargetParentWindowDialogText+"</option>"+'<option value="_top">'+$.ig.HtmlEditor.locale.linkTargetTopmostWindowDialogText+"</option>"+"</select>"+"</li>"+'<li style="text-align:right">'+'<button aria-disabled="false" id="'+this._id("_btnApply")+'" name="insertLink" role="button" title="'+$.ig.HtmlEditor.locale.applyButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.applyButtonTitle+"</button>"+'<button aria-disabled="false" id="'+this._id("_btnCancel")+'" role="button" title="'+$.ig.HtmlEditor.locale.cancelButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.cancelButtonTitle+"</button>"+"</li>"+"</ol>"+"</div>";$(html).appendTo(this.poContent)},_dataBind:function(anchor){this._txtUrl=this.poContent.find("#"+this._id("_linkHref")).val(anchor.attr("href"));this._cbTarget=this.poContent.find("#"+this._id("_cmbOpenIn")).val(anchor.attr("target"));this._displayText=this.poContent.find("#"+this._id("_linkDisplayText")).val(anchor.html())}});$.widget("ui.igTablePropertiesDialog",$.ui.igHtmlEditorPopover,{_init:function(){this.rowsNumField=this.element.find("#"+this._id("_tableRows"));this.columnsNumField=this.element.find("#"+this._id("_tableColumns"));$.ui.igHtmlEditorPopover.prototype._init.apply(this,arguments)},_createForm:function(){var html="<div>"+'<ol class="layoutList">'+"<li>"+"</li>"+"<li>"+'<div class="ui-igtablepropertiesdialog-cols-rows-num">'+'<input type="hidden" id="'+this._id("_tableRows")+'" name="tableRows" readonly="readonly" value="">'+'<input type="hidden" id="'+this._id("_tableColumns")+'" name="tableColumns" readonly="readonly" value="">'+"</div>"+"</li>"+"</ol>"+"</div>";$(html).appendTo(this.poContent);this._sampleTable=$('<table "'+this._id("_tableModel")+'" class="ui-igtablepropertiesdialog-sample-table"></table>').tableManipulator({rows:8,columns:6}).appendTo(this.poContent.find(".layoutList li:first"))},_attachFormEvents:function(){var tablePreview=this.poContent.find("table"),cells=tablePreview.find("td").addClass("ui-state-default"),rows=tablePreview.find("tr"),self=this;tablePreview.delegate("td","mouseover",function(e){var target=$(e.target),currentRowNumber=target.parent().index()+1,currentColumnNumber=$(this).index()+1,i;cells.removeClass("ui-state-hover");for(i=0;i<currentRowNumber;i++){$(rows.get(i)).find("td:lt("+currentColumnNumber+")").addClass("ui-state-hover")}self.rowsNumField.val(currentRowNumber);self.columnsNumField.val(currentColumnNumber)});tablePreview.delegate("td","click",function(e){var target=$(e.target),currentRowNumber=target.parent().index()+1,currentColumnNumber=$(this).index()+1;self._item.tableManipulator({rows:currentRowNumber,columns:currentColumnNumber,addSpacingChar:true});self._trigger(self.events.apply,e,{table:self._item.attr("border",1)});self.hide()});tablePreview.bind("mouseout",function(){cells.removeClass("ui-state-hover");self.rowsNumField.val(null);self.columnsNumField.val(null)})},_dataBind:function(table){this.rowsNumField.val();this.columnsNumField.val()}});$.widget("ui.igImagePropertiesDialog",$.ui.igHtmlEditorPopover,{_init:function(){this._imgSrcFld=this.poContent.find("#"+this._id("_imgSrc"));this._imgAltFld=this.poContent.find("#"+this._id("_imgAlt"));$.ui.igHtmlEditorPopover.prototype._init.apply(this,arguments)},_createForm:function(){var html="";html+='<div class="'+this.css.igImagePropertiesDialogContent+'">';html+="	<div>";html+='		<ol class="layoutList">';html+="			<li>";html+='				<label for="'+this._id("_imgSrc")+'">'+$.ig.HtmlEditor.locale.imageUrlDialogText+"</label>";html+='				<input autocomplete="off" id="'+this._id("_imgSrc")+'" name="src" type="text" value="" />';html+="			</li>";html+="			<li>";html+='				<label for="'+this._id("_imgAlt")+'">'+$.ig.HtmlEditor.locale.imageAlternativeTextDialogText+"</label>";html+='				<input autocomplete="off" id="'+this._id("_imgAlt")+'" name="altText" type="text" value="" />';html+="			</li>";html+='			<li style="text-align:right">';html+='				<button aria-disabled="false" id="'+this._id("_btnApply")+'" name="insertLink" role="button" title="'+$.ig.HtmlEditor.locale.applyButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.applyButtonTitle+"</button>";html+='				<button aria-disabled="false" id="'+this._id("_btnCancel")+'" role="button" title="'+$.ig.HtmlEditor.locale.cancelButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.cancelButtonTitle+"</button>";html+="			</li>";html+="		</ol>";html+="	</div>";html+="</div>";this.poContent.append(html)},_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){self._item.attr({src:self._imgSrcFld.val(),alt:self._imgAltFld.val()});self._trigger(self.events.apply,e,{image:self._item});self.hide()}}).end().find("#"+this._id("_btnCancel")).igButton({click:function(e){self._trigger(self.events.cancel,e);self.hide()}})},_dataBind:function(image){this._imgSrcFld.val(image.attr("src"));this._imgAltFld.val(image.attr("alt"))}});var table,tableNumRows=0,tableNumCols=0,settings={document:document,rows:0,columns:0,addSpacingChar:false},spacingChar="",methods={init:function(options){return this.each(function(){var tRows;$.extend(settings,options);if(this.nodeName.toLowerCase()!=="table"){return}if(settings.addSpacingChar){spacingChar="&nbsp;"}table=$(this);tRows=methods.getTableRows();if(settings.rows&&settings.rows>0){tableNumRows=settings.rows}else{tableNumRows=tRows.length}if(settings.columns&&settings.columns>0){tableNumCols=settings.columns}else if(tRows[0]){tableNumCols=tRows[0].cells.length}if(!table.children().length){methods.create()}})},create:function(){var newRow,i,j;table.empty();for(i=0;i<tableNumRows;i++){newRow=$("<tr></tr>",settings.document).appendTo(table);for(j=0;j<tableNumCols;j++){$("<td>"+spacingChar+"</td>",settings.document).appendTo(newRow)}}},addRow:function(position){var newRow=$("<tr></tr>",settings.document),j;if(position){newRow.insertAfter(methods.getTableRows().eq(position))}else{newRow.appendTo(table)}for(j=0;j<methods.getColumnsNum();j++){$("<td>"+spacingChar+"</td>",settings.document).appendTo(newRow)}return newRow},removeRow:function(position){var rows=methods.getTableRows(),removedRow;if(position){removedRow=rows.eq(position).remove()}else{removedRow=rows.last().remove()}return removedRow},addColumn:function(position){var columnCellsArr=[];methods.getTableRows().each(function(idx,el){var row=$(el),columns=row.children("td"),newColumn=$("<td>"+spacingChar+"</td>",settings.document);if(position&&columns.length){columnCellsArr.push(newColumn.insertAfter(columns.eq(position))[0]);return true}columnCellsArr.push(newColumn.appendTo(row)[0])});return $([]).pushStack(columnCellsArr)},removeColumn:function(position){var removedRowsArr=[];methods.getTableRows().each(function(idx,el){var row=$(el);if(position){removedRowsArr.push(row.children("td").eq(position).remove());return true}removedRowsArr.push(row.children("td:last").remove())});return $([]).pushStack(removedRowsArr)},getRowsNum:function(){return methods.getTableRows().length},getColumnsNum:function(){return methods.getTableCols().length},getTableRows:function(){return table.children("tbody").children("tr")},getTableCols:function(){return table.children("tbody").children("tr").first().children("td")}};$.fn.tableManipulator=function(method){if(methods[method]){if(this!==table[0]){table=$(this)}return methods[method].apply(this,Array.prototype.slice.call(arguments,1))}if(typeof method==="object"||!method){return methods.init.apply(this,arguments)}$.error("Method "+method+" does not exist on jQuery.tableManipulator")};$.ig.SelectionWrapper=$.ig.SelectionWrapper||Class.extend({_selection:null,_range:null,_isIeOld:false,_document:null,_commands:{insertunorderedlist:{name:"_insertList",browsers:null,args:["insertunorderedlist"]},insertorderedlist:{name:"_insertList",browsers:null,args:["insertorderedlist"]}},_css:{larger:"ui-ightmleditor-larger",smaller:"ui-ightmleditor-smaller"},NODE:new $.ig.XmlNodeType,init:function(window,callback){var self=this;this._window=window;this._document=this._window.document;if(!this._document.getSelection){this._isIeOld=true}if(this._isIeOld){this.focus();this._selection=this._document.selection;this._window.setTimeout(function(){self._range=self._selection.createRange();if($.isFunction(callback)){callback.call(self)}},50)}else{this._selection=this._window.getSelection();this._window.setTimeout(function(){self._range=self._getSelection().rangeCount===0?self._document.createRange():self._selection.getRangeAt(0);if($.isFunction(callback)){callback.call(self)}},50)}},_getSelection:function(){return this._selection},_getRange:function(){return this._range},_isCommandSupportedByBrowser:function(command){var supportedBrowsers,i;if(command===null||!this._commands.hasOwnProperty(command.toLowerCase())){return}if(this._commands[command].browsers===null){return}supportedBrowsers=this._commands[command].browsers;for(i=0;i<supportedBrowsers.length;i++){if($.browser&&$.browser.hasOwnProperty(supportedBrowsers[i])){return true}if(!$.browser){if($.ig.util.isIE||$.ig.util.isSafari||$.ig.util.isChrome){return true}}}},surroundContents:function(wrapEl){var range=this._getRange();if(this._isIeOld){range.pasteHTML(wrapEl.html(range.text).get(0).outerHTML)}else{this._surroundContents($(range.commonAncestorContainer),$(range.startContainer),$(range.endContainer),wrapEl)}return wrapEl},getSelectedItem:function(){var range=this._getRange(),rangeParent=$(range.commonAncestorContainer);if(!this._isIeOld){if(range.collapsed&&range.endContainer.nodeType===this.NODE._Text){if(rangeParent.parent().is("img")||rangeParent.parent().is("td")){return rangeParent.parent()}return $(range.startContainer)}if(range.collapsed){return $(range.commonAncestorContainer)}if(range.collapsed&&range.endContainer.nodeType===this.NODE._Element){return $(range.commonAncestorContainer.childNodes[range.endOffset-range.startOffset])}return $(range.commonAncestorContainer)}if(range.parentElement!==undefined){return $(range.parentElement())}if(range.commonParentElement!==undefined){return $(range.commonParentElement())}},getSelectionAsText:function(){if(this._getRange().text!==undefined){return this._getRange().text}return this._getRange().toString()},select:function(element){var selectedItem=element||this.getSelectedItem(),newRange;if(!this._isIeOld){this._range.selectNodeContents(selectedItem[0]);this._selection.removeAllRanges();this._selection.addRange(this._range)}else{newRange=this._document.body.createTextRange();if(selectedItem.length===1){newRange.moveToElementText(selectedItem[0])}newRange.select()}},insertElement:function(element){if(!this._isIeOld){this._getRange().insertNode(element.get(0))}else{this._getRange().pasteHTML(element.get(0).outerHTML)}},applyStyle:function(){},execCommand:function(name,args){var range=this._getRange(),customCommand=this._commands[name]?this[this._commands[name].name]:null,customCommandArgs=this._commands[name]?this._commands[name].args:null,browser=this._commands[name]?this._commands[name].browsers:null,startEl,endEl,p,isCommandSupported=this._isCommandSupportedByBrowser(name),shouldExit=false;if(this._isIeOld){range.select();range.execCommand(name,false,args)}else{p=$("<p><br /></p>",this._document);if(this._selection.isCollapsed&&range.collapsed){if($(range.startContainer).is("body")){startEl=$(range.startContainer).find(":first");if(!startEl.length){startEl=$(range.startContainer)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Document){startEl=$(range.startContainer.body).find(":first");if(!startEl.length){startEl=$(range.startContainer.body)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Text){this._updateSelection(range);this._document.execCommand(name,false,args);shouldExit=true}else{startEl=$(range.startContainer);range.selectNodeContents(startEl[0])}if(shouldExit){return}if(startEl&&startEl.is("br")&&endEl&&endEl.is("br")){startEl.replaceWith(p);range.selectNodeContents(p[0]);this._updateSelection(range)}}if($.ig.util.isIE&&$.ig.util.browserVersion>=9||$.ig.util.isOpera){this._updateSelection(range)}if($.isFunction(customCommand)&&browser===null){customCommand.call(this,name,args)}else if($.isFunction(customCommand)&&isCommandSupported){customCommand.apply(this,customCommandArgs)}else{this._document.execCommand(name,false,args)}}},_insertList:function(listType,args){var self=this,textNodes;this._document.execCommand(listType,false,args);if(!this._document.queryCommandState(listType)){if(this._selection.anchorNode&&this._selection.anchorNode.nodeType===this.NODE._Text&&$(this._selection.focusNode).is("body")){textNodes=$(this._selection.focusNode).contents().filter(function(){if($(this).is("br")){$(this).remove();return false}return this.nodeType===self.NODE._Text})}}},_getTextNodesOnlyCallback:function(){return this.nodeType===this.NODE._Text},_wrapPartialString:function(string,start,end,wrapElName){var stack=[];stack.push(this._document.createTextNode(string.slice(0,start)));stack.push(wrapElName.text(string.substring(start,end))[0]);stack.push(this._document.createTextNode(string.slice(end)));return $(stack)},_updateSelection:function(range){this._selection.removeAllRanges();this._selection.addRange(range)},_surroundContents:function(commonParrent,startEl,endEl,wrapEl,wholeElement){var self=this,startOffset,endOffset,rangeStart,rangeEnd,startElPar,endElPar,selection=this._getSelection(),range=this._getRange(),startElSiblings;if(startEl[0]===endEl[0]){range.surroundContents(wrapEl.get(0));return wrapEl}startOffset=range.startOffset;endOffset=range.endOffset;rangeStart=this._document.createRange();rangeStart.setStart(startEl.get(0),startOffset);rangeStart.setEnd(startEl.get(0),startEl.text().length);rangeStart.surroundContents(wrapEl.clone().get(0));selection.addRange(rangeStart);startElPar=this._getLastParentUntil(startEl,commonParrent);endElPar=this._getLastParentUntil(endEl,commonParrent);startElSiblings=startElPar.siblings();startElPar.siblings().each(function(i,el){if(startElPar[0]===endElPar[0]){return}var rangeClone=self._document.createRange();rangeClone.setStartBefore(el);rangeClone.setEndAfter(el);rangeClone.surroundContents(wrapEl.clone().get(0));selection.addRange(rangeClone)});rangeEnd=this._document.createRange();rangeEnd.setStart(endEl.get(0),0);rangeEnd.setEnd(endEl.get(0),endOffset);rangeEnd.surroundContents(wrapEl.clone().get(0));selection.addRange(rangeEnd)},_getLastParentUntil:function(root,target){while(root.parent().length){if(root.parent()[0]===target[0]){return root}root=root.parent()}},replaceNode:function(newNode){var range=this._getRange();if(range.startOffset!==range.endOffset){range.deleteContents()}if(range.insertNode!==undefined){range.insertNode(newNode[0])}else if(range.pasteHTML!==undefined){range.pasteHTML(newNode[0].outerHTML)}},insertTable:function(table){var selItem=this.getSelectedItem(),br=$("<br>",this._document);if(selItem[0].nodeType===this.NODE._Document){this._range.selectNodeContents(selItem.find("body > p:first")[0]);this._range.insertNode(table[0])}else if(selItem.is("td")){table.appendTo(selItem)}else if(selItem.is("table")){selItem.replaceWith(table)}else if(selItem.is("br")){selItem.replaceWith(table)}else{if(this._range.insertNode!==undefined){this._range.insertNode(table[0])}else if(this._range.pasteHTML!==undefined){this._range.select();this._range.pasteHTML(table[0].outerHTML)}}if(this._range.selectNodeContents!==undefined){this._range.selectNodeContents(br.insertAfter(table)[0])}},focus:function(){var focusTarget=$(this._document.body).find(":not(br):first");if(this._isIeOld){this._document.body.focus();return}if(this._range.startContainer.nodeType!==this.NODE._Document&&!$(this._range.startContainer).is("body")){return}if(this._range.startContainer.nodeType===this.NODE._Text){this._document.body.focus();return}if(focusTarget.length===0){return}this._range.setStart(focusTarget[0],0);this._range.setEnd(focusTarget[0],0);this._document.body.focus()}});$.ig.ToolbarHelper=$.ig.ToolbarHelper||Class.extend({_toolbarsItemsLocation:{textToolbar:{name:"textToolbar",bold:{name:"bold"},italic:{name:"Italic"},underline:{name:"Underline"},strikethrough:{name:"Strikethrough"},fontFamily:{name:"fontFamily"},fontSize:{name:"fontSize"},formatsList:{name:"formatsList"}},formattingToolbar:{name:"formattingToolbar",justifyleft:{name:"justifyleft"},justifycenter:{name:"justifycenter"},justifyright:{name:"justifyright"},justifyfull:{name:"justifyfull"},bullets:{name:"bullets"},indent:{name:"indent"},outdent:{name:"outdent"},textColor:{name:"textColor"},backgroundTextColor:{name:"backgroundTextColor"}},insertObjectToolbar:{name:"insertObjectToolbar",image:{name:"image"},link:{name:"link"},table:{name:"table"},addRow:{name:"addRow"},addColumn:{name:"addColumn"},removeRow:{name:"removeRow"},removeColumn:{name:"removeColumn"}},copyPasteToolbar:{name:"copyPasteToolbar",copy:{name:"copy"},cut:{name:"cut"},paste:{name:"paste"},undo:{name:"undo"},redo:{name:"redo"}}},init:function(window,toolbars){this._toolbars={};this._w=window;this._d=window.document;var self=this;toolbars.each(function(idx,el){var igToolbarName=$(el).igToolbar("option","name");self._toolbars[igToolbarName]=$(el)});this._initAlignButtons(toolbars);this._disableUnsupportedItems();this._disableTableControls(true)},_initAlignButtons:function(toolbars){var alignButtonsToolbar=this._toolbars.formattingToolbar,alignButtons={justifyleft:alignButtonsToolbar.igToolbar("getItem","justifyleft"),justifycenter:alignButtonsToolbar.igToolbar("getItem","justifycenter"),justifyright:alignButtonsToolbar.igToolbar("getItem","justifyright"),justifyfull:alignButtonsToolbar.igToolbar("getItem","justifyfull")};toolbars.bind("igtoolbartoolbarbuttonclick",function(e,ui){if(alignButtons.hasOwnProperty(ui.name)){$.each(alignButtons,function(buttonName,button){if(buttonName!==ui.name&&button.igToolbarButton("option","isSelected")){button.igToolbarButton("toggle");return}})}})},_disableUnsupportedItems:function(){var copyPasteToolbar=this._toolbars.copyPasteToolbar;if(!$.ig.util.isIE){copyPasteToolbar.igToolbar("disableItem","cut",true);copyPasteToolbar.igToolbar("disableItem","copy",true);copyPasteToolbar.igToolbar("disableItem","paste",true)}},_disableTableControls:function(toDisable){var insertObjectToolbar=this._toolbars.insertObjectToolbar;if(!toDisable&&this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",false);insertObjectToolbar.igToolbar("disableItem","removeColumn",false);insertObjectToolbar.igToolbar("disableItem","addRow",false);insertObjectToolbar.igToolbar("disableItem","removeRow",false);this._isTableControlsDisabled=false}else if(toDisable&&!this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",true);insertObjectToolbar.igToolbar("disableItem","removeColumn",true);insertObjectToolbar.igToolbar("disableItem","addRow",true);insertObjectToolbar.igToolbar("disableItem","removeRow",true);this._isTableControlsDisabled=true}},_callbackMap:{_isBold:"_onBold",_isItalic:"_onItalic",_isUnderlined:"_onUnderlined",_isLineThrough:"_onLineThrough",_isJustifyCenter:"_onAlign",_isJustifyFull:"_onAlign",_isJustifyLeft:"_onAlign",_isJustifyRight:"_onAlign",_isOrderedList:"_onList",_isUnorderedList:"_onList",_hasFontName:"_onFontName",_hasFontSize:"_onFontSize",_isTable:"_onTable"},analyse:function(el){var self=this;this._resetToolbars();if(el[0].nodeType===9){this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(this._d.body)||this._d.body.currentStyle}else{this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(el[0])||el[0].currentStyle}if(el.is(":header")){this._onHeader(el)}$.each(this._callbackMap,function(isTrueFunc,callback){var isTrueRes=self[isTrueFunc](el);if($.isFunction(self[isTrueFunc])&&isTrueRes&&$.isFunction(self[callback])){self[callback](el,isTrueRes)}});if(!el.is("table")&&!el.is("td")){this._disableTableControls(true)}},_isBold:function(){return this._d.queryCommandState("bold")||this._computedStyles.fontWeight>=700},_isItalic:function(){return this._d.queryCommandState("italic")||this._computedStyles.fontStyle.toLowerCase()==="italic"},_isUnderlined:function(){return this._d.queryCommandState("underline")||this._computedStyles.textDecoration.toLowerCase().indexOf("underline")!==-1},_isLineThrough:function(){return this._d.queryCommandState("strikethrough")||this._computedStyles.textDecoration.toLowerCase().indexOf("line-through")!==-1},_isJustifyCenter:function(){if(this._d.queryCommandState("justifycenter")){return"justifycenter"}},_isJustifyFull:function(){if(this._d.queryCommandState("justifyfull")){return"justifyfull"}},_isJustifyLeft:function(){if(this._d.queryCommandState("justifyleft")){return"justifyleft"}},_isJustifyRight:function(){if(this._d.queryCommandState("justifyright")){return"justifyright"}},_isOrderedList:function(){if(this._d.queryCommandState("insertorderedlist")){return"InsertOrderedList"}},_isUnorderedList:function(){if(this._d.queryCommandState("insertunorderedlist")){return"InsertUnorderedList"}},_isTable:function(el){if(el.is("table")||el.is("td")){return true}},_checkParents:function(el,wanted){while(el.parent()){if(el.parent().is(wanted)){return true}if(el.is("body")){return}el=el.parent()}},_hasFontName:function(){var fontName=this._getFontFamily();if(fontName==="serif"){fontName="Times New Roman"}return fontName},_getFontFamily:function(){return this._computedStyles.fontFamily},_hasFontSize:function(){return this._computedStyles.fontSize},_onBold:function(el){this._toolbars.textToolbar.igToolbar("getItem","Bold").igToolbarButton("toggle")},_onItalic:function(el){this._toolbars.textToolbar.igToolbar("getItem","Italic").igToolbarButton("toggle")},_onUnderlined:function(el){this._toolbars.textToolbar.igToolbar("getItem","Underline").igToolbarButton("toggle")},_onLineThrough:function(el){this._toolbars.textToolbar.igToolbar("getItem","Strikethrough").igToolbarButton("toggle")},_onAlign:function(el,dir){this._toolbars.formattingToolbar.igToolbar("getItem",dir).igToolbarButton("toggle")},_onList:function(el,listType){this._toolbars.formattingToolbar.igToolbar("getItem",listType).igToolbarButton("toggle")},_onFontName:function(el,fontName){var combo=this._toolbars.textToolbar.igToolbar("getItem","fontFamily");fontName=fontName.replace(/'|"/g,"");this._setComboValue(combo,$.ig.HtmlEditor.locale.fontNames[/^win/gi.test(navigator.platform)?"win":"mac"],fontName)},_onFontSize:function(el){var pxTbl={"11px":1,"13px":3,"16px":4,"19px":5,"18px":7,"24px":7},fontSizeUnits=this._d.queryCommandValue("fontsize")||pxTbl[this._computedStyles.fontSize],fontSizeUnitsStr=fontSizeUnits?fontSizeUnits.toString():"",combo=this._toolbars.textToolbar.igToolbar("getItem","fontSize");this._setComboValue(combo,$.ig.HtmlEditor.locale.fontSizes,fontSizeUnitsStr)},_onHeader:function(element){var combo=this._toolbars.textToolbar.igToolbar("getItem","formatsList");this._setComboValue(combo,$.ig.HtmlEditor.locale.formatsList,element[0].nodeName.toLowerCase())},_onTable:function(){this._disableTableControls(false)},_setComboValue:function(combo,values,newValue,valueKey){var i,dsValueKey=valueKey||"text",currentValue=values[combo.igCombo("selectedIndex")][dsValueKey],dataSourceValue;if(newValue===currentValue){return}for(i=0;i<values.length;i++){dataSourceValue=values[i][dsValueKey];if(newValue===dataSourceValue){combo.igCombo("selectedIndex",i);break}}},_resetToolbars:function(){$.each(this._toolbars,function(idx,el){$(el).igToolbar("deactivateAll")})}});$.extend($.ui.igHtmlEditor,{version:"14.1.20141.1020"})})(jQuery);(function($){$(document).ready(function(){var wm=$("#__ig_wm__").length>0?$("#__ig_wm__"):$('<div id="__ig_wm__"></div>').appendTo(document.body);wm.css({position:"fixed",bottom:0,right:0,zIndex:1e3}).addClass("ui-igtrialwatermark")})})(jQuery);