lolita 3.2.0.rc1 → 3.2.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +11 -4
- data/VERSION +1 -1
- data/app/assets/javascripts/lolita/application.js +4 -1
- data/app/assets/javascripts/lolita/tab.js +2 -2
- data/app/assets/stylesheets/lolita/application.css +5 -0
- data/app/assets/stylesheets/lolita/{default.css → default.css.erb} +0 -0
- data/app/assets/stylesheets/lolita/{style.css → style.css.erb} +3 -3
- data/app/views/components/lolita/configuration/field/string/text/_display.html.erb +0 -7
- data/app/views/layouts/lolita/application.html.erb +2 -12
- data/lib/lolita.rb +8 -3
- data/lolita.gemspec +13 -57
- data/spec/rails_app/config/application.rb +12 -1
- data/spec/rails_app/config/environments/development.rb +6 -2
- data/spec/rails_app/config/environments/production.rb +5 -1
- data/spec/rails_app/config/environments/test.rb +5 -1
- data/vendor/assets/javascripts/application_vendor_lolita.js +6 -0
- data/vendor/assets/javascripts/{modernizr-1.7.min.js → modernizr_1_7_min.js} +0 -0
- data/vendor/assets/javascripts/tinymce_config.js +0 -1
- metadata +46 -106
- data/vendor/assets/javascripts/jquery-1.6.2.min.js +0 -18
- data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +0 -1
- data/vendor/assets/javascripts/tinymce/langs/en.js +0 -222
- data/vendor/assets/javascripts/tinymce/license.txt +0 -504
- data/vendor/assets/javascripts/tinymce/themes/advanced/about.htm +0 -52
- data/vendor/assets/javascripts/tinymce/themes/advanced/anchor.htm +0 -26
- data/vendor/assets/javascripts/tinymce/themes/advanced/charmap.htm +0 -51
- data/vendor/assets/javascripts/tinymce/themes/advanced/color_picker.htm +0 -74
- data/vendor/assets/javascripts/tinymce/themes/advanced/editor_template.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/advanced/editor_template_src.js +0 -1328
- data/vendor/assets/javascripts/tinymce/themes/advanced/image.htm +0 -80
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/colorpicker.jpg +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/flash.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/icons.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/iframe.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/pagebreak.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/quicktime.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/realmedia.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/shockwave.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/trans.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/video.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/about.js +0 -73
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/anchor.js +0 -42
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/charmap.js +0 -354
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/color_picker.js +0 -329
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/image.js +0 -247
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/link.js +0 -153
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/source_editor.js +0 -56
- data/vendor/assets/javascripts/tinymce/themes/advanced/langs/en.js +0 -68
- data/vendor/assets/javascripts/tinymce/themes/advanced/langs/en_dlg.js +0 -54
- data/vendor/assets/javascripts/tinymce/themes/advanced/link.htm +0 -57
- data/vendor/assets/javascripts/tinymce/themes/advanced/shortcuts.htm +0 -47
- data/vendor/assets/javascripts/tinymce/themes/advanced/source_editor.htm +0 -25
- data/vendor/assets/javascripts/tinymce/tiny_mce.js +0 -1
- data/vendor/assets/javascripts/tinymce/tiny_mce_popup.js +0 -5
- data/vendor/assets/javascripts/tinymce/utils/editable_selects.js +0 -70
- data/vendor/assets/javascripts/tinymce/utils/form_utils.js +0 -210
- data/vendor/assets/javascripts/tinymce/utils/mctabs.js +0 -162
- data/vendor/assets/javascripts/tinymce/utils/validate.js +0 -252
@@ -1,52 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<title>{#advanced_dlg.about_title}</title>
|
5
|
-
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6
|
-
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
7
|
-
<script type="text/javascript" src="js/about.js"></script>
|
8
|
-
</head>
|
9
|
-
<body id="about" style="display: none">
|
10
|
-
<div class="tabs">
|
11
|
-
<ul>
|
12
|
-
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>
|
13
|
-
<li id="help_tab" style="display:none" aria-hidden="true" aria-controls="help_panel"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>
|
14
|
-
<li id="plugins_tab" aria-controls="plugins_panel"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>
|
15
|
-
</ul>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div class="panel_wrapper">
|
19
|
-
<div id="general_panel" class="panel current">
|
20
|
-
<h3>{#advanced_dlg.about_title}</h3>
|
21
|
-
<p>Version: <span id="version"></span> (<span id="date"></span>)</p>
|
22
|
-
<p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>
|
23
|
-
by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>
|
24
|
-
<p>Copyright © 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>
|
25
|
-
<p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>
|
26
|
-
|
27
|
-
<div id="buttoncontainer">
|
28
|
-
<a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
|
32
|
-
<div id="plugins_panel" class="panel">
|
33
|
-
<div id="pluginscontainer">
|
34
|
-
<h3>{#advanced_dlg.about_loaded}</h3>
|
35
|
-
|
36
|
-
<div id="plugintablecontainer">
|
37
|
-
</div>
|
38
|
-
|
39
|
-
<p> </p>
|
40
|
-
</div>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div id="help_panel" class="panel noscroll" style="overflow: visible;">
|
44
|
-
<div id="iframecontainer"></div>
|
45
|
-
</div>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
<div class="mceActionPanel">
|
49
|
-
<input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
|
50
|
-
</div>
|
51
|
-
</body>
|
52
|
-
</html>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<title>{#advanced_dlg.anchor_title}</title>
|
5
|
-
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6
|
-
<script type="text/javascript" src="js/anchor.js"></script>
|
7
|
-
</head>
|
8
|
-
<body style="display: none" role="application" aria-labelledby="app_title">
|
9
|
-
<form onsubmit="AnchorDialog.update();return false;" action="#">
|
10
|
-
<table border="0" cellpadding="4" cellspacing="0" role="presentation">
|
11
|
-
<tr>
|
12
|
-
<td colspan="2" class="title" id="app_title">{#advanced_dlg.anchor_title}</td>
|
13
|
-
</tr>
|
14
|
-
<tr>
|
15
|
-
<td class="nowrap"><label for="anchorName">{#advanced_dlg.anchor_name}:</label></td>
|
16
|
-
<td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" aria-required="true" /></td>
|
17
|
-
</tr>
|
18
|
-
</table>
|
19
|
-
|
20
|
-
<div class="mceActionPanel">
|
21
|
-
<input type="submit" id="insert" name="insert" value="{#update}" />
|
22
|
-
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
23
|
-
</div>
|
24
|
-
</form>
|
25
|
-
</body>
|
26
|
-
</html>
|
@@ -1,51 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<title>{#advanced_dlg.charmap_title}</title>
|
5
|
-
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6
|
-
<script type="text/javascript" src="js/charmap.js"></script>
|
7
|
-
</head>
|
8
|
-
<body id="charmap" style="display:none">
|
9
|
-
<table align="center" border="0" cellspacing="0" cellpadding="2" role="presentation">
|
10
|
-
<tr>
|
11
|
-
<td colspan="2" class="title" ><label for="charmapView" id="charmap_label">{#advanced_dlg.charmap_title}</label></td>
|
12
|
-
</tr>
|
13
|
-
<tr>
|
14
|
-
<td id="charmapView" rowspan="2" align="left" valign="top">
|
15
|
-
<!-- Chars will be rendered here -->
|
16
|
-
</td>
|
17
|
-
<td width="100" align="center" valign="top">
|
18
|
-
<table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px" role="presentation">
|
19
|
-
<tr>
|
20
|
-
<td id="codeV"> </td>
|
21
|
-
</tr>
|
22
|
-
<tr>
|
23
|
-
<td id="codeN"> </td>
|
24
|
-
</tr>
|
25
|
-
</table>
|
26
|
-
</td>
|
27
|
-
</tr>
|
28
|
-
<tr>
|
29
|
-
<td valign="bottom" style="padding-bottom: 3px;">
|
30
|
-
<table width="100" align="center" border="0" cellpadding="2" cellspacing="0" role="presentation">
|
31
|
-
<tr>
|
32
|
-
<td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;"><label for="codeA">HTML-Code</label></td>
|
33
|
-
</tr>
|
34
|
-
<tr>
|
35
|
-
<td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center"> </td>
|
36
|
-
</tr>
|
37
|
-
<tr>
|
38
|
-
<td style="font-size: 1px;"> </td>
|
39
|
-
</tr>
|
40
|
-
<tr>
|
41
|
-
<td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;"><label for="codeB">NUM-Code</label></td>
|
42
|
-
</tr>
|
43
|
-
<tr>
|
44
|
-
<td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center"> </td>
|
45
|
-
</tr>
|
46
|
-
</table>
|
47
|
-
</td>
|
48
|
-
</tr>
|
49
|
-
</table>
|
50
|
-
</body>
|
51
|
-
</html>
|
@@ -1,74 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<title>{#advanced_dlg.colorpicker_title}</title>
|
5
|
-
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6
|
-
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
7
|
-
<script type="text/javascript" src="js/color_picker.js"></script>
|
8
|
-
</head>
|
9
|
-
<body id="colorpicker" style="display: none" role="application" aria-labelledby="app_label">
|
10
|
-
<span class="mceVoiceLabel" id="app_label" style="display:none;">{#advanced_dlg.colorpicker_title}</span>
|
11
|
-
<form onsubmit="insertAction();return false" action="#">
|
12
|
-
<div class="tabs">
|
13
|
-
<ul>
|
14
|
-
<li id="picker_tab" aria-controls="picker_panel" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>
|
15
|
-
<li id="rgb_tab" aria-controls="rgb_panel"><span><a href="javascript:;" onclick="mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>
|
16
|
-
<li id="named_tab" aria-controls="named_panel"><span><a href="javascript:;" onclick="javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>
|
17
|
-
</ul>
|
18
|
-
</div>
|
19
|
-
|
20
|
-
<div class="panel_wrapper">
|
21
|
-
<div id="picker_panel" class="panel current">
|
22
|
-
<fieldset>
|
23
|
-
<legend>{#advanced_dlg.colorpicker_picker_title}</legend>
|
24
|
-
<div id="picker">
|
25
|
-
<img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" />
|
26
|
-
|
27
|
-
<div id="light">
|
28
|
-
<!-- Will be filled with divs -->
|
29
|
-
</div>
|
30
|
-
|
31
|
-
<br style="clear: both" />
|
32
|
-
</div>
|
33
|
-
</fieldset>
|
34
|
-
</div>
|
35
|
-
|
36
|
-
<div id="rgb_panel" class="panel">
|
37
|
-
<fieldset>
|
38
|
-
<legend id="webcolors_title">{#advanced_dlg.colorpicker_palette_title}</legend>
|
39
|
-
<div id="webcolors">
|
40
|
-
<!-- Gets filled with web safe colors-->
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<br style="clear: both" />
|
44
|
-
</fieldset>
|
45
|
-
</div>
|
46
|
-
|
47
|
-
<div id="named_panel" class="panel">
|
48
|
-
<fieldset id="named_picker_label">
|
49
|
-
<legend id="named_title">{#advanced_dlg.colorpicker_named_title}</legend>
|
50
|
-
<div id="namedcolors" role="listbox" tabindex="0" aria-labelledby="named_picker_label">
|
51
|
-
<!-- Gets filled with named colors-->
|
52
|
-
</div>
|
53
|
-
|
54
|
-
<br style="clear: both" />
|
55
|
-
|
56
|
-
<div id="colornamecontainer">
|
57
|
-
{#advanced_dlg.colorpicker_name} <span id="colorname"></span>
|
58
|
-
</div>
|
59
|
-
</fieldset>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
|
63
|
-
<div class="mceActionPanel">
|
64
|
-
<input type="submit" id="insert" name="insert" value="{#apply}" />
|
65
|
-
|
66
|
-
<div id="preview"></div>
|
67
|
-
|
68
|
-
<div id="previewblock">
|
69
|
-
<label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" class="text mceFocus" aria-required="true" />
|
70
|
-
</div>
|
71
|
-
</div>
|
72
|
-
</form>
|
73
|
-
</body>
|
74
|
-
</html>
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);j.forcedHighContrastMode=j.settings.detect_highcontrast&&l._isHighContrast();j.settings.skin=j.forcedHighContrastMode?"highcontrast":j.settings.skin;l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}if(j.settings.content_css!==false){j.contentCSS.push(j.baseURI.toAbsolute(k+"/skins/"+j.settings.skin+"/content.css"))}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l);j.onKeyUp.add(l._updateUndoStatus,l);j.onMouseUp.add(l._updateUndoStatus,l);j.dom.bind(j.dom.getRoot(),"dragend",function(){l._updateUndoStatus(j)})}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},_isHighContrast:function(){var i,j=d.add(d.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});i=(d.getStyle(j,"background-color",true)+"").toLowerCase().replace(/ /g,"");d.remove(j);return i!="rgb(171,239,86)"&&i!="#abef56"},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){if(p[0]){i.formatter.remove(p[0])}}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(p){return i==p});return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;if(r.settings){r.settings.aria_label=w.aria_label+r.getLang("advanced.help_shortcut")}m=j=d.create("span",{role:"application","aria-labelledby":r.id+"_voice",id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});d.add(m,"span",{"class":"mceVoiceLabel",style:"display:none;",id:r.id+"_voice"},w.aria_label);if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{role:"presentation",id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;r.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){v.toolbarGroup.focus();return b.cancel(n)}else{if(n.keyCode===o){d.get(p.id+"_path_row").focus();return b.cancel(n)}}}});r.addShortcut("alt+0","","mceShortcuts",v);return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_ifr");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,m,k){var j=this.editor,l=this.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr");i=Math.max(l.theme_advanced_resizing_min_width||100,i);m=Math.max(l.theme_advanced_resizing_min_height||100,m);i=Math.min(l.theme_advanced_resizing_max_width||65535,i);m=Math.min(l.theme_advanced_resizing_max_height||65535,m);d.setStyle(n,"height","");d.setStyle(o,"height",m);if(l.theme_advanced_resize_horizontal){d.setStyle(n,"width","");d.setStyle(o,"width",i);if(i<n.clientWidth){i=n.clientWidth;d.setStyle(o,"width",n.clientWidth)}}if(k&&l.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+j.id+"_size",{cw:i,ch:m})}},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(x,k){var A=this,p,m,r=A.editor,B=A.settings,z,j=r.controlManager,u,l,q=[],y,w;w=j.createToolbarGroup("toolbargroup",{name:r.getLang("advanced.toolbar"),tab_focus_toolbar:r.getParam("theme_advanced_tab_focus_toolbar")});A.toolbarGroup=w;y=B.theme_advanced_toolbar_align.toLowerCase();y="mce"+A._ufirst(y);l=d.add(d.add(x,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+y,role:"presentation"});for(p=1;(z=B["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(B["theme_advanced_buttons"+p+"_add"]){z+=","+B["theme_advanced_buttons"+p+"_add"]}if(B["theme_advanced_buttons"+p+"_add_before"]){z=B["theme_advanced_buttons"+p+"_add_before"]+","+z}A._addControls(z,m);w.add(m);k.deltaHeight-=B.theme_advanced_row_height}q.push(w.renderHTML());q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row",role:"group","aria-labelledby":p.id+"_path_voice"});if(w.theme_advanced_path){d.add(k,"span",{id:p.id+"_path_voice"},p.translate("advanced.path"));d.add(k,"span",{},": ")}else{d.add(k,"span",{}," ")}if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","click",function(n){n.preventDefault()});b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){G.preventDefault();n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E,true)}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_updateUndoStatus:function(j){var i=j.controlManager;i.setDisabled("undo",!j.undoManager.hasUndo()&&!j.typing);i.setDisabled("redo",!j.undoManager.hasRedo())},_nodeChanged:function(l,q,B,m,C){var x=this,A,D=0,w,E,y=x.settings,u,k,r,j,i;e.each(x.stateControls,function(n){q.setActive(n,l.queryCommandState(x.controls[n][1]))});function o(p){var s,n=C.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}q.setActive("visualaid",l.hasVisual);q.setDisabled("undo",!l.undoManager.hasUndo()&&!l.typing);q.setDisabled("redo",!l.undoManager.hasRedo());q.setDisabled("outdent",!l.queryCommandState("Outdent"));A=o("A");if(E=q.get("link")){if(!A||!A.name){E.setDisabled(!A&&m);E.setActive(!!A)}}if(E=q.get("unlink")){E.setDisabled(!A&&m);E.setActive(!!A&&!A.name)}if(E=q.get("anchor")){E.setActive(!m&&!!A&&A.name)}A=o("IMG");if(E=q.get("image")){E.setActive(!m&&!!A&&B.className.indexOf("mceItem")==-1)}if(E=q.get("styleselect")){x._importClasses();j=[];f(E.items,function(n){j.push(n.value)});i=l.formatter.matchAll(j);E.select(i[0])}if(E=q.get("formatselect")){A=o(d.isBlock);if(A){E.select(A.nodeName.toLowerCase())}}o(function(p){if(p.nodeName==="SPAN"){if(!u&&p.className){u=p.className}}if(l.dom.is(p,y.theme_advanced_font_selector)){if(!k&&p.style.fontSize){k=p.style.fontSize}if(!r&&p.style.fontFamily){r=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(E=q.get("fontselect")){E.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==r})}if(E=q.get("fontsizeselect")){if(y.theme_advanced_runtime_fontsize&&!k&&!u){k=l.dom.getStyle(B,"fontSize",true)}E.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===u){return true}})}if(y.theme_advanced_show_current_color){function z(p,n){if(E=q.get(p)){if(!n){n=E.settings.default_color}if(n!==E.value){E.displayColor(n)}}}z("forecolor",fc);z("backcolor",bc)}if(y.theme_advanced_path&&y.theme_advanced_statusbar_location){A=d.get(l.id+"_path")||d.add(l.id+"_path_row","span",{id:l.id+"_path"});if(x.statusKeyboardNavigation){x.statusKeyboardNavigation.destroy();x.statusKeyboardNavigation=null}d.setHTML(A,"");o(function(F){var p=F.nodeName.toLowerCase(),s,v,t="";if(F.getAttribute("data-mce-bogus")){return}if(F.nodeType!=1||F.nodeName==="BR"||(d.hasClass(F,"mceItemHidden")||d.hasClass(F,"mceItemRemoved"))){return}if(e.isIE&&F.scopeName!=="HTML"){p=F.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(w=d.getAttrib(F,"src")){t+="src: "+w+" "}break;case"a":if(w=d.getAttrib(F,"name")){t+="name: "+w+" ";p+="#"+w}if(w=d.getAttrib(F,"href")){t+="href: "+w+" "}break;case"font":if(w=d.getAttrib(F,"face")){t+="font: "+w+" "}if(w=d.getAttrib(F,"size")){t+="size: "+w+" "}if(w=d.getAttrib(F,"color")){t+="color: "+w+" "}break;case"span":if(w=d.getAttrib(F,"style")){t+="style: "+w+" "}break}if(w=d.getAttrib(F,"id")){t+="id: "+w+" "}if(w=F.className){w=w.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(w){t+="class: "+w+" ";if(d.isBlock(F)||p=="img"||p=="span"){p+="."+w}}}p=p.replace(/(html:)/g,"");p={name:p,node:F,title:t};x.onResolveName.dispatch(x,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(D++)},p);if(A.hasChildNodes()){A.insertBefore(d.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),A.firstChild);A.insertBefore(v,A.firstChild)}else{A.appendChild(v)}},l.getBody());if(d.select("a",A).length>0){x.statusKeyboardNavigation=new e.ui.KeyboardNavigation({root:l.id+"_path_row",items:d.select("a",A),excludeFromTabOrder:true,onCancel:function(){l.focus()}},d)}}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var i=this.editor;i.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
|
@@ -1,1328 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* editor_template_src.js
|
3
|
-
*
|
4
|
-
* Copyright 2009, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://tinymce.moxiecode.com/license
|
8
|
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
(function(tinymce) {
|
12
|
-
var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;
|
13
|
-
|
14
|
-
// Tell it to load theme specific language pack(s)
|
15
|
-
tinymce.ThemeManager.requireLangPack('advanced');
|
16
|
-
|
17
|
-
tinymce.create('tinymce.themes.AdvancedTheme', {
|
18
|
-
sizes : [8, 10, 12, 14, 18, 24, 36],
|
19
|
-
|
20
|
-
// Control name lookup, format: title, command
|
21
|
-
controls : {
|
22
|
-
bold : ['bold_desc', 'Bold'],
|
23
|
-
italic : ['italic_desc', 'Italic'],
|
24
|
-
underline : ['underline_desc', 'Underline'],
|
25
|
-
strikethrough : ['striketrough_desc', 'Strikethrough'],
|
26
|
-
justifyleft : ['justifyleft_desc', 'JustifyLeft'],
|
27
|
-
justifycenter : ['justifycenter_desc', 'JustifyCenter'],
|
28
|
-
justifyright : ['justifyright_desc', 'JustifyRight'],
|
29
|
-
justifyfull : ['justifyfull_desc', 'JustifyFull'],
|
30
|
-
bullist : ['bullist_desc', 'InsertUnorderedList'],
|
31
|
-
numlist : ['numlist_desc', 'InsertOrderedList'],
|
32
|
-
outdent : ['outdent_desc', 'Outdent'],
|
33
|
-
indent : ['indent_desc', 'Indent'],
|
34
|
-
cut : ['cut_desc', 'Cut'],
|
35
|
-
copy : ['copy_desc', 'Copy'],
|
36
|
-
paste : ['paste_desc', 'Paste'],
|
37
|
-
undo : ['undo_desc', 'Undo'],
|
38
|
-
redo : ['redo_desc', 'Redo'],
|
39
|
-
link : ['link_desc', 'mceLink'],
|
40
|
-
unlink : ['unlink_desc', 'unlink'],
|
41
|
-
image : ['image_desc', 'mceImage'],
|
42
|
-
cleanup : ['cleanup_desc', 'mceCleanup'],
|
43
|
-
help : ['help_desc', 'mceHelp'],
|
44
|
-
code : ['code_desc', 'mceCodeEditor'],
|
45
|
-
hr : ['hr_desc', 'InsertHorizontalRule'],
|
46
|
-
removeformat : ['removeformat_desc', 'RemoveFormat'],
|
47
|
-
sub : ['sub_desc', 'subscript'],
|
48
|
-
sup : ['sup_desc', 'superscript'],
|
49
|
-
forecolor : ['forecolor_desc', 'ForeColor'],
|
50
|
-
forecolorpicker : ['forecolor_desc', 'mceForeColor'],
|
51
|
-
backcolor : ['backcolor_desc', 'HiliteColor'],
|
52
|
-
backcolorpicker : ['backcolor_desc', 'mceBackColor'],
|
53
|
-
charmap : ['charmap_desc', 'mceCharMap'],
|
54
|
-
visualaid : ['visualaid_desc', 'mceToggleVisualAid'],
|
55
|
-
anchor : ['anchor_desc', 'mceInsertAnchor'],
|
56
|
-
newdocument : ['newdocument_desc', 'mceNewDocument'],
|
57
|
-
blockquote : ['blockquote_desc', 'mceBlockQuote']
|
58
|
-
},
|
59
|
-
|
60
|
-
stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],
|
61
|
-
|
62
|
-
init : function(ed, url) {
|
63
|
-
var t = this, s, v, o;
|
64
|
-
|
65
|
-
t.editor = ed;
|
66
|
-
t.url = url;
|
67
|
-
t.onResolveName = new tinymce.util.Dispatcher(this);
|
68
|
-
|
69
|
-
ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
|
70
|
-
ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
|
71
|
-
|
72
|
-
// Default settings
|
73
|
-
t.settings = s = extend({
|
74
|
-
theme_advanced_path : true,
|
75
|
-
theme_advanced_toolbar_location : 'bottom',
|
76
|
-
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
|
77
|
-
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
|
78
|
-
theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
|
79
|
-
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
|
80
|
-
theme_advanced_toolbar_align : "center",
|
81
|
-
theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
|
82
|
-
theme_advanced_more_colors : 1,
|
83
|
-
theme_advanced_row_height : 23,
|
84
|
-
theme_advanced_resize_horizontal : 1,
|
85
|
-
theme_advanced_resizing_use_cookie : 1,
|
86
|
-
theme_advanced_font_sizes : "1,2,3,4,5,6,7",
|
87
|
-
theme_advanced_font_selector : "span",
|
88
|
-
readonly : ed.settings.readonly
|
89
|
-
}, ed.settings);
|
90
|
-
|
91
|
-
// Setup default font_size_style_values
|
92
|
-
if (!s.font_size_style_values)
|
93
|
-
s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";
|
94
|
-
|
95
|
-
if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {
|
96
|
-
s.font_size_style_values = tinymce.explode(s.font_size_style_values);
|
97
|
-
s.font_size_classes = tinymce.explode(s.font_size_classes || '');
|
98
|
-
|
99
|
-
// Parse string value
|
100
|
-
o = {};
|
101
|
-
ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;
|
102
|
-
each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {
|
103
|
-
var cl;
|
104
|
-
|
105
|
-
if (k == v && v >= 1 && v <= 7) {
|
106
|
-
k = v + ' (' + t.sizes[v - 1] + 'pt)';
|
107
|
-
cl = s.font_size_classes[v - 1];
|
108
|
-
v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');
|
109
|
-
}
|
110
|
-
|
111
|
-
if (/^\s*\./.test(v))
|
112
|
-
cl = v.replace(/\./g, '');
|
113
|
-
|
114
|
-
o[k] = cl ? {'class' : cl} : {fontSize : v};
|
115
|
-
});
|
116
|
-
|
117
|
-
s.theme_advanced_font_sizes = o;
|
118
|
-
}
|
119
|
-
|
120
|
-
if ((v = s.theme_advanced_path_location) && v != 'none')
|
121
|
-
s.theme_advanced_statusbar_location = s.theme_advanced_path_location;
|
122
|
-
|
123
|
-
if (s.theme_advanced_statusbar_location == 'none')
|
124
|
-
s.theme_advanced_statusbar_location = 0;
|
125
|
-
|
126
|
-
if (ed.settings.content_css !== false)
|
127
|
-
ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css"));
|
128
|
-
|
129
|
-
// Init editor
|
130
|
-
ed.onInit.add(function() {
|
131
|
-
if (!ed.settings.readonly) {
|
132
|
-
ed.onNodeChange.add(t._nodeChanged, t);
|
133
|
-
ed.onKeyUp.add(t._updateUndoStatus, t);
|
134
|
-
ed.onMouseUp.add(t._updateUndoStatus, t);
|
135
|
-
ed.dom.bind(ed.dom.getRoot(), 'dragend', function() {
|
136
|
-
t._updateUndoStatus(ed);
|
137
|
-
});
|
138
|
-
}
|
139
|
-
});
|
140
|
-
|
141
|
-
ed.onSetProgressState.add(function(ed, b, ti) {
|
142
|
-
var co, id = ed.id, tb;
|
143
|
-
|
144
|
-
if (b) {
|
145
|
-
t.progressTimer = setTimeout(function() {
|
146
|
-
co = ed.getContainer();
|
147
|
-
co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);
|
148
|
-
tb = DOM.get(ed.id + '_tbl');
|
149
|
-
|
150
|
-
DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});
|
151
|
-
DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});
|
152
|
-
}, ti || 0);
|
153
|
-
} else {
|
154
|
-
DOM.remove(id + '_blocker');
|
155
|
-
DOM.remove(id + '_progress');
|
156
|
-
clearTimeout(t.progressTimer);
|
157
|
-
}
|
158
|
-
});
|
159
|
-
|
160
|
-
DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");
|
161
|
-
|
162
|
-
if (s.skin_variant)
|
163
|
-
DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");
|
164
|
-
},
|
165
|
-
|
166
|
-
_isHighContrast : function() {
|
167
|
-
var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'});
|
168
|
-
|
169
|
-
actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, '');
|
170
|
-
DOM.remove(div);
|
171
|
-
|
172
|
-
return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56';
|
173
|
-
},
|
174
|
-
|
175
|
-
createControl : function(n, cf) {
|
176
|
-
var cd, c;
|
177
|
-
|
178
|
-
if (c = cf.createControl(n))
|
179
|
-
return c;
|
180
|
-
|
181
|
-
switch (n) {
|
182
|
-
case "styleselect":
|
183
|
-
return this._createStyleSelect();
|
184
|
-
|
185
|
-
case "formatselect":
|
186
|
-
return this._createBlockFormats();
|
187
|
-
|
188
|
-
case "fontselect":
|
189
|
-
return this._createFontSelect();
|
190
|
-
|
191
|
-
case "fontsizeselect":
|
192
|
-
return this._createFontSizeSelect();
|
193
|
-
|
194
|
-
case "forecolor":
|
195
|
-
return this._createForeColorMenu();
|
196
|
-
|
197
|
-
case "backcolor":
|
198
|
-
return this._createBackColorMenu();
|
199
|
-
}
|
200
|
-
|
201
|
-
if ((cd = this.controls[n]))
|
202
|
-
return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});
|
203
|
-
},
|
204
|
-
|
205
|
-
execCommand : function(cmd, ui, val) {
|
206
|
-
var f = this['_' + cmd];
|
207
|
-
|
208
|
-
if (f) {
|
209
|
-
f.call(this, ui, val);
|
210
|
-
return true;
|
211
|
-
}
|
212
|
-
|
213
|
-
return false;
|
214
|
-
},
|
215
|
-
|
216
|
-
_importClasses : function(e) {
|
217
|
-
var ed = this.editor, ctrl = ed.controlManager.get('styleselect');
|
218
|
-
|
219
|
-
if (ctrl.getLength() == 0) {
|
220
|
-
each(ed.dom.getClasses(), function(o, idx) {
|
221
|
-
var name = 'style_' + idx;
|
222
|
-
|
223
|
-
ed.formatter.register(name, {
|
224
|
-
inline : 'span',
|
225
|
-
attributes : {'class' : o['class']},
|
226
|
-
selector : '*'
|
227
|
-
});
|
228
|
-
|
229
|
-
ctrl.add(o['class'], name);
|
230
|
-
});
|
231
|
-
}
|
232
|
-
},
|
233
|
-
|
234
|
-
_createStyleSelect : function(n) {
|
235
|
-
var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;
|
236
|
-
|
237
|
-
// Setup style select box
|
238
|
-
ctrl = ctrlMan.createListBox('styleselect', {
|
239
|
-
title : 'advanced.style_select',
|
240
|
-
onselect : function(name) {
|
241
|
-
var matches, formatNames = [];
|
242
|
-
|
243
|
-
each(ctrl.items, function(item) {
|
244
|
-
formatNames.push(item.value);
|
245
|
-
});
|
246
|
-
|
247
|
-
ed.focus();
|
248
|
-
ed.undoManager.add();
|
249
|
-
|
250
|
-
// Toggle off the current format
|
251
|
-
matches = ed.formatter.matchAll(formatNames);
|
252
|
-
if (!name || matches[0] == name) {
|
253
|
-
if (matches[0])
|
254
|
-
ed.formatter.remove(matches[0]);
|
255
|
-
} else
|
256
|
-
ed.formatter.apply(name);
|
257
|
-
|
258
|
-
ed.undoManager.add();
|
259
|
-
ed.nodeChanged();
|
260
|
-
|
261
|
-
return false; // No auto select
|
262
|
-
}
|
263
|
-
});
|
264
|
-
|
265
|
-
// Handle specified format
|
266
|
-
ed.onInit.add(function() {
|
267
|
-
var counter = 0, formats = ed.getParam('style_formats');
|
268
|
-
|
269
|
-
if (formats) {
|
270
|
-
each(formats, function(fmt) {
|
271
|
-
var name, keys = 0;
|
272
|
-
|
273
|
-
each(fmt, function() {keys++;});
|
274
|
-
|
275
|
-
if (keys > 1) {
|
276
|
-
name = fmt.name = fmt.name || 'style_' + (counter++);
|
277
|
-
ed.formatter.register(name, fmt);
|
278
|
-
ctrl.add(fmt.title, name);
|
279
|
-
} else
|
280
|
-
ctrl.add(fmt.title);
|
281
|
-
});
|
282
|
-
} else {
|
283
|
-
each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {
|
284
|
-
var name;
|
285
|
-
|
286
|
-
if (val) {
|
287
|
-
name = 'style_' + (counter++);
|
288
|
-
|
289
|
-
ed.formatter.register(name, {
|
290
|
-
inline : 'span',
|
291
|
-
classes : val,
|
292
|
-
selector : '*'
|
293
|
-
});
|
294
|
-
|
295
|
-
ctrl.add(t.editor.translate(key), name);
|
296
|
-
}
|
297
|
-
});
|
298
|
-
}
|
299
|
-
});
|
300
|
-
|
301
|
-
// Auto import classes if the ctrl box is empty
|
302
|
-
if (ctrl.getLength() == 0) {
|
303
|
-
ctrl.onPostRender.add(function(ed, n) {
|
304
|
-
if (!ctrl.NativeListBox) {
|
305
|
-
Event.add(n.id + '_text', 'focus', t._importClasses, t);
|
306
|
-
Event.add(n.id + '_text', 'mousedown', t._importClasses, t);
|
307
|
-
Event.add(n.id + '_open', 'focus', t._importClasses, t);
|
308
|
-
Event.add(n.id + '_open', 'mousedown', t._importClasses, t);
|
309
|
-
} else
|
310
|
-
Event.add(n.id, 'focus', t._importClasses, t);
|
311
|
-
});
|
312
|
-
}
|
313
|
-
|
314
|
-
return ctrl;
|
315
|
-
},
|
316
|
-
|
317
|
-
_createFontSelect : function() {
|
318
|
-
var c, t = this, ed = t.editor;
|
319
|
-
|
320
|
-
c = ed.controlManager.createListBox('fontselect', {
|
321
|
-
title : 'advanced.fontdefault',
|
322
|
-
onselect : function(v) {
|
323
|
-
var cur = c.items[c.selectedIndex];
|
324
|
-
|
325
|
-
if (!v && cur) {
|
326
|
-
ed.execCommand('FontName', false, cur.value);
|
327
|
-
return;
|
328
|
-
}
|
329
|
-
|
330
|
-
ed.execCommand('FontName', false, v);
|
331
|
-
|
332
|
-
// Fake selection, execCommand will fire a nodeChange and update the selection
|
333
|
-
c.select(function(sv) {
|
334
|
-
return v == sv;
|
335
|
-
});
|
336
|
-
|
337
|
-
return false; // No auto select
|
338
|
-
}
|
339
|
-
});
|
340
|
-
|
341
|
-
if (c) {
|
342
|
-
each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {
|
343
|
-
c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});
|
344
|
-
});
|
345
|
-
}
|
346
|
-
|
347
|
-
return c;
|
348
|
-
},
|
349
|
-
|
350
|
-
_createFontSizeSelect : function() {
|
351
|
-
var t = this, ed = t.editor, c, i = 0, cl = [];
|
352
|
-
|
353
|
-
c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
|
354
|
-
var cur = c.items[c.selectedIndex];
|
355
|
-
|
356
|
-
if (!v && cur) {
|
357
|
-
cur = cur.value;
|
358
|
-
|
359
|
-
if (cur['class']) {
|
360
|
-
ed.formatter.toggle('fontsize_class', {value : cur['class']});
|
361
|
-
ed.undoManager.add();
|
362
|
-
ed.nodeChanged();
|
363
|
-
} else {
|
364
|
-
ed.execCommand('FontSize', false, cur.fontSize);
|
365
|
-
}
|
366
|
-
|
367
|
-
return;
|
368
|
-
}
|
369
|
-
|
370
|
-
if (v['class']) {
|
371
|
-
ed.focus();
|
372
|
-
ed.undoManager.add();
|
373
|
-
ed.formatter.toggle('fontsize_class', {value : v['class']});
|
374
|
-
ed.undoManager.add();
|
375
|
-
ed.nodeChanged();
|
376
|
-
} else
|
377
|
-
ed.execCommand('FontSize', false, v.fontSize);
|
378
|
-
|
379
|
-
// Fake selection, execCommand will fire a nodeChange and update the selection
|
380
|
-
c.select(function(sv) {
|
381
|
-
return v == sv;
|
382
|
-
});
|
383
|
-
|
384
|
-
return false; // No auto select
|
385
|
-
}});
|
386
|
-
|
387
|
-
if (c) {
|
388
|
-
each(t.settings.theme_advanced_font_sizes, function(v, k) {
|
389
|
-
var fz = v.fontSize;
|
390
|
-
|
391
|
-
if (fz >= 1 && fz <= 7)
|
392
|
-
fz = t.sizes[parseInt(fz) - 1] + 'pt';
|
393
|
-
|
394
|
-
c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});
|
395
|
-
});
|
396
|
-
}
|
397
|
-
|
398
|
-
return c;
|
399
|
-
},
|
400
|
-
|
401
|
-
_createBlockFormats : function() {
|
402
|
-
var c, fmts = {
|
403
|
-
p : 'advanced.paragraph',
|
404
|
-
address : 'advanced.address',
|
405
|
-
pre : 'advanced.pre',
|
406
|
-
h1 : 'advanced.h1',
|
407
|
-
h2 : 'advanced.h2',
|
408
|
-
h3 : 'advanced.h3',
|
409
|
-
h4 : 'advanced.h4',
|
410
|
-
h5 : 'advanced.h5',
|
411
|
-
h6 : 'advanced.h6',
|
412
|
-
div : 'advanced.div',
|
413
|
-
blockquote : 'advanced.blockquote',
|
414
|
-
code : 'advanced.code',
|
415
|
-
dt : 'advanced.dt',
|
416
|
-
dd : 'advanced.dd',
|
417
|
-
samp : 'advanced.samp'
|
418
|
-
}, t = this;
|
419
|
-
|
420
|
-
c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'});
|
421
|
-
if (c) {
|
422
|
-
each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {
|
423
|
-
c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});
|
424
|
-
});
|
425
|
-
}
|
426
|
-
|
427
|
-
return c;
|
428
|
-
},
|
429
|
-
|
430
|
-
_createForeColorMenu : function() {
|
431
|
-
var c, t = this, s = t.settings, o = {}, v;
|
432
|
-
|
433
|
-
if (s.theme_advanced_more_colors) {
|
434
|
-
o.more_colors_func = function() {
|
435
|
-
t._mceColorPicker(0, {
|
436
|
-
color : c.value,
|
437
|
-
func : function(co) {
|
438
|
-
c.setColor(co);
|
439
|
-
}
|
440
|
-
});
|
441
|
-
};
|
442
|
-
}
|
443
|
-
|
444
|
-
if (v = s.theme_advanced_text_colors)
|
445
|
-
o.colors = v;
|
446
|
-
|
447
|
-
if (s.theme_advanced_default_foreground_color)
|
448
|
-
o.default_color = s.theme_advanced_default_foreground_color;
|
449
|
-
|
450
|
-
o.title = 'advanced.forecolor_desc';
|
451
|
-
o.cmd = 'ForeColor';
|
452
|
-
o.scope = this;
|
453
|
-
|
454
|
-
c = t.editor.controlManager.createColorSplitButton('forecolor', o);
|
455
|
-
|
456
|
-
return c;
|
457
|
-
},
|
458
|
-
|
459
|
-
_createBackColorMenu : function() {
|
460
|
-
var c, t = this, s = t.settings, o = {}, v;
|
461
|
-
|
462
|
-
if (s.theme_advanced_more_colors) {
|
463
|
-
o.more_colors_func = function() {
|
464
|
-
t._mceColorPicker(0, {
|
465
|
-
color : c.value,
|
466
|
-
func : function(co) {
|
467
|
-
c.setColor(co);
|
468
|
-
}
|
469
|
-
});
|
470
|
-
};
|
471
|
-
}
|
472
|
-
|
473
|
-
if (v = s.theme_advanced_background_colors)
|
474
|
-
o.colors = v;
|
475
|
-
|
476
|
-
if (s.theme_advanced_default_background_color)
|
477
|
-
o.default_color = s.theme_advanced_default_background_color;
|
478
|
-
|
479
|
-
o.title = 'advanced.backcolor_desc';
|
480
|
-
o.cmd = 'HiliteColor';
|
481
|
-
o.scope = this;
|
482
|
-
|
483
|
-
c = t.editor.controlManager.createColorSplitButton('backcolor', o);
|
484
|
-
|
485
|
-
return c;
|
486
|
-
},
|
487
|
-
|
488
|
-
renderUI : function(o) {
|
489
|
-
var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;
|
490
|
-
|
491
|
-
if (ed.settings) {
|
492
|
-
ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut');
|
493
|
-
}
|
494
|
-
|
495
|
-
// TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for.
|
496
|
-
// Maybe actually inherit it from the original textara?
|
497
|
-
n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});
|
498
|
-
DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label);
|
499
|
-
|
500
|
-
if (!DOM.boxModel)
|
501
|
-
n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});
|
502
|
-
|
503
|
-
n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});
|
504
|
-
n = tb = DOM.add(n, 'tbody');
|
505
|
-
|
506
|
-
switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {
|
507
|
-
case "rowlayout":
|
508
|
-
ic = t._rowLayout(s, tb, o);
|
509
|
-
break;
|
510
|
-
|
511
|
-
case "customlayout":
|
512
|
-
ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);
|
513
|
-
break;
|
514
|
-
|
515
|
-
default:
|
516
|
-
ic = t._simpleLayout(s, tb, o, p);
|
517
|
-
}
|
518
|
-
|
519
|
-
n = o.targetNode;
|
520
|
-
|
521
|
-
// Add classes to first and last TRs
|
522
|
-
nl = sc.rows;
|
523
|
-
DOM.addClass(nl[0], 'mceFirst');
|
524
|
-
DOM.addClass(nl[nl.length - 1], 'mceLast');
|
525
|
-
|
526
|
-
// Add classes to first and last TDs
|
527
|
-
each(DOM.select('tr', tb), function(n) {
|
528
|
-
DOM.addClass(n.firstChild, 'mceFirst');
|
529
|
-
DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');
|
530
|
-
});
|
531
|
-
|
532
|
-
if (DOM.get(s.theme_advanced_toolbar_container))
|
533
|
-
DOM.get(s.theme_advanced_toolbar_container).appendChild(p);
|
534
|
-
else
|
535
|
-
DOM.insertAfter(p, n);
|
536
|
-
|
537
|
-
Event.add(ed.id + '_path_row', 'click', function(e) {
|
538
|
-
e = e.target;
|
539
|
-
|
540
|
-
if (e.nodeName == 'A') {
|
541
|
-
t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));
|
542
|
-
|
543
|
-
return Event.cancel(e);
|
544
|
-
}
|
545
|
-
});
|
546
|
-
/*
|
547
|
-
if (DOM.get(ed.id + '_path_row')) {
|
548
|
-
Event.add(ed.id + '_tbl', 'mouseover', function(e) {
|
549
|
-
var re;
|
550
|
-
|
551
|
-
e = e.target;
|
552
|
-
|
553
|
-
if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
|
554
|
-
re = DOM.get(ed.id + '_path_row');
|
555
|
-
t.lastPath = re.innerHTML;
|
556
|
-
DOM.setHTML(re, e.parentNode.title);
|
557
|
-
}
|
558
|
-
});
|
559
|
-
|
560
|
-
Event.add(ed.id + '_tbl', 'mouseout', function(e) {
|
561
|
-
if (t.lastPath) {
|
562
|
-
DOM.setHTML(ed.id + '_path_row', t.lastPath);
|
563
|
-
t.lastPath = 0;
|
564
|
-
}
|
565
|
-
});
|
566
|
-
}
|
567
|
-
*/
|
568
|
-
|
569
|
-
if (!ed.getParam('accessibility_focus'))
|
570
|
-
Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});
|
571
|
-
|
572
|
-
if (s.theme_advanced_toolbar_location == 'external')
|
573
|
-
o.deltaHeight = 0;
|
574
|
-
|
575
|
-
t.deltaHeight = o.deltaHeight;
|
576
|
-
o.targetNode = null;
|
577
|
-
|
578
|
-
ed.onKeyDown.add(function(ed, evt) {
|
579
|
-
var DOM_VK_F10 = 121, DOM_VK_F11 = 122;
|
580
|
-
|
581
|
-
if (evt.altKey) {
|
582
|
-
if (evt.keyCode === DOM_VK_F10) {
|
583
|
-
t.toolbarGroup.focus();
|
584
|
-
return Event.cancel(evt);
|
585
|
-
} else if (evt.keyCode === DOM_VK_F11) {
|
586
|
-
DOM.get(ed.id + '_path_row').focus();
|
587
|
-
return Event.cancel(evt);
|
588
|
-
}
|
589
|
-
}
|
590
|
-
});
|
591
|
-
|
592
|
-
// alt+0 is the UK recommended shortcut for accessing the list of access controls.
|
593
|
-
ed.addShortcut('alt+0', '', 'mceShortcuts', t);
|
594
|
-
|
595
|
-
return {
|
596
|
-
iframeContainer : ic,
|
597
|
-
editorContainer : ed.id + '_parent',
|
598
|
-
sizeContainer : sc,
|
599
|
-
deltaHeight : o.deltaHeight
|
600
|
-
};
|
601
|
-
},
|
602
|
-
|
603
|
-
getInfo : function() {
|
604
|
-
return {
|
605
|
-
longname : 'Advanced theme',
|
606
|
-
author : 'Moxiecode Systems AB',
|
607
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
608
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
609
|
-
}
|
610
|
-
},
|
611
|
-
|
612
|
-
resizeBy : function(dw, dh) {
|
613
|
-
var e = DOM.get(this.editor.id + '_ifr');
|
614
|
-
|
615
|
-
this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);
|
616
|
-
},
|
617
|
-
|
618
|
-
resizeTo : function(w, h, store) {
|
619
|
-
var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');
|
620
|
-
|
621
|
-
// Boundery fix box
|
622
|
-
w = Math.max(s.theme_advanced_resizing_min_width || 100, w);
|
623
|
-
h = Math.max(s.theme_advanced_resizing_min_height || 100, h);
|
624
|
-
w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);
|
625
|
-
h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);
|
626
|
-
|
627
|
-
// Resize iframe and container
|
628
|
-
DOM.setStyle(e, 'height', '');
|
629
|
-
DOM.setStyle(ifr, 'height', h);
|
630
|
-
|
631
|
-
if (s.theme_advanced_resize_horizontal) {
|
632
|
-
DOM.setStyle(e, 'width', '');
|
633
|
-
DOM.setStyle(ifr, 'width', w);
|
634
|
-
|
635
|
-
// Make sure that the size is never smaller than the over all ui
|
636
|
-
if (w < e.clientWidth) {
|
637
|
-
w = e.clientWidth;
|
638
|
-
DOM.setStyle(ifr, 'width', e.clientWidth);
|
639
|
-
}
|
640
|
-
}
|
641
|
-
|
642
|
-
// Store away the size
|
643
|
-
if (store && s.theme_advanced_resizing_use_cookie) {
|
644
|
-
Cookie.setHash("TinyMCE_" + ed.id + "_size", {
|
645
|
-
cw : w,
|
646
|
-
ch : h
|
647
|
-
});
|
648
|
-
}
|
649
|
-
},
|
650
|
-
|
651
|
-
destroy : function() {
|
652
|
-
var id = this.editor.id;
|
653
|
-
|
654
|
-
Event.clear(id + '_resize');
|
655
|
-
Event.clear(id + '_path_row');
|
656
|
-
Event.clear(id + '_external_close');
|
657
|
-
},
|
658
|
-
|
659
|
-
// Internal functions
|
660
|
-
|
661
|
-
_simpleLayout : function(s, tb, o, p) {
|
662
|
-
var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;
|
663
|
-
|
664
|
-
if (s.readonly) {
|
665
|
-
n = DOM.add(tb, 'tr');
|
666
|
-
n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
|
667
|
-
return ic;
|
668
|
-
}
|
669
|
-
|
670
|
-
// Create toolbar container at top
|
671
|
-
if (lo == 'top')
|
672
|
-
t._addToolbars(tb, o);
|
673
|
-
|
674
|
-
// Create external toolbar
|
675
|
-
if (lo == 'external') {
|
676
|
-
n = c = DOM.create('div', {style : 'position:relative'});
|
677
|
-
n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});
|
678
|
-
DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});
|
679
|
-
n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});
|
680
|
-
etb = DOM.add(n, 'tbody');
|
681
|
-
|
682
|
-
if (p.firstChild.className == 'mceOldBoxModel')
|
683
|
-
p.firstChild.appendChild(c);
|
684
|
-
else
|
685
|
-
p.insertBefore(c, p.firstChild);
|
686
|
-
|
687
|
-
t._addToolbars(etb, o);
|
688
|
-
|
689
|
-
ed.onMouseUp.add(function() {
|
690
|
-
var e = DOM.get(ed.id + '_external');
|
691
|
-
DOM.show(e);
|
692
|
-
|
693
|
-
DOM.hide(lastExtID);
|
694
|
-
|
695
|
-
var f = Event.add(ed.id + '_external_close', 'click', function() {
|
696
|
-
DOM.hide(ed.id + '_external');
|
697
|
-
Event.remove(ed.id + '_external_close', 'click', f);
|
698
|
-
});
|
699
|
-
|
700
|
-
DOM.show(e);
|
701
|
-
DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);
|
702
|
-
|
703
|
-
// Fixes IE rendering bug
|
704
|
-
DOM.hide(e);
|
705
|
-
DOM.show(e);
|
706
|
-
e.style.filter = '';
|
707
|
-
|
708
|
-
lastExtID = ed.id + '_external';
|
709
|
-
|
710
|
-
e = null;
|
711
|
-
});
|
712
|
-
}
|
713
|
-
|
714
|
-
if (sl == 'top')
|
715
|
-
t._addStatusBar(tb, o);
|
716
|
-
|
717
|
-
// Create iframe container
|
718
|
-
if (!s.theme_advanced_toolbar_container) {
|
719
|
-
n = DOM.add(tb, 'tr');
|
720
|
-
n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
|
721
|
-
}
|
722
|
-
|
723
|
-
// Create toolbar container at bottom
|
724
|
-
if (lo == 'bottom')
|
725
|
-
t._addToolbars(tb, o);
|
726
|
-
|
727
|
-
if (sl == 'bottom')
|
728
|
-
t._addStatusBar(tb, o);
|
729
|
-
|
730
|
-
return ic;
|
731
|
-
},
|
732
|
-
|
733
|
-
_rowLayout : function(s, tb, o) {
|
734
|
-
var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;
|
735
|
-
|
736
|
-
dc = s.theme_advanced_containers_default_class || '';
|
737
|
-
da = s.theme_advanced_containers_default_align || 'center';
|
738
|
-
|
739
|
-
each(explode(s.theme_advanced_containers || ''), function(c, i) {
|
740
|
-
var v = s['theme_advanced_container_' + c] || '';
|
741
|
-
|
742
|
-
switch (v.toLowerCase()) {
|
743
|
-
case 'mceeditor':
|
744
|
-
n = DOM.add(tb, 'tr');
|
745
|
-
n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
|
746
|
-
break;
|
747
|
-
|
748
|
-
case 'mceelementpath':
|
749
|
-
t._addStatusBar(tb, o);
|
750
|
-
break;
|
751
|
-
|
752
|
-
default:
|
753
|
-
a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();
|
754
|
-
a = 'mce' + t._ufirst(a);
|
755
|
-
|
756
|
-
n = DOM.add(DOM.add(tb, 'tr'), 'td', {
|
757
|
-
'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da
|
758
|
-
});
|
759
|
-
|
760
|
-
to = cf.createToolbar("toolbar" + i);
|
761
|
-
t._addControls(v, to);
|
762
|
-
DOM.setHTML(n, to.renderHTML());
|
763
|
-
o.deltaHeight -= s.theme_advanced_row_height;
|
764
|
-
}
|
765
|
-
});
|
766
|
-
|
767
|
-
return ic;
|
768
|
-
},
|
769
|
-
|
770
|
-
_addControls : function(v, tb) {
|
771
|
-
var t = this, s = t.settings, di, cf = t.editor.controlManager;
|
772
|
-
|
773
|
-
if (s.theme_advanced_disable && !t._disabled) {
|
774
|
-
di = {};
|
775
|
-
|
776
|
-
each(explode(s.theme_advanced_disable), function(v) {
|
777
|
-
di[v] = 1;
|
778
|
-
});
|
779
|
-
|
780
|
-
t._disabled = di;
|
781
|
-
} else
|
782
|
-
di = t._disabled;
|
783
|
-
|
784
|
-
each(explode(v), function(n) {
|
785
|
-
var c;
|
786
|
-
|
787
|
-
if (di && di[n])
|
788
|
-
return;
|
789
|
-
|
790
|
-
// Compatiblity with 2.x
|
791
|
-
if (n == 'tablecontrols') {
|
792
|
-
each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {
|
793
|
-
n = t.createControl(n, cf);
|
794
|
-
|
795
|
-
if (n)
|
796
|
-
tb.add(n);
|
797
|
-
});
|
798
|
-
|
799
|
-
return;
|
800
|
-
}
|
801
|
-
|
802
|
-
c = t.createControl(n, cf);
|
803
|
-
|
804
|
-
if (c)
|
805
|
-
tb.add(c);
|
806
|
-
});
|
807
|
-
},
|
808
|
-
|
809
|
-
_addToolbars : function(c, o) {
|
810
|
-
var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup;
|
811
|
-
|
812
|
-
toolbarGroup = cf.createToolbarGroup('toolbargroup', {
|
813
|
-
'name': ed.getLang('advanced.toolbar'),
|
814
|
-
'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar')
|
815
|
-
});
|
816
|
-
|
817
|
-
t.toolbarGroup = toolbarGroup;
|
818
|
-
|
819
|
-
a = s.theme_advanced_toolbar_align.toLowerCase();
|
820
|
-
a = 'mce' + t._ufirst(a);
|
821
|
-
|
822
|
-
n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"});
|
823
|
-
|
824
|
-
// Create toolbar and add the controls
|
825
|
-
for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
|
826
|
-
tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});
|
827
|
-
|
828
|
-
if (s['theme_advanced_buttons' + i + '_add'])
|
829
|
-
v += ',' + s['theme_advanced_buttons' + i + '_add'];
|
830
|
-
|
831
|
-
if (s['theme_advanced_buttons' + i + '_add_before'])
|
832
|
-
v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;
|
833
|
-
|
834
|
-
t._addControls(v, tb);
|
835
|
-
toolbarGroup.add(tb);
|
836
|
-
|
837
|
-
o.deltaHeight -= s.theme_advanced_row_height;
|
838
|
-
}
|
839
|
-
h.push(toolbarGroup.renderHTML());
|
840
|
-
h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
|
841
|
-
DOM.setHTML(n, h.join(''));
|
842
|
-
},
|
843
|
-
|
844
|
-
_addStatusBar : function(tb, o) {
|
845
|
-
var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
|
846
|
-
|
847
|
-
n = DOM.add(tb, 'tr');
|
848
|
-
n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
|
849
|
-
n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});
|
850
|
-
if (s.theme_advanced_path) {
|
851
|
-
DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));
|
852
|
-
DOM.add(n, 'span', {}, ': ');
|
853
|
-
} else {
|
854
|
-
DOM.add(n, 'span', {}, ' ');
|
855
|
-
}
|
856
|
-
|
857
|
-
|
858
|
-
if (s.theme_advanced_resizing) {
|
859
|
-
DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'});
|
860
|
-
|
861
|
-
if (s.theme_advanced_resizing_use_cookie) {
|
862
|
-
ed.onPostRender.add(function() {
|
863
|
-
var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');
|
864
|
-
|
865
|
-
if (!o)
|
866
|
-
return;
|
867
|
-
|
868
|
-
t.resizeTo(o.cw, o.ch);
|
869
|
-
});
|
870
|
-
}
|
871
|
-
|
872
|
-
ed.onPostRender.add(function() {
|
873
|
-
Event.add(ed.id + '_resize', 'click', function(e) {
|
874
|
-
e.preventDefault();
|
875
|
-
});
|
876
|
-
|
877
|
-
Event.add(ed.id + '_resize', 'mousedown', function(e) {
|
878
|
-
var mouseMoveHandler1, mouseMoveHandler2,
|
879
|
-
mouseUpHandler1, mouseUpHandler2,
|
880
|
-
startX, startY, startWidth, startHeight, width, height, ifrElm;
|
881
|
-
|
882
|
-
function resizeOnMove(e) {
|
883
|
-
e.preventDefault();
|
884
|
-
|
885
|
-
width = startWidth + (e.screenX - startX);
|
886
|
-
height = startHeight + (e.screenY - startY);
|
887
|
-
|
888
|
-
t.resizeTo(width, height);
|
889
|
-
};
|
890
|
-
|
891
|
-
function endResize(e) {
|
892
|
-
// Stop listening
|
893
|
-
Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);
|
894
|
-
Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);
|
895
|
-
Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);
|
896
|
-
Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);
|
897
|
-
|
898
|
-
width = startWidth + (e.screenX - startX);
|
899
|
-
height = startHeight + (e.screenY - startY);
|
900
|
-
t.resizeTo(width, height, true);
|
901
|
-
};
|
902
|
-
|
903
|
-
e.preventDefault();
|
904
|
-
|
905
|
-
// Get the current rect size
|
906
|
-
startX = e.screenX;
|
907
|
-
startY = e.screenY;
|
908
|
-
ifrElm = DOM.get(t.editor.id + '_ifr');
|
909
|
-
startWidth = width = ifrElm.clientWidth;
|
910
|
-
startHeight = height = ifrElm.clientHeight;
|
911
|
-
|
912
|
-
// Register envent handlers
|
913
|
-
mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);
|
914
|
-
mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);
|
915
|
-
mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);
|
916
|
-
mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);
|
917
|
-
});
|
918
|
-
});
|
919
|
-
}
|
920
|
-
|
921
|
-
o.deltaHeight -= 21;
|
922
|
-
n = tb = null;
|
923
|
-
},
|
924
|
-
|
925
|
-
_updateUndoStatus : function(ed) {
|
926
|
-
var cm = ed.controlManager;
|
927
|
-
|
928
|
-
cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing);
|
929
|
-
cm.setDisabled('redo', !ed.undoManager.hasRedo());
|
930
|
-
},
|
931
|
-
|
932
|
-
_nodeChanged : function(ed, cm, n, co, ob) {
|
933
|
-
var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, formatNames, matches;
|
934
|
-
|
935
|
-
tinymce.each(t.stateControls, function(c) {
|
936
|
-
cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
|
937
|
-
});
|
938
|
-
|
939
|
-
function getParent(name) {
|
940
|
-
var i, parents = ob.parents, func = name;
|
941
|
-
|
942
|
-
if (typeof(name) == 'string') {
|
943
|
-
func = function(node) {
|
944
|
-
return node.nodeName == name;
|
945
|
-
};
|
946
|
-
}
|
947
|
-
|
948
|
-
for (i = 0; i < parents.length; i++) {
|
949
|
-
if (func(parents[i]))
|
950
|
-
return parents[i];
|
951
|
-
}
|
952
|
-
};
|
953
|
-
|
954
|
-
cm.setActive('visualaid', ed.hasVisual);
|
955
|
-
cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing);
|
956
|
-
cm.setDisabled('redo', !ed.undoManager.hasRedo());
|
957
|
-
cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
|
958
|
-
|
959
|
-
p = getParent('A');
|
960
|
-
if (c = cm.get('link')) {
|
961
|
-
if (!p || !p.name) {
|
962
|
-
c.setDisabled(!p && co);
|
963
|
-
c.setActive(!!p);
|
964
|
-
}
|
965
|
-
}
|
966
|
-
|
967
|
-
if (c = cm.get('unlink')) {
|
968
|
-
c.setDisabled(!p && co);
|
969
|
-
c.setActive(!!p && !p.name);
|
970
|
-
}
|
971
|
-
|
972
|
-
if (c = cm.get('anchor')) {
|
973
|
-
c.setActive(!co && !!p && p.name);
|
974
|
-
}
|
975
|
-
|
976
|
-
p = getParent('IMG');
|
977
|
-
if (c = cm.get('image'))
|
978
|
-
c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1);
|
979
|
-
|
980
|
-
if (c = cm.get('styleselect')) {
|
981
|
-
t._importClasses();
|
982
|
-
|
983
|
-
formatNames = [];
|
984
|
-
each(c.items, function(item) {
|
985
|
-
formatNames.push(item.value);
|
986
|
-
});
|
987
|
-
|
988
|
-
matches = ed.formatter.matchAll(formatNames);
|
989
|
-
c.select(matches[0]);
|
990
|
-
}
|
991
|
-
|
992
|
-
if (c = cm.get('formatselect')) {
|
993
|
-
p = getParent(DOM.isBlock);
|
994
|
-
|
995
|
-
if (p)
|
996
|
-
c.select(p.nodeName.toLowerCase());
|
997
|
-
}
|
998
|
-
|
999
|
-
// Find out current fontSize, fontFamily and fontClass
|
1000
|
-
getParent(function(n) {
|
1001
|
-
if (n.nodeName === 'SPAN') {
|
1002
|
-
if (!cl && n.className)
|
1003
|
-
cl = n.className;
|
1004
|
-
}
|
1005
|
-
|
1006
|
-
if (ed.dom.is(n, s.theme_advanced_font_selector)) {
|
1007
|
-
if (!fz && n.style.fontSize)
|
1008
|
-
fz = n.style.fontSize;
|
1009
|
-
|
1010
|
-
if (!fn && n.style.fontFamily)
|
1011
|
-
fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
|
1012
|
-
}
|
1013
|
-
|
1014
|
-
return false;
|
1015
|
-
});
|
1016
|
-
|
1017
|
-
if (c = cm.get('fontselect')) {
|
1018
|
-
c.select(function(v) {
|
1019
|
-
return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;
|
1020
|
-
});
|
1021
|
-
}
|
1022
|
-
|
1023
|
-
// Select font size
|
1024
|
-
if (c = cm.get('fontsizeselect')) {
|
1025
|
-
// Use computed style
|
1026
|
-
if (s.theme_advanced_runtime_fontsize && !fz && !cl)
|
1027
|
-
fz = ed.dom.getStyle(n, 'fontSize', true);
|
1028
|
-
|
1029
|
-
c.select(function(v) {
|
1030
|
-
if (v.fontSize && v.fontSize === fz)
|
1031
|
-
return true;
|
1032
|
-
|
1033
|
-
if (v['class'] && v['class'] === cl)
|
1034
|
-
return true;
|
1035
|
-
});
|
1036
|
-
}
|
1037
|
-
|
1038
|
-
if (s.theme_advanced_show_current_color) {
|
1039
|
-
function updateColor(controlId, color) {
|
1040
|
-
if (c = cm.get(controlId)) {
|
1041
|
-
if (!color)
|
1042
|
-
color = c.settings.default_color;
|
1043
|
-
if (color !== c.value) {
|
1044
|
-
c.displayColor(color);
|
1045
|
-
}
|
1046
|
-
}
|
1047
|
-
};
|
1048
|
-
|
1049
|
-
updateColor('forecolor', fc);
|
1050
|
-
updateColor('backcolor', bc);
|
1051
|
-
}
|
1052
|
-
|
1053
|
-
if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {
|
1054
|
-
p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});
|
1055
|
-
|
1056
|
-
if (t.statusKeyboardNavigation) {
|
1057
|
-
t.statusKeyboardNavigation.destroy();
|
1058
|
-
t.statusKeyboardNavigation = null;
|
1059
|
-
}
|
1060
|
-
|
1061
|
-
DOM.setHTML(p, '');
|
1062
|
-
|
1063
|
-
getParent(function(n) {
|
1064
|
-
var na = n.nodeName.toLowerCase(), u, pi, ti = '';
|
1065
|
-
|
1066
|
-
if (n.getAttribute('data-mce-bogus'))
|
1067
|
-
return;
|
1068
|
-
|
1069
|
-
// Ignore non element and hidden elements
|
1070
|
-
if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))
|
1071
|
-
return;
|
1072
|
-
|
1073
|
-
// Handle prefix
|
1074
|
-
if (tinymce.isIE && n.scopeName !== 'HTML')
|
1075
|
-
na = n.scopeName + ':' + na;
|
1076
|
-
|
1077
|
-
// Remove internal prefix
|
1078
|
-
na = na.replace(/mce\:/g, '');
|
1079
|
-
|
1080
|
-
// Handle node name
|
1081
|
-
switch (na) {
|
1082
|
-
case 'b':
|
1083
|
-
na = 'strong';
|
1084
|
-
break;
|
1085
|
-
|
1086
|
-
case 'i':
|
1087
|
-
na = 'em';
|
1088
|
-
break;
|
1089
|
-
|
1090
|
-
case 'img':
|
1091
|
-
if (v = DOM.getAttrib(n, 'src'))
|
1092
|
-
ti += 'src: ' + v + ' ';
|
1093
|
-
|
1094
|
-
break;
|
1095
|
-
|
1096
|
-
case 'a':
|
1097
|
-
if (v = DOM.getAttrib(n, 'name')) {
|
1098
|
-
ti += 'name: ' + v + ' ';
|
1099
|
-
na += '#' + v;
|
1100
|
-
}
|
1101
|
-
|
1102
|
-
if (v = DOM.getAttrib(n, 'href'))
|
1103
|
-
ti += 'href: ' + v + ' ';
|
1104
|
-
|
1105
|
-
break;
|
1106
|
-
|
1107
|
-
case 'font':
|
1108
|
-
if (v = DOM.getAttrib(n, 'face'))
|
1109
|
-
ti += 'font: ' + v + ' ';
|
1110
|
-
|
1111
|
-
if (v = DOM.getAttrib(n, 'size'))
|
1112
|
-
ti += 'size: ' + v + ' ';
|
1113
|
-
|
1114
|
-
if (v = DOM.getAttrib(n, 'color'))
|
1115
|
-
ti += 'color: ' + v + ' ';
|
1116
|
-
|
1117
|
-
break;
|
1118
|
-
|
1119
|
-
case 'span':
|
1120
|
-
if (v = DOM.getAttrib(n, 'style'))
|
1121
|
-
ti += 'style: ' + v + ' ';
|
1122
|
-
|
1123
|
-
break;
|
1124
|
-
}
|
1125
|
-
|
1126
|
-
if (v = DOM.getAttrib(n, 'id'))
|
1127
|
-
ti += 'id: ' + v + ' ';
|
1128
|
-
|
1129
|
-
if (v = n.className) {
|
1130
|
-
v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
|
1131
|
-
|
1132
|
-
if (v) {
|
1133
|
-
ti += 'class: ' + v + ' ';
|
1134
|
-
|
1135
|
-
if (DOM.isBlock(n) || na == 'img' || na == 'span')
|
1136
|
-
na += '.' + v;
|
1137
|
-
}
|
1138
|
-
}
|
1139
|
-
|
1140
|
-
na = na.replace(/(html:)/g, '');
|
1141
|
-
na = {name : na, node : n, title : ti};
|
1142
|
-
t.onResolveName.dispatch(t, na);
|
1143
|
-
ti = na.title;
|
1144
|
-
na = na.name;
|
1145
|
-
|
1146
|
-
//u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";
|
1147
|
-
pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);
|
1148
|
-
|
1149
|
-
if (p.hasChildNodes()) {
|
1150
|
-
p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild);
|
1151
|
-
p.insertBefore(pi, p.firstChild);
|
1152
|
-
} else
|
1153
|
-
p.appendChild(pi);
|
1154
|
-
}, ed.getBody());
|
1155
|
-
|
1156
|
-
if (DOM.select('a', p).length > 0) {
|
1157
|
-
t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({
|
1158
|
-
root: ed.id + "_path_row",
|
1159
|
-
items: DOM.select('a', p),
|
1160
|
-
excludeFromTabOrder: true,
|
1161
|
-
onCancel: function() {
|
1162
|
-
ed.focus();
|
1163
|
-
}
|
1164
|
-
}, DOM);
|
1165
|
-
}
|
1166
|
-
}
|
1167
|
-
},
|
1168
|
-
|
1169
|
-
// Commands gets called by execCommand
|
1170
|
-
|
1171
|
-
_sel : function(v) {
|
1172
|
-
this.editor.execCommand('mceSelectNodeDepth', false, v);
|
1173
|
-
},
|
1174
|
-
|
1175
|
-
_mceInsertAnchor : function(ui, v) {
|
1176
|
-
var ed = this.editor;
|
1177
|
-
|
1178
|
-
ed.windowManager.open({
|
1179
|
-
url : this.url + '/anchor.htm',
|
1180
|
-
width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),
|
1181
|
-
height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),
|
1182
|
-
inline : true
|
1183
|
-
}, {
|
1184
|
-
theme_url : this.url
|
1185
|
-
});
|
1186
|
-
},
|
1187
|
-
|
1188
|
-
_mceCharMap : function() {
|
1189
|
-
var ed = this.editor;
|
1190
|
-
|
1191
|
-
ed.windowManager.open({
|
1192
|
-
url : this.url + '/charmap.htm',
|
1193
|
-
width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
|
1194
|
-
height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
|
1195
|
-
inline : true
|
1196
|
-
}, {
|
1197
|
-
theme_url : this.url
|
1198
|
-
});
|
1199
|
-
},
|
1200
|
-
|
1201
|
-
_mceHelp : function() {
|
1202
|
-
var ed = this.editor;
|
1203
|
-
|
1204
|
-
ed.windowManager.open({
|
1205
|
-
url : this.url + '/about.htm',
|
1206
|
-
width : 480,
|
1207
|
-
height : 380,
|
1208
|
-
inline : true
|
1209
|
-
}, {
|
1210
|
-
theme_url : this.url
|
1211
|
-
});
|
1212
|
-
},
|
1213
|
-
|
1214
|
-
_mceShortcuts : function() {
|
1215
|
-
var ed = this.editor;
|
1216
|
-
ed.windowManager.open({
|
1217
|
-
url: this.url + '/shortcuts.htm',
|
1218
|
-
width: 480,
|
1219
|
-
height: 380,
|
1220
|
-
inline: true
|
1221
|
-
}, {
|
1222
|
-
theme_url: this.url
|
1223
|
-
});
|
1224
|
-
},
|
1225
|
-
|
1226
|
-
_mceColorPicker : function(u, v) {
|
1227
|
-
var ed = this.editor;
|
1228
|
-
|
1229
|
-
v = v || {};
|
1230
|
-
|
1231
|
-
ed.windowManager.open({
|
1232
|
-
url : this.url + '/color_picker.htm',
|
1233
|
-
width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),
|
1234
|
-
height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),
|
1235
|
-
close_previous : false,
|
1236
|
-
inline : true
|
1237
|
-
}, {
|
1238
|
-
input_color : v.color,
|
1239
|
-
func : v.func,
|
1240
|
-
theme_url : this.url
|
1241
|
-
});
|
1242
|
-
},
|
1243
|
-
|
1244
|
-
_mceCodeEditor : function(ui, val) {
|
1245
|
-
var ed = this.editor;
|
1246
|
-
|
1247
|
-
ed.windowManager.open({
|
1248
|
-
url : this.url + '/source_editor.htm',
|
1249
|
-
width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),
|
1250
|
-
height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),
|
1251
|
-
inline : true,
|
1252
|
-
resizable : true,
|
1253
|
-
maximizable : true
|
1254
|
-
}, {
|
1255
|
-
theme_url : this.url
|
1256
|
-
});
|
1257
|
-
},
|
1258
|
-
|
1259
|
-
_mceImage : function(ui, val) {
|
1260
|
-
var ed = this.editor;
|
1261
|
-
|
1262
|
-
// Internal image object like a flash placeholder
|
1263
|
-
if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
|
1264
|
-
return;
|
1265
|
-
|
1266
|
-
ed.windowManager.open({
|
1267
|
-
url : this.url + '/image.htm',
|
1268
|
-
width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),
|
1269
|
-
height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),
|
1270
|
-
inline : true
|
1271
|
-
}, {
|
1272
|
-
theme_url : this.url
|
1273
|
-
});
|
1274
|
-
},
|
1275
|
-
|
1276
|
-
_mceLink : function(ui, val) {
|
1277
|
-
var ed = this.editor;
|
1278
|
-
|
1279
|
-
ed.windowManager.open({
|
1280
|
-
url : this.url + '/link.htm',
|
1281
|
-
width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),
|
1282
|
-
height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),
|
1283
|
-
inline : true
|
1284
|
-
}, {
|
1285
|
-
theme_url : this.url
|
1286
|
-
});
|
1287
|
-
},
|
1288
|
-
|
1289
|
-
_mceNewDocument : function() {
|
1290
|
-
var ed = this.editor;
|
1291
|
-
|
1292
|
-
ed.windowManager.confirm('advanced.newdocument', function(s) {
|
1293
|
-
if (s)
|
1294
|
-
ed.execCommand('mceSetContent', false, '');
|
1295
|
-
});
|
1296
|
-
},
|
1297
|
-
|
1298
|
-
_mceForeColor : function() {
|
1299
|
-
var t = this;
|
1300
|
-
|
1301
|
-
this._mceColorPicker(0, {
|
1302
|
-
color: t.fgColor,
|
1303
|
-
func : function(co) {
|
1304
|
-
t.fgColor = co;
|
1305
|
-
t.editor.execCommand('ForeColor', false, co);
|
1306
|
-
}
|
1307
|
-
});
|
1308
|
-
},
|
1309
|
-
|
1310
|
-
_mceBackColor : function() {
|
1311
|
-
var t = this;
|
1312
|
-
|
1313
|
-
this._mceColorPicker(0, {
|
1314
|
-
color: t.bgColor,
|
1315
|
-
func : function(co) {
|
1316
|
-
t.bgColor = co;
|
1317
|
-
t.editor.execCommand('HiliteColor', false, co);
|
1318
|
-
}
|
1319
|
-
});
|
1320
|
-
},
|
1321
|
-
|
1322
|
-
_ufirst : function(s) {
|
1323
|
-
return s.substring(0, 1).toUpperCase() + s.substring(1);
|
1324
|
-
}
|
1325
|
-
});
|
1326
|
-
|
1327
|
-
tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);
|
1328
|
-
}(tinymce));
|