aboutsummaryrefslogtreecommitdiffstats
path: root/public/assets/refinery/wymeditor.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/refinery/wymeditor.js')
-rw-r--r--public/assets/refinery/wymeditor.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/public/assets/refinery/wymeditor.js b/public/assets/refinery/wymeditor.js
index 9ca0fca..2927284 100644
--- a/public/assets/refinery/wymeditor.js
+++ b/public/assets/refinery/wymeditor.js
@@ -44,7 +44,7 @@ WYMeditor.WymClassExplorer=function(t){this._wym=t,this._class="className",this.
* Bermi Ferrer (wymeditor a-t bermi dotorg)
* Frédéric Palluel-Lafleur (fpalluel a-t gmail dotcom)
*/
-WYMeditor.WymClassMozilla=function(t){this._wym=t,this._class="class",this._newLine="\n"},WYMeditor.WymClassMozilla.prototype.initIframe=function(iframe){var wym=this;this._iframe=iframe,this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0],aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss),this._doc.title=this._wym._index,$("html",this._doc).attr("dir",this._options.direction),$(".fieldWithErrors iframe").contents().find("body").addClass("fieldWithErrors"),this.html(this._wym._html),this.enableDesignMode(),$.isFunction(this._options.preBind)&&this._options.preBind(this),this._wym.bindEvents(),$(this._doc).bind("keydown",this.keydown),$(this._doc).bind("keyup",this.keyup),$(this._doc).bind("paste",this.intercept_paste),$(this._doc).bind("focus",function(){wym.enableDesignMode.call(wym)}),$.isFunction(this._options.postInit)&&this._options.postInit(this),this.listen()},WYMeditor.WymClassMozilla.prototype.html=function(t){if("string"!=typeof t)return $(this._doc.body).html();try{this._doc.designMode="off"}catch(e){}t=t.replace(/<em(\b[^>]*)>/gi,"<i$1>").replace(/<\/em>/gi,"</i>").replace(/<strong(\b[^>]*)>/gi,"<b$1>").replace(/<\/strong>/gi,"</b>"),$(this._doc.body).html(t),this.enableDesignMode()},WYMeditor.WymClassMozilla.prototype._exec=function(t,e){if(!this.selected())return!1;switch(t){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var i=this.selected(),s=this._iframe.contentWindow.getSelection().anchorNode;if("#text"==s.nodeName&&(s=s.parentNode),i=this.findUp(i,WYMeditor.BLOCKS),s=this.findUp(s,WYMeditor.BLOCKS),i&&i==s&&i.tagName.toLowerCase()==WYMeditor.LI){var o=i.parentNode.parentNode;(1<i.parentNode.childNodes.length||-1<$.inArray(o.tagName.toLowerCase(),[WYMeditor.OL,WYMeditor.UL]))&&this._doc.execCommand(t,"",null)}break;default:e?this._doc.execCommand(t,"",e):this._doc.execCommand(t,"",null)}this.selected().tagName.toLowerCase()==WYMeditor.BODY&&this._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)},WYMeditor.WymClassMozilla.prototype.selected=function(t){null!=t&&"true"==t.toString()||(t=!1);var e=this._iframe.contentWindow.getSelection(),s=e.focusNode;if(s){if("#text"==s.nodeName){if(t&&0<e.toString().length){if(actual_node=null,parent_node=e.focusNode.parentNode,null!=parent_node)for(i=0;i<parent_node.childNodes.length;i++)child_node=parent_node.childNodes[i],"#text"!=child_node.nodeName&&child_node.innerHTML==e.toString()&&(actual_node=child_node);return null==actual_node?this.switchTo(e,"span"):actual_node}return s.parentNode}return s}return null},WYMeditor.WymClassMozilla.prototype.addCssRule=function(t,e){t.insertRule(e.name+" {"+e.css+"}",t.cssRules.length)},WYMeditor.WymClassMozilla.prototype.keydown=function(t){var e=WYMeditor.INSTANCES[this.title];if(t.ctrlKey){if(66==t.keyCode)return e._exec(WYMeditor.BOLD),!1;if(73==t.keyCode)return e._exec(WYMeditor.ITALIC),!1}else 13==t.keyCode&&(t.shiftKey||(container=e.selected(),container&&container.tagName.toLowerCase()==WYMeditor.PRE&&(t.preventDefault(),e.insert("<p></p>"))))},WYMeditor.WymClassMozilla.prototype.keyup=function(t){if(null!=(wym=WYMeditor.INSTANCES[this.title])){wym._selected_image=null,$(wym._iframe).contents().find(".selected_by_wym").removeClass("selected_by_wym");var e=null;13!=t.keyCode||t.shiftKey?-1!=$.inArray(t.keyCode,[8,17,46,224])||t.metaKey||t.ctrlKey||wym.format_block():($(wym._doc.body).children(WYMeditor.BR).remove(),(e=wym.selected())&&e.tagName.toLowerCase()==WYMeditor.PRE&&wym._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P))}},WYMeditor.WymClassMozilla.prototype.enableDesignMode=function(){if("off"==this._doc.designMode)try{this._doc.designMode="on",this._doc.execCommand("styleWithCSS","",!1)}catch(t){}},WYMeditor.WymClassMozilla.prototype.openBlockTag=function(t,e){e=this.validator.getValidTagAttributes(t,e);if("span"===t&&e.style){var i=this.getTagForStyle(e.style);i&&(t=i,this._tag_stack.pop(),this._tag_stack.push(t),e.style="")}this.output+=this.helper.tag(t,e,!0)},WYMeditor.WymClassMozilla.prototype.getTagForStyle=function(t){return/bold/.test(t)?"strong":/italic/.test(t)?"em":/sub/.test(t)?"sub":!!/super/.test(t)&&"super"},
+WYMeditor.WymClassMozilla=function(t){this._wym=t,this._class="class",this._newLine="\n"},WYMeditor.WymClassMozilla.prototype.initIframe=function(iframe){var wym=this;this._iframe=iframe,this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0],aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss),this._doc.title=this._wym._index,$("html",this._doc).attr("dir",this._options.direction),$(".fieldWithErrors iframe").contents().find("body").addClass("fieldWithErrors"),this.html(this._wym._html),this.enableDesignMode(),$.isFunction(this._options.preBind)&&this._options.preBind(this),this._wym.bindEvents(),$(this._doc).bind("keydown",this.keydown),$(this._doc).bind("keyup",this.keyup),$(this._doc).bind("paste",this.intercept_paste),$(this._doc).bind("focus",function(){wym.enableDesignMode.call(wym)}),$.isFunction(this._options.postInit)&&this._options.postInit(this),this.listen()},WYMeditor.WymClassMozilla.prototype.html=function(t){if("string"!=typeof t)return $(this._doc.body).html();try{this._doc.designMode="off"}catch(e){}t=t.replace(/<em(\b[^>]*)>/gi,"<i$1>").replace(/<\/em>/gi,"</i>").replace(/<strong(\b[^>]*)>/gi,"<b$1>").replace(/<\/strong>/gi,"</b>"),$(this._doc.body).html(t),this.enableDesignMode()},WYMeditor.WymClassMozilla.prototype._exec=function(t,e){if(!this.selected())return!1;switch(t){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var i=this.selected(),s=this._iframe.contentWindow.getSelection().anchorNode;if("#text"==s.nodeName&&(s=s.parentNode),i=this.findUp(i,WYMeditor.BLOCKS),s=this.findUp(s,WYMeditor.BLOCKS),i&&i==s&&i.tagName.toLowerCase()==WYMeditor.LI){var o=i.parentNode.parentNode;(1<i.parentNode.childNodes.length||-1<$.inArray(o.tagName.toLowerCase(),[WYMeditor.OL,WYMeditor.UL]))&&this._doc.execCommand(t,"",null)}break;default:e?this._doc.execCommand(t,"",e):this._doc.execCommand(t,"",null)}this.selected().tagName.toLowerCase()==WYMeditor.BODY&&this._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)},WYMeditor.WymClassMozilla.prototype.selected=function(t){null!=t&&"true"==t.toString()||(t=!1);var e=this._iframe.contentWindow.getSelection(),s=e.focusNode;if(s){if("#text"!=s.nodeName)return s;if(t&&0<e.toString().length){if(actual_node=null,parent_node=e.focusNode.parentNode,null!=parent_node)for(i=0;i<parent_node.childNodes.length;i++)child_node=parent_node.childNodes[i],"#text"!=child_node.nodeName&&child_node.innerHTML==e.toString()&&(actual_node=child_node);return null==actual_node?this.switchTo(e,"span"):actual_node}return s.parentNode}return null},WYMeditor.WymClassMozilla.prototype.addCssRule=function(t,e){t.insertRule(e.name+" {"+e.css+"}",t.cssRules.length)},WYMeditor.WymClassMozilla.prototype.keydown=function(t){var e=WYMeditor.INSTANCES[this.title];if(t.ctrlKey){if(66==t.keyCode)return e._exec(WYMeditor.BOLD),!1;if(73==t.keyCode)return e._exec(WYMeditor.ITALIC),!1}else 13==t.keyCode&&(t.shiftKey||(container=e.selected(),container&&container.tagName.toLowerCase()==WYMeditor.PRE&&(t.preventDefault(),e.insert("<p></p>"))))},WYMeditor.WymClassMozilla.prototype.keyup=function(t){if(null!=(wym=WYMeditor.INSTANCES[this.title])){wym._selected_image=null,$(wym._iframe).contents().find(".selected_by_wym").removeClass("selected_by_wym");var e=null;13!=t.keyCode||t.shiftKey?-1!=$.inArray(t.keyCode,[8,17,46,224])||t.metaKey||t.ctrlKey||wym.format_block():($(wym._doc.body).children(WYMeditor.BR).remove(),(e=wym.selected())&&e.tagName.toLowerCase()==WYMeditor.PRE&&wym._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P))}},WYMeditor.WymClassMozilla.prototype.enableDesignMode=function(){if("off"==this._doc.designMode)try{this._doc.designMode="on",this._doc.execCommand("styleWithCSS","",!1)}catch(t){}},WYMeditor.WymClassMozilla.prototype.openBlockTag=function(t,e){e=this.validator.getValidTagAttributes(t,e);if("span"===t&&e.style){var i=this.getTagForStyle(e.style);i&&(t=i,this._tag_stack.pop(),this._tag_stack.push(t),e.style="")}this.output+=this.helper.tag(t,e,!0)},WYMeditor.WymClassMozilla.prototype.getTagForStyle=function(t){return/bold/.test(t)?"strong":/italic/.test(t)?"em":/sub/.test(t)?"sub":!!/super/.test(t)&&"super"},
/*
* WYMeditor : what you see is What You Mean web-based editor
* Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/
@@ -81,4 +81,4 @@ WYMeditor.WymClassOpera=function(t){this._wym=t,this._class="class",this._newLin
* Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg)
* Scott Lewis (lewiscot a-t gmail dotcom)
*/
-WYMeditor.WymClassSafari=function(t){this._wym=t,this._class="class",this._newLine="\n"},WYMeditor.WymClassSafari.prototype.initIframe=function(iframe){this._iframe=iframe,this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0],aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss),this._doc.title=this._wym._index,$("html",this._doc).attr("dir",this._options.direction),this._doc.designMode="on",this.html(this._wym._html),$.isFunction(this._options.preBind)&&this._options.preBind(this),this._wym.bindEvents(),$(this._doc).bind("keydown",this.keydown),$(this._doc).bind("keyup",this.keyup),$(this._doc).bind("paste",this.intercept_paste),$.isFunction(this._options.postInit)&&this._options.postInit(this),this.listen()},WYMeditor.WymClassSafari.prototype._exec=function(t,e){var i=this;if(!i.selected())return!1;switch(t){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var s=i.selected(),o=i._iframe.contentWindow.getSelection().anchorNode;if("#text"==o.nodeName&&(o=o.parentNode),s=i.findUp(s,WYMeditor.BLOCKS),o=i.findUp(o,WYMeditor.BLOCKS),s&&s==o&&s.tagName.toLowerCase()==WYMeditor.LI){var r=s.parentNode.parentNode;(1<s.parentNode.childNodes.length||-1<$.inArray(r.tagName.toLowerCase(),[WYMeditor.OL,WYMeditor.UL]))&&i._doc.execCommand(t,"",null)}break;case WYMeditor.INSERT_ORDEREDLIST:case WYMeditor.INSERT_UNORDEREDLIST:this._doc.execCommand(t,"",null);s=this.selected();var a=this.findUp(s,WYMeditor.MAIN_CONTAINERS);a&&$(a).replaceWith($(a).html());break;default:e?this._doc.execCommand(t,"",e):this._doc.execCommand(t,"",null)}},WYMeditor.WymClassSafari.prototype.selected=function(t){null!=t&&"true"==t.toString()||(t=!1);var e=this._iframe.contentWindow.getSelection(),s=e.focusNode;if(s){if("#text"==s.nodeName){if(t&&0<e.toString().length){if(actual_node=null,parent_node=e.focusNode.parentNode,null!=parent_node)for(i=0;i<parent_node.childNodes.length;i++)child_node=parent_node.childNodes[i],child_node.textContent==e.toString()&&(actual_node=child_node.parentNode);return null==actual_node?(this._selected_item=this.switchTo(e,"span"),this._selected_item):actual_node}return s.parentNode}return s}return null},WYMeditor.WymClassSafari.prototype.toggleClass=function(t,e){var i=null;i=this._selected_image?$(this._selected_image):$(this.selected(!0)||this._selected_item),null!=e&&(i=$(i.parentsOrSelf(e))),i.toggleClass(t),i.attr(WYMeditor.CLASS)||i.removeAttr(this._class)},WYMeditor.WymClassSafari.prototype.addCssRule=function(t,e){t.insertRule(e.name+" {"+e.css+"}",t.cssRules.length)},WYMeditor.WymClassSafari.prototype.keydown=function(t){var e=WYMeditor.INSTANCES[this.title];t.ctrlKey?(66==t.keyCode&&(e._exec(WYMeditor.BOLD),t.preventDefault()),73==t.keyCode&&(e._exec(WYMeditor.ITALIC),t.preventDefault())):t.shiftKey&&13==t.keyCode&&(e._exec("InsertLineBreak"),t.preventDefault())},WYMeditor.WymClassSafari.prototype.keyup=function(t){var e=WYMeditor.INSTANCES[this.title];e._selected_image=null,$(e._iframe).contents().find(".selected_by_wym").removeClass("selected_by_wym");var i=null;13!=t.keyCode||t.shiftKey?-1!=$.inArray(t.keyCode,[8,17,46,224])||t.metaKey||t.ctrlKey||(i=e.selected())&&(name=i.tagName.toLowerCase())&&(-1<$.inArray(name,["strong","b","em","i","sub","sup","a","span"])&&(name=i.parentNode.tagName.toLowerCase()),-1<$.inArray(name,[WYMeditor.BODY,WYMeditor.DIV])&&e._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)):($(e._doc.body).children(WYMeditor.BR).remove(),(i=e.selected())&&i.tagName.toLowerCase()==WYMeditor.PRE&&e._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P))},WYMeditor.WymClassSafari.prototype.openBlockTag=function(t,e){e=this.validator.getValidTagAttributes(t,e);if("span"==t&&e.style&&(new_tag=this.getTagForStyle(e.style),new_tag)){this._tag_stack.pop();t=new_tag;this._tag_stack.push(new_tag),e.style="","string"==typeof e["class"]&&(e["class"]=e["class"].replace(/apple-style-span/gi,""))}this.output+=this.helper.tag(t,e,!0)},WYMeditor.WymClassSafari.prototype.getTagForStyle=function(t){return/bold/.test(t)?"strong":/italic/.test(t)?"em":/sub/.test(t)?"sub":!!/super/.test(t)&&"sup"},onOpenDialog=function(){$(".ui-dialog").height()<$(window).height()&&(iframed()?$(parent.document.body).addClass("hide-overflow"):$(document.body).addClass("hide-overflow"))},onCloseDialog=function(){iframed()?$(parent.document.body).removeClass("hide-overflow"):$(document.body).removeClass("hide-overflow")},WYMeditor.onload_functions=[];var wymeditor_inputs=[],wymeditors_loaded=0;"undefined"==typeof custom_wymeditor_boot_options&&(custom_wymeditor_boot_options={});var form_actions="<div id='dialog-form-actions' class='form-actions'><div class='form-actions-left'><input id='submit_button' class='wym_submit button' type='submit' value='{Insert}' class='button' /><a href='' class='wym_cancel close_dialog button'>{Cancel}</a></div></div>",wymeditor_boot_options=$.extend({skin:"refinery",basePath:"/",wymPath:"/assets/wymeditor/jquery.refinery.wymeditor.js",cssSkinPath:"/assets/wymeditor/skins/",jsSkinPath:"/assets/wymeditor/skins/",langPath:"/assets/wymeditor/lang/",iframeBasePath:"/",classesItems:[{name:"text-align",rules:[{name:"left",title:"{Left}"},{name:"center",title:"{Center}"},{name:"right",title:"{Right}"},{name:"justify",title:"{Justify}"}],join:"-",title:"{Text_Align}"},{name:"image-align",rules:[{name:"left",title:"{Left}"},{name:"right",title:"{Right}"}],join:"-",title:"{Image_Align}"},{name:"font-size",rules:[{name:"small",title:"{Small}"},{name:"normal",title:"{Normal}"},{name:"large",title:"{Large}"}],join:"-",title:"{Font_Size}"}],containersItems:[{name:"h1",title:"Heading_1",css:"wym_containers_h1"},{name:"h2",title:"Heading_2",css:"wym_containers_h2"},{name:"h3",title:"Heading_3",css:"wym_containers_h3"},{name:"p",title:"Paragraph",css:"wym_containers_p"}],toolsItems:[{name:"Bold",title:"Bold",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"}],toolsHtml:"<ul class='wym_tools wym_section wym_buttons'>"+WYMeditor.TOOLS_ITEMS+"</ul>",toolsItemHtml:"<li class='"+WYMeditor.TOOL_CLASS+"'><a href='#' name='"+WYMeditor.TOOL_NAME+"' title='"+WYMeditor.TOOL_TITLE+"' class='no-tooltip'>"+WYMeditor.TOOL_TITLE+"</a></li>",classesHtml:"<ul class='wym_classes_container wym_section wym_buttons'><li class='wym_tools_class'><a href='#' name='"+WYMeditor.APPLY_CLASS+"' title='"+WYMeditor.APPLY_CLASS+"' class='no-tooltip'>"+WYMeditor.APPLY_CLASS+"</a><ul class='wym_classes wym_classes_hidden'>"+WYMeditor.CLASSES_ITEMS+"</ul></li></ul>",classesItemHtml:"<li><a href='#' name='"+WYMeditor.CLASS_NAME+"'>"+WYMeditor.CLASS_TITLE+"</a></li>",classesItemHtmlMultiple:"<li class='wym_tools_class_multiple_rules'><span>"+WYMeditor.CLASS_TITLE+"</span><ul>{classesItemHtml}</ul></li>",containersHtml:"<ul class='wym_containers wym_section'>"+WYMeditor.CONTAINERS_ITEMS+"</ul>",containersItemHtml:"<li class='"+WYMeditor.CONTAINER_CLASS+"'><a href='#' name='"+WYMeditor.CONTAINER_NAME+"' title='"+WYMeditor.CONTAINER_TITLE+"' class='no-tooltip'></a></li>",boxHtml:"<div class='wym_box'><div class='wym_area_top clearfix'>"+WYMeditor.CONTAINERS+WYMeditor.TOOLS+WYMeditor.CLASSES+"</div><div class='wym_area_main'>"+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"</div></div>",iframeHtml:"<div class='wym_iframe wym_section'><iframe id='WYMeditor_"+WYMeditor.INDEX+"'"+($.browser.msie?" src='"+WYMeditor.IFRAME_BASE_PATH+"wymiframe'":"")+" frameborder='0' marginheight='0' marginwidth='0' border='0' onload='this.contentWindow.parent.WYMeditor.INSTANCES["+WYMeditor.INDEX+"].loadIframe(this);'></iframe></div>",dialogImageHtml:"",dialogLinkHtml:"",dialogTableHtml:"<div class='wym_dialog wym_dialog_table'><form><input type='hidden' id='wym_dialog_type' class='wym_dialog_type' value='"+WYMeditor.DIALOG_TABLE+"' /><div class='field'><label for='wym_caption'>{Caption}</label><input type='text' id='wym_caption' class='wym_caption' value='' size='40' /></div><div class='field'><label for='wym_rows'>{Number_Of_Rows}</label><input type='text' id='wym_rows' class='wym_rows' value='3' size='3' /></div><div class='field'><label for='wym_cols'>{Number_Of_Cols}</label><input type='text' id='wym_cols' class='wym_cols' value='2' size='3' /></div>"+form_actions+"</form></div>",dialogPasteHtml:"<div class='wym_dialog wym_dialog_paste'><form><input type='hidden' id='wym_dialog_type' class='wym_dialog_type' value='"+WYMeditor.DIALOG_PASTE+"' /><div class='field'><textarea class='wym_text' rows='10' cols='50'></textarea></div>"+form_actions+"</form></div>",dialogPath:"/refinery/dialogs/",dialogFeatures:{width:866,height:455,modal:!0,draggable:!0,resizable:!1,autoOpen:!0,open:onOpenDialog,close:onCloseDialog},dialogInlineFeatures:{width:600,height:485,modal:!0,draggable:!0,resizable:!1,autoOpen:!0,open:onOpenDialog,close:onCloseDialog},dialogId:"editor_dialog",dialogHtml:"<!DOCTYPE html><html dir='"+WYMeditor.DIRECTION+"'><head><link rel='stylesheet' type='text/css' media='screen' href='"+WYMeditor.CSS_PATH+"' /><title>"+WYMeditor.DIALOG_TITLE+"</title><script type='text/javascript' src='"+WYMeditor.JQUERY_PATH+"'></script><script type='text/javascript' src='"+WYMeditor.WYM_PATH+"'></script></head><body><div id='page'>"+WYMeditor.DIALOG_BODY+"</div></body></html>",postInit:function(t){if(wymeditors_loaded+=1,WYMeditor.INSTANCES.length==wymeditors_loaded)for($(".wym_loading_overlay").remove(),i=0;i<WYMeditor.onload_functions.length;i++)WYMeditor.onload_functions[i]();$(t._iframe).contents().find("body").addClass("wym_iframe_body"),$(".field.hide-overflow").removeClass("hide-overflow").css("height","auto")},postInitDialog:function(){$.browser.msie&&($the_ui_dialog=$(".ui-dialog")).css("height",$the_ui_dialog.find("iframe").height()+$the_ui_dialog.find("iframe").contents().find(".form-actions").height()-12)},lang:refinery.current_admin_locale},custom_wymeditor_boot_options);WYMeditor.editor.prototype.loadIframe=function(t){var e=this,i=t.contentDocument||t.contentWindow;if(i.document&&(i=i.document),!$.browser.msie){i.open("text/html","replace"),html="<!DOCTYPE html> <html> <head> <title>WYMeditor</title> <meta charset='"+$("meta[charset]").attr("charset")+"' /> <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1' /> </head> <body class='wym_iframe'> </body> </html>",i.write(html),i.close();var s=i.head||$(i).find("head").get(0);$("<link href='/assets/wymeditor/skins/refinery/wymiframe.css' media='all' rel='stylesheet' />").appendTo(s),$("<link href='/assets/refinery/formatting.css' media='all' rel='stylesheet' />").appendTo(s),$("<link href='/assets/refinery/theme.css' media='all' rel='stylesheet' />").appendTo(s)}null!=(id_of_editor=e._element.parent().attr("id"))&&$(i.body).addClass(id_of_editor),e.initIframe(t)},WYMeditor.init=function(){(wymeditor_inputs=$(".wymeditor").filter(function(){for(i=0;i<WYMeditor.INSTANCES.length;i++)if(WYMeditor.INSTANCES[i]._element.attr("id")==$(this).attr("id"))return!1;return!0})).each(function(){0<(containing_field=$(this).parents(".field")).length&&""===containing_field.get(0).style.height.replace("auto","")&&containing_field.addClass("hide-overflow").css("height",$(this).outerHeight()-containing_field.offset().top+$(this).offset().top+45),$(this).hide()}),wymeditor_inputs.wymeditor(wymeditor_boot_options)},$(function(){WYMeditor.init()}); \ No newline at end of file
+WYMeditor.WymClassSafari=function(t){this._wym=t,this._class="class",this._newLine="\n"},WYMeditor.WymClassSafari.prototype.initIframe=function(iframe){this._iframe=iframe,this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0],aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss),this._doc.title=this._wym._index,$("html",this._doc).attr("dir",this._options.direction),this._doc.designMode="on",this.html(this._wym._html),$.isFunction(this._options.preBind)&&this._options.preBind(this),this._wym.bindEvents(),$(this._doc).bind("keydown",this.keydown),$(this._doc).bind("keyup",this.keyup),$(this._doc).bind("paste",this.intercept_paste),$.isFunction(this._options.postInit)&&this._options.postInit(this),this.listen()},WYMeditor.WymClassSafari.prototype._exec=function(t,e){var i=this;if(!i.selected())return!1;switch(t){case WYMeditor.INDENT:case WYMeditor.OUTDENT:var s=i.selected(),o=i._iframe.contentWindow.getSelection().anchorNode;if("#text"==o.nodeName&&(o=o.parentNode),s=i.findUp(s,WYMeditor.BLOCKS),o=i.findUp(o,WYMeditor.BLOCKS),s&&s==o&&s.tagName.toLowerCase()==WYMeditor.LI){var r=s.parentNode.parentNode;(1<s.parentNode.childNodes.length||-1<$.inArray(r.tagName.toLowerCase(),[WYMeditor.OL,WYMeditor.UL]))&&i._doc.execCommand(t,"",null)}break;case WYMeditor.INSERT_ORDEREDLIST:case WYMeditor.INSERT_UNORDEREDLIST:this._doc.execCommand(t,"",null);s=this.selected();var a=this.findUp(s,WYMeditor.MAIN_CONTAINERS);a&&$(a).replaceWith($(a).html());break;default:e?this._doc.execCommand(t,"",e):this._doc.execCommand(t,"",null)}},WYMeditor.WymClassSafari.prototype.selected=function(t){null!=t&&"true"==t.toString()||(t=!1);var e=this._iframe.contentWindow.getSelection(),s=e.focusNode;if(s){if("#text"!=s.nodeName)return s;if(t&&0<e.toString().length){if(actual_node=null,parent_node=e.focusNode.parentNode,null!=parent_node)for(i=0;i<parent_node.childNodes.length;i++)child_node=parent_node.childNodes[i],child_node.textContent==e.toString()&&(actual_node=child_node.parentNode);return null==actual_node?(this._selected_item=this.switchTo(e,"span"),this._selected_item):actual_node}return s.parentNode}return null},WYMeditor.WymClassSafari.prototype.toggleClass=function(t,e){var i=null;i=this._selected_image?$(this._selected_image):$(this.selected(!0)||this._selected_item),null!=e&&(i=$(i.parentsOrSelf(e))),i.toggleClass(t),i.attr(WYMeditor.CLASS)||i.removeAttr(this._class)},WYMeditor.WymClassSafari.prototype.addCssRule=function(t,e){t.insertRule(e.name+" {"+e.css+"}",t.cssRules.length)},WYMeditor.WymClassSafari.prototype.keydown=function(t){var e=WYMeditor.INSTANCES[this.title];t.ctrlKey?(66==t.keyCode&&(e._exec(WYMeditor.BOLD),t.preventDefault()),73==t.keyCode&&(e._exec(WYMeditor.ITALIC),t.preventDefault())):t.shiftKey&&13==t.keyCode&&(e._exec("InsertLineBreak"),t.preventDefault())},WYMeditor.WymClassSafari.prototype.keyup=function(t){var e=WYMeditor.INSTANCES[this.title];e._selected_image=null,$(e._iframe).contents().find(".selected_by_wym").removeClass("selected_by_wym");var i=null;13!=t.keyCode||t.shiftKey?-1!=$.inArray(t.keyCode,[8,17,46,224])||t.metaKey||t.ctrlKey||(i=e.selected())&&(name=i.tagName.toLowerCase())&&(-1<$.inArray(name,["strong","b","em","i","sub","sup","a","span"])&&(name=i.parentNode.tagName.toLowerCase()),-1<$.inArray(name,[WYMeditor.BODY,WYMeditor.DIV])&&e._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)):($(e._doc.body).children(WYMeditor.BR).remove(),(i=e.selected())&&i.tagName.toLowerCase()==WYMeditor.PRE&&e._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P))},WYMeditor.WymClassSafari.prototype.openBlockTag=function(t,e){e=this.validator.getValidTagAttributes(t,e);if("span"==t&&e.style&&(new_tag=this.getTagForStyle(e.style),new_tag)){this._tag_stack.pop();t=new_tag;this._tag_stack.push(new_tag),e.style="","string"==typeof e["class"]&&(e["class"]=e["class"].replace(/apple-style-span/gi,""))}this.output+=this.helper.tag(t,e,!0)},WYMeditor.WymClassSafari.prototype.getTagForStyle=function(t){return/bold/.test(t)?"strong":/italic/.test(t)?"em":/sub/.test(t)?"sub":!!/super/.test(t)&&"sup"},onOpenDialog=function(){$(".ui-dialog").height()<$(window).height()&&(iframed()?$(parent.document.body).addClass("hide-overflow"):$(document.body).addClass("hide-overflow"))},onCloseDialog=function(){iframed()?$(parent.document.body).removeClass("hide-overflow"):$(document.body).removeClass("hide-overflow")},WYMeditor.onload_functions=[];var wymeditor_inputs=[],wymeditors_loaded=0;"undefined"==typeof custom_wymeditor_boot_options&&(custom_wymeditor_boot_options={});var form_actions="<div id='dialog-form-actions' class='form-actions'><div class='form-actions-left'><input id='submit_button' class='wym_submit button' type='submit' value='{Insert}' class='button' /><a href='' class='wym_cancel close_dialog button'>{Cancel}</a></div></div>",wymeditor_boot_options=$.extend({skin:"refinery",basePath:"/",wymPath:"/assets/wymeditor/jquery.refinery.wymeditor.js",cssSkinPath:"/assets/wymeditor/skins/",jsSkinPath:"/assets/wymeditor/skins/",langPath:"/assets/wymeditor/lang/",iframeBasePath:"/",classesItems:[{name:"text-align",rules:[{name:"left",title:"{Left}"},{name:"center",title:"{Center}"},{name:"right",title:"{Right}"},{name:"justify",title:"{Justify}"}],join:"-",title:"{Text_Align}"},{name:"image-align",rules:[{name:"left",title:"{Left}"},{name:"right",title:"{Right}"}],join:"-",title:"{Image_Align}"},{name:"font-size",rules:[{name:"small",title:"{Small}"},{name:"normal",title:"{Normal}"},{name:"large",title:"{Large}"}],join:"-",title:"{Font_Size}"}],containersItems:[{name:"h1",title:"Heading_1",css:"wym_containers_h1"},{name:"h2",title:"Heading_2",css:"wym_containers_h2"},{name:"h3",title:"Heading_3",css:"wym_containers_h3"},{name:"p",title:"Paragraph",css:"wym_containers_p"}],toolsItems:[{name:"Bold",title:"Bold",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"}],toolsHtml:"<ul class='wym_tools wym_section wym_buttons'>"+WYMeditor.TOOLS_ITEMS+"</ul>",toolsItemHtml:"<li class='"+WYMeditor.TOOL_CLASS+"'><a href='#' name='"+WYMeditor.TOOL_NAME+"' title='"+WYMeditor.TOOL_TITLE+"' class='no-tooltip'>"+WYMeditor.TOOL_TITLE+"</a></li>",classesHtml:"<ul class='wym_classes_container wym_section wym_buttons'><li class='wym_tools_class'><a href='#' name='"+WYMeditor.APPLY_CLASS+"' title='"+WYMeditor.APPLY_CLASS+"' class='no-tooltip'>"+WYMeditor.APPLY_CLASS+"</a><ul class='wym_classes wym_classes_hidden'>"+WYMeditor.CLASSES_ITEMS+"</ul></li></ul>",classesItemHtml:"<li><a href='#' name='"+WYMeditor.CLASS_NAME+"'>"+WYMeditor.CLASS_TITLE+"</a></li>",classesItemHtmlMultiple:"<li class='wym_tools_class_multiple_rules'><span>"+WYMeditor.CLASS_TITLE+"</span><ul>{classesItemHtml}</ul></li>",containersHtml:"<ul class='wym_containers wym_section'>"+WYMeditor.CONTAINERS_ITEMS+"</ul>",containersItemHtml:"<li class='"+WYMeditor.CONTAINER_CLASS+"'><a href='#' name='"+WYMeditor.CONTAINER_NAME+"' title='"+WYMeditor.CONTAINER_TITLE+"' class='no-tooltip'></a></li>",boxHtml:"<div class='wym_box'><div class='wym_area_top clearfix'>"+WYMeditor.CONTAINERS+WYMeditor.TOOLS+WYMeditor.CLASSES+"</div><div class='wym_area_main'>"+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"</div></div>",iframeHtml:"<div class='wym_iframe wym_section'><iframe id='WYMeditor_"+WYMeditor.INDEX+"'"+($.browser.msie?" src='"+WYMeditor.IFRAME_BASE_PATH+"wymiframe'":"")+" frameborder='0' marginheight='0' marginwidth='0' border='0' onload='this.contentWindow.parent.WYMeditor.INSTANCES["+WYMeditor.INDEX+"].loadIframe(this);'></iframe></div>",dialogImageHtml:"",dialogLinkHtml:"",dialogTableHtml:"<div class='wym_dialog wym_dialog_table'><form><input type='hidden' id='wym_dialog_type' class='wym_dialog_type' value='"+WYMeditor.DIALOG_TABLE+"' /><div class='field'><label for='wym_caption'>{Caption}</label><input type='text' id='wym_caption' class='wym_caption' value='' size='40' /></div><div class='field'><label for='wym_rows'>{Number_Of_Rows}</label><input type='text' id='wym_rows' class='wym_rows' value='3' size='3' /></div><div class='field'><label for='wym_cols'>{Number_Of_Cols}</label><input type='text' id='wym_cols' class='wym_cols' value='2' size='3' /></div>"+form_actions+"</form></div>",dialogPasteHtml:"<div class='wym_dialog wym_dialog_paste'><form><input type='hidden' id='wym_dialog_type' class='wym_dialog_type' value='"+WYMeditor.DIALOG_PASTE+"' /><div class='field'><textarea class='wym_text' rows='10' cols='50'></textarea></div>"+form_actions+"</form></div>",dialogPath:"/refinery/dialogs/",dialogFeatures:{width:866,height:455,modal:!0,draggable:!0,resizable:!1,autoOpen:!0,open:onOpenDialog,close:onCloseDialog},dialogInlineFeatures:{width:600,height:485,modal:!0,draggable:!0,resizable:!1,autoOpen:!0,open:onOpenDialog,close:onCloseDialog},dialogId:"editor_dialog",dialogHtml:"<!DOCTYPE html><html dir='"+WYMeditor.DIRECTION+"'><head><link rel='stylesheet' type='text/css' media='screen' href='"+WYMeditor.CSS_PATH+"' /><title>"+WYMeditor.DIALOG_TITLE+"</title><script type='text/javascript' src='"+WYMeditor.JQUERY_PATH+"'></script><script type='text/javascript' src='"+WYMeditor.WYM_PATH+"'></script></head><body><div id='page'>"+WYMeditor.DIALOG_BODY+"</div></body></html>",postInit:function(t){if(wymeditors_loaded+=1,WYMeditor.INSTANCES.length==wymeditors_loaded)for($(".wym_loading_overlay").remove(),i=0;i<WYMeditor.onload_functions.length;i++)WYMeditor.onload_functions[i]();$(t._iframe).contents().find("body").addClass("wym_iframe_body"),$(".field.hide-overflow").removeClass("hide-overflow").css("height","auto")},postInitDialog:function(){$.browser.msie&&($the_ui_dialog=$(".ui-dialog")).css("height",$the_ui_dialog.find("iframe").height()+$the_ui_dialog.find("iframe").contents().find(".form-actions").height()-12)},lang:refinery.current_admin_locale},custom_wymeditor_boot_options);WYMeditor.editor.prototype.loadIframe=function(t){var e=this,i=t.contentDocument||t.contentWindow;if(i.document&&(i=i.document),!$.browser.msie){i.open("text/html","replace"),html="<!DOCTYPE html> <html> <head> <title>WYMeditor</title> <meta charset='"+$("meta[charset]").attr("charset")+"' /> <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1' /> </head> <body class='wym_iframe'> </body> </html>",i.write(html),i.close();var s=i.head||$(i).find("head").get(0);$("<link href='/assets/wymeditor/skins/refinery/wymiframe.css' media='all' rel='stylesheet' />").appendTo(s),$("<link href='/assets/refinery/formatting.css' media='all' rel='stylesheet' />").appendTo(s),$("<link href='/assets/refinery/theme.css' media='all' rel='stylesheet' />").appendTo(s)}null!=(id_of_editor=e._element.parent().attr("id"))&&$(i.body).addClass(id_of_editor),e.initIframe(t)},WYMeditor.init=function(){(wymeditor_inputs=$(".wymeditor").filter(function(){for(i=0;i<WYMeditor.INSTANCES.length;i++)if(WYMeditor.INSTANCES[i]._element.attr("id")==$(this).attr("id"))return!1;return!0})).each(function(){0<(containing_field=$(this).parents(".field")).length&&""===containing_field.get(0).style.height.replace("auto","")&&containing_field.addClass("hide-overflow").css("height",$(this).outerHeight()-containing_field.offset().top+$(this).offset().top+45),$(this).hide()}),wymeditor_inputs.wymeditor(wymeditor_boot_options)},$(function(){WYMeditor.init()}); \ No newline at end of file