+++ /dev/null
-In order to make TinyMCE work smoothly with Friendica, the files in this directory are those few files we've changed in TinyMCE. We will attempt to keep them current, but if you decide to upgrade tinymce, it is best to save current copies of the files in question from the active tinymce tree and replace them or merge them after upgrade.
-
-Except for some simple theming, the primary changes are the advanced theme icon set, which we changed the "html" icon to "[]" to represent BBcode, and major changes have been made to the bbcode plugin.
-
-
-in TinyMCE 3.5b2 it appears that we are getting double linefeeds. Code has been put in place in mod/item.php and mod/message.php to reduce the duplicates.
-
-
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.BBCodePlugin', {\r
- init : function(ed, url) {\r
- var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').toLowerCase();\r
-\r
- ed.onBeforeSetContent.add(function(ed, o) {\r
- o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
- });\r
-\r
- ed.onPostProcess.add(function(ed, o) {\r
- if (o.set)\r
- o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
-\r
- if (o.get)\r
- o.content = t['_' + dialect + '_html2bbcode'](o.content);\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'BBCode Plugin',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- // Private methods\r
-\r
- // HTML -> BBCode in DFRN dialect\r
- _dfrn_html2bbcode : function(s) {\r
- s = tinymce.trim(s);\r
-\r
- function rep(re, str) {\r
-\r
-\r
-s = s.replace(re,str);\r
-\r
- //modify code to keep stuff intact within [code][/code] blocks\r
- //Waitman Gobble NO WARRANTY\r
-\r
-/* This doesn't seem to work well with\r
-[code]line1\r
-line2[/code]\r
-commenting out for now\r
-*/\r
-\r
-/*\r
- var o = new Array();\r
- var x = s.split("[code]");\r
- var i = 0;\r
-\r
- var si = "";\r
- si = x.shift();\r
- si = si.replace(re,str);\r
- o.push(si);\r
-\r
- for (i = 0; i < x.length; i++) {\r
- var no = new Array();\r
- var j = x.shift();\r
- var g = j.split("[/code]");\r
- no.push(g.shift());\r
- si = g.shift();\r
- si = si.replace(re,str);\r
- no.push(si);\r
- o.push(no.join("[/code]"));\r
- }\r
-\r
- s = o.join("[code]");\r
-*/\r
- };\r
-\r
-\r
-\r
-\r
- /* oembed */\r
- function _h2b_cb(match) {\r
- /*\r
- function s_h2b(data) {\r
- match = data;\r
- }\r
- $.ajax({\r
- type:"POST",\r
- url: 'oembed/h2b',\r
- data: {text: match},\r
- async: false,\r
- success: s_h2b,\r
- dataType: 'html'\r
- });\r
- */\r
- \r
- var f, g, tof = [], tor = [];\r
- var find_spanc = /<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;\r
- while (f = find_spanc.exec(match)) {\r
- var find_a = /<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;\r
- if (g = find_a.exec(f[1])) {\r
- var find_href = /href=[\"']([^\"']*)[\"']/ig;\r
- var m2 = find_href.exec(g[1]);\r
- if (m2[1]) {\r
- tof.push(f[0]);\r
- tor.push("[EMBED]" + m2[1] + "[/EMBED]");\r
- }\r
- }\r
- }\r
- for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);\r
- \r
- return match;\r
- }\r
- if (s.indexOf('class="oembed')>=0){\r
- //alert("request oembed html2bbcode");\r
- s = _h2b_cb(s);\r
- }\r
- \r
- /* /oembed */\r
-\r
-\r
- // example: <strong> to [b]\r
- rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");\r
- rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");\r
- rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");\r
- rep(/<span style=\"color:(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");\r
- rep(/<font>(.*?)<\/font>/gi,"$1");\r
- rep(/<img.*?width=\"(.*?)\".*?height=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$1x$2]$3[/img]");\r
- rep(/<img.*?height=\"(.*?)\".*?width=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$2x$1]$3[/img]");\r
- rep(/<img.*?src=\"(.*?)\".*?height=\"(.*?)\".*?width=\"(.*?)\".*?\/>/gi,"[img=$3x$2]$1[/img]");\r
- rep(/<img.*?src=\"(.*?)\".*?width=\"(.*?)\".*?height=\"(.*?)\".*?\/>/gi,"[img=$2x$3]$1[/img]");\r
- rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");\r
-\r
- rep(/<ul class=\"listbullet\" style=\"list-style-type\: circle\;\">(.*?)<\/ul>/gi,"[list]$1[/list]");\r
- rep(/<ul class=\"listnone\" style=\"list-style-type\: none\;\">(.*?)<\/ul>/gi,"[list=]$1[/list]");\r
- rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");\r
- rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");\r
- rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");\r
- rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");\r
- rep(/<ul class=\"listupperalpha\" style=\"list-style-type\: upper-alpha\;\">(.*?)<\/ul>/gi,"[list=A]$1[/list]");\r
- rep(/<li>(.*?)<\/li>/gi,'[li]$1[/li]');\r
-\r
- rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");\r
- rep(/<\/(strong|b)>/gi,"[/b]");\r
- rep(/<(strong|b)>/gi,"[b]");\r
- rep(/<\/(em|i)>/gi,"[/i]");\r
- rep(/<(em|i)>/gi,"[i]");\r
- rep(/<\/u>/gi,"[/u]");\r
- rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");\r
- rep(/<u>/gi,"[u]");\r
- rep(/<blockquote[^>]*>/gi,"[quote]");\r
- rep(/<\/blockquote>/gi,"[/quote]");\r
- rep(/<hr \/>/gi,"[hr]");\r
- rep(/<br (.*?)\/>/gi,"\n");\r
- rep(/<br\/>/gi,"\n");\r
- rep(/<br>/gi,"\n");\r
- rep(/<p>/gi,"");\r
- rep(/<\/p>/gi,"\n");\r
- rep(/ /gi," ");\r
- rep(/"/gi,"\"");\r
- rep(/</gi,"<");\r
- rep(/>/gi,">");\r
- rep(/&/gi,"&");\r
-\r
- return s; \r
- },\r
-\r
- // BBCode -> HTML from DFRN dialect\r
- _dfrn_bbcode2html : function(s) {\r
- s = tinymce.trim(s);\r
-\r
-\r
- function rep(re, str) {\r
-\r
-\r
- //modify code to keep stuff intact within [code][/code] blocks\r
- //Waitman Gobble NO WARRANTY\r
-\r
-\r
- var o = new Array();\r
- var x = s.split("[code]");\r
- var i = 0;\r
-\r
- var si = "";\r
- si = x.shift();\r
- si = si.replace(re,str);\r
- o.push(si);\r
-\r
- for (i = 0; i < x.length; i++) {\r
- var no = new Array();\r
- var j = x.shift();\r
- var g = j.split("[/code]");\r
- no.push(g.shift());\r
- si = g.shift();\r
- si = si.replace(re,str);\r
- no.push(si);\r
- o.push(no.join("[/code]"));\r
- }\r
-\r
- s = o.join("[code]");\r
-\r
- };\r
-\r
-\r
-\r
-\r
-\r
- // example: [b] to <strong>\r
- rep(/\n/gi,"<br />");\r
- rep(/\[b\]/gi,"<strong>");\r
- rep(/\[\/b\]/gi,"</strong>");\r
- rep(/\[i\]/gi,"<em>");\r
- rep(/\[\/i\]/gi,"</em>");\r
- rep(/\[u\]/gi,"<u>");\r
- rep(/\[\/u\]/gi,"</u>");\r
- rep(/\[hr\]/gi,"<hr />");\r
- rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");\r
- rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");\r
- rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");\r
- rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");\r
- rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");\r
-\r
- rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');\r
- rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');\r
- rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');\r
- rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');\r
- rep(/\[list=I\](.*?)\[\/list\]/gi, '<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');\r
- rep(/\[list=a\](.*?)\[\/list\]/gi, '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');\r
- rep(/\[list=A\](.*?)\[\/list\]/gi, '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');\r
- rep(/\[li\](.*?)\[\/li\]/gi, '<li>$1</li>');\r
- rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<span style=\"color: $1;\">$2</span>");\r
- rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"<span style=\"font-size: $1;\">$2</span>");\r
- rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");\r
- rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");\r
-\r
- /* oembed */\r
- function _b2h_cb(match, url) {\r
- url = bin2hex(url);\r
- function s_b2h(data) {\r
- match = data;\r
- }\r
- $.ajax({\r
- url: 'oembed/b2h?url=' + url,\r
- async: false,\r
- success: s_b2h,\r
- dataType: 'html'\r
- });\r
- return match;\r
- }\r
- s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);\r
- \r
- /* /oembed */\r
-\r
- return s; \r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);\r
-})();\r
+++ /dev/null
-/* Generic */\r
-body {\r
-font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
-scrollbar-3dlight-color:#F0F0EE;\r
-scrollbar-arrow-color:#676662;\r
-scrollbar-base-color:#F0F0EE;\r
-scrollbar-darkshadow-color:#DDDDDD;\r
-scrollbar-face-color:#E0E0DD;\r
-scrollbar-highlight-color:#F0F0EE;\r
-scrollbar-shadow-color:#F0F0EE;\r
-scrollbar-track-color:#F5F5F5;\r
-background:#F0F0EE;\r
-padding:0;\r
-margin:8px 8px 0 8px;\r
-}\r
-\r
-html {background:#F0F0EE;}\r
-td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
-textarea {resize:none;outline:none;}\r
-a:link, a:visited {color:black;}\r
-a:hover {color:#2B6FB6;}\r
-.nowrap {white-space: nowrap}\r
-\r
-/* Forms */\r
-fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}\r
-legend {color:#2B6FB6; font-weight:bold;}\r
-label.msg {display:none;}\r
-label.invalid {color:#EE0000; display:inline;}\r
-input.invalid {border:1px solid #EE0000;}\r
-input {background:#FFF; border:1px solid #CCC;}\r
-input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
-input, select, textarea {border:1px solid #808080;}\r
-input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}\r
-input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}\r
-.input_noborder {border:0;}\r
-\r
-/* Buttons */\r
-#insert, #cancel, input.button, .updateButton {\r
-border:0; margin:0; padding:0;\r
-font-weight:bold;\r
-width:94px; height:26px;\r
-background:url(img/buttons.png) 0 -26px;\r
-cursor:pointer;\r
-padding-bottom:2px;\r
-float:left;\r
-}\r
-\r
-#insert {background:url(img/buttons.png) 0 -52px}\r
-#cancel {background:url(img/buttons.png) 0 0; float:right}\r
-\r
-/* Browse */\r
-a.pickcolor, a.browse {text-decoration:none}\r
-a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}\r
-.mceOldBoxModel a.browse span {width:22px; height:20px;}\r
-a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}\r
-a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}\r
-a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}\r
-.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}\r
-a.pickcolor:hover span {background-color:#B2BBD0;}\r
-a.pickcolor:hover span.disabled {}\r
-\r
-/* Charmap */\r
-table.charmap {border:1px solid #AAA; text-align:center}\r
-td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}\r
-#charmap a {display:block; color:#000; text-decoration:none; border:0}\r
-#charmap a:hover {background:#CCC;color:#2B6FB6}\r
-#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}\r
-#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}\r
-\r
-/* Source */\r
-.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}\r
-.mceActionPanel {margin-top:5px;}\r
-\r
-/* Tabs classes */\r
-.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}\r
-.tabs ul {margin:0; padding:0; list-style:none;}\r
-.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}\r
-.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}\r
-.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}\r
-.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}\r
-.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}\r
-.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}\r
-\r
-/* Panels */\r
-.panel_wrapper div.panel {display:none;}\r
-.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}\r
-.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}\r
-\r
-/* Columns */\r
-.column {float:left;}\r
-.properties {width:100%;}\r
-.properties .column1 {}\r
-.properties .column2 {text-align:left;}\r
-\r
-/* Titles */\r
-h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}\r
-h3 {font-size:14px;}\r
-.title {font-size:12px; font-weight:bold; color:#2B6FB6;}\r
-\r
-/* Dialog specific */\r
-#link .panel_wrapper, #link div.current {height:125px;}\r
-#image .panel_wrapper, #image div.current {height:200px;}\r
-#plugintable thead {font-weight:bold; background:#DDD;}\r
-#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
-#plugintable {width:96%; margin-top:10px;}\r
-#pluginscontainer {height:290px; overflow:auto;}\r
-#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}\r
-#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
-#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
-#colorpicker #light div {overflow:hidden;}\r
-#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}\r
-#colorpicker .panel_wrapper div.current {height:175px;}\r
-#colorpicker #namedcolors {width:150px;}\r
-#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
-#colorpicker #colornamecontainer {margin-top:5px;}\r
-#colorpicker #picker_panel fieldset {margin:auto;width:325px;}\r
+++ /dev/null
-/* Reset */\r
-.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}\r
-.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
-.defaultSkin table td {vertical-align:middle}\r
-\r
-/* Containers */\r
-.defaultSkin table {direction:ltr; background:#FFF}\r
-.defaultSkin iframe {display:block; background:#FFF}\r
-.defaultSkin .mceToolbar {height:26px}\r
-.defaultSkin .mceLeft {text-align:left}\r
-.defaultSkin .mceRight {text-align:right}\r
-\r
-/* External */\r
-.defaultSkin .mceExternalToolbar {position:absolute; border:2px solid #CCC; border-bottom:0; display:none;}\r
-.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}\r
-.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}\r
-\r
-/* Layout */\r
-.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC}\r
-.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}\r
-.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}\r
-.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}\r
-.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}\r
-.defaultSkin .mceIframeContainer { /*border-top:1px solid #CCC; border-bottom:1px solid #CCC */ border: none;}\r
-.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}\r
-.defaultSkin .mceStatusbar div {float:left; margin:2px}\r
-.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}\r
-.defaultSkin .mceStatusbar a:hover {text-decoration:underline}\r
-.defaultSkin table.mceToolbar {margin-left:3px}\r
-.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}\r
-.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
-.defaultSkin td.mceCenter {text-align:center;}\r
-.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;}\r
-.defaultSkin td.mceRight table {margin:0 0 0 auto;}\r
-\r
-/* Button */\r
-.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:10px}\r
-.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}\r
-.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}\r
-.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-.defaultSkin .mceButtonLabeled {width:auto}\r
-.defaultSkin .mceButtonLabeled span.mceIcon {float:left}\r
-.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}\r
-.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888}\r
-\r
-/* Separator */\r
-.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}\r
-\r
-/* ListBox */\r
-.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}\r
-.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}\r
-.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}\r
-.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF}\r
-.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0}\r
-.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;}\r
-.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}\r
-.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px}\r
-.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;}\r
-.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}\r
-\r
-/* SplitButton */\r
-.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}\r
-.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}\r
-.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}\r
-.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}\r
-.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}\r
-.defaultSkin .mceSplitButton span.mceOpen {display:none}\r
-.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}\r
-.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;}\r
-.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0}\r
-.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;}\r
-\r
-/* ColorSplitButton */\r
-.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}\r
-.defaultSkin .mceColorSplitMenu td {padding:2px}\r
-.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}\r
-.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}\r
-.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}\r
-.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}\r
-.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}\r
-.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a}\r
-.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}\r
-\r
-/* Menu */\r
-.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}\r
-.defaultSkin .mceNoIcons span.mceIcon {width:0;}\r
-.defaultSkin .mceNoIcons a .mceText {padding-left:10px}\r
-.defaultSkin .mceMenu table {background:#FFF}\r
-.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}\r
-.defaultSkin .mceMenu td {height:20px}\r
-.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}\r
-.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}\r
-.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px}\r
-.defaultSkin .mceMenu pre.mceText {font-family:Monospace}\r
-.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}\r
-.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}\r
-.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}\r
-.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}\r
-.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}\r
-.defaultSkin .mceMenuItemDisabled .mceText {color:#888}\r
-.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)}\r
-.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}\r
-.defaultSkin .mceMenu span.mceMenuLine {display:none}\r
-.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}\r
-\r
-/* Progress,Resize */\r
-.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}\r
-.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}\r
-\r
-/* Formats */\r
-.defaultSkin .mce_formatPreview a {font-size:10px}\r
-.defaultSkin .mce_p span.mceText {}\r
-.defaultSkin .mce_address span.mceText {font-style:italic}\r
-.defaultSkin .mce_pre span.mceText {font-family:monospace}\r
-.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}\r
-.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}\r
-.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}\r
-.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}\r
-.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}\r
-.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}\r
-\r
-/* Theme */\r
-.defaultSkin span.mce_bold {background-position:0 0}\r
-.defaultSkin span.mce_italic {background-position:-60px 0}\r
-.defaultSkin span.mce_underline {background-position:-140px 0}\r
-.defaultSkin span.mce_strikethrough {background-position:-120px 0}\r
-.defaultSkin span.mce_undo {background-position:-160px 0}\r
-.defaultSkin span.mce_redo {background-position:-100px 0}\r
-.defaultSkin span.mce_cleanup {background-position:-40px 0}\r
-.defaultSkin span.mce_bullist {background-position:-20px 0}\r
-.defaultSkin span.mce_numlist {background-position:-80px 0}\r
-.defaultSkin span.mce_justifyleft {background-position:-460px 0}\r
-.defaultSkin span.mce_justifyright {background-position:-480px 0}\r
-.defaultSkin span.mce_justifycenter {background-position:-420px 0}\r
-.defaultSkin span.mce_justifyfull {background-position:-440px 0}\r
-.defaultSkin span.mce_anchor {background-position:-200px 0}\r
-.defaultSkin span.mce_indent {background-position:-400px 0}\r
-.defaultSkin span.mce_outdent {background-position:-540px 0}\r
-.defaultSkin span.mce_link {background-position:-500px 0}\r
-.defaultSkin span.mce_unlink {background-position:-640px 0}\r
-.defaultSkin span.mce_sub {background-position:-600px 0}\r
-.defaultSkin span.mce_sup {background-position:-620px 0}\r
-.defaultSkin span.mce_removeformat {background-position:-580px 0}\r
-.defaultSkin span.mce_newdocument {background-position:-520px 0}\r
-.defaultSkin span.mce_image {background-position:-380px 0}\r
-.defaultSkin span.mce_help {background-position:-340px 0}\r
-.defaultSkin span.mce_code {background-position:-260px 0}\r
-.defaultSkin span.mce_hr {background-position:-360px 0}\r
-.defaultSkin span.mce_visualaid {background-position:-660px 0}\r
-.defaultSkin span.mce_charmap {background-position:-240px 0}\r
-.defaultSkin span.mce_paste {background-position:-560px 0}\r
-.defaultSkin span.mce_copy {background-position:-700px 0}\r
-.defaultSkin span.mce_cut {background-position:-680px 0}\r
-.defaultSkin span.mce_blockquote {background-position:-220px 0}\r
-.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0}\r
-.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0}\r
-.defaultSkin span.mce_forecolorpicker {background-position:-720px 0}\r
-.defaultSkin span.mce_backcolorpicker {background-position:-760px 0}\r
-\r
-/* Plugins */\r
-.defaultSkin span.mce_advhr {background-position:-0px -20px}\r
-.defaultSkin span.mce_ltr {background-position:-20px -20px}\r
-.defaultSkin span.mce_rtl {background-position:-40px -20px}\r
-.defaultSkin span.mce_emotions {background-position:-60px -20px}\r
-.defaultSkin span.mce_fullpage {background-position:-80px -20px}\r
-.defaultSkin span.mce_fullscreen {background-position:-100px -20px}\r
-.defaultSkin span.mce_iespell {background-position:-120px -20px}\r
-.defaultSkin span.mce_insertdate {background-position:-140px -20px}\r
-.defaultSkin span.mce_inserttime {background-position:-160px -20px}\r
-.defaultSkin span.mce_absolute {background-position:-180px -20px}\r
-.defaultSkin span.mce_backward {background-position:-200px -20px}\r
-.defaultSkin span.mce_forward {background-position:-220px -20px}\r
-.defaultSkin span.mce_insert_layer {background-position:-240px -20px}\r
-.defaultSkin span.mce_insertlayer {background-position:-260px -20px}\r
-.defaultSkin span.mce_movebackward {background-position:-280px -20px}\r
-.defaultSkin span.mce_moveforward {background-position:-300px -20px}\r
-.defaultSkin span.mce_media {background-position:-320px -20px}\r
-.defaultSkin span.mce_nonbreaking {background-position:-340px -20px}\r
-.defaultSkin span.mce_pastetext {background-position:-360px -20px}\r
-.defaultSkin span.mce_pasteword {background-position:-380px -20px}\r
-.defaultSkin span.mce_selectall {background-position:-400px -20px}\r
-.defaultSkin span.mce_preview {background-position:-420px -20px}\r
-.defaultSkin span.mce_print {background-position:-440px -20px}\r
-.defaultSkin span.mce_cancel {background-position:-460px -20px}\r
-.defaultSkin span.mce_save {background-position:-480px -20px}\r
-.defaultSkin span.mce_replace {background-position:-500px -20px}\r
-.defaultSkin span.mce_search {background-position:-520px -20px}\r
-.defaultSkin span.mce_styleprops {background-position:-560px -20px}\r
-.defaultSkin span.mce_table {background-position:-580px -20px}\r
-.defaultSkin span.mce_cell_props {background-position:-600px -20px}\r
-.defaultSkin span.mce_delete_table {background-position:-620px -20px}\r
-.defaultSkin span.mce_delete_col {background-position:-640px -20px}\r
-.defaultSkin span.mce_delete_row {background-position:-660px -20px}\r
-.defaultSkin span.mce_col_after {background-position:-680px -20px}\r
-.defaultSkin span.mce_col_before {background-position:-700px -20px}\r
-.defaultSkin span.mce_row_after {background-position:-720px -20px}\r
-.defaultSkin span.mce_row_before {background-position:-740px -20px}\r
-.defaultSkin span.mce_merge_cells {background-position:-760px -20px}\r
-.defaultSkin span.mce_table_props {background-position:-980px -20px}\r
-.defaultSkin span.mce_row_props {background-position:-780px -20px}\r
-.defaultSkin span.mce_split_cells {background-position:-800px -20px}\r
-.defaultSkin span.mce_template {background-position:-820px -20px}\r
-.defaultSkin span.mce_visualchars {background-position:-840px -20px}\r
-.defaultSkin span.mce_abbr {background-position:-860px -20px}\r
-.defaultSkin span.mce_acronym {background-position:-880px -20px}\r
-.defaultSkin span.mce_attribs {background-position:-900px -20px}\r
-.defaultSkin span.mce_cite {background-position:-920px -20px}\r
-.defaultSkin span.mce_del {background-position:-940px -20px}\r
-.defaultSkin span.mce_ins {background-position:-960px -20px}\r
-.defaultSkin span.mce_pagebreak {background-position:0 -40px}\r
-.defaultSkin span.mce_restoredraft {background-position:-20px -40px}\r
-.defaultSkin span.mce_spellchecker {background-position:-540px -20px}\r
+++ /dev/null
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
+++ /dev/null
-Version 3.5.8 (2012-11-20)
- Fixed bug where html5 data attributes where stripped from contents.
- Fixed bug where toolbar was annouced multiple times with JAWS on Firefox.
- Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode.
- Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty.
- Fixed bug with auto detection logic for youtube urls in the media plugin.
- Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery.
- Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks.
- Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element.
- Fixed bug where toggling of blockquotes when using br enter mode would produce an exception.
- Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level.
- Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8.
-Version 3.5.7 (2012-09-20)
- Changed table row properties dialog to not update multiple rows when row type is header or footer.
- Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of --
- Changing toolbars to have a toolbar role for FF keyboard navigation works correctly.
- Fixed bug where applying formatting to an empty block element would produce redundant spans.
- Fixed bug where caret formatting on IE wouldn't properly apply if you pressed enter/return.
- Fixed bug where loading TinyMCE using an async script wouldn't properly initialize editors.
- Fixed bug where some white space would be removed after inline elements before block elements.
- Fixed bug where it wouldn't properly parse attributes with a single backslash as it's contents.
- Fixed bug where noscript elements would loose it's contents on older IE versions.
- Fixed bug where backspace inside empty blockquote wouldn't delete it properly.
- Fixed bug where custom elements with . in their names wouldn't work properly.
- Fixed bug where the custom_elements option didn't properly setup the block elements schema structure.
- Fixed bug where the custom_elements option didn't auto populate the extended_valid_elements.
- Fixed bug where the whole TD element would get blcok formatted when there where BR elements in it.
- Fixed bug where IE 9 might crash if the editor was hidden and specific styles where applied to surrounding contents.
- Fixed bug where shift+enter inside a table cell on Gecko would produce an zero width non breaking space between tr:s.
- Fixed bug where the advlink dialog wouldn't properly populate the anchors dropdown if the HTML5 schema was used.
- Fixed issue with missing autofocus attribute on input element when using the HTML5 schema.
- Fixed issue where enter inside a block contained within an LI element wouldn't produce a new LI.
-Version 3.5.6 (2012-07-26)
- Added "text" as a valid option to the editor.getContent format option. Makes it easier to get a text representation of the editor contents.
- Fixed bug where resizing an image to less that 0x0 pixels would display the ghost image at an incorrect position.
- Fixed bug where the remove format button would produce extra paragraphs on WebKit if all of the contents was selected.
- Fixed issue where edge resize handles on images of wouldn't scale it with the same aspect ratio.
- Fixed so force_p_newlines option works again since some users want mixed mode paragraphs.
- Fixed so directionality plugin modifies the dir attribute of all selected blocks in the editor.
- Fixed bug where backspace/delete of a custom element would move it's attributes to the parent block on Gecko.
-Version 3.5.5 (2012-07-19)
- Added full resize support for images and tables on WebKit/Opera. It now behaves just like Gecko.
- Added automatic embed support for Vimeo, Stream.cz and Google Maps in media plugin. Patch contributed by Jakub Matas.
- Fixed bug where the lists plugin wouldn't properly remove all li elements when toggling selected items of. Patched by Taku AMANO.
- Fixed bug where the lists plugin would remove the entire list if you pressed deleted at the beginning of the first element. Patched by Taku AMANO.
- Fixed bug where the ordered/unordered list buttons could both be enabled if you nested lists. Patch contributed by Craig Petchell.
- Fixed bug where shift+enter wouldn't produce a BR in a LI when having forced_root_blocks set to false.
- Fixed bug where scrollbars aren't visible in fullscreen when window is resized.
- Fixed bug with updating the border size using the advimage dialog on IE 9.
- Fixed bug where the selection of inner elements on IE 8 in contentEditable mode would select the whole parent element.
- Fixed bug where the enter key would produce an empty anchor if you pressed it at the space after a link on IE.
- Fixed bug where autolink plugin would produce an exception for specific html see bug #5365
- Fixed so the formatChanged function takes an optional "similar" parameter to use while matching the format.
-Version 3.5.4.1 (2012-06-24)
- Fixed issue with Shift+A selecting all contents on Chrome.
-Version 3.5.4 (2012-06-21)
- Added missing mouse events to HTML5 schema. Some events needs to be manually defined though since the spec is huge.
- Added image resizing for WebKit browsers by faking the whole resize behavior.
- Fixed bug in context menu plugin where listener to hide menu wasn't removed correctly.
- Fixed bug where media plugin wouldn't use placeholder size for the object/video elements.
- Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2.
- Fixed bug where jQuery plugin would throw an error if you used the tinymce pseudo selector when TinyMCE wasn't loaded.
- Fixed so encoding option gets applied when using jQuery val() or attr() to extract the contents.
- Fixed so any non valid width/height passed to media plugin would get parsed to proper integer or percent values.
-Version 3.5.3 (2012-06-19)
- Added missing wbr element to HTML5 schema.
- Added new mceToggleFormat command. Enabled you to toggle a specific format on/off.
- Fixed bug where undo/redo state didn't update correctly after executing an execCommand call.
- Fixed bug where the editor would get auto focused on IE running in quirks mode.
- Fixed bug where pressing enter before an IMG or INPUT element wouldn't properly split the block.
- Fixed bug where backspace would navigate back when selecting control types on IE.
- Fixed bug where the editor remove method would unbind events for controls outside the editor instance UI.
- Fixed bug where the autosave plugin would try to store a draft copy of editors that where removed.
- Fixed bug where floated elements wouldn't expand the block created when pressing enter on non IE browsers.
- Fixed bug where the caret would be placed in the wrong location when pressing enter at the beginning of a block.
- Fixed bug where it wasn't possible to block events using the handle_event_callback option.
- Fixed bug where keyboard navigation of the ColorSplitButton.js didn't work correctly.
- Fixed bug where keyboard navigation didn't work correctly on split buttons.
- Fixed bug where the legacy Event.add function didn't properly handle multiple id:s passed in.
- Fixed bug where the caret would disappear on IE when selecting all contents and pressing backspace/delete.
- Fixed bug where the getStart/getEnd methods would sometimes return elements from the wrong document on IE.
- Fixed so paragraphs gets created if you press enter inside a form element.
-Version 3.5.2 (2012-05-31)
- Added new formatChanged method to tinymce.Formatter class. Enables easier state change handling of formats.
- Added new selectorChanged method to tinymce.dom.Selection class. Enables easier state change handling of matching CSS selectors.
- Changed the default theme to be advanced instead of simple since most users uses the advanced theme.
- Changed so the theme_advanced_buttons doesn't have a default set if one button row is specified.
- Changed the theme_advanced_toolbar_align default value to "left".
- Changed the theme_advanced_toolbar_location default value to "top".
- Changed the theme_advanced_statusbar_location default value to "bottom".
- Fixed bug where the simple link dialog would remove class and target attributes from links when updating them if the drop downs wasn't visible.
- Fixed bug where the link/unlink buttons wouldn't get disabled once a link was created by the autolink plugin logic.
- Fixed bug where the border attribute was missing in the HTML5 schema.
- Fixed bug where the legacyoutput plugin would use inline styles for font color.
- Fixed bug where editing of anchor names wouldn't produce an undo level.
- Fixed bug where the table plugin would delete the last empty block element in the editor.
- Fixed bug where pasting table rows when they where selected would make it impossible to editor that table row.
- Fixed bug with pressing enter in IE while having a select list focused would produce a JS error.
- Fixed bug where it wasn't possible to merge table cells by selecting them and using merge from context menu.
- Removed summary from HTML5 table attributes and fixed so this and other deprecated table fields gets hidden in the table dialog.
-Version 3.5.1.1 (2012-05-25)
- Fixed bug with control creation where plugin specific controls didn't work as expected.
-Version 3.5.1 (2012-05-25)
- Added new onBeforeAdd event to UndoManager patch contributed by Dan Rumney.
- Added support for overriding the theme rendering logic by using a custom function.
- Fixed bug where links wasn't automatically created by the autolink plugin on old IE versions when pressing enter in BR mode.
- Fixed bug where enter on older IE versions wouldn't produce a new paragraph if the previous sibling paragraph was empty.
- Fixed bug where toString on a faked DOM range on older IE versions wouldn't return a proper string.
- Fixed bug where named anchors wouldn't work properly when schema was set to HTML5.
- Fixed bug where HTML5 datalist options wasn't correctly parsed or indented.
- Fixed bug where linking would add anchors around block elements when the HTML5 schema was used.
- Fixed issue where the autolink plugin wouldn't properly handle mailto:user@domain.com.
- Optimized initialization and reduced rendering flicker by hiding the target element while initializing.
-Version 3.5.0.1 (2012-05-10)
- Fixed bug where selection normalization logic would break the selections of parent elements using the element path.
- Fixed bug where the autolink plugin would include trailing dots in domain names in the link creation.
- Fixed bug where the autolink plugin would produce an error on older IE versions when pressing enter.
- Fixed bug where old IE versions would throw an error during initialization when the editor was placed in an size restricted div.
-Version 3.5 (2012-05-03)
- Fixed menu rendering issue if the document was in rtl mode.
- Fixed bug where the hide function would throw an error about a missing variable.
- Fixed bug where autolink wouldn't convert URLs when hitting enter on IE due to the new enter key logic.
- Fixed bug where formatting using shortcuts like ctrl+b wouldn't work properly the first time.
- Fixed bug where selection.setContent after a formatter call wouldn't generate formatted contents.
- Fixed bug where whitespace would be removed before/after invalid_elements when they where removed.
- Fixed bug where updating styles using the theme image dialog in non inline mode on IE9 would produce errors.
- Fixed bug where IE 8 would produce an error when using the contextmenu plugin.
- Fixed bug where delete/backspace could remove contents of noneditable elements.
- Fixed so background color in style preview gets computed from body element if the current style element is transparent.
-Version 3.5b3 (2012-03-29)
- Added cancel button to colour picker dialog.
- Added figure and figcaption to the html5 visualblocks plugin.
- Added default alignment options for the figure element.
- Fixed bug where empty inline elements within block elements would sometimes produce a br child element.
- Fixed bug where urls pointing to the same domain as the current one would cause undefined errors. Patch contributed by Paul Giberson.
- Fixed bug where enter inside an editable element inside an non editable element would split the element.
- Fixed bug where cut/copy/paste of noneditable elements didn't work.
- Fixed bug where backspace would sometimes produce font elements on WebKit.
- Fixed bug where WebKit would produce spans out of various inline elements when using backspace.
- Fixed bug where IE9 wouldn't properly update image styles when images where resized.
- Fixed bug where drag/drop of noneditable elements didn't work correctly.
- Fixed bug where applying formatting to all contents wouldn't work correctly when an end point was inside an empty bock. Patch contributed by Jose Luiz.
- Fixed bug where IE10 removed the scopeName from the DOM element interface and there for it produced an undefined string in element path.
- Fixed bug where the caret would be placed at an incorrect location if you applied block formatting while having the caret at the end of the block.
- Fixed bug where applying column changes using the cell dialog would only update the first column. Patch contributed by krzyko.
- Fixed bug where the visualblocks plugin would force editor focus if it was turned on by default.
- Fixed bug where the tabfocus plugin would tab to iframes these are now ignored.
- Fixed bug where format drop down list wouldn't show the currently active format for a parent element.
- Fixed bug where paste of plain text in IE 9 would remove the new line characters from text.
- Fixed bug where the menu buttons/split button menus wouldn't be opened at the right location on older IE versions.
- Fixed bug where Gecko browsers wouldn't properly display the right format when having the selection as specific places.
- Fixed bug where shift+enter inside the body when having forced_root_blocks set to false would throw an error.
- Fixed bug where the jQuery plugin would break the attr method of jQuery 1.7.2. Patch contributed by Markus Kemmerling.
- Fixed so options like content_css accepts and array as well as a comma separated string as input.
- Restructured the internal logic to make it more separate from Editor.js.
- Updated the Sizzle engine to the latest version.
-Version 3.5b2 (2012-03-15)
- Rewrote the enter key logic to normalize browser behavior.
- Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option.
- Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node.
- Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls.
- Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection.
- Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string.
- Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default.
-Version 3.5b1 (2012-03-08)
- Added new event class that is faster and enables support for faking events.
- Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema.
- Added new schema option and support for the HTML5 schema.
- Added new visualblocks plugin that shows html5 blocks with visual borders.
- Added new types and selector options to make it easier to create editor instances with different configs.
- Added new preview of formatting options in various listboxes.
- Added new preview_styles option that enables control over what gets previewed.
- Fixed bug where content css would be loaded twice into iframe.
- Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed.
- Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined.
- Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting.
- Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing.
-Version 3.4.9 (2012-02-23)
- Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete.
- Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents.
- Fixed bug where pressing enter on end of list item with a heading would create a new item with heading.
- Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled.
- Fixed bug in Gecko where undo wasn't added when focus was lost.
- Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line.
- Fixed bug where right-click on formatted text in IE selected the entire line.
- Fixed bug where text ending with space could not be unformatted in IE.
- Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used.
- Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts.
- Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config.
- Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser.
- Fixed bug where content css files where loaded twice into the iframe.
- Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse.
-Version 3.4.8 (2012-02-02)
- Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text.
- Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked.
- Fixed bug where wrong text align buttons are active when multiple block elements are selected.
- Fixed bug where selected link not showing in target field of link dialog in some selection cases.
- Use settings for remove_trailing_br so this can be turned off instead of hard coding the value.
- Fixed bug in IE where the media plugin displayed null text when some values aren't filled in.
- Added API method 'onSetAttrib' that fires when the attribute value on a node changes.
- Fix font size dropdown value not being updated when text already has a font size in the advanced template.
- Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times.
- Fixed bug where caret cannot be placed after table if table is at end of document in IE.
- Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur.
- Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly.
- Fixed bug where a stranded bullet point would get created in WebKit.
- Fixed bug where selecting text in a blockquote and pressing backspace toggles the style.
- Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property.
- Fix white space in between spans from being deleted.
- Fixed bug where scrollbars where visible in the character map dialog on Gecko.
- Fixed issue with missing translation for one of the emoticons.
- Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev.
- Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout.
- Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace.
- Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber.
- Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu.
-Version 3.4.7 (2011-11-03)
- Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office.
- Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text.
- Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row.
- Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10.
- Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph.
- Fix new list items in IE8 not displayed on a new line when list contains nested list items.
- Clear formatting in table cell breaks the cell.
- Made media type list localisable.
- Fix out of memory error when using prototype in media dialog.
- Fixed bug where could not add a space in the middle of a th cell.
- Fixed bug where adding a bullet between two existing bullets adds an extra one
- Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in.
- Fixed bug where pressing enter on an empty list item does not outdent properly in FF
- Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell
- Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox.
- Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph.
- Fixed bug where deleting part of the link text can cause a link with no destination to be saved.
- Fixed bug where css style border widths wasn't handled correctly in table dialog.
- Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop.
- Fixed bug where scripts with custom script types wasn't properly passed though the editor.
- Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled.
- Made emoticons dialog use the keyboard naviation.
- Added navigation instructions to the symbols dialog.
- Added ability to set default values for the media plugin.
- Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties.
- Fixed bug where the symbols dialog was not accessible.
- Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility.
- Fixed bug where the advanced color picker wasn't working properly on FF 7.
- Fixed issue where the advanced color picker was producing uppercase hex codes.
- Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements.
- Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit.
- Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes.
-Version 3.4.6 (2011-09-29)
- Fixed bug where list items were being created for empty divs.
- Added support in Media plugin for audio media using the embed tag
- Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read.
- Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers)
- Fixed bug where classid attribute was not being checked from embed objects.
- Fixed bug in jsrobot tests with intermittently failing.
- Fixed bug where anchors wasn't updated properly if you edited them using IE 8.
- Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor.
- Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them.
- Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin.
- Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin.
- Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin.
- Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko.
- Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly.
- Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers.
-Version 3.4.5 (2011-09-06)
- Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes.
- Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved.
- Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats.
- Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly.
- Fixed bug in WebKit where console messages would be logged when deleting an empty document.
- Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list
- Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements.
- Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases.
- Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM.
- Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized.
- Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control.
- Fixed bug where adjacent links would get merged on IE due to bugs in their link command.
- Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe.
- Fixed bug where floated images in WebKit wouldn't get properly linked.
- Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode.
- Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P.
- Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit.
- Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit.
- Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7.
- Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit.
- Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents.
- Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text.
- Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled.
- Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin.
- Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped.
-Version 3.4.4 (2011-08-04)
- Added new html5 audio support. Patch contributed by Ronald M. Clifford.
- Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin.
- Fixed selection to match visual selection before applying formatting changes.
- Fixed browser specific bugs in lists for WebKit and IE.
- Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel.
- Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser.
- Fixed bug where formatting change would be lost after pressing enter.
- Fixed bug in WebKit where deleting across blocks would add extra styles.
- Fixed bug where moving cursor vertically in tables in WebKit wasn't working.
- Fixed bug in IE where deleting would cause error in console.
- Fixed bug where the formatter was not applying formats across list elements.
- Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed.
- Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden.
- Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko.
- Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements.
- Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event.
- Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them.
- Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog.
- Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location.
-Version 3.4.3.2 (2011-06-30)
- Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit.
- Fixed bugs in tests in firefox5 and WebKit.
- Fixed bug where selection of table cells would produce an exception on Gecko.
- Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden.
- Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup.
- Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection.
- Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes.
- Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document.
- Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them.
- Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed.
- Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element.
- Fixed performance issue with the noneditable plugin where it would enable/disable controls to often.
-Version 3.4.3.1 (2011-06-16)
- Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin.
- Fixed bug where custom buttons were not being rendered correctly when in high contrast mode.
- Added support for iOS 5 that now supporting contentEditable in it's latest beta.
- Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output.
- Fixed bug where custom_elements option wasn't working properly on IE browsers.
- Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements.
- Fixed bug where attributes with </> wasn't properly encoded as XML entities.
-Version 3.4.3 (2011-06-09)
- Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location.
- Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly.
- Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8.
- Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs.
- Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied.
- Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page.
- Fixed bug where applying a heading style to a list item would cascade style to children list items.
- Fixed bug where Editor loses focus when backspacing and changing styles in WebKit.
- Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided.
- Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari.
- Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk.
- Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded.
- Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ).
- Added possibility to change properties of all table cells in a column.
- Added external_image_list option to get images list from user-defined variable or function.
- Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome.
- Fixed bug where table size inputs were to small for values with size units.
- Fixed bug where table cell/row size input values were not validated.
- Fixed bug where menu item line-height would be set to wrong value by external styles.
- Fixed bug where hasUndo() would return wrong answer.
- Fixed bug where page title would be set to undefined by fullpage plugin.
- Fixed bug where HTML5 video properties were not updated in embedded media settings.
- Fixed bug where HTML comment on the first line would cause an error.
- Fixed bug where spellchecker menu was positioned incorrectly on IE.
- Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list.
- Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped.
- Fixed bug where numeric entities with leading zeros would produce incorrect decoding.
- Fixed bug where hexadecimal entities wasn't properly decoded.
- Fixed bug where bookmarks wasn't properly stored/restored on undo/redo.
- Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents.
- Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements.
- Fixed so contentEditable is used for the body of the editor if it's supported.
- Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null.
- Fixed performance issue with mceInsertCommand and inserting very simple contents.
- Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic.
- Fixed performance issue with table plugin where it checked for selected cells to often.
- Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers.
- Fixed bug where Gecko would remove single paragraphs if there where contents before/after it.
- Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin.
-Version 3.4.2 (2011-04-07)
- Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text.
- Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz.
- Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers.
- Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser.
- Fixed bug where blocks containing a single anchor element would be treated as empty.
- Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed.
- Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed.
- Fixed bug where image border color/style values were overwritten by advimage plugin.
- Fixed bug where setting border in advimage plugin would throw error in IE.
- Fixed bug where empty anchors list in link settings wasn't hidden.
- Fixed bug where xhtmlextras popups were missing localized popup-size parameters.
- Fixed bug where the context menu wouldn't select images on WebKit browsers.
- Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior.
- Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control.
- Fixed bug where contextmenu wasn't disabled on noneditable elements.
- Fixed bug where getStyle function would trigger error when called on element without style property.
- Fixed bug where editor fail to load if Javascript Compressor was used.
- Fixed bug where list-style-type=lower-greek would produce errors in IE<8.
- Fixed bug where spellchecker plugin would produce errors on IE6-7.
- Fixed bug where theme_advanced_containers configuration option causes error.
- Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value.
- Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size.
- Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog.
-Version 3.4.1 (2011-03-24)
- Added significantly improved list handling via the new 'lists' plugin.
- Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default.
- Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color.
- Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour.
- Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled.
- Fixed bug where selection locations on undo/redo didn't work correctly on specific contents.
- Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe.
- Fixed bug where some ascii numeric entities wasn't properly decoded.
- Fixed bug where some non western language codes wasn't properly decoded/encoded.
- Fixed bug where undo levels wasn't created when deleting contents on IE.
- Fixed bug where the initial undo levels bookmark wasn't updated correctly.
- Fixed bug where search/replace wouldn't be scoped to editor instances on IE8.
- Fixed bug where IE9 would produce two br elements after block elements when pasting.
- Fixed bug where IE would place the caret at an incorrect position after a paste operation.
- Fixed bug where a paste operation using the keyboard would add an extra undo level.
- Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted.
- Fixed bug where the table plugin couldn't correctly handle invalid table structures.
- Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin.
- Fixed bug where toggle states on some of the list boxes didn't update correctly.
- Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10.
- Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin.
- Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid.
- Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme.
- Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome.
- Fixed bug with references to non-existing images in css of fullpage plugin.
- Fixed bug where item could be unselected in spellchecker's language selector.
- Fixed bug where some mispelled words could be not highlighted using spellchecker plugin.
- Fixed bug where spellchecking would merge some words on IE.
- Fixed bug where spellchecker context menu was not always positioned correctly.
- Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled.
- Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents.
- Fixed bug where selecting the whole table would enable table tools for cells and rows.
- Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin.
- Fixed bug where setting text color in fullpage plugin doesn't work.
- Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly.
- Fixed bug where black spade suit character was not included in special character selector.
- Fixed bug where setting invalid values for table cell size would throw an error in IE.
- Fixed bug where spellchecking would remove whitespace characters from PRE block in IE.
- Fixed bug where HR was inserted inside P elements instead of splitting them.
- Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes.
- Fixed bug where bullet lists weren't always detected correctly.
- Fixed bug where deleting some paragraphs on IE would cause an exception.
- Fixed bug where the json encoder logic wouldn't properly encode \ characters.
- Fixed bug where the onChange event would be fired when the editor was first initialized.
- Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class.
- Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences.
- Fixed issue where styles were not included when using the full page plugin.
- Fixed issue where drag/drop operations wasn't properly added to the undo levels.
- Fixed issue where colors wasn't correctly applied to elements with underline decoration.
- Fixed issue where deleting some paragraphs on IE would cause an exception.
-Version 3.4 (2011-03-10)
- Added accessibility example with various accessibility options contributed by Ephox.
- Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin.
- Fixed bug where the image.htm had some strange td artifacts probably due to auto merging.
- Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method.
- Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent.
- Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode.
- Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode.
- Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode.
- Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox.
- Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme.
- Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x.
- Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right.
- Fixed bug where the formatter would align images when the selection range was collapsed.
- Fixed bug where the image button would be active when the selection range was collapsed.
- Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic.
- Fixed bug where the table cell/row dialogs would produce empty attributes.
- Fixed bug where the tfoot wouldn't be added to the top of the table.
- Fixed bug where the formatter would merge siblings with white space between them.
- Fixed bug where pasting headers and paragraphs would produce an extra paragraph.
- Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color.
- Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting.
- Fixed bug where multiple BR elements at end of block elements where removed.
- Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages.
- Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode.
- Fixed bug where the search/replace plugin wouldn't work correctly on IE 9.
- Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox.
- Fixed so the values entered in the color picker are forced to hex values.
- Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade.
- Removed obsolete calls in various plugins to the mceBeginUndoLevel command.
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<title>Full featured example</title>\r
-\r
-<!-- TinyMCE -->\r
-<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>\r
-<script type="text/javascript">\r
- tinyMCE.init({\r
- // General options\r
- mode : "textareas",\r
- theme : "advanced",\r
- plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",\r
-\r
- // Theme options\r
- theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",\r
- theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",\r
- theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",\r
- theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",\r
- theme_advanced_toolbar_location : "top",\r
- theme_advanced_toolbar_align : "left",\r
- theme_advanced_statusbar_location : "bottom",\r
- theme_advanced_resizing : true,\r
-\r
- // Example content CSS (should be your site CSS)\r
- // using false to ensure that the default browser settings are used for best Accessibility\r
- // ACCESSIBILITY SETTINGS
- content_css : false,\r
- // Use browser preferred colors for dialogs.
- browser_preferred_colors : true,\r
- detect_highcontrast : true,\r
-\r
- // Drop lists for link/image/media/template dialogs\r
- template_external_list_url : "lists/template_list.js",\r
- external_link_list_url : "lists/link_list.js",\r
- external_image_list_url : "lists/image_list.js",\r
- media_external_list_url : "lists/media_list.js",\r
-\r
- // Style formats\r
- style_formats : [\r
- {title : 'Bold text', inline : 'b'},\r
- {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},\r
- {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},\r
- {title : 'Example 1', inline : 'span', classes : 'example1'},\r
- {title : 'Example 2', inline : 'span', classes : 'example2'},\r
- {title : 'Table styles'},\r
- {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}\r
- ],\r
-\r
- // Replace values for the template plugin\r
- template_replace_values : {\r
- username : "Some User",\r
- staffid : "991234"\r
- }\r
- });\r
-</script>\r
-<!-- /TinyMCE -->\r
-\r
-</head>\r
-<body>\r
-\r
-<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">\r
- <div>\r
- <h3>Full featured example, with Accessibility settings enabled</h3>\r
-\r
- <p>\r
- This page has got the TinyMCE set up to work with configurations related to accessiblity enabled.\r
- In particular
- <ul>
- <li>the <strong>content_css</strong> is set to false, to ensure that all default browser styles are used, </li>
- <li>the <strong>browser_preferred_colors</strong> dialog option is used to ensure that default css is used for dialogs, </li>
- <li>and the <strong>detect_highcontrast</strong> option has been set to ensure that highcontrast mode in Windows browsers
- is detected and the toolbars are displayed in a high contrast mode.</li>
- </ul>
- </p>\r
-\r
- <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->\r
- <div>\r
- <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">\r
- <p>\r
- This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.\r
- </p>\r
- <p>\r
- Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.\r
- </p>\r
- </textarea>\r
- </div>\r
-\r
- <br />\r
- <input type="submit" name="save" value="Submit" />\r
- <input type="reset" name="reset" value="Reset" />\r
- </div>\r
-</form>\r
-\r
-<script type="text/javascript">\r
-if (document.location.protocol == 'file:') {\r
- alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");\r
-}\r
-</script>\r
-</body>\r
-</html>
+++ /dev/null
-body {\r
- background-color: #FFFFFF;\r
- font-family: Verdana, Arial, Helvetica, sans-serif;\r
- font-size: 10px;\r
- scrollbar-3dlight-color: #F0F0EE;\r
- scrollbar-arrow-color: #676662;\r
- scrollbar-base-color: #F0F0EE;\r
- scrollbar-darkshadow-color: #DDDDDD;\r
- scrollbar-face-color: #E0E0DD;\r
- scrollbar-highlight-color: #F0F0EE;\r
- scrollbar-shadow-color: #F0F0EE;\r
- scrollbar-track-color: #F5F5F5;\r
-}\r
-\r
-td {\r
- font-family: Verdana, Arial, Helvetica, sans-serif;\r
- font-size: 10px;\r
-}\r
-\r
-pre {\r
- font-family: Verdana, Arial, Helvetica, sans-serif;\r
- font-size: 10px;\r
-}\r
-\r
-.example1 {\r
- font-weight: bold;\r
- font-size: 14px\r
-}\r
-\r
-.example2 {\r
- font-weight: bold;\r
- font-size: 12px;\r
- color: #FF0000\r
-}\r
-\r
-.tablerow1 {\r
- background-color: #BBBBBB;\r
-}\r
-\r
-thead {\r
- background-color: #FFBBBB;\r
-}\r
-\r
-tfoot {\r
- background-color: #BBBBFF;\r
-}\r
-\r
-th {\r
- font-family: Verdana, Arial, Helvetica, sans-serif;\r
- font-size: 13px;\r
-}\r
-\r
-/* Basic formats */\r
-\r
-.bold {\r
- font-weight: bold;\r
-}\r
-\r
-.italic {\r
- font-style: italic;\r
-}\r
-\r
-.underline {\r
- text-decoration: underline;\r
-}\r
-\r
-/* Global align classes */\r
-\r
-.left {\r
- text-align: inherit;\r
-}\r
-\r
-.center {\r
- text-align: center;\r
-}\r
-\r
-.right {\r
- text-align: right;\r
-}\r
-\r
-.full {\r
- text-align: justify\r
-}\r
-\r
-/* Image and table specific aligns */\r
-\r
-img.left, table.left {\r
- float: left;\r
- text-align: inherit;\r
-}\r
-\r
-img.center, table.center {\r
- margin-left: auto;\r
- margin-right: auto;\r
- text-align: inherit;\r
-}\r
-\r
-img.center {\r
- display: block;\r
-}\r
-\r
-img.right, table.right {\r
- float: right;\r
- text-align: inherit;\r
-}\r
+++ /dev/null
-body {\r
- background-color: #FFFFFF;\r
- font-family: Verdana, Arial, Helvetica, sans-serif;\r
- font-size: 10px;\r
- scrollbar-3dlight-color: #F0F0EE;\r
- scrollbar-arrow-color: #676662;\r
- scrollbar-base-color: #F0F0EE;\r
- scrollbar-darkshadow-color: #DDDDDD;\r
- scrollbar-face-color: #E0E0DD;\r
- scrollbar-highlight-color: #F0F0EE;\r
- scrollbar-shadow-color: #F0F0EE;\r
- scrollbar-track-color: #F5F5F5;\r
-}\r
-\r
-p {margin:0; padding:0;}\r
-\r
-td {\r
- font-family: Verdana, Arial, Helvetica, sans-serif;\r
- font-size: 10px;\r
-}\r
-\r
-pre {\r
- font-family: Verdana, Arial, Helvetica, sans-serif;\r
- font-size: 10px;\r
-}\r
-\r
-.example1 {\r
- font-weight: bold;\r
- font-size: 14px\r
-}\r
-\r
-.example2 {\r
- font-weight: bold;\r
- font-size: 12px;\r
- color: #FF0000\r
-}\r
-\r
-.tablerow1 {\r
- background-color: #BBBBBB;\r
-}\r
-\r
-thead {\r
- background-color: #FFBBBB;\r
-}\r
-\r
-tfoot {\r
- background-color: #BBBBFF;\r
-}\r
-\r
-th {\r
- font-family: Verdana, Arial, Helvetica, sans-serif;\r
- font-size: 13px;\r
-}\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<title>Custom formats example</title>\r
-\r
-<!-- TinyMCE -->\r
-<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>\r
-<script type="text/javascript">\r
- tinyMCE.init({\r
- // General options\r
- mode : "textareas",\r
- theme : "advanced",\r
- plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",\r
-\r
- // Theme options\r
- theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",\r
- theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",\r
- theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",\r
- theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",\r
- theme_advanced_toolbar_location : "top",\r
- theme_advanced_toolbar_align : "left",\r
- theme_advanced_statusbar_location : "bottom",\r
- theme_advanced_resizing : true,\r
-\r
- // Example content CSS (should be your site CSS)\r
- content_css : "css/content.css",\r
-\r
- // Drop lists for link/image/media/template dialogs\r
- template_external_list_url : "lists/template_list.js",\r
- external_link_list_url : "lists/link_list.js",\r
- external_image_list_url : "lists/image_list.js",\r
- media_external_list_url : "lists/media_list.js",\r
-\r
- // Style formats\r
- style_formats : [\r
- {title : 'Bold text', inline : 'b'},\r
- {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},\r
- {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},\r
- {title : 'Example 1', inline : 'span', classes : 'example1'},\r
- {title : 'Example 2', inline : 'span', classes : 'example2'},\r
- {title : 'Table styles'},\r
- {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}\r
- ],\r
-\r
- formats : {\r
- alignleft : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'left'},\r
- aligncenter : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'center'},\r
- alignright : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'right'},\r
- alignfull : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'full'},\r
- bold : {inline : 'span', 'classes' : 'bold'},\r
- italic : {inline : 'span', 'classes' : 'italic'},\r
- underline : {inline : 'span', 'classes' : 'underline', exact : true},\r
- strikethrough : {inline : 'del'}\r
- },\r
-\r
- // Replace values for the template plugin\r
- template_replace_values : {\r
- username : "Some User",\r
- staffid : "991234"\r
- }\r
- });\r
-</script>\r
-<!-- /TinyMCE -->\r
-\r
-</head>\r
-<body>\r
-\r
-<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">\r
- <div>\r
- <h3>Custom formats example</h3>\r
-\r
- <p>\r
- This example shows you how to override the default formats for bold, italic, underline, strikethough and alignment to use classes instead of inline styles.\r
- There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.\r
- </p>\r
-\r
- <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->\r
- <div>\r
- <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">\r
- <p>\r
- This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.\r
- </p>\r
- <p>\r
- Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.\r
- </p>\r
- </textarea>\r
- </div>\r
-\r
- <!-- Some integration calls -->\r
- <a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>\r
- <a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a>\r
- <a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Bold]</a>\r
- <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a>\r
- <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a>\r
- <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>\r
- <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().nodeName);">[Get selected element]</a>\r
- <a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>\r
- <a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>\r
-\r
- <br />\r
- <input type="submit" name="save" value="Submit" />\r
- <input type="reset" name="reset" value="Reset" />\r
- </div>\r
-</form>\r
-<script type="text/javascript">\r
-if (document.location.protocol == 'file:') {\r
- alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");\r
-}\r
-</script>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<title>Full featured example</title>\r
-<meta http-equiv="X-UA-Compatible" content="IE=edge" />\r
-<!-- TinyMCE -->\r
-<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>\r
-<script type="text/javascript">\r
- tinyMCE.init({\r
- // General options\r
- mode : "textareas",\r
- theme : "advanced",\r
- plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",\r
-\r
- // Theme options\r
- theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",\r
- theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",\r
- theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",\r
- theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks",\r
- theme_advanced_toolbar_location : "top",\r
- theme_advanced_toolbar_align : "left",\r
- theme_advanced_statusbar_location : "bottom",\r
- theme_advanced_resizing : true,\r
-\r
- // Example content CSS (should be your site CSS)\r
- content_css : "css/content.css",\r
-\r
- // Drop lists for link/image/media/template dialogs\r
- template_external_list_url : "lists/template_list.js",\r
- external_link_list_url : "lists/link_list.js",\r
- external_image_list_url : "lists/image_list.js",\r
- media_external_list_url : "lists/media_list.js",\r
-\r
- // Style formats\r
- style_formats : [\r
- {title : 'Bold text', inline : 'b'},\r
- {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},\r
- {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},\r
- {title : 'Example 1', inline : 'span', classes : 'example1'},\r
- {title : 'Example 2', inline : 'span', classes : 'example2'},\r
- {title : 'Table styles'},\r
- {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}\r
- ],\r
-\r
- // Replace values for the template plugin\r
- template_replace_values : {\r
- username : "Some User",\r
- staffid : "991234"\r
- }\r
- });\r
-</script>\r
-<!-- /TinyMCE -->\r
-\r
-</head>\r
-<body role="application">\r
-\r
-<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">\r
- <div>\r
- <h3>Full featured example</h3>\r
-\r
- <p>\r
- This page shows all available buttons and plugins that are included in the TinyMCE core package.\r
- There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.\r
- </p>\r
-\r
- <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->\r
- <div>\r
- <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">\r
- <p>\r
- This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.\r
- </p>\r
- <p>\r
- Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.\r
- </p>\r
- </textarea>\r
- </div>\r
-\r
- <!-- Some integration calls -->\r
- <a href="javascript:;" onclick="tinyMCE.get('elm1').show();return false;">[Show]</a>\r
- <a href="javascript:;" onclick="tinyMCE.get('elm1').hide();return false;">[Hide]</a>\r
- <a href="javascript:;" onclick="tinyMCE.get('elm1').execCommand('Bold');return false;">[Bold]</a>\r
- <a href="javascript:;" onclick="alert(tinyMCE.get('elm1').getContent());return false;">[Get contents]</a>\r
- <a href="javascript:;" onclick="alert(tinyMCE.get('elm1').selection.getContent());return false;">[Get selected HTML]</a>\r
- <a href="javascript:;" onclick="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));return false;">[Get selected text]</a>\r
- <a href="javascript:;" onclick="alert(tinyMCE.get('elm1').selection.getNode().nodeName);return false;">[Get selected element]</a>\r
- <a href="javascript:;" onclick="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');return false;">[Insert HTML]</a>\r
- <a href="javascript:;" onclick="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');return false;">[Replace selection]</a>\r
-\r
- <br />\r
- <input type="submit" name="save" value="Submit" />\r
- <input type="reset" name="reset" value="Reset" />\r
- </div>\r
-</form>\r
-\r
-<script type="text/javascript">\r
-if (document.location.protocol == 'file:') {\r
- alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");\r
-}\r
-</script>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\r
-<html>\r
-<head>\r
- <title>TinyMCE examples</title>\r
-</head>\r
-<frameset cols="180,80%">\r
- <frame src="menu.html" name="menu" />\r
- <frame src="full.html" name="main" />\r
-</frameset>\r
-</html>\r
+++ /dev/null
-// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.\r
-// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url"\r
-// option is defined in TinyMCE init.\r
-\r
-var tinyMCEImageList = new Array(\r
- // Name, URL\r
- ["Logo 1", "media/logo.jpg"],\r
- ["Logo 2 Over", "media/logo_over.jpg"]\r
-);\r
+++ /dev/null
-// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.\r
-// There links will be displayed as a dropdown in all link dialogs if the "external_link_list_url"\r
-// option is defined in TinyMCE init.\r
-\r
-var tinyMCELinkList = new Array(\r
- // Name, URL\r
- ["Moxiecode", "http://www.moxiecode.com"],\r
- ["Freshmeat", "http://www.freshmeat.com"],\r
- ["Sourceforge", "http://www.sourceforge.com"]\r
-);\r
+++ /dev/null
-// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.\r
-// There flash movies will be displayed as a dropdown in all media dialog if the "media_external_list_url"\r
-// option is defined in TinyMCE init.\r
-\r
-var tinyMCEMediaList = [\r
- // Name, URL\r
- ["Some Flash", "media/sample.swf"],\r
- ["Some Quicktime", "media/sample.mov"],\r
- ["Some AVI", "media/sample.avi"],\r
- ["Some RealMedia", "media/sample.rm"],\r
- ["Some Shockwave", "media/sample.dcr"],\r
- ["Some Video", "media/sample.mp4"],\r
- ["Some FLV", "media/sample.flv"]\r
-];
\ No newline at end of file
+++ /dev/null
-// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.\r
-// There templates will be displayed as a dropdown in all media dialog if the "template_external_list_url"\r
-// option is defined in TinyMCE init.\r
-\r
-var tinyMCETemplateList = [\r
- // Name, URL, Description\r
- ["Simple snippet", "templates/snippet1.htm", "Simple HTML snippet."],\r
- ["Layout", "templates/layout1.htm", "HTML Layout."]\r
-];
\ No newline at end of file
+++ /dev/null
-http://streaming.uga.edu/samples/ayp_lan.rm
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<title>Menu</title>\r
-<style>\r
-a {display:block;}\r
-</style>\r
-</head>\r
-<body>\r
-<h3>Examples</h3>\r
-<a href="full.html" target="main">Full featured</a>\r
-<a href="simple.html" target="main">Simple theme</a>\r
-<a href="skins.html" target="main">Skin support</a>\r
-<a href="word.html" target="main">Word processor</a>\r
-<a href="custom_formats.html" target="main">Custom formats</a>\r
-<a href="accessibility.html" target="main">Accessibility Options</a>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<title>Simple theme example</title>\r
-\r
-<!-- TinyMCE -->\r
-<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>\r
-<script type="text/javascript">\r
- tinyMCE.init({\r
- mode : "textareas",\r
- theme : "simple"\r
- });\r
-</script>\r
-<!-- /TinyMCE -->\r
-\r
-</head>\r
-<body>\r
-\r
-<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">\r
- <h3>Simple theme example</h3>\r
-\r
- <p>\r
- This page shows you the simple theme and it's core functionality you can extend it by changing the code use the advanced theme if you need to configure/add more buttons etc.\r
- There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.\r
- </p>\r
-\r
- <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->\r
- <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">\r
- <p>\r
- This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.\r
- </p>\r
- <p>\r
- Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.\r
- </p>\r
- </textarea>\r
-\r
- <br />\r
- <input type="submit" name="save" value="Submit" />\r
- <input type="reset" name="reset" value="Reset" />\r
-</form>\r
-<script type="text/javascript">\r
-if (document.location.protocol == 'file:') {\r
- alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");\r
-}\r
-</script>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<title>Skin support example</title>\r
-\r
-<!-- TinyMCE -->\r
-<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>\r
-<script type="text/javascript">\r
- // Default skin\r
- tinyMCE.init({\r
- // General options\r
- mode : "exact",\r
- elements : "elm1",\r
- theme : "advanced",\r
- plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",\r
-\r
- // Theme options\r
- theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",\r
- theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",\r
- theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",\r
- theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",\r
- theme_advanced_toolbar_location : "top",\r
- theme_advanced_toolbar_align : "left",\r
- theme_advanced_statusbar_location : "bottom",\r
- theme_advanced_resizing : true,\r
-\r
- // Example content CSS (should be your site CSS)\r
- content_css : "css/content.css",\r
-\r
- // Drop lists for link/image/media/template dialogs\r
- template_external_list_url : "lists/template_list.js",\r
- external_link_list_url : "lists/link_list.js",\r
- external_image_list_url : "lists/image_list.js",\r
- media_external_list_url : "lists/media_list.js",\r
-\r
- // Replace values for the template plugin\r
- template_replace_values : {\r
- username : "Some User",\r
- staffid : "991234"\r
- }\r
- });\r
-\r
- // O2k7 skin\r
- tinyMCE.init({\r
- // General options\r
- mode : "exact",\r
- elements : "elm2",\r
- theme : "advanced",\r
- skin : "o2k7",\r
- plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",\r
-\r
- // Theme options\r
- theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",\r
- theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",\r
- theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",\r
- theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",\r
- theme_advanced_toolbar_location : "top",\r
- theme_advanced_toolbar_align : "left",\r
- theme_advanced_statusbar_location : "bottom",\r
- theme_advanced_resizing : true,\r
-\r
- // Example content CSS (should be your site CSS)\r
- content_css : "css/content.css",\r
-\r
- // Drop lists for link/image/media/template dialogs\r
- template_external_list_url : "lists/template_list.js",\r
- external_link_list_url : "lists/link_list.js",\r
- external_image_list_url : "lists/image_list.js",\r
- media_external_list_url : "lists/media_list.js",\r
-\r
- // Replace values for the template plugin\r
- template_replace_values : {\r
- username : "Some User",\r
- staffid : "991234"\r
- }\r
- });\r
-\r
- // O2k7 skin (silver)\r
- tinyMCE.init({\r
- // General options\r
- mode : "exact",\r
- elements : "elm3",\r
- theme : "advanced",\r
- skin : "o2k7",\r
- skin_variant : "silver",\r
- plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",\r
-\r
- // Theme options\r
- theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",\r
- theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",\r
- theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",\r
- theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",\r
- theme_advanced_toolbar_location : "top",\r
- theme_advanced_toolbar_align : "left",\r
- theme_advanced_statusbar_location : "bottom",\r
- theme_advanced_resizing : true,\r
-\r
- // Example content CSS (should be your site CSS)\r
- content_css : "css/content.css",\r
-\r
- // Drop lists for link/image/media/template dialogs\r
- template_external_list_url : "lists/template_list.js",\r
- external_link_list_url : "lists/link_list.js",\r
- external_image_list_url : "lists/image_list.js",\r
- media_external_list_url : "lists/media_list.js",\r
-\r
- // Replace values for the template plugin\r
- template_replace_values : {\r
- username : "Some User",\r
- staffid : "991234"\r
- }\r
- });\r
-\r
- // O2k7 skin (silver)\r
- tinyMCE.init({\r
- // General options\r
- mode : "exact",\r
- elements : "elm4",\r
- theme : "advanced",\r
- skin : "o2k7",\r
- skin_variant : "black",\r
- plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",\r
-\r
- // Theme options\r
- theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",\r
- theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",\r
- theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",\r
- theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",\r
- theme_advanced_toolbar_location : "top",\r
- theme_advanced_toolbar_align : "left",\r
- theme_advanced_statusbar_location : "bottom",\r
- theme_advanced_resizing : true,\r
-\r
- // Example content CSS (should be your site CSS)\r
- content_css : "css/content.css",\r
-\r
- // Drop lists for link/image/media/template dialogs\r
- template_external_list_url : "lists/template_list.js",\r
- external_link_list_url : "lists/link_list.js",\r
- external_image_list_url : "lists/image_list.js",\r
- media_external_list_url : "lists/media_list.js",\r
-\r
- // Replace values for the template plugin\r
- template_replace_values : {\r
- username : "Some User",\r
- staffid : "991234"\r
- }\r
- });\r
-</script>\r
-<!-- /TinyMCE -->\r
-\r
-</head>\r
-<body>\r
-\r
-<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">\r
- <h3>Skin support example</h3>\r
-\r
- <p>\r
- This page displays the two skins that TinyMCE comes with. You can make your own by creating a CSS file in themes/advanced/skins/<yout skin>/ui.css\r
- There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.\r
- </p>\r
-\r
- <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->\r
- <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">\r
- <p>\r
- This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.\r
- </p>\r
- <p>\r
- Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.\r
- </p>\r
- </textarea>\r
-\r
- <br />\r
-\r
- <textarea id="elm2" name="elm2" rows="15" cols="80" style="width: 80%">\r
- <p>\r
- This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.\r
- </p>\r
- <p>\r
- Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.\r
- </p>\r
- </textarea>\r
-\r
- <br />\r
-\r
- <textarea id="elm3" name="elm3" rows="15" cols="80" style="width: 80%">\r
- <p>\r
- This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.\r
- </p>\r
- <p>\r
- Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.\r
- </p>\r
- </textarea>\r
-\r
- <br />\r
-\r
- <textarea id="elm4" name="elm4" rows="15" cols="80" style="width: 80%">\r
- <p>\r
- This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.\r
- </p>\r
- <p>\r
- Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.\r
- </p>\r
- </textarea>\r
-\r
- <br />\r
- <input type="submit" name="save" value="Submit" />\r
- <input type="reset" name="reset" value="Reset" />\r
-</form>\r
-<script type="text/javascript">\r
-if (document.location.protocol == 'file:') {\r
- alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");\r
-}\r
-</script>\r
-</body>\r
-</html>\r
+++ /dev/null
-<table border="1">\r
- <thead>\r
- <tr>\r
- <td>Column 1</td>\r
- <td>Column 2</td>\r
- </tr>\r
- </thead>\r
-\r
- <tbody>\r
- <tr>\r
- <td>Username: {$username}</td>\r
- <td>Staffid: {$staffid}</td>\r
- </tr>\r
- </tbody>\r
-</table>\r
+++ /dev/null
-This is just some <strong>code</strong>.\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<title>Word processor example</title>\r
-<meta http-equiv="X-UA-Compatible" content="IE=edge" />\r
-<!-- TinyMCE -->\r
-<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>\r
-<script type="text/javascript">\r
- tinyMCE.init({\r
- // General options\r
- mode : "textareas",\r
- theme : "advanced",\r
- skin : "o2k7",\r
- plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",\r
-\r
- // Theme options\r
- theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",\r
- theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",\r
- theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",\r
- theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",\r
- theme_advanced_toolbar_location : "top",\r
- theme_advanced_toolbar_align : "left",\r
- theme_advanced_statusbar_location : "bottom",\r
- theme_advanced_resizing : true,\r
-\r
- // Example word content CSS (should be your site CSS) this one removes paragraph margins\r
- content_css : "css/word.css",\r
-\r
- // Drop lists for link/image/media/template dialogs\r
- template_external_list_url : "lists/template_list.js",\r
- external_link_list_url : "lists/link_list.js",\r
- external_image_list_url : "lists/image_list.js",\r
- media_external_list_url : "lists/media_list.js",\r
-\r
- // Replace values for the template plugin\r
- template_replace_values : {\r
- username : "Some User",\r
- staffid : "991234"\r
- }\r
- });\r
-</script>\r
-<!-- /TinyMCE -->\r
-\r
-</head>\r
-<body>\r
-\r
-<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">\r
- <h3>Word processor example</h3>\r
-\r
- <p>\r
- This page shows you how to configure TinyMCE to work more like common word processors.\r
- There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.\r
- </p>\r
-\r
- <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->\r
- <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">\r
- <p>This is the first paragraph.</p>\r
- <p>This is the second paragraph.</p>\r
- <p>This is the third paragraph.</p>\r
- </textarea>\r
-\r
- <br />\r
- <input type="submit" name="save" value="Submit" />\r
- <input type="reset" name="reset" value="Reset" />\r
-</form>\r
-<script type="text/javascript">\r
-if (document.location.protocol == 'file:') {\r
- alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");\r
-}\r
-</script>\r
-</body>\r
-</html>\r
+++ /dev/null
-tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"},visualblocks:{desc:'Show/hide block elements'}}});
\ No newline at end of file
+++ /dev/null
- GNU LESSER GENERAL PUBLIC LICENSE\r
- Version 2.1, February 1999\r
-\r
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-[This is the first released version of the Lesser GPL. It also counts\r
- as the successor of the GNU Library Public License, version 2, hence\r
- the version number 2.1.]\r
-\r
- Preamble\r
-\r
- The licenses for most software are designed to take away your\r
-freedom to share and change it. By contrast, the GNU General Public\r
-Licenses are intended to guarantee your freedom to share and change\r
-free software--to make sure the software is free for all its users.\r
-\r
- This license, the Lesser General Public License, applies to some\r
-specially designated software packages--typically libraries--of the\r
-Free Software Foundation and other authors who decide to use it. You\r
-can use it too, but we suggest you first think carefully about whether\r
-this license or the ordinary General Public License is the better\r
-strategy to use in any particular case, based on the explanations below.\r
-\r
- When we speak of free software, we are referring to freedom of use,\r
-not price. Our General Public Licenses are designed to make sure that\r
-you have the freedom to distribute copies of free software (and charge\r
-for this service if you wish); that you receive source code or can get\r
-it if you want it; that you can change the software and use pieces of\r
-it in new free programs; and that you are informed that you can do\r
-these things.\r
-\r
- To protect your rights, we need to make restrictions that forbid\r
-distributors to deny you these rights or to ask you to surrender these\r
-rights. These restrictions translate to certain responsibilities for\r
-you if you distribute copies of the library or if you modify it.\r
-\r
- For example, if you distribute copies of the library, whether gratis\r
-or for a fee, you must give the recipients all the rights that we gave\r
-you. You must make sure that they, too, receive or can get the source\r
-code. If you link other code with the library, you must provide\r
-complete object files to the recipients, so that they can relink them\r
-with the library after making changes to the library and recompiling\r
-it. And you must show them these terms so they know their rights.\r
-\r
- We protect your rights with a two-step method: (1) we copyright the\r
-library, and (2) we offer you this license, which gives you legal\r
-permission to copy, distribute and/or modify the library.\r
-\r
- To protect each distributor, we want to make it very clear that\r
-there is no warranty for the free library. Also, if the library is\r
-modified by someone else and passed on, the recipients should know\r
-that what they have is not the original version, so that the original\r
-author's reputation will not be affected by problems that might be\r
-introduced by others.\r
-\r
- Finally, software patents pose a constant threat to the existence of\r
-any free program. We wish to make sure that a company cannot\r
-effectively restrict the users of a free program by obtaining a\r
-restrictive license from a patent holder. Therefore, we insist that\r
-any patent license obtained for a version of the library must be\r
-consistent with the full freedom of use specified in this license.\r
-\r
- Most GNU software, including some libraries, is covered by the\r
-ordinary GNU General Public License. This license, the GNU Lesser\r
-General Public License, applies to certain designated libraries, and\r
-is quite different from the ordinary General Public License. We use\r
-this license for certain libraries in order to permit linking those\r
-libraries into non-free programs.\r
-\r
- When a program is linked with a library, whether statically or using\r
-a shared library, the combination of the two is legally speaking a\r
-combined work, a derivative of the original library. The ordinary\r
-General Public License therefore permits such linking only if the\r
-entire combination fits its criteria of freedom. The Lesser General\r
-Public License permits more lax criteria for linking other code with\r
-the library.\r
-\r
- We call this license the "Lesser" General Public License because it\r
-does Less to protect the user's freedom than the ordinary General\r
-Public License. It also provides other free software developers Less\r
-of an advantage over competing non-free programs. These disadvantages\r
-are the reason we use the ordinary General Public License for many\r
-libraries. However, the Lesser license provides advantages in certain\r
-special circumstances.\r
-\r
- For example, on rare occasions, there may be a special need to\r
-encourage the widest possible use of a certain library, so that it becomes\r
-a de-facto standard. To achieve this, non-free programs must be\r
-allowed to use the library. A more frequent case is that a free\r
-library does the same job as widely used non-free libraries. In this\r
-case, there is little to gain by limiting the free library to free\r
-software only, so we use the Lesser General Public License.\r
-\r
- In other cases, permission to use a particular library in non-free\r
-programs enables a greater number of people to use a large body of\r
-free software. For example, permission to use the GNU C Library in\r
-non-free programs enables many more people to use the whole GNU\r
-operating system, as well as its variant, the GNU/Linux operating\r
-system.\r
-\r
- Although the Lesser General Public License is Less protective of the\r
-users' freedom, it does ensure that the user of a program that is\r
-linked with the Library has the freedom and the wherewithal to run\r
-that program using a modified version of the Library.\r
-\r
- The precise terms and conditions for copying, distribution and\r
-modification follow. Pay close attention to the difference between a\r
-"work based on the library" and a "work that uses the library". The\r
-former contains code derived from the library, whereas the latter must\r
-be combined with the library in order to run.\r
-\r
- GNU LESSER GENERAL PUBLIC LICENSE\r
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
- 0. This License Agreement applies to any software library or other\r
-program which contains a notice placed by the copyright holder or\r
-other authorized party saying it may be distributed under the terms of\r
-this Lesser General Public License (also called "this License").\r
-Each licensee is addressed as "you".\r
-\r
- A "library" means a collection of software functions and/or data\r
-prepared so as to be conveniently linked with application programs\r
-(which use some of those functions and data) to form executables.\r
-\r
- The "Library", below, refers to any such software library or work\r
-which has been distributed under these terms. A "work based on the\r
-Library" means either the Library or any derivative work under\r
-copyright law: that is to say, a work containing the Library or a\r
-portion of it, either verbatim or with modifications and/or translated\r
-straightforwardly into another language. (Hereinafter, translation is\r
-included without limitation in the term "modification".)\r
-\r
- "Source code" for a work means the preferred form of the work for\r
-making modifications to it. For a library, complete source code means\r
-all the source code for all modules it contains, plus any associated\r
-interface definition files, plus the scripts used to control compilation\r
-and installation of the library.\r
-\r
- Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope. The act of\r
-running a program using the Library is not restricted, and output from\r
-such a program is covered only if its contents constitute a work based\r
-on the Library (independent of the use of the Library in a tool for\r
-writing it). Whether that is true depends on what the Library does\r
-and what the program that uses the Library does.\r
- \r
- 1. You may copy and distribute verbatim copies of the Library's\r
-complete source code as you receive it, in any medium, provided that\r
-you conspicuously and appropriately publish on each copy an\r
-appropriate copyright notice and disclaimer of warranty; keep intact\r
-all the notices that refer to this License and to the absence of any\r
-warranty; and distribute a copy of this License along with the\r
-Library.\r
-\r
- You may charge a fee for the physical act of transferring a copy,\r
-and you may at your option offer warranty protection in exchange for a\r
-fee.\r
-\r
- 2. You may modify your copy or copies of the Library or any portion\r
-of it, thus forming a work based on the Library, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
- a) The modified work must itself be a software library.\r
-\r
- b) You must cause the files modified to carry prominent notices\r
- stating that you changed the files and the date of any change.\r
-\r
- c) You must cause the whole of the work to be licensed at no\r
- charge to all third parties under the terms of this License.\r
-\r
- d) If a facility in the modified Library refers to a function or a\r
- table of data to be supplied by an application program that uses\r
- the facility, other than as an argument passed when the facility\r
- is invoked, then you must make a good faith effort to ensure that,\r
- in the event an application does not supply such function or\r
- table, the facility still operates, and performs whatever part of\r
- its purpose remains meaningful.\r
-\r
- (For example, a function in a library to compute square roots has\r
- a purpose that is entirely well-defined independent of the\r
- application. Therefore, Subsection 2d requires that any\r
- application-supplied function or table used by this function must\r
- be optional: if the application does not supply it, the square\r
- root function must still compute square roots.)\r
-\r
-These requirements apply to the modified work as a whole. If\r
-identifiable sections of that work are not derived from the Library,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works. But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Library, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote\r
-it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Library.\r
-\r
-In addition, mere aggregation of another work not based on the Library\r
-with the Library (or with a work based on the Library) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
- 3. You may opt to apply the terms of the ordinary GNU General Public\r
-License instead of this License to a given copy of the Library. To do\r
-this, you must alter all the notices that refer to this License, so\r
-that they refer to the ordinary GNU General Public License, version 2,\r
-instead of to this License. (If a newer version than version 2 of the\r
-ordinary GNU General Public License has appeared, then you can specify\r
-that version instead if you wish.) Do not make any other change in\r
-these notices.\r
-\r
- Once this change is made in a given copy, it is irreversible for\r
-that copy, so the ordinary GNU General Public License applies to all\r
-subsequent copies and derivative works made from that copy.\r
-\r
- This option is useful when you wish to copy part of the code of\r
-the Library into a program that is not a library.\r
-\r
- 4. You may copy and distribute the Library (or a portion or\r
-derivative of it, under Section 2) in object code or executable form\r
-under the terms of Sections 1 and 2 above provided that you accompany\r
-it with the complete corresponding machine-readable source code, which\r
-must be distributed under the terms of Sections 1 and 2 above on a\r
-medium customarily used for software interchange.\r
-\r
- If distribution of object code is made by offering access to copy\r
-from a designated place, then offering equivalent access to copy the\r
-source code from the same place satisfies the requirement to\r
-distribute the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\r
- 5. A program that contains no derivative of any portion of the\r
-Library, but is designed to work with the Library by being compiled or\r
-linked with it, is called a "work that uses the Library". Such a\r
-work, in isolation, is not a derivative work of the Library, and\r
-therefore falls outside the scope of this License.\r
-\r
- However, linking a "work that uses the Library" with the Library\r
-creates an executable that is a derivative of the Library (because it\r
-contains portions of the Library), rather than a "work that uses the\r
-library". The executable is therefore covered by this License.\r
-Section 6 states terms for distribution of such executables.\r
-\r
- When a "work that uses the Library" uses material from a header file\r
-that is part of the Library, the object code for the work may be a\r
-derivative work of the Library even though the source code is not.\r
-Whether this is true is especially significant if the work can be\r
-linked without the Library, or if the work is itself a library. The\r
-threshold for this to be true is not precisely defined by law.\r
-\r
- If such an object file uses only numerical parameters, data\r
-structure layouts and accessors, and small macros and small inline\r
-functions (ten lines or less in length), then the use of the object\r
-file is unrestricted, regardless of whether it is legally a derivative\r
-work. (Executables containing this object code plus portions of the\r
-Library will still fall under Section 6.)\r
-\r
- Otherwise, if the work is a derivative of the Library, you may\r
-distribute the object code for the work under the terms of Section 6.\r
-Any executables containing that work also fall under Section 6,\r
-whether or not they are linked directly with the Library itself.\r
-\r
- 6. As an exception to the Sections above, you may also combine or\r
-link a "work that uses the Library" with the Library to produce a\r
-work containing portions of the Library, and distribute that work\r
-under terms of your choice, provided that the terms permit\r
-modification of the work for the customer's own use and reverse\r
-engineering for debugging such modifications.\r
-\r
- You must give prominent notice with each copy of the work that the\r
-Library is used in it and that the Library and its use are covered by\r
-this License. You must supply a copy of this License. If the work\r
-during execution displays copyright notices, you must include the\r
-copyright notice for the Library among them, as well as a reference\r
-directing the user to the copy of this License. Also, you must do one\r
-of these things:\r
-\r
- a) Accompany the work with the complete corresponding\r
- machine-readable source code for the Library including whatever\r
- changes were used in the work (which must be distributed under\r
- Sections 1 and 2 above); and, if the work is an executable linked\r
- with the Library, with the complete machine-readable "work that\r
- uses the Library", as object code and/or source code, so that the\r
- user can modify the Library and then relink to produce a modified\r
- executable containing the modified Library. (It is understood\r
- that the user who changes the contents of definitions files in the\r
- Library will not necessarily be able to recompile the application\r
- to use the modified definitions.)\r
-\r
- b) Use a suitable shared library mechanism for linking with the\r
- Library. A suitable mechanism is one that (1) uses at run time a\r
- copy of the library already present on the user's computer system,\r
- rather than copying library functions into the executable, and (2)\r
- will operate properly with a modified version of the library, if\r
- the user installs one, as long as the modified version is\r
- interface-compatible with the version that the work was made with.\r
-\r
- c) Accompany the work with a written offer, valid for at\r
- least three years, to give the same user the materials\r
- specified in Subsection 6a, above, for a charge no more\r
- than the cost of performing this distribution.\r
-\r
- d) If distribution of the work is made by offering access to copy\r
- from a designated place, offer equivalent access to copy the above\r
- specified materials from the same place.\r
-\r
- e) Verify that the user has already received a copy of these\r
- materials or that you have already sent this user a copy.\r
-\r
- For an executable, the required form of the "work that uses the\r
-Library" must include any data and utility programs needed for\r
-reproducing the executable from it. However, as a special exception,\r
-the materials to be distributed need not include anything that is\r
-normally distributed (in either source or binary form) with the major\r
-components (compiler, kernel, and so on) of the operating system on\r
-which the executable runs, unless that component itself accompanies\r
-the executable.\r
-\r
- It may happen that this requirement contradicts the license\r
-restrictions of other proprietary libraries that do not normally\r
-accompany the operating system. Such a contradiction means you cannot\r
-use both them and the Library together in an executable that you\r
-distribute.\r
-\r
- 7. You may place library facilities that are a work based on the\r
-Library side-by-side in a single library together with other library\r
-facilities not covered by this License, and distribute such a combined\r
-library, provided that the separate distribution of the work based on\r
-the Library and of the other library facilities is otherwise\r
-permitted, and provided that you do these two things:\r
-\r
- a) Accompany the combined library with a copy of the same work\r
- based on the Library, uncombined with any other library\r
- facilities. This must be distributed under the terms of the\r
- Sections above.\r
-\r
- b) Give prominent notice with the combined library of the fact\r
- that part of it is a work based on the Library, and explaining\r
- where to find the accompanying uncombined form of the same work.\r
-\r
- 8. You may not copy, modify, sublicense, link with, or distribute\r
-the Library except as expressly provided under this License. Any\r
-attempt otherwise to copy, modify, sublicense, link with, or\r
-distribute the Library is void, and will automatically terminate your\r
-rights under this License. However, parties who have received copies,\r
-or rights, from you under this License will not have their licenses\r
-terminated so long as such parties remain in full compliance.\r
-\r
- 9. You are not required to accept this License, since you have not\r
-signed it. However, nothing else grants you permission to modify or\r
-distribute the Library or its derivative works. These actions are\r
-prohibited by law if you do not accept this License. Therefore, by\r
-modifying or distributing the Library (or any work based on the\r
-Library), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Library or works based on it.\r
-\r
- 10. Each time you redistribute the Library (or any work based on the\r
-Library), the recipient automatically receives a license from the\r
-original licensor to copy, distribute, link with or modify the Library\r
-subject to these terms and conditions. You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties with\r
-this License.\r
-\r
- 11. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License. If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Library at all. For example, if a patent\r
-license would not permit royalty-free redistribution of the Library by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Library.\r
-\r
-If any portion of this section is held invalid or unenforceable under any\r
-particular circumstance, the balance of the section is intended to apply,\r
-and the section as a whole is intended to apply in other circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system which is\r
-implemented by public license practices. Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\r
- 12. If the distribution and/or use of the Library is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Library under this License may add\r
-an explicit geographical distribution limitation excluding those countries,\r
-so that distribution is permitted only in or among countries not thus\r
-excluded. In such case, this License incorporates the limitation as if\r
-written in the body of this License.\r
-\r
- 13. The Free Software Foundation may publish revised and/or new\r
-versions of the Lesser General Public License from time to time.\r
-Such new versions will be similar in spirit to the present version,\r
-but may differ in detail to address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number. If the Library\r
-specifies a version number of this License which applies to it and\r
-"any later version", you have the option of following the terms and\r
-conditions either of that version or of any later version published by\r
-the Free Software Foundation. If the Library does not specify a\r
-license version number, you may choose any version ever published by\r
-the Free Software Foundation.\r
-\r
- 14. If you wish to incorporate parts of the Library into other free\r
-programs whose distribution conditions are incompatible with these,\r
-write to the author to ask for permission. For software which is\r
-copyrighted by the Free Software Foundation, write to the Free\r
-Software Foundation; we sometimes make exceptions for this. Our\r
-decision will be guided by the two goals of preserving the free status\r
-of all derivatives of our free software and of promoting the sharing\r
-and reuse of software generally.\r
-\r
- NO WARRANTY\r
-\r
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
-\r
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
-DAMAGES.\r
-\r
- END OF TERMS AND CONDITIONS\r
-\r
- How to Apply These Terms to Your New Libraries\r
-\r
- If you develop a new library, and you want it to be of the greatest\r
-possible use to the public, we recommend making it free software that\r
-everyone can redistribute and change. You can do so by permitting\r
-redistribution under these terms (or, alternatively, under the terms of the\r
-ordinary General Public License).\r
-\r
- To apply these terms, attach the following notices to the library. It is\r
-safest to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least the\r
-"copyright" line and a pointer to where the full notice is found.\r
-\r
- <one line to give the library's name and a brief idea of what it does.>\r
- Copyright (C) <year> <name of author>\r
-\r
- This library is free software; you can redistribute it and/or\r
- modify it under the terms of the GNU Lesser General Public\r
- License as published by the Free Software Foundation; either\r
- version 2.1 of the License, or (at your option) any later version.\r
-\r
- This library is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- Lesser General Public License for more details.\r
-\r
- You should have received a copy of the GNU Lesser General Public\r
- License along with this library; if not, write to the Free Software\r
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the library, if\r
-necessary. Here is a sample; alter the names:\r
-\r
- Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
-\r
- <signature of Ty Coon>, 1 April 1990\r
- Ty Coon, President of Vice\r
-\r
-That's all there is to it!\r
-\r
-\r
+++ /dev/null
-input.radio {border:1px none #000; background:transparent; vertical-align:middle;}\r
-.panel_wrapper div.current {height:80px;}\r
-#width {width:50px; vertical-align:middle;}\r
-#width2 {width:50px; vertical-align:middle;}\r
-#size {width:100px;}\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.AdvancedHRPlugin', {\r
- init : function(ed, url) {\r
- // Register commands\r
- ed.addCommand('mceAdvancedHr', function() {\r
- ed.windowManager.open({\r
- file : url + '/rule.htm',\r
- width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),\r
- height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('advhr', {\r
- title : 'advhr.advhr_desc',\r
- cmd : 'mceAdvancedHr'\r
- });\r
-\r
- ed.onNodeChange.add(function(ed, cm, n) {\r
- cm.setActive('advhr', n.nodeName == 'HR');\r
- });\r
-\r
- ed.onClick.add(function(ed, e) {\r
- e = e.target;\r
-\r
- if (e.nodeName === 'HR')\r
- ed.selection.select(e);\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Advanced HR',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-var AdvHRDialog = {\r
- init : function(ed) {\r
- var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;\r
-\r
- w = dom.getAttrib(n, 'width');\r
- f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');\r
- f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';\r
- f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');\r
- selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');\r
- },\r
-\r
- update : function() {\r
- var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';\r
-\r
- h = '<hr';\r
-\r
- if (f.size.value) {\r
- h += ' size="' + f.size.value + '"';\r
- st += ' height:' + f.size.value + 'px;';\r
- }\r
-\r
- if (f.width.value) {\r
- h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';\r
- st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';\r
- }\r
-\r
- if (f.noshade.checked) {\r
- h += ' noshade="noshade"';\r
- st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';\r
- }\r
-\r
- if (ed.settings.inline_styles)\r
- h += ' style="' + tinymce.trim(st) + '"';\r
-\r
- h += ' />';\r
-\r
- ed.execCommand("mceInsertContent", false, h);\r
- tinyMCEPopup.close();\r
- }\r
-};\r
-\r
-tinyMCEPopup.requireLangPack();\r
-tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);\r
+++ /dev/null
-tinyMCE.addI18n('en.advhr_dlg',{size:"Height",noshade:"No Shadow",width:"Width",normal:"Normal",widthunits:"Units"});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advhr.advhr_desc}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/rule.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <link href="css/advhr.css" rel="stylesheet" type="text/css" />\r
-</head>\r
-<body role="application">\r
-<form onsubmit="AdvHRDialog.update();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr role="group" aria-labelledby="width_label">\r
- <td><label id="width_label" for="width">{#advhr_dlg.width}</label></td>\r
- <td class="nowrap">\r
- <input id="width" name="width" type="text" value="" class="mceFocus" />\r
- <span style="display:none;" id="width_unit_label">{#advhr_dlg.widthunits}</span>\r
- <select name="width2" id="width2" aria-labelledby="width_unit_label">\r
- <option value="">px</option>\r
- <option value="%">%</option>\r
- </select>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td><label for="size">{#advhr_dlg.size}</label></td>\r
- <td><select id="size" name="size">\r
- <option value="">{#advhr_dlg.normal}</option>\r
- <option value="1">1</option>\r
- <option value="2">2</option>\r
- <option value="3">3</option>\r
- <option value="4">4</option>\r
- <option value="5">5</option>\r
- </select></td>\r
- </tr>\r
- <tr>\r
- <td><label for="noshade">{#advhr_dlg.noshade}</label></td>\r
- <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>\r
- </tr>\r
- </table>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-#src_list, #over_list, #out_list {width:280px;}\r
-.mceActionPanel {margin-top:7px;}\r
-.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}\r
-.checkbox {border:0;}\r
-.panel_wrapper div.current {height:305px;}\r
-#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}\r
-#align, #classlist {width:150px;}\r
-#width, #height {vertical-align:middle; width:50px; text-align:center;}\r
-#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}\r
-#class_list {width:180px;}\r
-input {width: 280px;}\r
-#constrain, #onmousemovecheck {width:auto;}\r
-#id, #dir, #lang, #usemap, #longdesc {width:200px;}\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.AdvancedImagePlugin', {\r
- init : function(ed, url) {\r
- // Register commands\r
- ed.addCommand('mceAdvImage', function() {\r
- // Internal image object like a flash placeholder\r
- if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)\r
- return;\r
-\r
- ed.windowManager.open({\r
- file : url + '/image.htm',\r
- width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),\r
- height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('image', {\r
- title : 'advimage.image_desc',\r
- cmd : 'mceAdvImage'\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Advanced image',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advimage_dlg.dialog_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/validate.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="js/image.js"></script>\r
- <link href="css/advimage.css" rel="stylesheet" type="text/css" />\r
-</head>\r
-<body id="advimage" style="display: none" role="application" aria-labelledby="app_title">\r
- <span id="app_title" style="display:none">{#advimage_dlg.dialog_title}</span>\r
- <form onsubmit="ImageDialog.insert();return false;" action="#"> \r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>\r
- <li id="appearance_tab" aria-controls="appearance_panel"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>\r
- <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#advimage_dlg.general}</legend>\r
-\r
- <table role="presentation" class="properties">\r
- <tr>\r
- <td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>\r
- <td colspan="2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr> \r
- <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" aria-required="true" /></td> \r
- <td id="srcbrowsercontainer"> </td>\r
- </tr>\r
- </table></td>\r
- </tr>\r
- <tr>\r
- <td><label for="src_list">{#advimage_dlg.image_list}</label></td>\r
- <td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>\r
- </tr>\r
- <tr> \r
- <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td> \r
- <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td> \r
- </tr> \r
- <tr> \r
- <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td> \r
- <td colspan="2"><input id="title" name="title" type="text" value="" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset>\r
- <legend>{#advimage_dlg.preview}</legend>\r
- <div id="prev"></div>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="appearance_panel" class="panel">\r
- <fieldset>\r
- <legend>{#advimage_dlg.tab_appearance}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr> \r
- <td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td> \r
- <td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();"> \r
- <option value="">{#not_set}</option> \r
- <option value="baseline">{#advimage_dlg.align_baseline}</option>\r
- <option value="top">{#advimage_dlg.align_top}</option>\r
- <option value="middle">{#advimage_dlg.align_middle}</option>\r
- <option value="bottom">{#advimage_dlg.align_bottom}</option>\r
- <option value="text-top">{#advimage_dlg.align_texttop}</option>\r
- <option value="text-bottom">{#advimage_dlg.align_textbottom}</option>\r
- <option value="left">{#advimage_dlg.align_left}</option>\r
- <option value="right">{#advimage_dlg.align_right}</option>\r
- </select> \r
- </td>\r
- <td rowspan="6" valign="top">\r
- <div class="alignPreview">\r
- <img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />\r
- Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam\r
- nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum\r
- edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam\r
- erat volutpat.\r
- </div>\r
- </td>\r
- </tr>\r
-\r
- <tr role="group" aria-labelledby="widthlabel">\r
- <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>\r
- <td class="nowrap">\r
- <span style="display:none" id="width_voiceLabel">{#advimage_dlg.width}</span>\r
- <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" aria-labelledby="width_voiceLabel" /> x \r
- <span style="display:none" id="height_voiceLabel">{#advimage_dlg.height}</span>\r
- <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" aria-labelledby="height_voiceLabel" /> px\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td> </td>\r
- <td><table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>\r
- <td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>\r
- </tr>\r
- </table></td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td> \r
- <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />\r
- </td>\r
- </tr>\r
-\r
- <tr> \r
- <td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td> \r
- <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td> \r
- <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td><label for="class_list">{#class_name}</label></td>\r
- <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td> \r
- <td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td> \r
- </tr>\r
-\r
- <!-- <tr>\r
- <td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td> \r
- <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> \r
- </tr> -->\r
- </table>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="advanced_panel" class="panel">\r
- <fieldset>\r
- <legend>{#advimage_dlg.swap_image}</legend>\r
-\r
- <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" aria-controls="onmouseoversrc onmouseoutsrc" />\r
- <label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">\r
- <tr>\r
- <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td> \r
- <td><table role="presentation" border="0" cellspacing="0" cellpadding="0"> \r
- <tr> \r
- <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td> \r
- <td id="onmouseoversrccontainer"> </td>\r
- </tr>\r
- </table></td>\r
- </tr>\r
- <tr>\r
- <td><label for="over_list">{#advimage_dlg.image_list}</label></td>\r
- <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>\r
- </tr>\r
- <tr> \r
- <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td> \r
- <td class="column2"><table role="presentation" border="0" cellspacing="0" cellpadding="0"> \r
- <tr> \r
- <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td> \r
- <td id="onmouseoutsrccontainer"> </td>\r
- </tr> \r
- </table></td> \r
- </tr>\r
- <tr>\r
- <td><label for="out_list">{#advimage_dlg.image_list}</label></td>\r
- <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset>\r
- <legend>{#advimage_dlg.misc}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td> \r
- <td><input id="id" name="id" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td> \r
- <td>\r
- <select id="dir" name="dir" onchange="ImageDialog.changeAppearance();"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#advimage_dlg.ltr}</option> \r
- <option value="rtl">{#advimage_dlg.rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" />\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td> \r
- <td>\r
- <input id="usemap" name="usemap" type="text" value="" />\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>\r
- <td><table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input id="longdesc" name="longdesc" type="text" value="" /></td>\r
- <td id="longdesccontainer"> </td>\r
- </tr>\r
- </table></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
- </form>\r
-</body> \r
-</html> \r
+++ /dev/null
-var ImageDialog = {\r
- preInit : function() {\r
- var url;\r
-\r
- tinyMCEPopup.requireLangPack();\r
-\r
- if (url = tinyMCEPopup.getParam("external_image_list_url"))\r
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
- },\r
-\r
- init : function(ed) {\r
- var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList');\r
-\r
- tinyMCEPopup.resizeToInnerSize();\r
- this.fillClassList('class_list');\r
- this.fillFileList('src_list', fl);\r
- this.fillFileList('over_list', fl);\r
- this.fillFileList('out_list', fl);\r
- TinyMCE_EditableSelects.init();\r
-\r
- if (n.nodeName == 'IMG') {\r
- nl.src.value = dom.getAttrib(n, 'src');\r
- nl.width.value = dom.getAttrib(n, 'width');\r
- nl.height.value = dom.getAttrib(n, 'height');\r
- nl.alt.value = dom.getAttrib(n, 'alt');\r
- nl.title.value = dom.getAttrib(n, 'title');\r
- nl.vspace.value = this.getAttrib(n, 'vspace');\r
- nl.hspace.value = this.getAttrib(n, 'hspace');\r
- nl.border.value = this.getAttrib(n, 'border');\r
- selectByValue(f, 'align', this.getAttrib(n, 'align'));\r
- selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);\r
- nl.style.value = dom.getAttrib(n, 'style');\r
- nl.id.value = dom.getAttrib(n, 'id');\r
- nl.dir.value = dom.getAttrib(n, 'dir');\r
- nl.lang.value = dom.getAttrib(n, 'lang');\r
- nl.usemap.value = dom.getAttrib(n, 'usemap');\r
- nl.longdesc.value = dom.getAttrib(n, 'longdesc');\r
- nl.insert.value = ed.getLang('update');\r
-\r
- if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))\r
- nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');\r
-\r
- if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))\r
- nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');\r
-\r
- if (ed.settings.inline_styles) {\r
- // Move attribs to styles\r
- if (dom.getAttrib(n, 'align'))\r
- this.updateStyle('align');\r
-\r
- if (dom.getAttrib(n, 'hspace'))\r
- this.updateStyle('hspace');\r
-\r
- if (dom.getAttrib(n, 'border'))\r
- this.updateStyle('border');\r
-\r
- if (dom.getAttrib(n, 'vspace'))\r
- this.updateStyle('vspace');\r
- }\r
- }\r
-\r
- // Setup browse button\r
- document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');\r
- if (isVisible('srcbrowser'))\r
- document.getElementById('src').style.width = '260px';\r
-\r
- // Setup browse button\r
- document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');\r
- if (isVisible('overbrowser'))\r
- document.getElementById('onmouseoversrc').style.width = '260px';\r
-\r
- // Setup browse button\r
- document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');\r
- if (isVisible('outbrowser'))\r
- document.getElementById('onmouseoutsrc').style.width = '260px';\r
-\r
- // If option enabled default contrain proportions to checked\r
- if (ed.getParam("advimage_constrain_proportions", true))\r
- f.constrain.checked = true;\r
-\r
- // Check swap image if valid data\r
- if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)\r
- this.setSwapImage(true);\r
- else\r
- this.setSwapImage(false);\r
-\r
- this.changeAppearance();\r
- this.showPreviewImage(nl.src.value, 1);\r
- },\r
-\r
- insert : function(file, title) {\r
- var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];\r
-\r
- if (f.src.value === '') {\r
- if (ed.selection.getNode().nodeName == 'IMG') {\r
- ed.dom.remove(ed.selection.getNode());\r
- ed.execCommand('mceRepaint');\r
- }\r
-\r
- tinyMCEPopup.close();\r
- return;\r
- }\r
-\r
- if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {\r
- if (!f.alt.value) {\r
- tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {\r
- if (s)\r
- t.insertAndClose();\r
- });\r
-\r
- return;\r
- }\r
- }\r
-\r
- t.insertAndClose();\r
- },\r
-\r
- insertAndClose : function() {\r
- var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;\r
-\r
- tinyMCEPopup.restoreSelection();\r
-\r
- // Fixes crash in Safari\r
- if (tinymce.isWebKit)\r
- ed.getWin().focus();\r
-\r
- if (!ed.settings.inline_styles) {\r
- args = {\r
- vspace : nl.vspace.value,\r
- hspace : nl.hspace.value,\r
- border : nl.border.value,\r
- align : getSelectValue(f, 'align')\r
- };\r
- } else {\r
- // Remove deprecated values\r
- args = {\r
- vspace : '',\r
- hspace : '',\r
- border : '',\r
- align : ''\r
- };\r
- }\r
-\r
- tinymce.extend(args, {\r
- src : nl.src.value.replace(/ /g, '%20'),\r
- width : nl.width.value,\r
- height : nl.height.value,\r
- alt : nl.alt.value,\r
- title : nl.title.value,\r
- 'class' : getSelectValue(f, 'class_list'),\r
- style : nl.style.value,\r
- id : nl.id.value,\r
- dir : nl.dir.value,\r
- lang : nl.lang.value,\r
- usemap : nl.usemap.value,\r
- longdesc : nl.longdesc.value\r
- });\r
-\r
- args.onmouseover = args.onmouseout = '';\r
-\r
- if (f.onmousemovecheck.checked) {\r
- if (nl.onmouseoversrc.value)\r
- args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";\r
-\r
- if (nl.onmouseoutsrc.value)\r
- args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";\r
- }\r
-\r
- el = ed.selection.getNode();\r
-\r
- if (el && el.nodeName == 'IMG') {\r
- ed.dom.setAttribs(el, args);\r
- } else {\r
- tinymce.each(args, function(value, name) {\r
- if (value === "") {\r
- delete args[name];\r
- }\r
- });\r
-\r
- ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});\r
- ed.undoManager.add();\r
- }\r
-\r
- tinyMCEPopup.editor.execCommand('mceRepaint');\r
- tinyMCEPopup.editor.focus();\r
- tinyMCEPopup.close();\r
- },\r
-\r
- getAttrib : function(e, at) {\r
- var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;\r
-\r
- if (ed.settings.inline_styles) {\r
- switch (at) {\r
- case 'align':\r
- if (v = dom.getStyle(e, 'float'))\r
- return v;\r
-\r
- if (v = dom.getStyle(e, 'vertical-align'))\r
- return v;\r
-\r
- break;\r
-\r
- case 'hspace':\r
- v = dom.getStyle(e, 'margin-left')\r
- v2 = dom.getStyle(e, 'margin-right');\r
-\r
- if (v && v == v2)\r
- return parseInt(v.replace(/[^0-9]/g, ''));\r
-\r
- break;\r
-\r
- case 'vspace':\r
- v = dom.getStyle(e, 'margin-top')\r
- v2 = dom.getStyle(e, 'margin-bottom');\r
- if (v && v == v2)\r
- return parseInt(v.replace(/[^0-9]/g, ''));\r
-\r
- break;\r
-\r
- case 'border':\r
- v = 0;\r
-\r
- tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {\r
- sv = dom.getStyle(e, 'border-' + sv + '-width');\r
-\r
- // False or not the same as prev\r
- if (!sv || (sv != v && v !== 0)) {\r
- v = 0;\r
- return false;\r
- }\r
-\r
- if (sv)\r
- v = sv;\r
- });\r
-\r
- if (v)\r
- return parseInt(v.replace(/[^0-9]/g, ''));\r
-\r
- break;\r
- }\r
- }\r
-\r
- if (v = dom.getAttrib(e, at))\r
- return v;\r
-\r
- return '';\r
- },\r
-\r
- setSwapImage : function(st) {\r
- var f = document.forms[0];\r
-\r
- f.onmousemovecheck.checked = st;\r
- setBrowserDisabled('overbrowser', !st);\r
- setBrowserDisabled('outbrowser', !st);\r
-\r
- if (f.over_list)\r
- f.over_list.disabled = !st;\r
-\r
- if (f.out_list)\r
- f.out_list.disabled = !st;\r
-\r
- f.onmouseoversrc.disabled = !st;\r
- f.onmouseoutsrc.disabled = !st;\r
- },\r
-\r
- fillClassList : function(id) {\r
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
-\r
- if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {\r
- cl = [];\r
-\r
- tinymce.each(v.split(';'), function(v) {\r
- var p = v.split('=');\r
-\r
- cl.push({'title' : p[0], 'class' : p[1]});\r
- });\r
- } else\r
- cl = tinyMCEPopup.editor.dom.getClasses();\r
-\r
- if (cl.length > 0) {\r
- lst.options.length = 0;\r
- lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
-\r
- tinymce.each(cl, function(o) {\r
- lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);\r
- });\r
- } else\r
- dom.remove(dom.getParent(id, 'tr'));\r
- },\r
-\r
- fillFileList : function(id, l) {\r
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
-\r
- l = typeof(l) === 'function' ? l() : window[l];\r
- lst.options.length = 0;\r
-\r
- if (l && l.length > 0) {\r
- lst.options[lst.options.length] = new Option('', '');\r
-\r
- tinymce.each(l, function(o) {\r
- lst.options[lst.options.length] = new Option(o[0], o[1]);\r
- });\r
- } else\r
- dom.remove(dom.getParent(id, 'tr'));\r
- },\r
-\r
- resetImageData : function() {\r
- var f = document.forms[0];\r
-\r
- f.elements.width.value = f.elements.height.value = '';\r
- },\r
-\r
- updateImageData : function(img, st) {\r
- var f = document.forms[0];\r
-\r
- if (!st) {\r
- f.elements.width.value = img.width;\r
- f.elements.height.value = img.height;\r
- }\r
-\r
- this.preloadImg = img;\r
- },\r
-\r
- changeAppearance : function() {\r
- var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');\r
-\r
- if (img) {\r
- if (ed.getParam('inline_styles')) {\r
- ed.dom.setAttrib(img, 'style', f.style.value);\r
- } else {\r
- img.align = f.align.value;\r
- img.border = f.border.value;\r
- img.hspace = f.hspace.value;\r
- img.vspace = f.vspace.value;\r
- }\r
- }\r
- },\r
-\r
- changeHeight : function() {\r
- var f = document.forms[0], tp, t = this;\r
-\r
- if (!f.constrain.checked || !t.preloadImg) {\r
- return;\r
- }\r
-\r
- if (f.width.value == "" || f.height.value == "")\r
- return;\r
-\r
- tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;\r
- f.height.value = tp.toFixed(0);\r
- },\r
-\r
- changeWidth : function() {\r
- var f = document.forms[0], tp, t = this;\r
-\r
- if (!f.constrain.checked || !t.preloadImg) {\r
- return;\r
- }\r
-\r
- if (f.width.value == "" || f.height.value == "")\r
- return;\r
-\r
- tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;\r
- f.width.value = tp.toFixed(0);\r
- },\r
-\r
- updateStyle : function(ty) {\r
- var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});\r
-\r
- if (tinyMCEPopup.editor.settings.inline_styles) {\r
- // Handle align\r
- if (ty == 'align') {\r
- dom.setStyle(img, 'float', '');\r
- dom.setStyle(img, 'vertical-align', '');\r
-\r
- v = getSelectValue(f, 'align');\r
- if (v) {\r
- if (v == 'left' || v == 'right')\r
- dom.setStyle(img, 'float', v);\r
- else\r
- img.style.verticalAlign = v;\r
- }\r
- }\r
-\r
- // Handle border\r
- if (ty == 'border') {\r
- b = img.style.border ? img.style.border.split(' ') : [];\r
- bStyle = dom.getStyle(img, 'border-style');\r
- bColor = dom.getStyle(img, 'border-color');\r
-\r
- dom.setStyle(img, 'border', '');\r
-\r
- v = f.border.value;\r
- if (v || v == '0') {\r
- if (v == '0')\r
- img.style.border = isIE ? '0' : '0 none none';\r
- else {\r
- var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9);\r
-\r
- if (b.length == 3 && b[isOldIE ? 2 : 1])\r
- bStyle = b[isOldIE ? 2 : 1];\r
- else if (!bStyle || bStyle == 'none')\r
- bStyle = 'solid';\r
- if (b.length == 3 && b[isIE ? 0 : 2])\r
- bColor = b[isOldIE ? 0 : 2];\r
- else if (!bColor || bColor == 'none')\r
- bColor = 'black';\r
- img.style.border = v + 'px ' + bStyle + ' ' + bColor;\r
- }\r
- }\r
- }\r
-\r
- // Handle hspace\r
- if (ty == 'hspace') {\r
- dom.setStyle(img, 'marginLeft', '');\r
- dom.setStyle(img, 'marginRight', '');\r
-\r
- v = f.hspace.value;\r
- if (v) {\r
- img.style.marginLeft = v + 'px';\r
- img.style.marginRight = v + 'px';\r
- }\r
- }\r
-\r
- // Handle vspace\r
- if (ty == 'vspace') {\r
- dom.setStyle(img, 'marginTop', '');\r
- dom.setStyle(img, 'marginBottom', '');\r
-\r
- v = f.vspace.value;\r
- if (v) {\r
- img.style.marginTop = v + 'px';\r
- img.style.marginBottom = v + 'px';\r
- }\r
- }\r
-\r
- // Merge\r
- dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img');\r
- }\r
- },\r
-\r
- changeMouseMove : function() {\r
- },\r
-\r
- showPreviewImage : function(u, st) {\r
- if (!u) {\r
- tinyMCEPopup.dom.setHTML('prev', '');\r
- return;\r
- }\r
-\r
- if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))\r
- this.resetImageData();\r
-\r
- u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);\r
-\r
- if (!st)\r
- tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');\r
- else\r
- tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');\r
- }\r
-};\r
-\r
-ImageDialog.preInit();\r
-tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);\r
+++ /dev/null
-tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"});
\ No newline at end of file
+++ /dev/null
-.mceLinkList, .mceAnchorList, #targetlist {width:280px;}\r
-.mceActionPanel {margin-top:7px;}\r
-.panel_wrapper div.current {height:320px;}\r
-#classlist, #title, #href {width:280px;}\r
-#popupurl, #popupname {width:200px;}\r
-#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}\r
-#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}\r
-#events_panel input {width:200px;}\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {\r
- init : function(ed, url) {\r
- this.editor = ed;\r
-\r
- // Register commands\r
- ed.addCommand('mceAdvLink', function() {\r
- var se = ed.selection;\r
-\r
- // No selection and not in link\r
- if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))\r
- return;\r
-\r
- ed.windowManager.open({\r
- file : url + '/link.htm',\r
- width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),\r
- height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('link', {\r
- title : 'advlink.link_desc',\r
- cmd : 'mceAdvLink'\r
- });\r
-\r
- ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');\r
-\r
- ed.onNodeChange.add(function(ed, cm, n, co) {\r
- cm.setDisabled('link', co && n.nodeName != 'A');\r
- cm.setActive('link', n.nodeName == 'A' && !n.name);\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Advanced link',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-/* Functions for the advlink plugin popup */\r
-\r
-tinyMCEPopup.requireLangPack();\r
-\r
-var templates = {\r
- "window.open" : "window.open('${url}','${target}','${options}')"\r
-};\r
-\r
-function preinit() {\r
- var url;\r
-\r
- if (url = tinyMCEPopup.getParam("external_link_list_url"))\r
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
-}\r
-\r
-function changeClass() {\r
- var f = document.forms[0];\r
-\r
- f.classes.value = getSelectValue(f, 'classlist');\r
-}\r
-\r
-function init() {\r
- tinyMCEPopup.resizeToInnerSize();\r
-\r
- var formObj = document.forms[0];\r
- var inst = tinyMCEPopup.editor;\r
- var elm = inst.selection.getNode();\r
- var action = "insert";\r
- var html;\r
-\r
- document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');\r
- document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');\r
- document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');\r
-\r
- // Link list\r
- html = getLinkListHTML('linklisthref','href');\r
- if (html == "")\r
- document.getElementById("linklisthrefrow").style.display = 'none';\r
- else\r
- document.getElementById("linklisthrefcontainer").innerHTML = html;\r
-\r
- // Anchor list\r
- html = getAnchorListHTML('anchorlist','href');\r
- if (html == "")\r
- document.getElementById("anchorlistrow").style.display = 'none';\r
- else\r
- document.getElementById("anchorlistcontainer").innerHTML = html;\r
-\r
- // Resize some elements\r
- if (isVisible('hrefbrowser'))\r
- document.getElementById('href').style.width = '260px';\r
-\r
- if (isVisible('popupurlbrowser'))\r
- document.getElementById('popupurl').style.width = '180px';\r
-\r
- elm = inst.dom.getParent(elm, "A");\r
- if (elm == null) {\r
- var prospect = inst.dom.create("p", null, inst.selection.getContent());\r
- if (prospect.childNodes.length === 1) {\r
- elm = prospect.firstChild;\r
- }\r
- }\r
-\r
- if (elm != null && elm.nodeName == "A")\r
- action = "update";\r
-\r
- formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);\r
-\r
- setPopupControlsDisabled(true);\r
-\r
- if (action == "update") {\r
- var href = inst.dom.getAttrib(elm, 'href');\r
- var onclick = inst.dom.getAttrib(elm, 'onclick');\r
- var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self";\r
-\r
- // Setup form data\r
- setFormValue('href', href);\r
- setFormValue('title', inst.dom.getAttrib(elm, 'title'));\r
- setFormValue('id', inst.dom.getAttrib(elm, 'id'));\r
- setFormValue('style', inst.dom.getAttrib(elm, "style"));\r
- setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));\r
- setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));\r
- setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));\r
- setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));\r
- setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));\r
- setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));\r
- setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));\r
- setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));\r
- setFormValue('type', inst.dom.getAttrib(elm, 'type'));\r
- setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));\r
- setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));\r
- setFormValue('onclick', onclick);\r
- setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));\r
- setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));\r
- setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));\r
- setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));\r
- setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));\r
- setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));\r
- setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));\r
- setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));\r
- setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));\r
- setFormValue('target', linkTarget);\r
- setFormValue('classes', inst.dom.getAttrib(elm, 'class'));\r
-\r
- // Parse onclick data\r
- if (onclick != null && onclick.indexOf('window.open') != -1)\r
- parseWindowOpen(onclick);\r
- else\r
- parseFunction(onclick);\r
-\r
- // Select by the values\r
- selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));\r
- selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));\r
- selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));\r
- selectByValue(formObj, 'linklisthref', href);\r
-\r
- if (href.charAt(0) == '#')\r
- selectByValue(formObj, 'anchorlist', href);\r
-\r
- addClassesToList('classlist', 'advlink_styles');\r
-\r
- selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);\r
- selectByValue(formObj, 'targetlist', linkTarget, true);\r
- } else\r
- addClassesToList('classlist', 'advlink_styles');\r
-}\r
-\r
-function checkPrefix(n) {\r
- if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))\r
- n.value = 'mailto:' + n.value;\r
-\r
- if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))\r
- n.value = 'http://' + n.value;\r
-}\r
-\r
-function setFormValue(name, value) {\r
- document.forms[0].elements[name].value = value;\r
-}\r
-\r
-function parseWindowOpen(onclick) {\r
- var formObj = document.forms[0];\r
-\r
- // Preprocess center code\r
- if (onclick.indexOf('return false;') != -1) {\r
- formObj.popupreturn.checked = true;\r
- onclick = onclick.replace('return false;', '');\r
- } else\r
- formObj.popupreturn.checked = false;\r
-\r
- var onClickData = parseLink(onclick);\r
-\r
- if (onClickData != null) {\r
- formObj.ispopup.checked = true;\r
- setPopupControlsDisabled(false);\r
-\r
- var onClickWindowOptions = parseOptions(onClickData['options']);\r
- var url = onClickData['url'];\r
-\r
- formObj.popupname.value = onClickData['target'];\r
- formObj.popupurl.value = url;\r
- formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');\r
- formObj.popupheight.value = getOption(onClickWindowOptions, 'height');\r
-\r
- formObj.popupleft.value = getOption(onClickWindowOptions, 'left');\r
- formObj.popuptop.value = getOption(onClickWindowOptions, 'top');\r
-\r
- if (formObj.popupleft.value.indexOf('screen') != -1)\r
- formObj.popupleft.value = "c";\r
-\r
- if (formObj.popuptop.value.indexOf('screen') != -1)\r
- formObj.popuptop.value = "c";\r
-\r
- formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";\r
- formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";\r
- formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";\r
- formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";\r
- formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";\r
- formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";\r
- formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";\r
-\r
- buildOnClick();\r
- }\r
-}\r
-\r
-function parseFunction(onclick) {\r
- var formObj = document.forms[0];\r
- var onClickData = parseLink(onclick);\r
-\r
- // TODO: Add stuff here\r
-}\r
-\r
-function getOption(opts, name) {\r
- return typeof(opts[name]) == "undefined" ? "" : opts[name];\r
-}\r
-\r
-function setPopupControlsDisabled(state) {\r
- var formObj = document.forms[0];\r
-\r
- formObj.popupname.disabled = state;\r
- formObj.popupurl.disabled = state;\r
- formObj.popupwidth.disabled = state;\r
- formObj.popupheight.disabled = state;\r
- formObj.popupleft.disabled = state;\r
- formObj.popuptop.disabled = state;\r
- formObj.popuplocation.disabled = state;\r
- formObj.popupscrollbars.disabled = state;\r
- formObj.popupmenubar.disabled = state;\r
- formObj.popupresizable.disabled = state;\r
- formObj.popuptoolbar.disabled = state;\r
- formObj.popupstatus.disabled = state;\r
- formObj.popupreturn.disabled = state;\r
- formObj.popupdependent.disabled = state;\r
-\r
- setBrowserDisabled('popupurlbrowser', state);\r
-}\r
-\r
-function parseLink(link) {\r
- link = link.replace(new RegExp(''', 'g'), "'");\r
-\r
- var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");\r
-\r
- // Is function name a template function\r
- var template = templates[fnName];\r
- if (template) {\r
- // Build regexp\r
- var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));\r
- var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";\r
- var replaceStr = "";\r
- for (var i=0; i<variableNames.length; i++) {\r
- // Is string value\r
- if (variableNames[i].indexOf("'${") != -1)\r
- regExp += "'(.*)'";\r
- else // Number value\r
- regExp += "([0-9]*)";\r
-\r
- replaceStr += "$" + (i+1);\r
-\r
- // Cleanup variable name\r
- variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");\r
-\r
- if (i != variableNames.length-1) {\r
- regExp += "\\s*,\\s*";\r
- replaceStr += "<delim>";\r
- } else\r
- regExp += ".*";\r
- }\r
-\r
- regExp += "\\);?";\r
-\r
- // Build variable array\r
- var variables = [];\r
- variables["_function"] = fnName;\r
- var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');\r
- for (var i=0; i<variableNames.length; i++)\r
- variables[variableNames[i]] = variableValues[i];\r
-\r
- return variables;\r
- }\r
-\r
- return null;\r
-}\r
-\r
-function parseOptions(opts) {\r
- if (opts == null || opts == "")\r
- return [];\r
-\r
- // Cleanup the options\r
- opts = opts.toLowerCase();\r
- opts = opts.replace(/;/g, ",");\r
- opts = opts.replace(/[^0-9a-z=,]/g, "");\r
-\r
- var optionChunks = opts.split(',');\r
- var options = [];\r
-\r
- for (var i=0; i<optionChunks.length; i++) {\r
- var parts = optionChunks[i].split('=');\r
-\r
- if (parts.length == 2)\r
- options[parts[0]] = parts[1];\r
- }\r
-\r
- return options;\r
-}\r
-\r
-function buildOnClick() {\r
- var formObj = document.forms[0];\r
-\r
- if (!formObj.ispopup.checked) {\r
- formObj.onclick.value = "";\r
- return;\r
- }\r
-\r
- var onclick = "window.open('";\r
- var url = formObj.popupurl.value;\r
-\r
- onclick += url + "','";\r
- onclick += formObj.popupname.value + "','";\r
-\r
- if (formObj.popuplocation.checked)\r
- onclick += "location=yes,";\r
-\r
- if (formObj.popupscrollbars.checked)\r
- onclick += "scrollbars=yes,";\r
-\r
- if (formObj.popupmenubar.checked)\r
- onclick += "menubar=yes,";\r
-\r
- if (formObj.popupresizable.checked)\r
- onclick += "resizable=yes,";\r
-\r
- if (formObj.popuptoolbar.checked)\r
- onclick += "toolbar=yes,";\r
-\r
- if (formObj.popupstatus.checked)\r
- onclick += "status=yes,";\r
-\r
- if (formObj.popupdependent.checked)\r
- onclick += "dependent=yes,";\r
-\r
- if (formObj.popupwidth.value != "")\r
- onclick += "width=" + formObj.popupwidth.value + ",";\r
-\r
- if (formObj.popupheight.value != "")\r
- onclick += "height=" + formObj.popupheight.value + ",";\r
-\r
- if (formObj.popupleft.value != "") {\r
- if (formObj.popupleft.value != "c")\r
- onclick += "left=" + formObj.popupleft.value + ",";\r
- else\r
- onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";\r
- }\r
-\r
- if (formObj.popuptop.value != "") {\r
- if (formObj.popuptop.value != "c")\r
- onclick += "top=" + formObj.popuptop.value + ",";\r
- else\r
- onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";\r
- }\r
-\r
- if (onclick.charAt(onclick.length-1) == ',')\r
- onclick = onclick.substring(0, onclick.length-1);\r
-\r
- onclick += "');";\r
-\r
- if (formObj.popupreturn.checked)\r
- onclick += "return false;";\r
-\r
- // tinyMCE.debug(onclick);\r
-\r
- formObj.onclick.value = onclick;\r
-\r
- if (formObj.href.value == "")\r
- formObj.href.value = url;\r
-}\r
-\r
-function setAttrib(elm, attrib, value) {\r
- var formObj = document.forms[0];\r
- var valueElm = formObj.elements[attrib.toLowerCase()];\r
- var dom = tinyMCEPopup.editor.dom;\r
-\r
- if (typeof(value) == "undefined" || value == null) {\r
- value = "";\r
-\r
- if (valueElm)\r
- value = valueElm.value;\r
- }\r
-\r
- // Clean up the style\r
- if (attrib == 'style')\r
- value = dom.serializeStyle(dom.parseStyle(value), 'a');\r
-\r
- dom.setAttrib(elm, attrib, value);\r
-}\r
-\r
-function getAnchorListHTML(id, target) {\r
- var ed = tinyMCEPopup.editor, nodes = ed.dom.select('a'), name, i, len, html = "";\r
-\r
- for (i=0, len=nodes.length; i<len; i++) {\r
- if ((name = ed.dom.getAttrib(nodes[i], "name")) != "")\r
- html += '<option value="#' + name + '">' + name + '</option>';\r
-\r
- if ((name = nodes[i].id) != "" && !nodes[i].href)\r
- html += '<option value="#' + name + '">' + name + '</option>';\r
- }\r
-\r
- if (html == "")\r
- return "";\r
-\r
- html = '<select id="' + id + '" name="' + id + '" class="mceAnchorList"'\r
- + ' onchange="this.form.' + target + '.value=this.options[this.selectedIndex].value"'\r
- + '>'\r
- + '<option value="">---</option>'\r
- + html\r
- + '</select>';\r
-\r
- return html;\r
-}\r
-\r
-function insertAction() {\r
- var inst = tinyMCEPopup.editor;\r
- var elm, elementArray, i;\r
-\r
- elm = inst.selection.getNode();\r
- checkPrefix(document.forms[0].href);\r
-\r
- elm = inst.dom.getParent(elm, "A");\r
-\r
- // Remove element if there is no href\r
- if (!document.forms[0].href.value) {\r
- i = inst.selection.getBookmark();\r
- inst.dom.remove(elm, 1);\r
- inst.selection.moveToBookmark(i);\r
- tinyMCEPopup.execCommand("mceEndUndoLevel");\r
- tinyMCEPopup.close();\r
- return;\r
- }\r
-\r
- // Create new anchor elements\r
- if (elm == null) {\r
- inst.getDoc().execCommand("unlink", false, null);\r
- tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});\r
-\r
- elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});\r
- for (i=0; i<elementArray.length; i++)\r
- setAllAttribs(elm = elementArray[i]);\r
- } else\r
- setAllAttribs(elm);\r
-\r
- // Don't move caret if selection was image\r
- if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {\r
- inst.focus();\r
- inst.selection.select(elm);\r
- inst.selection.collapse(0);\r
- tinyMCEPopup.storeSelection();\r
- }\r
-\r
- tinyMCEPopup.execCommand("mceEndUndoLevel");\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function setAllAttribs(elm) {\r
- var formObj = document.forms[0];\r
- var href = formObj.href.value.replace(/ /g, '%20');\r
- var target = getSelectValue(formObj, 'targetlist');\r
-\r
- setAttrib(elm, 'href', href);\r
- setAttrib(elm, 'title');\r
- setAttrib(elm, 'target', target == '_self' ? '' : target);\r
- setAttrib(elm, 'id');\r
- setAttrib(elm, 'style');\r
- setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));\r
- setAttrib(elm, 'rel');\r
- setAttrib(elm, 'rev');\r
- setAttrib(elm, 'charset');\r
- setAttrib(elm, 'hreflang');\r
- setAttrib(elm, 'dir');\r
- setAttrib(elm, 'lang');\r
- setAttrib(elm, 'tabindex');\r
- setAttrib(elm, 'accesskey');\r
- setAttrib(elm, 'type');\r
- setAttrib(elm, 'onfocus');\r
- setAttrib(elm, 'onblur');\r
- setAttrib(elm, 'onclick');\r
- setAttrib(elm, 'ondblclick');\r
- setAttrib(elm, 'onmousedown');\r
- setAttrib(elm, 'onmouseup');\r
- setAttrib(elm, 'onmouseover');\r
- setAttrib(elm, 'onmousemove');\r
- setAttrib(elm, 'onmouseout');\r
- setAttrib(elm, 'onkeypress');\r
- setAttrib(elm, 'onkeydown');\r
- setAttrib(elm, 'onkeyup');\r
-\r
- // Refresh in old MSIE\r
- if (tinyMCE.isMSIE5)\r
- elm.outerHTML = elm.outerHTML;\r
-}\r
-\r
-function getSelectValue(form_obj, field_name) {\r
- var elm = form_obj.elements[field_name];\r
-\r
- if (!elm || elm.options == null || elm.selectedIndex == -1)\r
- return "";\r
-\r
- return elm.options[elm.selectedIndex].value;\r
-}\r
-\r
-function getLinkListHTML(elm_id, target_form_element, onchange_func) {\r
- if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)\r
- return "";\r
-\r
- var html = "";\r
-\r
- html += '<select id="' + elm_id + '" name="' + elm_id + '"';\r
- html += ' class="mceLinkList" onchange="this.form.' + target_form_element + '.value=';\r
- html += 'this.options[this.selectedIndex].value;';\r
-\r
- if (typeof(onchange_func) != "undefined")\r
- html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';\r
-\r
- html += '"><option value="">---</option>';\r
-\r
- for (var i=0; i<tinyMCELinkList.length; i++)\r
- html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';\r
-\r
- html += '</select>';\r
-\r
- return html;\r
-\r
- // tinyMCE.debug('-- image list start --', html, '-- image list end --');\r
-}\r
-\r
-function getTargetListHTML(elm_id, target_form_element) {\r
- var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');\r
- var html = '';\r
-\r
- html += '<select id="' + elm_id + '" name="' + elm_id + '" onchange="this.form.' + target_form_element + '.value=';\r
- html += 'this.options[this.selectedIndex].value;">';\r
- html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';\r
- html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';\r
- html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';\r
- html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';\r
-\r
- for (var i=0; i<targets.length; i++) {\r
- var key, value;\r
-\r
- if (targets[i] == "")\r
- continue;\r
-\r
- key = targets[i].split('=')[0];\r
- value = targets[i].split('=')[1];\r
-\r
- html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';\r
- }\r
-\r
- html += '</select>';\r
-\r
- return html;\r
-}\r
-\r
-// While loading\r
-preinit();\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advlink_dlg.title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/validate.js"></script>\r
- <script type="text/javascript" src="js/advlink.js"></script>\r
- <link href="css/advlink.css" rel="stylesheet" type="text/css" />\r
-</head>\r
-<body id="advlink" style="display: none" role="application" onload="javascript:mcTabs.displayTab('general_tab','general_panel', true);" aria-labelledby="app_label">\r
- <span class="mceVoiceLabel" id="app_label" style="display:none;">{#advlink_dlg.title}</span>\r
- <form onsubmit="insertAction();return false;" action="#">\r
- <div class="tabs" role="presentation">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel" ><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>\r
- <li id="popup_tab" aria-controls="popup_panel" ><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>\r
- <li id="events_tab" aria-controls="events_panel"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>\r
- <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper" role="presentation">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#advlink_dlg.general_props}</legend>\r
-\r
- <table border="0" cellpadding="4" cellspacing="0" role="presentation">\r
- <tr>\r
- <td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>\r
- <td><table border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" aria-required="true" /></td>\r
- <td id="hrefbrowsercontainer"> </td>\r
- </tr>\r
- </table></td>\r
- </tr>\r
- <tr id="linklisthrefrow">\r
- <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>\r
- <td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td>\r
- </tr>\r
- <tr id="anchorlistrow">\r
- <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>\r
- <td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>\r
- </tr>\r
- <tr>\r
- <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>\r
- <td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>\r
- <td><input id="title" name="title" type="text" value="" /></td>\r
- </tr>\r
- <tr>\r
- <td><label id="classlabel" for="classlist">{#class_name}</label></td>\r
- <td>\r
- <select id="classlist" name="classlist" onchange="changeClass();">\r
- <option value="" selected="selected">{#not_set}</option>\r
- </select>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="popup_panel" class="panel">\r
- <fieldset>\r
- <legend>{#advlink_dlg.popup_props}</legend>\r
-\r
- <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />\r
- <label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>\r
-\r
- <table border="0" cellpadding="0" cellspacing="4" role="presentation" >\r
- <tr>\r
- <td class="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label> </td>\r
- <td>\r
- <table border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>\r
- <td id="popupurlbrowsercontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label> </td>\r
- <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>\r
- </tr>\r
- <tr role="group" aria-labelledby="popup_size_label">\r
- <td class="nowrap"><label id="popup_size_label">{#advlink_dlg.popup_size}</label> </td>\r
- <td class="nowrap">\r
- <span style="display:none" id="width_voiceLabel">{#advlink_dlg.width}</span>\r
- <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" aria-labelledby="width_voiceLabel" /> x\r
- <span style="display:none" id="height_voiceLabel">{#advlink_dlg.height}</span>\r
- <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" aria-labelledby="height_voiceLabel" /> px\r
- </td>\r
- </tr>\r
- <tr role="group" aria-labelledby="popup_position_label center_hint">\r
- <td class="nowrap" id="labelleft"><label id="popup_position_label">{#advlink_dlg.popup_position}</label> </td>\r
- <td class="nowrap">\r
- <span style="display:none" id="x_voiceLabel">X</span>\r
- <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" aria-labelledby="x_voiceLabel" /> / \r
- <span style="display:none" id="y_voiceLabel">Y</span>\r
- <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" aria-labelledby="y_voiceLabel" /> <span id="center_hint">(c /c = center)</span>\r
- </td>\r
- </tr>\r
- </table>\r
-\r
- <fieldset>\r
- <legend>{#advlink_dlg.popup_opts}</legend>\r
-\r
- <table border="0" cellpadding="0" cellspacing="4" role="presentation" >\r
- <tr>\r
- <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>\r
- <td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>\r
- <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>\r
- <td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>\r
- </tr>\r
- <tr>\r
- <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>\r
- <td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>\r
- <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>\r
- <td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>\r
- </tr>\r
- <tr>\r
- <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>\r
- <td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>\r
- <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>\r
- <td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>\r
- </tr>\r
- <tr>\r
- <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>\r
- <td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>\r
- <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>\r
- <td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="advanced_panel" class="panel">\r
- <fieldset>\r
- <legend>{#advlink_dlg.advanced_props}</legend>\r
-\r
- <table border="0" cellpadding="0" cellspacing="4" role="presentation" >\r
- <tr>\r
- <td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td> \r
- <td><input id="id" name="id" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>\r
- <td><input type="text" id="style" name="style" value="" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>\r
- <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>\r
- <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td> \r
- <td>\r
- <select id="dir" name="dir"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#advlink_dlg.ltr}</option> \r
- <option value="rtl">{#advlink_dlg.rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>\r
- <td><input type="text" id="hreflang" name="hreflang" value="" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" />\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>\r
- <td><input type="text" id="charset" name="charset" value="" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>\r
- <td><input type="text" id="type" name="type" value="" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>\r
- <td><select id="rel" name="rel"> \r
- <option value="">{#not_set}</option> \r
- <option value="lightbox">Lightbox</option> \r
- <option value="alternate">Alternate</option> \r
- <option value="designates">Designates</option> \r
- <option value="stylesheet">Stylesheet</option> \r
- <option value="start">Start</option> \r
- <option value="next">Next</option> \r
- <option value="prev">Prev</option> \r
- <option value="contents">Contents</option> \r
- <option value="index">Index</option> \r
- <option value="glossary">Glossary</option> \r
- <option value="copyright">Copyright</option> \r
- <option value="chapter">Chapter</option> \r
- <option value="subsection">Subsection</option> \r
- <option value="appendix">Appendix</option> \r
- <option value="help">Help</option> \r
- <option value="bookmark">Bookmark</option>\r
- <option value="nofollow">No Follow</option>\r
- <option value="tag">Tag</option>\r
- </select> \r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>\r
- <td><select id="rev" name="rev"> \r
- <option value="">{#not_set}</option> \r
- <option value="alternate">Alternate</option> \r
- <option value="designates">Designates</option> \r
- <option value="stylesheet">Stylesheet</option> \r
- <option value="start">Start</option> \r
- <option value="next">Next</option> \r
- <option value="prev">Prev</option> \r
- <option value="contents">Contents</option> \r
- <option value="index">Index</option> \r
- <option value="glossary">Glossary</option> \r
- <option value="copyright">Copyright</option> \r
- <option value="chapter">Chapter</option> \r
- <option value="subsection">Subsection</option> \r
- <option value="appendix">Appendix</option> \r
- <option value="help">Help</option> \r
- <option value="bookmark">Bookmark</option> \r
- </select> \r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>\r
- <td><input type="text" id="tabindex" name="tabindex" value="" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>\r
- <td><input type="text" id="accesskey" name="accesskey" value="" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="events_panel" class="panel">\r
- <fieldset>\r
- <legend>{#advlink_dlg.event_props}</legend>\r
-\r
- <table border="0" cellpadding="0" cellspacing="4" role="presentation" >\r
- <tr>\r
- <td class="column1"><label for="onfocus">onfocus</label></td> \r
- <td><input id="onfocus" name="onfocus" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onblur">onblur</label></td> \r
- <td><input id="onblur" name="onblur" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onclick">onclick</label></td> \r
- <td><input id="onclick" name="onclick" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="ondblclick">ondblclick</label></td> \r
- <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onmousedown">onmousedown</label></td> \r
- <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onmouseup">onmouseup</label></td> \r
- <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onmouseover">onmouseover</label></td> \r
- <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onmousemove">onmousemove</label></td> \r
- <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onmouseout">onmouseout</label></td> \r
- <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onkeypress">onkeypress</label></td> \r
- <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onkeydown">onkeydown</label></td> \r
- <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="onkeyup">onkeyup</label></td> \r
- <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
- </form>\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square");if(tinymce.isIE&&/MSIE [2-7]/.test(navigator.userAgent)){d.isIE7=true}},createControl:function(d,b){var f=this,e,i,g=f.editor;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){i=f[d][0]}function c(j,l){var k=true;a(l.styles,function(n,m){if(g.dom.getStyle(j,m)!=n){k=false;return false}});return k}function h(){var k,l=g.dom,j=g.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,i)){g.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(i){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,i.styles);k.removeAttribute("data-mce-style")}}g.focus()}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){h()}});e.onRenderMenu.add(function(j,k){k.onHideMenu.add(function(){if(f.bookmark){g.selection.moveToBookmark(f.bookmark);f.bookmark=0}});k.onShowMenu.add(function(){var n=g.dom,m=n.getParent(g.selection.getNode(),"ol,ul"),l;if(m||i){l=f[d];a(k.items,function(o){var p=true;o.setSelected(0);if(m&&!o.isDisabled()){a(l,function(q){if(q.id==o.id){if(!c(m,q)){p=false;return false}}});if(p){o.setSelected(1)}}});if(!m){k.items[i.id].setSelected(1)}}g.focus();if(tinymce.isIE){f.bookmark=g.selection.getBookmark(1)}});k.add({id:g.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle",titleItem:true}).setDisabled(1);a(f[d],function(l){if(f.isIE7&&l.styles.listStyleType=="lower-greek"){return}l.id=g.dom.uniqueId();k.add({id:l.id,title:l.title,onclick:function(){i=l;h()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var each = tinymce.each;\r
-\r
- tinymce.create('tinymce.plugins.AdvListPlugin', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
-\r
- function buildFormats(str) {\r
- var formats = [];\r
-\r
- each(str.split(/,/), function(type) {\r
- formats.push({\r
- title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),\r
- styles : {\r
- listStyleType : type == 'default' ? '' : type\r
- }\r
- });\r
- });\r
-\r
- return formats;\r
- };\r
-\r
- // Setup number formats from config or default\r
- t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");\r
- t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");\r
-\r
- if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent))\r
- t.isIE7 = true;\r
- },\r
-\r
- createControl: function(name, cm) {\r
- var t = this, btn, format, editor = t.editor;\r
-\r
- if (name == 'numlist' || name == 'bullist') {\r
- // Default to first item if it's a default item\r
- if (t[name][0].title == 'advlist.def')\r
- format = t[name][0];\r
-\r
- function hasFormat(node, format) {\r
- var state = true;\r
-\r
- each(format.styles, function(value, name) {\r
- // Format doesn't match\r
- if (editor.dom.getStyle(node, name) != value) {\r
- state = false;\r
- return false;\r
- }\r
- });\r
-\r
- return state;\r
- };\r
-\r
- function applyListFormat() {\r
- var list, dom = editor.dom, sel = editor.selection;\r
-\r
- // Check for existing list element\r
- list = dom.getParent(sel.getNode(), 'ol,ul');\r
-\r
- // Switch/add list type if needed\r
- if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))\r
- editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');\r
-\r
- // Append styles to new list element\r
- if (format) {\r
- list = dom.getParent(sel.getNode(), 'ol,ul');\r
- if (list) {\r
- dom.setStyles(list, format.styles);\r
- list.removeAttribute('data-mce-style');\r
- }\r
- }\r
-\r
- editor.focus();\r
- };\r
-\r
- btn = cm.createSplitButton(name, {\r
- title : 'advanced.' + name + '_desc',\r
- 'class' : 'mce_' + name,\r
- onclick : function() {\r
- applyListFormat();\r
- }\r
- });\r
-\r
- btn.onRenderMenu.add(function(btn, menu) {\r
- menu.onHideMenu.add(function() {\r
- if (t.bookmark) {\r
- editor.selection.moveToBookmark(t.bookmark);\r
- t.bookmark = 0;\r
- }\r
- });\r
-\r
- menu.onShowMenu.add(function() {\r
- var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList;\r
-\r
- if (list || format) {\r
- fmtList = t[name];\r
-\r
- // Unselect existing items\r
- each(menu.items, function(item) {\r
- var state = true;\r
-\r
- item.setSelected(0);\r
-\r
- if (list && !item.isDisabled()) {\r
- each(fmtList, function(fmt) {\r
- if (fmt.id == item.id) {\r
- if (!hasFormat(list, fmt)) {\r
- state = false;\r
- return false;\r
- }\r
- }\r
- });\r
-\r
- if (state)\r
- item.setSelected(1);\r
- }\r
- });\r
-\r
- // Select the current format\r
- if (!list)\r
- menu.items[format.id].setSelected(1);\r
- }\r
- \r
- editor.focus();\r
-\r
- // IE looses it's selection so store it away and restore it later\r
- if (tinymce.isIE) {\r
- t.bookmark = editor.selection.getBookmark(1);\r
- }\r
- });\r
-\r
- menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1);\r
-\r
- each(t[name], function(item) {\r
- // IE<8 doesn't support lower-greek, skip it\r
- if (t.isIE7 && item.styles.listStyleType == 'lower-greek')\r
- return;\r
-\r
- item.id = editor.dom.uniqueId();\r
-\r
- menu.add({id : item.id, title : item.title, onclick : function() {\r
- format = item;\r
- applyListFormat();\r
- }});\r
- });\r
- });\r
-\r
- return btn;\r
- }\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Advanced lists',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f>=2?f-2:0);a.setEnd(n,f>=1?f-1:0);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**
- * editor_plugin_src.js
- *
- * Copyright 2011, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- tinymce.create('tinymce.plugins.AutolinkPlugin', {
- /**
- * Initializes the plugin, this will be executed after the plugin has been created.
- * This call is done before the editor instance has finished it's initialization so use the onInit event
- * of the editor instance to intercept that event.
- *
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
- * @param {string} url Absolute URL to where the plugin is located.
- */
-
- init : function(ed, url) {
- var t = this;
-
- // Add a key down handler
- ed.onKeyDown.addToTop(function(ed, e) {
- if (e.keyCode == 13)
- return t.handleEnter(ed);
- });
-
- // Internet Explorer has built-in automatic linking for most cases
- if (tinyMCE.isIE)
- return;
-
- ed.onKeyPress.add(function(ed, e) {
- if (e.which == 41)
- return t.handleEclipse(ed);
- });
-
- // Add a key up handler
- ed.onKeyUp.add(function(ed, e) {
- if (e.keyCode == 32)
- return t.handleSpacebar(ed);
- });
- },
-
- handleEclipse : function(ed) {
- this.parseCurrentLine(ed, -1, '(', true);
- },
-
- handleSpacebar : function(ed) {
- this.parseCurrentLine(ed, 0, '', true);
- },
-
- handleEnter : function(ed) {
- this.parseCurrentLine(ed, -1, '', false);
- },
-
- parseCurrentLine : function(ed, end_offset, delimiter, goback) {
- var r, end, start, endContainer, bookmark, text, matches, prev, len;
-
- // We need at least five characters to form a URL,
- // hence, at minimum, five characters from the beginning of the line.
- r = ed.selection.getRng(true).cloneRange();
- if (r.startOffset < 5) {
- // During testing, the caret is placed inbetween two text nodes.
- // The previous text node contains the URL.
- prev = r.endContainer.previousSibling;
- if (prev == null) {
- if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
- return;
-
- prev = r.endContainer.firstChild.nextSibling;
- }
- len = prev.length;
- r.setStart(prev, len);
- r.setEnd(prev, len);
-
- if (r.endOffset < 5)
- return;
-
- end = r.endOffset;
- endContainer = prev;
- } else {
- endContainer = r.endContainer;
-
- // Get a text node
- if (endContainer.nodeType != 3 && endContainer.firstChild) {
- while (endContainer.nodeType != 3 && endContainer.firstChild)
- endContainer = endContainer.firstChild;
-
- // Move range to text node
- if (endContainer.nodeType == 3) {
- r.setStart(endContainer, 0);
- r.setEnd(endContainer, endContainer.nodeValue.length);
- }
- }
-
- if (r.endOffset == 1)
- end = 2;
- else
- end = r.endOffset - 1 - end_offset;
- }
-
- start = end;
-
- do
- {
- // Move the selection one character backwards.
- r.setStart(endContainer, end >= 2 ? end - 2 : 0);
- r.setEnd(endContainer, end >= 1 ? end - 1 : 0);
- end -= 1;
-
- // Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
- } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
-
- if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
- r.setStart(endContainer, end);
- r.setEnd(endContainer, start);
- end += 1;
- } else if (r.startOffset == 0) {
- r.setStart(endContainer, 0);
- r.setEnd(endContainer, start);
- }
- else {
- r.setStart(endContainer, end);
- r.setEnd(endContainer, start);
- }
-
- // Exclude last . from word like "www.site.com."
- var text = r.toString();
- if (text.charAt(text.length - 1) == '.') {
- r.setEnd(endContainer, start - 1);
- }
-
- text = r.toString();
- matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
-
- if (matches) {
- if (matches[1] == 'www.') {
- matches[1] = 'http://www.';
- } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
- matches[1] = 'mailto:' + matches[1];
- }
-
- bookmark = ed.selection.getBookmark();
-
- ed.selection.setRng(r);
- tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
- ed.selection.moveToBookmark(bookmark);
- ed.nodeChanged();
-
- // TODO: Determine if this is still needed.
- if (tinyMCE.isWebKit) {
- // move the caret to its original position
- ed.selection.collapse(false);
- var max = Math.min(endContainer.length, start + 1);
- r.setStart(endContainer, max);
- r.setEnd(endContainer, max);
- ed.selection.setRng(r);
- }
- }
- },
-
- /**
- * Returns information about the plugin as a name/value array.
- * The current keys are longname, author, authorurl, infourl and version.
- *
- * @return {Object} Name/value array containing information about the plugin.
- */
- getInfo : function() {
- return {
- longname : 'Autolink',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
-})();
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var j,i=a.getDoc(),f=i.body,l=i.documentElement,h=tinymce.DOM,k=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:(tinymce.isWebKit&&f.clientHeight==0?0:f.offsetHeight);if(g>d.autoresize_min_height){k=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){k=d.autoresize_max_height;f.style.overflowY="auto";l.style.overflowY="auto"}else{f.style.overflowY="hidden";l.style.overflowY="hidden";f.scrollTop=0}if(k!==e){j=k-e;h.setStyle(h.get(a.id+"_ifr"),"height",k+"px");e=k;if(tinymce.isWebKit&&j<0){b()}}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onLoad.add(b);a.onLoadContent.add(b)}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- /**
- * Auto Resize
- *
- * This plugin automatically resizes the content area to fit its content height.
- * It will retain a minimum height, which is the height of the content area when
- * it's initialized.
- */
- tinymce.create('tinymce.plugins.AutoResizePlugin', {
- /**
- * Initializes the plugin, this will be executed after the plugin has been created.
- * This call is done before the editor instance has finished it's initialization so use the onInit event
- * of the editor instance to intercept that event.
- *
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
- * @param {string} url Absolute URL to where the plugin is located.
- */
- init : function(ed, url) {
- var t = this, oldSize = 0;
-
- if (ed.getParam('fullscreen_is_enabled'))
- return;
-
- /**
- * This method gets executed each time the editor needs to resize.
- */
- function resize() {
- var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
-
- // Get height differently depending on the browser used
- myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
-
- // Don't make it smaller than the minimum height
- if (myHeight > t.autoresize_min_height)
- resizeHeight = myHeight;
-
- // If a maximum height has been defined don't exceed this height
- if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
- resizeHeight = t.autoresize_max_height;
- body.style.overflowY = "auto";
- de.style.overflowY = "auto"; // Old IE
- } else {
- body.style.overflowY = "hidden";
- de.style.overflowY = "hidden"; // Old IE
- body.scrollTop = 0;
- }
-
- // Resize content element
- if (resizeHeight !== oldSize) {
- deltaSize = resizeHeight - oldSize;
- DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
- oldSize = resizeHeight;
-
- // WebKit doesn't decrease the size of the body element until the iframe gets resized
- // So we need to continue to resize the iframe down until the size gets fixed
- if (tinymce.isWebKit && deltaSize < 0)
- resize();
- }
- };
-
- t.editor = ed;
-
- // Define minimum height
- t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
-
- // Define maximum height
- t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
-
- // Add padding at the bottom for better UX
- ed.onInit.add(function(ed){
- ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
- });
-
- // Add appropriate listeners for resizing content area
- ed.onChange.add(resize);
- ed.onSetContent.add(resize);
- ed.onPaste.add(resize);
- ed.onKeyUp.add(resize);
- ed.onPostRender.add(resize);
-
- if (ed.getParam('autoresize_on_init', true)) {
- ed.onLoad.add(resize);
- ed.onLoadContent.add(resize);
- }
-
- // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
- ed.addCommand('mceAutoResize', resize);
- },
-
- /**
- * Returns information about the plugin as a name/value array.
- * The current keys are longname, author, authorurl, infourl and version.
- *
- * @return {Object} Name/value array containing information about the plugin.
- */
- getInfo : function() {
- return {
- longname : 'Auto Resize',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
-})();
+++ /dev/null
-(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){if(!i.removed){h.storeDraft();i.nodeChanged()}},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- *\r
- * Adds auto-save capability to the TinyMCE text editor to rescue content\r
- * inadvertently lost. This plugin was originally developed by Speednet\r
- * and that project can be found here: http://code.google.com/p/tinyautosave/\r
- *\r
- * TECHNOLOGY DISCUSSION:\r
- * \r
- * The plugin attempts to use the most advanced features available in the current browser to save\r
- * as much content as possible. There are a total of four different methods used to autosave the\r
- * content. In order of preference, they are:\r
- * \r
- * 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain\r
- * on the client computer. Data stored in the localStorage area has no expiration date, so we must\r
- * manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed\r
- * to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers. As\r
- * HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7,\r
- * localStorage is stored in the following folder:\r
- * C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder]\r
- * \r
- * 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage,\r
- * except it is designed to expire after a certain amount of time. Because the specification\r
- * around expiration date/time is very loosely-described, it is preferrable to use locaStorage and\r
- * manage the expiration ourselves. sessionStorage has similar storage characteristics to\r
- * localStorage, although it seems to have better support by Firefox 3 at the moment. (That will\r
- * certainly change as Firefox continues getting better at HTML 5 adoption.)\r
- * \r
- * 3. UserData - A very under-exploited feature of Microsoft Internet Explorer, UserData is a\r
- * way to store up to 128K of data per "document", or up to 1MB of data per domain, on the client\r
- * computer. The feature is available for IE 5+, which makes it available for every version of IE\r
- * supported by TinyMCE. The content is persistent across browser restarts and expires on the\r
- * date/time specified, just like a cookie. However, the data is not cleared when the user clears\r
- * cookies on the browser, which makes it well-suited for rescuing autosaved content. UserData,\r
- * like other Microsoft IE browser technologies, is implemented as a behavior attached to a\r
- * specific DOM object, so in this case we attach the behavior to the same DOM element that the\r
- * TinyMCE editor instance is attached to.\r
- */\r
-\r
-(function(tinymce) {\r
- // Setup constants to help the compressor to reduce script size\r
- var PLUGIN_NAME = 'autosave',\r
- RESTORE_DRAFT = 'restoredraft',\r
- TRUE = true,\r
- undefined,\r
- unloadHandlerAdded,\r
- Dispatcher = tinymce.util.Dispatcher;\r
-\r
- /**\r
- * This plugin adds auto-save capability to the TinyMCE text editor to rescue content\r
- * inadvertently lost. By using localStorage.\r
- *\r
- * @class tinymce.plugins.AutoSave\r
- */\r
- tinymce.create('tinymce.plugins.AutoSave', {\r
- /**\r
- * Initializes the plugin, this will be executed after the plugin has been created.\r
- * This call is done before the editor instance has finished it's initialization so use the onInit event\r
- * of the editor instance to intercept that event.\r
- *\r
- * @method init\r
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
- * @param {string} url Absolute URL to where the plugin is located.\r
- */\r
- init : function(ed, url) {\r
- var self = this, settings = ed.settings;\r
-\r
- self.editor = ed;\r
-\r
- // Parses the specified time string into a milisecond number 10m, 10s etc.\r
- function parseTime(time) {\r
- var multipels = {\r
- s : 1000,\r
- m : 60000\r
- };\r
-\r
- time = /^(\d+)([ms]?)$/.exec('' + time);\r
-\r
- return (time[2] ? multipels[time[2]] : 1) * parseInt(time);\r
- };\r
-\r
- // Default config\r
- tinymce.each({\r
- ask_before_unload : TRUE,\r
- interval : '30s',\r
- retention : '20m',\r
- minlength : 50\r
- }, function(value, key) {\r
- key = PLUGIN_NAME + '_' + key;\r
-\r
- if (settings[key] === undefined)\r
- settings[key] = value;\r
- });\r
-\r
- // Parse times\r
- settings.autosave_interval = parseTime(settings.autosave_interval);\r
- settings.autosave_retention = parseTime(settings.autosave_retention);\r
-\r
- // Register restore button\r
- ed.addButton(RESTORE_DRAFT, {\r
- title : PLUGIN_NAME + ".restore_content",\r
- onclick : function() {\r
- if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {\r
- // Show confirm dialog if the editor isn't empty\r
- ed.windowManager.confirm(\r
- PLUGIN_NAME + ".warning_message",\r
- function(ok) {\r
- if (ok)\r
- self.restoreDraft();\r
- }\r
- );\r
- } else\r
- self.restoreDraft();\r
- }\r
- });\r
-\r
- // Enable/disable restoredraft button depending on if there is a draft stored or not\r
- ed.onNodeChange.add(function() {\r
- var controlManager = ed.controlManager;\r
-\r
- if (controlManager.get(RESTORE_DRAFT))\r
- controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft());\r
- });\r
-\r
- ed.onInit.add(function() {\r
- // Check if the user added the restore button, then setup auto storage logic\r
- if (ed.controlManager.get(RESTORE_DRAFT)) {\r
- // Setup storage engine\r
- self.setupStorage(ed);\r
-\r
- // Auto save contents each interval time\r
- setInterval(function() {\r
- if (!ed.removed) {\r
- self.storeDraft();\r
- ed.nodeChanged();\r
- }\r
- }, settings.autosave_interval);\r
- }\r
- });\r
-\r
- /**\r
- * This event gets fired when a draft is stored to local storage.\r
- *\r
- * @event onStoreDraft\r
- * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
- * @param {Object} draft Draft object containing the HTML contents of the editor.\r
- */\r
- self.onStoreDraft = new Dispatcher(self);\r
-\r
- /**\r
- * This event gets fired when a draft is restored from local storage.\r
- *\r
- * @event onStoreDraft\r
- * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
- * @param {Object} draft Draft object containing the HTML contents of the editor.\r
- */\r
- self.onRestoreDraft = new Dispatcher(self);\r
-\r
- /**\r
- * This event gets fired when a draft removed/expired.\r
- *\r
- * @event onRemoveDraft\r
- * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
- * @param {Object} draft Draft object containing the HTML contents of the editor.\r
- */\r
- self.onRemoveDraft = new Dispatcher(self);\r
-\r
- // Add ask before unload dialog only add one unload handler\r
- if (!unloadHandlerAdded) {\r
- window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler;\r
- unloadHandlerAdded = TRUE;\r
- }\r
- },\r
-\r
- /**\r
- * Returns information about the plugin as a name/value array.\r
- * The current keys are longname, author, authorurl, infourl and version.\r
- *\r
- * @method getInfo\r
- * @return {Object} Name/value array containing information about the plugin.\r
- */\r
- getInfo : function() {\r
- return {\r
- longname : 'Auto save',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- /**\r
- * Returns an expiration date UTC string.\r
- *\r
- * @method getExpDate\r
- * @return {String} Expiration date UTC string.\r
- */\r
- getExpDate : function() {\r
- return new Date(\r
- new Date().getTime() + this.editor.settings.autosave_retention\r
- ).toUTCString();\r
- },\r
-\r
- /**\r
- * This method will setup the storage engine. If the browser has support for it.\r
- *\r
- * @method setupStorage\r
- */\r
- setupStorage : function(ed) {\r
- var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK";\r
-\r
- self.key = PLUGIN_NAME + ed.id;\r
-\r
- // Loop though each storage engine type until we find one that works\r
- tinymce.each([\r
- function() {\r
- // Try HTML5 Local Storage\r
- if (localStorage) {\r
- localStorage.setItem(testKey, testVal);\r
-\r
- if (localStorage.getItem(testKey) === testVal) {\r
- localStorage.removeItem(testKey);\r
-\r
- return localStorage;\r
- }\r
- }\r
- },\r
-\r
- function() {\r
- // Try HTML5 Session Storage\r
- if (sessionStorage) {\r
- sessionStorage.setItem(testKey, testVal);\r
-\r
- if (sessionStorage.getItem(testKey) === testVal) {\r
- sessionStorage.removeItem(testKey);\r
-\r
- return sessionStorage;\r
- }\r
- }\r
- },\r
-\r
- function() {\r
- // Try IE userData\r
- if (tinymce.isIE) {\r
- ed.getElement().style.behavior = "url('#default#userData')";\r
-\r
- // Fake localStorage on old IE\r
- return {\r
- autoExpires : TRUE,\r
-\r
- setItem : function(key, value) {\r
- var userDataElement = ed.getElement();\r
-\r
- userDataElement.setAttribute(key, value);\r
- userDataElement.expires = self.getExpDate();\r
-\r
- try {\r
- userDataElement.save("TinyMCE");\r
- } catch (e) {\r
- // Ignore, saving might fail if "Userdata Persistence" is disabled in IE\r
- }\r
- },\r
-\r
- getItem : function(key) {\r
- var userDataElement = ed.getElement();\r
-\r
- try {\r
- userDataElement.load("TinyMCE");\r
- return userDataElement.getAttribute(key);\r
- } catch (e) {\r
- // Ignore, loading might fail if "Userdata Persistence" is disabled in IE\r
- return null;\r
- }\r
- },\r
-\r
- removeItem : function(key) {\r
- ed.getElement().removeAttribute(key);\r
- }\r
- };\r
- }\r
- },\r
- ], function(setup) {\r
- // Try executing each function to find a suitable storage engine\r
- try {\r
- self.storage = setup();\r
-\r
- if (self.storage)\r
- return false;\r
- } catch (e) {\r
- // Ignore\r
- }\r
- });\r
- },\r
-\r
- /**\r
- * This method will store the current contents in the the storage engine.\r
- *\r
- * @method storeDraft\r
- */\r
- storeDraft : function() {\r
- var self = this, storage = self.storage, editor = self.editor, expires, content;\r
-\r
- // Is the contents dirty\r
- if (storage) {\r
- // If there is no existing key and the contents hasn't been changed since\r
- // it's original value then there is no point in saving a draft\r
- if (!storage.getItem(self.key) && !editor.isDirty())\r
- return;\r
-\r
- // Store contents if the contents if longer than the minlength of characters\r
- content = editor.getContent({draft: true});\r
- if (content.length > editor.settings.autosave_minlength) {\r
- expires = self.getExpDate();\r
-\r
- // Store expiration date if needed IE userData has auto expire built in\r
- if (!self.storage.autoExpires)\r
- self.storage.setItem(self.key + "_expires", expires);\r
-\r
- self.storage.setItem(self.key, content);\r
- self.onStoreDraft.dispatch(self, {\r
- expires : expires,\r
- content : content\r
- });\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * This method will restore the contents from the storage engine back to the editor.\r
- *\r
- * @method restoreDraft\r
- */\r
- restoreDraft : function() {\r
- var self = this, storage = self.storage, content;\r
-\r
- if (storage) {\r
- content = storage.getItem(self.key);\r
-\r
- if (content) {\r
- self.editor.setContent(content);\r
- self.onRestoreDraft.dispatch(self, {\r
- content : content\r
- });\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * This method will return true/false if there is a local storage draft available.\r
- *\r
- * @method hasDraft\r
- * @return {boolean} true/false state if there is a local draft.\r
- */\r
- hasDraft : function() {\r
- var self = this, storage = self.storage, expDate, exists;\r
-\r
- if (storage) {\r
- // Does the item exist at all\r
- exists = !!storage.getItem(self.key);\r
- if (exists) {\r
- // Storage needs autoexpire\r
- if (!self.storage.autoExpires) {\r
- expDate = new Date(storage.getItem(self.key + "_expires"));\r
-\r
- // Contents hasn't expired\r
- if (new Date().getTime() < expDate.getTime())\r
- return TRUE;\r
-\r
- // Remove it if it has\r
- self.removeDraft();\r
- } else\r
- return TRUE;\r
- }\r
- }\r
-\r
- return false;\r
- },\r
-\r
- /**\r
- * Removes the currently stored draft.\r
- *\r
- * @method removeDraft\r
- */\r
- removeDraft : function() {\r
- var self = this, storage = self.storage, key = self.key, content;\r
-\r
- if (storage) {\r
- // Get current contents and remove the existing draft\r
- content = storage.getItem(key);\r
- storage.removeItem(key);\r
- storage.removeItem(key + "_expires");\r
-\r
- // Dispatch remove event if we had any contents\r
- if (content) {\r
- self.onRemoveDraft.dispatch(self, {\r
- content : content\r
- });\r
- }\r
- }\r
- },\r
-\r
- "static" : {\r
- // Internal unload handler will be called before the page is unloaded\r
- _beforeUnloadHandler : function(e) {\r
- var msg;\r
-\r
- tinymce.each(tinyMCE.editors, function(ed) {\r
- // Store a draft for each editor instance\r
- if (ed.plugins.autosave)\r
- ed.plugins.autosave.storeDraft();\r
-\r
- // Never ask in fullscreen mode\r
- if (ed.getParam("fullscreen_is_enabled"))\r
- return;\r
-\r
- // Setup a return message if the editor is dirty\r
- if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload"))\r
- msg = ed.getLang("autosave.unload_msg");\r
- });\r
-\r
- return msg;\r
- }\r
- }\r
- });\r
-\r
- tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave);\r
-})(tinymce);\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(ed,url){var t=this,dialect=ed.getParam("bbcode_dialect","dfrn").toLowerCase();ed.onBeforeSetContent.add(function(ed,o){o.content=t["_"+dialect+"_bbcode2html"](o.content)});ed.onPostProcess.add(function(ed,o){if(o.set)o.content=t["_"+dialect+"_bbcode2html"](o.content);if(o.get)o.content=t["_"+dialect+"_html2bbcode"](o.content)})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_dfrn_html2bbcode:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str)}function get(re){return s.match(re)}function _h2b_cb(match){var f,g,tof=[],tor=[];var find_spanc=/<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/gi;while(f=find_spanc.exec(match)){var find_a=/<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/gi;if(g=find_a.exec(f[1])){var find_href=/href=[\"']([^\"']*)[\"']/gi;var m2=find_href.exec(g[1]);if(m2[1]){tof.push(f[0]);tor.push("[EMBED]"+m2[1]+"[/EMBED]")}}}for(var i=0;i<tof.length;i++)match=match.replace(tof[i],tor[i]);return match}if(s.indexOf('class="oembed')>=0){s=_h2b_cb(s)}var codes=get(/<code>(.*?)<\/code>/gi);rep(/<code>(.*?)<\/code>/gi,"[$!$!CODEBLOCK!$!$]");rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");rep(/<span style=\"color:(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");rep(/<font>(.*?)<\/font>/gi,"$1");rep(/<img[^>]*?width=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$1x$2]$3[/img]");rep(/<img[^>]*?height=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$2x$1]$3[/img]");rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$3x$2]$1[/img]");rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$2x$3]$1[/img]");rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img]$1[/img]");rep(/<ul class=\"listbullet\" style=\"list-style-type\: circle\;\">(.*?)<\/ul>/gi,"[list]$1[/list]");rep(/<ul class=\"listnone\" style=\"list-style-type\: none\;\">(.*?)<\/ul>/gi,"[list=]$1[/list]");rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");rep(/<ul class=\"listupperalpha\" style=\"list-style-type\: upper-alpha\;\">(.*?)<\/ul>/gi,"[list=A]$1[/list]");rep(/<li>(.*?)<\/li>/gi,"[li]$1[/li]");rep(/<\/(strong|b)>/gi,"[/b]");rep(/<(strong|b)>/gi,"[b]");rep(/<\/(em|i)>/gi,"[/i]");rep(/<(em|i)>/gi,"[i]");rep(/<\/u>/gi,"[/u]");rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");rep(/<u>/gi,"[u]");rep(/<blockquote[^>]*>/gi,"[quote]");rep(/<\/blockquote>/gi,"[/quote]");rep(/<hr \/>/gi,"[hr]");rep(/<br (.*?)\/>/gi,"\n");rep(/<br\/>/gi,"\n");rep(/<br>/gi,"\n");rep(/<p>/gi,"");rep(/<\/p>/gi,"\n");rep(/ |\u00a0/gi," ");rep(/"/gi,'"');rep(/</gi,"<");rep(/>/gi,">");rep(/&/gi,"&");rep(/<div>/gi,"");rep(/<\/div>/gi,"");if(codes!=null){for(var i=0;i<codes.length;i++){codes[i]=codes[i].replace("<code>","");codes[i]=codes[i].replace("</code>","");rep(/\[\$!\$!CODEBLOCK!\$!\$\]/i,"[code]"+codes[i]+"[/code]")}}return s},_dfrn_bbcode2html:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str)}function get(re){return s.match(re)}var codes=get(/\[code\](.*?)\[\/code\]/gi);rep(/\[code\](.*?)\[\/code\]/gi,"[$!$!CODEBLOCK!$!$]");rep(/\n/gi,"<br />");rep(/\[b\]/gi,"<strong>");rep(/\[\/b\]/gi,"</strong>");rep(/\[i\]/gi,"<em>");rep(/\[\/i\]/gi,"</em>");rep(/\[u\]/gi,"<u>");rep(/\[\/u\]/gi,"</u>");rep(/\[hr\]/gi,"<hr />");rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,'<a class="bookmark" href="$1">$2</a>');rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');rep(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,'<img width="$1" height="$2" src="$3" />');rep(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');rep(/\[list\](.*?)\[\/list\]/gi,'<ul class="listbullet" style="list-style-type: circle;">$1</ul>');rep(/\[list=\](.*?)\[\/list\]/gi,'<ul class="listnone" style="list-style-type: none;">$1</ul>');rep(/\[list=1\](.*?)\[\/list\]/gi,'<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');rep(/\[list=I\](.*?)\[\/list\]/gi,'<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');rep(/\[list=a\](.*?)\[\/list\]/gi,'<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');rep(/\[list=A\](.*?)\[\/list\]/gi,'<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');rep(/\[li\](.*?)\[\/li\]/gi,"<li>$1</li>");rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<span style="color: $1;">$2</span>');rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,'<span style="font-size: $1;">$2</span>');rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");function _b2h_cb(match,url){url=bin2hex(url);function s_b2h(data){match=data}$.ajax({url:"oembed/b2h?url="+url,async:false,success:s_b2h,dataType:"html"});return match}s=s.replace(/\[embed\](.*?)\[\/embed\]/gi,_b2h_cb);if(codes!=null){for(var i=0;i<codes.length;i++){codes[i]=codes[i].replace("[code]","");codes[i]=codes[i].replace("[/code]","");rep(/\[\$!\$!CODEBLOCK!\$!\$\]/i,"<code>"+codes[i]+"</code>")}}return s}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */
-
-(function() {
- tinymce.create('tinymce.plugins.BBCodePlugin', {
- init : function(ed, url) {
- var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').toLowerCase();
-
- ed.onBeforeSetContent.add(function(ed, o) {
- o.content = t['_' + dialect + '_bbcode2html'](o.content);
- });
-
- ed.onPostProcess.add(function(ed, o) {
- if (o.set)
- o.content = t['_' + dialect + '_bbcode2html'](o.content);
-
- if (o.get)
- o.content = t['_' + dialect + '_html2bbcode'](o.content);
- });
- },
-
- getInfo : function() {
- return {
- longname : 'BBCode Plugin',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- },
-
- // Private methods
-
- // HTML -> BBCode in DFRN dialect
- _dfrn_html2bbcode : function(s) {
- s = tinymce.trim(s);
-
- function rep(re, str) {
-
-
- s = s.replace(re,str);
-
- //modify code to keep stuff intact within [code][/code] blocks
- //Waitman Gobble NO WARRANTY
-
- /* This doesn't seem to work well with
- [code]line1
- line2[/code]
- commenting out for now
- */
-
-/*
- var o = new Array();
- var x = s.split("[code]");
- var i = 0;
-
- var si = "";
- si = x.shift();
- si = si.replace(re,str);
- o.push(si);
-
- for (i = 0; i < x.length; i++) {
- var no = new Array();
- var j = x.shift();
- var g = j.split("[/code]");
- no.push(g.shift());
- si = g.shift();
- si = si.replace(re,str);
- no.push(si);
- o.push(no.join("[/code]"));
- }
-
- s = o.join("[code]");
-*/
- };
-
-
- function get(re) {
- return s.match(re);
- }
-
-
- /* oembed */
- function _h2b_cb(match) {
- /*
- function s_h2b(data) {
- match = data;
- }
- $.ajax({
- type:"POST",
- url: 'oembed/h2b',
- data: {text: match},
- async: false,
- success: s_h2b,
- dataType: 'html'
- });
- */
-
- var f, g, tof = [], tor = [];
- var find_spanc = /<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;
- while (f = find_spanc.exec(match)) {
- var find_a = /<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;
- if (g = find_a.exec(f[1])) {
- var find_href = /href=[\"']([^\"']*)[\"']/ig;
- var m2 = find_href.exec(g[1]);
- if (m2[1]) {
- tof.push(f[0]);
- tor.push("[EMBED]" + m2[1] + "[/EMBED]");
- }
- }
- }
- for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);
-
- return match;
- }
-
- if (s.indexOf('class="oembed')>=0){
- //alert("request oembed html2bbcode");
- s = _h2b_cb(s);
- }
-
- /* /oembed */
-
-
- // Preserve HTML tags inside code blocks
- var codes = get(/<code>(.*?)<\/code>/gi);
- rep(/<code>(.*?)<\/code>/gi,"[$!$!CODEBLOCK!$!$]");
-
- // example: <strong> to [b]
- rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");
- rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
- rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
- rep(/<span style=\"color:(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
- rep(/<font>(.*?)<\/font>/gi,"$1");
-
- // Use [^>]* instead of .* to prevent a match against two separate <img> tags
- rep(/<img[^>]*?width=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$1x$2]$3[/img]");
- rep(/<img[^>]*?height=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$2x$1]$3[/img]");
- rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$3x$2]$1[/img]");
- rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$2x$3]$1[/img]");
- rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img]$1[/img]");
-
- rep(/<ul class=\"listbullet\" style=\"list-style-type\: circle\;\">(.*?)<\/ul>/gi,"[list]$1[/list]");
- rep(/<ul class=\"listnone\" style=\"list-style-type\: none\;\">(.*?)<\/ul>/gi,"[list=]$1[/list]");
- rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");
- rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");
- rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");
- rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");
- rep(/<ul class=\"listupperalpha\" style=\"list-style-type\: upper-alpha\;\">(.*?)<\/ul>/gi,"[list=A]$1[/list]");
- rep(/<li>(.*?)<\/li>/gi,'[li]$1[/li]');
-
- //rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
- rep(/<\/(strong|b)>/gi,"[/b]");
- rep(/<(strong|b)>/gi,"[b]");
- rep(/<\/(em|i)>/gi,"[/i]");
- rep(/<(em|i)>/gi,"[i]");
- rep(/<\/u>/gi,"[/u]");
- rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
- rep(/<u>/gi,"[u]");
- rep(/<blockquote[^>]*>/gi,"[quote]");
- rep(/<\/blockquote>/gi,"[/quote]");
- rep(/<hr \/>/gi,"[hr]");
- rep(/<br (.*?)\/>/gi,"\n");
- rep(/<br\/>/gi,"\n");
- rep(/<br>/gi,"\n");
- rep(/<p>/gi,"");
- rep(/<\/p>/gi,"\n");
- rep(/ |\u00a0/gi," ");
- rep(/"/gi,"\"");
- rep(/</gi,"<");
- rep(/>/gi,">");
- rep(/&/gi,"&");
-
- // Hack to fix an annoying bug of TinyMCE where block formats don't
- // work when forced_root_block = ''. So set forced_root_block = 'div'
- // and then strip out the divs manually
- rep(/<div>/gi,"");
- rep(/<\/div>/gi,"");
-
- if(codes != null) {
- for(var i=0; i<codes.length; i++) {
- codes[i] = codes[i].replace("<code>","");
- codes[i] = codes[i].replace("</code>","");
- rep(/\[\$!\$!CODEBLOCK!\$!\$\]/i,"[code]"+codes[i]+"[/code]");
- }
- }
-
- return s;
- },
-
- // BBCode -> HTML from DFRN dialect
- _dfrn_bbcode2html : function(s) {
- s = tinymce.trim(s);
-
-
- function rep(re, str) {
-
-
- /*//modify code to keep stuff intact within [code][/code] blocks
- //Waitman Gobble NO WARRANTY
-
-
- var o = new Array();
- var x = s.split("[code]");
- var i = 0;
-
- var si = "";
- si = x.shift();
- si = si.replace(re,str);
- o.push(si);
-
- for (i = 0; i < x.length; i++) {
- var no = new Array();
- var j = x.shift();
- var g = j.split("[/code]");
- no.push(g.shift());
- si = g.shift();
- si = si.replace(re,str);
- no.push(si);
- o.push(no.join("[/code]"));
- }
-
- s = o.join("[code]");*/
-
- s = s.replace(re, str);
-
- };
-
-
-
- function get(re) {
- return s.match(re);
- }
-
-
-
- // Preserve HTML tags inside code blocks
- var codes = get(/\[code\](.*?)\[\/code\]/gi);
- rep(/\[code\](.*?)\[\/code\]/gi,"[$!$!CODEBLOCK!$!$]");
-
- // example: [b] to <strong>
- rep(/\n/gi,"<br />");
- rep(/\[b\]/gi,"<strong>");
- rep(/\[\/b\]/gi,"</strong>");
- rep(/\[i\]/gi,"<em>");
- rep(/\[\/i\]/gi,"</em>");
- rep(/\[u\]/gi,"<u>");
- rep(/\[\/u\]/gi,"</u>");
- rep(/\[hr\]/gi,"<hr />");
- rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");
- rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
- rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
- rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");
- rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
-
- rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');
- rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');
- rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');
- rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');
- rep(/\[list=I\](.*?)\[\/list\]/gi, '<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');
- rep(/\[list=a\](.*?)\[\/list\]/gi, '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');
- rep(/\[list=A\](.*?)\[\/list\]/gi, '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');
- rep(/\[li\](.*?)\[\/li\]/gi, '<li>$1</li>');
- rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<span style=\"color: $1;\">$2</span>");
- rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"<span style=\"font-size: $1;\">$2</span>");
- //rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");
- rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
-
- /* oembed */
- function _b2h_cb(match, url) {
- url = bin2hex(url);
- function s_b2h(data) {
- match = data;
- }
- $.ajax({
- url: 'oembed/b2h?url=' + url,
- async: false,
- success: s_b2h,
- dataType: 'html'
- });
- return match;
- }
-
- s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
-
- /* /oembed */
-
- if(codes != null) {
- for(var i=0; i<codes.length; i++) {
- codes[i] = codes[i].replace("[code]","");
- codes[i] = codes[i].replace("[/code]","");
- rep(/\[\$!\$!CODEBLOCK!\$!\$\]/i,"<code>"+codes[i]+"</code>");
- }
- }
-
- return s;
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
-})();
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.BBCodePlugin', {\r
- init : function(ed, url) {\r
- var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();\r
-\r
- ed.onBeforeSetContent.add(function(ed, o) {\r
- o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
- });\r
-\r
- ed.onPostProcess.add(function(ed, o) {\r
- if (o.set)\r
- o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
-\r
- if (o.get)\r
- o.content = t['_' + dialect + '_html2bbcode'](o.content);\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'BBCode Plugin',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- // Private methods\r
-\r
- // HTML -> BBCode in PunBB dialect\r
- _punbb_html2bbcode : function(s) {\r
- s = tinymce.trim(s);\r
-\r
- function rep(re, str) {\r
- s = s.replace(re, str);\r
- };\r
-\r
- // example: <strong> to [b]\r
- rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");\r
- rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");\r
- rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");\r
- rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");\r
- rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");\r
- rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");\r
- rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");\r
- rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");\r
- rep(/<font>(.*?)<\/font>/gi,"$1");\r
- rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");\r
- rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");\r
- rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");\r
- rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");\r
- rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");\r
- rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");\r
- rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");\r
- rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");\r
- rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");\r
- rep(/<\/(strong|b)>/gi,"[/b]");\r
- rep(/<(strong|b)>/gi,"[b]");\r
- rep(/<\/(em|i)>/gi,"[/i]");\r
- rep(/<(em|i)>/gi,"[i]");\r
- rep(/<\/u>/gi,"[/u]");\r
- rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");\r
- rep(/<u>/gi,"[u]");\r
- rep(/<blockquote[^>]*>/gi,"[quote]");\r
- rep(/<\/blockquote>/gi,"[/quote]");\r
- rep(/<br \/>/gi,"\n");\r
- rep(/<br\/>/gi,"\n");\r
- rep(/<br>/gi,"\n");\r
- rep(/<p>/gi,"");\r
- rep(/<\/p>/gi,"\n");\r
- rep(/ |\u00a0/gi," ");\r
- rep(/"/gi,"\"");\r
- rep(/</gi,"<");\r
- rep(/>/gi,">");\r
- rep(/&/gi,"&");\r
-\r
- return s; \r
- },\r
-\r
- // BBCode -> HTML from PunBB dialect\r
- _punbb_bbcode2html : function(s) {\r
- s = tinymce.trim(s);\r
-\r
- function rep(re, str) {\r
- s = s.replace(re, str);\r
- };\r
-\r
- // example: [b] to <strong>\r
- rep(/\n/gi,"<br />");\r
- rep(/\[b\]/gi,"<strong>");\r
- rep(/\[\/b\]/gi,"</strong>");\r
- rep(/\[i\]/gi,"<em>");\r
- rep(/\[\/i\]/gi,"</em>");\r
- rep(/\[u\]/gi,"<u>");\r
- rep(/\[\/u\]/gi,"</u>");\r
- rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");\r
- rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");\r
- rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");\r
- rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");\r
- rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> ");\r
- rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");\r
-\r
- return s; \r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(f){var i=this,g,d,j,e;i.editor=f;d=f.settings.contextmenu_never_use_native;i.onContextMenu=new tinymce.util.Dispatcher(this);e=function(k){h(f,k)};g=f.onContextMenu.add(function(k,l){if((j!==0?j:l.ctrlKey)&&!d){return}a.cancel(l);if(l.target.nodeName=="IMG"){k.selection.select(l.target)}i._getMenu(k).showMenu(l.clientX||l.pageX,l.clientY||l.pageY);a.add(k.getDoc(),"click",e);k.nodeChanged()});f.onRemove.add(function(){if(i._menu){i._menu.removeAll()}});function h(k,l){j=0;if(l&&l.button==2){j=l.ctrlKey;return}if(i._menu){i._menu.removeAll();i._menu.destroy();a.remove(k.getDoc(),"click",e);i._menu=null}}f.onMouseDown.add(h);f.onKeyDown.add(h);f.onKeyDown.add(function(k,l){if(l.shiftKey&&!l.ctrlKey&&!l.altKey&&l.keyCode===121){a.cancel(l);g(k,l)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;\r
-\r
- /**\r
- * This plugin a context menu to TinyMCE editor instances.\r
- *\r
- * @class tinymce.plugins.ContextMenu\r
- */\r
- tinymce.create('tinymce.plugins.ContextMenu', {\r
- /**\r
- * Initializes the plugin, this will be executed after the plugin has been created.\r
- * This call is done before the editor instance has finished it's initialization so use the onInit event\r
- * of the editor instance to intercept that event.\r
- *\r
- * @method init\r
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
- * @param {string} url Absolute URL to where the plugin is located.\r
- */\r
- init : function(ed) {\r
- var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu;\r
-\r
- t.editor = ed;\r
-\r
- contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native;\r
-\r
- /**\r
- * This event gets fired when the context menu is shown.\r
- *\r
- * @event onContextMenu\r
- * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.\r
- * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.\r
- */\r
- t.onContextMenu = new tinymce.util.Dispatcher(this);\r
-\r
- hideMenu = function(e) {\r
- hide(ed, e);\r
- };\r
-\r
- showMenu = ed.onContextMenu.add(function(ed, e) {\r
- // Block TinyMCE menu on ctrlKey and work around Safari issue\r
- if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)\r
- return;\r
-\r
- Event.cancel(e);\r
-\r
- // Select the image if it's clicked. WebKit would other wise expand the selection\r
- if (e.target.nodeName == 'IMG')\r
- ed.selection.select(e.target);\r
-\r
- t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);\r
- Event.add(ed.getDoc(), 'click', hideMenu);\r
-\r
- ed.nodeChanged();\r
- });\r
- \r
- ed.onRemove.add(function() {\r
- if (t._menu)\r
- t._menu.removeAll();\r
- });\r
-\r
- function hide(ed, e) {\r
- realCtrlKey = 0;\r
-\r
- // Since the contextmenu event moves\r
- // the selection we need to store it away\r
- if (e && e.button == 2) {\r
- realCtrlKey = e.ctrlKey;\r
- return;\r
- }\r
-\r
- if (t._menu) {\r
- t._menu.removeAll();\r
- t._menu.destroy();\r
- Event.remove(ed.getDoc(), 'click', hideMenu);\r
- t._menu = null;\r
- }\r
- };\r
-\r
- ed.onMouseDown.add(hide);\r
- ed.onKeyDown.add(hide);\r
- ed.onKeyDown.add(function(ed, e) {\r
- if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) {\r
- Event.cancel(e);\r
- showMenu(ed, e);\r
- }\r
- });\r
- },\r
-\r
- /**\r
- * Returns information about the plugin as a name/value array.\r
- * The current keys are longname, author, authorurl, infourl and version.\r
- *\r
- * @method getInfo\r
- * @return {Object} Name/value array containing information about the plugin.\r
- */\r
- getInfo : function() {\r
- return {\r
- longname : 'Contextmenu',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- _getMenu : function(ed) {\r
- var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p;\r
-\r
- if (m) {\r
- m.removeAll();\r
- m.destroy();\r
- }\r
-\r
- p = DOM.getPos(ed.getContentAreaContainer());\r
-\r
- m = ed.controlManager.createDropMenu('contextmenu', {\r
- offset_x : p.x + ed.getParam('contextmenu_offset_x', 0),\r
- offset_y : p.y + ed.getParam('contextmenu_offset_y', 0),\r
- constrain : 1,\r
- keyboard_focus: true\r
- });\r
-\r
- t._menu = m;\r
-\r
- m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);\r
- m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);\r
- m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});\r
-\r
- if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {\r
- m.addSeparator();\r
- m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});\r
- m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});\r
- }\r
-\r
- m.addSeparator();\r
- m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});\r
-\r
- m.addSeparator();\r
- am = m.addMenu({title : 'contextmenu.align'});\r
- am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});\r
- am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});\r
- am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});\r
- am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});\r
-\r
- t.onContextMenu.dispatch(t, m, el, col);\r
-\r
- return m;\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);\r
-})();\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.Directionality', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
-\r
- function setDir(dir) {\r
- var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks();\r
-\r
- if (blocks.length) {\r
- curDir = dom.getAttrib(blocks[0], "dir");\r
-\r
- tinymce.each(blocks, function(block) {\r
- // Add dir to block if the parent block doesn't already have that dir\r
- if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {\r
- if (curDir != dir) {\r
- dom.setAttrib(block, "dir", dir);\r
- } else {\r
- dom.setAttrib(block, "dir", null);\r
- }\r
- }\r
- });\r
-\r
- ed.nodeChanged();\r
- }\r
- }\r
-\r
- ed.addCommand('mceDirectionLTR', function() {\r
- setDir("ltr");\r
- });\r
-\r
- ed.addCommand('mceDirectionRTL', function() {\r
- setDir("rtl");\r
- });\r
-\r
- ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});\r
- ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});\r
-\r
- ed.onNodeChange.add(t._nodeChange, t);\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Directionality',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- // Private methods\r
-\r
- _nodeChange : function(ed, cm, n) {\r
- var dom = ed.dom, dir;\r
-\r
- n = dom.getParent(n, dom.isBlock);\r
- if (!n) {\r
- cm.setDisabled('ltr', 1);\r
- cm.setDisabled('rtl', 1);\r
- return;\r
- }\r
-\r
- dir = dom.getAttrib(n, 'dir');\r
- cm.setActive('ltr', dir == "ltr");\r
- cm.setDisabled('ltr', 0);\r
- cm.setActive('rtl', dir == "rtl");\r
- cm.setDisabled('rtl', 0);\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce);
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function(tinymce) {\r
- tinymce.create('tinymce.plugins.EmotionsPlugin', {\r
- init : function(ed, url) {\r
- // Register commands\r
- ed.addCommand('mceEmotion', function() {\r
- ed.windowManager.open({\r
- file : url + '/emotions.htm',\r
- width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),\r
- height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Emotions',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);\r
-})(tinymce);
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#emotions_dlg.title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/emotions.js"></script>\r
-</head>\r
-<body style="display: none" role="application" aria-labelledby="app_title">\r
-<span style="display:none;" id="app_title">{#emotions_dlg.title}</span>\r
-<div align="center">\r
- <div class="title">{#emotions_dlg.title}:<br /><br /></div>\r
-\r
- <table id="emoticon_table" role="presentation" border="0" cellspacing="0" cellpadding="4">\r
- <tr>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.cool}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.cry}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.embarassed}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.foot_in_mouth}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}. {#emotions_dlg.usage}" /></a></td>\r
- </tr>\r
- <tr>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.frown}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.innocent}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.kiss}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.laughing}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}. {#emotions_dlg.usage}" /></a></td>\r
- </tr>\r
- <tr>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.money_mouth}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}. {#emotions_dlg.usage}"/></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.sealed}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.smile}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.surprised}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}. {#emotions_dlg.usage}" /></a></td>\r
- </tr>\r
- <tr>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.tongue_out}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.undecided}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.wink}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}. {#emotions_dlg.usage}" /></a></td>\r
- <td><a class="emoticon_link" role="button" title="{#emotions_dlg.yell}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}. {#emotions_dlg.usage}" /></a></td>\r
- </tr>\r
- </table>\r
- <div>{#emotions_dlg.usage}</div>\r
-</div>\r
-</body>\r
-</html>\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var EmotionsDialog = {\r
- addKeyboardNavigation: function(){\r
- var tableElm, cells, settings;\r
- \r
- cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table");\r
- \r
- settings ={\r
- root: "emoticon_table",\r
- items: cells\r
- };\r
- cells[0].tabindex=0;\r
- tinyMCEPopup.dom.addClass(cells[0], "mceFocus");\r
- if (tinymce.isGecko) {\r
- cells[0].focus(); \r
- } else {\r
- setTimeout(function(){\r
- cells[0].focus();\r
- }, 100);\r
- }\r
- tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);\r
- }, \r
- init : function(ed) {\r
- tinyMCEPopup.resizeToInnerSize();\r
- this.addKeyboardNavigation();\r
- },\r
-\r
- insert : function(file, title) {\r
- var ed = tinyMCEPopup.editor, dom = ed.dom;\r
-\r
- tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {\r
- src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,\r
- alt : ed.getLang(title),\r
- title : ed.getLang(title),\r
- border : 0\r
- }));\r
-\r
- tinyMCEPopup.close();\r
- }\r
-};\r
-\r
-tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);\r
+++ /dev/null
-tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"});
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#example_dlg.title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/dialog.js"></script>\r
-</head>\r
-<body>\r
-\r
-<form onsubmit="ExampleDialog.insert();return false;" action="#">\r
- <p>Here is a example dialog.</p>\r
- <p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p>\r
- <p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p>\r
-\r
- <div class="mceActionPanel">\r
- <input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- // Load plugin specific language pack\r
- tinymce.PluginManager.requireLangPack('example');\r
-\r
- tinymce.create('tinymce.plugins.ExamplePlugin', {\r
- /**\r
- * Initializes the plugin, this will be executed after the plugin has been created.\r
- * This call is done before the editor instance has finished it's initialization so use the onInit event\r
- * of the editor instance to intercept that event.\r
- *\r
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
- * @param {string} url Absolute URL to where the plugin is located.\r
- */\r
- init : function(ed, url) {\r
- // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');\r
- ed.addCommand('mceExample', function() {\r
- ed.windowManager.open({\r
- file : url + '/dialog.htm',\r
- width : 320 + parseInt(ed.getLang('example.delta_width', 0)),\r
- height : 120 + parseInt(ed.getLang('example.delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url, // Plugin absolute URL\r
- some_custom_arg : 'custom arg' // Custom argument\r
- });\r
- });\r
-\r
- // Register example button\r
- ed.addButton('example', {\r
- title : 'example.desc',\r
- cmd : 'mceExample',\r
- image : url + '/img/example.gif'\r
- });\r
-\r
- // Add a node change handler, selects the button in the UI when a image is selected\r
- ed.onNodeChange.add(function(ed, cm, n) {\r
- cm.setActive('example', n.nodeName == 'IMG');\r
- });\r
- },\r
-\r
- /**\r
- * Creates control instances based in the incomming name. This method is normally not\r
- * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons\r
- * but you sometimes need to create more complex controls like listboxes, split buttons etc then this\r
- * method can be used to create those.\r
- *\r
- * @param {String} n Name of the control to create.\r
- * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.\r
- * @return {tinymce.ui.Control} New control instance or null if no control was created.\r
- */\r
- createControl : function(n, cm) {\r
- return null;\r
- },\r
-\r
- /**\r
- * Returns information about the plugin as a name/value array.\r
- * The current keys are longname, author, authorurl, infourl and version.\r
- *\r
- * @return {Object} Name/value array containing information about the plugin.\r
- */\r
- getInfo : function() {\r
- return {\r
- longname : 'Example plugin',\r
- author : 'Some author',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',\r
- version : "1.0"\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var ExampleDialog = {\r
- init : function() {\r
- var f = document.forms[0];\r
-\r
- // Get the selected contents as text and place it in the input\r
- f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});\r
- f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');\r
- },\r
-\r
- insert : function() {\r
- // Insert the contents from the input into the document\r
- tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);\r
- tinyMCEPopup.close();\r
- }\r
-};\r
-\r
-tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);\r
+++ /dev/null
-tinyMCE.addI18n('en.example',{\r
- desc : 'This is just a template button'\r
-});\r
+++ /dev/null
-tinyMCE.addI18n('en.example_dlg',{\r
- title : 'This is just a example title'\r
-});\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.ExampleDependencyPlugin",{init:function(a,b){},getInfo:function(){return{longname:"Example Dependency plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency",version:"1.0"}}});tinymce.PluginManager.add("example_dependency",tinymce.plugins.ExampleDependencyPlugin,["example"])})();
\ No newline at end of file
+++ /dev/null
-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
-
- tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
- /**
- * Initializes the plugin, this will be executed after the plugin has been created.
- * This call is done before the editor instance has finished it's initialization so use the onInit event
- * of the editor instance to intercept that event.
- *
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
- * @param {string} url Absolute URL to where the plugin is located.
- */
- init : function(ed, url) {
- },
-
-
- /**
- * Returns information about the plugin as a name/value array.
- * The current keys are longname, author, authorurl, infourl and version.
- *
- * @return {Object} Name/value array containing information about the plugin.
- */
- getInfo : function() {
- return {
- longname : 'Example Dependency plugin',
- author : 'Some author',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
- version : "1.0"
- };
- }
- });
-
- /**
- * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
- * plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
- * plugins in a depends list should typically be specified using the short name). If neccesary this can be done
- * with an object which has the url to the plugin and the shortname.
- */
- tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
-})();
+++ /dev/null
-/* Hide the advanced tab */\r
-#advanced_tab {\r
- display: none;\r
-}\r
-\r
-#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright {\r
- width: 280px;\r
-}\r
-\r
-#doctype, #docencoding {\r
- width: 200px;\r
-}\r
-\r
-#langcode {\r
- width: 30px;\r
-}\r
-\r
-#bgimage {\r
- width: 220px; \r
-}\r
-\r
-#fontface {\r
- width: 240px;\r
-}\r
-\r
-#leftmargin, #rightmargin, #topmargin, #bottommargin {\r
- width: 50px;\r
-}\r
-\r
-.panel_wrapper div.current {\r
- height: 400px;\r
-}\r
-\r
-#stylesheet, #style {\r
- width: 240px;\r
-}\r
-\r
-#doctypes {\r
- width: 200px;\r
-}\r
-\r
-/* Head list classes */\r
-\r
-.headlistwrapper {\r
- width: 100%;\r
-}\r
-\r
-.selected {\r
- border: 1px solid #0A246A;\r
- background-color: #B6BDD2;\r
-}\r
-\r
-.toolbar {\r
- width: 100%;\r
-}\r
-\r
-#headlist {\r
- width: 100%;\r
- margin-top: 3px;\r
- font-size: 11px;\r
-}\r
-\r
-#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {\r
- display: none;\r
-}\r
-\r
-#addmenu {\r
- position: absolute;\r
- border: 1px solid gray;\r
- display: none;\r
- z-index: 100;\r
- background-color: white;\r
-}\r
-\r
-#addmenu a {\r
- display: block;\r
- width: 100%;\r
- line-height: 20px;\r
- text-decoration: none;\r
- background-color: white;\r
-}\r
-\r
-#addmenu a:hover {\r
- background-color: #B6BDD2;\r
- color: black;\r
-}\r
-\r
-#addmenu span {\r
- padding-left: 10px;\r
- padding-right: 10px;\r
-}\r
-\r
-#updateElementPanel {\r
- display: none;\r
-}\r
-\r
-#script_element .panel_wrapper div.current {\r
- height: 108px;\r
-}\r
-\r
-#style_element .panel_wrapper div.current {\r
- height: 108px;\r
-}\r
-\r
-#link_element .panel_wrapper div.current {\r
- height: 140px;\r
-}\r
-\r
-#element_script_value {\r
- width: 100%;\r
- height: 100px;\r
-}\r
-\r
-#element_comment_value {\r
- width: 100%;\r
- height: 120px;\r
-}\r
-\r
-#element_style_value {\r
- width: 100%;\r
- height: 100px;\r
-}\r
-\r
-#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {\r
- width: 250px;\r
-}\r
-\r
-.updateElementButton {\r
- margin-top: 3px;\r
-}\r
-\r
-/* MSIE specific styles */\r
-\r
-* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {\r
- width: 22px;\r
- height: 22px;\r
-}\r
-\r
-textarea {\r
- height: 55px;\r
-}\r
-\r
-.panel_wrapper div.current {height:420px;}
\ No newline at end of file
+++ /dev/null
-(function(){var b=tinymce.each,a=tinymce.html.Node;tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(c,d){var e=this;e.editor=c;c.addCommand("mceFullPageProperties",function(){c.windowManager.open({file:d+"/fullpage.htm",width:430+parseInt(c.getLang("fullpage.delta_width",0)),height:495+parseInt(c.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:d,data:e._htmlToData()})});c.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});c.onBeforeSetContent.add(e._setContent,e);c.onGetContent.add(e._getContent,e)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_htmlToData:function(){var f=this._parseHeader(),h={},c,i,g,e=this.editor;function d(l,j){var k=l.attr(j);return k||""}h.fontface=e.getParam("fullpage_default_fontface","");h.fontsize=e.getParam("fullpage_default_fontsize","");i=f.firstChild;if(i.type==7){h.xml_pi=true;g=/encoding="([^"]+)"/.exec(i.value);if(g){h.docencoding=g[1]}}i=f.getAll("#doctype")[0];if(i){h.doctype="<!DOCTYPE"+i.value+">"}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n<l.length;n++){p=l[n];if(p.attr("name")==m){if(o){p.attr("content",o)}else{p.remove()}return}}if(o){j=new a("meta",1);j.attr("name",m);j.attr("content",o);j.shortEnded=true;i(j)}});j=f.getAll("link")[0];if(j&&j.attr("rel")=="stylesheet"){if(g.stylesheet){j.attr("href",g.stylesheet)}else{j.remove()}}else{if(g.stylesheet){j=new a("link",1);j.attr({rel:"stylesheet",text:"text/css",href:g.stylesheet});j.shortEnded=true;i(j)}}j=f.getAll("body")[0];if(j){c(j,"dir",g.langdir);c(j,"style",g.style);c(j,"vlink",g.visited_color);c(j,"link",g.link_color);c(j,"alink",g.active_color);e.setAttribs(this.editor.getBody(),{style:g.style,dir:g.dir,vLink:g.visited_color,link:g.link_color,aLink:g.active_color})}j=f.getAll("html")[0];if(j){c(j,"lang",g.langcode);c(j,"xml:lang",g.langcode)}h=new tinymce.html.Serializer({validate:false,indent:true,apply_source_formatting:true,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(f);this.head=h.substring(0,h.indexOf("</body>"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("<body");if(i!=-1){i=h.indexOf(">",i);m.head=k(h.substring(0,i+1));c=h.indexOf("</body",i);if(c==-1){c=h.length}d.content=h.substring(i+1,c);m.foot=k(h.substring(c))}else{m.head=this._getDefaultHeader();m.foot="\n</body>\n</html>"}f=m._parseHeader();b(f.getAll("style"),function(n){if(n.firstChild){l+=n.firstChild.value}});j=f.getAll("body")[0];if(j){e.setAttribs(m.editor.getBody(),{style:j.attr("style")||"",dir:j.attr("dir")||"",vLink:j.attr("vlink")||"",link:j.attr("link")||"",aLink:j.attr("alink")||""})}e.remove("fullpage_styles");if(l){e.add(m.editor.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},l);j=e.get("fullpage_styles");if(j.styleSheet){j.styleSheet.cssText=l}}},_getDefaultHeader:function(){var f="",c=this.editor,e,d="";if(c.getParam("fullpage_default_xml_pi")){f+='<?xml version="1.0" encoding="'+c.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}f+=c.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');f+="\n<html>\n<head>\n";if(e=c.getParam("fullpage_default_title")){f+="<title>"+e+"</title>\n"}if(e=c.getParam("fullpage_default_encoding")){f+='<meta http-equiv="Content-Type" content="text/html; charset='+e+'" />\n'}if(e=c.getParam("fullpage_default_font_family")){d+="font-family: "+e+";"}if(e=c.getParam("fullpage_default_font_size")){d+="font-size: "+e+";"}if(e=c.getParam("fullpage_default_text_color")){d+="color: "+e+";"}f+="</head>\n<body"+(d?' style="'+d+'"':"")+">\n";return f},_getContent:function(d,e){var c=this;if(!e.source_view||!d.getParam("fullpage_hide_in_source_view")){e.content=tinymce.trim(c.head)+"\n"+tinymce.trim(e.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var each = tinymce.each, Node = tinymce.html.Node;\r
-\r
- tinymce.create('tinymce.plugins.FullPagePlugin', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
-\r
- // Register commands\r
- ed.addCommand('mceFullPageProperties', function() {\r
- ed.windowManager.open({\r
- file : url + '/fullpage.htm',\r
- width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),\r
- height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url,\r
- data : t._htmlToData()\r
- });\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});\r
-\r
- ed.onBeforeSetContent.add(t._setContent, t);\r
- ed.onGetContent.add(t._getContent, t);\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Fullpage',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- // Private plugin internal methods\r
-\r
- _htmlToData : function() {\r
- var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor;\r
-\r
- function getAttr(elm, name) {\r
- var value = elm.attr(name);\r
-\r
- return value || '';\r
- };\r
-\r
- // Default some values\r
- data.fontface = editor.getParam("fullpage_default_fontface", "");\r
- data.fontsize = editor.getParam("fullpage_default_fontsize", "");\r
-\r
- // Parse XML PI\r
- elm = headerFragment.firstChild;\r
- if (elm.type == 7) {\r
- data.xml_pi = true;\r
- matches = /encoding="([^"]+)"/.exec(elm.value);\r
- if (matches)\r
- data.docencoding = matches[1];\r
- }\r
-\r
- // Parse doctype\r
- elm = headerFragment.getAll('#doctype')[0];\r
- if (elm)\r
- data.doctype = '<!DOCTYPE' + elm.value + ">"; \r
-\r
- // Parse title element\r
- elm = headerFragment.getAll('title')[0];\r
- if (elm && elm.firstChild) {\r
- data.metatitle = elm.firstChild.value;\r
- }\r
-\r
- // Parse meta elements\r
- each(headerFragment.getAll('meta'), function(meta) {\r
- var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;\r
-\r
- if (name)\r
- data['meta' + name.toLowerCase()] = meta.attr('content');\r
- else if (httpEquiv == "Content-Type") {\r
- matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));\r
-\r
- if (matches)\r
- data.docencoding = matches[1];\r
- }\r
- });\r
-\r
- // Parse html attribs\r
- elm = headerFragment.getAll('html')[0];\r
- if (elm)\r
- data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');\r
- \r
- // Parse stylesheet\r
- elm = headerFragment.getAll('link')[0];\r
- if (elm && elm.attr('rel') == 'stylesheet')\r
- data.stylesheet = elm.attr('href');\r
-\r
- // Parse body parts\r
- elm = headerFragment.getAll('body')[0];\r
- if (elm) {\r
- data.langdir = getAttr(elm, 'dir');\r
- data.style = getAttr(elm, 'style');\r
- data.visited_color = getAttr(elm, 'vlink');\r
- data.link_color = getAttr(elm, 'link');\r
- data.active_color = getAttr(elm, 'alink');\r
- }\r
-\r
- return data;\r
- },\r
-\r
- _dataToHtml : function(data) {\r
- var headerFragment, headElement, html, elm, value, dom = this.editor.dom;\r
-\r
- function setAttr(elm, name, value) {\r
- elm.attr(name, value ? value : undefined);\r
- };\r
-\r
- function addHeadNode(node) {\r
- if (headElement.firstChild)\r
- headElement.insert(node, headElement.firstChild);\r
- else\r
- headElement.append(node);\r
- };\r
-\r
- headerFragment = this._parseHeader();\r
- headElement = headerFragment.getAll('head')[0];\r
- if (!headElement) {\r
- elm = headerFragment.getAll('html')[0];\r
- headElement = new Node('head', 1);\r
-\r
- if (elm.firstChild)\r
- elm.insert(headElement, elm.firstChild, true);\r
- else\r
- elm.append(headElement);\r
- }\r
-\r
- // Add/update/remove XML-PI\r
- elm = headerFragment.firstChild;\r
- if (data.xml_pi) {\r
- value = 'version="1.0"';\r
-\r
- if (data.docencoding)\r
- value += ' encoding="' + data.docencoding + '"';\r
-\r
- if (elm.type != 7) {\r
- elm = new Node('xml', 7);\r
- headerFragment.insert(elm, headerFragment.firstChild, true);\r
- }\r
-\r
- elm.value = value;\r
- } else if (elm && elm.type == 7)\r
- elm.remove();\r
-\r
- // Add/update/remove doctype\r
- elm = headerFragment.getAll('#doctype')[0];\r
- if (data.doctype) {\r
- if (!elm) {\r
- elm = new Node('#doctype', 10);\r
-\r
- if (data.xml_pi)\r
- headerFragment.insert(elm, headerFragment.firstChild);\r
- else\r
- addHeadNode(elm);\r
- }\r
-\r
- elm.value = data.doctype.substring(9, data.doctype.length - 1);\r
- } else if (elm)\r
- elm.remove();\r
-\r
- // Add/update/remove title\r
- elm = headerFragment.getAll('title')[0];\r
- if (data.metatitle) {\r
- if (!elm) {\r
- elm = new Node('title', 1);\r
- elm.append(new Node('#text', 3)).value = data.metatitle;\r
- addHeadNode(elm);\r
- }\r
- }\r
-\r
- // Add meta encoding\r
- if (data.docencoding) {\r
- elm = null;\r
- each(headerFragment.getAll('meta'), function(meta) {\r
- if (meta.attr('http-equiv') == 'Content-Type')\r
- elm = meta;\r
- });\r
-\r
- if (!elm) {\r
- elm = new Node('meta', 1);\r
- elm.attr('http-equiv', 'Content-Type');\r
- elm.shortEnded = true;\r
- addHeadNode(elm);\r
- }\r
-\r
- elm.attr('content', 'text/html; charset=' + data.docencoding);\r
- }\r
-\r
- // Add/update/remove meta\r
- each('keywords,description,author,copyright,robots'.split(','), function(name) {\r
- var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name];\r
-\r
- for (i = 0; i < nodes.length; i++) {\r
- meta = nodes[i];\r
-\r
- if (meta.attr('name') == name) {\r
- if (value)\r
- meta.attr('content', value);\r
- else\r
- meta.remove();\r
-\r
- return;\r
- }\r
- }\r
-\r
- if (value) {\r
- elm = new Node('meta', 1);\r
- elm.attr('name', name);\r
- elm.attr('content', value);\r
- elm.shortEnded = true;\r
-\r
- addHeadNode(elm);\r
- }\r
- });\r
-\r
- // Add/update/delete link\r
- elm = headerFragment.getAll('link')[0];\r
- if (elm && elm.attr('rel') == 'stylesheet') {\r
- if (data.stylesheet)\r
- elm.attr('href', data.stylesheet);\r
- else\r
- elm.remove();\r
- } else if (data.stylesheet) {\r
- elm = new Node('link', 1);\r
- elm.attr({\r
- rel : 'stylesheet',\r
- text : 'text/css',\r
- href : data.stylesheet\r
- });\r
- elm.shortEnded = true;\r
-\r
- addHeadNode(elm);\r
- }\r
-\r
- // Update body attributes\r
- elm = headerFragment.getAll('body')[0];\r
- if (elm) {\r
- setAttr(elm, 'dir', data.langdir);\r
- setAttr(elm, 'style', data.style);\r
- setAttr(elm, 'vlink', data.visited_color);\r
- setAttr(elm, 'link', data.link_color);\r
- setAttr(elm, 'alink', data.active_color);\r
-\r
- // Update iframe body as well\r
- dom.setAttribs(this.editor.getBody(), {\r
- style : data.style,\r
- dir : data.dir,\r
- vLink : data.visited_color,\r
- link : data.link_color,\r
- aLink : data.active_color\r
- });\r
- }\r
-\r
- // Set html attributes\r
- elm = headerFragment.getAll('html')[0];\r
- if (elm) {\r
- setAttr(elm, 'lang', data.langcode);\r
- setAttr(elm, 'xml:lang', data.langcode);\r
- }\r
-\r
- // Serialize header fragment and crop away body part\r
- html = new tinymce.html.Serializer({\r
- validate: false,\r
- indent: true,\r
- apply_source_formatting : true,\r
- indent_before: 'head,html,body,meta,title,script,link,style',\r
- indent_after: 'head,html,body,meta,title,script,link,style'\r
- }).serialize(headerFragment);\r
-\r
- this.head = html.substring(0, html.indexOf('</body>'));\r
- },\r
-\r
- _parseHeader : function() {\r
- // Parse the contents with a DOM parser\r
- return new tinymce.html.DomParser({\r
- validate: false,\r
- root_name: '#document'\r
- }).parse(this.head);\r
- },\r
-\r
- _setContent : function(ed, o) {\r
- var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm;\r
-\r
- function low(s) {\r
- return s.replace(/<\/?[A-Z]+/g, function(a) {\r
- return a.toLowerCase();\r
- })\r
- };\r
-\r
- // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate\r
- if (o.format == 'raw' && self.head)\r
- return;\r
-\r
- if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))\r
- return;\r
-\r
- // Parse out head, body and footer\r
- content = content.replace(/<(\/?)BODY/gi, '<$1body');\r
- startPos = content.indexOf('<body');\r
-\r
- if (startPos != -1) {\r
- startPos = content.indexOf('>', startPos);\r
- self.head = low(content.substring(0, startPos + 1));\r
-\r
- endPos = content.indexOf('</body', startPos);\r
- if (endPos == -1)\r
- endPos = content.length;\r
-\r
- o.content = content.substring(startPos + 1, endPos);\r
- self.foot = low(content.substring(endPos));\r
- } else {\r
- self.head = this._getDefaultHeader();\r
- self.foot = '\n</body>\n</html>';\r
- }\r
-\r
- // Parse header and update iframe\r
- headerFragment = self._parseHeader();\r
- each(headerFragment.getAll('style'), function(node) {\r
- if (node.firstChild)\r
- styles += node.firstChild.value;\r
- });\r
-\r
- elm = headerFragment.getAll('body')[0];\r
- if (elm) {\r
- dom.setAttribs(self.editor.getBody(), {\r
- style : elm.attr('style') || '',\r
- dir : elm.attr('dir') || '',\r
- vLink : elm.attr('vlink') || '',\r
- link : elm.attr('link') || '',\r
- aLink : elm.attr('alink') || ''\r
- });\r
- }\r
-\r
- dom.remove('fullpage_styles');\r
-\r
- if (styles) {\r
- dom.add(self.editor.getDoc().getElementsByTagName('head')[0], 'style', {id : 'fullpage_styles'}, styles);\r
-\r
- // Needed for IE 6/7\r
- elm = dom.get('fullpage_styles');\r
- if (elm.styleSheet)\r
- elm.styleSheet.cssText = styles;\r
- }\r
- },\r
-\r
- _getDefaultHeader : function() {\r
- var header = '', editor = this.editor, value, styles = '';\r
-\r
- if (editor.getParam('fullpage_default_xml_pi'))\r
- header += '<?xml version="1.0" encoding="' + editor.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';\r
-\r
- header += editor.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');\r
- header += '\n<html>\n<head>\n';\r
-\r
- if (value = editor.getParam('fullpage_default_title'))\r
- header += '<title>' + value + '</title>\n';\r
-\r
- if (value = editor.getParam('fullpage_default_encoding'))\r
- header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';\r
-\r
- if (value = editor.getParam('fullpage_default_font_family'))\r
- styles += 'font-family: ' + value + ';';\r
-\r
- if (value = editor.getParam('fullpage_default_font_size'))\r
- styles += 'font-size: ' + value + ';';\r
-\r
- if (value = editor.getParam('fullpage_default_text_color'))\r
- styles += 'color: ' + value + ';';\r
-\r
- header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';\r
-\r
- return header;\r
- },\r
-\r
- _getContent : function(ed, o) {\r
- var self = this;\r
-\r
- if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))\r
- o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot);\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);\r
-})();\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#fullpage_dlg.title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="js/fullpage.js"></script>\r
- <link href="css/fullpage.css" rel="stylesheet" type="text/css" />\r
-</head>\r
-<body id="fullpage" style="display: none">\r
-<form onsubmit="FullPageDialog.update();return false;" name="fullpage" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li>\r
- <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="meta_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#fullpage_dlg.meta_props}</legend>\r
-\r
- <table border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label> </td>\r
- <td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label> </td>\r
- <td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label> </td>\r
- <td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label> </td>\r
- <td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label> </td>\r
- <td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label> </td>\r
- <td>\r
- <select id="metarobots" name="metarobots">\r
- <option value="">{#not_set}</option> \r
- <option value="index,follow">{#fullpage_dlg.meta_index_follow}</option>\r
- <option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option>\r
- <option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option>\r
- <option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option>\r
- </select>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset>\r
- <legend>{#fullpage_dlg.langprops}</legend>\r
-\r
- <table border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td> \r
- <td>\r
- <select id="docencoding" name="docencoding"> \r
- <option value="">{#not_set}</option>\r
- </select>\r
- </td> \r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="doctype">{#fullpage_dlg.doctypes}</label> </td>\r
- <td>\r
- <select id="doctype" name="doctype">\r
- <option value="">{#not_set}</option>\r
- </select>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label> </td>\r
- <td><input type="text" id="langcode" name="langcode" value="" /></td>\r
- </tr>\r
- <tr>\r
- <td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td> \r
- <td>\r
- <select id="langdir" name="langdir"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#fullpage_dlg.ltr}</option> \r
- <option value="rtl">{#fullpage_dlg.rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label> </td>\r
- <td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="appearance_panel" class="panel">\r
- <fieldset>\r
- <legend>{#fullpage_dlg.appearance_textprops}</legend>\r
-\r
- <table border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td> \r
- <td>\r
- <select id="fontface" name="fontface" onchange="FullPageDialog.changedStyleProp();">\r
- <option value="">{#not_set}</option>\r
- </select>\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td> \r
- <td>\r
- <select id="fontsize" name="fontsize" onchange="FullPageDialog.changedStyleProp();">\r
- <option value="">{#not_set}</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td> \r
- <td>\r
- <table border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');FullPageDialog.changedStyleProp();" /></td>\r
- <td id="textcolor_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset>\r
- <legend>{#fullpage_dlg.appearance_bgprops}</legend>\r
-\r
- <table border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td> \r
- <td>\r
- <table border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="bgimage" name="bgimage" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>\r
- <td id="bgimage_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td> \r
- <td>\r
- <table border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');FullPageDialog.changedStyleProp();" /></td>\r
- <td id="bgcolor_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset>\r
- <legend>{#fullpage_dlg.appearance_marginprops}</legend>\r
-\r
- <table border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td> \r
- <td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>\r
- <td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td> \r
- <td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>\r
- </tr>\r
- <tr>\r
- <td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td> \r
- <td><input id="topmargin" name="topmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>\r
- <td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td> \r
- <td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset>\r
- <legend>{#fullpage_dlg.appearance_linkprops}</legend>\r
-\r
- <table border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td> \r
- <td>\r
- <table border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');FullPageDialog.changedStyleProp();" /></td>\r
- <td id="link_color_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td> \r
- <td>\r
- <table border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');FullPageDialog.changedStyleProp();" /></td>\r
- <td id="visited_color_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td> \r
- <td>\r
- <table border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');FullPageDialog.changedStyleProp();" /></td>\r
- <td id="active_color_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td> </td>\r
- <td> </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset>\r
- <legend>{#fullpage_dlg.appearance_style}</legend>\r
-\r
- <table border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td> \r
- <td><table border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="stylesheet" name="stylesheet" type="text" value="" /></td>\r
- <td id="stylesheet_browsercontainer"> </td>\r
- </tr>\r
- </table></td>\r
- </tr>\r
- <tr>\r
- <td class="column1"><label for="style">{#fullpage_dlg.style}</label></td> \r
- <td><input id="style" name="style" type="text" value="" onchange="FullPageDialog.changedStyle();" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="update" value="{#update}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-/**\r
- * fullpage.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinyMCEPopup.requireLangPack();\r
-\r
- var defaultDocTypes = \r
- 'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +\r
- 'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +\r
- 'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +\r
- 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +\r
- 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +\r
- 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +\r
- 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';\r
-\r
- var defaultEncodings = \r
- 'Western european (iso-8859-1)=iso-8859-1,' +\r
- 'Central European (iso-8859-2)=iso-8859-2,' +\r
- 'Unicode (UTF-8)=utf-8,' +\r
- 'Chinese traditional (Big5)=big5,' +\r
- 'Cyrillic (iso-8859-5)=iso-8859-5,' +\r
- 'Japanese (iso-2022-jp)=iso-2022-jp,' +\r
- 'Greek (iso-8859-7)=iso-8859-7,' +\r
- 'Korean (iso-2022-kr)=iso-2022-kr,' +\r
- 'ASCII (us-ascii)=us-ascii';\r
-\r
- var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';\r
- var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';\r
-\r
- function setVal(id, value) {\r
- var elm = document.getElementById(id);\r
-\r
- if (elm) {\r
- value = value || '';\r
-\r
- if (elm.nodeName == "SELECT")\r
- selectByValue(document.forms[0], id, value);\r
- else if (elm.type == "checkbox")\r
- elm.checked = !!value;\r
- else\r
- elm.value = value;\r
- }\r
- };\r
-\r
- function getVal(id) {\r
- var elm = document.getElementById(id);\r
-\r
- if (elm.nodeName == "SELECT")\r
- return elm.options[elm.selectedIndex].value;\r
-\r
- if (elm.type == "checkbox")\r
- return elm.checked;\r
-\r
- return elm.value;\r
- };\r
-\r
- window.FullPageDialog = {\r
- changedStyle : function() {\r
- var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style'));\r
-\r
- setVal('fontface', styles['font-face']);\r
- setVal('fontsize', styles['font-size']);\r
- setVal('textcolor', styles['color']);\r
-\r
- if (val = styles['background-image'])\r
- setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"));\r
- else\r
- setVal('bgimage', '');\r
-\r
- setVal('bgcolor', styles['background-color']);\r
-\r
- // Reset margin form elements\r
- setVal('topmargin', '');\r
- setVal('rightmargin', '');\r
- setVal('bottommargin', '');\r
- setVal('leftmargin', '');\r
-\r
- // Expand margin\r
- if (val = styles['margin']) {\r
- val = val.split(' ');\r
- styles['margin-top'] = val[0] || '';\r
- styles['margin-right'] = val[1] || val[0] || '';\r
- styles['margin-bottom'] = val[2] || val[0] || '';\r
- styles['margin-left'] = val[3] || val[0] || '';\r
- }\r
-\r
- if (val = styles['margin-top'])\r
- setVal('topmargin', val.replace(/px/, ''));\r
-\r
- if (val = styles['margin-right'])\r
- setVal('rightmargin', val.replace(/px/, ''));\r
-\r
- if (val = styles['margin-bottom'])\r
- setVal('bottommargin', val.replace(/px/, ''));\r
-\r
- if (val = styles['margin-left'])\r
- setVal('leftmargin', val.replace(/px/, ''));\r
-\r
- updateColor('bgcolor_pick', 'bgcolor');\r
- updateColor('textcolor_pick', 'textcolor');\r
- },\r
-\r
- changedStyleProp : function() {\r
- var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style'));\r
- \r
- styles['font-face'] = getVal('fontface');\r
- styles['font-size'] = getVal('fontsize');\r
- styles['color'] = getVal('textcolor');\r
- styles['background-color'] = getVal('bgcolor');\r
-\r
- if (val = getVal('bgimage'))\r
- styles['background-image'] = "url('" + val + "')";\r
- else\r
- styles['background-image'] = '';\r
-\r
- delete styles['margin'];\r
-\r
- if (val = getVal('topmargin'))\r
- styles['margin-top'] = val + "px";\r
- else\r
- styles['margin-top'] = '';\r
-\r
- if (val = getVal('rightmargin'))\r
- styles['margin-right'] = val + "px";\r
- else\r
- styles['margin-right'] = '';\r
-\r
- if (val = getVal('bottommargin'))\r
- styles['margin-bottom'] = val + "px";\r
- else\r
- styles['margin-bottom'] = '';\r
-\r
- if (val = getVal('leftmargin'))\r
- styles['margin-left'] = val + "px";\r
- else\r
- styles['margin-left'] = '';\r
-\r
- // Serialize, parse and reserialize this will compress redundant styles\r
- setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles))));\r
- this.changedStyle();\r
- },\r
- \r
- update : function() {\r
- var data = {};\r
-\r
- tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) {\r
- data[node.id] = getVal(node.id);\r
- });\r
-\r
- tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data);\r
- tinyMCEPopup.close();\r
- }\r
- };\r
- \r
- function init() {\r
- var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor;\r
-\r
- // Setup doctype select box\r
- list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(',');\r
- for (i = 0; i < list.length; i++) {\r
- item = list[i].split('=');\r
-\r
- if (item.length > 1)\r
- addSelectValue(form, 'doctype', item[0], item[1]);\r
- }\r
-\r
- // Setup fonts select box\r
- list = editor.getParam("fullpage_fonts", defaultFontNames).split(';');\r
- for (i = 0; i < list.length; i++) {\r
- item = list[i].split('=');\r
-\r
- if (item.length > 1)\r
- addSelectValue(form, 'fontface', item[0], item[1]);\r
- }\r
-\r
- // Setup fontsize select box\r
- list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(',');\r
- for (i = 0; i < list.length; i++)\r
- addSelectValue(form, 'fontsize', list[i], list[i]);\r
-\r
- // Setup encodings select box\r
- list = editor.getParam("fullpage_encodings", defaultEncodings).split(',');\r
- for (i = 0; i < list.length; i++) {\r
- item = list[i].split('=');\r
-\r
- if (item.length > 1)\r
- addSelectValue(form, 'docencoding', item[0], item[1]);\r
- }\r
-\r
- // Setup color pickers\r
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
- document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');\r
- document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');\r
- document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');\r
- document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');\r
- document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');\r
- document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');\r
-\r
- // Resize some elements\r
- if (isVisible('stylesheetbrowser'))\r
- document.getElementById('stylesheet').style.width = '220px';\r
-\r
- if (isVisible('link_href_browser'))\r
- document.getElementById('element_link_href').style.width = '230px';\r
-\r
- if (isVisible('bgimage_browser'))\r
- document.getElementById('bgimage').style.width = '210px';\r
-\r
- // Update form\r
- tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) {\r
- setVal(key, value);\r
- });\r
-\r
- FullPageDialog.changedStyle();\r
-\r
- // Update colors\r
- updateColor('textcolor_pick', 'textcolor');\r
- updateColor('bgcolor_pick', 'bgcolor');\r
- updateColor('visited_color_pick', 'visited_color');\r
- updateColor('active_color_pick', 'active_color');\r
- updateColor('link_color_pick', 'link_color');\r
- };\r
-\r
- tinyMCEPopup.onInit.add(init);\r
-})();\r
+++ /dev/null
-tinyMCE.addI18n('en.fullpage_dlg',{title:"Document Properties","meta_tab":"General","appearance_tab":"Appearance","advanced_tab":"Advanced","meta_props":"Meta Information",langprops:"Language and Encoding","meta_title":"Title","meta_keywords":"Keywords","meta_description":"Description","meta_robots":"Robots",doctypes:"Doctype",langcode:"Language Code",langdir:"Language Direction",ltr:"Left to Right",rtl:"Right to Left","xml_pi":"XML Declaration",encoding:"Character Encoding","appearance_bgprops":"Background Properties","appearance_marginprops":"Body Margins","appearance_linkprops":"Link Colors","appearance_textprops":"Text Properties",bgcolor:"Background Color",bgimage:"Background Image","left_margin":"Left Margin","right_margin":"Right Margin","top_margin":"Top Margin","bottom_margin":"Bottom Margin","text_color":"Text Color","font_size":"Font Size","font_face":"Font Face","link_color":"Link Color","hover_color":"Hover Color","visited_color":"Visited Color","active_color":"Active Color",textcolor:"Color",fontsize:"Font Size",fontface:"Font Family","meta_index_follow":"Index and Follow the Links","meta_index_nofollow":"Index and Don\'t Follow the Links","meta_noindex_follow":"Do Not Index but Follow the Links","meta_noindex_nofollow":"Do Not Index and Don\'t Follow the Links","appearance_style":"Stylesheet and Style Properties",stylesheet:"Stylesheet",style:"Style",author:"Author",copyright:"Copyright",add:"Add New Element",remove:"Remove Selected Element",moveup:"Move Selected Element Up",movedown:"Move Selected Element Down","head_elements":"Head Elements",info:"Information","add_title":"Title Element","add_meta":"Meta Element","add_script":"Script Element","add_style":"Style Element","add_link":"Link Element","add_base":"Base Element","add_comment":"Comment Node","title_element":"Title Element","script_element":"Script Element","style_element":"Style Element","base_element":"Base Element","link_element":"Link Element","meta_element":"Meta Element","comment_element":"Comment",src:"Source",language:"Language",href:"HREF",target:"Target",type:"Type",charset:"Charset",defer:"Defer",media:"Media",properties:"Properties",name:"Name",value:"Value",content:"Content",rel:"Rel",rev:"Rev",hreflang:"HREF Lang","general_props":"General","advanced_props":"Advanced"});
\ No newline at end of file
+++ /dev/null
-(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().getElementsByTagName("table")[0]);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var DOM = tinymce.DOM;\r
-\r
- tinymce.create('tinymce.plugins.FullScreenPlugin', {\r
- init : function(ed, url) {\r
- var t = this, s = {}, vp, posCss;\r
-\r
- t.editor = ed;\r
-\r
- // Register commands\r
- ed.addCommand('mceFullScreen', function() {\r
- var win, de = DOM.doc.documentElement;\r
-\r
- if (ed.getParam('fullscreen_is_enabled')) {\r
- if (ed.getParam('fullscreen_new_window'))\r
- closeFullscreen(); // Call to close in new window\r
- else {\r
- DOM.win.setTimeout(function() {\r
- tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);\r
- tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent());\r
- tinyMCE.remove(ed);\r
- DOM.remove('mce_fullscreen_container');\r
- de.style.overflow = ed.getParam('fullscreen_html_overflow');\r
- DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));\r
- DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));\r
- tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings\r
- }, 10);\r
- }\r
-\r
- return;\r
- }\r
-\r
- if (ed.getParam('fullscreen_new_window')) {\r
- win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);\r
- try {\r
- win.resizeTo(screen.availWidth, screen.availHeight);\r
- } catch (e) {\r
- // Ignore\r
- }\r
- } else {\r
- tinyMCE.oldSettings = tinyMCE.settings; // Store old settings\r
- s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';\r
- s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);\r
- vp = DOM.getViewPort();\r
- s.fullscreen_scrollx = vp.x;\r
- s.fullscreen_scrolly = vp.y;\r
-\r
- // Fixes an Opera bug where the scrollbars doesn't reappear\r
- if (tinymce.isOpera && s.fullscreen_overflow == 'visible')\r
- s.fullscreen_overflow = 'auto';\r
-\r
- // Fixes an IE bug where horizontal scrollbars would appear\r
- if (tinymce.isIE && s.fullscreen_overflow == 'scroll')\r
- s.fullscreen_overflow = 'auto';\r
-\r
- // Fixes an IE bug where the scrollbars doesn't reappear\r
- if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))\r
- s.fullscreen_html_overflow = 'auto';\r
-\r
- if (s.fullscreen_overflow == '0px')\r
- s.fullscreen_overflow = '';\r
-\r
- DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');\r
- de.style.overflow = 'hidden'; //Fix for IE6/7\r
- vp = DOM.getViewPort();\r
- DOM.win.scrollTo(0, 0);\r
-\r
- if (tinymce.isIE)\r
- vp.h -= 1;\r
-\r
- // Use fixed position if it exists\r
- if (tinymce.isIE6 || document.compatMode == 'BackCompat')\r
- posCss = 'absolute;top:' + vp.y;\r
- else\r
- posCss = 'fixed;top:0';\r
-\r
- n = DOM.add(DOM.doc.body, 'div', {\r
- id : 'mce_fullscreen_container',\r
- style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});\r
- DOM.add(n, 'div', {id : 'mce_fullscreen'});\r
-\r
- tinymce.each(ed.settings, function(v, n) {\r
- s[n] = v;\r
- });\r
-\r
- s.id = 'mce_fullscreen';\r
- s.width = n.clientWidth;\r
- s.height = n.clientHeight - 15;\r
- s.fullscreen_is_enabled = true;\r
- s.fullscreen_editor_id = ed.id;\r
- s.theme_advanced_resizing = false;\r
- s.save_onsavecallback = function() {\r
- ed.setContent(tinyMCE.get(s.id).getContent());\r
- ed.execCommand('mceSave');\r
- };\r
-\r
- tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {\r
- s[k] = v;\r
- });\r
-\r
- if (s.theme_advanced_toolbar_location === 'external')\r
- s.theme_advanced_toolbar_location = 'top';\r
-\r
- t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);\r
- t.fullscreenEditor.onInit.add(function() {\r
- t.fullscreenEditor.setContent(ed.getContent());\r
- t.fullscreenEditor.focus();\r
- });\r
-\r
- t.fullscreenEditor.render();\r
-\r
- t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');\r
- t.fullscreenElement.update();\r
- //document.body.overflow = 'hidden';\r
-\r
- t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {\r
- var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;\r
-\r
- // Get outer/inner size to get a delta size that can be used to calc the new iframe size\r
- outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]);\r
- innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);\r
-\r
- fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);\r
- });\r
- }\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});\r
-\r
- ed.onNodeChange.add(function(ed, cm) {\r
- cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Fullscreen',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);\r
-})();\r
+++ /dev/null
-<!DOCTYPE html>\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title></title>\r
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />\r
- <script type="text/javascript" src="../../tiny_mce.js"></script>\r
- <script type="text/javascript">\r
- function patchCallback(settings, key) {\r
- if (settings[key])\r
- settings[key] = "window.opener." + settings[key];\r
- }\r
-\r
- var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;\r
-\r
- // Clone array\r
- for (var n in paSe)\r
- settings[n] = paSe[n];\r
-\r
- // Override options for fullscreen\r
- for (var n in paSe.fullscreen_settings)\r
- settings[n] = paSe.fullscreen_settings[n];\r
-\r
- // Patch callbacks, make them point to window.opener\r
- patchCallback(settings, 'urlconverter_callback');\r
- patchCallback(settings, 'insertlink_callback');\r
- patchCallback(settings, 'insertimage_callback');\r
- patchCallback(settings, 'setupcontent_callback');\r
- patchCallback(settings, 'save_callback');\r
- patchCallback(settings, 'onchange_callback');\r
- patchCallback(settings, 'init_instance_callback');\r
- patchCallback(settings, 'file_browser_callback');\r
- patchCallback(settings, 'cleanup_callback');\r
- patchCallback(settings, 'execcommand_callback');\r
- patchCallback(settings, 'oninit');\r
-\r
- // Set options\r
- delete settings.id;\r
- settings['mode'] = 'exact';\r
- settings['elements'] = 'fullscreenarea';\r
- settings['add_unload_trigger'] = false;\r
- settings['ask'] = false;\r
- settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();\r
- settings['fullscreen_is_enabled'] = true;\r
- settings['fullscreen_editor_id'] = oeID;\r
- settings['theme_advanced_resizing'] = false;\r
- settings['strict_loading_mode'] = true;\r
-\r
- settings.save_onsavecallback = function() {\r
- window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});\r
- window.opener.tinyMCE.get(oeID).execCommand('mceSave');\r
- window.close();\r
- };\r
-\r
- function unloadHandler(e) {\r
- moveContent();\r
- }\r
-\r
- function moveContent() {\r
- window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());\r
- }\r
-\r
- function closeFullscreen() {\r
- moveContent();\r
- window.close();\r
- }\r
-\r
- function doParentSubmit() {\r
- moveContent();\r
-\r
- if (window.opener.tinyMCE.selectedInstance.formElement.form)\r
- window.opener.tinyMCE.selectedInstance.formElement.form.submit();\r
-\r
- window.close();\r
-\r
- return false;\r
- }\r
-\r
- function render() {\r
- var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;\r
-\r
- e.value = window.opener.tinyMCE.get(oeID).getContent();\r
-\r
- vp = dom.getViewPort();\r
- settings.width = vp.w;\r
- settings.height = vp.h - 15;\r
-\r
- tinymce.dom.Event.add(window, 'resize', function() {\r
- var vp = dom.getViewPort();\r
-\r
- tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);\r
- });\r
-\r
- tinyMCE.init(settings);\r
- }\r
-\r
- // Add onunload\r
- tinymce.dom.Event.add(window, "beforeunload", unloadHandler);\r
- </script>\r
-</head>\r
-<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">\r
-<form onsubmit="doParentSubmit();">\r
-<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>\r
-</form>\r
-\r
-<script type="text/javascript">\r
- render();\r
-</script>\r
-\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.IESpell', {\r
- init : function(ed, url) {\r
- var t = this, sp;\r
-\r
- if (!tinymce.isIE)\r
- return;\r
-\r
- t.editor = ed;\r
-\r
- // Register commands\r
- ed.addCommand('mceIESpell', function() {\r
- try {\r
- sp = new ActiveXObject("ieSpell.ieSpellExtension");\r
- sp.CheckDocumentNode(ed.getDoc().documentElement);\r
- } catch (e) {\r
- if (e.number == -2146827859) {\r
- ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {\r
- if (s)\r
- window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');\r
- });\r
- } else\r
- ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);\r
- }\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'IESpell (IE Only)',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","<br />"));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceClose"){z.close(null,i);return a.cancel(t)}else{if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(i,k){var g=this,f,j=d.doc,h,k;k=g._findId(k||i);if(!g.windows[k]){g.parent(i);return}g.count--;if(g.count==0){d.remove("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","false");g.editor.focus()}if(f=g.windows[k]){g.onClose.dispatch(g);a.remove(j,"mousedown",f.mousedownFunc);a.remove(j,"click",f.clickFunc);a.clear(k);a.clear(k+"_ifr");d.setAttrib(k+"_ifr","src",'javascript:""');f.element.remove();delete g.windows[k];h=g._frontWindow();if(h){g.focus(h.id)}}},_frontWindow:function(){var g,f=0;e(this.windows,function(h){if(h.zIndex>f){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;\r
-\r
- tinymce.create('tinymce.plugins.InlinePopups', {\r
- init : function(ed, url) {\r
- // Replace window manager\r
- ed.onBeforeRenderUI.add(function() {\r
- ed.windowManager = new tinymce.InlineWindowManager(ed);\r
- DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'InlinePopups',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {\r
- InlineWindowManager : function(ed) {\r
- var t = this;\r
-\r
- t.parent(ed);\r
- t.zIndex = 300000;\r
- t.count = 0;\r
- t.windows = {};\r
- },\r
-\r
- open : function(f, p) {\r
- var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow;\r
-\r
- f = f || {};\r
- p = p || {};\r
-\r
- // Run native windows\r
- if (!f.inline)\r
- return t.parent(f, p);\r
-\r
- parentWindow = t._frontWindow();\r
- if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {\r
- parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;\r
- }\r
- \r
- // Only store selection if the type is a normal window\r
- if (!f.type)\r
- t.bookmark = ed.selection.getBookmark(1);\r
-\r
- id = DOM.uniqueId();\r
- vp = DOM.getViewPort();\r
- f.width = parseInt(f.width || 320);\r
- f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);\r
- f.min_width = parseInt(f.min_width || 150);\r
- f.min_height = parseInt(f.min_height || 100);\r
- f.max_width = parseInt(f.max_width || 2000);\r
- f.max_height = parseInt(f.max_height || 2000);\r
- f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));\r
- f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));\r
- f.movable = f.resizable = true;\r
- p.mce_width = f.width;\r
- p.mce_height = f.height;\r
- p.mce_inline = true;\r
- p.mce_window_id = id;\r
- p.mce_auto_focus = f.auto_focus;\r
-\r
- // Transpose\r
-// po = DOM.getPos(ed.getContainer());\r
-// f.left -= po.x;\r
-// f.top -= po.y;\r
-\r
- t.features = f;\r
- t.params = p;\r
- t.onOpen.dispatch(t, f, p);\r
-\r
- if (f.type) {\r
- opt += ' mceModal';\r
-\r
- if (f.type)\r
- opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1);\r
-\r
- f.resizable = false;\r
- }\r
-\r
- if (f.statusbar)\r
- opt += ' mceStatusbar';\r
-\r
- if (f.resizable)\r
- opt += ' mceResizable';\r
-\r
- if (f.minimizable)\r
- opt += ' mceMinimizable';\r
-\r
- if (f.maximizable)\r
- opt += ' mceMaximizable';\r
-\r
- if (f.movable)\r
- opt += ' mceMovable';\r
-\r
- // Create DOM objects\r
- t._addAll(DOM.doc.body, \r
- ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, \r
- ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},\r
- ['div', {id : id + '_top', 'class' : 'mceTop'}, \r
- ['div', {'class' : 'mceLeft'}],\r
- ['div', {'class' : 'mceCenter'}],\r
- ['div', {'class' : 'mceRight'}],\r
- ['span', {id : id + '_title'}, f.title || '']\r
- ],\r
-\r
- ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, \r
- ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],\r
- ['span', {id : id + '_content'}],\r
- ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]\r
- ],\r
-\r
- ['div', {id : id + '_bottom', 'class' : 'mceBottom'},\r
- ['div', {'class' : 'mceLeft'}],\r
- ['div', {'class' : 'mceCenter'}],\r
- ['div', {'class' : 'mceRight'}],\r
- ['span', {id : id + '_status'}, 'Content']\r
- ],\r
-\r
- ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}],\r
- ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
- ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
- ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
- ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
- ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}],\r
- ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}],\r
- ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}],\r
- ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}],\r
- ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}],\r
- ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}],\r
- ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}],\r
- ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}]\r
- ]\r
- ]\r
- );\r
-\r
- DOM.setStyles(id, {top : -10000, left : -10000});\r
-\r
- // Fix gecko rendering bug, where the editors iframe messed with window contents\r
- if (tinymce.isGecko)\r
- DOM.setStyle(id, 'overflow', 'auto');\r
-\r
- // Measure borders\r
- if (!f.type) {\r
- dw += DOM.get(id + '_left').clientWidth;\r
- dw += DOM.get(id + '_right').clientWidth;\r
- dh += DOM.get(id + '_top').clientHeight;\r
- dh += DOM.get(id + '_bottom').clientHeight;\r
- }\r
-\r
- // Resize window\r
- DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});\r
-\r
- u = f.url || f.file;\r
- if (u) {\r
- if (tinymce.relaxedDomain)\r
- u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;\r
-\r
- u = tinymce._addVer(u);\r
- }\r
-\r
- if (!f.type) {\r
- DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});\r
- DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});\r
- DOM.setAttrib(id + '_ifr', 'src', u);\r
- } else {\r
- DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');\r
-\r
- if (f.type == 'confirm')\r
- DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');\r
-\r
- DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});\r
- DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));\r
- \r
- Event.add(id, 'keyup', function(evt) {\r
- var VK_ESCAPE = 27;\r
- if (evt.keyCode === VK_ESCAPE) {\r
- f.button_func(false);\r
- return Event.cancel(evt);\r
- }\r
- });\r
-\r
- Event.add(id, 'keydown', function(evt) {\r
- var cancelButton, VK_TAB = 9;\r
- if (evt.keyCode === VK_TAB) {\r
- cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0];\r
- if (cancelButton && cancelButton !== evt.target) {\r
- cancelButton.focus();\r
- } else {\r
- DOM.get(id + '_ok').focus();\r
- }\r
- return Event.cancel(evt);\r
- }\r
- });\r
- }\r
-\r
- // Register events\r
- mdf = Event.add(id, 'mousedown', function(e) {\r
- var n = e.target, w, vp;\r
-\r
- w = t.windows[id];\r
- t.focus(id);\r
-\r
- if (n.nodeName == 'A' || n.nodeName == 'a') {\r
- if (n.className == 'mceClose') {\r
- t.close(null, id);\r
- return Event.cancel(e);\r
- } else if (n.className == 'mceMax') {\r
- w.oldPos = w.element.getXY();\r
- w.oldSize = w.element.getSize();\r
-\r
- vp = DOM.getViewPort();\r
-\r
- // Reduce viewport size to avoid scrollbars\r
- vp.w -= 2;\r
- vp.h -= 2;\r
-\r
- w.element.moveTo(vp.x, vp.y);\r
- w.element.resizeTo(vp.w, vp.h);\r
- DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});\r
- DOM.addClass(id + '_wrapper', 'mceMaximized');\r
- } else if (n.className == 'mceMed') {\r
- // Reset to old size\r
- w.element.moveTo(w.oldPos.x, w.oldPos.y);\r
- w.element.resizeTo(w.oldSize.w, w.oldSize.h);\r
- w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);\r
-\r
- DOM.removeClass(id + '_wrapper', 'mceMaximized');\r
- } else if (n.className == 'mceMove')\r
- return t._startDrag(id, e, n.className);\r
- else if (DOM.hasClass(n, 'mceResize'))\r
- return t._startDrag(id, e, n.className.substring(13));\r
- }\r
- });\r
-\r
- clf = Event.add(id, 'click', function(e) {\r
- var n = e.target;\r
-\r
- t.focus(id);\r
-\r
- if (n.nodeName == 'A' || n.nodeName == 'a') {\r
- switch (n.className) {\r
- case 'mceClose':\r
- t.close(null, id);\r
- return Event.cancel(e);\r
-\r
- case 'mceButton mceOk':\r
- case 'mceButton mceCancel':\r
- f.button_func(n.className == 'mceButton mceOk');\r
- return Event.cancel(e);\r
- }\r
- }\r
- });\r
- \r
- // Make sure the tab order loops within the dialog.\r
- Event.add([id + '_left', id + '_right'], 'focus', function(evt) {\r
- var iframe = DOM.get(id + '_ifr');\r
- if (iframe) {\r
- var body = iframe.contentWindow.document.body;\r
- var focusable = DOM.select(':input:enabled,*[tabindex=0]', body);\r
- if (evt.target.id === (id + '_left')) {\r
- focusable[focusable.length - 1].focus();\r
- } else {\r
- focusable[0].focus();\r
- }\r
- } else {\r
- DOM.get(id + '_ok').focus();\r
- }\r
- });\r
- \r
- // Add window\r
- w = t.windows[id] = {\r
- id : id,\r
- mousedown_func : mdf,\r
- click_func : clf,\r
- element : new Element(id, {blocker : 1, container : ed.getContainer()}),\r
- iframeElement : new Element(id + '_ifr'),\r
- features : f,\r
- deltaWidth : dw,\r
- deltaHeight : dh\r
- };\r
-\r
- w.iframeElement.on('focus', function() {\r
- t.focus(id);\r
- });\r
-\r
- // Setup blocker\r
- if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {\r
- DOM.add(DOM.doc.body, 'div', {\r
- id : 'mceModalBlocker',\r
- 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',\r
- style : {zIndex : t.zIndex - 1}\r
- });\r
-\r
- DOM.show('mceModalBlocker'); // Reduces flicker in IE\r
- DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true');\r
- } else\r
- DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);\r
-\r
- if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))\r
- DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});\r
-\r
- DOM.setAttrib(id, 'aria-hidden', 'false');\r
- t.focus(id);\r
- t._fixIELayout(id, 1);\r
-\r
- // Focus ok button\r
- if (DOM.get(id + '_ok'))\r
- DOM.get(id + '_ok').focus();\r
- t.count++;\r
-\r
- return w;\r
- },\r
-\r
- focus : function(id) {\r
- var t = this, w;\r
-\r
- if (w = t.windows[id]) {\r
- w.zIndex = this.zIndex++;\r
- w.element.setStyle('zIndex', w.zIndex);\r
- w.element.update();\r
-\r
- id = id + '_wrapper';\r
- DOM.removeClass(t.lastId, 'mceFocus');\r
- DOM.addClass(id, 'mceFocus');\r
- t.lastId = id;\r
- \r
- if (w.focussedElement) {\r
- w.focussedElement.focus();\r
- } else if (DOM.get(id + '_ok')) {\r
- DOM.get(w.id + '_ok').focus();\r
- } else if (DOM.get(w.id + '_ifr')) {\r
- DOM.get(w.id + '_ifr').focus();\r
- }\r
- }\r
- },\r
-\r
- _addAll : function(te, ne) {\r
- var i, n, t = this, dom = tinymce.DOM;\r
-\r
- if (is(ne, 'string'))\r
- te.appendChild(dom.doc.createTextNode(ne));\r
- else if (ne.length) {\r
- te = te.appendChild(dom.create(ne[0], ne[1]));\r
-\r
- for (i=2; i<ne.length; i++)\r
- t._addAll(te, ne[i]);\r
- }\r
- },\r
-\r
- _startDrag : function(id, se, ac) {\r
- var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh;\r
-\r
- // Get positons and sizes\r
-// cp = DOM.getPos(t.editor.getContainer());\r
- cp = {x : 0, y : 0};\r
- vp = DOM.getViewPort();\r
-\r
- // Reduce viewport size to avoid scrollbars while dragging\r
- vp.w -= 2;\r
- vp.h -= 2;\r
-\r
- sex = se.screenX;\r
- sey = se.screenY;\r
- dx = dy = dw = dh = 0;\r
-\r
- // Handle mouse up\r
- mu = Event.add(d, 'mouseup', function(e) {\r
- Event.remove(d, 'mouseup', mu);\r
- Event.remove(d, 'mousemove', mm);\r
-\r
- if (eb)\r
- eb.remove();\r
-\r
- we.moveBy(dx, dy);\r
- we.resizeBy(dw, dh);\r
- sz = we.getSize();\r
- DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});\r
- t._fixIELayout(id, 1);\r
-\r
- return Event.cancel(e);\r
- });\r
-\r
- if (ac != 'Move')\r
- startMove();\r
-\r
- function startMove() {\r
- if (eb)\r
- return;\r
-\r
- t._fixIELayout(id, 0);\r
-\r
- // Setup event blocker\r
- DOM.add(d.body, 'div', {\r
- id : 'mceEventBlocker',\r
- 'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),\r
- style : {zIndex : t.zIndex + 1}\r
- });\r
-\r
- if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))\r
- DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});\r
-\r
- eb = new Element('mceEventBlocker');\r
- eb.update();\r
-\r
- // Setup placeholder\r
- p = we.getXY();\r
- sz = we.getSize();\r
- sx = cp.x + p.x - vp.x;\r
- sy = cp.y + p.y - vp.y;\r
- DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});\r
- ph = new Element('mcePlaceHolder');\r
- };\r
-\r
- // Handle mouse move/drag\r
- mm = Event.add(d, 'mousemove', function(e) {\r
- var x, y, v;\r
-\r
- startMove();\r
-\r
- x = e.screenX - sex;\r
- y = e.screenY - sey;\r
-\r
- switch (ac) {\r
- case 'ResizeW':\r
- dx = x;\r
- dw = 0 - x;\r
- break;\r
-\r
- case 'ResizeE':\r
- dw = x;\r
- break;\r
-\r
- case 'ResizeN':\r
- case 'ResizeNW':\r
- case 'ResizeNE':\r
- if (ac == "ResizeNW") {\r
- dx = x;\r
- dw = 0 - x;\r
- } else if (ac == "ResizeNE")\r
- dw = x;\r
-\r
- dy = y;\r
- dh = 0 - y;\r
- break;\r
-\r
- case 'ResizeS':\r
- case 'ResizeSW':\r
- case 'ResizeSE':\r
- if (ac == "ResizeSW") {\r
- dx = x;\r
- dw = 0 - x;\r
- } else if (ac == "ResizeSE")\r
- dw = x;\r
-\r
- dh = y;\r
- break;\r
-\r
- case 'mceMove':\r
- dx = x;\r
- dy = y;\r
- break;\r
- }\r
-\r
- // Boundary check\r
- if (dw < (v = w.features.min_width - sz.w)) {\r
- if (dx !== 0)\r
- dx += dw - v;\r
-\r
- dw = v;\r
- }\r
- \r
- if (dh < (v = w.features.min_height - sz.h)) {\r
- if (dy !== 0)\r
- dy += dh - v;\r
-\r
- dh = v;\r
- }\r
-\r
- dw = Math.min(dw, w.features.max_width - sz.w);\r
- dh = Math.min(dh, w.features.max_height - sz.h);\r
- dx = Math.max(dx, vp.x - (sx + vp.x));\r
- dy = Math.max(dy, vp.y - (sy + vp.y));\r
- dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));\r
- dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));\r
-\r
- // Move if needed\r
- if (dx + dy !== 0) {\r
- if (sx + dx < 0)\r
- dx = 0;\r
- \r
- if (sy + dy < 0)\r
- dy = 0;\r
-\r
- ph.moveTo(sx + dx, sy + dy);\r
- }\r
-\r
- // Resize if needed\r
- if (dw + dh !== 0)\r
- ph.resizeTo(sz.w + dw, sz.h + dh);\r
-\r
- return Event.cancel(e);\r
- });\r
-\r
- return Event.cancel(se);\r
- },\r
-\r
- resizeBy : function(dw, dh, id) {\r
- var w = this.windows[id];\r
-\r
- if (w) {\r
- w.element.resizeBy(dw, dh);\r
- w.iframeElement.resizeBy(dw, dh);\r
- }\r
- },\r
-\r
- close : function(win, id) {\r
- var t = this, w, d = DOM.doc, fw, id;\r
-\r
- id = t._findId(id || win);\r
-\r
- // Probably not inline\r
- if (!t.windows[id]) {\r
- t.parent(win);\r
- return;\r
- }\r
-\r
- t.count--;\r
-\r
- if (t.count == 0) {\r
- DOM.remove('mceModalBlocker');\r
- DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'false');\r
- t.editor.focus();\r
- }\r
-\r
- if (w = t.windows[id]) {\r
- t.onClose.dispatch(t);\r
- Event.remove(d, 'mousedown', w.mousedownFunc);\r
- Event.remove(d, 'click', w.clickFunc);\r
- Event.clear(id);\r
- Event.clear(id + '_ifr');\r
-\r
- DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak\r
- w.element.remove();\r
- delete t.windows[id];\r
-\r
- fw = t._frontWindow();\r
-\r
- if (fw)\r
- t.focus(fw.id);\r
- }\r
- },\r
- \r
- // Find front most window\r
- _frontWindow : function() {\r
- var fw, ix = 0;\r
- // Find front most window and focus that\r
- each (this.windows, function(w) {\r
- if (w.zIndex > ix) {\r
- fw = w;\r
- ix = w.zIndex;\r
- }\r
- });\r
- return fw;\r
- },\r
-\r
- setTitle : function(w, ti) {\r
- var e;\r
-\r
- w = this._findId(w);\r
-\r
- if (e = DOM.get(w + '_title'))\r
- e.innerHTML = DOM.encode(ti);\r
- },\r
-\r
- alert : function(txt, cb, s) {\r
- var t = this, w;\r
-\r
- w = t.open({\r
- title : t,\r
- type : 'alert',\r
- button_func : function(s) {\r
- if (cb)\r
- cb.call(s || t, s);\r
-\r
- t.close(null, w.id);\r
- },\r
- content : DOM.encode(t.editor.getLang(txt, txt)),\r
- inline : 1,\r
- width : 400,\r
- height : 130\r
- });\r
- },\r
-\r
- confirm : function(txt, cb, s) {\r
- var t = this, w;\r
-\r
- w = t.open({\r
- title : t,\r
- type : 'confirm',\r
- button_func : function(s) {\r
- if (cb)\r
- cb.call(s || t, s);\r
-\r
- t.close(null, w.id);\r
- },\r
- content : DOM.encode(t.editor.getLang(txt, txt)),\r
- inline : 1,\r
- width : 400,\r
- height : 130\r
- });\r
- },\r
-\r
- // Internal functions\r
-\r
- _findId : function(w) {\r
- var t = this;\r
-\r
- if (typeof(w) == 'string')\r
- return w;\r
-\r
- each(t.windows, function(wo) {\r
- var ifr = DOM.get(wo.id + '_ifr');\r
-\r
- if (ifr && w == ifr.contentWindow) {\r
- w = wo.id;\r
- return false;\r
- }\r
- });\r
-\r
- return w;\r
- },\r
-\r
- _fixIELayout : function(id, s) {\r
- var w, img;\r
-\r
- if (!tinymce.isIE6)\r
- return;\r
-\r
- // Fixes the bug where hover flickers and does odd things in IE6\r
- each(['n','s','w','e','nw','ne','sw','se'], function(v) {\r
- var e = DOM.get(id + '_resize_' + v);\r
-\r
- DOM.setStyles(e, {\r
- width : s ? e.clientWidth : '',\r
- height : s ? e.clientHeight : '',\r
- cursor : DOM.getStyle(e, 'cursor', 1)\r
- });\r
-\r
- DOM.setStyle(id + "_bottom", 'bottom', '-1px');\r
-\r
- e = 0;\r
- });\r
-\r
- // Fixes graphics glitch\r
- if (w = this.windows[id]) {\r
- // Fixes rendering bug after resize\r
- w.element.hide();\r
- w.element.show();\r
-\r
- // Forced a repaint of the window\r
- //DOM.get(id).style.filter = '';\r
-\r
- // IE has a bug where images used in CSS won't get loaded\r
- // sometimes when the cache in the browser is disabled\r
- // This fix tries to solve it by loading the images using the image object\r
- each(DOM.select('div,a', id), function(e, i) {\r
- if (e.currentStyle.backgroundImage != 'none') {\r
- img = new Image();\r
- img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');\r
- }\r
- });\r
-\r
- DOM.get(id).style.filter = '';\r
- }\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);\r
-})();\r
-\r
+++ /dev/null
-/* Clearlooks 2 */
-
-/* Reset */
-.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
-
-/* General */
-.clearlooks2 {position:absolute; direction:ltr}
-.clearlooks2 .mceWrapper {position:static}
-.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
-.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
-.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
-
-/* Top */
-.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
-.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)}
-.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
-.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
-.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
-.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0}
-.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px}
-.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0}
-.clearlooks2 .mceFocus .mceTop span {color:#FFF}
-
-/* Middle */
-.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0}
-.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)}
-.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
-.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
-.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
-
-/* Bottom */
-.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px}
-.clearlooks2 .mceBottom {left:0; bottom:0; width:100%}
-.clearlooks2 .mceBottom div {top:0}
-.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
-.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
-.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0}
-.clearlooks2 .mceBottom span {display:none}
-.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px}
-.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0}
-.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px}
-.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0}
-.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
-
-/* Actions */
-.clearlooks2 a {width:29px; height:16px; top:3px;}
-.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0}
-.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0}
-.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
-.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
-.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
-.clearlooks2 .mceMovable .mceMove {display:block}
-.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px}
-.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px}
-.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px}
-.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px}
-.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
-.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
-.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
-.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
-.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
-
-/* Resize */
-.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
-.clearlooks2 .mceResizable .mceResize {display:block}
-.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none}
-.clearlooks2 .mceMinimizable .mceMin {display:block}
-.clearlooks2 .mceMaximizable .mceMax {display:block}
-.clearlooks2 .mceMaximized .mceMed {display:block}
-.clearlooks2 .mceMaximized .mceMax {display:none}
-.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize}
-.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize}
-.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize}
-.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;}
-.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize}
-.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize}
-.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize}
-.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize}
-
-/* Alert/Confirm */
-.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
-.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
-.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
-.clearlooks2 a:hover {font-weight:bold;}
-.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5}
-.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
-.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
-.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
-.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
-.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)}
+++ /dev/null
-<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -->\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<title>Template for dialogs</title>\r
-<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css" />\r
-</head>\r
-<body>\r
-\r
-<div class="mceEditor">\r
- <div class="clearlooks2" style="width:400px; height:100px; left:10px;">\r
- <div class="mceWrapper">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Blured</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>Content</span>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar text.</span>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceMin" href="#"></a>\r
- <a class="mceMax" href="#"></a>\r
- <a class="mceMed" href="#"></a>\r
- <a class="mceClose" href="#"></a>\r
- <a class="mceResize mceResizeN" href="#"></a>\r
- <a class="mceResize mceResizeS" href="#"></a>\r
- <a class="mceResize mceResizeW" href="#"></a>\r
- <a class="mceResize mceResizeE" href="#"></a>\r
- <a class="mceResize mceResizeNW" href="#"></a>\r
- <a class="mceResize mceResizeNE" href="#"></a>\r
- <a class="mceResize mceResizeSW" href="#"></a>\r
- <a class="mceResize mceResizeSE" href="#"></a>\r
- </div>\r
- </div>\r
-\r
- <div class="clearlooks2" style="width:400px; height:100px; left:420px;">\r
- <div class="mceWrapper mceMovable mceFocus">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Focused</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>Content</span>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar text.</span>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceMin" href="#"></a>\r
- <a class="mceMax" href="#"></a>\r
- <a class="mceMed" href="#"></a>\r
- <a class="mceClose" href="#"></a>\r
- <a class="mceResize mceResizeN" href="#"></a>\r
- <a class="mceResize mceResizeS" href="#"></a>\r
- <a class="mceResize mceResizeW" href="#"></a>\r
- <a class="mceResize mceResizeE" href="#"></a>\r
- <a class="mceResize mceResizeNW" href="#"></a>\r
- <a class="mceResize mceResizeNE" href="#"></a>\r
- <a class="mceResize mceResizeSW" href="#"></a>\r
- <a class="mceResize mceResizeSE" href="#"></a>\r
- </div>\r
- </div>\r
-\r
- <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:120px;">\r
- <div class="mceWrapper mceMovable mceFocus mceStatusbar">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>Content</span>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar text.</span>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceMin" href="#"></a>\r
- <a class="mceMax" href="#"></a>\r
- <a class="mceMed" href="#"></a>\r
- <a class="mceClose" href="#"></a>\r
- <a class="mceResize mceResizeN" href="#"></a>\r
- <a class="mceResize mceResizeS" href="#"></a>\r
- <a class="mceResize mceResizeW" href="#"></a>\r
- <a class="mceResize mceResizeE" href="#"></a>\r
- <a class="mceResize mceResizeNW" href="#"></a>\r
- <a class="mceResize mceResizeNE" href="#"></a>\r
- <a class="mceResize mceResizeSW" href="#"></a>\r
- <a class="mceResize mceResizeSE" href="#"></a>\r
- </div>\r
- </div>\r
-\r
- <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:120px;">\r
- <div class="mceWrapper mceMovable mceFocus mceStatusbar mceResizable">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar, Resizable</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>Content</span>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar text.</span>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceMin" href="#"></a>\r
- <a class="mceMax" href="#"></a>\r
- <a class="mceMed" href="#"></a>\r
- <a class="mceClose" href="#"></a>\r
- <a class="mceResize mceResizeN" href="#"></a>\r
- <a class="mceResize mceResizeS" href="#"></a>\r
- <a class="mceResize mceResizeW" href="#"></a>\r
- <a class="mceResize mceResizeE" href="#"></a>\r
- <a class="mceResize mceResizeNW" href="#"></a>\r
- <a class="mceResize mceResizeNE" href="#"></a>\r
- <a class="mceResize mceResizeSW" href="#"></a>\r
- <a class="mceResize mceResizeSE" href="#"></a>\r
- </div>\r
- </div>\r
-\r
- <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:230px;">\r
- <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximizable">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Resizable, Maximizable</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>Content</span>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar text.</span>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceMin" href="#"></a>\r
- <a class="mceMax" href="#"></a>\r
- <a class="mceMed" href="#"></a>\r
- <a class="mceClose" href="#"></a>\r
- <a class="mceResize mceResizeN" href="#"></a>\r
- <a class="mceResize mceResizeS" href="#"></a>\r
- <a class="mceResize mceResizeW" href="#"></a>\r
- <a class="mceResize mceResizeE" href="#"></a>\r
- <a class="mceResize mceResizeNW" href="#"></a>\r
- <a class="mceResize mceResizeNE" href="#"></a>\r
- <a class="mceResize mceResizeSW" href="#"></a>\r
- <a class="mceResize mceResizeSE" href="#"></a>\r
- </div>\r
- </div>\r
-\r
- <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:230px;">\r
- <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximizable">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Blurred, Maximizable, Statusbar, Resizable</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>Content</span>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar text.</span>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceMin" href="#"></a>\r
- <a class="mceMax" href="#"></a>\r
- <a class="mceMed" href="#"></a>\r
- <a class="mceClose" href="#"></a>\r
- <a class="mceResize mceResizeN" href="#"></a>\r
- <a class="mceResize mceResizeS" href="#"></a>\r
- <a class="mceResize mceResizeW" href="#"></a>\r
- <a class="mceResize mceResizeE" href="#"></a>\r
- <a class="mceResize mceResizeNW" href="#"></a>\r
- <a class="mceResize mceResizeNE" href="#"></a>\r
- <a class="mceResize mceResizeSW" href="#"></a>\r
- <a class="mceResize mceResizeSE" href="#"></a>\r
- </div>\r
- </div>\r
-\r
- <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:340px;">\r
- <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximized mceMinimizable mceMaximizable">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Maximized, Maximizable, Minimizable</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>Content</span>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar text.</span>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceMin" href="#"></a>\r
- <a class="mceMax" href="#"></a>\r
- <a class="mceMed" href="#"></a>\r
- <a class="mceClose" href="#"></a>\r
- <a class="mceResize mceResizeN" href="#"></a>\r
- <a class="mceResize mceResizeS" href="#"></a>\r
- <a class="mceResize mceResizeW" href="#"></a>\r
- <a class="mceResize mceResizeE" href="#"></a>\r
- <a class="mceResize mceResizeNW" href="#"></a>\r
- <a class="mceResize mceResizeNE" href="#"></a>\r
- <a class="mceResize mceResizeSW" href="#"></a>\r
- <a class="mceResize mceResizeSE" href="#"></a>\r
- </div>\r
- </div>\r
-\r
- <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:340px;">\r
- <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximized mceMinimizable mceMaximizable">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Blured</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>Content</span>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Statusbar text.</span>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceMin" href="#"></a>\r
- <a class="mceMax" href="#"></a>\r
- <a class="mceMed" href="#"></a>\r
- <a class="mceClose" href="#"></a>\r
- <a class="mceResize mceResizeN" href="#"></a>\r
- <a class="mceResize mceResizeS" href="#"></a>\r
- <a class="mceResize mceResizeW" href="#"></a>\r
- <a class="mceResize mceResizeE" href="#"></a>\r
- <a class="mceResize mceResizeNW" href="#"></a>\r
- <a class="mceResize mceResizeNE" href="#"></a>\r
- <a class="mceResize mceResizeSW" href="#"></a>\r
- <a class="mceResize mceResizeSE" href="#"></a>\r
- </div>\r
- </div>\r
-\r
- <div class="clearlooks2" style="width:400px; height:130px; left:10px; top:450px;">\r
- <div class="mceWrapper mceMovable mceFocus mceModal mceAlert">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Alert</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- </span>\r
- <div class="mceRight"></div>\r
- <div class="mceIcon"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceButton mceOk" href="#">Ok</a>\r
- <a class="mceClose" href="#"></a>\r
- </div>\r
- </div>\r
-\r
- <div class="clearlooks2" style="width:400px; height:130px; left:420px; top:450px;">\r
- <div class="mceWrapper mceMovable mceFocus mceModal mceConfirm">\r
- <div class="mceTop">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- <span>Confirm</span>\r
- </div>\r
-\r
- <div class="mceMiddle">\r
- <div class="mceLeft"></div>\r
- <span>\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- This is a very long error message. This is a very long error message.\r
- </span>\r
- <div class="mceRight"></div>\r
- <div class="mceIcon"></div>\r
- </div>\r
-\r
- <div class="mceBottom">\r
- <div class="mceLeft"></div>\r
- <div class="mceCenter"></div>\r
- <div class="mceRight"></div>\r
- </div>\r
-\r
- <a class="mceMove" href="#"></a>\r
- <a class="mceButton mceOk" href="#">Ok</a>\r
- <a class="mceButton mceCancel" href="#">Cancel</a>\r
- <a class="mceClose" href="#"></a>\r
- </div>\r
- </div>\r
-</div>\r
-\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length<d){for(var f=0;f<(d-g.length);f++){g="0"+g}}return g}a=a.replace("%D","%m/%d/%y");a=a.replace("%r","%I:%M:%S %p");a=a.replace("%Y",""+e.getFullYear());a=a.replace("%y",""+e.getYear());a=a.replace("%m",b(e.getMonth()+1,2));a=a.replace("%d",b(e.getDate(),2));a=a.replace("%H",""+b(e.getHours(),2));a=a.replace("%M",""+b(e.getMinutes(),2));a=a.replace("%S",""+b(e.getSeconds(),2));a=a.replace("%I",""+((e.getHours()+11)%12+1));a=a.replace("%p",""+(e.getHours()<12?"AM":"PM"));a=a.replace("%B",""+c.getLang("insertdatetime.months_long").split(",")[e.getMonth()]);a=a.replace("%b",""+c.getLang("insertdatetime.months_short").split(",")[e.getMonth()]);a=a.replace("%A",""+c.getLang("insertdatetime.day_long").split(",")[e.getDay()]);a=a.replace("%a",""+c.getLang("insertdatetime.day_short").split(",")[e.getDay()]);a=a.replace("%%","%");return a}});tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.InsertDateTime', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
-\r
- ed.addCommand('mceInsertDate', function() {\r
- var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));\r
-\r
- ed.execCommand('mceInsertContent', false, str);\r
- });\r
-\r
- ed.addCommand('mceInsertTime', function() {\r
- var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));\r
-\r
- ed.execCommand('mceInsertContent', false, str);\r
- });\r
-\r
- ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});\r
- ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Insert date/time',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- // Private methods\r
-\r
- _getDateTime : function(d, fmt) {\r
- var ed = this.editor;\r
-\r
- function addZeros(value, len) {\r
- value = "" + value;\r
-\r
- if (value.length < len) {\r
- for (var i=0; i<(len-value.length); i++)\r
- value = "0" + value;\r
- }\r
-\r
- return value;\r
- };\r
-\r
- fmt = fmt.replace("%D", "%m/%d/%y");\r
- fmt = fmt.replace("%r", "%I:%M:%S %p");\r
- fmt = fmt.replace("%Y", "" + d.getFullYear());\r
- fmt = fmt.replace("%y", "" + d.getYear());\r
- fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));\r
- fmt = fmt.replace("%d", addZeros(d.getDate(), 2));\r
- fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));\r
- fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));\r
- fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));\r
- fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));\r
- fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));\r
- fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);\r
- fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);\r
- fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);\r
- fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);\r
- fmt = fmt.replace("%%", "%");\r
-\r
- return fmt;\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(){function a(b){do{if(b.className&&b.className.indexOf("mceItemLayer")!=-1){return b}}while(b=b.parentNode)}tinymce.create("tinymce.plugins.Layer",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceInsertLayer",d._insertLayer,d);b.addCommand("mceMoveForward",function(){d._move(1)});b.addCommand("mceMoveBackward",function(){d._move(-1)});b.addCommand("mceMakeAbsolute",function(){d._toggleAbsolute()});b.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});b.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});b.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});b.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});b.onInit.add(function(){var e=b.dom;if(tinymce.isIE){b.getDoc().execCommand("2D-Position",false,true)}});b.onMouseUp.add(function(f,h){var g=a(h.target);if(g){f.dom.setAttrib(g,"data-mce-style","")}});b.onMouseDown.add(function(f,j){var h=j.target,i=f.getDoc(),g;if(tinymce.isGecko){if(a(h)){if(i.designMode!=="on"){i.designMode="on";h=i.body;g=h.parentNode;g.removeChild(h);g.appendChild(h)}}else{if(i.designMode=="on"){i.designMode="off"}}}});b.onNodeChange.add(d._nodeChange,d);b.onVisualAid.add(d._visualAid,d)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(c,b,f){var d,e;d=this._getParentLayer(f);e=c.dom.getParent(f,"DIV,P,IMG");if(!e){b.setDisabled("absolute",1);b.setDisabled("moveforward",1);b.setDisabled("movebackward",1)}else{b.setDisabled("absolute",0);b.setDisabled("moveforward",!d);b.setDisabled("movebackward",!d);b.setActive("absolute",d&&d.style.position.toLowerCase()=="absolute")}},_visualAid:function(b,d,c){var f=b.dom;tinymce.each(f.select("div,p",d),function(g){if(/^(absolute|relative|fixed)$/i.test(g.style.position)){if(c){f.addClass(g,"mceItemVisualAid")}else{f.removeClass(g,"mceItemVisualAid")}f.addClass(g,"mceItemLayer")}})},_move:function(j){var c=this.editor,g,h=[],f=this._getParentLayer(c.selection.getNode()),e=-1,k=-1,b;b=[];tinymce.walk(c.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){b.push(d)}},"childNodes");for(g=0;g<b.length;g++){h[g]=b[g].style.zIndex?parseInt(b[g].style.zIndex):0;if(e<0&&b[g]==f){e=g}}if(j<0){for(g=0;g<h.length;g++){if(h[g]<h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{if(h[e]>0){b[e].style.zIndex=h[e]-1}}}else{for(g=0;g<h.length;g++){if(h[g]>h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{b[e].style.zIndex=h[e]+1}}c.execCommand("mceRepaint")},_getParentLayer:function(b){return this.editor.dom.getParent(b,function(c){return c.nodeType==1&&/^(absolute|relative|static)$/i.test(c.style.position)})},_insertLayer:function(){var c=this.editor,e=c.dom,d=e.getPos(e.getParent(c.selection.getNode(),"*")),b=c.getBody();c.dom.add(b,"div",{style:{position:"absolute",left:d.x,top:(d.y>20?d.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},c.selection.getContent()||c.getLang("layer.content"));if(tinymce.isIE){e.setHTML(b,b.innerHTML)}},_toggleAbsolute:function(){var b=this.editor,c=this._getParentLayer(b.selection.getNode());if(!c){c=b.dom.getParent(b.selection.getNode(),"DIV,P,IMG")}if(c){if(c.style.position.toLowerCase()=="absolute"){b.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""});b.dom.removeClass(c,"mceItemVisualAid");b.dom.removeClass(c,"mceItemLayer")}else{if(c.style.left==""){c.style.left=20+"px"}if(c.style.top==""){c.style.top=20+"px"}if(c.style.width==""){c.style.width=c.width?(c.width+"px"):"100px"}if(c.style.height==""){c.style.height=c.height?(c.height+"px"):"100px"}c.style.position="absolute";b.dom.setAttrib(c,"data-mce-style","");b.addVisual(b.getBody())}b.execCommand("mceRepaint");b.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- function findParentLayer(node) {\r
- do {\r
- if (node.className && node.className.indexOf('mceItemLayer') != -1) {\r
- return node;\r
- }\r
- } while (node = node.parentNode);\r
- };\r
-\r
- tinymce.create('tinymce.plugins.Layer', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
-\r
- // Register commands\r
- ed.addCommand('mceInsertLayer', t._insertLayer, t);\r
-\r
- ed.addCommand('mceMoveForward', function() {\r
- t._move(1);\r
- });\r
-\r
- ed.addCommand('mceMoveBackward', function() {\r
- t._move(-1);\r
- });\r
-\r
- ed.addCommand('mceMakeAbsolute', function() {\r
- t._toggleAbsolute();\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});\r
- ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});\r
- ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});\r
- ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});\r
-\r
- ed.onInit.add(function() {\r
- var dom = ed.dom;\r
-\r
- if (tinymce.isIE)\r
- ed.getDoc().execCommand('2D-Position', false, true);\r
- });\r
-\r
- // Remove serialized styles when selecting a layer since it might be changed by a drag operation\r
- ed.onMouseUp.add(function(ed, e) {\r
- var layer = findParentLayer(e.target);\r
- \r
- if (layer) {\r
- ed.dom.setAttrib(layer, 'data-mce-style', '');\r
- }\r
- });\r
-\r
- // Fixes edit focus issues with layers on Gecko\r
- // This will enable designMode while inside a layer and disable it when outside\r
- ed.onMouseDown.add(function(ed, e) {\r
- var node = e.target, doc = ed.getDoc(), parent;\r
-\r
- if (tinymce.isGecko) {\r
- if (findParentLayer(node)) {\r
- if (doc.designMode !== 'on') {\r
- doc.designMode = 'on';\r
-\r
- // Repaint caret\r
- node = doc.body;\r
- parent = node.parentNode;\r
- parent.removeChild(node);\r
- parent.appendChild(node);\r
- }\r
- } else if (doc.designMode == 'on') {\r
- doc.designMode = 'off';\r
- }\r
- }\r
- });\r
-\r
- ed.onNodeChange.add(t._nodeChange, t);\r
- ed.onVisualAid.add(t._visualAid, t);\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Layer',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- // Private methods\r
-\r
- _nodeChange : function(ed, cm, n) {\r
- var le, p;\r
-\r
- le = this._getParentLayer(n);\r
- p = ed.dom.getParent(n, 'DIV,P,IMG');\r
-\r
- if (!p) {\r
- cm.setDisabled('absolute', 1);\r
- cm.setDisabled('moveforward', 1);\r
- cm.setDisabled('movebackward', 1);\r
- } else {\r
- cm.setDisabled('absolute', 0);\r
- cm.setDisabled('moveforward', !le);\r
- cm.setDisabled('movebackward', !le);\r
- cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");\r
- }\r
- },\r
-\r
- // Private methods\r
-\r
- _visualAid : function(ed, e, s) {\r
- var dom = ed.dom;\r
-\r
- tinymce.each(dom.select('div,p', e), function(e) {\r
- if (/^(absolute|relative|fixed)$/i.test(e.style.position)) {\r
- if (s)\r
- dom.addClass(e, 'mceItemVisualAid');\r
- else\r
- dom.removeClass(e, 'mceItemVisualAid');\r
-\r
- dom.addClass(e, 'mceItemLayer');\r
- }\r
- });\r
- },\r
-\r
- _move : function(d) {\r
- var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;\r
-\r
- nl = [];\r
- tinymce.walk(ed.getBody(), function(n) {\r
- if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))\r
- nl.push(n); \r
- }, 'childNodes');\r
-\r
- // Find z-indexes\r
- for (i=0; i<nl.length; i++) {\r
- z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;\r
-\r
- if (ci < 0 && nl[i] == le)\r
- ci = i;\r
- }\r
-\r
- if (d < 0) {\r
- // Move back\r
-\r
- // Try find a lower one\r
- for (i=0; i<z.length; i++) {\r
- if (z[i] < z[ci]) {\r
- fi = i;\r
- break;\r
- }\r
- }\r
-\r
- if (fi > -1) {\r
- nl[ci].style.zIndex = z[fi];\r
- nl[fi].style.zIndex = z[ci];\r
- } else {\r
- if (z[ci] > 0)\r
- nl[ci].style.zIndex = z[ci] - 1;\r
- }\r
- } else {\r
- // Move forward\r
-\r
- // Try find a higher one\r
- for (i=0; i<z.length; i++) {\r
- if (z[i] > z[ci]) {\r
- fi = i;\r
- break;\r
- }\r
- }\r
-\r
- if (fi > -1) {\r
- nl[ci].style.zIndex = z[fi];\r
- nl[fi].style.zIndex = z[ci];\r
- } else\r
- nl[ci].style.zIndex = z[ci] + 1;\r
- }\r
-\r
- ed.execCommand('mceRepaint');\r
- },\r
-\r
- _getParentLayer : function(n) {\r
- return this.editor.dom.getParent(n, function(n) {\r
- return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);\r
- });\r
- },\r
-\r
- _insertLayer : function() {\r
- var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody();\r
-\r
- ed.dom.add(body, 'div', {\r
- style : {\r
- position : 'absolute',\r
- left : p.x,\r
- top : (p.y > 20 ? p.y : 20),\r
- width : 100,\r
- height : 100\r
- },\r
- 'class' : 'mceItemVisualAid mceItemLayer'\r
- }, ed.selection.getContent() || ed.getLang('layer.content'));\r
-\r
- // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7\r
- if (tinymce.isIE)\r
- dom.setHTML(body, body.innerHTML);\r
- },\r
-\r
- _toggleAbsolute : function() {\r
- var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());\r
-\r
- if (!le)\r
- le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');\r
-\r
- if (le) {\r
- if (le.style.position.toLowerCase() == "absolute") {\r
- ed.dom.setStyles(le, {\r
- position : '',\r
- left : '',\r
- top : '',\r
- width : '',\r
- height : ''\r
- });\r
-\r
- ed.dom.removeClass(le, 'mceItemVisualAid');\r
- ed.dom.removeClass(le, 'mceItemLayer');\r
- } else {\r
- if (le.style.left == "")\r
- le.style.left = 20 + 'px';\r
-\r
- if (le.style.top == "")\r
- le.style.top = 20 + 'px';\r
-\r
- if (le.style.width == "")\r
- le.style.width = le.width ? (le.width + 'px') : '100px';\r
-\r
- if (le.style.height == "")\r
- le.style.height = le.height ? (le.height + 'px') : '100px';\r
-\r
- le.style.position = "absolute";\r
-\r
- ed.dom.setAttrib(le, 'data-mce-style', '');\r
- ed.addVisual(ed.getBody());\r
- }\r
-\r
- ed.execCommand('mceRepaint');\r
- ed.nodeChanged();\r
- }\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('layer', tinymce.plugins.Layer);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce);
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- *\r
- * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align\r
- * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash\r
- *\r
- * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are\r
- * not apart of the newer specifications for HTML and XHTML.\r
- */\r
-\r
-(function(tinymce) {\r
- // Override inline_styles setting to force TinyMCE to produce deprecated contents\r
- tinymce.onAddEditor.addToTop(function(tinymce, editor) {\r
- editor.settings.inline_styles = false;\r
- });\r
-\r
- // Create the legacy ouput plugin\r
- tinymce.create('tinymce.plugins.LegacyOutput', {\r
- init : function(editor) {\r
- editor.onInit.add(function() {\r
- var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',\r
- fontSizes = tinymce.explode(editor.settings.font_size_style_values),\r
- schema = editor.schema;\r
-\r
- // Override some internal formats to produce legacy elements and attributes\r
- editor.formatter.register({\r
- // Change alignment formats to use the deprecated align attribute\r
- alignleft : {selector : alignElements, attributes : {align : 'left'}},\r
- aligncenter : {selector : alignElements, attributes : {align : 'center'}},\r
- alignright : {selector : alignElements, attributes : {align : 'right'}},\r
- alignfull : {selector : alignElements, attributes : {align : 'justify'}},\r
-\r
- // Change the basic formatting elements to use deprecated element types
- bold : [\r
- {inline : 'b', remove : 'all'},\r
- {inline : 'strong', remove : 'all'},\r
- {inline : 'span', styles : {fontWeight : 'bold'}}\r
- ],\r
- italic : [\r
- {inline : 'i', remove : 'all'},\r
- {inline : 'em', remove : 'all'},\r
- {inline : 'span', styles : {fontStyle : 'italic'}}\r
- ],\r
- underline : [\r
- {inline : 'u', remove : 'all'},\r
- {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}\r
- ],\r
- strikethrough : [\r
- {inline : 'strike', remove : 'all'},\r
- {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true}\r
- ],
-\r
- // Change font size and font family to use the deprecated font element\r
- fontname : {inline : 'font', attributes : {face : '%value'}},\r
- fontsize : {\r
- inline : 'font',\r
- attributes : {\r
- size : function(vars) {\r
- return tinymce.inArray(fontSizes, vars.value) + 1;\r
- }\r
- }\r
- },\r
-\r
- // Setup font elements for colors as well\r
- forecolor : {inline : 'font', attributes : {color : '%value'}},\r
- hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}}\r
- });\r
-\r
- // Check that deprecated elements are allowed if not add them\r
- tinymce.each('b,i,u,strike'.split(','), function(name) {\r
- schema.addValidElements(name + '[*]');\r
- });\r
-\r
- // Add font element if it's missing\r
- if (!schema.getElementRule("font"))\r
- schema.addValidElements("font[face|size|color|style]");\r
-\r
- // Add the missing and depreacted align attribute for the serialization engine\r
- tinymce.each(alignElements.split(','), function(name) {\r
- var rule = schema.getElementRule(name), found;\r
-\r
- if (rule) {\r
- if (!rule.attributes.align) {\r
- rule.attributes.align = {};\r
- rule.attributesOrder.push('align');\r
- }\r
- }\r
- });\r
-\r
- // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes\r
- editor.onNodeChange.add(function(editor, control_manager) {\r
- var control, fontElm, fontName, fontSize;\r
-\r
- // Find font element get it's name and size\r
- fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');\r
- if (fontElm) {\r
- fontName = fontElm.face;\r
- fontSize = fontElm.size;\r
- }\r
-\r
- // Select/unselect the font name in droplist\r
- if (control = control_manager.get('fontselect')) {\r
- control.select(function(value) {\r
- return value == fontName;\r
- });\r
- }\r
-\r
- // Select/unselect the font size in droplist\r
- if (control = control_manager.get('fontsizeselect')) {\r
- control.select(function(value) {\r
- var index = tinymce.inArray(fontSizes, value.fontSize);\r
-\r
- return index + 1 == fontSize;\r
- });\r
- }\r
- });\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'LegacyOutput',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput);\r
-})(tinymce);\r
+++ /dev/null
-(function(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{return v&&u.tagName==="P"&&t.tagName==="P"}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(y){var v="TABBING";var s="EMPTY";var J="ESCAPE";var z="PARAGRAPH";var N="UNKNOWN";var x=N;function E(U){return U.keyCode===tinymce.VK.TAB&&!(U.altKey||U.ctrlKey)&&(y.queryCommandState("InsertUnorderedList")||y.queryCommandState("InsertOrderedList"))}function w(){var U=B();var W=U.parentNode.parentNode;var V=U.parentNode.lastChild===U;return V&&!t(W)&&P(U)}function t(U){if(n(U)){return U.parentNode&&U.parentNode.tagName==="LI"}else{return U.tagName==="LI"}}function F(){return y.selection.isCollapsed()&&P(B())}function B(){var U=y.selection.getStart();return((U.tagName=="BR"||U.tagName=="")&&U.parentNode.tagName=="LI")?U.parentNode:U}function P(U){var V=U.childNodes.length;if(U.tagName==="LI"){return V==0?true:V==1&&(U.firstChild.tagName==""||U.firstChild.tagName=="BR"||H(U))}return false}function H(U){var V=tinymce.grep(U.parentNode.childNodes,function(Y){return Y.tagName=="LI"});var W=U==V[V.length-1];var X=U.firstChild;return tinymce.isIE9&&W&&(X.nodeValue==String.fromCharCode(160)||X.nodeValue==String.fromCharCode(32))}function T(U){return U.keyCode===tinymce.VK.ENTER}function A(U){return T(U)&&!U.shiftKey}function M(U){if(E(U)){return v}else{if(A(U)&&w()){return N}else{if(A(U)&&F()){return s}else{return N}}}}function D(U,V){if(x==v||x==s||tinymce.isGecko&&x==J){r.cancel(V)}}function C(){var U=y.selection.getRng(true);var V=U.startContainer;if(V.nodeType==3){var W=V.nodeValue;if(tinymce.isIE9&&W.length>1&&W.charCodeAt(W.length-1)==32){return(U.endOffset==W.length-1)}else{return(U.endOffset==W.length)}}else{if(V.nodeType==1){return U.endOffset==V.childNodes.length}}return false}function I(){var W=y.selection.getNode();var V="h1,h2,h3,h4,h5,h6,p,div";var U=y.dom.is(W,V)&&W.parentNode.tagName==="LI"&&W.parentNode.lastChild===W;return y.selection.isCollapsed()&&U&&C()}function K(W,Y){if(A(Y)&&I()){var X=W.selection.getNode();var V=W.dom.create("li");var U=W.dom.getParent(X,"li");W.dom.insertAfter(V,U);if(tinymce.isIE6||tinymce.isIE7||tinyMCE.isIE8){W.selection.setCursorLocation(V,1)}else{W.selection.setCursorLocation(V,0)}Y.preventDefault()}}function u(X,Z){var ac;if(!tinymce.isGecko){return}var V=X.selection.getStart();if(Z.keyCode!=tinymce.VK.BACKSPACE||V.tagName!=="IMG"){return}function W(ag){var ah=ag.firstChild;var af=null;do{if(!ah){break}if(ah.tagName==="LI"){af=ah}}while(ah=ah.nextSibling);return af}function ae(ag,af){while(ag.childNodes.length>0){af.appendChild(ag.childNodes[0])}}ac=V.parentNode.previousSibling;if(!ac){return}var aa;if(ac.tagName==="UL"||ac.tagName==="OL"){aa=ac}else{if(ac.previousSibling&&(ac.previousSibling.tagName==="UL"||ac.previousSibling.tagName==="OL")){aa=ac.previousSibling}else{return}}var ad=W(aa);var U=X.dom.createRng();U.setStart(ad,1);U.setEnd(ad,1);X.selection.setRng(U);X.selection.collapse(true);var Y=X.selection.getBookmark();var ab=V.parentNode.cloneNode(true);if(ab.tagName==="P"||ab.tagName==="DIV"){ae(ab,ad)}else{ad.appendChild(ab)}V.parentNode.parentNode.removeChild(V.parentNode);X.selection.moveToBookmark(Y)}function G(U){var V=y.dom.getParent(U,"ol,ul");if(V!=null){var W=V.lastChild;y.selection.setCursorLocation(W,0)}}this.ed=y;y.addCommand("Indent",this.indent,this);y.addCommand("Outdent",this.outdent,this);y.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);y.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);y.onInit.add(function(){y.editorCommands.addCommands({outdent:function(){var V=y.selection,W=y.dom;function U(X){X=W.getParent(X,W.isBlock);return X&&(parseInt(y.dom.getStyle(X,"margin-left")||0,10)+parseInt(y.dom.getStyle(X,"padding-left")||0,10))>0}return U(V.getStart())||U(V.getEnd())||y.queryCommandState("InsertOrderedList")||y.queryCommandState("InsertUnorderedList")}},"state")});y.onKeyUp.add(function(V,W){if(x==v){V.execCommand(W.shiftKey?"Outdent":"Indent",true,null);x=N;return r.cancel(W)}else{if(x==s){var U=B();var Y=V.settings.list_outdent_on_enter===true||W.shiftKey;V.execCommand(Y?"Outdent":"Indent",true,null);if(tinymce.isIE){G(U)}return r.cancel(W)}else{if(x==J){if(tinymce.isIE6||tinymce.isIE7||tinymce.isIE8){var X=V.getDoc().createTextNode("\uFEFF");V.selection.getNode().appendChild(X)}else{if(tinymce.isIE9||tinymce.isGecko){V.execCommand("Outdent");return r.cancel(W)}}}}}});function L(V,U){var W=y.getDoc().createTextNode("\uFEFF");V.insertBefore(W,U);y.selection.setCursorLocation(W,0);y.execCommand("mceRepaint")}function R(V,X){if(T(X)){var U=B();if(U){var W=U.parentNode;var Y=W&&W.parentNode;if(Y&&Y.nodeName=="LI"&&Y.firstChild==W&&U==W.firstChild){L(Y,W)}}}}function S(V,X){if(T(X)){var U=B();if(V.dom.select("ul li",U).length===1){var W=U.firstChild;L(U,W)}}}function Q(W,aa){function X(ab){var ad=[];var ae=new tinymce.dom.TreeWalker(ab.firstChild,ab);for(var ac=ae.current();ac;ac=ae.next()){if(W.dom.is(ac,"ol,ul,li")){ad.push(ac)}}return ad}if(aa.keyCode==tinymce.VK.BACKSPACE){var U=B();if(U){var Z=W.dom.getParent(U,"ol,ul"),V=W.selection.getRng();if(Z&&Z.firstChild===U&&V.startOffset==0){var Y=X(U);Y.unshift(U);W.execCommand("Outdent",false,Y);W.undoManager.add();return r.cancel(aa)}}}}function O(V,X){var U=B();if(X.keyCode===tinymce.VK.BACKSPACE&&V.dom.is(U,"li")&&U.parentNode.firstChild!==U){if(V.dom.select("ul,ol",U).length===1){var Z=U.previousSibling;V.dom.remove(V.dom.select("br",U));V.dom.remove(U,true);var W=tinymce.grep(Z.childNodes,function(aa){return aa.nodeType===3});if(W.length===1){var Y=W[0];V.selection.setCursorLocation(Y,Y.length)}V.undoManager.add();return r.cancel(X)}}}y.onKeyDown.add(function(U,V){x=M(V)});y.onKeyDown.add(D);y.onKeyDown.add(u);y.onKeyDown.add(K);if(tinymce.isGecko){y.onKeyUp.add(R)}if(tinymce.isIE8){y.onKeyUp.add(S)}if(tinymce.isGecko||tinymce.isWebKit){y.onKeyDown.add(Q)}if(tinymce.isWebKit){y.onKeyDown.add(O)}},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(t){if(t.tagName==="LI"&&(M.tagName==="P"||G.length>1)){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true)}return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(P,L,N){var t,O=P,M;while(!I.isBlock(P.parentNode)&&P.parentNode!==I.getRoot()){P=I.split(P.parentNode,P.previousSibling);P=P.nextSibling;O=P}if(N){t=N.cloneNode(true);P.parentNode.insertBefore(t,P);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");P.parentNode.insertBefore(t,P)}while(O&&O!=L){M=O.nextSibling;t.appendChild(O);O=M}if(t.childNodes.length===0){t.innerHTML='<br _mce_bogus="1" />'}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return !(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(U){if(U.hasAttribute&&U.hasAttribute("_mce_bogus")){return true}if(P(N,U)){I.addClass(U,"_mce_tagged_br");N=S(U)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w&&!H||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D,elements:this.selectedBlocks()}}else{B={defaultAction:x,elements:this.selectedBlocks(),processEvenIfEmpty:true}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true),elements:this.selectedBlocks()})},outdent:function(y,x){var w=this,u=w.ed,z=u.dom,s=[];function A(t){var C,B,D;if(!d(u,t,s)){if(z.getStyle(t,"margin-left")!==""||z.getStyle(t,"padding-left")!==""){return w.adjustPaddingFunction(false)(t)}D=z.getStyle(t,"text-align",true);if(D==="center"||D==="right"){z.setStyle(t,"text-align","left");return}t=c(t,z);C=t.parentNode;B=t.parentNode.parentNode;if(B.tagName==="P"){z.split(B,t.parentNode)}else{z.split(C,t);if(B.tagName==="LI"){z.split(B,t)}else{if(!z.is(B,"ol,ul")){z.rename(t,"p")}}}s.push(t)}}var v=x&&tinymce.is(x,"array")?x:this.selectedBlocks();this.process({LI:A,defaultAction:this.adjustPaddingFunction(false),elements:v});e(s,m)},process:function(y){var F=this,w=F.ed.selection,z=F.ed.dom,E,u;function B(t){var s=tinymce.grep(t.childNodes,function(H){return !(H.nodeName==="BR"||H.nodeName==="SPAN"&&z.getAttrib(H,"data-mce-type")=="bookmark"||H.nodeType==3&&(H.nodeValue==String.fromCharCode(160)||H.nodeValue==""))});return s.length===0}function x(s){z.removeClass(s,"_mce_act_on");if(!s||s.nodeType!==1||!y.processEvenIfEmpty&&E.length>1&&B(s)){return}s=k(s,z);var t=y[s.tagName];if(!t){t=y.defaultAction}t(s)}function v(s){F.splitSafeEach(s.childNodes,x,true)}function C(s,t){return t>=0&&s.hasChildNodes()&&t<s.childNodes.length&&s.childNodes[t].tagName==="BR"}function D(){var t=w.getNode();var s=z.getParent(t,"td");return s!==null}E=y.elements;u=w.getRng(true);if(!u.collapsed){if(C(u.endContainer,u.endOffset-1)){u.setEnd(u.endContainer,u.endOffset-1);w.setRng(u)}if(C(u.startContainer,u.startOffset)){u.setStart(u.startContainer,u.startOffset+1);w.setRng(u)}}if(tinymce.isIE8){var G=F.ed.selection.getNode();if(G.tagName==="LI"&&!(G.parentNode.lastChild===G)){var A=F.ed.getDoc().createTextNode("\uFEFF");G.appendChild(A)}}g=w.getBookmark();y.OL=y.UL=v;F.splitSafeEach(E,x);w.moveToBookmark(g);g=null;if(!D()){F.ed.execCommand("mceRepaint")}},splitSafeEach:function(u,t,s){if(s||(tinymce.isGecko&&(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent)||/Firefox\/3\.[0-4]/.test(navigator.userAgent)))){this.classBasedEach(u,t)}else{e(u,t)}},classBasedEach:function(v,u){var w=this.ed.dom,s,t;e(v,function(x){w.addClass(x,"_mce_act_on")});s=w.select("._mce_act_on");while(s.length>0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},selectedBlocks:function(){var s=this.ed,t=s.selection.getSelectedBlocks();return t.length==0?[s.dom.getRoot()]:t},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}());
\ No newline at end of file
+++ /dev/null
-/**
- * editor_plugin_src.js
- *
- * Copyright 2011, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- var each = tinymce.each, Event = tinymce.dom.Event, bookmark;
-
- // Skips text nodes that only contain whitespace since they aren't semantically important.
- function skipWhitespaceNodes(e, next) {
- while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
- e = next(e);
- }
- return e;
- }
-
- function skipWhitespaceNodesBackwards(e) {
- return skipWhitespaceNodes(e, function(e) {
- return e.previousSibling;
- });
- }
-
- function skipWhitespaceNodesForwards(e) {
- return skipWhitespaceNodes(e, function(e) {
- return e.nextSibling;
- });
- }
-
- function hasParentInList(ed, e, list) {
- return ed.dom.getParent(e, function(p) {
- return tinymce.inArray(list, p) !== -1;
- });
- }
-
- function isList(e) {
- return e && (e.tagName === 'OL' || e.tagName === 'UL');
- }
-
- function splitNestedLists(element, dom) {
- var tmp, nested, wrapItem;
- tmp = skipWhitespaceNodesBackwards(element.lastChild);
- while (isList(tmp)) {
- nested = tmp;
- tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
- }
- if (nested) {
- wrapItem = dom.create('li', { style: 'list-style-type: none;'});
- dom.split(element, nested);
- dom.insertAfter(wrapItem, nested);
- wrapItem.appendChild(nested);
- wrapItem.appendChild(nested);
- element = wrapItem.previousSibling;
- }
- return element;
- }
-
- function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
- e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
- return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
- }
-
- function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
- var prev = skipWhitespaceNodesBackwards(e.previousSibling);
- if (prev) {
- return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
- } else {
- return e;
- }
- }
-
- function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
- var next = skipWhitespaceNodesForwards(e.nextSibling);
- if (next) {
- return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
- } else {
- return e;
- }
- }
-
- function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
- if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
- return merge(e1, e2, differentStylesMasterElement);
- } else if (e1 && e1.tagName === 'LI' && isList(e2)) {
- // Fix invalidly nested lists.
- e1.appendChild(e2);
- }
- return e2;
- }
-
- function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
- if (!e1 || !e2) {
- return false;
- } else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
- return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
- } else if (isList(e1)) {
- return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
- } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';
- }
-
- function isListForIndent(e) {
- var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
- return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
- }
-
- function containsOnlyAList(e) {
- var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
- return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
- }
-
- function merge(e1, e2, masterElement) {
- var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
- if (e1.tagName === 'P') {
- e1.appendChild(e1.ownerDocument.createElement('br'));
- }
- while (e2.firstChild) {
- e1.appendChild(e2.firstChild);
- }
- if (masterElement) {
- e1.style.listStyleType = masterElement.style.listStyleType;
- }
- e2.parentNode.removeChild(e2);
- attemptMerge(lastOriginal, firstNew, false);
- return e1;
- }
-
- function findItemToOperateOn(e, dom) {
- var item;
- if (!dom.is(e, 'li,ol,ul')) {
- item = dom.getParent(e, 'li');
- if (item) {
- e = item;
- }
- }
- return e;
- }
-
- tinymce.create('tinymce.plugins.Lists', {
- init: function(ed) {
- var LIST_TABBING = 'TABBING';
- var LIST_EMPTY_ITEM = 'EMPTY';
- var LIST_ESCAPE = 'ESCAPE';
- var LIST_PARAGRAPH = 'PARAGRAPH';
- var LIST_UNKNOWN = 'UNKNOWN';
- var state = LIST_UNKNOWN;
-
- function isTabInList(e) {
- // Don't indent on Ctrl+Tab or Alt+Tab
- return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) &&
- (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
- }
-
- function isOnLastListItem() {
- var li = getLi();
- var grandParent = li.parentNode.parentNode;
- var isLastItem = li.parentNode.lastChild === li;
- return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);
- }
-
- function isNestedList(grandParent) {
- if (isList(grandParent)) {
- return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';
- } else {
- return grandParent.tagName === 'LI';
- }
- }
-
- function isInEmptyListItem() {
- return ed.selection.isCollapsed() && isEmptyListItem(getLi());
- }
-
- function getLi() {
- var n = ed.selection.getStart();
- // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position
- return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;
- }
-
- function isEmptyListItem(li) {
- var numChildren = li.childNodes.length;
- if (li.tagName === 'LI') {
- return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li));
- }
- return false;
- }
-
- function isEmptyIE9Li(li) {
- // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these
- var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'});
- var isLastLi = li == lis[lis.length - 1];
- var child = li.firstChild;
- return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));
- }
-
- function isEnter(e) {
- return e.keyCode === tinymce.VK.ENTER;
- }
-
- function isEnterWithoutShift(e) {
- return isEnter(e) && !e.shiftKey;
- }
-
- function getListKeyState(e) {
- if (isTabInList(e)) {
- return LIST_TABBING;
- } else if (isEnterWithoutShift(e) && isOnLastListItem()) {
- // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now
- //return LIST_ESCAPE;
- return LIST_UNKNOWN;
- } else if (isEnterWithoutShift(e) && isInEmptyListItem()) {
- return LIST_EMPTY_ITEM;
- } else {
- return LIST_UNKNOWN;
- }
- }
-
- function cancelDefaultEvents(ed, e) {
- // list escape is done manually using outdent as it does not create paragraphs correctly in td's
- if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) {
- Event.cancel(e);
- }
- }
-
- function isCursorAtEndOfContainer() {
- var range = ed.selection.getRng(true);
- var startContainer = range.startContainer;
- if (startContainer.nodeType == 3) {
- var value = startContainer.nodeValue;
- if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) {
- // IE9 places a space on the end of the text in some cases so ignore last char
- return (range.endOffset == value.length-1);
- } else {
- return (range.endOffset == value.length);
- }
- } else if (startContainer.nodeType == 1) {
- return range.endOffset == startContainer.childNodes.length;
- }
- return false;
- }
-
- /*
- If we are at the end of a list item surrounded with an element, pressing enter should create a
- new list item instead without splitting the element e.g. don't want to create new P or H1 tag
- */
- function isEndOfListItem() {
- var node = ed.selection.getNode();
- var validElements = 'h1,h2,h3,h4,h5,h6,p,div';
- var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node;
- return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer();
- }
-
- // Creates a new list item after the current selection's list item parent
- function createNewLi(ed, e) {
- if (isEnterWithoutShift(e) && isEndOfListItem()) {
- var node = ed.selection.getNode();
- var li = ed.dom.create("li");
- var parentLi = ed.dom.getParent(node, 'li');
- ed.dom.insertAfter(li, parentLi);
-
- // Move caret to new list element.
- if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) {
- // Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic
- //li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point
- ed.selection.setCursorLocation(li, 1);
- } else {
- ed.selection.setCursorLocation(li, 0);
- }
- e.preventDefault();
- }
- }
-
- function imageJoiningListItem(ed, e) {
- var prevSibling;
-
- if (!tinymce.isGecko)
- return;
-
- var n = ed.selection.getStart();
- if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG')
- return;
-
- function lastLI(node) {
- var child = node.firstChild;
- var li = null;
- do {
- if (!child)
- break;
-
- if (child.tagName === 'LI')
- li = child;
- } while (child = child.nextSibling);
-
- return li;
- }
-
- function addChildren(parentNode, destination) {
- while (parentNode.childNodes.length > 0)
- destination.appendChild(parentNode.childNodes[0]);
- }
-
- // Check if there is a previous sibling
- prevSibling = n.parentNode.previousSibling;
- if (!prevSibling)
- return;
-
- var ul;
- if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')
- ul = prevSibling;
- else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))
- ul = prevSibling.previousSibling;
- else
- return;
-
- var li = lastLI(ul);
-
- // move the caret to the end of the list item
- var rng = ed.dom.createRng();
- rng.setStart(li, 1);
- rng.setEnd(li, 1);
- ed.selection.setRng(rng);
- ed.selection.collapse(true);
-
- // save a bookmark at the end of the list item
- var bookmark = ed.selection.getBookmark();
-
- // copy the image an its text to the list item
- var clone = n.parentNode.cloneNode(true);
- if (clone.tagName === 'P' || clone.tagName === 'DIV')
- addChildren(clone, li);
- else
- li.appendChild(clone);
-
- // remove the old copy of the image
- n.parentNode.parentNode.removeChild(n.parentNode);
-
- // move the caret where we saved the bookmark
- ed.selection.moveToBookmark(bookmark);
- }
-
- // fix the cursor position to ensure it is correct in IE
- function setCursorPositionToOriginalLi(li) {
- var list = ed.dom.getParent(li, 'ol,ul');
- if (list != null) {
- var lastLi = list.lastChild;
- // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic
- //lastLi.appendChild(ed.getDoc().createElement(''));
- ed.selection.setCursorLocation(lastLi, 0);
- }
- }
-
- this.ed = ed;
- ed.addCommand('Indent', this.indent, this);
- ed.addCommand('Outdent', this.outdent, this);
- ed.addCommand('InsertUnorderedList', function() {
- this.applyList('UL', 'OL');
- }, this);
- ed.addCommand('InsertOrderedList', function() {
- this.applyList('OL', 'UL');
- }, this);
-
- ed.onInit.add(function() {
- ed.editorCommands.addCommands({
- 'outdent': function() {
- var sel = ed.selection, dom = ed.dom;
-
- function hasStyleIndent(n) {
- n = dom.getParent(n, dom.isBlock);
- return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
- }
-
- return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
- }
- }, 'state');
- });
-
- ed.onKeyUp.add(function(ed, e) {
- if (state == LIST_TABBING) {
- ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
- state = LIST_UNKNOWN;
- return Event.cancel(e);
- } else if (state == LIST_EMPTY_ITEM) {
- var li = getLi();
- var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;
- ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);
- if (tinymce.isIE) {
- setCursorPositionToOriginalLi(li);
- }
-
- return Event.cancel(e);
- } else if (state == LIST_ESCAPE) {
- if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) {
- // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting.
- // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after
- // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.
- var n = ed.getDoc().createTextNode('\uFEFF');
- ed.selection.getNode().appendChild(n);
- } else if (tinymce.isIE9 || tinymce.isGecko) {
- // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour
- // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves
- ed.execCommand('Outdent');
- return Event.cancel(e);
- }
- }
- });
-
- function fixListItem(parent, reference) {
- // a zero-sized non-breaking space is placed in the empty list item so that the nested list is
- // displayed on the below line instead of next to it
- var n = ed.getDoc().createTextNode('\uFEFF');
- parent.insertBefore(n, reference);
- ed.selection.setCursorLocation(n, 0);
- // repaint to remove rendering artifact. only visible when creating new list
- ed.execCommand('mceRepaint');
- }
-
- function fixIndentedListItemForGecko(ed, e) {
- if (isEnter(e)) {
- var li = getLi();
- if (li) {
- var parent = li.parentNode;
- var grandParent = parent && parent.parentNode;
- if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) {
- fixListItem(grandParent, parent);
- }
- }
- }
- }
-
- function fixIndentedListItemForIE8(ed, e) {
- if (isEnter(e)) {
- var li = getLi();
- if (ed.dom.select('ul li', li).length === 1) {
- var list = li.firstChild;
- fixListItem(li, list);
- }
- }
- }
-
- function fixDeletingFirstCharOfList(ed, e) {
- function listElements(li) {
- var elements = [];
- var walker = new tinymce.dom.TreeWalker(li.firstChild, li);
- for (var node = walker.current(); node; node = walker.next()) {
- if (ed.dom.is(node, 'ol,ul,li')) {
- elements.push(node);
- }
- }
- return elements;
- }
-
- if (e.keyCode == tinymce.VK.BACKSPACE) {
- var li = getLi();
- if (li) {
- var list = ed.dom.getParent(li, 'ol,ul'),
- rng = ed.selection.getRng();
- if (list && list.firstChild === li && rng.startOffset == 0) {
- var elements = listElements(li);
- elements.unshift(li);
- ed.execCommand("Outdent", false, elements);
- ed.undoManager.add();
- return Event.cancel(e);
- }
- }
- }
- }
-
- function fixDeletingEmptyLiInWebkit(ed, e) {
- var li = getLi();
- if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) {
- if (ed.dom.select('ul,ol', li).length === 1) {
- var prevLi = li.previousSibling;
- ed.dom.remove(ed.dom.select('br', li));
- ed.dom.remove(li, true);
- var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });
- if (textNodes.length === 1) {
- var textNode = textNodes[0];
- ed.selection.setCursorLocation(textNode, textNode.length);
- }
- ed.undoManager.add();
- return Event.cancel(e);
- }
- }
- }
-
- ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });
- ed.onKeyDown.add(cancelDefaultEvents);
- ed.onKeyDown.add(imageJoiningListItem);
- ed.onKeyDown.add(createNewLi);
-
- if (tinymce.isGecko) {
- ed.onKeyUp.add(fixIndentedListItemForGecko);
- }
- if (tinymce.isIE8) {
- ed.onKeyUp.add(fixIndentedListItemForIE8);
- }
- if (tinymce.isGecko || tinymce.isWebKit) {
- ed.onKeyDown.add(fixDeletingFirstCharOfList);
- }
- if (tinymce.isWebKit) {
- ed.onKeyDown.add(fixDeletingEmptyLiInWebkit);
- }
- },
-
- applyList: function(targetListType, oppositeListType) {
- var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
- selectedBlocks = ed.selection.getSelectedBlocks();
-
- function cleanupBr(e) {
- if (e && e.tagName === 'BR') {
- dom.remove(e);
- }
- }
-
- function makeList(element) {
- var list = dom.create(targetListType), li;
-
- function adjustIndentForNewList(element) {
- // If there's a margin-left, outdent one level to account for the extra list margin.
- if (element.style.marginLeft || element.style.paddingLeft) {
- t.adjustPaddingFunction(false)(element);
- }
- }
-
- if (element.tagName === 'LI') {
- // No change required.
- } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
- processBrs(element, function(startSection, br) {
- doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
- li = startSection.parentNode;
- adjustIndentForNewList(li);
- cleanupBr(br);
- });
- if (li) {
- if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) {
- dom.split(li.parentNode.parentNode, li.parentNode);
- }
- attemptMergeWithAdjacent(li.parentNode, true);
- }
- return;
- } else {
- // Put the list around the element.
- li = dom.create('li');
- dom.insertAfter(li, element);
- li.appendChild(element);
- adjustIndentForNewList(element);
- element = li;
- }
- dom.insertAfter(list, element);
- list.appendChild(element);
- attemptMergeWithAdjacent(list, true);
- applied.push(element);
- }
-
- function doWrapList(start, end, template) {
- var li, n = start, tmp;
- while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
- start = dom.split(start.parentNode, start.previousSibling);
- start = start.nextSibling;
- n = start;
- }
- if (template) {
- li = template.cloneNode(true);
- start.parentNode.insertBefore(li, start);
- while (li.firstChild) dom.remove(li.firstChild);
- li = dom.rename(li, 'li');
- } else {
- li = dom.create('li');
- start.parentNode.insertBefore(li, start);
- }
- while (n && n != end) {
- tmp = n.nextSibling;
- li.appendChild(n);
- n = tmp;
- }
- if (li.childNodes.length === 0) {
- li.innerHTML = '<br _mce_bogus="1" />';
- }
- makeList(li);
- }
-
- function processBrs(element, callback) {
- var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
- breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
-
- function isAnyPartSelected(start, end) {
- var r = dom.createRng(), sel;
- bookmark.keep = true;
- ed.selection.moveToBookmark(bookmark);
- bookmark.keep = false;
- sel = ed.selection.getRng(true);
- if (!end) {
- end = start.parentNode.lastChild;
- }
- r.setStartBefore(start);
- r.setEndAfter(end);
- return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
- }
-
- function nextLeaf(br) {
- if (br.nextSibling)
- return br.nextSibling;
- if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
- return nextLeaf(br.parentNode);
- }
-
- // Split on BRs within the range and process those.
- startSection = element.firstChild;
- // First mark the BRs that have any part of the previous section selected.
- var trailingContentSelected = false;
- each(dom.select(breakElements, element), function(br) {
- if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
- return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
- }
- if (isAnyPartSelected(startSection, br)) {
- dom.addClass(br, '_mce_tagged_br');
- startSection = nextLeaf(br);
- }
- });
- trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
- startSection = element.firstChild;
- each(dom.select(breakElements, element), function(br) {
- // Got a section from start to br.
- var tmp = nextLeaf(br);
- if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
- return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
- }
- if (dom.hasClass(br, '_mce_tagged_br')) {
- callback(startSection, br, previousBR);
- previousBR = null;
- } else {
- previousBR = br;
- }
- startSection = tmp;
- });
- if (trailingContentSelected) {
- callback(startSection, undefined, previousBR);
- }
- }
-
- function wrapList(element) {
- processBrs(element, function(startSection, br, previousBR) {
- // Need to indent this part
- doWrapList(startSection, br);
- cleanupBr(br);
- cleanupBr(previousBR);
- });
- }
-
- function changeList(element) {
- if (tinymce.inArray(applied, element) !== -1) {
- return;
- }
- if (element.parentNode.tagName === oppositeListType) {
- dom.split(element.parentNode, element);
- makeList(element);
- attemptMergeWithNext(element.parentNode, false);
- }
- applied.push(element);
- }
-
- function convertListItemToParagraph(element) {
- var child, nextChild, mergedElement, splitLast;
- if (tinymce.inArray(applied, element) !== -1) {
- return;
- }
- element = splitNestedLists(element, dom);
- while (dom.is(element.parentNode, 'ol,ul,li')) {
- dom.split(element.parentNode, element);
- }
- // Push the original element we have from the selection, not the renamed one.
- applied.push(element);
- element = dom.rename(element, 'p');
- mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
- if (mergedElement === element) {
- // Now split out any block elements that can't be contained within a P.
- // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
- child = element.firstChild;
- while (child) {
- if (dom.isBlock(child)) {
- child = dom.split(child.parentNode, child);
- splitLast = true;
- nextChild = child.nextSibling && child.nextSibling.firstChild;
- } else {
- nextChild = child.nextSibling;
- if (splitLast && child.tagName === 'BR') {
- dom.remove(child);
- }
- splitLast = false;
- }
- child = nextChild;
- }
- }
- }
-
- each(selectedBlocks, function(e) {
- e = findItemToOperateOn(e, dom);
- if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
- hasOppositeType = true;
- } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
- hasSameType = true;
- } else {
- hasNonList = true;
- }
- });
-
- if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) {
- actions = {
- 'LI': changeList,
- 'H1': makeList,
- 'H2': makeList,
- 'H3': makeList,
- 'H4': makeList,
- 'H5': makeList,
- 'H6': makeList,
- 'P': makeList,
- 'BODY': makeList,
- 'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
- defaultAction: wrapList,
- elements: this.selectedBlocks()
- };
- } else {
- actions = {
- defaultAction: convertListItemToParagraph,
- elements: this.selectedBlocks(),
- processEvenIfEmpty: true
- };
- }
- this.process(actions);
- },
-
- indent: function() {
- var ed = this.ed, dom = ed.dom, indented = [];
-
- function createWrapItem(element) {
- var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
- dom.insertAfter(wrapItem, element);
- return wrapItem;
- }
-
- function createWrapList(element) {
- var wrapItem = createWrapItem(element),
- list = dom.getParent(element, 'ol,ul'),
- listType = list.tagName,
- listStyle = dom.getStyle(list, 'list-style-type'),
- attrs = {},
- wrapList;
- if (listStyle !== '') {
- attrs.style = 'list-style-type: ' + listStyle + ';';
- }
- wrapList = dom.create(listType, attrs);
- wrapItem.appendChild(wrapList);
- return wrapList;
- }
-
- function indentLI(element) {
- if (!hasParentInList(ed, element, indented)) {
- element = splitNestedLists(element, dom);
- var wrapList = createWrapList(element);
- wrapList.appendChild(element);
- attemptMergeWithAdjacent(wrapList.parentNode, false);
- attemptMergeWithAdjacent(wrapList, false);
- indented.push(element);
- }
- }
-
- this.process({
- 'LI': indentLI,
- defaultAction: this.adjustPaddingFunction(true),
- elements: this.selectedBlocks()
- });
-
- },
-
- outdent: function(ui, elements) {
- var t = this, ed = t.ed, dom = ed.dom, outdented = [];
-
- function outdentLI(element) {
- var listElement, targetParent, align;
- if (!hasParentInList(ed, element, outdented)) {
- if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
- return t.adjustPaddingFunction(false)(element);
- }
- align = dom.getStyle(element, 'text-align', true);
- if (align === 'center' || align === 'right') {
- dom.setStyle(element, 'text-align', 'left');
- return;
- }
- element = splitNestedLists(element, dom);
- listElement = element.parentNode;
- targetParent = element.parentNode.parentNode;
- if (targetParent.tagName === 'P') {
- dom.split(targetParent, element.parentNode);
- } else {
- dom.split(listElement, element);
- if (targetParent.tagName === 'LI') {
- // Nested list, need to split the LI and go back out to the OL/UL element.
- dom.split(targetParent, element);
- } else if (!dom.is(targetParent, 'ol,ul')) {
- dom.rename(element, 'p');
- }
- }
- outdented.push(element);
- }
- }
-
- var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks();
- this.process({
- 'LI': outdentLI,
- defaultAction: this.adjustPaddingFunction(false),
- elements: listElements
- });
-
- each(outdented, attemptMergeWithAdjacent);
- },
-
- process: function(actions) {
- var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
-
- function isEmptyElement(element) {
- var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {
- return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark'
- || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == ''));
- });
- return excludeBrsAndBookmarks.length === 0;
- }
-
- function processElement(element) {
- dom.removeClass(element, '_mce_act_on');
- if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) {
- return;
- }
- element = findItemToOperateOn(element, dom);
- var action = actions[element.tagName];
- if (!action) {
- action = actions.defaultAction;
- }
- action(element);
- }
-
- function recurse(element) {
- t.splitSafeEach(element.childNodes, processElement, true);
- }
-
- function brAtEdgeOfSelection(container, offset) {
- return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
- container.childNodes[offset].tagName === 'BR';
- }
-
- function isInTable() {
- var n = sel.getNode();
- var p = dom.getParent(n, 'td');
- return p !== null;
- }
-
- selectedBlocks = actions.elements;
-
- r = sel.getRng(true);
- if (!r.collapsed) {
- if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
- r.setEnd(r.endContainer, r.endOffset - 1);
- sel.setRng(r);
- }
- if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
- r.setStart(r.startContainer, r.startOffset + 1);
- sel.setRng(r);
- }
- }
-
-
- if (tinymce.isIE8) {
- // append a zero sized nbsp so that caret is restored correctly using bookmark
- var s = t.ed.selection.getNode();
- if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {
- var i = t.ed.getDoc().createTextNode('\uFEFF');
- s.appendChild(i);
- }
- }
-
- bookmark = sel.getBookmark();
- actions.OL = actions.UL = recurse;
- t.splitSafeEach(selectedBlocks, processElement);
- sel.moveToBookmark(bookmark);
- bookmark = null;
-
- // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6
- if (!isInTable()) {
- // Avoids table or image handles being left behind in Firefox.
- t.ed.execCommand('mceRepaint');
- }
- },
-
- splitSafeEach: function(elements, f, forceClassBase) {
- if (forceClassBase ||
- (tinymce.isGecko &&
- (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
- /Firefox\/3\.[0-4]/.test(navigator.userAgent)))) {
- this.classBasedEach(elements, f);
- } else {
- each(elements, f);
- }
- },
-
- classBasedEach: function(elements, f) {
- var dom = this.ed.dom, nodes, element;
- // Mark nodes
- each(elements, function(element) {
- dom.addClass(element, '_mce_act_on');
- });
- nodes = dom.select('._mce_act_on');
- while (nodes.length > 0) {
- element = nodes.shift();
- dom.removeClass(element, '_mce_act_on');
- f(element);
- nodes = dom.select('._mce_act_on');
- }
- },
-
- adjustPaddingFunction: function(isIndent) {
- var indentAmount, indentUnits, ed = this.ed;
- indentAmount = ed.settings.indentation;
- indentUnits = /[a-z%]+/i.exec(indentAmount);
- indentAmount = parseInt(indentAmount, 10);
- return function(element) {
- var currentIndent, newIndentAmount;
- currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
- if (isIndent) {
- newIndentAmount = currentIndent + indentAmount;
- } else {
- newIndentAmount = currentIndent - indentAmount;
- }
- ed.dom.setStyle(element, 'padding-left', '');
- ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
- };
- },
-
- selectedBlocks: function() {
- var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks();
- return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
- },
-
- getInfo: function() {
- return {
- longname : 'Lists',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
- tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
-}());
+++ /dev/null
-#id, #name, #hspace, #vspace, #class_name, #align { width: 100px }\r
-#hspace, #vspace { width: 50px }\r
-#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }\r
-#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px }\r
-#width, #height { width: 40px }\r
-#src, #media_type { width: 250px }\r
-#class { width: 120px }\r
-#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto }\r
-.panel_wrapper div.current { height: 420px; overflow: auto }\r
-#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }\r
-.mceAddSelectValue { background-color: #DDDDDD }\r
-#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }\r
-#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }\r
-#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }\r
-#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }\r
-#qt_qtsrc { width: 200px }\r
-iframe {border: 1px solid gray}\r
+++ /dev/null
-(function(){var b=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),a=tinymce.makeMap(b.join(",")),f=tinymce.html.Node,d,i,h=tinymce.util.JSON,g;d=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function e(j){return typeof(j)=="string"?j.replace(/[^0-9%]/g,""):j}function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(s){return s&&s.nodeName==="IMG"&&n.dom.hasClass(s,"mceItemMedia")}r.editor=n;r.url=j;i="";for(m=0;m<d.length;m++){k=d[m][0];q={name:k,clsids:tinymce.explode(d[m][1]||""),mimes:tinymce.explode(d[m][2]||""),codebase:d[m][3]};for(p=0;p<q.clsids.length;p++){l["clsid:"+q.clsids[p]]=q}for(p=0;p<q.mimes.length;p++){l[q.mimes[p]]=q}l["mceItem"+k]=q;l[k.toLowerCase()]=q;i+=(i?"|":"")+k}tinymce.each(n.getParam("media_types","video=mp4,m4v,ogv,webm;silverlight=xap;flash=swf,flv;shockwave=dcr;quicktime=mov,qt,mpg,mpeg;shockwave=dcr;windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;realmedia=rm,ra,ram;java=jar;audio=mp3,ogg").split(";"),function(v){var s,u,t;v=v.split(/=/);u=tinymce.explode(v[1].toLowerCase());for(s=0;s<u.length;s++){t=l[v[0].toLowerCase()];if(t){l[u[s]]=t}}});i=new RegExp("write("+i+")\\(([^)]+)\\)");r.lookup=l;n.onPreInit.add(function(){n.schema.addValidElements("object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]");n.parser.addNodeFilter("object,embed,video,audio,script,iframe",function(s){var t=s.length;while(t--){r.objectToImg(s[t])}});n.serializer.addNodeFilter("img",function(s,u,t){var v=s.length,w;while(v--){w=s[v];if((w.attr("class")||"").indexOf("mceItemMedia")!==-1){r.imgToObject(w,t)}}})});n.onInit.add(function(){if(n.theme&&n.theme.onResolveName){n.theme.onResolveName.add(function(s,t){if(t.name==="img"&&n.dom.hasClass(t.node,"mceItemMedia")){t.name="media"}})}if(n&&n.plugins.contextmenu){n.plugins.contextmenu.onContextMenu.add(function(t,u,s){if(s.nodeName==="IMG"&&s.className.indexOf("mceItemMedia")!==-1){u.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});n.addCommand("mceMedia",function(){var t,s;s=n.selection.getNode();if(o(s)){t=n.dom.getAttrib(s,"data-mce-json");if(t){t=h.parse(t);tinymce.each(b,function(u){var v=n.dom.getAttrib(s,u);if(v){t[u]=v}});t.type=r.getType(s.className).name.toLowerCase()}}if(!t){t={type:"flash",video:{sources:[]},params:{}}}n.windowManager.open({file:j+"/media.htm",width:430+parseInt(n.getLang("media.delta_width",0)),height:500+parseInt(n.getLang("media.delta_height",0)),inline:1},{plugin_url:j,data:t})});n.addButton("media",{title:"media.desc",cmd:"mceMedia"});n.onNodeChange.add(function(t,s,u){s.setActive("media",o(u))})},convertUrl:function(l,o){var k=this,n=k.editor,m=n.settings,p=m.url_converter,j=m.url_converter_scope||k;if(!l){return l}if(o){return n.documentBaseURI.toAbsolute(l)}return p.call(j,l,"src","object")},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},dataToImg:function(m,k){var r=this,o=r.editor,p=o.documentBaseURI,j,q,n,l;m.params.src=r.convertUrl(m.params.src,k);q=m.video.attrs;if(q){q.src=r.convertUrl(q.src,k)}if(q){q.poster=r.convertUrl(q.poster,k)}j=c(m.video.sources);if(j){for(l=0;l<j.length;l++){j[l].src=r.convertUrl(j[l].src,k)}}n=r.editor.dom.create("img",{id:m.id,style:m.style,align:m.align,hspace:m.hspace,vspace:m.vspace,src:r.editor.theme.url+"/img/trans.gif","class":"mceItemMedia mceItem"+r.getType(m.type).name,"data-mce-json":h.serialize(m,"'")});n.width=m.width=e(m.width||(m.type=="audio"?"300":"320"));n.height=m.height=e(m.height||(m.type=="audio"?"32":"240"));return n},dataToHtml:function(j,k){return this.editor.serializer.serialize(this.dataToImg(j,k),{forced_root_block:"",force_absolute:k})},htmlToData:function(l){var k,j,m;m={type:"flash",video:{sources:[]},params:{}};k=this.editor.parser.parse(l);j=k.getAll("img")[0];if(j){m=h.parse(j.attr("data-mce-json"));m.type=this.getType(j.attr("class")).name.toLowerCase();tinymce.each(b,function(n){var o=j.attr(n);if(o){m[n]=o}})}return m},getType:function(m){var k,j,l;j=tinymce.explode(m," ");for(k=0;k<j.length;k++){l=this.lookup[j[k]];if(l){return l}}},imgToObject:function(z,o){var u=this,p=u.editor,C,H,j,t,I,y,G,w,k,E,s,q,A,D,m,x,l,B,F;function r(n,J){var N,M,O,L,K;K=p.getParam("flash_video_player_url",u.convertUrl(u.url+"/moxieplayer.swf"));if(K){N=p.documentBaseURI;G.params.src=K;if(p.getParam("flash_video_player_absvideourl",true)){n=N.toAbsolute(n||"",true);J=N.toAbsolute(J||"",true)}O="";M=p.getParam("flash_video_player_flashvars",{url:"$url",poster:"$poster"});tinymce.each(M,function(Q,P){Q=Q.replace(/\$url/,n||"");Q=Q.replace(/\$poster/,J||"");if(Q.length>0){O+=(O?"&":"")+P+"="+escape(Q)}});if(O.length){G.params.flashvars=O}L=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(L,function(Q,P){G.params[P]=""+Q})}}G=z.attr("data-mce-json");if(!G){return}G=h.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}G.width=z.attr("width")||G.width;G.height=z.attr("height")||G.height;if(q.name==="Iframe"){x=new f("iframe",1);tinymce.each(b,function(n){var J=z.attr(n);if(n=="class"&&J){J=J.replace(/mceItem.+ ?/g,"")}if(J&&J.length>0){x.attr(n,J)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new f("script",1).attr("type","text/javascript");y=new f("#text",3);y.value="write"+q.name+"("+h.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new f("video",1).attr(tinymce.extend({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A<k.length;A++){if(/\.mp4$/.test(k[A].src)){m=k[A].src}}if(!k[0].type){C.attr("src",k[0].src);k.splice(0,1)}for(A=0;A<k.length;A++){w=new f("source",1).attr(k[A]);w.shortEnded=true;C.append(w)}if(m){r(m,l);q=u.getType("flash")}else{G.params.src=""}}if(q.name==="Audio"&&G.video.sources[0]){F=new f("audio",1).attr(tinymce.extend({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);if(!k[0].type){F.attr("src",k[0].src);k.splice(0,1)}for(A=0;A<k.length;A++){w=new f("source",1).attr(k[A]);w.shortEnded=true;F.append(w)}G.params.src=""}if(q.name==="EmbeddedAudio"){j=new f("embed",1);j.shortEnded=true;j.attr({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B,type:z.attr("type")});for(I in G.params){j.attr(I,G.params[I])}tinymce.each(b,function(n){if(G[n]&&n!="type"){j.attr(n,G[n])}});G.params.src=""}if(G.params.src){if(/\.flv$/i.test(G.params.src)){r(G.params.src,"")}if(o&&o.force_absolute){G.params.src=p.documentBaseURI.toAbsolute(G.params.src)}H=new f("object",1).attr({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B});tinymce.each(b,function(n){var J=G[n];if(n=="class"&&J){J=J.replace(/mceItem.+ ?/g,"")}if(J&&n!="type"){H.attr(n,J)}});for(I in G.params){s=new f("param",1);s.shortEnded=true;y=G.params[I];if(I==="src"&&q.name==="WindowsMedia"){I="url"}s.attr({name:I,value:y});H.append(s)}if(this.editor.getParam("media_strict",true)){H.attr({data:G.params.src,type:q.mimes[0]})}else{H.attr({classid:"clsid:"+q.clsids[0],codebase:q.codebase});j=new f("embed",1);j.shortEnded=true;j.attr({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B,type:q.mimes[0]});for(I in G.params){j.attr(I,G.params[I])}tinymce.each(b,function(n){if(G[n]&&n!="type"){j.attr(n,G[n])}});H.append(j)}if(G.object_html){y=new f("#text",3);y.raw=true;y.value=G.object_html;H.append(y)}if(C){C.append(H)}}if(C){if(G.video_html){y=new f("#text",3);y.raw=true;y.value=G.video_html;C.append(y)}}if(F){if(G.video_html){y=new f("#text",3);y.raw=true;y.value=G.video_html;F.append(y)}}var v=C||F||H||j;if(v){z.replace(v)}else{z.remove()}},objectToImg:function(C){var L,k,F,s,M,N,y,A,x,G,E,t,q,I,B,l,K,o,H=this.lookup,m,z,v=this.editor.settings.url_converter,n=this.editor.settings.url_converter_scope,w,r,D,j;function u(O){return new tinymce.html.Serializer({inner:true,validate:false}).serialize(O)}function J(P,O){return H[(P.attr(O)||"").toLowerCase()]}function p(P){var O=P.replace(/^.*\.([^.]+)$/,"$1");return H[O.toLowerCase()||""]}if(!C.parent){return}if(C.name==="script"){if(C.firstChild){m=i.exec(C.firstChild.value)}if(!m){return}o=m[1];K={video:{},params:h.parse(m[2])};A=K.params.width;x=K.params.height}K=K||{video:{},params:{}};M=new f("img",1);M.attr({src:this.editor.theme.url+"/img/trans.gif"});N=C.name;if(N==="video"||N=="audio"){F=C;L=C.getAll("object")[0];k=C.getAll("embed")[0];A=F.attr("width");x=F.attr("height");y=F.attr("id");K.video={attrs:{},sources:[]};z=K.video.attrs;for(N in F.attributes.map){z[N]=F.attributes.map[N]}B=C.attr("src");if(B){K.video.sources.push({src:v.call(n,B,"src",C.name)})}l=F.getAll("source");for(E=0;E<l.length;E++){B=l[E].remove();K.video.sources.push({src:v.call(n,B.attr("src"),"src","source"),type:B.attr("type"),media:B.attr("media")})}if(z.poster){z.poster=v.call(n,z.poster,"poster",C.name)}}if(C.name==="object"){L=C;k=C.getAll("embed")[0]}if(C.name==="embed"){k=C}if(C.name==="iframe"){s=C;o="Iframe"}if(L){A=A||L.attr("width");x=x||L.attr("height");G=G||L.attr("style");y=y||L.attr("id");w=w||L.attr("hspace");r=r||L.attr("vspace");D=D||L.attr("align");j=j||L.attr("bgcolor");K.name=L.attr("name");I=L.getAll("param");for(E=0;E<I.length;E++){q=I[E];N=q.remove().attr("name");if(!a[N]){K.params[N]=q.attr("value")}}K.params.src=K.params.src||L.attr("data")}if(k){A=A||k.attr("width");x=x||k.attr("height");G=G||k.attr("style");y=y||k.attr("id");w=w||k.attr("hspace");r=r||k.attr("vspace");D=D||k.attr("align");j=j||k.attr("bgcolor");for(N in k.attributes.map){if(!a[N]&&!K.params[N]){K.params[N]=k.attributes.map[N]}}}if(s){A=e(s.attr("width"));x=e(s.attr("height"));G=G||s.attr("style");y=s.attr("id");w=s.attr("hspace");r=s.attr("vspace");D=s.attr("align");j=s.attr("bgcolor");tinymce.each(b,function(O){M.attr(O,s.attr(O))});for(N in s.attributes.map){if(!a[N]&&!K.params[N]){K.params[N]=s.attributes.map[N]}}}if(K.params.movie){K.params.src=K.params.src||K.params.movie;delete K.params.movie}if(K.params.src){K.params.src=v.call(n,K.params.src,"src","object")}if(F){if(C.name==="video"){o=H.video.name}else{if(C.name==="audio"){o=H.audio.name}}}if(L&&!o){o=(J(L,"clsid")||J(L,"classid")||J(L,"type")||{}).name}if(k&&!o){o=(J(k,"type")||p(K.params.src)||{}).name}if(k&&o=="EmbeddedAudio"){K.params.type=k.attr("type")}C.replace(M);if(k){k.remove()}if(L){t=u(L.remove());if(t){K.object_html=t}}if(F){t=u(F.remove());if(t){K.video_html=t}}K.hspace=w;K.vspace=r;K.align=D;K.bgcolor=j;M.attr({id:y,"class":"mceItemMedia mceItem"+(o||"Flash"),style:G,width:A||(C.name=="audio"?"300":"320"),height:x||(C.name=="audio"?"32":"240"),hspace:w,vspace:r,align:D,bgcolor:j,"data-mce-json":h.serialize(K,"'")})}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node,\r
- mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes;\r
-\r
- // Media types supported by this plugin\r
- mediaTypes = [\r
- // Type, clsid:s, mime types, codebase\r
- ["Flash", "d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],\r
- ["ShockWave", "166b1bca-3f9c-11cf-8075-444553540000", "application/x-director", "http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],\r
- ["WindowsMedia", "6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a", "application/x-mplayer2", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],\r
- ["QuickTime", "02bf25d5-8c17-4b23-bc80-d3488abddc6b", "video/quicktime", "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],\r
- ["RealMedia", "cfcdaa03-8be4-11cf-b84b-0020afbbccfa", "audio/x-pn-realaudio-plugin", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],\r
- ["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],\r
- ["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"],\r
- ["Iframe"],\r
- ["Video"],\r
- ["EmbeddedAudio"],\r
- ["Audio"]\r
- ];\r
-\r
- function normalizeSize(size) {\r
- return typeof(size) == "string" ? size.replace(/[^0-9%]/g, '') : size;\r
- }\r
-\r
- function toArray(obj) {\r
- var undef, out, i;\r
-\r
- if (obj && !obj.splice) {\r
- out = [];\r
-\r
- for (i = 0; true; i++) {\r
- if (obj[i])\r
- out[i] = obj[i];\r
- else\r
- break;\r
- }\r
-\r
- return out;\r
- }\r
-\r
- return obj;\r
- };\r
-\r
- tinymce.create('tinymce.plugins.MediaPlugin', {\r
- init : function(ed, url) {\r
- var self = this, lookup = {}, i, y, item, name;\r
-\r
- function isMediaImg(node) {\r
- return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');\r
- };\r
-\r
- self.editor = ed;\r
- self.url = url;\r
-\r
- // Parse media types into a lookup table\r
- scriptRegExp = '';\r
- for (i = 0; i < mediaTypes.length; i++) {\r
- name = mediaTypes[i][0];\r
-\r
- item = {\r
- name : name,\r
- clsids : tinymce.explode(mediaTypes[i][1] || ''),\r
- mimes : tinymce.explode(mediaTypes[i][2] || ''),\r
- codebase : mediaTypes[i][3]\r
- };\r
-\r
- for (y = 0; y < item.clsids.length; y++)\r
- lookup['clsid:' + item.clsids[y]] = item;\r
-\r
- for (y = 0; y < item.mimes.length; y++)\r
- lookup[item.mimes[y]] = item;\r
-\r
- lookup['mceItem' + name] = item;\r
- lookup[name.toLowerCase()] = item;\r
-\r
- scriptRegExp += (scriptRegExp ? '|' : '') + name;\r
- }\r
-\r
- // Handle the media_types setting\r
- tinymce.each(ed.getParam("media_types",\r
- "video=mp4,m4v,ogv,webm;" +\r
- "silverlight=xap;" +\r
- "flash=swf,flv;" +\r
- "shockwave=dcr;" +\r
- "quicktime=mov,qt,mpg,mpeg;" +\r
- "shockwave=dcr;" +\r
- "windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" +\r
- "realmedia=rm,ra,ram;" +\r
- "java=jar;" +\r
- "audio=mp3,ogg"\r
- ).split(';'), function(item) {\r
- var i, extensions, type;\r
-\r
- item = item.split(/=/);\r
- extensions = tinymce.explode(item[1].toLowerCase());\r
- for (i = 0; i < extensions.length; i++) {\r
- type = lookup[item[0].toLowerCase()];\r
-\r
- if (type)\r
- lookup[extensions[i]] = type;\r
- }\r
- });\r
-\r
- scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)');\r
- self.lookup = lookup;\r
-\r
- ed.onPreInit.add(function() {\r
- // Allow video elements\r
- ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]');\r
-\r
- // Convert video elements to image placeholder\r
- ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {\r
- var i = nodes.length;\r
-\r
- while (i--)\r
- self.objectToImg(nodes[i]);\r
- });\r
-\r
- // Convert image placeholders to video elements\r
- ed.serializer.addNodeFilter('img', function(nodes, name, args) {\r
- var i = nodes.length, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1)\r
- self.imgToObject(node, args);\r
- }\r
- });\r
- });\r
-\r
- ed.onInit.add(function() {\r
- // Display "media" instead of "img" in element path\r
- if (ed.theme && ed.theme.onResolveName) {\r
- ed.theme.onResolveName.add(function(theme, path_object) {\r
- if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia'))\r
- path_object.name = 'media';\r
- });\r
- }\r
-\r
- // Add contect menu if it's loaded\r
- if (ed && ed.plugins.contextmenu) {\r
- ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {\r
- if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1)\r
- menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});\r
- });\r
- }\r
- });\r
-\r
- // Register commands\r
- ed.addCommand('mceMedia', function() {\r
- var data, img;\r
-\r
- img = ed.selection.getNode();\r
- if (isMediaImg(img)) {\r
- data = ed.dom.getAttrib(img, 'data-mce-json');\r
- if (data) {\r
- data = JSON.parse(data);\r
-\r
- // Add some extra properties to the data object\r
- tinymce.each(rootAttributes, function(name) {\r
- var value = ed.dom.getAttrib(img, name);\r
-\r
- if (value)\r
- data[name] = value;\r
- });\r
-\r
- data.type = self.getType(img.className).name.toLowerCase();\r
- }\r
- }\r
-\r
- if (!data) {\r
- data = {\r
- type : 'flash',\r
- video: {sources:[]},\r
- params: {}\r
- };\r
- }\r
-\r
- ed.windowManager.open({\r
- file : url + '/media.htm',\r
- width : 430 + parseInt(ed.getLang('media.delta_width', 0)),\r
- height : 500 + parseInt(ed.getLang('media.delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url,\r
- data : data\r
- });\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});\r
-\r
- // Update media selection status\r
- ed.onNodeChange.add(function(ed, cm, node) {\r
- cm.setActive('media', isMediaImg(node));\r
- });\r
- },\r
-\r
- convertUrl : function(url, force_absolute) {\r
- var self = this, editor = self.editor, settings = editor.settings,\r
- urlConverter = settings.url_converter,\r
- urlConverterScope = settings.url_converter_scope || self;\r
-\r
- if (!url)\r
- return url;\r
-\r
- if (force_absolute)\r
- return editor.documentBaseURI.toAbsolute(url);\r
-\r
- return urlConverter.call(urlConverterScope, url, 'src', 'object');\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Media',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- /**\r
- * Converts the JSON data object to an img node.\r
- */\r
- dataToImg : function(data, force_absolute) {\r
- var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;\r
-\r
- data.params.src = self.convertUrl(data.params.src, force_absolute);\r
-\r
- attrs = data.video.attrs;\r
- if (attrs)\r
- attrs.src = self.convertUrl(attrs.src, force_absolute);\r
-\r
- if (attrs)\r
- attrs.poster = self.convertUrl(attrs.poster, force_absolute);\r
-\r
- sources = toArray(data.video.sources);\r
- if (sources) {\r
- for (i = 0; i < sources.length; i++)\r
- sources[i].src = self.convertUrl(sources[i].src, force_absolute);\r
- }\r
-\r
- img = self.editor.dom.create('img', {\r
- id : data.id,\r
- style : data.style,\r
- align : data.align,\r
- hspace : data.hspace,\r
- vspace : data.vspace,\r
- src : self.editor.theme.url + '/img/trans.gif',\r
- 'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,\r
- 'data-mce-json' : JSON.serialize(data, "'")\r
- });\r
-\r
- img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320"));\r
- img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240"));\r
-\r
- return img;\r
- },\r
-\r
- /**\r
- * Converts the JSON data object to a HTML string.\r
- */\r
- dataToHtml : function(data, force_absolute) {\r
- return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute});\r
- },\r
-\r
- /**\r
- * Converts the JSON data object to a HTML string.\r
- */\r
- htmlToData : function(html) {\r
- var fragment, img, data;\r
-\r
- data = {\r
- type : 'flash',\r
- video: {sources:[]},\r
- params: {}\r
- };\r
-\r
- fragment = this.editor.parser.parse(html);\r
- img = fragment.getAll('img')[0];\r
-\r
- if (img) {\r
- data = JSON.parse(img.attr('data-mce-json'));\r
- data.type = this.getType(img.attr('class')).name.toLowerCase();\r
-\r
- // Add some extra properties to the data object\r
- tinymce.each(rootAttributes, function(name) {\r
- var value = img.attr(name);\r
-\r
- if (value)\r
- data[name] = value;\r
- });\r
- }\r
-\r
- return data;\r
- },\r
-\r
- /**\r
- * Get type item by extension, class, clsid or mime type.\r
- *\r
- * @method getType\r
- * @param {String} value Value to get type item by.\r
- * @return {Object} Type item object or undefined.\r
- */\r
- getType : function(value) {\r
- var i, values, typeItem;\r
-\r
- // Find type by checking the classes\r
- values = tinymce.explode(value, ' ');\r
- for (i = 0; i < values.length; i++) {\r
- typeItem = this.lookup[values[i]];\r
-\r
- if (typeItem)\r
- return typeItem;\r
- }\r
- },\r
-\r
- /**\r
- * Converts a tinymce.html.Node image element to video/object/embed.\r
- */\r
- imgToObject : function(node, args) {\r
- var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,\r
- source, sources, params, param, typeItem, i, item, mp4Source, replacement,\r
- posterSrc, style, audio;\r
-\r
- // Adds the flash player\r
- function addPlayer(video_src, poster_src) {\r
- var baseUri, flashVars, flashVarsOutput, params, flashPlayer;\r
-\r
- flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));\r
- if (flashPlayer) {\r
- baseUri = editor.documentBaseURI;\r
- data.params.src = flashPlayer;\r
-\r
- // Convert the movie url to absolute urls\r
- if (editor.getParam('flash_video_player_absvideourl', true)) {\r
- video_src = baseUri.toAbsolute(video_src || '', true);\r
- poster_src = baseUri.toAbsolute(poster_src || '', true);\r
- }\r
-\r
- // Generate flash vars\r
- flashVarsOutput = '';\r
- flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'});\r
- tinymce.each(flashVars, function(value, name) {\r
- // Replace $url and $poster variables in flashvars value\r
- value = value.replace(/\$url/, video_src || '');\r
- value = value.replace(/\$poster/, poster_src || '');\r
-\r
- if (value.length > 0)\r
- flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);\r
- });\r
-\r
- if (flashVarsOutput.length)\r
- data.params.flashvars = flashVarsOutput;\r
-\r
- params = editor.getParam('flash_video_player_params', {\r
- allowfullscreen: true,\r
- allowscriptaccess: true\r
- });\r
-\r
- tinymce.each(params, function(value, name) {\r
- data.params[name] = "" + value;\r
- });\r
- }\r
- };\r
-\r
- data = node.attr('data-mce-json');\r
- if (!data)\r
- return;\r
-\r
- data = JSON.parse(data);\r
- typeItem = this.getType(node.attr('class'));\r
-\r
- style = node.attr('data-mce-style');\r
- if (!style) {\r
- style = node.attr('style');\r
-\r
- if (style)\r
- style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));\r
- }\r
-\r
- // Use node width/height to override the data width/height when the placeholder is resized\r
- data.width = node.attr('width') || data.width;\r
- data.height = node.attr('height') || data.height;\r
-\r
- // Handle iframe\r
- if (typeItem.name === 'Iframe') {\r
- replacement = new Node('iframe', 1);\r
-\r
- tinymce.each(rootAttributes, function(name) {\r
- var value = node.attr(name);\r
-\r
- if (name == 'class' && value)\r
- value = value.replace(/mceItem.+ ?/g, '');\r
-\r
- if (value && value.length > 0)\r
- replacement.attr(name, value);\r
- });\r
-\r
- for (name in data.params)\r
- replacement.attr(name, data.params[name]);\r
-\r
- replacement.attr({\r
- style: style,\r
- src: data.params.src\r
- });\r
-\r
- node.replace(replacement);\r
-\r
- return;\r
- }\r
-\r
- // Handle scripts\r
- if (this.editor.settings.media_use_script) {\r
- replacement = new Node('script', 1).attr('type', 'text/javascript');\r
-\r
- value = new Node('#text', 3);\r
- value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, {\r
- width: node.attr('width'),\r
- height: node.attr('height')\r
- })) + ');';\r
-\r
- replacement.append(value);\r
- node.replace(replacement);\r
-\r
- return;\r
- }\r
-\r
- // Add HTML5 video element\r
- if (typeItem.name === 'Video' && data.video.sources[0]) {\r
- // Create new object element\r
- video = new Node('video', 1).attr(tinymce.extend({\r
- id : node.attr('id'),\r
- width: normalizeSize(node.attr('width')),\r
- height: normalizeSize(node.attr('height')),\r
- style : style\r
- }, data.video.attrs));\r
-\r
- // Get poster source and use that for flash fallback\r
- if (data.video.attrs)\r
- posterSrc = data.video.attrs.poster;\r
-\r
- sources = data.video.sources = toArray(data.video.sources);\r
- for (i = 0; i < sources.length; i++) {\r
- if (/\.mp4$/.test(sources[i].src))\r
- mp4Source = sources[i].src;\r
- }\r
-\r
- if (!sources[0].type) {\r
- video.attr('src', sources[0].src);\r
- sources.splice(0, 1);\r
- }\r
-\r
- for (i = 0; i < sources.length; i++) {\r
- source = new Node('source', 1).attr(sources[i]);\r
- source.shortEnded = true;\r
- video.append(source);\r
- }\r
-\r
- // Create flash fallback for video if we have a mp4 source\r
- if (mp4Source) {\r
- addPlayer(mp4Source, posterSrc);\r
- typeItem = self.getType('flash');\r
- } else\r
- data.params.src = '';\r
- }\r
-\r
- // Add HTML5 audio element\r
- if (typeItem.name === 'Audio' && data.video.sources[0]) {\r
- // Create new object element\r
- audio = new Node('audio', 1).attr(tinymce.extend({\r
- id : node.attr('id'),\r
- width: normalizeSize(node.attr('width')),\r
- height: normalizeSize(node.attr('height')),\r
- style : style\r
- }, data.video.attrs));\r
-\r
- // Get poster source and use that for flash fallback\r
- if (data.video.attrs)\r
- posterSrc = data.video.attrs.poster;\r
-\r
- sources = data.video.sources = toArray(data.video.sources);\r
- if (!sources[0].type) {\r
- audio.attr('src', sources[0].src);\r
- sources.splice(0, 1);\r
- }\r
-\r
- for (i = 0; i < sources.length; i++) {\r
- source = new Node('source', 1).attr(sources[i]);\r
- source.shortEnded = true;\r
- audio.append(source);\r
- }\r
-\r
- data.params.src = '';\r
- }\r
-\r
- if (typeItem.name === 'EmbeddedAudio') {\r
- embed = new Node('embed', 1);\r
- embed.shortEnded = true;\r
- embed.attr({\r
- id: node.attr('id'),\r
- width: normalizeSize(node.attr('width')),\r
- height: normalizeSize(node.attr('height')),\r
- style : style,\r
- type: node.attr('type')\r
- });\r
-\r
- for (name in data.params)\r
- embed.attr(name, data.params[name]);\r
-\r
- tinymce.each(rootAttributes, function(name) {\r
- if (data[name] && name != 'type')\r
- embed.attr(name, data[name]);\r
- });\r
-\r
- data.params.src = '';\r
- }\r
-\r
- // Do we have a params src then we can generate object\r
- if (data.params.src) {\r
- // Is flv movie add player for it\r
- if (/\.flv$/i.test(data.params.src))\r
- addPlayer(data.params.src, '');\r
-\r
- if (args && args.force_absolute)\r
- data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);\r
-\r
- // Create new object element\r
- object = new Node('object', 1).attr({\r
- id : node.attr('id'),\r
- width: normalizeSize(node.attr('width')),\r
- height: normalizeSize(node.attr('height')),\r
- style : style\r
- });\r
-\r
- tinymce.each(rootAttributes, function(name) {\r
- var value = data[name];\r
-\r
- if (name == 'class' && value)\r
- value = value.replace(/mceItem.+ ?/g, '');\r
-\r
- if (value && name != 'type')\r
- object.attr(name, value);\r
- });\r
-\r
- // Add params\r
- for (name in data.params) {\r
- param = new Node('param', 1);\r
- param.shortEnded = true;\r
- value = data.params[name];\r
-\r
- // Windows media needs to use url instead of src for the media URL\r
- if (name === 'src' && typeItem.name === 'WindowsMedia')\r
- name = 'url';\r
-\r
- param.attr({name: name, value: value});\r
- object.append(param);\r
- }\r
-\r
- // Setup add type and classid if strict is disabled\r
- if (this.editor.getParam('media_strict', true)) {\r
- object.attr({\r
- data: data.params.src,\r
- type: typeItem.mimes[0]\r
- });\r
- } else {\r
- object.attr({\r
- classid: "clsid:" + typeItem.clsids[0],\r
- codebase: typeItem.codebase\r
- });\r
-\r
- embed = new Node('embed', 1);\r
- embed.shortEnded = true;\r
- embed.attr({\r
- id: node.attr('id'),\r
- width: normalizeSize(node.attr('width')),\r
- height: normalizeSize(node.attr('height')),\r
- style : style,\r
- type: typeItem.mimes[0]\r
- });\r
-\r
- for (name in data.params)\r
- embed.attr(name, data.params[name]);\r
-\r
- tinymce.each(rootAttributes, function(name) {\r
- if (data[name] && name != 'type')\r
- embed.attr(name, data[name]);\r
- });\r
-\r
- object.append(embed);\r
- }\r
-\r
- // Insert raw HTML\r
- if (data.object_html) {\r
- value = new Node('#text', 3);\r
- value.raw = true;\r
- value.value = data.object_html;\r
- object.append(value);\r
- }\r
-\r
- // Append object to video element if it exists\r
- if (video)\r
- video.append(object);\r
- }\r
-\r
- if (video) {\r
- // Insert raw HTML\r
- if (data.video_html) {\r
- value = new Node('#text', 3);\r
- value.raw = true;\r
- value.value = data.video_html;\r
- video.append(value);\r
- }\r
- }\r
-\r
- if (audio) {\r
- // Insert raw HTML\r
- if (data.video_html) {\r
- value = new Node('#text', 3);\r
- value.raw = true;\r
- value.value = data.video_html;\r
- audio.append(value);\r
- }\r
- }\r
-\r
- var n = video || audio || object || embed;\r
- if (n)\r
- node.replace(n);\r
- else\r
- node.remove();\r
- },\r
-\r
- /**\r
- * Converts a tinymce.html.Node video/object/embed to an img element.\r
- *\r
- * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this:\r
- * <img class="mceItemMedia mceItemFlash" width="100" height="100" data-mce-json="{..}" />\r
- *\r
- * The JSON structure will be like this:\r
- * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}}\r
- */\r
- objectToImg : function(node) {\r
- var object, embed, video, iframe, img, name, id, width, height, style, i, html,\r
- param, params, source, sources, data, type, lookup = this.lookup,\r
- matches, attrs, urlConverter = this.editor.settings.url_converter,\r
- urlConverterScope = this.editor.settings.url_converter_scope,\r
- hspace, vspace, align, bgcolor;\r
-\r
- function getInnerHTML(node) {\r
- return new tinymce.html.Serializer({\r
- inner: true,\r
- validate: false\r
- }).serialize(node);\r
- };\r
-\r
- function lookupAttribute(o, attr) {\r
- return lookup[(o.attr(attr) || '').toLowerCase()];\r
- }\r
-\r
- function lookupExtension(src) {\r
- var ext = src.replace(/^.*\.([^.]+)$/, '$1');\r
- return lookup[ext.toLowerCase() || ''];\r
- }\r
-\r
- // If node isn't in document\r
- if (!node.parent)\r
- return;\r
-\r
- // Handle media scripts\r
- if (node.name === 'script') {\r
- if (node.firstChild)\r
- matches = scriptRegExp.exec(node.firstChild.value);\r
-\r
- if (!matches)\r
- return;\r
-\r
- type = matches[1];\r
- data = {video : {}, params : JSON.parse(matches[2])};\r
- width = data.params.width;\r
- height = data.params.height;\r
- }\r
-\r
- // Setup data objects\r
- data = data || {\r
- video : {},\r
- params : {}\r
- };\r
-\r
- // Setup new image object\r
- img = new Node('img', 1);\r
- img.attr({\r
- src : this.editor.theme.url + '/img/trans.gif'\r
- });\r
-\r
- // Video element\r
- name = node.name;\r
- if (name === 'video' || name == 'audio') {\r
- video = node;\r
- object = node.getAll('object')[0];\r
- embed = node.getAll('embed')[0];\r
- width = video.attr('width');\r
- height = video.attr('height');\r
- id = video.attr('id');\r
- data.video = {attrs : {}, sources : []};\r
-\r
- // Get all video attributes\r
- attrs = data.video.attrs;\r
- for (name in video.attributes.map)\r
- attrs[name] = video.attributes.map[name];\r
-\r
- source = node.attr('src');\r
- if (source)\r
- data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)});\r
-\r
- // Get all sources\r
- sources = video.getAll("source");\r
- for (i = 0; i < sources.length; i++) {\r
- source = sources[i].remove();\r
-\r
- data.video.sources.push({\r
- src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'),\r
- type: source.attr('type'),\r
- media: source.attr('media')\r
- });\r
- }\r
-\r
- // Convert the poster URL\r
- if (attrs.poster)\r
- attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name);\r
- }\r
-\r
- // Object element\r
- if (node.name === 'object') {\r
- object = node;\r
- embed = node.getAll('embed')[0];\r
- }\r
-\r
- // Embed element\r
- if (node.name === 'embed')\r
- embed = node;\r
-\r
- // Iframe element\r
- if (node.name === 'iframe') {\r
- iframe = node;\r
- type = 'Iframe';\r
- }\r
-\r
- if (object) {\r
- // Get width/height\r
- width = width || object.attr('width');\r
- height = height || object.attr('height');\r
- style = style || object.attr('style');\r
- id = id || object.attr('id');\r
- hspace = hspace || object.attr('hspace');\r
- vspace = vspace || object.attr('vspace');\r
- align = align || object.attr('align');\r
- bgcolor = bgcolor || object.attr('bgcolor');\r
- data.name = object.attr('name');\r
-\r
- // Get all object params\r
- params = object.getAll("param");\r
- for (i = 0; i < params.length; i++) {\r
- param = params[i];\r
- name = param.remove().attr('name');\r
-\r
- if (!excludedAttrs[name])\r
- data.params[name] = param.attr('value');\r
- }\r
-\r
- data.params.src = data.params.src || object.attr('data');\r
- }\r
-\r
- if (embed) {\r
- // Get width/height\r
- width = width || embed.attr('width');\r
- height = height || embed.attr('height');\r
- style = style || embed.attr('style');\r
- id = id || embed.attr('id');\r
- hspace = hspace || embed.attr('hspace');\r
- vspace = vspace || embed.attr('vspace');\r
- align = align || embed.attr('align');\r
- bgcolor = bgcolor || embed.attr('bgcolor');\r
-\r
- // Get all embed attributes\r
- for (name in embed.attributes.map) {\r
- if (!excludedAttrs[name] && !data.params[name])\r
- data.params[name] = embed.attributes.map[name];\r
- }\r
- }\r
-\r
- if (iframe) {\r
- // Get width/height\r
- width = normalizeSize(iframe.attr('width'));\r
- height = normalizeSize(iframe.attr('height'));\r
- style = style || iframe.attr('style');\r
- id = iframe.attr('id');\r
- hspace = iframe.attr('hspace');\r
- vspace = iframe.attr('vspace');\r
- align = iframe.attr('align');\r
- bgcolor = iframe.attr('bgcolor');\r
-\r
- tinymce.each(rootAttributes, function(name) {\r
- img.attr(name, iframe.attr(name));\r
- });\r
-\r
- // Get all iframe attributes\r
- for (name in iframe.attributes.map) {\r
- if (!excludedAttrs[name] && !data.params[name])\r
- data.params[name] = iframe.attributes.map[name];\r
- }\r
- }\r
-\r
- // Use src not movie\r
- if (data.params.movie) {\r
- data.params.src = data.params.src || data.params.movie;\r
- delete data.params.movie;\r
- }\r
-\r
- // Convert the URL to relative/absolute depending on configuration\r
- if (data.params.src)\r
- data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');\r
-\r
- if (video) {\r
- if (node.name === 'video')\r
- type = lookup.video.name;\r
- else if (node.name === 'audio')\r
- type = lookup.audio.name;\r
- }\r
-\r
- if (object && !type)\r
- type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name;\r
-\r
- if (embed && !type)\r
- type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name;\r
-\r
- // for embedded audio we preserve the original specified type\r
- if (embed && type == 'EmbeddedAudio') {\r
- data.params.type = embed.attr('type');\r
- }\r
-\r
- // Replace the video/object/embed element with a placeholder image containing the data\r
- node.replace(img);\r
-\r
- // Remove embed\r
- if (embed)\r
- embed.remove();\r
-\r
- // Serialize the inner HTML of the object element\r
- if (object) {\r
- html = getInnerHTML(object.remove());\r
-\r
- if (html)\r
- data.object_html = html;\r
- }\r
-\r
- // Serialize the inner HTML of the video element\r
- if (video) {\r
- html = getInnerHTML(video.remove());\r
-\r
- if (html)\r
- data.video_html = html;\r
- }\r
-\r
- data.hspace = hspace;\r
- data.vspace = vspace;\r
- data.align = align;\r
- data.bgcolor = bgcolor;\r
-\r
- // Set width/height of placeholder\r
- img.attr({\r
- id : id,\r
- 'class' : 'mceItemMedia mceItem' + (type || 'Flash'),\r
- style : style,\r
- width : width || (node.name == 'audio' ? "300" : "320"),\r
- height : height || (node.name == 'audio' ? "32" : "240"),\r
- hspace : hspace,\r
- vspace : vspace,\r
- align : align,\r
- bgcolor : bgcolor,\r
- "data-mce-json" : JSON.serialize(data, "'")\r
- });\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);\r
-})();\r
+++ /dev/null
-/**\r
- * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.\r
- */\r
-\r
-function writeFlash(p) {\r
- writeEmbed(\r
- 'D27CDB6E-AE6D-11cf-96B8-444553540000',\r
- 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
- 'application/x-shockwave-flash',\r
- p\r
- );\r
-}\r
-\r
-function writeShockWave(p) {\r
- writeEmbed(\r
- '166B1BCA-3F9C-11CF-8075-444553540000',\r
- 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',\r
- 'application/x-director',\r
- p\r
- );\r
-}\r
-\r
-function writeQuickTime(p) {\r
- writeEmbed(\r
- '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',\r
- 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',\r
- 'video/quicktime',\r
- p\r
- );\r
-}\r
-\r
-function writeRealMedia(p) {\r
- writeEmbed(\r
- 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',\r
- 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
- 'audio/x-pn-realaudio-plugin',\r
- p\r
- );\r
-}\r
-\r
-function writeWindowsMedia(p) {\r
- p.url = p.src;\r
- writeEmbed(\r
- '6BF52A52-394A-11D3-B153-00C04F79FAA6',\r
- 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',\r
- 'application/x-mplayer2',\r
- p\r
- );\r
-}\r
-\r
-function writeEmbed(cls, cb, mt, p) {\r
- var h = '', n;\r
-\r
- h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';\r
- h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';\r
- h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';\r
- h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';\r
- h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';\r
- h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';\r
- h += '>';\r
-\r
- for (n in p)\r
- h += '<param name="' + n + '" value="' + p[n] + '">';\r
-\r
- h += '<embed type="' + mt + '"';\r
-\r
- for (n in p)\r
- h += n + '="' + p[n] + '" ';\r
-\r
- h += '></embed></object>';\r
-\r
- document.write(h);\r
-}\r
+++ /dev/null
-(function() {\r
- var url;\r
-\r
- if (url = tinyMCEPopup.getParam("media_external_list_url"))\r
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
-\r
- function get(id) {\r
- return document.getElementById(id);\r
- }\r
-\r
- function clone(obj) {\r
- var i, len, copy, attr;\r
-\r
- if (null == obj || "object" != typeof obj)\r
- return obj;\r
-\r
- // Handle Array\r
- if ('length' in obj) {\r
- copy = [];\r
-\r
- for (i = 0, len = obj.length; i < len; ++i) {\r
- copy[i] = clone(obj[i]);\r
- }\r
-\r
- return copy;\r
- }\r
-\r
- // Handle Object\r
- copy = {};\r
- for (attr in obj) {\r
- if (obj.hasOwnProperty(attr))\r
- copy[attr] = clone(obj[attr]);\r
- }\r
-\r
- return copy;\r
- }\r
-\r
- function getVal(id) {\r
- var elm = get(id);\r
-\r
- if (elm.nodeName == "SELECT")\r
- return elm.options[elm.selectedIndex].value;\r
-\r
- if (elm.type == "checkbox")\r
- return elm.checked;\r
-\r
- return elm.value;\r
- }\r
-\r
- function setVal(id, value, name) {\r
- if (typeof(value) != 'undefined' && value != null) {\r
- var elm = get(id);\r
-\r
- if (elm.nodeName == "SELECT")\r
- selectByValue(document.forms[0], id, value);\r
- else if (elm.type == "checkbox") {\r
- if (typeof(value) == 'string') {\r
- value = value.toLowerCase();\r
- value = (!name && value === 'true') || (name && value === name.toLowerCase());\r
- }\r
- elm.checked = !!value;\r
- } else\r
- elm.value = value;\r
- }\r
- }\r
-\r
- window.Media = {\r
- init : function() {\r
- var html, editor, self = this;\r
-\r
- self.editor = editor = tinyMCEPopup.editor;\r
-\r
- // Setup file browsers and color pickers\r
- get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');\r
- get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media');\r
- get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
- get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media');\r
- get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media');\r
- get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media');\r
- get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media');\r
- get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media');\r
-\r
- html = self.getMediaListHTML('medialist', 'src', 'media', 'media');\r
- if (html == "")\r
- get("linklistrow").style.display = 'none';\r
- else\r
- get("linklistcontainer").innerHTML = html;\r
-\r
- if (isVisible('filebrowser'))\r
- get('src').style.width = '230px';\r
-\r
- if (isVisible('video_filebrowser_altsource1'))\r
- get('video_altsource1').style.width = '220px';\r
-\r
- if (isVisible('video_filebrowser_altsource2'))\r
- get('video_altsource2').style.width = '220px';\r
-\r
- if (isVisible('audio_filebrowser_altsource1'))\r
- get('audio_altsource1').style.width = '220px';\r
-\r
- if (isVisible('audio_filebrowser_altsource2'))\r
- get('audio_altsource2').style.width = '220px';\r
-\r
- if (isVisible('filebrowser_poster'))\r
- get('video_poster').style.width = '220px';\r
-\r
- editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor));\r
-\r
- self.setDefaultDialogSettings(editor);\r
- self.data = clone(tinyMCEPopup.getWindowArg('data'));\r
- self.dataToForm();\r
- self.preview();\r
-\r
- updateColor('bgcolor_pick', 'bgcolor');\r
- },\r
-\r
- insert : function() {\r
- var editor = tinyMCEPopup.editor;\r
-\r
- this.formToData();\r
- editor.execCommand('mceRepaint');\r
- tinyMCEPopup.restoreSelection();\r
- editor.selection.setNode(editor.plugins.media.dataToImg(this.data));\r
- tinyMCEPopup.close();\r
- },\r
-\r
- preview : function() {\r
- get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true);\r
- },\r
-\r
- moveStates : function(to_form, field) {\r
- var data = this.data, editor = this.editor,\r
- mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src;\r
-\r
- defaultStates = {\r
- // QuickTime\r
- quicktime_autoplay : true,\r
- quicktime_controller : true,\r
-\r
- // Flash\r
- flash_play : true,\r
- flash_loop : true,\r
- flash_menu : true,\r
-\r
- // WindowsMedia\r
- windowsmedia_autostart : true,\r
- windowsmedia_enablecontextmenu : true,\r
- windowsmedia_invokeurls : true,\r
-\r
- // RealMedia\r
- realmedia_autogotourl : true,\r
- realmedia_imagestatus : true\r
- };\r
-\r
- function parseQueryParams(str) {\r
- var out = {};\r
-\r
- if (str) {\r
- tinymce.each(str.split('&'), function(item) {\r
- var parts = item.split('=');\r
-\r
- out[unescape(parts[0])] = unescape(parts[1]);\r
- });\r
- }\r
-\r
- return out;\r
- };\r
-\r
- function setOptions(type, names) {\r
- var i, name, formItemName, value, list;\r
-\r
- if (type == data.type || type == 'global') {\r
- names = tinymce.explode(names);\r
- for (i = 0; i < names.length; i++) {\r
- name = names[i];\r
- formItemName = type == 'global' ? name : type + '_' + name;\r
-\r
- if (type == 'global')\r
- list = data;\r
- else if (type == 'video' || type == 'audio') {\r
- list = data.video.attrs;\r
-\r
- if (!list && !to_form)\r
- data.video.attrs = list = {};\r
- } else\r
- list = data.params;\r
-\r
- if (list) {\r
- if (to_form) {\r
- setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : '');\r
- } else {\r
- delete list[name];\r
-\r
- value = getVal(formItemName);\r
- if ((type == 'video' || type == 'audio') && value === true)\r
- value = name;\r
-\r
- if (defaultStates[formItemName]) {\r
- if (value !== defaultStates[formItemName]) {\r
- value = "" + value;\r
- list[name] = value;\r
- }\r
- } else if (value) {\r
- value = "" + value;\r
- list[name] = value;\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
-\r
- if (!to_form) {\r
- data.type = get('media_type').options[get('media_type').selectedIndex].value;\r
- data.width = getVal('width');\r
- data.height = getVal('height');\r
-\r
- // Switch type based on extension\r
- src = getVal('src');\r
- if (field == 'src') {\r
- ext = src.replace(/^.*\.([^.]+)$/, '$1');\r
- if (typeInfo = mediaPlugin.getType(ext))\r
- data.type = typeInfo.name.toLowerCase();\r
-\r
- setVal('media_type', data.type);\r
- }\r
-\r
- if (data.type == "video" || data.type == "audio") {\r
- if (!data.video.sources)\r
- data.video.sources = [];\r
-\r
- data.video.sources[0] = {src: getVal('src')};\r
- }\r
- }\r
-\r
- // Hide all fieldsets and show the one active\r
- get('video_options').style.display = 'none';\r
- get('audio_options').style.display = 'none';\r
- get('flash_options').style.display = 'none';\r
- get('quicktime_options').style.display = 'none';\r
- get('shockwave_options').style.display = 'none';\r
- get('windowsmedia_options').style.display = 'none';\r
- get('realmedia_options').style.display = 'none';\r
- get('embeddedaudio_options').style.display = 'none';\r
-\r
- if (get(data.type + '_options'))\r
- get(data.type + '_options').style.display = 'block';\r
-\r
- setVal('media_type', data.type);\r
-\r
- setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars');\r
- setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc');\r
- setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign');\r
- setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume');\r
- setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks');\r
- setOptions('video', 'poster,autoplay,loop,muted,preload,controls');\r
- setOptions('audio', 'autoplay,loop,preload,controls');\r
- setOptions('embeddedaudio', 'autoplay,loop,controls');\r
- setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height');\r
-\r
- if (to_form) {\r
- if (data.type == 'video') {\r
- if (data.video.sources[0])\r
- setVal('src', data.video.sources[0].src);\r
-\r
- src = data.video.sources[1];\r
- if (src)\r
- setVal('video_altsource1', src.src);\r
-\r
- src = data.video.sources[2];\r
- if (src)\r
- setVal('video_altsource2', src.src);\r
- } else if (data.type == 'audio') {\r
- if (data.video.sources[0])\r
- setVal('src', data.video.sources[0].src);\r
- \r
- src = data.video.sources[1];\r
- if (src)\r
- setVal('audio_altsource1', src.src);\r
- \r
- src = data.video.sources[2];\r
- if (src)\r
- setVal('audio_altsource2', src.src);\r
- } else {\r
- // Check flash vars\r
- if (data.type == 'flash') {\r
- tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) {\r
- if (value == '$url')\r
- data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || '';\r
- });\r
- }\r
-\r
- setVal('src', data.params.src);\r
- }\r
- } else {\r
- src = getVal("src");\r
-\r
- // YouTube Embed\r
- if (src.match(/youtube\.com\/embed\/\w+/)) {\r
- data.width = 425;\r
- data.height = 350;\r
- data.params.frameborder = '0';\r
- data.type = 'iframe';\r
- setVal('src', src);\r
- setVal('media_type', data.type);\r
- } else {\r
- // YouTube *NEW*\r
- if (src.match(/youtu\.be\/[a-z1-9.-_]+/)) {\r
- data.width = 425;\r
- data.height = 350;\r
- data.params.frameborder = '0';\r
- data.type = 'iframe';\r
- src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];\r
- setVal('src', src);\r
- setVal('media_type', data.type);\r
- }\r
-\r
- // YouTube\r
- if (src.match(/youtube\.com(.+)v=([^&]+)/)) {\r
- data.width = 425;\r
- data.height = 350;\r
- data.params.frameborder = '0';\r
- data.type = 'iframe';\r
- src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];\r
- setVal('src', src);\r
- setVal('media_type', data.type);\r
- }\r
- }\r
-\r
- // Google video\r
- if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) {\r
- data.width = 425;\r
- data.height = 326;\r
- data.type = 'flash';\r
- src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en';\r
- setVal('src', src);\r
- setVal('media_type', data.type);\r
- }\r
- \r
- // Vimeo\r
- if (src.match(/vimeo\.com\/([0-9]+)/)) {\r
- data.width = 425;\r
- data.height = 350;\r
- data.params.frameborder = '0';\r
- data.type = 'iframe';\r
- src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1];\r
- setVal('src', src);\r
- setVal('media_type', data.type);\r
- }\r
- \r
- // stream.cz\r
- if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) {\r
- data.width = 425;\r
- data.height = 350;\r
- data.params.frameborder = '0';\r
- data.type = 'iframe';\r
- src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1];\r
- setVal('src', src);\r
- setVal('media_type', data.type);\r
- }\r
- \r
- // Google maps\r
- if (src.match(/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {\r
- data.width = 425;\r
- data.height = 350;\r
- data.params.frameborder = '0';\r
- data.type = 'iframe';\r
- src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed";\r
- setVal('src', src);\r
- setVal('media_type', data.type);\r
- }\r
-\r
- if (data.type == 'video') {\r
- if (!data.video.sources)\r
- data.video.sources = [];\r
-\r
- data.video.sources[0] = {src : src};\r
-\r
- src = getVal("video_altsource1");\r
- if (src)\r
- data.video.sources[1] = {src : src};\r
-\r
- src = getVal("video_altsource2");\r
- if (src)\r
- data.video.sources[2] = {src : src};\r
- } else if (data.type == 'audio') {\r
- if (!data.video.sources)\r
- data.video.sources = [];\r
- \r
- data.video.sources[0] = {src : src};\r
- \r
- src = getVal("audio_altsource1");\r
- if (src)\r
- data.video.sources[1] = {src : src};\r
- \r
- src = getVal("audio_altsource2");\r
- if (src)\r
- data.video.sources[2] = {src : src};\r
- } else\r
- data.params.src = src;\r
-\r
- // Set default size\r
- setVal('width', data.width || (data.type == 'audio' ? 300 : 320));\r
- setVal('height', data.height || (data.type == 'audio' ? 32 : 240));\r
- }\r
- },\r
-\r
- dataToForm : function() {\r
- this.moveStates(true);\r
- },\r
-\r
- formToData : function(field) {\r
- if (field == "width" || field == "height")\r
- this.changeSize(field);\r
-\r
- if (field == 'source') {\r
- this.moveStates(false, field);\r
- setVal('source', this.editor.plugins.media.dataToHtml(this.data));\r
- this.panel = 'source';\r
- } else {\r
- if (this.panel == 'source') {\r
- this.data = clone(this.editor.plugins.media.htmlToData(getVal('source')));\r
- this.dataToForm();\r
- this.panel = '';\r
- }\r
-\r
- this.moveStates(false, field);\r
- this.preview();\r
- }\r
- },\r
-\r
- beforeResize : function() {\r
- this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);\r
- this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);\r
- },\r
-\r
- changeSize : function(type) {\r
- var width, height, scale, size;\r
-\r
- if (get('constrain').checked) {\r
- width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);\r
- height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);\r
-\r
- if (type == 'width') {\r
- this.height = Math.round((width / this.width) * height);\r
- setVal('height', this.height);\r
- } else {\r
- this.width = Math.round((height / this.height) * width);\r
- setVal('width', this.width);\r
- }\r
- }\r
- },\r
-\r
- getMediaListHTML : function() {\r
- if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {\r
- var html = "";\r
-\r
- html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;Media.formToData(\'src\');">';\r
- html += '<option value="">---</option>';\r
-\r
- for (var i=0; i<tinyMCEMediaList.length; i++)\r
- html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';\r
-\r
- html += '</select>';\r
-\r
- return html;\r
- }\r
-\r
- return "";\r
- },\r
-\r
- getMediaTypeHTML : function(editor) {\r
- function option(media_type, element) {\r
- if (!editor.schema.getElementRule(element || media_type)) {\r
- return '';\r
- }\r
-\r
- return '<option value="'+media_type+'">'+tinyMCEPopup.editor.translate("media_dlg."+media_type)+'</option>'\r
- }\r
-\r
- var html = "";\r
-\r
- html += '<select id="media_type" name="media_type" onchange="Media.formToData(\'type\');">';\r
- html += option("video");\r
- html += option("audio");\r
- html += option("flash", "object");\r
- html += option("quicktime", "object");\r
- html += option("shockwave", "object");\r
- html += option("windowsmedia", "object");\r
- html += option("realmedia", "object");\r
- html += option("iframe");\r
-\r
- if (editor.getParam('media_embedded_audio', false)) {\r
- html += option('embeddedaudio', "object");\r
- }\r
-\r
- html += '</select>';\r
- return html;\r
- },\r
-\r
- setDefaultDialogSettings : function(editor) {\r
- var defaultDialogSettings = editor.getParam("media_dialog_defaults", {});\r
- tinymce.each(defaultDialogSettings, function(v, k) {\r
- setVal(k, v);\r
- });\r
- }\r
- };\r
-\r
- tinyMCEPopup.requireLangPack();\r
- tinyMCEPopup.onInit.add(function() {\r
- Media.init();\r
- });\r
-})();\r
+++ /dev/null
-tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" });
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#media_dlg.title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/media.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/validate.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <link href="css/media.css" rel="stylesheet" type="text/css" />\r
-</head>\r
-<body style="display: none" role="application">\r
-<form onsubmit="Media.insert();return false;" action="#">\r
- <div class="tabs" role="presentation">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.general}</a></span></li>\r
- <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>\r
- <li id="source_tab" aria-controls="source_panel"><span><a href="javascript:mcTabs.displayTab('source_tab','source_panel');Media.formToData('source');" onmousedown="return false;">{#media_dlg.source}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#media_dlg.general}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td><label for="media_type">{#media_dlg.type}</label></td>\r
- <td>\r
- <select id="media_type"></select>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td><label for="src">{#media_dlg.file}</label></td>\r
- <td>\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="Media.formToData();" /></td>\r
- <td id="filebrowsercontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- <tr id="linklistrow">\r
- <td><label for="linklist">{#media_dlg.list}</label></td>\r
- <td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td>\r
- </tr>\r
- <tr>\r
- <td><label for="width">{#media_dlg.size}</label></td>\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="text" id="width" name="width" value="" class="size" onchange="Media.formToData('width');" onfocus="Media.beforeResize();" /> x <input type="text" id="height" name="height" value="" class="size" onfocus="Media.beforeResize();" onchange="Media.formToData('height');" /></td>\r
- <td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" checked="checked" /></td>\r
- <td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset>\r
- <legend>{#media_dlg.preview}</legend>\r
- <div id="prev"></div>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="advanced_panel" class="panel">\r
- <fieldset>\r
- <legend>{#media_dlg.advanced}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">\r
- <tr>\r
- <td><label for="id">{#media_dlg.id}</label></td>\r
- <td><input type="text" id="id" name="id" onchange="Media.formToData();" /></td>\r
- <td><label for="name">{#media_dlg.name}</label></td>\r
- <td><input type="text" id="name" name="name" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="align">{#media_dlg.align}</label></td>\r
- <td>\r
- <select id="align" name="align" onchange="Media.formToData();">\r
- <option value="">{#not_set}</option> \r
- <option value="top">{#media_dlg.align_top}</option>\r
- <option value="right">{#media_dlg.align_right}</option>\r
- <option value="bottom">{#media_dlg.align_bottom}</option>\r
- <option value="left">{#media_dlg.align_left}</option>\r
- </select>\r
- </td>\r
-\r
- <td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');Media.formToData();" /></td>\r
- <td id="bgcolor_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="vspace">{#media_dlg.vspace}</label></td>\r
- <td><input type="text" id="vspace" name="vspace" class="number" onchange="Media.formToData();" /></td>\r
- <td><label for="hspace">{#media_dlg.hspace}</label></td>\r
- <td><input type="text" id="hspace" name="hspace" class="number" onchange="Media.formToData();" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset id="video_options">\r
- <legend>{#media_dlg.html5_video_options}</legend>\r
-\r
- <table role="presentation">\r
- <tr>\r
- <td><label for="video_altsource1">{#media_dlg.altsource1}</label></td>\r
- <td>\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input type="text" id="video_altsource1" name="video_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>\r
- <td id="video_altsource1_filebrowser"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="video_altsource2">{#media_dlg.altsource2}</label></td>\r
- <td>\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input type="text" id="video_altsource2" name="video_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>\r
- <td id="video_altsource2_filebrowser"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="video_poster">{#media_dlg.poster}</label></td>\r
- <td>\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input type="text" id="video_poster" name="video_poster" onchange="Media.formToData();" style="width: 240px" /></td>\r
- <td id="video_poster_filebrowser"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="video_preload">{#media_dlg.preload}</label></td>\r
- <td>\r
- <select id="video_preload" name="video_preload" onchange="Media.formToData();">\r
- <option value="none">{#media_dlg.preload_none}</option> \r
- <option value="metadata">{#media_dlg.preload_metadata}</option>\r
- <option value="auto">{#media_dlg.preload_auto}</option>\r
- </select>\r
- </td>\r
- </tr>\r
- </table>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="video_autoplay" name="video_autoplay" onchange="Media.formToData();" /></td>\r
- <td><label for="video_autoplay">{#media_dlg.play}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="video_muted" name="video_muted" onchange="Media.formToData();" /></td>\r
- <td><label for="video_muted">{#media_dlg.mute}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="video_loop" name="video_loop" onchange="Media.formToData();" /></td>\r
- <td><label for="video_loop">{#media_dlg.loop}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="video_controls" name="video_controls" onchange="Media.formToData();" /></td>\r
- <td><label for="video_controls">{#media_dlg.controls}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset id="embeddedaudio_options">\r
- <legend>{#media_dlg.embedded_audio_options}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="embeddedaudio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>\r
- <td><label for="audio_autoplay">{#media_dlg.play}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="embeddedaudio_loop" name="audio_loop" onchange="Media.formToData();" /></td>\r
- <td><label for="audio_loop">{#media_dlg.loop}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="embeddedaudio_controls" name="audio_controls" onchange="Media.formToData();" /></td>\r
- <td><label for="audio_controls">{#media_dlg.controls}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset id="audio_options">\r
- <legend>{#media_dlg.html5_audio_options}</legend>\r
-\r
- <table role="presentation">\r
- <tr>\r
- <td><label for="audio_altsource1">{#media_dlg.altsource1}</label></td>\r
- <td>\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input type="text" id="audio_altsource1" name="audio_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>\r
- <td id="audio_altsource1_filebrowser"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="audio_altsource2">{#media_dlg.altsource2}</label></td>\r
- <td>\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input type="text" id="audio_altsource2" name="audio_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>\r
- <td id="audio_altsource2_filebrowser"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="audio_preload">{#media_dlg.preload}</label></td>\r
- <td>\r
- <select id="audio_preload" name="audio_preload" onchange="Media.formToData();">\r
- <option value="none">{#media_dlg.preload_none}</option>\r
- <option value="metadata">{#media_dlg.preload_metadata}</option>\r
- <option value="auto">{#media_dlg.preload_auto}</option>\r
- </select>\r
- </td>\r
- </tr>\r
- </table>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="audio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>\r
- <td><label for="audio_autoplay">{#media_dlg.play}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="audio_loop" name="audio_loop" onchange="Media.formToData();" /></td>\r
- <td><label for="audio_loop">{#media_dlg.loop}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="audio_controls" name="audio_controls" onchange="Media.formToData();" /></td>\r
- <td><label for="audio_controls">{#media_dlg.controls}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset id="flash_options">\r
- <legend>{#media_dlg.flash_options}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td><label for="flash_quality">{#media_dlg.quality}</label></td>\r
- <td>\r
- <select id="flash_quality" name="flash_quality" onchange="Media.formToData();">\r
- <option value="">{#not_set}</option> \r
- <option value="high">high</option>\r
- <option value="low">low</option>\r
- <option value="autolow">autolow</option>\r
- <option value="autohigh">autohigh</option>\r
- <option value="best">best</option>\r
- </select>\r
- </td>\r
-\r
- <td><label for="flash_scale">{#media_dlg.scale}</label></td>\r
- <td>\r
- <select id="flash_scale" name="flash_scale" onchange="Media.formToData();">\r
- <option value="">{#not_set}</option> \r
- <option value="showall">showall</option>\r
- <option value="noborder">noborder</option>\r
- <option value="exactfit">exactfit</option>\r
- <option value="noscale">noscale</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="flash_wmode">{#media_dlg.wmode}</label></td>\r
- <td>\r
- <select id="flash_wmode" name="flash_wmode" onchange="Media.formToData();">\r
- <option value="">{#not_set}</option> \r
- <option value="window">window</option>\r
- <option value="opaque">opaque</option>\r
- <option value="transparent">transparent</option>\r
- </select>\r
- </td>\r
-\r
- <td><label for="flash_salign">{#media_dlg.salign}</label></td>\r
- <td>\r
- <select id="flash_salign" name="flash_salign" onchange="Media.formToData();">\r
- <option value="">{#not_set}</option> \r
- <option value="l">{#media_dlg.align_left}</option>\r
- <option value="t">{#media_dlg.align_top}</option>\r
- <option value="r">{#media_dlg.align_right}</option>\r
- <option value="b">{#media_dlg.align_bottom}</option>\r
- <option value="tl">{#media_dlg.align_top_left}</option>\r
- <option value="tr">{#media_dlg.align_top_right}</option>\r
- <option value="bl">{#media_dlg.align_bottom_left}</option>\r
- <option value="br">{#media_dlg.align_bottom_right}</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="flash_play">{#media_dlg.play}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="flash_loop">{#media_dlg.loop}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="flash_menu">{#media_dlg.menu}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="Media.formToData();" /></td>\r
- <td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
-\r
- <table role="presentation">\r
- <tr>\r
- <td><label for="flash_base">{#media_dlg.base}</label></td>\r
- <td><input type="text" id="flash_base" name="flash_base" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>\r
- <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="Media.formToData();" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset id="quicktime_options">\r
- <legend>{#media_dlg.qt_options}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_loop" name="quicktime_loop" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_loop">{#media_dlg.loop}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_autoplay" name="quicktime_autoplay" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_autoplay">{#media_dlg.play}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_cache" name="quicktime_cache" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_cache">{#media_dlg.cache}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_controller" name="quicktime_controller" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_controller">{#media_dlg.controller}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_correction" name="quicktime_correction" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_correction">{#media_dlg.correction}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_enablejavascript" name="quicktime_enablejavascript" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_enablejavascript">{#media_dlg.enablejavascript}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_kioskmode" name="quicktime_kioskmode" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_kioskmode">{#media_dlg.kioskmode}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_autohref" name="quicktime_autohref" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_autohref">{#media_dlg.autohref}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_playeveryframe" name="quicktime_playeveryframe" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_playeveryframe">{#media_dlg.playeveryframe}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="quicktime_targetcache" name="quicktime_targetcache" onchange="Media.formToData();" /></td>\r
- <td><label for="quicktime_targetcache">{#media_dlg.targetcache}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="quicktime_scale">{#media_dlg.scale}</label></td>\r
- <td><select id="quicktime_scale" name="quicktime_scale" class="mceEditableSelect" onchange="Media.formToData();">\r
- <option value="">{#not_set}</option> \r
- <option value="tofit">tofit</option>\r
- <option value="aspect">aspect</option>\r
- </select>\r
- </td>\r
-\r
- <td colspan="2"> </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="quicktime_starttime">{#media_dlg.starttime}</label></td>\r
- <td><input type="text" id="quicktime_starttime" name="quicktime_starttime" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="quicktime_endtime">{#media_dlg.endtime}</label></td>\r
- <td><input type="text" id="quicktime_endtime" name="quicktime_endtime" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="quicktime_target">{#media_dlg.target}</label></td>\r
- <td><input type="text" id="quicktime_target" name="quicktime_target" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="quicktime_href">{#media_dlg.href}</label></td>\r
- <td><input type="text" id="quicktime_href" name="quicktime_href" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="quicktime_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>\r
- <td><input type="text" id="quicktime_qtsrcchokespeed" name="quicktime_qtsrcchokespeed" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="quicktime_volume">{#media_dlg.volume}</label></td>\r
- <td><input type="text" id="quicktime_volume" name="quicktime_volume" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="quicktime_qtsrc">{#media_dlg.qtsrc}</label></td>\r
- <td colspan="4">\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input type="text" id="quicktime_qtsrc" name="quicktime_qtsrc" onchange="Media.formToData();" /></td>\r
- <td id="qtsrcfilebrowsercontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset id="windowsmedia_options">\r
- <legend>{#media_dlg.wmp_options}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="windowsmedia_autostart" name="windowsmedia_autostart" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="windowsmedia_autostart">{#media_dlg.autostart}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="windowsmedia_enabled" name="windowsmedia_enabled" onchange="Media.formToData();" /></td>\r
- <td><label for="windowsmedia_enabled">{#media_dlg.enabled}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="windowsmedia_enablecontextmenu" name="windowsmedia_enablecontextmenu" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="windowsmedia_enablecontextmenu">{#media_dlg.menu}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="windowsmedia_fullscreen" name="windowsmedia_fullscreen" onchange="Media.formToData();" /></td>\r
- <td><label for="windowsmedia_fullscreen">{#media_dlg.fullscreen}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="windowsmedia_invokeurls" name="windowsmedia_invokeurls" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="windowsmedia_invokeurls">{#media_dlg.invokeurls}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="windowsmedia_mute" name="windowsmedia_mute" onchange="Media.formToData();" /></td>\r
- <td><label for="windowsmedia_mute">{#media_dlg.mute}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="windowsmedia_stretchtofit" name="windowsmedia_stretchtofit" onchange="Media.formToData();" /></td>\r
- <td><label for="windowsmedia_stretchtofit">{#media_dlg.stretchtofit}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="windowsmedia_windowlessvideo" name="windowsmedia_windowlessvideo" onchange="Media.formToData();" /></td>\r
- <td><label for="windowsmedia_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="windowsmedia_balance">{#media_dlg.balance}</label></td>\r
- <td><input type="text" id="windowsmedia_balance" name="windowsmedia_balance" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="windowsmedia_baseurl">{#media_dlg.baseurl}</label></td>\r
- <td><input type="text" id="windowsmedia_baseurl" name="windowsmedia_baseurl" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="windowsmedia_captioningid">{#media_dlg.captioningid}</label></td>\r
- <td><input type="text" id="windowsmedia_captioningid" name="windowsmedia_captioningid" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="windowsmedia_currentmarker">{#media_dlg.currentmarker}</label></td>\r
- <td><input type="text" id="windowsmedia_currentmarker" name="windowsmedia_currentmarker" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="windowsmedia_currentposition">{#media_dlg.currentposition}</label></td>\r
- <td><input type="text" id="windowsmedia_currentposition" name="windowsmedia_currentposition" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="windowsmedia_defaultframe">{#media_dlg.defaultframe}</label></td>\r
- <td><input type="text" id="windowsmedia_defaultframe" name="windowsmedia_defaultframe" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="windowsmedia_playcount">{#media_dlg.playcount}</label></td>\r
- <td><input type="text" id="windowsmedia_playcount" name="windowsmedia_playcount" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="windowsmedia_rate">{#media_dlg.rate}</label></td>\r
- <td><input type="text" id="windowsmedia_rate" name="windowsmedia_rate" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="windowsmedia_uimode">{#media_dlg.uimode}</label></td>\r
- <td><input type="text" id="windowsmedia_uimode" name="windowsmedia_uimode" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="windowsmedia_volume">{#media_dlg.volume}</label></td>\r
- <td><input type="text" id="windowsmedia_volume" name="windowsmedia_volume" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset id="realmedia_options">\r
- <legend>{#media_dlg.rmp_options}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="realmedia_autostart" name="realmedia_autostart" onchange="Media.formToData();" /></td>\r
- <td><label for="realmedia_autostart">{#media_dlg.autostart}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="realmedia_loop" name="realmedia_loop" onchange="Media.formToData();" /></td>\r
- <td><label for="realmedia_loop">{#media_dlg.loop}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="realmedia_autogotourl" name="realmedia_autogotourl" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="realmedia_autogotourl">{#media_dlg.autogotourl}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="realmedia_center" name="realmedia_center" onchange="Media.formToData();" /></td>\r
- <td><label for="realmedia_center">{#media_dlg.center}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="realmedia_imagestatus" name="realmedia_imagestatus" checked="checked" onchange="Media.formToData();" /></td>\r
- <td><label for="realmedia_imagestatus">{#media_dlg.imagestatus}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="realmedia_maintainaspect" name="realmedia_maintainaspect" onchange="Media.formToData();" /></td>\r
- <td><label for="realmedia_maintainaspect">{#media_dlg.maintainaspect}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="realmedia_nojava" name="realmedia_nojava" onchange="Media.formToData();" /></td>\r
- <td><label for="realmedia_nojava">{#media_dlg.nojava}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="realmedia_prefetch" name="realmedia_prefetch" onchange="Media.formToData();" /></td>\r
- <td><label for="realmedia_prefetch">{#media_dlg.prefetch}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="realmedia_shuffle" name="realmedia_shuffle" onchange="Media.formToData();" /></td>\r
- <td><label for="realmedia_shuffle">{#media_dlg.shuffle}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- \r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="realmedia_console">{#media_dlg.console}</label></td>\r
- <td><input type="text" id="realmedia_console" name="realmedia_console" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="realmedia_controls">{#media_dlg.controls}</label></td>\r
- <td><input type="text" id="realmedia_controls" name="realmedia_controls" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="realmedia_numloop">{#media_dlg.numloop}</label></td>\r
- <td><input type="text" id="realmedia_numloop" name="realmedia_numloop" onchange="Media.formToData();" /></td>\r
-\r
- <td><label for="realmedia_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>\r
- <td><input type="text" id="realmedia_scriptcallbacks" name="realmedia_scriptcallbacks" onchange="Media.formToData();" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset id="shockwave_options">\r
- <legend>{#media_dlg.shockwave_options}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>\r
- <td>\r
- <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="Media.formToData();">\r
- <option value="none">{#not_set}</option>\r
- <option value="meet">Meet</option>\r
- <option value="fill">Fill</option>\r
- <option value="stage">Stage</option>\r
- </select>\r
- </td>\r
-\r
- <td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>\r
- <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="Media.formToData();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>\r
- <td>\r
- <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="Media.formToData();">\r
- <option value="none">{#not_set}</option>\r
- <option value="left">{#media_dlg.align_left}</option>\r
- <option value="center">{#media_dlg.align_center}</option>\r
- <option value="right">{#media_dlg.align_right}</option>\r
- </select>\r
- </td>\r
-\r
- <td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>\r
- <td>\r
- <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="Media.formToData();">\r
- <option value="none">{#not_set}</option>\r
- <option value="meet">Meet</option>\r
- <option value="fill">Fill</option>\r
- <option value="stage">Stage</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="Media.formToData();" checked="checked" /></td>\r
- <td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="Media.formToData();" checked="checked" /></td>\r
- <td><label for="shockwave_sound">{#media_dlg.sound}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
-\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="Media.formToData();" /></td>\r
- <td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
-\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="Media.formToData();" checked="checked" /></td>\r
- <td><label for="shockwave_progress">{#media_dlg.progress}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="source_panel" class="panel">\r
- <fieldset>\r
- <legend>{#media_dlg.source}</legend>\r
- <textarea id="source" style="width: 99%; height: 390px"></textarea>\r
- </fieldset>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
- </form>\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp"> </span>':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.Nonbreaking', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
-\r
- // Register commands\r
- ed.addCommand('mceNonBreaking', function() {\r
- ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp"> </span>' : ' ');\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});\r
-\r
- if (ed.getParam('nonbreaking_force_tab')) {\r
- ed.onKeyDown.add(function(ed, e) {\r
- if (e.keyCode == 9) {\r
- e.preventDefault();\r
- \r
- ed.execCommand('mceNonBreaking');\r
- ed.execCommand('mceNonBreaking');\r
- ed.execCommand('mceNonBreaking');\r
- }\r
- });\r
- }\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Nonbreaking space',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
-\r
- // Private methods\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(){var c=tinymce.dom.TreeWalker;var a="contenteditable",d="data-mce-"+a;var e=tinymce.VK;function b(n){var j=n.dom,p=n.selection,r,o="mce_noneditablecaret",r="\uFEFF";function m(t){var s;if(t.nodeType===1){s=t.getAttribute(d);if(s&&s!=="inherit"){return s}s=t.contentEditable;if(s!=="inherit"){return s}}return null}function g(s){var t;while(s){t=m(s);if(t){return t==="false"?s:null}s=s.parentNode}}function l(s){while(s){if(s.id===o){return s}s=s.parentNode}}function k(s){var t;if(s){t=new c(s,s);for(s=t.current();s;s=t.next()){if(s.nodeType===3){return s}}}}function f(v,u){var s,t;if(m(v)==="false"){if(j.isBlock(v)){p.select(v);return}}t=j.createRng();if(m(v)==="true"){if(!v.firstChild){v.appendChild(n.getDoc().createTextNode("\u00a0"))}v=v.firstChild;u=true}s=j.create("span",{id:o,"data-mce-bogus":true},r);if(u){v.parentNode.insertBefore(s,v)}else{j.insertAfter(s,v)}t.setStart(s.firstChild,1);t.collapse(true);p.setRng(t);return s}function i(s){var v,t,u;if(s){rng=p.getRng(true);rng.setStartBefore(s);rng.setEndBefore(s);v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true);p.setRng(rng)}else{t=l(p.getStart());while((s=j.get(o))&&s!==u){if(t!==s){v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true)}u=s}}}function q(){var s,w,u,t,v;function x(B,D){var A,F,E,C,z;A=t.startContainer;F=t.startOffset;if(A.nodeType==3){z=A.nodeValue.length;if((F>0&&F<z)||(D?F==z:F==0)){return}}else{if(F<A.childNodes.length){var G=!D&&F>0?F-1:F;A=A.childNodes[G];if(A.hasChildNodes()){A=A.firstChild}}else{return !D?B:null}}E=new c(A,B);while(C=E[D?"prev":"next"]()){if(C.nodeType===3&&C.nodeValue.length>0){return}else{if(m(C)==="true"){return C}}}return B}i();u=p.isCollapsed();s=g(p.getStart());w=g(p.getEnd());if(s||w){t=p.getRng(true);if(u){s=s||w;var y=p.getStart();if(v=x(s,true)){f(v,true)}else{if(v=x(s,false)){f(v,false)}else{p.select(s)}}}else{t=p.getRng(true);if(s){t.setStartBefore(s)}if(w){t.setEndAfter(w)}p.setRng(t)}}}function h(z,B){var F=B.keyCode,x,C,D,v;function u(H,G){while(H=H[G?"previousSibling":"nextSibling"]){if(H.nodeType!==3||H.nodeValue.length>0){return H}}}function y(G,H){p.select(G);p.collapse(H)}function t(K){var J,I,M,H;function G(O){var N=I;while(N){if(N===O){return}N=N.parentNode}j.remove(O);q()}function L(){var O,P,N=z.schema.getNonEmptyElements();P=new tinymce.dom.TreeWalker(I,z.getBody());while(O=(K?P.prev():P.next())){if(N[O.nodeName.toLowerCase()]){break}if(O.nodeType===3&&tinymce.trim(O.nodeValue).length>0){break}if(m(O)==="false"){G(O);return true}}if(g(O)){return true}return false}if(p.isCollapsed()){J=p.getRng(true);I=J.startContainer;M=J.startOffset;I=l(I)||I;if(H=g(I)){G(H);return false}if(I.nodeType==3&&(K?M>0:M<I.nodeValue.length)){return true}if(I.nodeType==1){I=I.childNodes[M]||I}if(L()){return false}}return true}D=p.getStart();v=p.getEnd();x=g(D)||g(v);if(x&&(F<112||F>124)&&F!=e.DELETE&&F!=e.BACKSPACE){if((tinymce.isMac?B.metaKey:B.ctrlKey)&&(F==67||F==88||F==86)){return}B.preventDefault();if(F==e.LEFT||F==e.RIGHT){var w=F==e.LEFT;if(z.dom.isBlock(x)){var A=w?x.previousSibling:x.nextSibling;var s=new c(A,A);var E=w?s.prev():s.next();y(E,!w)}else{y(x,w)}}}else{if(F==e.LEFT||F==e.RIGHT||F==e.BACKSPACE||F==e.DELETE){C=l(D);if(C){if(F==e.LEFT||F==e.BACKSPACE){x=u(C,true);if(x&&m(x)==="false"){B.preventDefault();if(F==e.LEFT){y(x,true)}else{j.remove(x);return}}else{i(C)}}if(F==e.RIGHT||F==e.DELETE){x=u(C);if(x&&m(x)==="false"){B.preventDefault();if(F==e.RIGHT){y(x,false)}else{j.remove(x);return}}else{i(C)}}}if((F==e.BACKSPACE||F==e.DELETE)&&!t(F==e.BACKSPACE)){B.preventDefault();return false}}}}n.onMouseDown.addToTop(function(s,u){var t=s.selection.getNode();if(m(t)==="false"&&t==u.target){q()}});n.onMouseUp.addToTop(q);n.onKeyDown.addToTop(h);n.onKeyUp.addToTop(q)}tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(i,k){var h,g,j;function f(m,n){var o=j.length,p=n.content,l=tinymce.trim(g);if(n.format=="raw"){return}while(o--){p=p.replace(j[o],function(s){var r=arguments,q=r[r.length-2];if(q>0&&p.charAt(q-1)=='"'){return s}return'<span class="'+l+'" data-mce-content="'+m.dom.encode(r[0])+'">'+m.dom.encode(typeof(r[1])==="string"?r[1]:r[0])+"</span>"})}n.content=p}h=" "+tinymce.trim(i.getParam("noneditable_editable_class","mceEditable"))+" ";g=" "+tinymce.trim(i.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";j=i.getParam("noneditable_regexp");if(j&&!j.length){j=[j]}i.onPreInit.add(function(){b(i);if(j){i.selection.onBeforeSetContent.add(f);i.onBeforeSetContent.add(f)}i.parser.addAttributeFilter("class",function(l){var m=l.length,n,o;while(m--){o=l[m];n=" "+o.attr("class")+" ";if(n.indexOf(h)!==-1){o.attr(d,"true")}else{if(n.indexOf(g)!==-1){o.attr(d,"false")}}}});i.serializer.addAttributeFilter(d,function(l,m){var n=l.length,o;while(n--){o=l[n];if(j&&o.attr("data-mce-content")){o.name="#text";o.type=3;o.raw=true;o.value=o.attr("data-mce-content")}else{o.attr(a,null);o.attr(d,null)}}});i.parser.addAttributeFilter(a,function(l,m){var n=l.length,o;while(n--){o=l[n];o.attr(d,o.attr(a));o.attr(a,null)}})})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var TreeWalker = tinymce.dom.TreeWalker;\r
- var externalName = 'contenteditable', internalName = 'data-mce-' + externalName;\r
- var VK = tinymce.VK;\r
-\r
- function handleContentEditableSelection(ed) {\r
- var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF';\r
-\r
- // Returns the content editable state of a node "true/false" or null\r
- function getContentEditable(node) {\r
- var contentEditable;\r
-\r
- // Ignore non elements\r
- if (node.nodeType === 1) {\r
- // Check for fake content editable\r
- contentEditable = node.getAttribute(internalName);\r
- if (contentEditable && contentEditable !== "inherit") {\r
- return contentEditable;\r
- }\r
-\r
- // Check for real content editable\r
- contentEditable = node.contentEditable;\r
- if (contentEditable !== "inherit") {\r
- return contentEditable;\r
- }\r
- }\r
-\r
- return null;\r
- };\r
-\r
- // Returns the noneditable parent or null if there is a editable before it or if it wasn't found\r
- function getNonEditableParent(node) {\r
- var state;\r
-\r
- while (node) {\r
- state = getContentEditable(node);\r
- if (state) {\r
- return state === "false" ? node : null;\r
- }\r
-\r
- node = node.parentNode;\r
- }\r
- };\r
-\r
- // Get caret container parent for the specified node\r
- function getParentCaretContainer(node) {\r
- while (node) {\r
- if (node.id === caretContainerId) {\r
- return node;\r
- }\r
-\r
- node = node.parentNode;\r
- }\r
- };\r
-\r
- // Finds the first text node in the specified node\r
- function findFirstTextNode(node) {\r
- var walker;\r
-\r
- if (node) {\r
- walker = new TreeWalker(node, node);\r
-\r
- for (node = walker.current(); node; node = walker.next()) {\r
- if (node.nodeType === 3) {\r
- return node;\r
- }\r
- }\r
- }\r
- };\r
-\r
- // Insert caret container before/after target or expand selection to include block\r
- function insertCaretContainerOrExpandToBlock(target, before) {\r
- var caretContainer, rng;\r
-\r
- // Select block\r
- if (getContentEditable(target) === "false") {\r
- if (dom.isBlock(target)) {\r
- selection.select(target);\r
- return;\r
- }\r
- }\r
-\r
- rng = dom.createRng();\r
-\r
- if (getContentEditable(target) === "true") {\r
- if (!target.firstChild) {\r
- target.appendChild(ed.getDoc().createTextNode('\u00a0'));\r
- }\r
-\r
- target = target.firstChild;\r
- before = true;\r
- }\r
-\r
- //caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style:'border: 1px solid red'}, invisibleChar);\r
- caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar);\r
-\r
- if (before) {\r
- target.parentNode.insertBefore(caretContainer, target);\r
- } else {\r
- dom.insertAfter(caretContainer, target);\r
- }\r
-\r
- rng.setStart(caretContainer.firstChild, 1);\r
- rng.collapse(true);\r
- selection.setRng(rng);\r
-\r
- return caretContainer;\r
- };\r
-\r
- // Removes any caret container except the one we might be in\r
- function removeCaretContainer(caretContainer) {\r
- var child, currentCaretContainer, lastContainer;\r
-\r
- if (caretContainer) {\r
- rng = selection.getRng(true);\r
- rng.setStartBefore(caretContainer);\r
- rng.setEndBefore(caretContainer);\r
-\r
- child = findFirstTextNode(caretContainer);\r
- if (child && child.nodeValue.charAt(0) == invisibleChar) {\r
- child = child.deleteData(0, 1);\r
- }\r
-\r
- dom.remove(caretContainer, true);\r
-\r
- selection.setRng(rng);\r
- } else {\r
- currentCaretContainer = getParentCaretContainer(selection.getStart());\r
- while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) {\r
- if (currentCaretContainer !== caretContainer) {\r
- child = findFirstTextNode(caretContainer);\r
- if (child && child.nodeValue.charAt(0) == invisibleChar) {\r
- child = child.deleteData(0, 1);\r
- }\r
-\r
- dom.remove(caretContainer, true);\r
- }\r
-\r
- lastContainer = caretContainer;\r
- }\r
- }\r
- };\r
-\r
- // Modifies the selection to include contentEditable false elements or insert caret containers\r
- function moveSelection() {\r
- var nonEditableStart, nonEditableEnd, isCollapsed, rng, element;\r
-\r
- // Checks if there is any contents to the left/right side of caret returns the noneditable element or any editable element if it finds one inside\r
- function hasSideContent(element, left) {\r
- var container, offset, walker, node, len;\r
-\r
- container = rng.startContainer;\r
- offset = rng.startOffset;\r
-\r
- // If endpoint is in middle of text node then expand to beginning/end of element\r
- if (container.nodeType == 3) {\r
- len = container.nodeValue.length;\r
- if ((offset > 0 && offset < len) || (left ? offset == len : offset == 0)) {\r
- return;\r
- }\r
- } else {\r
- // Can we resolve the node by index\r
- if (offset < container.childNodes.length) {\r
- // Browser represents caret position as the offset at the start of an element. When moving right\r
- // this is the element we are moving into so we consider our container to be child node at offset-1\r
- var pos = !left && offset > 0 ? offset-1 : offset;\r
- container = container.childNodes[pos];\r
- if (container.hasChildNodes()) {\r
- container = container.firstChild;\r
- }\r
- } else {\r
- // If not then the caret is at the last position in it's container and the caret container should be inserted after the noneditable element\r
- return !left ? element : null;\r
- }\r
- }\r
-\r
- // Walk left/right to look for contents\r
- walker = new TreeWalker(container, element);\r
- while (node = walker[left ? 'prev' : 'next']()) {\r
- if (node.nodeType === 3 && node.nodeValue.length > 0) {\r
- return;\r
- } else if (getContentEditable(node) === "true") {\r
- // Found contentEditable=true element return this one to we can move the caret inside it\r
- return node;\r
- }\r
- }\r
-\r
- return element;\r
- };\r
-\r
- // Remove any existing caret containers\r
- removeCaretContainer();\r
-\r
- // Get noneditable start/end elements\r
- isCollapsed = selection.isCollapsed();\r
- nonEditableStart = getNonEditableParent(selection.getStart());\r
- nonEditableEnd = getNonEditableParent(selection.getEnd());\r
-\r
- // Is any fo the range endpoints noneditable\r
- if (nonEditableStart || nonEditableEnd) {\r
- rng = selection.getRng(true);\r
-\r
- // If it's a caret selection then look left/right to see if we need to move the caret out side or expand\r
- if (isCollapsed) {\r
- nonEditableStart = nonEditableStart || nonEditableEnd;\r
- var start = selection.getStart();\r
- if (element = hasSideContent(nonEditableStart, true)) {\r
- // We have no contents to the left of the caret then insert a caret container before the noneditable element\r
- insertCaretContainerOrExpandToBlock(element, true);\r
- } else if (element = hasSideContent(nonEditableStart, false)) {\r
- // We have no contents to the right of the caret then insert a caret container after the noneditable element\r
- insertCaretContainerOrExpandToBlock(element, false);\r
- } else {\r
- // We are in the middle of a noneditable so expand to select it\r
- selection.select(nonEditableStart);\r
- }\r
- } else {\r
- rng = selection.getRng(true);\r
-\r
- // Expand selection to include start non editable element\r
- if (nonEditableStart) {\r
- rng.setStartBefore(nonEditableStart);\r
- }\r
-\r
- // Expand selection to include end non editable element\r
- if (nonEditableEnd) {\r
- rng.setEndAfter(nonEditableEnd);\r
- }\r
-\r
- selection.setRng(rng);\r
- }\r
- }\r
- };\r
-\r
- function handleKey(ed, e) {\r
- var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement;\r
-\r
- function getNonEmptyTextNodeSibling(node, prev) {\r
- while (node = node[prev ? 'previousSibling' : 'nextSibling']) {\r
- if (node.nodeType !== 3 || node.nodeValue.length > 0) {\r
- return node;\r
- }\r
- }\r
- };\r
-\r
- function positionCaretOnElement(element, start) {\r
- selection.select(element);\r
- selection.collapse(start);\r
- }\r
-\r
- function canDelete(backspace) {\r
- var rng, container, offset, nonEditableParent;\r
-\r
- function removeNodeIfNotParent(node) {\r
- var parent = container;\r
-\r
- while (parent) {\r
- if (parent === node) {\r
- return;\r
- }\r
-\r
- parent = parent.parentNode;\r
- }\r
-\r
- dom.remove(node);\r
- moveSelection();\r
- }\r
-\r
- function isNextPrevTreeNodeNonEditable() {\r
- var node, walker, nonEmptyElements = ed.schema.getNonEmptyElements();\r
-\r
- walker = new tinymce.dom.TreeWalker(container, ed.getBody());\r
- while (node = (backspace ? walker.prev() : walker.next())) {\r
- // Found IMG/INPUT etc\r
- if (nonEmptyElements[node.nodeName.toLowerCase()]) {\r
- break;\r
- }\r
-\r
- // Found text node with contents\r
- if (node.nodeType === 3 && tinymce.trim(node.nodeValue).length > 0) {\r
- break;\r
- }\r
-\r
- // Found non editable node\r
- if (getContentEditable(node) === "false") {\r
- removeNodeIfNotParent(node);\r
- return true;\r
- }\r
- }\r
-\r
- // Check if the content node is within a non editable parent\r
- if (getNonEditableParent(node)) {\r
- return true;\r
- }\r
-\r
- return false;\r
- }\r
-\r
- if (selection.isCollapsed()) {\r
- rng = selection.getRng(true);\r
- container = rng.startContainer;\r
- offset = rng.startOffset;\r
- container = getParentCaretContainer(container) || container;\r
-\r
- // Is in noneditable parent\r
- if (nonEditableParent = getNonEditableParent(container)) {\r
- removeNodeIfNotParent(nonEditableParent);\r
- return false;\r
- }\r
-\r
- // Check if the caret is in the middle of a text node\r
- if (container.nodeType == 3 && (backspace ? offset > 0 : offset < container.nodeValue.length)) {\r
- return true;\r
- }\r
-\r
- // Resolve container index\r
- if (container.nodeType == 1) {\r
- container = container.childNodes[offset] || container;\r
- }\r
-\r
- // Check if previous or next tree node is non editable then block the event\r
- if (isNextPrevTreeNodeNonEditable()) {\r
- return false;\r
- }\r
- }\r
-\r
- return true;\r
- }\r
-\r
- startElement = selection.getStart()\r
- endElement = selection.getEnd();\r
-\r
- // Disable all key presses in contentEditable=false except delete or backspace\r
- nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement);\r
- if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) {\r
- // Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior\r
- if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) {\r
- return;\r
- }\r
-\r
- e.preventDefault();\r
-\r
- // Arrow left/right select the element and collapse left/right\r
- if (keyCode == VK.LEFT || keyCode == VK.RIGHT) {\r
- var left = keyCode == VK.LEFT;\r
- // If a block element find previous or next element to position the caret\r
- if (ed.dom.isBlock(nonEditableParent)) {\r
- var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling;\r
- var walker = new TreeWalker(targetElement, targetElement);\r
- var caretElement = left ? walker.prev() : walker.next();\r
- positionCaretOnElement(caretElement, !left);\r
- } else {\r
- positionCaretOnElement(nonEditableParent, left);\r
- }\r
- }\r
- } else {\r
- // Is arrow left/right, backspace or delete\r
- if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) {\r
- caretContainer = getParentCaretContainer(startElement);\r
- if (caretContainer) {\r
- // Arrow left or backspace\r
- if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) {\r
- nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true);\r
-\r
- if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {\r
- e.preventDefault();\r
-\r
- if (keyCode == VK.LEFT) {\r
- positionCaretOnElement(nonEditableParent, true);\r
- } else {\r
- dom.remove(nonEditableParent);\r
- return;\r
- }\r
- } else {\r
- removeCaretContainer(caretContainer);\r
- }\r
- }\r
-\r
- // Arrow right or delete\r
- if (keyCode == VK.RIGHT || keyCode == VK.DELETE) {\r
- nonEditableParent = getNonEmptyTextNodeSibling(caretContainer);\r
-\r
- if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {\r
- e.preventDefault();\r
-\r
- if (keyCode == VK.RIGHT) {\r
- positionCaretOnElement(nonEditableParent, false);\r
- } else {\r
- dom.remove(nonEditableParent);\r
- return;\r
- }\r
- } else {\r
- removeCaretContainer(caretContainer);\r
- }\r
- }\r
- }\r
-\r
- if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) {\r
- e.preventDefault();\r
- return false;\r
- }\r
- }\r
- }\r
- };\r
-\r
- ed.onMouseDown.addToTop(function(ed, e) {\r
- var node = ed.selection.getNode();\r
-\r
- if (getContentEditable(node) === "false" && node == e.target) {\r
- // Expand selection on mouse down we can't block the default event since it's used for drag/drop\r
- moveSelection();\r
- }\r
- });\r
-\r
- ed.onMouseUp.addToTop(moveSelection);\r
- ed.onKeyDown.addToTop(handleKey);\r
- ed.onKeyUp.addToTop(moveSelection);\r
- };\r
-\r
- tinymce.create('tinymce.plugins.NonEditablePlugin', {\r
- init : function(ed, url) {\r
- var editClass, nonEditClass, nonEditableRegExps;\r
-\r
- // Converts configured regexps to noneditable span items\r
- function convertRegExpsToNonEditable(ed, args) {\r
- var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass);\r
-\r
- // Don't replace the variables when raw is used for example on undo/redo\r
- if (args.format == "raw") {\r
- return;\r
- }\r
-\r
- while (i--) {\r
- content = content.replace(nonEditableRegExps[i], function(match) {\r
- var args = arguments, index = args[args.length - 2];\r
-\r
- // Is value inside an attribute then don't replace\r
- if (index > 0 && content.charAt(index - 1) == '"') {\r
- return match;\r
- }\r
-\r
- return '<span class="' + cls + '" data-mce-content="' + ed.dom.encode(args[0]) + '">' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + '</span>';\r
- });\r
- }\r
-\r
- args.content = content;\r
- };\r
- \r
- editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " ";\r
- nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " ";\r
-\r
- // Setup noneditable regexps array\r
- nonEditableRegExps = ed.getParam("noneditable_regexp");\r
- if (nonEditableRegExps && !nonEditableRegExps.length) {\r
- nonEditableRegExps = [nonEditableRegExps];\r
- }\r
-\r
- ed.onPreInit.add(function() {\r
- handleContentEditableSelection(ed);\r
-\r
- if (nonEditableRegExps) {\r
- ed.selection.onBeforeSetContent.add(convertRegExpsToNonEditable);\r
- ed.onBeforeSetContent.add(convertRegExpsToNonEditable);\r
- }\r
-\r
- // Apply contentEditable true/false on elements with the noneditable/editable classes\r
- ed.parser.addAttributeFilter('class', function(nodes) {\r
- var i = nodes.length, className, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- className = " " + node.attr("class") + " ";\r
-\r
- if (className.indexOf(editClass) !== -1) {\r
- node.attr(internalName, "true");\r
- } else if (className.indexOf(nonEditClass) !== -1) {\r
- node.attr(internalName, "false");\r
- }\r
- }\r
- });\r
-\r
- // Remove internal name\r
- ed.serializer.addAttributeFilter(internalName, function(nodes, name) {\r
- var i = nodes.length, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
-\r
- if (nonEditableRegExps && node.attr('data-mce-content')) {\r
- node.name = "#text";\r
- node.type = 3;\r
- node.raw = true;\r
- node.value = node.attr('data-mce-content');\r
- } else {\r
- node.attr(externalName, null);\r
- node.attr(internalName, null);\r
- }\r
- }\r
- });\r
-\r
- // Convert external name into internal name\r
- ed.parser.addAttributeFilter(externalName, function(nodes, name) {\r
- var i = nodes.length, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- node.attr(internalName, node.attr(externalName));\r
- node.attr(externalName, null);\r
- }\r
- });\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Non editable elements',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='<img src="'+b.theme.url+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',a="mcePageBreak",c=b.getParam("pagebreak_separator","<!-- pagebreak -->"),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.PageBreakPlugin', {\r
- init : function(ed, url) {\r
- var pb = '<img src="' + ed.theme.url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;\r
-\r
- pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');\r
-\r
- // Register commands\r
- ed.addCommand('mcePageBreak', function() {\r
- ed.execCommand('mceInsertContent', 0, pb);\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});\r
-\r
- ed.onInit.add(function() {\r
- if (ed.theme.onResolveName) {\r
- ed.theme.onResolveName.add(function(th, o) {\r
- if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))\r
- o.name = 'pagebreak';\r
- });\r
- }\r
- });\r
-\r
- ed.onClick.add(function(ed, e) {\r
- e = e.target;\r
-\r
- if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))\r
- ed.selection.select(e);\r
- });\r
-\r
- ed.onNodeChange.add(function(ed, cm, n) {\r
- cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));\r
- });\r
-\r
- ed.onBeforeSetContent.add(function(ed, o) {\r
- o.content = o.content.replace(pbRE, pb);\r
- });\r
-\r
- ed.onPostProcess.add(function(ed, o) {\r
- if (o.get)\r
- o.content = o.content.replace(/<img[^>]+>/g, function(im) {\r
- if (im.indexOf('class="mcePageBreak') !== -1)\r
- im = sep;\r
-\r
- return im;\r
- });\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'PageBreak',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_max_consecutive_linebreaks:2,paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="<p>"+o.encode(r).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g,"$1"]]);d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j){var h=this.editor,f=b(h,"paste_text_linebreaktype"),k=b(h,"paste_text_replacements"),g=tinymce.is;function e(m){c(m,function(n){if(n.constructor==RegExp){j=j.replace(n,"")}else{j=j.replace(n[0],n[1])}})}if((typeof(j)==="string")&&(j.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(j)){e([/[\n\r]+/g])}else{e([/\r+/g])}e([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"]]);var d=Number(b(h,"paste_max_consecutive_linebreaks"));if(d>-1){var l=new RegExp("\n{"+(d+1)+",}","g");var i="";while(i.length<d){i+="\n"}e([[l,i]])}j=h.dom.decode(tinymce.html.Entities.encodeRaw(j));if(g(k,"array")){e(k)}else{if(g(k,"string")){e(new RegExp(k,"gi"))}}if(f=="none"){e([[/\n+/g," "]])}else{if(f=="br"){e([[/\n/g,"<br />"]])}else{if(f=="p"){e([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"]])}else{e([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]])}}}h.execCommand("mceInsertContent",false,j)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var each = tinymce.each,\r
- defs = {\r
- paste_auto_cleanup_on_paste : true,\r
- paste_enable_default_filters : true,\r
- paste_block_drop : false,\r
- paste_retain_style_properties : "none",\r
- paste_strip_class_attributes : "mso",\r
- paste_remove_spans : false,\r
- paste_remove_styles : false,\r
- paste_remove_styles_if_webkit : true,\r
- paste_convert_middot_lists : true,\r
- paste_convert_headers_to_strong : false,\r
- paste_dialog_width : "450",\r
- paste_dialog_height : "400",\r
- paste_max_consecutive_linebreaks: 2,\r
- paste_text_use_dialog : false,\r
- paste_text_sticky : false,\r
- paste_text_sticky_default : false,\r
- paste_text_notifyalways : false,\r
- paste_text_linebreaktype : "combined",\r
- paste_text_replacements : [\r
- [/\u2026/g, "..."],\r
- [/[\x93\x94\u201c\u201d]/g, '"'],\r
- [/[\x60\x91\x92\u2018\u2019]/g, "'"]\r
- ]\r
- };\r
-\r
- function getParam(ed, name) {\r
- return ed.getParam(name, defs[name]);\r
- }\r
-\r
- tinymce.create('tinymce.plugins.PastePlugin', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
- t.url = url;\r
-\r
- // Setup plugin events\r
- t.onPreProcess = new tinymce.util.Dispatcher(t);\r
- t.onPostProcess = new tinymce.util.Dispatcher(t);\r
-\r
- // Register default handlers\r
- t.onPreProcess.add(t._preProcess);\r
- t.onPostProcess.add(t._postProcess);\r
-\r
- // Register optional preprocess handler\r
- t.onPreProcess.add(function(pl, o) {\r
- ed.execCallback('paste_preprocess', pl, o);\r
- });\r
-\r
- // Register optional postprocess\r
- t.onPostProcess.add(function(pl, o) {\r
- ed.execCallback('paste_postprocess', pl, o);\r
- });\r
-\r
- ed.onKeyDown.addToTop(function(ed, e) {\r
- // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that\r
- if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))\r
- return false; // Stop other listeners\r
- });\r
-\r
- // Initialize plain text flag\r
- ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default');\r
-\r
- // This function executes the process handlers and inserts the contents\r
- // force_rich overrides plain text mode set by user, important for pasting with execCommand\r
- function process(o, force_rich) {\r
- var dom = ed.dom, rng;\r
-\r
- // Execute pre process handlers\r
- t.onPreProcess.dispatch(t, o);\r
-\r
- // Create DOM structure\r
- o.node = dom.create('div', 0, o.content);\r
-\r
- // If pasting inside the same element and the contents is only one block\r
- // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element\r
- if (tinymce.isGecko) {\r
- rng = ed.selection.getRng(true);\r
- if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) {\r
- // Is only one block node and it doesn't contain word stuff\r
- if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1)\r
- dom.remove(o.node.firstChild, true);\r
- }\r
- }\r
-\r
- // Execute post process handlers\r
- t.onPostProcess.dispatch(t, o);\r
-\r
- // Serialize content\r
- o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''});\r
-\r
- // Plain text option active?\r
- if ((!force_rich) && (ed.pasteAsPlainText)) {\r
- t._insertPlainText(o.content);\r
-\r
- if (!getParam(ed, "paste_text_sticky")) {\r
- ed.pasteAsPlainText = false;\r
- ed.controlManager.setActive("pastetext", false);\r
- }\r
- } else {\r
- t._insert(o.content);\r
- }\r
- }\r
-\r
- // Add command for external usage\r
- ed.addCommand('mceInsertClipboardContent', function(u, o) {\r
- process(o, true);\r
- });\r
-\r
- if (!getParam(ed, "paste_text_use_dialog")) {\r
- ed.addCommand('mcePasteText', function(u, v) {\r
- var cookie = tinymce.util.Cookie;\r
-\r
- ed.pasteAsPlainText = !ed.pasteAsPlainText;\r
- ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);\r
-\r
- if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {\r
- if (getParam(ed, "paste_text_sticky")) {\r
- ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));\r
- } else {\r
- ed.windowManager.alert(ed.translate('paste.plaintext_mode'));\r
- }\r
-\r
- if (!getParam(ed, "paste_text_notifyalways")) {\r
- cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))\r
- }\r
- }\r
- });\r
- }\r
-\r
- ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});\r
- ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});\r
-\r
- // This function grabs the contents from the clipboard by adding a\r
- // hidden div and placing the caret inside it and after the browser paste\r
- // is done it grabs that contents and processes that\r
- function grabContent(e) {\r
- var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent;\r
-\r
- // Check if browser supports direct plaintext access\r
- if (e.clipboardData || dom.doc.dataTransfer) {\r
- textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text');\r
-\r
- if (ed.pasteAsPlainText) {\r
- e.preventDefault();\r
- process({content : dom.encode(textContent).replace(/\r?\n/g, '<br />')});\r
- return;\r
- }\r
- }\r
-\r
- if (dom.get('_mcePaste'))\r
- return;\r
-\r
- // Create container to paste into\r
- n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF');\r
-\r
- // If contentEditable mode we need to find out the position of the closest element\r
- if (body != ed.getDoc().body)\r
- posY = dom.getPos(ed.selection.getStart(), body).y;\r
- else\r
- posY = body.scrollTop + dom.getViewPort(ed.getWin()).y;\r
-\r
- // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles\r
- // If also needs to be in view on IE or the paste would fail\r
- dom.setStyles(n, {\r
- position : 'absolute',\r
- left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div\r
- top : posY - 25,\r
- width : 1,\r
- height : 1,\r
- overflow : 'hidden'\r
- });\r
-\r
- if (tinymce.isIE) {\r
- // Store away the old range\r
- oldRng = sel.getRng();\r
-\r
- // Select the container\r
- rng = dom.doc.body.createTextRange();\r
- rng.moveToElementText(n);\r
- rng.execCommand('Paste');\r
-\r
- // Remove container\r
- dom.remove(n);\r
-\r
- // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due\r
- // to IE security settings so we pass the junk though better than nothing right\r
- if (n.innerHTML === '\uFEFF\uFEFF') {\r
- ed.execCommand('mcePasteWord');\r
- e.preventDefault();\r
- return;\r
- }\r
-\r
- // Restore the old range and clear the contents before pasting\r
- sel.setRng(oldRng);\r
- sel.setContent('');\r
-\r
- // For some odd reason we need to detach the the mceInsertContent call from the paste event\r
- // It's like IE has a reference to the parent element that you paste in and the selection gets messed up\r
- // when it tries to restore the selection\r
- setTimeout(function() {\r
- // Process contents\r
- process({content : n.innerHTML});\r
- }, 0);\r
-\r
- // Block the real paste event\r
- return tinymce.dom.Event.cancel(e);\r
- } else {\r
- function block(e) {\r
- e.preventDefault();\r
- };\r
-\r
- // Block mousedown and click to prevent selection change\r
- dom.bind(ed.getDoc(), 'mousedown', block);\r
- dom.bind(ed.getDoc(), 'keydown', block);\r
-\r
- or = ed.selection.getRng();\r
-\r
- // Move select contents inside DIV\r
- n = n.firstChild;\r
- rng = ed.getDoc().createRange();\r
- rng.setStart(n, 0);\r
- rng.setEnd(n, 2);\r
- sel.setRng(rng);\r
-\r
- // Wait a while and grab the pasted contents\r
- window.setTimeout(function() {\r
- var h = '', nl;\r
-\r
- // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit\r
- if (!dom.select('div.mcePaste > div.mcePaste').length) {\r
- nl = dom.select('div.mcePaste');\r
-\r
- // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string\r
- each(nl, function(n) {\r
- var child = n.firstChild;\r
-\r
- // WebKit inserts a DIV container with lots of odd styles\r
- if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) {\r
- dom.remove(child, 1);\r
- }\r
-\r
- // Remove apply style spans\r
- each(dom.select('span.Apple-style-span', n), function(n) {\r
- dom.remove(n, 1);\r
- });\r
-\r
- // Remove bogus br elements\r
- each(dom.select('br[data-mce-bogus]', n), function(n) {\r
- dom.remove(n);\r
- });\r
-\r
- // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV\r
- if (n.parentNode.className != 'mcePaste')\r
- h += n.innerHTML;\r
- });\r
- } else {\r
- // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc\r
- // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same\r
- h = '<p>' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '</p><p>').replace(/\r?\n/g, '<br />') + '</p>';\r
- }\r
-\r
- // Remove the nodes\r
- each(dom.select('div.mcePaste'), function(n) {\r
- dom.remove(n);\r
- });\r
-\r
- // Restore the old selection\r
- if (or)\r
- sel.setRng(or);\r
-\r
- process({content : h});\r
-\r
- // Unblock events ones we got the contents\r
- dom.unbind(ed.getDoc(), 'mousedown', block);\r
- dom.unbind(ed.getDoc(), 'keydown', block);\r
- }, 0);\r
- }\r
- }\r
-\r
- // Check if we should use the new auto process method \r
- if (getParam(ed, "paste_auto_cleanup_on_paste")) {\r
- // Is it's Opera or older FF use key handler\r
- if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {\r
- ed.onKeyDown.addToTop(function(ed, e) {\r
- if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))\r
- grabContent(e);\r
- });\r
- } else {\r
- // Grab contents on paste event on Gecko and WebKit\r
- ed.onPaste.addToTop(function(ed, e) {\r
- return grabContent(e);\r
- });\r
- }\r
- }\r
-\r
- ed.onInit.add(function() {\r
- ed.controlManager.setActive("pastetext", ed.pasteAsPlainText);\r
-\r
- // Block all drag/drop events\r
- if (getParam(ed, "paste_block_drop")) {\r
- ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {\r
- e.preventDefault();\r
- e.stopPropagation();\r
-\r
- return false;\r
- });\r
- }\r
- });\r
-\r
- // Add legacy support\r
- t._legacySupport();\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Paste text/word',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- _preProcess : function(pl, o) {\r
- var ed = this.editor,\r
- h = o.content,\r
- grep = tinymce.grep,\r
- explode = tinymce.explode,\r
- trim = tinymce.trim,\r
- len, stripClass;\r
-\r
- //console.log('Before preprocess:' + o.content);\r
-\r
- function process(items) {\r
- each(items, function(v) {\r
- // Remove or replace\r
- if (v.constructor == RegExp)\r
- h = h.replace(v, '');\r
- else\r
- h = h.replace(v[0], v[1]);\r
- });\r
- }\r
- \r
- if (ed.settings.paste_enable_default_filters == false) {\r
- return;\r
- }\r
-\r
- // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser\r
- if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) {\r
- // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser\r
- process([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g, '$1']]);\r
-\r
- // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break\r
- process([\r
- [/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact\r
- [/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s\r
- [/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR\r
- ]);\r
- }\r
-\r
- // Detect Word content and process it more aggressive\r
- if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {\r
- o.wordContent = true; // Mark the pasted contents as word specific content\r
- //console.log('Word contents detected.');\r
-\r
- // Process away some basic content\r
- process([\r
- /^\s*( )+/gi, // entities at the start of contents\r
- /( |<br[^>]*>)+\s*$/gi // entities at the end of contents\r
- ]);\r
-\r
- if (getParam(ed, "paste_convert_headers_to_strong")) {\r
- h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");\r
- }\r
-\r
- if (getParam(ed, "paste_convert_middot_lists")) {\r
- process([\r
- [/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker\r
- [/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers\r
- [/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF)\r
- ]);\r
- }\r
-\r
- process([\r
- // Word comments like conditional comments etc\r
- /<!--[\s\S]+?-->/gi,\r
-\r
- // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags\r
- /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,\r
-\r
- // Convert <s> into <strike> for line-though\r
- [/<(\/?)s>/gi, "<$1strike>"],\r
-\r
- // Replace nsbp entites to char since it's easier to handle\r
- [/ /gi, "\u00a0"]\r
- ]);\r
-\r
- // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.\r
- // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.\r
- do {\r
- len = h.length;\r
- h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");\r
- } while (len != h.length);\r
-\r
- // Remove all spans if no styles is to be retained\r
- if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {\r
- h = h.replace(/<\/?span[^>]*>/gi, "");\r
- } else {\r
- // We're keeping styles, so at least clean them up.\r
- // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx\r
-\r
- process([\r
- // Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length\r
- [/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,\r
- function(str, spaces) {\r
- return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";\r
- }\r
- ],\r
-\r
- // Examine all styles: delete junk, transform some, and keep the rest\r
- [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,\r
- function(str, tag, style) {\r
- var n = [],\r
- i = 0,\r
- s = explode(trim(style).replace(/"/gi, "'"), ";");\r
-\r
- // Examine each style definition within the tag's style attribute\r
- each(s, function(v) {\r
- var name, value,\r
- parts = explode(v, ":");\r
-\r
- function ensureUnits(v) {\r
- return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";\r
- }\r
-\r
- if (parts.length == 2) {\r
- name = parts[0].toLowerCase();\r
- value = parts[1].toLowerCase();\r
-\r
- // Translate certain MS Office styles into their CSS equivalents\r
- switch (name) {\r
- case "mso-padding-alt":\r
- case "mso-padding-top-alt":\r
- case "mso-padding-right-alt":\r
- case "mso-padding-bottom-alt":\r
- case "mso-padding-left-alt":\r
- case "mso-margin-alt":\r
- case "mso-margin-top-alt":\r
- case "mso-margin-right-alt":\r
- case "mso-margin-bottom-alt":\r
- case "mso-margin-left-alt":\r
- case "mso-table-layout-alt":\r
- case "mso-height":\r
- case "mso-width":\r
- case "mso-vertical-align-alt":\r
- n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);\r
- return;\r
-\r
- case "horiz-align":\r
- n[i++] = "text-align:" + value;\r
- return;\r
-\r
- case "vert-align":\r
- n[i++] = "vertical-align:" + value;\r
- return;\r
-\r
- case "font-color":\r
- case "mso-foreground":\r
- n[i++] = "color:" + value;\r
- return;\r
-\r
- case "mso-background":\r
- case "mso-highlight":\r
- n[i++] = "background:" + value;\r
- return;\r
-\r
- case "mso-default-height":\r
- n[i++] = "min-height:" + ensureUnits(value);\r
- return;\r
-\r
- case "mso-default-width":\r
- n[i++] = "min-width:" + ensureUnits(value);\r
- return;\r
-\r
- case "mso-padding-between-alt":\r
- n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);\r
- return;\r
-\r
- case "text-line-through":\r
- if ((value == "single") || (value == "double")) {\r
- n[i++] = "text-decoration:line-through";\r
- }\r
- return;\r
-\r
- case "mso-zero-height":\r
- if (value == "yes") {\r
- n[i++] = "display:none";\r
- }\r
- return;\r
- }\r
-\r
- // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name\r
- if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) {\r
- return;\r
- }\r
-\r
- // If it reached this point, it must be a valid CSS style\r
- n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case\r
- }\r
- });\r
-\r
- // If style attribute contained any valid styles the re-write it; otherwise delete style attribute.\r
- if (i > 0) {\r
- return tag + ' style="' + n.join(';') + '"';\r
- } else {\r
- return tag;\r
- }\r
- }\r
- ]\r
- ]);\r
- }\r
- }\r
-\r
- // Replace headers with <strong>\r
- if (getParam(ed, "paste_convert_headers_to_strong")) {\r
- process([\r
- [/<h[1-6][^>]*>/gi, "<p><strong>"],\r
- [/<\/h[1-6][^>]*>/gi, "</strong></p>"]\r
- ]);\r
- }\r
-\r
- process([\r
- // Copy paste from Java like Open Office will produce this junk on FF\r
- [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, '']\r
- ]);\r
-\r
- // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").\r
- // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.\r
- stripClass = getParam(ed, "paste_strip_class_attributes");\r
-\r
- if (stripClass !== "none") {\r
- function removeClasses(match, g1) {\r
- if (stripClass === "all")\r
- return '';\r
-\r
- var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),\r
- function(v) {\r
- return (/^(?!mso)/i.test(v));\r
- }\r
- );\r
-\r
- return cls.length ? ' class="' + cls.join(" ") + '"' : '';\r
- };\r
-\r
- h = h.replace(/ class="([^"]+)"/gi, removeClasses);\r
- h = h.replace(/ class=([\-\w]+)/gi, removeClasses);\r
- }\r
-\r
- // Remove spans option\r
- if (getParam(ed, "paste_remove_spans")) {\r
- h = h.replace(/<\/?span[^>]*>/gi, "");\r
- }\r
-\r
- //console.log('After preprocess:' + h);\r
-\r
- o.content = h;\r
- },\r
-\r
- /**\r
- * Various post process items.\r
- */\r
- _postProcess : function(pl, o) {\r
- var t = this, ed = t.editor, dom = ed.dom, styleProps;\r
-\r
- if (ed.settings.paste_enable_default_filters == false) {\r
- return;\r
- }\r
- \r
- if (o.wordContent) {\r
- // Remove named anchors or TOC links\r
- each(dom.select('a', o.node), function(a) {\r
- if (!a.href || a.href.indexOf('#_Toc') != -1)\r
- dom.remove(a, 1);\r
- });\r
-\r
- if (getParam(ed, "paste_convert_middot_lists")) {\r
- t._convertLists(pl, o);\r
- }\r
-\r
- // Process styles\r
- styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties\r
-\r
- // Process only if a string was specified and not equal to "all" or "*"\r
- if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) {\r
- styleProps = tinymce.explode(styleProps.replace(/^none$/i, ""));\r
-\r
- // Retains some style properties\r
- each(dom.select('*', o.node), function(el) {\r
- var newStyle = {}, npc = 0, i, sp, sv;\r
-\r
- // Store a subset of the existing styles\r
- if (styleProps) {\r
- for (i = 0; i < styleProps.length; i++) {\r
- sp = styleProps[i];\r
- sv = dom.getStyle(el, sp);\r
-\r
- if (sv) {\r
- newStyle[sp] = sv;\r
- npc++;\r
- }\r
- }\r
- }\r
-\r
- // Remove all of the existing styles\r
- dom.setAttrib(el, 'style', '');\r
-\r
- if (styleProps && npc > 0)\r
- dom.setStyles(el, newStyle); // Add back the stored subset of styles\r
- else // Remove empty span tags that do not have class attributes\r
- if (el.nodeName == 'SPAN' && !el.className)\r
- dom.remove(el, true);\r
- });\r
- }\r
- }\r
-\r
- // Remove all style information or only specifically on WebKit to avoid the style bug on that browser\r
- if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) {\r
- each(dom.select('*[style]', o.node), function(el) {\r
- el.removeAttribute('style');\r
- el.removeAttribute('data-mce-style');\r
- });\r
- } else {\r
- if (tinymce.isWebKit) {\r
- // We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." />\r
- // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles\r
- each(dom.select('*', o.node), function(el) {\r
- el.removeAttribute('data-mce-style');\r
- });\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Converts the most common bullet and number formats in Office into a real semantic UL/LI list.\r
- */\r
- _convertLists : function(pl, o) {\r
- var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;\r
-\r
- // Convert middot lists into real semantic lists\r
- each(dom.select('p', o.node), function(p) {\r
- var sib, val = '', type, html, idx, parents;\r
-\r
- // Get text node value at beginning of paragraph\r
- for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)\r
- val += sib.nodeValue;\r
-\r
- val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0');\r
-\r
- // Detect unordered lists look for bullets\r
- if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val))\r
- type = 'ul';\r
-\r
- // Detect ordered lists 1., a. or ixv.\r
- if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val))\r
- type = 'ol';\r
-\r
- // Check if node value matches the list pattern: o \r
- if (type) {\r
- margin = parseFloat(p.style.marginLeft || 0);\r
-\r
- if (margin > lastMargin)\r
- levels.push(margin);\r
-\r
- if (!listElm || type != lastType) {\r
- listElm = dom.create(type);\r
- dom.insertAfter(listElm, p);\r
- } else {\r
- // Nested list element\r
- if (margin > lastMargin) {\r
- listElm = li.appendChild(dom.create(type));\r
- } else if (margin < lastMargin) {\r
- // Find parent level based on margin value\r
- idx = tinymce.inArray(levels, margin);\r
- parents = dom.getParents(listElm.parentNode, type);\r
- listElm = parents[parents.length - 1 - idx] || listElm;\r
- }\r
- }\r
-\r
- // Remove middot or number spans if they exists\r
- each(dom.select('span', p), function(span) {\r
- var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');\r
-\r
- // Remove span with the middot or the number\r
- if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html))\r
- dom.remove(span);\r
- else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html))\r
- dom.remove(span);\r
- });\r
-\r
- html = p.innerHTML;\r
-\r
- // Remove middot/list items\r
- if (type == 'ul')\r
- html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, '');\r
- else\r
- html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, '');\r
-\r
- // Create li and add paragraph data into the new li\r
- li = listElm.appendChild(dom.create('li', 0, html));\r
- dom.remove(p);\r
-\r
- lastMargin = margin;\r
- lastType = type;\r
- } else\r
- listElm = lastMargin = 0; // End list element\r
- });\r
-\r
- // Remove any left over makers\r
- html = o.node.innerHTML;\r
- if (html.indexOf('__MCE_ITEM__') != -1)\r
- o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');\r
- },\r
-\r
- /**\r
- * Inserts the specified contents at the caret position.\r
- */\r
- _insert : function(h, skip_undo) {\r
- var ed = this.editor, r = ed.selection.getRng();\r
-\r
- // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells.\r
- if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer)\r
- ed.getDoc().execCommand('Delete', false, null);\r
-\r
- ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo});\r
- },\r
-\r
- /**\r
- * Instead of the old plain text method which tried to re-create a paste operation, the\r
- * new approach adds a plain text mode toggle switch that changes the behavior of paste.\r
- * This function is passed the same input that the regular paste plugin produces.\r
- * It performs additional scrubbing and produces (and inserts) the plain text.\r
- * This approach leverages all of the great existing functionality in the paste\r
- * plugin, and requires minimal changes to add the new functionality.\r
- * Speednet - June 2009\r
- */\r
- _insertPlainText : function(content) {\r
- var ed = this.editor,\r
- linebr = getParam(ed, "paste_text_linebreaktype"),\r
- rl = getParam(ed, "paste_text_replacements"),\r
- is = tinymce.is;\r
-\r
- function process(items) {\r
- each(items, function(v) {\r
- if (v.constructor == RegExp)\r
- content = content.replace(v, "");\r
- else\r
- content = content.replace(v[0], v[1]);\r
- });\r
- };\r
-\r
- if ((typeof(content) === "string") && (content.length > 0)) {\r
- // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line\r
- if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) {\r
- process([\r
- /[\n\r]+/g\r
- ]);\r
- } else {\r
- // Otherwise just get rid of carriage returns (only need linefeeds)\r
- process([\r
- /\r+/g\r
- ]);\r
- }\r
-\r
- process([\r
- [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them\r
- [/<br[^>]*>|<\/tr>/gi, "\n"], // Single linebreak for <br /> tags and table rows\r
- [/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them\r
- /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags\r
- [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)\r
- [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars.\r
- ]);\r
-\r
- var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks"));\r
- if (maxLinebreaks > -1) {\r
- var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g");\r
- var linebreakReplacement = "";\r
-\r
- while (linebreakReplacement.length < maxLinebreaks) {\r
- linebreakReplacement += "\n";\r
- }\r
-\r
- process([\r
- [maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks\r
- ]);\r
- }\r
-\r
- content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content));\r
-\r
- // Perform default or custom replacements\r
- if (is(rl, "array")) {\r
- process(rl);\r
- } else if (is(rl, "string")) {\r
- process(new RegExp(rl, "gi"));\r
- }\r
-\r
- // Treat paragraphs as specified in the config\r
- if (linebr == "none") {\r
- // Convert all line breaks to space\r
- process([\r
- [/\n+/g, " "]\r
- ]);\r
- } else if (linebr == "br") {\r
- // Convert all line breaks to <br />\r
- process([\r
- [/\n/g, "<br />"]\r
- ]);\r
- } else if (linebr == "p") {\r
- // Convert all line breaks to <p>...</p>\r
- process([\r
- [/\n+/g, "</p><p>"],\r
- [/^(.*<\/p>)(<p>)$/, '<p>$1']\r
- ]);\r
- } else {\r
- // defaults to "combined"\r
- // Convert single line breaks to <br /> and double line breaks to <p>...</p>\r
- process([\r
- [/\n\n/g, "</p><p>"],\r
- [/^(.*<\/p>)(<p>)$/, '<p>$1'],\r
- [/\n/g, "<br />"]\r
- ]);\r
- }\r
-\r
- ed.execCommand('mceInsertContent', false, content);\r
- }\r
- },\r
-\r
- /**\r
- * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.\r
- */\r
- _legacySupport : function() {\r
- var t = this, ed = t.editor;\r
-\r
- // Register command(s) for backwards compatibility\r
- ed.addCommand("mcePasteWord", function() {\r
- ed.windowManager.open({\r
- file: t.url + "/pasteword.htm",\r
- width: parseInt(getParam(ed, "paste_dialog_width")),\r
- height: parseInt(getParam(ed, "paste_dialog_height")),\r
- inline: 1\r
- });\r
- });\r
-\r
- if (getParam(ed, "paste_text_use_dialog")) {\r
- ed.addCommand("mcePasteText", function() {\r
- ed.windowManager.open({\r
- file : t.url + "/pastetext.htm",\r
- width: parseInt(getParam(ed, "paste_dialog_width")),\r
- height: parseInt(getParam(ed, "paste_dialog_height")),\r
- inline : 1\r
- });\r
- });\r
- }\r
-\r
- // Register button for backwards compatibility\r
- ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"});\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin);\r
-})();\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var PasteTextDialog = {\r
- init : function() {\r
- this.resize();\r
- },\r
-\r
- insert : function() {\r
- var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;\r
-\r
- // Convert linebreaks into paragraphs\r
- if (document.getElementById('linebreaks').checked) {\r
- lines = h.split(/\r?\n/);\r
- if (lines.length > 1) {\r
- h = '';\r
- tinymce.each(lines, function(row) {\r
- h += '<p>' + row + '</p>';\r
- });\r
- }\r
- }\r
-\r
- tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h});\r
- tinyMCEPopup.close();\r
- },\r
-\r
- resize : function() {\r
- var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
-\r
- el = document.getElementById('content');\r
-\r
- el.style.width = (vp.w - 20) + 'px';\r
- el.style.height = (vp.h - 90) + 'px';\r
- }\r
-};\r
-\r
-tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var PasteWordDialog = {\r
- init : function() {\r
- var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = '';\r
-\r
- // Create iframe\r
- el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>';\r
- ifr = document.getElementById('iframe');\r
- doc = ifr.contentWindow.document;\r
-\r
- // Force absolute CSS urls\r
- css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];\r
- css = css.concat(tinymce.explode(ed.settings.content_css) || []);\r
- tinymce.each(css, function(u) {\r
- cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />';\r
- });\r
-\r
- // Write content into iframe\r
- doc.open();\r
- doc.write('<html><head>' + cssHTML + '</head><body class="mceContentBody" spellcheck="false"></body></html>');\r
- doc.close();\r
-\r
- doc.designMode = 'on';\r
- this.resize();\r
-\r
- window.setTimeout(function() {\r
- ifr.contentWindow.focus();\r
- }, 10);\r
- },\r
-\r
- insert : function() {\r
- var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;\r
-\r
- tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true});\r
- tinyMCEPopup.close();\r
- },\r
-\r
- resize : function() {\r
- var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
-\r
- el = document.getElementById('iframe');\r
-\r
- if (el) {\r
- el.style.width = (vp.w - 20) + 'px';\r
- el.style.height = (vp.h - 90) + 'px';\r
- }\r
- }\r
-};\r
-\r
-tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog);\r
+++ /dev/null
-tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."});
\ No newline at end of file
+++ /dev/null
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#paste.paste_text_desc}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/pastetext.js"></script>\r
-</head>\r
-<body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">\r
- <form name="source" onsubmit="return PasteTextDialog.insert();" action="#">\r
- <div style="float: left" class="title">{#paste.paste_text_desc}</div>\r
-\r
- <div style="float: right">\r
- <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>\r
- </div>\r
-\r
- <br style="clear: both" />\r
-\r
- <div>{#paste_dlg.text_title}</div>\r
-\r
- <textarea id="content" name="content" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" name="insert" value="{#insert}" id="insert" />\r
- <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />\r
- </div>\r
- </form>\r
-</body> \r
-</html>
\ No newline at end of file
+++ /dev/null
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#paste.paste_word_desc}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/pasteword.js"></script>\r
-</head>\r
-<body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">\r
- <form name="source" onsubmit="return PasteWordDialog.insert();" action="#">\r
- <div class="title">{#paste.paste_word_desc}</div>\r
-\r
- <div>{#paste_dlg.word_title}</div>\r
-\r
- <div id="iframecontainer"></div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
- </form>\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})();
\ No newline at end of file
+++ /dev/null
-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- tinymce.create('tinymce.plugins.Preview', {
- init : function(ed, url) {
- var t = this, css = tinymce.explode(ed.settings.content_css);
-
- t.editor = ed;
-
- // Force absolute CSS urls
- tinymce.each(css, function(u, k) {
- css[k] = ed.documentBaseURI.toAbsolute(u);
- });
-
- ed.addCommand('mcePreview', function() {
- ed.windowManager.open({
- file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
- width : parseInt(ed.getParam("plugin_preview_width", "550")),
- height : parseInt(ed.getParam("plugin_preview_height", "600")),
- resizable : "yes",
- scrollbars : "yes",
- popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
- inline : ed.getParam("plugin_preview_inline", 1)
- }, {
- base : ed.documentBaseURI.getURI()
- });
- });
-
- ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
- },
-
- getInfo : function() {
- return {
- longname : 'Preview',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
-})();
\ No newline at end of file
+++ /dev/null
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<script language="javascript" src="../../tiny_mce_popup.js"></script>\r
-<script type="text/javascript" src="jscripts/embed.js"></script>\r
-<script type="text/javascript">\r
-tinyMCEPopup.onInit.add(function(ed) {\r
- var dom = tinyMCEPopup.dom;\r
-\r
- // Load editor content_css\r
- tinymce.each(ed.settings.content_css.split(','), function(u) {\r
- dom.loadCSS(ed.documentBaseURI.toAbsolute(u));\r
- });\r
-\r
- // Place contents inside div container\r
- dom.setHTML('content', ed.getContent());\r
-});\r
-</script>\r
-<title>Example of a custom preview page</title>\r
-</head>\r
-<body>\r
-\r
-Editor contents: <br />\r
-<div id="content">\r
-<!-- Gets filled with editor contents -->\r
-</div>\r
-\r
-</body>\r
-</html>\r
+++ /dev/null
-/**\r
- * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.\r
- */\r
-\r
-function writeFlash(p) {\r
- writeEmbed(\r
- 'D27CDB6E-AE6D-11cf-96B8-444553540000',\r
- 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
- 'application/x-shockwave-flash',\r
- p\r
- );\r
-}\r
-\r
-function writeShockWave(p) {\r
- writeEmbed(\r
- '166B1BCA-3F9C-11CF-8075-444553540000',\r
- 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',\r
- 'application/x-director',\r
- p\r
- );\r
-}\r
-\r
-function writeQuickTime(p) {\r
- writeEmbed(\r
- '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',\r
- 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',\r
- 'video/quicktime',\r
- p\r
- );\r
-}\r
-\r
-function writeRealMedia(p) {\r
- writeEmbed(\r
- 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',\r
- 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
- 'audio/x-pn-realaudio-plugin',\r
- p\r
- );\r
-}\r
-\r
-function writeWindowsMedia(p) {\r
- p.url = p.src;\r
- writeEmbed(\r
- '6BF52A52-394A-11D3-B153-00C04F79FAA6',\r
- 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',\r
- 'application/x-mplayer2',\r
- p\r
- );\r
-}\r
-\r
-function writeEmbed(cls, cb, mt, p) {\r
- var h = '', n;\r
-\r
- h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';\r
- h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';\r
- h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';\r
- h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';\r
- h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';\r
- h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';\r
- h += '>';\r
-\r
- for (n in p)\r
- h += '<param name="' + n + '" value="' + p[n] + '">';\r
-\r
- h += '<embed type="' + mt + '"';\r
-\r
- for (n in p)\r
- h += n + '="' + p[n] + '" ';\r
-\r
- h += '></embed></object>';\r
-\r
- document.write(h);\r
-}\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
-<script type="text/javascript" src="jscripts/embed.js"></script>\r
-<script type="text/javascript"><!--\r
-document.write('<base href="' + tinyMCEPopup.getWindowArg("base") + '">');\r
-// -->\r
-</script>\r
-<title>{#preview.preview_desc}</title>\r
-</head>\r
-<body id="content">\r
-<script type="text/javascript">\r
- document.write(tinyMCEPopup.editor.getContent());\r
-</script>\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.Print', {\r
- init : function(ed, url) {\r
- ed.addCommand('mcePrint', function() {\r
- ed.getWin().print();\r
- });\r
-\r
- ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'});\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Print',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('print', tinymce.plugins.Print);\r
-})();\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.Save', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
-\r
- // Register commands\r
- ed.addCommand('mceSave', t._save, t);\r
- ed.addCommand('mceCancel', t._cancel, t);\r
-\r
- // Register buttons\r
- ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'});\r
- ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'});\r
-\r
- ed.onNodeChange.add(t._nodeChange, t);\r
- ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave');\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Save',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- // Private methods\r
-\r
- _nodeChange : function(ed, cm, n) {\r
- var ed = this.editor;\r
-\r
- if (ed.getParam('save_enablewhendirty')) {\r
- cm.setDisabled('save', !ed.isDirty());\r
- cm.setDisabled('cancel', !ed.isDirty());\r
- }\r
- },\r
-\r
- // Private methods\r
-\r
- _save : function() {\r
- var ed = this.editor, formObj, os, i, elementId;\r
-\r
- formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form');\r
-\r
- if (ed.getParam("save_enablewhendirty") && !ed.isDirty())\r
- return;\r
-\r
- tinyMCE.triggerSave();\r
-\r
- // Use callback instead\r
- if (os = ed.getParam("save_onsavecallback")) {\r
- if (ed.execCallback('save_onsavecallback', ed)) {\r
- ed.startContent = tinymce.trim(ed.getContent({format : 'raw'}));\r
- ed.nodeChanged();\r
- }\r
-\r
- return;\r
- }\r
-\r
- if (formObj) {\r
- ed.isNotDirty = true;\r
-\r
- if (formObj.onsubmit == null || formObj.onsubmit() != false)\r
- formObj.submit();\r
-\r
- ed.nodeChanged();\r
- } else\r
- ed.windowManager.alert("Error: No form element found.");\r
- },\r
-\r
- _cancel : function() {\r
- var ed = this.editor, os, h = tinymce.trim(ed.startContent);\r
-\r
- // Use callback instead\r
- if (os = ed.getParam("save_oncancelcallback")) {\r
- ed.execCallback('save_oncancelcallback', ed);\r
- return;\r
- }\r
-\r
- ed.setContent(h);\r
- ed.undoManager.clear();\r
- ed.nodeChanged();\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('save', tinymce.plugins.Save);\r
-})();
\ No newline at end of file
+++ /dev/null
-.panel_wrapper {height:85px;}\r
-.panel_wrapper div.current {height:85px;}\r
-\r
-/* IE */\r
-* html .panel_wrapper {height:100px;}\r
-* html .panel_wrapper div.current {height:100px;}\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.SearchReplacePlugin', {\r
- init : function(ed, url) {\r
- function open(m) {\r
- // Keep IE from writing out the f/r character to the editor\r
- // instance while initializing a new dialog. See: #3131190\r
- window.focus();\r
-\r
- ed.windowManager.open({\r
- file : url + '/searchreplace.htm',\r
- width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),\r
- height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)),\r
- inline : 1,\r
- auto_focus : 0\r
- }, {\r
- mode : m,\r
- search_string : ed.selection.getContent({format : 'text'}),\r
- plugin_url : url\r
- });\r
- };\r
-\r
- // Register commands\r
- ed.addCommand('mceSearch', function() {\r
- open('search');\r
- });\r
-\r
- ed.addCommand('mceReplace', function() {\r
- open('replace');\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});\r
- ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});\r
-\r
- ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Search/Replace',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var SearchReplaceDialog = {\r
- init : function(ed) {\r
- var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");\r
-\r
- t.switchMode(m);\r
-\r
- f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");\r
-\r
- // Focus input field\r
- f[m + '_panel_searchstring'].focus();\r
- \r
- mcTabs.onChange.add(function(tab_id, panel_id) {\r
- t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));\r
- });\r
- },\r
-\r
- switchMode : function(m) {\r
- var f, lm = this.lastMode;\r
-\r
- if (lm != m) {\r
- f = document.forms[0];\r
-\r
- if (lm) {\r
- f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;\r
- f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;\r
- f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;\r
- f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;\r
- }\r
-\r
- mcTabs.displayTab(m + '_tab', m + '_panel');\r
- document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";\r
- document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";\r
- this.lastMode = m;\r
- }\r
- },\r
-\r
- searchNext : function(a) {\r
- var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;\r
-\r
- // Get input\r
- f = document.forms[0];\r
- s = f[m + '_panel_searchstring'].value;\r
- b = f[m + '_panel_backwardsu'].checked;\r
- ca = f[m + '_panel_casesensitivebox'].checked;\r
- rs = f['replace_panel_replacestring'].value;\r
-\r
- if (tinymce.isIE) {\r
- r = ed.getDoc().selection.createRange();\r
- }\r
-\r
- if (s == '')\r
- return;\r
-\r
- function fix() {\r
- // Correct Firefox graphics glitches\r
- // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? \r
- r = se.getRng().cloneRange();\r
- ed.getDoc().execCommand('SelectAll', false, null);\r
- se.setRng(r);\r
- };\r
-\r
- function replace() {\r
- ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE\r
- };\r
-\r
- // IE flags\r
- if (ca)\r
- fl = fl | 4;\r
-\r
- switch (a) {\r
- case 'all':\r
- // Move caret to beginning of text\r
- ed.execCommand('SelectAll');\r
- ed.selection.collapse(true);\r
-\r
- if (tinymce.isIE) {\r
- ed.focus();\r
- r = ed.getDoc().selection.createRange();\r
-\r
- while (r.findText(s, b ? -1 : 1, fl)) {\r
- r.scrollIntoView();\r
- r.select();\r
- replace();\r
- fo = 1;\r
-\r
- if (b) {\r
- r.moveEnd("character", -(rs.length)); // Otherwise will loop forever\r
- }\r
- }\r
-\r
- tinyMCEPopup.storeSelection();\r
- } else {\r
- while (w.find(s, ca, b, false, false, false, false)) {\r
- replace();\r
- fo = 1;\r
- }\r
- }\r
-\r
- if (fo)\r
- tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));\r
- else\r
- tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
-\r
- return;\r
-\r
- case 'current':\r
- if (!ed.selection.isCollapsed())\r
- replace();\r
-\r
- break;\r
- }\r
-\r
- se.collapse(b);\r
- r = se.getRng();\r
-\r
- // Whats the point\r
- if (!s)\r
- return;\r
-\r
- if (tinymce.isIE) {\r
- ed.focus();\r
- r = ed.getDoc().selection.createRange();\r
-\r
- if (r.findText(s, b ? -1 : 1, fl)) {\r
- r.scrollIntoView();\r
- r.select();\r
- } else\r
- tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
-\r
- tinyMCEPopup.storeSelection();\r
- } else {\r
- if (!w.find(s, ca, b, false, false, false, false))\r
- tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
- else\r
- fix();\r
- }\r
- }\r
-};\r
-\r
-tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);\r
+++ /dev/null
-tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#searchreplace_dlg.replace_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="js/searchreplace.js"></script>\r
- <link rel="stylesheet" type="text/css" href="css/searchreplace.css" />\r
-</head>\r
-<body style="display:none;" role="application" aria-labelledby="app_title">\r
-<span id="app_title" style="display:none">{#searchreplace_dlg.replace_title}</span>\r
-<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="search_tab" aria-controls="search_panel"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>\r
- <li id="replace_tab" aria-controls="replace_panel"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="search_panel" class="panel">\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="2">\r
- <tr>\r
- <td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>\r
- <td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" aria-required="true" /></td>\r
- </tr>\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0" class="direction">\r
- <tr role="group" aria-labelledby="search_panel_backwards_label">\r
- <td><label id="search_panel_backwards_label">{#searchreplace_dlg.direction}</label></td>\r
- <td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>\r
- <td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>\r
- <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>\r
- <td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>\r
- <td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
- </div>\r
-\r
- <div id="replace_panel" class="panel">\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="2">\r
- <tr>\r
- <td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>\r
- <td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" aria-required="true" /></td>\r
- </tr>\r
- <tr>\r
- <td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>\r
- <td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" aria-required="true" /></td>\r
- </tr>\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0" class="direction">\r
- <tr role="group" aria-labelledby="replace_panel_dir_label">\r
- <td><label id="replace_panel_dir_label">{#searchreplace_dlg.direction}</label></td>\r
- <td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>\r
- <td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>\r
- <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>\r
- <td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td colspan="2">\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>\r
- <td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- </table>\r
- </div>\r
-\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />\r
- <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />\r
- <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />\r
- <input type="button" id="cancel" name="close" value="{#close}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;}\r
+++ /dev/null
-(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+"/css/content.css")}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d="",f={},h=[];this._walk(e.getBody(),function(i){if(i.nodeType==3){d+=i.nodeValue+" "}});if(e.getParam("spellchecker_word_pattern")){h=d.match("("+e.getParam("spellchecker_word_pattern")+")","gi")}else{d=d.replace(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));h=d.split(" ")}c(h,function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(d){var e=this.editor,h=e.dom,g=e.selection,f=g.getRng(true);c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!d||h.decode(i.innerHTML)==d){h.remove(i,1)}}});g.setRng(f)},_markWords:function(l){var h=this.editor,g=h.dom,j=h.getDoc(),i=h.selection,d=i.getRng(true),e=[],k=l.join("|"),m=this._getSeparators(),f=new RegExp("(^|["+m+"])("+k+")(?=["+m+"]|$)","g");this._walk(h.getBody(),function(o){if(o.nodeType==3){e.push(o)}});c(e,function(t){var r,q,o,s,p=t.nodeValue;if(f.test(p)){p=g.encode(p);q=g.create("span",{"class":"mceItemHidden"});if(tinymce.isIE){p=p.replace(f,"$1<mcespell>$2</mcespell>");while((s=p.indexOf("<mcespell>"))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(g.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("</mcespell>");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(g.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(g.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(f,'$1<span class="mceItemHiddenSpellWord">$2</span>')}g.replace(q,t)}});i.setRng(d)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}if(h.getParam("show_ignore_words",true)){e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM;\r
-\r
- tinymce.create('tinymce.plugins.SpellcheckerPlugin', {\r
- getInfo : function() {\r
- return {\r
- longname : 'Spellchecker',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- init : function(ed, url) {\r
- var t = this, cm;\r
-\r
- t.url = url;\r
- t.editor = ed;\r
- t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}");\r
-\r
- if (t.rpcUrl == '{backend}') {\r
- // Sniff if the browser supports native spellchecking (Don't know of a better way)\r
- if (tinymce.isIE)\r
- return;\r
-\r
- t.hasSupport = true;\r
-\r
- // Disable the context menu when spellchecking is active\r
- ed.onContextMenu.addToTop(function(ed, e) {\r
- if (t.active)\r
- return false;\r
- });\r
- }\r
-\r
- // Register commands\r
- ed.addCommand('mceSpellCheck', function() {\r
- if (t.rpcUrl == '{backend}') {\r
- // Enable/disable native spellchecker\r
- t.editor.getBody().spellcheck = t.active = !t.active;\r
- return;\r
- }\r
-\r
- if (!t.active) {\r
- ed.setProgressState(1);\r
- t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) {\r
- if (r.length > 0) {\r
- t.active = 1;\r
- t._markWords(r);\r
- ed.setProgressState(0);\r
- ed.nodeChanged();\r
- } else {\r
- ed.setProgressState(0);\r
-\r
- if (ed.getParam('spellchecker_report_no_misspellings', true))\r
- ed.windowManager.alert('spellchecker.no_mpell');\r
- }\r
- });\r
- } else\r
- t._done();\r
- });\r
-\r
- if (ed.settings.content_css !== false)\r
- ed.contentCSS.push(url + '/css/content.css');\r
-\r
- ed.onClick.add(t._showMenu, t);\r
- ed.onContextMenu.add(t._showMenu, t);\r
- ed.onBeforeGetContent.add(function() {\r
- if (t.active)\r
- t._removeWords();\r
- });\r
-\r
- ed.onNodeChange.add(function(ed, cm) {\r
- cm.setActive('spellchecker', t.active);\r
- });\r
-\r
- ed.onSetContent.add(function() {\r
- t._done();\r
- });\r
-\r
- ed.onBeforeGetContent.add(function() {\r
- t._done();\r
- });\r
-\r
- ed.onBeforeExecCommand.add(function(ed, cmd) {\r
- if (cmd == 'mceFullScreen')\r
- t._done();\r
- });\r
-\r
- // Find selected language\r
- t.languages = {};\r
- each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) {\r
- if (k.indexOf('+') === 0) {\r
- k = k.substring(1);\r
- t.selectedLang = v;\r
- }\r
-\r
- t.languages[k] = v;\r
- });\r
- },\r
-\r
- createControl : function(n, cm) {\r
- var t = this, c, ed = t.editor;\r
-\r
- if (n == 'spellchecker') {\r
- // Use basic button if we use the native spellchecker\r
- if (t.rpcUrl == '{backend}') {\r
- // Create simple toggle button if we have native support\r
- if (t.hasSupport)\r
- c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});\r
-\r
- return c;\r
- }\r
-\r
- c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});\r
-\r
- c.onRenderMenu.add(function(c, m) {\r
- m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
- each(t.languages, function(v, k) {\r
- var o = {icon : 1}, mi;\r
-\r
- o.onclick = function() {\r
- if (v == t.selectedLang) {\r
- return;\r
- }\r
- mi.setSelected(1);\r
- t.selectedItem.setSelected(0);\r
- t.selectedItem = mi;\r
- t.selectedLang = v;\r
- };\r
-\r
- o.title = k;\r
- mi = m.add(o);\r
- mi.setSelected(v == t.selectedLang);\r
-\r
- if (v == t.selectedLang)\r
- t.selectedItem = mi;\r
- })\r
- });\r
-\r
- return c;\r
- }\r
- },\r
-\r
- // Internal functions\r
-\r
- _walk : function(n, f) {\r
- var d = this.editor.getDoc(), w;\r
-\r
- if (d.createTreeWalker) {\r
- w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);\r
-\r
- while ((n = w.nextNode()) != null)\r
- f.call(this, n);\r
- } else\r
- tinymce.walk(n, f, 'childNodes');\r
- },\r
-\r
- _getSeparators : function() {\r
- var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');\r
-\r
- // Build word separator regexp\r
- for (i=0; i<str.length; i++)\r
- re += '\\' + str.charAt(i);\r
-\r
- return re;\r
- },\r
-\r
- _getWords : function() {\r
- var ed = this.editor, wl = [], tx = '', lo = {}, rawWords = [];\r
-\r
- // Get area text\r
- this._walk(ed.getBody(), function(n) {\r
- if (n.nodeType == 3)\r
- tx += n.nodeValue + ' ';\r
- });\r
-\r
- // split the text up into individual words\r
- if (ed.getParam('spellchecker_word_pattern')) {\r
- // look for words that match the pattern\r
- rawWords = tx.match('(' + ed.getParam('spellchecker_word_pattern') + ')', 'gi');\r
- } else {\r
- // Split words by separator\r
- tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' ');\r
- tx = tinymce.trim(tx.replace(/(\s+)/g, ' '));\r
- rawWords = tx.split(' ');\r
- }\r
-\r
- // Build word array and remove duplicates\r
- each(rawWords, function(v) {\r
- if (!lo[v]) {\r
- wl.push(v);\r
- lo[v] = 1;\r
- }\r
- });\r
-\r
- return wl;\r
- },\r
-\r
- _removeWords : function(w) {\r
- var ed = this.editor, dom = ed.dom, se = ed.selection, r = se.getRng(true);\r
-\r
- each(dom.select('span').reverse(), function(n) {\r
- if (n && (dom.hasClass(n, 'mceItemHiddenSpellWord') || dom.hasClass(n, 'mceItemHidden'))) {\r
- if (!w || dom.decode(n.innerHTML) == w)\r
- dom.remove(n, 1);\r
- }\r
- });\r
-\r
- se.setRng(r);\r
- },\r
-\r
- _markWords : function(wl) {\r
- var ed = this.editor, dom = ed.dom, doc = ed.getDoc(), se = ed.selection, r = se.getRng(true), nl = [],\r
- w = wl.join('|'), re = this._getSeparators(), rx = new RegExp('(^|[' + re + '])(' + w + ')(?=[' + re + ']|$)', 'g');\r
-\r
- // Collect all text nodes\r
- this._walk(ed.getBody(), function(n) {\r
- if (n.nodeType == 3) {\r
- nl.push(n);\r
- }\r
- });\r
-\r
- // Wrap incorrect words in spans\r
- each(nl, function(n) {\r
- var node, elem, txt, pos, v = n.nodeValue;\r
-\r
- if (rx.test(v)) {\r
- // Encode the content\r
- v = dom.encode(v);\r
- // Create container element\r
- elem = dom.create('span', {'class' : 'mceItemHidden'});\r
-\r
- // Following code fixes IE issues by creating text nodes\r
- // using DOM methods instead of innerHTML.\r
- // Bug #3124: <PRE> elements content is broken after spellchecking.\r
- // Bug #1408: Preceding whitespace characters are removed\r
- // @TODO: I'm not sure that both are still issues on IE9.\r
- if (tinymce.isIE) {\r
- // Enclose mispelled words with temporal tag\r
- v = v.replace(rx, '$1<mcespell>$2</mcespell>');\r
- // Loop over the content finding mispelled words\r
- while ((pos = v.indexOf('<mcespell>')) != -1) {\r
- // Add text node for the content before the word\r
- txt = v.substring(0, pos);\r
- if (txt.length) {\r
- node = doc.createTextNode(dom.decode(txt));\r
- elem.appendChild(node);\r
- }\r
- v = v.substring(pos+10);\r
- pos = v.indexOf('</mcespell>');\r
- txt = v.substring(0, pos);\r
- v = v.substring(pos+11);\r
- // Add span element for the word\r
- elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt));\r
- }\r
- // Add text node for the rest of the content\r
- if (v.length) {\r
- node = doc.createTextNode(dom.decode(v));\r
- elem.appendChild(node);\r
- }\r
- } else {\r
- // Other browsers preserve whitespace characters on innerHTML usage\r
- elem.innerHTML = v.replace(rx, '$1<span class="mceItemHiddenSpellWord">$2</span>');\r
- }\r
-\r
- // Finally, replace the node with the container\r
- dom.replace(elem, n);\r
- }\r
- });\r
-\r
- se.setRng(r);\r
- },\r
-\r
- _showMenu : function(ed, e) {\r
- var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target;\r
-\r
- e = 0; // Fixes IE memory leak\r
-\r
- if (!m) {\r
- m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'});\r
- t._menu = m;\r
- }\r
-\r
- if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) {\r
- m.removeAll();\r
- m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
-\r
- t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) {\r
- var ignoreRpc;\r
-\r
- m.removeAll();\r
-\r
- if (r.length > 0) {\r
- m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
- each(r, function(v) {\r
- m.add({title : v, onclick : function() {\r
- dom.replace(ed.getDoc().createTextNode(v), wordSpan);\r
- t._checkDone();\r
- }});\r
- });\r
-\r
- m.addSeparator();\r
- } else\r
- m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
-\r
- if (ed.getParam('show_ignore_words', true)) {\r
- ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", '');\r
- m.add({\r
- title : 'spellchecker.ignore_word',\r
- onclick : function() {\r
- var word = wordSpan.innerHTML;\r
-\r
- dom.remove(wordSpan, 1);\r
- t._checkDone();\r
-\r
- // tell the server if we need to\r
- if (ignoreRpc) {\r
- ed.setProgressState(1);\r
- t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) {\r
- ed.setProgressState(0);\r
- });\r
- }\r
- }\r
- });\r
-\r
- m.add({\r
- title : 'spellchecker.ignore_words',\r
- onclick : function() {\r
- var word = wordSpan.innerHTML;\r
-\r
- t._removeWords(dom.decode(word));\r
- t._checkDone();\r
-\r
- // tell the server if we need to\r
- if (ignoreRpc) {\r
- ed.setProgressState(1);\r
- t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) {\r
- ed.setProgressState(0);\r
- });\r
- }\r
- }\r
- });\r
- }\r
-\r
- if (t.editor.getParam("spellchecker_enable_learn_rpc")) {\r
- m.add({\r
- title : 'spellchecker.learn_word',\r
- onclick : function() {\r
- var word = wordSpan.innerHTML;\r
-\r
- dom.remove(wordSpan, 1);\r
- t._checkDone();\r
-\r
- ed.setProgressState(1);\r
- t._sendRPC('learnWord', [t.selectedLang, word], function(r) {\r
- ed.setProgressState(0);\r
- });\r
- }\r
- });\r
- }\r
-\r
- m.update();\r
- });\r
-\r
- p1 = DOM.getPos(ed.getContentAreaContainer());\r
- m.settings.offset_x = p1.x;\r
- m.settings.offset_y = p1.y;\r
-\r
- ed.selection.select(wordSpan);\r
- p1 = dom.getPos(wordSpan);\r
- m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y);\r
-\r
- return tinymce.dom.Event.cancel(e);\r
- } else\r
- m.hideMenu();\r
- },\r
-\r
- _checkDone : function() {\r
- var t = this, ed = t.editor, dom = ed.dom, o;\r
-\r
- each(dom.select('span'), function(n) {\r
- if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) {\r
- o = true;\r
- return false;\r
- }\r
- });\r
-\r
- if (!o)\r
- t._done();\r
- },\r
-\r
- _done : function() {\r
- var t = this, la = t.active;\r
-\r
- if (t.active) {\r
- t.active = 0;\r
- t._removeWords();\r
-\r
- if (t._menu)\r
- t._menu.hideMenu();\r
-\r
- if (la)\r
- t.editor.nodeChanged();\r
- }\r
- },\r
-\r
- _sendRPC : function(m, p, cb) {\r
- var t = this;\r
-\r
- JSONRequest.sendRPC({\r
- url : t.rpcUrl,\r
- method : m,\r
- params : p,\r
- success : cb,\r
- error : function(e, x) {\r
- t.editor.setProgressState(0);\r
- t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText));\r
- }\r
- });\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin);\r
-})();\r
+++ /dev/null
-#text_font {width:250px;}\r
-#text_size {width:70px;}\r
-.mceAddSelectValue {background:#DDD;}\r
-select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;}\r
-#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;}\r
-#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;}\r
-#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;}\r
-.panel_toggle_insert_span {padding-top:10px;}\r
-.panel_wrapper div.current {padding-top:10px;height:230px;}\r
-.delim {border-left:1px solid gray;}\r
-.tdelim {border-bottom:1px solid gray;}\r
-#block_display {width:145px;}\r
-#list_type {width:115px;}\r
-.disabled {background:#EEE;}\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){var c=false;var f=a.selection.getSelectedBlocks();var d=[];if(f.length===1){d.push(a.selection.getNode().style.cssText)}else{tinymce.each(f,function(g){d.push(a.dom.getAttrib(g,"style"))});c=true}a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:340+parseInt(a.getLang("style.delta_height",0)),inline:1},{applyStyleToBlocks:c,plugin_url:b,styles:d})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.StylePlugin', {\r
- init : function(ed, url) {\r
- // Register commands\r
- ed.addCommand('mceStyleProps', function() {\r
-\r
- var applyStyleToBlocks = false;\r
- var blocks = ed.selection.getSelectedBlocks();\r
- var styles = [];\r
-\r
- if (blocks.length === 1) {\r
- styles.push(ed.selection.getNode().style.cssText);\r
- }\r
- else {\r
- tinymce.each(blocks, function(block) {\r
- styles.push(ed.dom.getAttrib(block, 'style'));\r
- });\r
- applyStyleToBlocks = true;\r
- }\r
-\r
- ed.windowManager.open({\r
- file : url + '/props.htm',\r
- width : 480 + parseInt(ed.getLang('style.delta_width', 0)),\r
- height : 340 + parseInt(ed.getLang('style.delta_height', 0)),\r
- inline : 1\r
- }, {\r
- applyStyleToBlocks : applyStyleToBlocks,\r
- plugin_url : url,\r
- styles : styles\r
- });\r
- });\r
-\r
- ed.addCommand('mceSetElementStyle', function(ui, v) {\r
- if (e = ed.selection.getNode()) {\r
- ed.dom.setAttrib(e, 'style', v);\r
- ed.execCommand('mceRepaint');\r
- }\r
- });\r
-\r
- ed.onNodeChange.add(function(ed, cm, n) {\r
- cm.setDisabled('styleprops', n.nodeName === 'BODY');\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Style',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);\r
-})();\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var defaultFonts = "" + \r
- "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + \r
- "Times New Roman, Times, serif=Times New Roman, Times, serif;" + \r
- "Courier New, Courier, mono=Courier New, Courier, mono;" + \r
- "Times New Roman, Times, serif=Times New Roman, Times, serif;" + \r
- "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + \r
- "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + \r
- "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";\r
-\r
-var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";\r
-var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";\r
-var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%";\r
-var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";\r
-var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";\r
-var defaultTextStyle = "normal;italic;oblique";\r
-var defaultVariant = "normal;small-caps";\r
-var defaultLineHeight = "normal";\r
-var defaultAttachment = "fixed;scroll";\r
-var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";\r
-var defaultPosH = "left;center;right";\r
-var defaultPosV = "top;center;bottom";\r
-var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";\r
-var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";\r
-var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";\r
-var defaultBorderWidth = "thin;medium;thick";\r
-var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";\r
-\r
-function aggregateStyles(allStyles) {\r
- var mergedStyles = {};\r
-\r
- tinymce.each(allStyles, function(style) {\r
- if (style !== '') {\r
- var parsedStyles = tinyMCEPopup.editor.dom.parseStyle(style);\r
- for (var name in parsedStyles) {\r
- if (parsedStyles.hasOwnProperty(name)) {\r
- if (mergedStyles[name] === undefined) {\r
- mergedStyles[name] = parsedStyles[name];\r
- }\r
- else if (name === 'text-decoration') {\r
- if (mergedStyles[name].indexOf(parsedStyles[name]) === -1) {\r
- mergedStyles[name] = mergedStyles[name] +' '+ parsedStyles[name];\r
- }\r
- }\r
- }\r
- }\r
- }\r
- });\r
-\r
- return mergedStyles;\r
-}\r
-\r
-var applyActionIsInsert;\r
-var existingStyles;\r
-\r
-function init(ed) {\r
- var ce = document.getElementById('container'), h;\r
-\r
- existingStyles = aggregateStyles(tinyMCEPopup.getWindowArg('styles'));\r
- ce.style.cssText = tinyMCEPopup.editor.dom.serializeStyle(existingStyles);\r
-\r
- applyActionIsInsert = ed.getParam("edit_css_style_insert_span", false);\r
- document.getElementById('toggle_insert_span').checked = applyActionIsInsert;\r
-\r
- h = getBrowserHTML('background_image_browser','background_image','image','advimage');\r
- document.getElementById("background_image_browser").innerHTML = h;\r
-\r
- document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');\r
- document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');\r
- document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');\r
- document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');\r
- document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');\r
- document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');\r
-\r
- fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);\r
- fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);\r
- fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);\r
- fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);\r
- fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);\r
- fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);\r
- fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);\r
- fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);\r
-\r
- fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);\r
- fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);\r
-\r
- fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);\r
-\r
- fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);\r
- fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);\r
-\r
- fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);\r
- fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);\r
- fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);\r
- fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);\r
- fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);\r
- fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);\r
- fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);\r
- fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);\r
- fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);\r
-\r
- fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);\r
- fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);\r
- fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);\r
-\r
- fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);\r
- fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);\r
- fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);\r
- fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);\r
-\r
- fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);\r
- fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);\r
- fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);\r
- fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);\r
-\r
- fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);\r
-\r
- fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);\r
- fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);\r
-\r
- fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);\r
- fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);\r
-\r
- fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);\r
-\r
- fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);\r
-\r
- fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);\r
- fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);\r
-\r
- TinyMCE_EditableSelects.init();\r
- setupFormData();\r
- showDisabledControls();\r
-}\r
-\r
-function setupFormData() {\r
- var ce = document.getElementById('container'), f = document.forms[0], s, b, i;\r
-\r
- // Setup text fields\r
-\r
- selectByValue(f, 'text_font', ce.style.fontFamily, true, true);\r
- selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);\r
- selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));\r
- selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);\r
- selectByValue(f, 'text_style', ce.style.fontStyle, true, true);\r
- selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);\r
- selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));\r
- selectByValue(f, 'text_case', ce.style.textTransform, true, true);\r
- selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);\r
- f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color);\r
- updateColor('text_color_pick', 'text_color');\r
- f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');\r
- f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');\r
- f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');\r
- f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');\r
- f.text_none.checked = inStr(ce.style.textDecoration, 'none');\r
- updateTextDecorations();\r
-\r
- // Setup background fields\r
-\r
- f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor);\r
- updateColor('background_color_pick', 'background_color');\r
- f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
- selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);\r
- selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);\r
- selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);\r
- selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));\r
- selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);\r
- selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));\r
-\r
- // Setup block fields\r
-\r
- selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);\r
- selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));\r
- selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);\r
- selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));\r
- selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);\r
- selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);\r
- f.block_text_indent.value = getNum(ce.style.textIndent);\r
- selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));\r
- selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);\r
- selectByValue(f, 'block_display', ce.style.display, true, true);\r
-\r
- // Setup box fields\r
-\r
- f.box_width.value = getNum(ce.style.width);\r
- selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));\r
-\r
- f.box_height.value = getNum(ce.style.height);\r
- selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));\r
- selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true);\r
-\r
- selectByValue(f, 'box_clear', ce.style.clear, true, true);\r
-\r
- setupBox(f, ce, 'box_padding', 'padding', '');\r
- setupBox(f, ce, 'box_margin', 'margin', '');\r
-\r
- // Setup border fields\r
-\r
- setupBox(f, ce, 'border_style', 'border', 'Style');\r
- setupBox(f, ce, 'border_width', 'border', 'Width');\r
- setupBox(f, ce, 'border_color', 'border', 'Color');\r
-\r
- updateColor('border_color_top_pick', 'border_color_top');\r
- updateColor('border_color_right_pick', 'border_color_right');\r
- updateColor('border_color_bottom_pick', 'border_color_bottom');\r
- updateColor('border_color_left_pick', 'border_color_left');\r
-\r
- f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value);\r
- f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value);\r
- f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value);\r
- f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value);\r
-\r
- // Setup list fields\r
-\r
- selectByValue(f, 'list_type', ce.style.listStyleType, true, true);\r
- selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);\r
- f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
-\r
- // Setup box fields\r
-\r
- selectByValue(f, 'positioning_type', ce.style.position, true, true);\r
- selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);\r
- selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);\r
- f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";\r
-\r
- f.positioning_width.value = getNum(ce.style.width);\r
- selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));\r
-\r
- f.positioning_height.value = getNum(ce.style.height);\r
- selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));\r
-\r
- setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);\r
-\r
- s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");\r
- s = s.replace(/,/g, ' ');\r
-\r
- if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {\r
- f.positioning_clip_top.value = getNum(getVal(s, 0));\r
- selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));\r
- f.positioning_clip_right.value = getNum(getVal(s, 1));\r
- selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));\r
- f.positioning_clip_bottom.value = getNum(getVal(s, 2));\r
- selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));\r
- f.positioning_clip_left.value = getNum(getVal(s, 3));\r
- selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));\r
- } else {\r
- f.positioning_clip_top.value = getNum(getVal(s, 0));\r
- selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));\r
- f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;\r
- }\r
-\r
-// setupBox(f, ce, '', 'border', 'Color');\r
-}\r
-\r
-function getMeasurement(s) {\r
- return s.replace(/^([0-9.]+)(.*)$/, "$2");\r
-}\r
-\r
-function getNum(s) {\r
- if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s))\r
- return s.replace(/[^0-9.]/g, '');\r
-\r
- return s;\r
-}\r
-\r
-function inStr(s, n) {\r
- return new RegExp(n, 'gi').test(s);\r
-}\r
-\r
-function getVal(s, i) {\r
- var a = s.split(' ');\r
-\r
- if (a.length > 1)\r
- return a[i];\r
-\r
- return "";\r
-}\r
-\r
-function setValue(f, n, v) {\r
- if (f.elements[n].type == "text")\r
- f.elements[n].value = v;\r
- else\r
- selectByValue(f, n, v, true, true);\r
-}\r
-\r
-function setupBox(f, ce, fp, pr, sf, b) {\r
- if (typeof(b) == "undefined")\r
- b = ['Top', 'Right', 'Bottom', 'Left'];\r
-\r
- if (isSame(ce, pr, sf, b)) {\r
- f.elements[fp + "_same"].checked = true;\r
-\r
- setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));\r
- f.elements[fp + "_top"].disabled = false;\r
-\r
- f.elements[fp + "_right"].value = "";\r
- f.elements[fp + "_right"].disabled = true;\r
- f.elements[fp + "_bottom"].value = "";\r
- f.elements[fp + "_bottom"].disabled = true;\r
- f.elements[fp + "_left"].value = "";\r
- f.elements[fp + "_left"].disabled = true;\r
-\r
- if (f.elements[fp + "_top_measurement"]) {\r
- selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));\r
- f.elements[fp + "_left_measurement"].disabled = true;\r
- f.elements[fp + "_bottom_measurement"].disabled = true;\r
- f.elements[fp + "_right_measurement"].disabled = true;\r
- }\r
- } else {\r
- f.elements[fp + "_same"].checked = false;\r
-\r
- setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));\r
- f.elements[fp + "_top"].disabled = false;\r
-\r
- setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));\r
- f.elements[fp + "_right"].disabled = false;\r
-\r
- setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));\r
- f.elements[fp + "_bottom"].disabled = false;\r
-\r
- setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));\r
- f.elements[fp + "_left"].disabled = false;\r
-\r
- if (f.elements[fp + "_top_measurement"]) {\r
- selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));\r
- selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));\r
- selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));\r
- selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));\r
- f.elements[fp + "_left_measurement"].disabled = false;\r
- f.elements[fp + "_bottom_measurement"].disabled = false;\r
- f.elements[fp + "_right_measurement"].disabled = false;\r
- }\r
- }\r
-}\r
-\r
-function isSame(e, pr, sf, b) {\r
- var a = [], i, x;\r
-\r
- if (typeof(b) == "undefined")\r
- b = ['Top', 'Right', 'Bottom', 'Left'];\r
-\r
- if (typeof(sf) == "undefined" || sf == null)\r
- sf = "";\r
-\r
- a[0] = e.style[pr + b[0] + sf];\r
- a[1] = e.style[pr + b[1] + sf];\r
- a[2] = e.style[pr + b[2] + sf];\r
- a[3] = e.style[pr + b[3] + sf];\r
-\r
- for (i=0; i<a.length; i++) {\r
- if (a[i] == null)\r
- return false;\r
-\r
- for (x=0; x<a.length; x++) {\r
- if (a[x] != a[i])\r
- return false;\r
- }\r
- }\r
-\r
- return true;\r
-};\r
-\r
-function hasEqualValues(a) {\r
- var i, x;\r
-\r
- for (i=0; i<a.length; i++) {\r
- if (a[i] == null)\r
- return false;\r
-\r
- for (x=0; x<a.length; x++) {\r
- if (a[x] != a[i])\r
- return false;\r
- }\r
- }\r
-\r
- return true;\r
-}\r
-\r
-function toggleApplyAction() {\r
- applyActionIsInsert = ! applyActionIsInsert;\r
-}\r
-\r
-function applyAction() {\r
- var ce = document.getElementById('container'), ed = tinyMCEPopup.editor;\r
-\r
- generateCSS();\r
-\r
- tinyMCEPopup.restoreSelection();\r
-\r
- var newStyles = tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText);\r
-\r
- if (applyActionIsInsert) {\r
- ed.formatter.register('plugin_style', {\r
- inline: 'span', styles: existingStyles\r
- });\r
- ed.formatter.remove('plugin_style');\r
-\r
- ed.formatter.register('plugin_style', {\r
- inline: 'span', styles: newStyles\r
- });\r
- ed.formatter.apply('plugin_style');\r
- } else {\r
- var nodes;\r
-\r
- if (tinyMCEPopup.getWindowArg('applyStyleToBlocks')) {\r
- nodes = ed.selection.getSelectedBlocks();\r
- }\r
- else {\r
- nodes = ed.selection.getNode();\r
- }\r
-\r
- ed.dom.setAttrib(nodes, 'style', tinyMCEPopup.editor.dom.serializeStyle(newStyles));\r
- }\r
-}\r
-\r
-function updateAction() {\r
- applyAction();\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function generateCSS() {\r
- var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;\r
-\r
- ce.style.cssText = "";\r
-\r
- // Build text styles\r
- ce.style.fontFamily = f.text_font.value;\r
- ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : "");\r
- ce.style.fontStyle = f.text_style.value;\r
- ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : "");\r
- ce.style.textTransform = f.text_case.value;\r
- ce.style.fontWeight = f.text_weight.value;\r
- ce.style.fontVariant = f.text_variant.value;\r
- ce.style.color = f.text_color.value;\r
-\r
- s = "";\r
- s += f.text_underline.checked ? " underline" : "";\r
- s += f.text_overline.checked ? " overline" : "";\r
- s += f.text_linethrough.checked ? " line-through" : "";\r
- s += f.text_blink.checked ? " blink" : "";\r
- s = s.length > 0 ? s.substring(1) : s;\r
-\r
- if (f.text_none.checked)\r
- s = "none";\r
-\r
- ce.style.textDecoration = s;\r
-\r
- // Build background styles\r
-\r
- ce.style.backgroundColor = f.background_color.value;\r
- ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";\r
- ce.style.backgroundRepeat = f.background_repeat.value;\r
- ce.style.backgroundAttachment = f.background_attachment.value;\r
-\r
- if (f.background_hpos.value != "") {\r
- s = "";\r
- s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";\r
- s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");\r
- ce.style.backgroundPosition = s;\r
- }\r
-\r
- // Build block styles\r
-\r
- ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");\r
- ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");\r
- ce.style.verticalAlign = f.block_vertical_alignment.value;\r
- ce.style.textAlign = f.block_text_align.value;\r
- ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");\r
- ce.style.whiteSpace = f.block_whitespace.value;\r
- ce.style.display = f.block_display.value;\r
-\r
- // Build box styles\r
-\r
- ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");\r
- ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");\r
- ce.style.styleFloat = f.box_float.value;\r
- ce.style.cssFloat = f.box_float.value;\r
-\r
- ce.style.clear = f.box_clear.value;\r
-\r
- if (!f.box_padding_same.checked) {\r
- ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");\r
- ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");\r
- ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");\r
- ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");\r
- } else\r
- ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); \r
-\r
- if (!f.box_margin_same.checked) {\r
- ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");\r
- ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");\r
- ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");\r
- ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");\r
- } else\r
- ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); \r
-\r
- // Build border styles\r
-\r
- if (!f.border_style_same.checked) {\r
- ce.style.borderTopStyle = f.border_style_top.value;\r
- ce.style.borderRightStyle = f.border_style_right.value;\r
- ce.style.borderBottomStyle = f.border_style_bottom.value;\r
- ce.style.borderLeftStyle = f.border_style_left.value;\r
- } else\r
- ce.style.borderStyle = f.border_style_top.value;\r
-\r
- if (!f.border_width_same.checked) {\r
- ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");\r
- ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");\r
- ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");\r
- ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");\r
- } else\r
- ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");\r
-\r
- if (!f.border_color_same.checked) {\r
- ce.style.borderTopColor = f.border_color_top.value;\r
- ce.style.borderRightColor = f.border_color_right.value;\r
- ce.style.borderBottomColor = f.border_color_bottom.value;\r
- ce.style.borderLeftColor = f.border_color_left.value;\r
- } else\r
- ce.style.borderColor = f.border_color_top.value;\r
-\r
- // Build list styles\r
-\r
- ce.style.listStyleType = f.list_type.value;\r
- ce.style.listStylePosition = f.list_position.value;\r
- ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";\r
-\r
- // Build positioning styles\r
-\r
- ce.style.position = f.positioning_type.value;\r
- ce.style.visibility = f.positioning_visibility.value;\r
-\r
- if (ce.style.width == "")\r
- ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");\r
-\r
- if (ce.style.height == "")\r
- ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");\r
-\r
- ce.style.zIndex = f.positioning_zindex.value;\r
- ce.style.overflow = f.positioning_overflow.value;\r
-\r
- if (!f.positioning_placement_same.checked) {\r
- ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");\r
- ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");\r
- ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");\r
- ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");\r
- } else {\r
- s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");\r
- ce.style.top = s;\r
- ce.style.right = s;\r
- ce.style.bottom = s;\r
- ce.style.left = s;\r
- }\r
-\r
- if (!f.positioning_clip_same.checked) {\r
- s = "rect(";\r
- s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";\r
- s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";\r
- s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";\r
- s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");\r
- s += ")";\r
-\r
- if (s != "rect(auto auto auto auto)")\r
- ce.style.clip = s;\r
- } else {\r
- s = "rect(";\r
- t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";\r
- s += t + " ";\r
- s += t + " ";\r
- s += t + " ";\r
- s += t + ")";\r
-\r
- if (s != "rect(auto auto auto auto)")\r
- ce.style.clip = s;\r
- }\r
-\r
- ce.style.cssText = ce.style.cssText;\r
-}\r
-\r
-function isNum(s) {\r
- return new RegExp('[0-9]+', 'g').test(s);\r
-}\r
-\r
-function showDisabledControls() {\r
- var f = document.forms, i, a;\r
-\r
- for (i=0; i<f.length; i++) {\r
- for (a=0; a<f[i].elements.length; a++) {\r
- if (f[i].elements[a].disabled)\r
- tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled");\r
- else\r
- tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled");\r
- }\r
- }\r
-}\r
-\r
-function fillSelect(f, s, param, dval, sep, em) {\r
- var i, ar, p, se;\r
-\r
- f = document.forms[f];\r
- sep = typeof(sep) == "undefined" ? ";" : sep;\r
-\r
- if (em)\r
- addSelectValue(f, s, "", "");\r
-\r
- ar = tinyMCEPopup.getParam(param, dval).split(sep);\r
- for (i=0; i<ar.length; i++) {\r
- se = false;\r
-\r
- if (ar[i].charAt(0) == '+') {\r
- ar[i] = ar[i].substring(1);\r
- se = true;\r
- }\r
-\r
- p = ar[i].split('=');\r
-\r
- if (p.length > 1) {\r
- addSelectValue(f, s, p[0], p[1]);\r
-\r
- if (se)\r
- selectByValue(f, s, p[1]);\r
- } else {\r
- addSelectValue(f, s, p[0], p[0]);\r
-\r
- if (se)\r
- selectByValue(f, s, p[0]);\r
- }\r
- }\r
-}\r
-\r
-function toggleSame(ce, pre) {\r
- var el = document.forms[0].elements, i;\r
-\r
- if (ce.checked) {\r
- el[pre + "_top"].disabled = false;\r
- el[pre + "_right"].disabled = true;\r
- el[pre + "_bottom"].disabled = true;\r
- el[pre + "_left"].disabled = true;\r
-\r
- if (el[pre + "_top_measurement"]) {\r
- el[pre + "_top_measurement"].disabled = false;\r
- el[pre + "_right_measurement"].disabled = true;\r
- el[pre + "_bottom_measurement"].disabled = true;\r
- el[pre + "_left_measurement"].disabled = true;\r
- }\r
- } else {\r
- el[pre + "_top"].disabled = false;\r
- el[pre + "_right"].disabled = false;\r
- el[pre + "_bottom"].disabled = false;\r
- el[pre + "_left"].disabled = false;\r
-\r
- if (el[pre + "_top_measurement"]) {\r
- el[pre + "_top_measurement"].disabled = false;\r
- el[pre + "_right_measurement"].disabled = false;\r
- el[pre + "_bottom_measurement"].disabled = false;\r
- el[pre + "_left_measurement"].disabled = false;\r
- }\r
- }\r
-\r
- showDisabledControls();\r
-}\r
-\r
-function synch(fr, to) {\r
- var f = document.forms[0];\r
-\r
- f.elements[to].value = f.elements[fr].value;\r
-\r
- if (f.elements[fr + "_measurement"])\r
- selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);\r
-}\r
-\r
-function updateTextDecorations(){\r
- var el = document.forms[0].elements;\r
-\r
- var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"];\r
- var noneChecked = el["text_none"].checked;\r
- tinymce.each(textDecorations, function(id) {\r
- el[id].disabled = noneChecked;\r
- if (noneChecked) {\r
- el[id].checked = false;\r
- }\r
- });\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"});
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{#style_dlg.title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
- <script type="text/javascript" src="js/props.js"></script>
- <link href="css/props.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body id="styleprops" style="display: none" role="application" aria-labelledby="app_title">
-<span id="app_title" style="display:none">{#style_dlg.title}</span>
-<form onsubmit="updateAction();return false;" action="#">
-<div class="tabs">
- <ul>
- <li id="text_tab" class="current" aria-controls="text_panel"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
- <li id="background_tab" aria-controls="background_panel"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
- <li id="block_tab" aria-controls="block_panel"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
- <li id="box_tab" aria-controls="box_panel"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
- <li id="border_tab" aria-controls="border_panel"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
- <li id="list_tab" aria-controls="list_panel"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
- <li id="positioning_tab" aria-controls="positioning_panel"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
- </ul>
-</div>
-
-<div class="panel_wrapper">
-<div id="text_panel" class="panel current">
- <fieldset>
- <legend>{#style_dlg.text}</legend>
- <table role="presentation" border="0" width="100%">
- <tr>
- <td><label for="text_font">{#style_dlg.text_font}</label></td>
- <td colspan="3">
- <select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
- </td>
- </tr>
- <tr>
- <td><label for="text_size">{#style_dlg.text_size}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
- <td> </td>
- <td>
- <label id="text_size_measurement_label" for="text_size_measurement" style="display: none; visibility: hidden;">Text Size Measurement Unit</label>
- <select id="text_size_measurement" name="text_size_measurement" aria-labelledby="text_size_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td><label for="text_weight">{#style_dlg.text_weight}</label></td>
- <td>
- <select id="text_weight" name="text_weight"></select>
- </td>
- </tr>
- <tr>
- <td><label for="text_style">{#style_dlg.text_style}</label></td>
- <td>
- <select id="text_style" name="text_style" class="mceEditableSelect"></select>
- </td>
- <td><label for="text_variant">{#style_dlg.text_variant}</label></td>
- <td>
- <select id="text_variant" name="text_variant"></select>
- </td>
- </tr>
- <tr>
- <td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
- </td>
- <td> </td>
- <td>
- <label id="text_lineheight_measurement_label" for="text_lineheight_measurement" style="display: none; visibility: hidden;">Line Height Measurement Unit</label>
- <select id="text_lineheight_measurement" name="text_lineheight_measurement" aria-labelledby="text_lineheight_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td><label for="text_case">{#style_dlg.text_case}</label></td>
- <td>
- <select id="text_case" name="text_case"></select>
- </td>
- </tr>
- <tr>
- <td><label for="text_color">{#style_dlg.text_color}</label></td>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
- <td id="text_color_pickcontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
- <td colspan="2">
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
- <td><label for="text_underline">{#style_dlg.text_underline}</label></td>
- </tr>
- <tr>
- <td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
- <td><label for="text_overline">{#style_dlg.text_overline}</label></td>
- </tr>
- <tr>
- <td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
- <td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
- </tr>
- <tr>
- <td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
- <td><label for="text_blink">{#style_dlg.text_blink}</label></td>
- </tr>
- <tr>
- <td><input id="text_none" name="text_none" class="checkbox" type="checkbox" onclick="updateTextDecorations();"/></td>
- <td><label for="text_none">{#style_dlg.text_none}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-</div>
-
-<div id="background_panel" class="panel">
- <fieldset>
- <legend>{#style_dlg.background}</legend>
- <table role="presentation" border="0">
- <tr>
- <td><label for="background_color">{#style_dlg.background_color}</label></td>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
- <td id="background_color_pickcontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="background_image">{#style_dlg.background_image}</label></td>
- <td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input id="background_image" name="background_image" type="text" /></td>
- <td id="background_image_browser"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
- <td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
- </tr>
-
- <tr>
- <td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
- <td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
- </tr>
-
- <tr>
- <td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
- <td> </td>
- <td>
- <label id="background_hpos_measurement_label" for="background_hpos_measurement" style="display: none; visibility: hidden;">Horizontal position measurement unit</label>
- <select id="background_hpos_measurement" name="background_hpos_measurement" aria-labelledby="background_hpos_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
- <td> </td>
- <td>
-
- <label id="background_vpos_measurement_label" for="background_vpos_measurement" style="display: none; visibility: hidden;">Vertical position measurement unit</label>
- <select id="background_vpos_measurement" name="background_vpos_measurement" aria-labelledby="background_vpos_measurement_label">></select></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-</div>
-
-<div id="block_panel" class="panel">
- <fieldset>
- <legend>{#style_dlg.block}</legend>
- <table role="presentation" border="0">
- <tr>
- <td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
- <td> </td>
- <td>
- <label id="block_wordspacing_measurement_label" for="block_wordspacing_measurement" style="display: none; visibility: hidden;">Word spacing measurement unit</label>
- <select id="block_wordspacing_measurement" name="block_wordspacing_measurement" aria-labelledby="block_wordspacing_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
- <td> </td>
- <td>
- <label id="block_letterspacing_measurement_label" for="block_letterspacing_measurement" style="display: none; visibility: hidden;">Letter spacing measurement unit</label>
- <select id="block_letterspacing_measurement" name="block_letterspacing_measurement" aria-labelledby="block_letterspacing_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
- <td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
- </tr>
-
- <tr>
- <td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
- <td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
- </tr>
-
- <tr>
- <td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
- <td> </td>
- <td>
- <label id="block_text_indent_measurement_label" for="block_text_indent_measurement" style="display: none; visibility: hidden;">Text Indent Measurement Unit</label>
-
- <select id="block_text_indent_measurement" name="block_text_indent_measurement" aria-labelledby="block_text_indent_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
- <td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
- </tr>
-
- <tr>
- <td><label for="block_display">{#style_dlg.block_display}</label></td>
- <td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
- </tr>
- </table>
- </fieldset>
-</div>
-
-<div id="box_panel" class="panel">
- <fieldset>
- <legend>{#style_dlg.box}</legend>
- <table role="presentation" border="0">
- <tr>
- <td><label for="box_width">{#style_dlg.box_width}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
- <td> </td>
- <td>
- <label id="box_width_measurement_label" for="box_width_measurement" style="display: none; visibility: hidden;">Box Width Measurement Unit</label>
- <select id="box_width_measurement" name="box_width_measurement" aria-labelledby="box_width_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td> <label for="box_float">{#style_dlg.box_float}</label></td>
- <td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
- </tr>
-
- <tr>
- <td><label for="box_height">{#style_dlg.box_height}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
- <td> </td>
- <td>
- <label id="box_height_measurement_label" for="box_height_measurement" style="display: none; visibility: hidden;">Box Height Measurement Unit</label>
- <select id="box_height_measurement" name="box_height_measurement" aria-labelledby="box_height_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td> <label for="box_clear">{#style_dlg.box_clear}</label></td>
- <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
- </tr>
- </table>
- </fieldset>
-
-<div style="float: left; width: 49%">
- <fieldset>
- <legend>{#style_dlg.padding}</legend>
-
- <table role="presentation" border="0">
- <tr>
- <td> </td>
- <td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
- </tr>
- <tr>
- <td><label for="box_padding_top">{#style_dlg.top}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
- <td> </td>
- <td>
- <label id="box_padding_top_measurement_label" for="box_padding_top_measurement" style="display: none; visibility: hidden;">Padding Top Measurement Unit</label>
- <select id="box_padding_top_measurement" name="box_padding_top_measurement" aria-labelledby="box_padding_top_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td><label for="box_padding_right">{#style_dlg.right}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="box_padding_right_measurement_label" for="box_padding_right_measurement" style="display: none; visibility: hidden;">Padding Right Measurement Unit</label>
- <select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled" aria-labelledby="box_padding_right_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="box_padding_bottom_measurement_label" for="box_padding_bottom_measurement" style="display: none; visibility: hidden;">Padding Bottom Measurement Unit</label>
- <select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled" aria-labelledby="box_padding_bottom_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td><label for="box_padding_left">{#style_dlg.left}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="box_padding_left_measurement_label" for="box_padding_left_measurement" style="display: none; visibility: hidden;">Padding Left Measurement Unit</label>
- <select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled" aria-labelledby="box_padding_left_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-</div>
-
-<div style="float: right; width: 49%">
- <fieldset>
- <legend>{#style_dlg.margin}</legend>
-
- <table role="presentation" border="0">
- <tr>
- <td> </td>
- <td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
- </tr>
- <tr>
- <td><label for="box_margin_top">{#style_dlg.top}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
- <td> </td>
- <td>
- <label id="box_margin_top_measurement_label" for="box_margin_top_measurement" style="display: none; visibility: hidden;">Margin Top Measurement Unit</label>
- <select id="box_margin_top_measurement" name="box_margin_top_measurement" aria-labelledby="box_margin_top_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td><label for="box_margin_right">{#style_dlg.right}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="box_margin_right_measurement_label" for="box_margin_right_measurement" style="display: none; visibility: hidden;">Margin Right Measurement Unit</label>
- <select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled" aria-labelledby="box_margin_right_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="box_margin_bottom_measurement_label" for="box_margin_bottom_measurement" style="display: none; visibility: hidden;">Margin Bottom Measurement Unit</label>
- <select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled" aria-labelledby="box_margin_bottom_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td><label for="box_margin_left">{#style_dlg.left}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="box_margin_left_measurement_label" for="box_margin_left_measurement" style="display: none; visibility: hidden;">Margin Left Measurement Unit</label>
- <select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled" aria-labelledby="box_margin_left_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-</div>
-<br style="clear: both" />
-</div>
-
-<div id="border_panel" class="panel">
- <fieldset>
- <legend>{#style_dlg.border}</legend>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td class="tdelim"> </td>
- <td class="tdelim delim"> </td>
- <td class="tdelim">{#style_dlg.style}</td>
- <td class="tdelim delim"> </td>
- <td class="tdelim">{#style_dlg.width}</td>
- <td class="tdelim delim"> </td>
- <td class="tdelim">{#style_dlg.color}</td>
- </tr>
-
- <tr>
- <td> </td>
- <td class="delim"> </td>
- <td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
- <td class="delim"> </td>
- <td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
- <td class="delim"> </td>
- <td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
- </tr>
-
- <tr>
- <td>{#style_dlg.top}</td>
- <td class="delim"> </td>
- <td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
- <td class="delim"> </td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
- <td> </td>
- <td>
- <label id="border_width_top_measurement_label" for="border_width_top_measurement" style="display: none; visibility: hidden;">Width top Measurement Unit</label>
- <select id="border_width_top_measurement" name="border_width_top_measurement" aria-labelledby="border_width_top_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td class="delim"> </td>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
- <td id="border_color_top_pickcontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td>{#style_dlg.right}</td>
- <td class="delim"> </td>
- <td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
- <td class="delim"> </td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
- <td> </td>
- <td>
- <label id="border_width_right_measurement_label" for="border_width_right_measurement" style="display: none; visibility: hidden;">Width Right Measurement Unit</label>
- <select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled" aria-labelledby="border_width_right_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td class="delim"> </td>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
- <td id="border_color_right_pickcontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td>{#style_dlg.bottom}</td>
- <td class="delim"> </td>
- <td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
- <td class="delim"> </td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
- <td> </td>
- <td>
- <label id="border_width_bottom_measurement_label" for="border_width_bottom_measurement" style="display: none; visibility: hidden;">Width Bottom Measurement Unit</label>
- <select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled" aria-labelledby="border_width_bottom_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td class="delim"> </td>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
- <td id="border_color_bottom_pickcontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td>{#style_dlg.left}</td>
- <td class="delim"> </td>
- <td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
- <td class="delim"> </td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
- <td> </td>
- <td>
- <label id="border_width_left_measurement_label" for="border_width_left_measurement" style="display: none; visibility: hidden;">Width Left Measurement Unit</label>
- <select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled" aria-labelledby="border_width_left_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td class="delim"> </td>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
- <td id="border_color_left_pickcontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-</div>
-
-<div id="list_panel" class="panel">
-<fieldset>
- <legend>{#style_dlg.list}</legend>
- <table role="presentation" border="0">
- <tr>
- <td><label for="list_type">{#style_dlg.list_type}</label></td>
- <td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
- </tr>
-
- <tr>
- <td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
- <td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
- </tr>
-
- <tr>
- <td><label for="list_position">{#style_dlg.position}</label></td>
- <td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
- </tr>
- </table>
-</fieldset>
-</div>
-
-<div id="positioning_panel" class="panel">
-<fieldset>
- <legend>{#style_dlg.position}</legend>
-<table role="presentation" border="0">
- <tr>
- <td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
- <td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
- <td> <label for="positioning_visibility">{#style_dlg.visibility}</label></td>
- <td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
- </tr>
-
- <tr>
- <td><label for="positioning_width">{#style_dlg.width}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
- <td> </td>
- <td>
- <label id="positioning_width_measurement_label" for="positioning_width_measurement" style="display: none; visibility: hidden;">Positioning width Measurement Unit</label>
- <select id="positioning_width_measurement" name="positioning_width_measurement" aria-labelledby="positioning_width_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td> <label for="positioning_zindex">{#style_dlg.zindex}</label></td>
- <td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
- </tr>
-
- <tr>
- <td><label for="positioning_height">{#style_dlg.height}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
- <td> </td>
- <td>
- <label id="positioning_height_measurement_label" for="positioning_height_measurement" style="display: none; visibility: hidden;">Positioning Height Measurement Unit</label>
- <select id="positioning_height_measurement" name="positioning_height_measurement" aria-labelledby="positioning_height_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- <td> <label for="positioning_overflow">{#style_dlg.overflow}</label></td>
- <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
- </tr>
-</table>
-</fieldset>
-
-<div style="float: left; width: 49%">
- <fieldset>
- <legend>{#style_dlg.placement}</legend>
-
- <table role="presentation" border="0">
- <tr>
- <td> </td>
- <td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
- </tr>
- <tr>
- <td>{#style_dlg.top}</td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
- <td> </td>
- <td>
- <label id="positioning_placement_top_measurement_label" for="positioning_placement_top_measurement" style="display: none; visibility: hidden;">Placement Top Measurement Unit</label>
- <select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement" aria-labelledby="positioning_placement_top_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>{#style_dlg.right}</td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="positioning_placement_right_measurement_label" for="positioning_placement_right_measurement" style="display: none; visibility: hidden;">Placement Right Measurement Unit</label>
- <select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled" aria-labelledby="positioning_placement_right_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>{#style_dlg.bottom}</td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="positioning_placement_bottom_measurement_label" for="positioning_placement_bottom_measurement" style="display: none; visibility: hidden;">Placement Bottom Measurement Unit</label>
- <select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled" aria-labelledby="positioning_placement_bottom_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>{#style_dlg.left}</td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="positioning_placement_left_measurement_label" for="positioning_placement_left_measurement" style="display: none; visibility: hidden;">Placement Left Measurement Unit</label>
- <select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled" aria-labelledby="positioning_placement_left_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-</div>
-
-<div style="float: right; width: 49%">
- <fieldset>
- <legend>{#style_dlg.clip}</legend>
-
- <table role="presentation" border="0">
- <tr>
- <td> </td>
- <td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
- </tr>
- <tr>
- <td>{#style_dlg.top}</td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
- <td> </td>
- <td>
- <label id="positioning_clip_top_measurement_label" for="positioning_clip_top_measurement" style="display: none; visibility: hidden;">Clip Top Measurement Unit</label>
- <select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement" aria-labelledby="positioning_clip_top_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>{#style_dlg.right}</td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="positioning_clip_right_measurement_label" for="positioning_clip_right_measurement" style="display: none; visibility: hidden;">Clip Right Measurement Unit</label>
- <select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled" aria-labelledby="positioning_clip_right_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>{#style_dlg.bottom}</td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="positioning_clip_bottom_measurement_label" for="positioning_clip_bottom_measurement" style="display: none; visibility: hidden;">Clip Bottom Measurement Unit</label>
- <select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled" aria-labelledby="positioning_clip_bottom_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>{#style_dlg.left}</td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
- <td> </td>
- <td>
- <label id="positioning_clip_left_measurement_label" for="positioning_clip_left_measurement" style="display: none; visibility: hidden;">Clip Left Measurement Unit</label>
- <select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled" aria-labelledby="positioning_clip_left_measurement_label"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-</div>
-<br style="clear: both" />
-</div>
-</div>
-
-<div class="panel_toggle_insert_span">
- <input type="checkbox" class="checkbox" id="toggle_insert_span" name="toggle_insert_span" onClick="toggleApplyAction();" />
- <label for="toggle_insert_span">{#style_dlg.toggle_insert_span}</label>
-</div>
-
-<div class="mceActionPanel">
- <input type="submit" id="insert" name="insert" value="{#update}" />
- <input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" />
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
-</div>
-</form>
-
-<div style="display: none">
- <div id="container"></div>
-</div>
-
-</body>
-</html>
+++ /dev/null
-Edit CSS Style plug-in notes
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Unlike WYSIWYG editor functionality that operates only on the selected text,
-typically by inserting new HTML elements with the specified styles.
-This plug-in operates on the HTML blocks surrounding the selected text.
-No new HTML elements are created.
-
-This plug-in only operates on the surrounding blocks and not the nearest
-parent node. This means that if a block encapsulates a node,
-e.g <p><span>text</span></p>, then only the styles in the block are
-recognized, not those in the span.
-
-When selecting text that includes multiple blocks at the same level (peers),
-this plug-in accumulates the specified styles in all of the surrounding blocks
-and populates the dialogue checkboxes accordingly. There is no differentiation
-between styles set in all the blocks versus styles set in some of the blocks.
-
-When the [Update] or [Apply] buttons are pressed, the styles selected in the
-checkboxes are applied to all blocks that surround the selected text.
+++ /dev/null
-(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]:not(iframe)");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m<n.length;m++){if(r(n[m])){return n[m]}}}else{for(m=j-1;m>=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
-
- tinymce.create('tinymce.plugins.TabFocusPlugin', {
- init : function(ed, url) {
- function tabCancel(ed, e) {
- if (e.keyCode === 9)
- return Event.cancel(e);
- }
-
- function tabHandler(ed, e) {
- var x, i, f, el, v;
-
- function find(d) {
- el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
-
- function canSelectRecursive(e) {
- return e.nodeName==="BODY" || (e.type != 'hidden' &&
- !(e.style.display == "none") &&
- !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
- }
- function canSelectInOldIe(el) {
- return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
- }
- function isOldIe() {
- return tinymce.isIE6 || tinymce.isIE7;
- }
- function canSelect(el) {
- return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
- }
-
- each(el, function(e, i) {
- if (e.id == ed.id) {
- x = i;
- return false;
- }
- });
- if (d > 0) {
- for (i = x + 1; i < el.length; i++) {
- if (canSelect(el[i]))
- return el[i];
- }
- } else {
- for (i = x - 1; i >= 0; i--) {
- if (canSelect(el[i]))
- return el[i];
- }
- }
-
- return null;
- }
-
- if (e.keyCode === 9) {
- v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
-
- if (v.length == 1) {
- v[1] = v[0];
- v[0] = ':prev';
- }
-
- // Find element to focus
- if (e.shiftKey) {
- if (v[0] == ':prev')
- el = find(-1);
- else
- el = DOM.get(v[0]);
- } else {
- if (v[1] == ':next')
- el = find(1);
- else
- el = DOM.get(v[1]);
- }
-
- if (el) {
- if (el.id && (ed = tinymce.get(el.id || el.name)))
- ed.focus();
- else
- window.setTimeout(function() {
- if (!tinymce.isWebKit)
- window.focus();
- el.focus();
- }, 10);
-
- return Event.cancel(e);
- }
- }
- }
-
- ed.onKeyUp.add(tabCancel);
-
- if (tinymce.isGecko) {
- ed.onKeyPress.add(tabHandler);
- ed.onKeyDown.add(tabCancel);
- } else
- ed.onKeyDown.add(tabHandler);
-
- },
-
- getInfo : function() {
- return {
- longname : 'Tabfocus',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
-})();
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#table_dlg.cell_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/validate.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="js/cell.js"></script>\r
- <link href="css/cell.css" rel="stylesheet" type="text/css" />\r
-</head>\r
-<body id="tablecell" style="display: none" role="application">\r
- <form onsubmit="updateAction();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>\r
- <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#table_dlg.general_props}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td><label for="align">{#table_dlg.align}</label></td>\r
- <td>\r
- <select id="align" name="align" class="mceFocus">\r
- <option value="">{#not_set}</option>\r
- <option value="center">{#table_dlg.align_middle}</option>\r
- <option value="left">{#table_dlg.align_left}</option>\r
- <option value="right">{#table_dlg.align_right}</option>\r
- </select>\r
- </td>\r
- \r
- <td><label for="celltype">{#table_dlg.cell_type}</label></td>\r
- <td>\r
- <select id="celltype" name="celltype">\r
- <option value="td">{#table_dlg.td}</option>\r
- <option value="th">{#table_dlg.th}</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="valign">{#table_dlg.valign}</label></td>\r
- <td>\r
- <select id="valign" name="valign">\r
- <option value="">{#not_set}</option>\r
- <option value="top">{#table_dlg.align_top}</option>\r
- <option value="middle">{#table_dlg.align_middle}</option>\r
- <option value="bottom">{#table_dlg.align_bottom}</option>\r
- </select>\r
- </td>\r
-\r
- <td><label for="scope">{#table_dlg.scope}</label></td>\r
- <td>\r
- <select id="scope" name="scope">\r
- <option value="">{#not_set}</option>\r
- <option value="col">{#table.col}</option>\r
- <option value="row">{#table.row}</option>\r
- <option value="rowgroup">{#table_dlg.rowgroup}</option>\r
- <option value="colgroup">{#table_dlg.colgroup}</option>\r
- </select>\r
- </td>\r
-\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="width">{#table_dlg.width}</label></td>\r
- <td><input id="width" name="width" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>\r
-\r
- <td><label for="height">{#table_dlg.height}</label></td>\r
- <td><input id="height" name="height" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>\r
- </tr>\r
-\r
- <tr id="styleSelectRow">\r
- <td><label for="class">{#class_name}</label></td>\r
- <td colspan="3">\r
- <select id="class" name="class" class="mceEditableSelect">\r
- <option value="" selected="selected">{#not_set}</option>\r
- </select>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="advanced_panel" class="panel">\r
- <fieldset>\r
- <legend>{#table_dlg.advanced_props}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="column1"><label for="id">{#table_dlg.id}</label></td> \r
- <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td><label for="style">{#table_dlg.style}</label></td>\r
- <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> \r
- <td>\r
- <select id="dir" name="dir" style="width: 200px"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#table_dlg.ltr}</option> \r
- <option value="rtl">{#table_dlg.rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" style="width: 200px" />\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> \r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>\r
- <td id="backgroundimagebrowsercontainer"> </td>\r
- </tr>\r
- </table>\r
- </td> \r
- </tr>\r
-\r
- <tr role="group" aria-labelledby="bordercolor_label">\r
- <td class="column1"><label id="bordercolor_label" for="bordercolor">{#table_dlg.bordercolor}</label></td> \r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>\r
- <td id="bordercolor_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td> \r
- </tr>\r
-\r
- <tr role="group" aria-labelledby="bgcolor_label">\r
- <td class="column1"><label id="bgcolor_label" for="bgcolor">{#table_dlg.bgcolor}</label></td> \r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>\r
- <td id="bgcolor_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <div>\r
- <select id="action" name="action">\r
- <option value="cell">{#table_dlg.cell_cell}</option>\r
- <option value="row">{#table_dlg.cell_row}</option>\r
- <option value="col">{#table_dlg.cell_col}</option>\r
- <option value="all">{#table_dlg.cell_all}</option>\r
- </select>\r
- </div>\r
-\r
- <input type="submit" id="insert" name="insert" value="{#update}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
- </form>\r
-</body>\r
-</html>\r
+++ /dev/null
-/* CSS file for cell dialog in the table plugin */\r
-\r
-.panel_wrapper div.current {\r
- height: 200px;\r
-}\r
-\r
-.advfield {\r
- width: 200px;\r
-}\r
-\r
-#action {\r
- margin-bottom: 3px;\r
-}\r
-\r
-#class {\r
- width: 150px;\r
-}
\ No newline at end of file
+++ /dev/null
-/* CSS file for row dialog in the table plugin */\r
-\r
-.panel_wrapper div.current {\r
- height: 200px;\r
-}\r
-\r
-.advfield {\r
- width: 200px;\r
-}\r
-\r
-#action {\r
- margin-bottom: 3px;\r
-}\r
-\r
-#rowtype,#align,#valign,#class,#height {\r
- width: 150px;\r
-}\r
-\r
-#height {\r
- width: 50px; \r
-}\r
-\r
-.col2 {\r
- padding-left: 20px;\r
-}\r
+++ /dev/null
-/* CSS file for table dialog in the table plugin */\r
-\r
-.panel_wrapper div.current {\r
- height: 245px;\r
-}\r
-\r
-.advfield {\r
- width: 200px;\r
-}\r
-\r
-#class {\r
- width: 150px;\r
-}\r
+++ /dev/null
-(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T<Q+U;T++){if(!g[T]){g[T]=[]}for(S=R;S<R+V;S++){g[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=g[O];if(N){return N[M]}}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return M&&(G.hasClass(M.elm,"mceSelected")||M==o)}function k(){var M=[];e(H.rows,function(N){e(N.cells,function(O){if(G.hasClass(O,"mceSelected")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function f(M){var N;d.walk(M,function(P){var O;if(P.nodeType==3){e(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=d.isIE?" ":'<br data-mce-bogus="1" />'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='<br data-mce-bogus="1" />'}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q<S-1;Q++){G.insertAfter(f(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{L=D=null;e(g,function(Z,aa){e(Z,function(ac,ab){if(j(ac)){if(!L){L={x:ab,y:aa}}D={x:ab,y:aa}}})});P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,"colSpan",(X-P)+1);s(T,"rowSpan",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){if(!g[R]||!g[R][U]){continue}V=g[R][U].elm;if(V!=T){N=d.grep(V.childNodes);e(N,function(Z){T.appendChild(Z)});if(N.length){N=d.grep(T.childNodes);Q=0;e(N,function(Z){if(Z.nodeName=="BR"&&G.getAttrib(Z,"data-mce-bogus")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(Q){var M,S,P,R,T,U,N,V,O;e(g,function(W,X){e(W,function(Z,Y){if(j(Z)){Z=Z.elm;T=Z.parentNode;U=A(T,false);M=X;if(Q){return false}}});if(Q){return !M}});for(R=0;R<g[0].length;R++){if(!g[M][R]){continue}S=g[M][R].elm;if(S!=P){if(!Q){O=a(S,"rowspan");if(O>1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){if(!O){return}var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,"colSpan",1);s(R,"rowSpan",1)}for(i=S;i<Q;i++){T.appendChild(f(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}});G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected")}function F(M){var N;e(g,function(O,P){e(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;e(g,function(P,Q){e(P,function(S,R){var U,T;if(j(S)){S=g[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=g[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=g[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){if(r.settings.forced_root_block){r.dom.add(r.getBody(),r.settings.forced_root_block,null,d.isIE?" ":'<br data-mce-bogus="1" />')}else{r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"})}}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&(z.nodeName=="BR"||(z.childNodes.length==1&&(z.firstChild.nodeName=="BR"||z.firstChild.nodeValue=="\u00a0")))&&z.previousSibling&&z.previousSibling.nodeName=="TABLE"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce);
\ No newline at end of file
+++ /dev/null
-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function(tinymce) {
- var each = tinymce.each;
-
- // Checks if the selection/caret is at the start of the specified block element
- function isAtStart(rng, par) {
- var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
-
- rng2.setStartBefore(par);
- rng2.setEnd(rng.endContainer, rng.endOffset);
-
- elm = doc.createElement('body');
- elm.appendChild(rng2.cloneContents());
-
- // Check for text characters of other elements that should be treated as content
- return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0;
- };
-
- function getSpanVal(td, name) {
- return parseInt(td.getAttribute(name) || 1);
- }
-
- /**
- * Table Grid class.
- */
- function TableGrid(table, dom, selection) {
- var grid, startPos, endPos, selectedCell;
-
- buildGrid();
- selectedCell = dom.getParent(selection.getStart(), 'th,td');
- if (selectedCell) {
- startPos = getPos(selectedCell);
- endPos = findEndPos();
- selectedCell = getCell(startPos.x, startPos.y);
- }
-
- function cloneNode(node, children) {
- node = node.cloneNode(children);
- node.removeAttribute('id');
-
- return node;
- }
-
- function buildGrid() {
- var startY = 0;
-
- grid = [];
-
- each(['thead', 'tbody', 'tfoot'], function(part) {
- var rows = dom.select('> ' + part + ' tr', table);
-
- each(rows, function(tr, y) {
- y += startY;
-
- each(dom.select('> td, > th', tr), function(td, x) {
- var x2, y2, rowspan, colspan;
-
- // Skip over existing cells produced by rowspan
- if (grid[y]) {
- while (grid[y][x])
- x++;
- }
-
- // Get col/rowspan from cell
- rowspan = getSpanVal(td, 'rowspan');
- colspan = getSpanVal(td, 'colspan');
-
- // Fill out rowspan/colspan right and down
- for (y2 = y; y2 < y + rowspan; y2++) {
- if (!grid[y2])
- grid[y2] = [];
-
- for (x2 = x; x2 < x + colspan; x2++) {
- grid[y2][x2] = {
- part : part,
- real : y2 == y && x2 == x,
- elm : td,
- rowspan : rowspan,
- colspan : colspan
- };
- }
- }
- });
- });
-
- startY += rows.length;
- });
- };
-
- function getCell(x, y) {
- var row;
-
- row = grid[y];
- if (row)
- return row[x];
- };
-
- function setSpanVal(td, name, val) {
- if (td) {
- val = parseInt(val);
-
- if (val === 1)
- td.removeAttribute(name, 1);
- else
- td.setAttribute(name, val, 1);
- }
- }
-
- function isCellSelected(cell) {
- return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell);
- };
-
- function getSelectedRows() {
- var rows = [];
-
- each(table.rows, function(row) {
- each(row.cells, function(cell) {
- if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {
- rows.push(row);
- return false;
- }
- });
- });
-
- return rows;
- };
-
- function deleteTable() {
- var rng = dom.createRng();
-
- rng.setStartAfter(table);
- rng.setEndAfter(table);
-
- selection.setRng(rng);
-
- dom.remove(table);
- };
-
- function cloneCell(cell) {
- var formatNode;
-
- // Clone formats
- tinymce.walk(cell, function(node) {
- var curNode;
-
- if (node.nodeType == 3) {
- each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
- node = cloneNode(node, false);
-
- if (!formatNode)
- formatNode = curNode = node;
- else if (curNode)
- curNode.appendChild(node);
-
- curNode = node;
- });
-
- // Add something to the inner node
- if (curNode)
- curNode.innerHTML = tinymce.isIE ? ' ' : '<br data-mce-bogus="1" />';
-
- return false;
- }
- }, 'childNodes');
-
- cell = cloneNode(cell, false);
- setSpanVal(cell, 'rowSpan', 1);
- setSpanVal(cell, 'colSpan', 1);
-
- if (formatNode) {
- cell.appendChild(formatNode);
- } else {
- if (!tinymce.isIE)
- cell.innerHTML = '<br data-mce-bogus="1" />';
- }
-
- return cell;
- };
-
- function cleanup() {
- var rng = dom.createRng();
-
- // Empty rows
- each(dom.select('tr', table), function(tr) {
- if (tr.cells.length == 0)
- dom.remove(tr);
- });
-
- // Empty table
- if (dom.select('tr', table).length == 0) {
- rng.setStartAfter(table);
- rng.setEndAfter(table);
- selection.setRng(rng);
- dom.remove(table);
- return;
- }
-
- // Empty header/body/footer
- each(dom.select('thead,tbody,tfoot', table), function(part) {
- if (part.rows.length == 0)
- dom.remove(part);
- });
-
- // Restore selection to start position if it still exists
- buildGrid();
-
- // Restore the selection to the closest table position
- row = grid[Math.min(grid.length - 1, startPos.y)];
- if (row) {
- selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
- selection.collapse(true);
- }
- };
-
- function fillLeftDown(x, y, rows, cols) {
- var tr, x2, r, c, cell;
-
- tr = grid[y][x].elm.parentNode;
- for (r = 1; r <= rows; r++) {
- tr = dom.getNext(tr, 'tr');
-
- if (tr) {
- // Loop left to find real cell
- for (x2 = x; x2 >= 0; x2--) {
- cell = grid[y + r][x2].elm;
-
- if (cell.parentNode == tr) {
- // Append clones after
- for (c = 1; c <= cols; c++)
- dom.insertAfter(cloneCell(cell), cell);
-
- break;
- }
- }
-
- if (x2 == -1) {
- // Insert nodes before first cell
- for (c = 1; c <= cols; c++)
- tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
- }
- }
- }
- };
-
- function split() {
- each(grid, function(row, y) {
- each(row, function(cell, x) {
- var colSpan, rowSpan, newCell, i;
-
- if (isCellSelected(cell)) {
- cell = cell.elm;
- colSpan = getSpanVal(cell, 'colspan');
- rowSpan = getSpanVal(cell, 'rowspan');
-
- if (colSpan > 1 || rowSpan > 1) {
- setSpanVal(cell, 'rowSpan', 1);
- setSpanVal(cell, 'colSpan', 1);
-
- // Insert cells right
- for (i = 0; i < colSpan - 1; i++)
- dom.insertAfter(cloneCell(cell), cell);
-
- fillLeftDown(x, y, rowSpan - 1, colSpan);
- }
- }
- });
- });
- };
-
- function merge(cell, cols, rows) {
- var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count;
-
- // Use specified cell and cols/rows
- if (cell) {
- pos = getPos(cell);
- startX = pos.x;
- startY = pos.y;
- endX = startX + (cols - 1);
- endY = startY + (rows - 1);
- } else {
- startPos = endPos = null;
-
- // Calculate start/end pos by checking for selected cells in grid works better with context menu
- each(grid, function(row, y) {
- each(row, function(cell, x) {
- if (isCellSelected(cell)) {
- if (!startPos) {
- startPos = {x: x, y: y};
- }
-
- endPos = {x: x, y: y};
- }
- });
- });
-
- // Use selection
- startX = startPos.x;
- startY = startPos.y;
- endX = endPos.x;
- endY = endPos.y;
- }
-
- // Find start/end cells
- startCell = getCell(startX, startY);
- endCell = getCell(endX, endY);
-
- // Check if the cells exists and if they are of the same part for example tbody = tbody
- if (startCell && endCell && startCell.part == endCell.part) {
- // Split and rebuild grid
- split();
- buildGrid();
-
- // Set row/col span to start cell
- startCell = getCell(startX, startY).elm;
- setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
- setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
-
- // Remove other cells and add it's contents to the start cell
- for (y = startY; y <= endY; y++) {
- for (x = startX; x <= endX; x++) {
- if (!grid[y] || !grid[y][x])
- continue;
-
- cell = grid[y][x].elm;
-
- if (cell != startCell) {
- // Move children to startCell
- children = tinymce.grep(cell.childNodes);
- each(children, function(node) {
- startCell.appendChild(node);
- });
-
- // Remove bogus nodes if there is children in the target cell
- if (children.length) {
- children = tinymce.grep(startCell.childNodes);
- count = 0;
- each(children, function(node) {
- if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1)
- startCell.removeChild(node);
- });
- }
-
- // Remove cell
- dom.remove(cell);
- }
- }
- }
-
- // Remove empty rows etc and restore caret location
- cleanup();
- }
- };
-
- function insertRow(before) {
- var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
-
- // Find first/last row
- each(grid, function(row, y) {
- each(row, function(cell, x) {
- if (isCellSelected(cell)) {
- cell = cell.elm;
- rowElm = cell.parentNode;
- newRow = cloneNode(rowElm, false);
- posY = y;
-
- if (before)
- return false;
- }
- });
-
- if (before)
- return !posY;
- });
-
- for (x = 0; x < grid[0].length; x++) {
- // Cell not found could be because of an invalid table structure
- if (!grid[posY][x])
- continue;
-
- cell = grid[posY][x].elm;
-
- if (cell != lastCell) {
- if (!before) {
- rowSpan = getSpanVal(cell, 'rowspan');
- if (rowSpan > 1) {
- setSpanVal(cell, 'rowSpan', rowSpan + 1);
- continue;
- }
- } else {
- // Check if cell above can be expanded
- if (posY > 0 && grid[posY - 1][x]) {
- otherCell = grid[posY - 1][x].elm;
- rowSpan = getSpanVal(otherCell, 'rowSpan');
- if (rowSpan > 1) {
- setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
- continue;
- }
- }
- }
-
- // Insert new cell into new row
- newCell = cloneCell(cell);
- setSpanVal(newCell, 'colSpan', cell.colSpan);
-
- newRow.appendChild(newCell);
-
- lastCell = cell;
- }
- }
-
- if (newRow.hasChildNodes()) {
- if (!before)
- dom.insertAfter(newRow, rowElm);
- else
- rowElm.parentNode.insertBefore(newRow, rowElm);
- }
- };
-
- function insertCol(before) {
- var posX, lastCell;
-
- // Find first/last column
- each(grid, function(row, y) {
- each(row, function(cell, x) {
- if (isCellSelected(cell)) {
- posX = x;
-
- if (before)
- return false;
- }
- });
-
- if (before)
- return !posX;
- });
-
- each(grid, function(row, y) {
- var cell, rowSpan, colSpan;
-
- if (!row[posX])
- return;
-
- cell = row[posX].elm;
- if (cell != lastCell) {
- colSpan = getSpanVal(cell, 'colspan');
- rowSpan = getSpanVal(cell, 'rowspan');
-
- if (colSpan == 1) {
- if (!before) {
- dom.insertAfter(cloneCell(cell), cell);
- fillLeftDown(posX, y, rowSpan - 1, colSpan);
- } else {
- cell.parentNode.insertBefore(cloneCell(cell), cell);
- fillLeftDown(posX, y, rowSpan - 1, colSpan);
- }
- } else
- setSpanVal(cell, 'colSpan', cell.colSpan + 1);
-
- lastCell = cell;
- }
- });
- };
-
- function deleteCols() {
- var cols = [];
-
- // Get selected column indexes
- each(grid, function(row, y) {
- each(row, function(cell, x) {
- if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {
- each(grid, function(row) {
- var cell = row[x].elm, colSpan;
-
- colSpan = getSpanVal(cell, 'colSpan');
-
- if (colSpan > 1)
- setSpanVal(cell, 'colSpan', colSpan - 1);
- else
- dom.remove(cell);
- });
-
- cols.push(x);
- }
- });
- });
-
- cleanup();
- };
-
- function deleteRows() {
- var rows;
-
- function deleteRow(tr) {
- var nextTr, pos, lastCell;
-
- nextTr = dom.getNext(tr, 'tr');
-
- // Move down row spanned cells
- each(tr.cells, function(cell) {
- var rowSpan = getSpanVal(cell, 'rowSpan');
-
- if (rowSpan > 1) {
- setSpanVal(cell, 'rowSpan', rowSpan - 1);
- pos = getPos(cell);
- fillLeftDown(pos.x, pos.y, 1, 1);
- }
- });
-
- // Delete cells
- pos = getPos(tr.cells[0]);
- each(grid[pos.y], function(cell) {
- var rowSpan;
-
- cell = cell.elm;
-
- if (cell != lastCell) {
- rowSpan = getSpanVal(cell, 'rowSpan');
-
- if (rowSpan <= 1)
- dom.remove(cell);
- else
- setSpanVal(cell, 'rowSpan', rowSpan - 1);
-
- lastCell = cell;
- }
- });
- };
-
- // Get selected rows and move selection out of scope
- rows = getSelectedRows();
-
- // Delete all selected rows
- each(rows.reverse(), function(tr) {
- deleteRow(tr);
- });
-
- cleanup();
- };
-
- function cutRows() {
- var rows = getSelectedRows();
-
- dom.remove(rows);
- cleanup();
-
- return rows;
- };
-
- function copyRows() {
- var rows = getSelectedRows();
-
- each(rows, function(row, i) {
- rows[i] = cloneNode(row, true);
- });
-
- return rows;
- };
-
- function pasteRows(rows, before) {
- // If we don't have any rows in the clipboard, return immediately
- if(!rows)
- return;
-
- var selectedRows = getSelectedRows(),
- targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
- targetCellCount = targetRow.cells.length;
-
- // Calc target cell count
- each(grid, function(row) {
- var match;
-
- targetCellCount = 0;
- each(row, function(cell, x) {
- if (cell.real)
- targetCellCount += cell.colspan;
-
- if (cell.elm.parentNode == targetRow)
- match = 1;
- });
-
- if (match)
- return false;
- });
-
- if (!before)
- rows.reverse();
-
- each(rows, function(row) {
- var cellCount = row.cells.length, cell;
-
- // Remove col/rowspans
- for (i = 0; i < cellCount; i++) {
- cell = row.cells[i];
- setSpanVal(cell, 'colSpan', 1);
- setSpanVal(cell, 'rowSpan', 1);
- }
-
- // Needs more cells
- for (i = cellCount; i < targetCellCount; i++)
- row.appendChild(cloneCell(row.cells[cellCount - 1]));
-
- // Needs less cells
- for (i = targetCellCount; i < cellCount; i++)
- dom.remove(row.cells[i]);
-
- // Add before/after
- if (before)
- targetRow.parentNode.insertBefore(row, targetRow);
- else
- dom.insertAfter(row, targetRow);
- });
-
- // Remove current selection
- dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
- };
-
- function getPos(target) {
- var pos;
-
- each(grid, function(row, y) {
- each(row, function(cell, x) {
- if (cell.elm == target) {
- pos = {x : x, y : y};
- return false;
- }
- });
-
- return !pos;
- });
-
- return pos;
- };
-
- function setStartCell(cell) {
- startPos = getPos(cell);
- };
-
- function findEndPos() {
- var pos, maxX, maxY;
-
- maxX = maxY = 0;
-
- each(grid, function(row, y) {
- each(row, function(cell, x) {
- var colSpan, rowSpan;
-
- if (isCellSelected(cell)) {
- cell = grid[y][x];
-
- if (x > maxX)
- maxX = x;
-
- if (y > maxY)
- maxY = y;
-
- if (cell.real) {
- colSpan = cell.colspan - 1;
- rowSpan = cell.rowspan - 1;
-
- if (colSpan) {
- if (x + colSpan > maxX)
- maxX = x + colSpan;
- }
-
- if (rowSpan) {
- if (y + rowSpan > maxY)
- maxY = y + rowSpan;
- }
- }
- }
- });
- });
-
- return {x : maxX, y : maxY};
- };
-
- function setEndCell(cell) {
- var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;
-
- endPos = getPos(cell);
-
- if (startPos && endPos) {
- // Get start/end positions
- startX = Math.min(startPos.x, endPos.x);
- startY = Math.min(startPos.y, endPos.y);
- endX = Math.max(startPos.x, endPos.x);
- endY = Math.max(startPos.y, endPos.y);
-
- // Expand end positon to include spans
- maxX = endX;
- maxY = endY;
-
- // Expand startX
- for (y = startY; y <= maxY; y++) {
- cell = grid[y][startX];
-
- if (!cell.real) {
- if (startX - (cell.colspan - 1) < startX)
- startX -= cell.colspan - 1;
- }
- }
-
- // Expand startY
- for (x = startX; x <= maxX; x++) {
- cell = grid[startY][x];
-
- if (!cell.real) {
- if (startY - (cell.rowspan - 1) < startY)
- startY -= cell.rowspan - 1;
- }
- }
-
- // Find max X, Y
- for (y = startY; y <= endY; y++) {
- for (x = startX; x <= endX; x++) {
- cell = grid[y][x];
-
- if (cell.real) {
- colSpan = cell.colspan - 1;
- rowSpan = cell.rowspan - 1;
-
- if (colSpan) {
- if (x + colSpan > maxX)
- maxX = x + colSpan;
- }
-
- if (rowSpan) {
- if (y + rowSpan > maxY)
- maxY = y + rowSpan;
- }
- }
- }
- }
-
- // Remove current selection
- dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
-
- // Add new selection
- for (y = startY; y <= maxY; y++) {
- for (x = startX; x <= maxX; x++) {
- if (grid[y][x])
- dom.addClass(grid[y][x].elm, 'mceSelected');
- }
- }
- }
- };
-
- // Expose to public
- tinymce.extend(this, {
- deleteTable : deleteTable,
- split : split,
- merge : merge,
- insertRow : insertRow,
- insertCol : insertCol,
- deleteCols : deleteCols,
- deleteRows : deleteRows,
- cutRows : cutRows,
- copyRows : copyRows,
- pasteRows : pasteRows,
- getPos : getPos,
- setStartCell : setStartCell,
- setEndCell : setEndCell
- });
- };
-
- tinymce.create('tinymce.plugins.TablePlugin', {
- init : function(ed, url) {
- var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload
-
- function createTableGrid(node) {
- var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
-
- if (tblElm)
- return new TableGrid(tblElm, ed.dom, selection);
- };
-
- function cleanup() {
- // Restore selection possibilities
- ed.getBody().style.webkitUserSelect = '';
-
- if (hasCellSelection) {
- ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
- hasCellSelection = false;
- }
- };
-
- // Register buttons
- each([
- ['table', 'table.desc', 'mceInsertTable', true],
- ['delete_table', 'table.del', 'mceTableDelete'],
- ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
- ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
- ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
- ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
- ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
- ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
- ['row_props', 'table.row_desc', 'mceTableRowProps', true],
- ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
- ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
- ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
- ], function(c) {
- ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
- });
-
- // Select whole table is a table border is clicked
- if (!tinymce.isIE) {
- ed.onClick.add(function(ed, e) {
- e = e.target;
-
- if (e.nodeName === 'TABLE') {
- ed.selection.select(e);
- ed.nodeChanged();
- }
- });
- }
-
- ed.onPreProcess.add(function(ed, args) {
- var nodes, i, node, dom = ed.dom, value;
-
- nodes = dom.select('table', args.node);
- i = nodes.length;
- while (i--) {
- node = nodes[i];
- dom.setAttrib(node, 'data-mce-style', '');
-
- if ((value = dom.getAttrib(node, 'width'))) {
- dom.setStyle(node, 'width', value);
- dom.setAttrib(node, 'width', '');
- }
-
- if ((value = dom.getAttrib(node, 'height'))) {
- dom.setStyle(node, 'height', value);
- dom.setAttrib(node, 'height', '');
- }
- }
- });
-
- // Handle node change updates
- ed.onNodeChange.add(function(ed, cm, n) {
- var p;
-
- n = ed.selection.getStart();
- p = ed.dom.getParent(n, 'td,th,caption');
- cm.setActive('table', n.nodeName === 'TABLE' || !!p);
-
- // Disable table tools if we are in caption
- if (p && p.nodeName === 'CAPTION')
- p = 0;
-
- cm.setDisabled('delete_table', !p);
- cm.setDisabled('delete_col', !p);
- cm.setDisabled('delete_table', !p);
- cm.setDisabled('delete_row', !p);
- cm.setDisabled('col_after', !p);
- cm.setDisabled('col_before', !p);
- cm.setDisabled('row_after', !p);
- cm.setDisabled('row_before', !p);
- cm.setDisabled('row_props', !p);
- cm.setDisabled('cell_props', !p);
- cm.setDisabled('split_cells', !p);
- cm.setDisabled('merge_cells', !p);
- });
-
- ed.onInit.add(function(ed) {
- var startTable, startCell, dom = ed.dom, tableGrid;
-
- winMan = ed.windowManager;
-
- // Add cell selection logic
- ed.onMouseDown.add(function(ed, e) {
- if (e.button != 2) {
- cleanup();
-
- startCell = dom.getParent(e.target, 'td,th');
- startTable = dom.getParent(startCell, 'table');
- }
- });
-
- dom.bind(ed.getDoc(), 'mouseover', function(e) {
- var sel, table, target = e.target;
-
- if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
- table = dom.getParent(target, 'table');
- if (table == startTable) {
- if (!tableGrid) {
- tableGrid = createTableGrid(table);
- tableGrid.setStartCell(startCell);
-
- ed.getBody().style.webkitUserSelect = 'none';
- }
-
- tableGrid.setEndCell(target);
- hasCellSelection = true;
- }
-
- // Remove current selection
- sel = ed.selection.getSel();
-
- try {
- if (sel.removeAllRanges)
- sel.removeAllRanges();
- else
- sel.empty();
- } catch (ex) {
- // IE9 might throw errors here
- }
-
- e.preventDefault();
- }
- });
-
- ed.onMouseUp.add(function(ed, e) {
- var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;
-
- // Move selection to startCell
- if (startCell) {
- if (tableGrid)
- ed.getBody().style.webkitUserSelect = '';
-
- function setPoint(node, start) {
- var walker = new tinymce.dom.TreeWalker(node, node);
-
- do {
- // Text node
- if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {
- if (start)
- rng.setStart(node, 0);
- else
- rng.setEnd(node, node.nodeValue.length);
-
- return;
- }
-
- // BR element
- if (node.nodeName == 'BR') {
- if (start)
- rng.setStartBefore(node);
- else
- rng.setEndBefore(node);
-
- return;
- }
- } while (node = (start ? walker.next() : walker.prev()));
- }
-
- // Try to expand text selection as much as we can only Gecko supports cell selection
- selectedCells = dom.select('td.mceSelected,th.mceSelected');
- if (selectedCells.length > 0) {
- rng = dom.createRng();
- node = selectedCells[0];
- endNode = selectedCells[selectedCells.length - 1];
- rng.setStartBefore(node);
- rng.setEndAfter(node);
-
- setPoint(node, 1);
- walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
-
- do {
- if (node.nodeName == 'TD' || node.nodeName == 'TH') {
- if (!dom.hasClass(node, 'mceSelected'))
- break;
-
- lastNode = node;
- }
- } while (node = walker.next());
-
- setPoint(lastNode);
-
- sel.setRng(rng);
- }
-
- ed.nodeChanged();
- startCell = tableGrid = startTable = null;
- }
- });
-
- ed.onKeyUp.add(function(ed, e) {
- cleanup();
- });
-
- ed.onKeyDown.add(function (ed, e) {
- fixTableCellSelection(ed);
- });
-
- ed.onMouseDown.add(function (ed, e) {
- if (e.button != 2) {
- fixTableCellSelection(ed);
- }
- });
- function tableCellSelected(ed, rng, n, currentCell) {
- // The decision of when a table cell is selected is somewhat involved. The fact that this code is
- // required is actually a pointer to the root cause of this bug. A cell is selected when the start
- // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
- // or the parent of the table (in the case of the selection containing the last cell of a table).
- var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'),
- tableParent, allOfCellSelected, tableCellSelection;
- if (table)
- tableParent = table.parentNode;
- allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE &&
- rng.startOffset == 0 &&
- rng.endOffset == 0 &&
- currentCell &&
- (n.nodeName=="TR" || n==tableParent);
- tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell;
- return allOfCellSelected || tableCellSelection;
- // return false;
- }
-
- // this nasty hack is here to work around some WebKit selection bugs.
- function fixTableCellSelection(ed) {
- if (!tinymce.isWebKit)
- return;
-
- var rng = ed.selection.getRng();
- var n = ed.selection.getNode();
- var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH');
-
- if (!tableCellSelected(ed, rng, n, currentCell))
- return;
- if (!currentCell) {
- currentCell=n;
- }
-
- // Get the very last node inside the table cell
- var end = currentCell.lastChild;
- while (end.lastChild)
- end = end.lastChild;
-
- // Select the entire table cell. Nothing outside of the table cell should be selected.
- rng.setEnd(end, end.nodeValue.length);
- ed.selection.setRng(rng);
- }
- ed.plugins.table.fixTableCellSelection=fixTableCellSelection;
-
- // Add context menu
- if (ed && ed.plugins.contextmenu) {
- ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
- var sm, se = ed.selection, el = se.getNode() || ed.getBody();
-
- if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) {
- m.removeAll();
-
- if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
- m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
- m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
- m.addSeparator();
- }
-
- if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
- m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
- m.addSeparator();
- }
-
- m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});
- m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});
- m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});
- m.addSeparator();
-
- // Cell menu
- sm = m.addMenu({title : 'table.cell'});
- sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});
- sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});
- sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});
-
- // Row menu
- sm = m.addMenu({title : 'table.row'});
- sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});
- sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
- sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
- sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
- sm.addSeparator();
- sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
- sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
- sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);
- sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);
-
- // Column menu
- sm = m.addMenu({title : 'table.col'});
- sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
- sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
- sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
- } else
- m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});
- });
- }
-
- // Fix to allow navigating up and down in a table in WebKit browsers.
- if (tinymce.isWebKit) {
- function moveSelection(ed, e) {
- var VK = tinymce.VK;
- var key = e.keyCode;
-
- function handle(upBool, sourceNode, event) {
- var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
- var currentRow = ed.dom.getParent(sourceNode, 'tr');
- var siblingRow = currentRow[siblingDirection];
-
- if (siblingRow) {
- moveCursorToRow(ed, sourceNode, siblingRow, upBool);
- tinymce.dom.Event.cancel(event);
- return true;
- } else {
- var tableNode = ed.dom.getParent(currentRow, 'table');
- var middleNode = currentRow.parentNode;
- var parentNodeName = middleNode.nodeName.toLowerCase();
- if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
- var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
- if (targetParent !== null) {
- return moveToRowInTarget(upBool, targetParent, sourceNode, event);
- }
- }
- return escapeTable(upBool, currentRow, siblingDirection, tableNode, event);
- }
- }
-
- function getTargetParent(upBool, topNode, secondNode, nodeName) {
- var tbodies = ed.dom.select('>' + nodeName, topNode);
- var position = tbodies.indexOf(secondNode);
- if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
- return getFirstHeadOrFoot(upBool, topNode);
- } else if (position === -1) {
- var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
- return tbodies[topOrBottom];
- } else {
- return tbodies[position + (upBool ? -1 : 1)];
- }
- }
-
- function getFirstHeadOrFoot(upBool, parent) {
- var tagName = upBool ? 'thead' : 'tfoot';
- var headOrFoot = ed.dom.select('>' + tagName, parent);
- return headOrFoot.length !== 0 ? headOrFoot[0] : null;
- }
-
- function moveToRowInTarget(upBool, targetParent, sourceNode, event) {
- var targetRow = getChildForDirection(targetParent, upBool);
- targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);
- tinymce.dom.Event.cancel(event);
- return true;
- }
-
- function escapeTable(upBool, currentRow, siblingDirection, table, event) {
- var tableSibling = table[siblingDirection];
- if (tableSibling) {
- moveCursorToStartOfElement(tableSibling);
- return true;
- } else {
- var parentCell = ed.dom.getParent(table, 'td,th');
- if (parentCell) {
- return handle(upBool, parentCell, event);
- } else {
- var backUpSibling = getChildForDirection(currentRow, !upBool);
- moveCursorToStartOfElement(backUpSibling);
- return tinymce.dom.Event.cancel(event);
- }
- }
- }
-
- function getChildForDirection(parent, up) {
- var child = parent && parent[up ? 'lastChild' : 'firstChild'];
- // BR is not a valid table child to return in this case we return the table cell
- return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child;
- }
-
- function moveCursorToStartOfElement(n) {
- ed.selection.setCursorLocation(n, 0);
- }
-
- function isVerticalMovement() {
- return key == VK.UP || key == VK.DOWN;
- }
-
- function isInTable(ed) {
- var node = ed.selection.getNode();
- var currentRow = ed.dom.getParent(node, 'tr');
- return currentRow !== null;
- }
-
- function columnIndex(column) {
- var colIndex = 0;
- var c = column;
- while (c.previousSibling) {
- c = c.previousSibling;
- colIndex = colIndex + getSpanVal(c, "colspan");
- }
- return colIndex;
- }
-
- function findColumn(rowElement, columnIndex) {
- var c = 0;
- var r = 0;
- each(rowElement.children, function(cell, i) {
- c = c + getSpanVal(cell, "colspan");
- r = i;
- if (c > columnIndex)
- return false;
- });
- return r;
- }
-
- function moveCursorToRow(ed, node, row, upBool) {
- var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th'));
- var tgtColumnIndex = findColumn(row, srcColumnIndex);
- var tgtNode = row.childNodes[tgtColumnIndex];
- var rowCellTarget = getChildForDirection(tgtNode, upBool);
- moveCursorToStartOfElement(rowCellTarget || tgtNode);
- }
-
- function shouldFixCaret(preBrowserNode) {
- var newNode = ed.selection.getNode();
- var newParent = ed.dom.getParent(newNode, 'td,th');
- var oldParent = ed.dom.getParent(preBrowserNode, 'td,th');
- return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent)
- }
-
- function checkSameParentTable(nodeOne, NodeTwo) {
- return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE');
- }
-
- if (isVerticalMovement() && isInTable(ed)) {
- var preBrowserNode = ed.selection.getNode();
- setTimeout(function() {
- if (shouldFixCaret(preBrowserNode)) {
- handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
- }
- }, 0);
- }
- }
-
- ed.onKeyDown.add(moveSelection);
- }
-
- // Fixes an issue on Gecko where it's impossible to place the caret behind a table
- // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
- function fixTableCaretPos() {
- var last;
-
- // Skip empty text nodes form the end
- for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
-
- if (last && last.nodeName == 'TABLE') {
- if (ed.settings.forced_root_block)
- ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '<br data-mce-bogus="1" />');
- else
- ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
- }
- };
-
- // Fixes an bug where it's impossible to place the caret before a table in Gecko
- // this fix solves it by detecting when the caret is at the beginning of such a table
- // and then manually moves the caret infront of the table
- if (tinymce.isGecko) {
- ed.onKeyDown.add(function(ed, e) {
- var rng, table, dom = ed.dom;
-
- // On gecko it's not possible to place the caret before a table
- if (e.keyCode == 37 || e.keyCode == 38) {
- rng = ed.selection.getRng();
- table = dom.getParent(rng.startContainer, 'table');
-
- if (table && ed.getBody().firstChild == table) {
- if (isAtStart(rng, table)) {
- rng = dom.createRng();
-
- rng.setStartBefore(table);
- rng.setEndBefore(table);
-
- ed.selection.setRng(rng);
-
- e.preventDefault();
- }
- }
- }
- });
- }
-
- ed.onKeyUp.add(fixTableCaretPos);
- ed.onSetContent.add(fixTableCaretPos);
- ed.onVisualAid.add(fixTableCaretPos);
-
- ed.onPreProcess.add(function(ed, o) {
- var last = o.node.lastChild;
-
- if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") {
- ed.dom.remove(last);
- }
- });
-
-
- /**
- * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
- *
- * Removed: Since the new enter logic seems to fix this one.
- */
- /*
- if (tinymce.isGecko) {
- ed.onKeyDown.add(function(ed, e) {
- if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
- var node = ed.selection.getRng().startContainer;
- var tableCell = dom.getParent(node, 'td,th');
- if (tableCell) {
- var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
- dom.insertAfter(zeroSizedNbsp, node);
- }
- }
- });
- }
- */
-
- fixTableCaretPos();
- ed.startContent = ed.getContent({format : 'raw'});
- });
-
- // Register action commands
- each({
- mceTableSplitCells : function(grid) {
- grid.split();
- },
-
- mceTableMergeCells : function(grid) {
- var rowSpan, colSpan, cell;
-
- cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');
- if (cell) {
- rowSpan = cell.rowSpan;
- colSpan = cell.colSpan;
- }
-
- if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {
- winMan.open({
- url : url + '/merge_cells.htm',
- width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),
- height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),
- inline : 1
- }, {
- rows : rowSpan,
- cols : colSpan,
- onaction : function(data) {
- grid.merge(cell, data.cols, data.rows);
- },
- plugin_url : url
- });
- } else
- grid.merge();
- },
-
- mceTableInsertRowBefore : function(grid) {
- grid.insertRow(true);
- },
-
- mceTableInsertRowAfter : function(grid) {
- grid.insertRow();
- },
-
- mceTableInsertColBefore : function(grid) {
- grid.insertCol(true);
- },
-
- mceTableInsertColAfter : function(grid) {
- grid.insertCol();
- },
-
- mceTableDeleteCol : function(grid) {
- grid.deleteCols();
- },
-
- mceTableDeleteRow : function(grid) {
- grid.deleteRows();
- },
-
- mceTableCutRow : function(grid) {
- clipboardRows = grid.cutRows();
- },
-
- mceTableCopyRow : function(grid) {
- clipboardRows = grid.copyRows();
- },
-
- mceTablePasteRowBefore : function(grid) {
- grid.pasteRows(clipboardRows, true);
- },
-
- mceTablePasteRowAfter : function(grid) {
- grid.pasteRows(clipboardRows);
- },
-
- mceTableDelete : function(grid) {
- grid.deleteTable();
- }
- }, function(func, name) {
- ed.addCommand(name, function() {
- var grid = createTableGrid();
-
- if (grid) {
- func(grid);
- ed.execCommand('mceRepaint');
- cleanup();
- }
- });
- });
-
- // Register dialog commands
- each({
- mceInsertTable : function(val) {
- winMan.open({
- url : url + '/table.htm',
- width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),
- height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),
- inline : 1
- }, {
- plugin_url : url,
- action : val ? val.action : 0
- });
- },
-
- mceTableRowProps : function() {
- winMan.open({
- url : url + '/row.htm',
- width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),
- height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),
- inline : 1
- }, {
- plugin_url : url
- });
- },
-
- mceTableCellProps : function() {
- winMan.open({
- url : url + '/cell.htm',
- width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),
- height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),
- inline : 1
- }, {
- plugin_url : url
- });
- }
- }, function(func, name) {
- ed.addCommand(name, function(ui, val) {
- func(val);
- });
- });
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
-})(tinymce);
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var ed;\r
-\r
-function init() {\r
- ed = tinyMCEPopup.editor;\r
- tinyMCEPopup.resizeToInnerSize();\r
-\r
- document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
- document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');\r
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')\r
-\r
- var inst = ed;\r
- var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th");\r
- var formObj = document.forms[0];\r
- var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));\r
-\r
- // Get table cell data\r
- var celltype = tdElm.nodeName.toLowerCase();\r
- var align = ed.dom.getAttrib(tdElm, 'align');\r
- var valign = ed.dom.getAttrib(tdElm, 'valign');\r
- var width = trimSize(getStyle(tdElm, 'width', 'width'));\r
- var height = trimSize(getStyle(tdElm, 'height', 'height'));\r
- var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));\r
- var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));\r
- var className = ed.dom.getAttrib(tdElm, 'class');\r
- var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");\r
- var id = ed.dom.getAttrib(tdElm, 'id');\r
- var lang = ed.dom.getAttrib(tdElm, 'lang');\r
- var dir = ed.dom.getAttrib(tdElm, 'dir');\r
- var scope = ed.dom.getAttrib(tdElm, 'scope');\r
-\r
- // Setup form\r
- addClassesToList('class', 'table_cell_styles');\r
- TinyMCE_EditableSelects.init();\r
-\r
- if (!ed.dom.hasClass(tdElm, 'mceSelected')) {\r
- formObj.bordercolor.value = bordercolor;\r
- formObj.bgcolor.value = bgcolor;\r
- formObj.backgroundimage.value = backgroundimage;\r
- formObj.width.value = width;\r
- formObj.height.value = height;\r
- formObj.id.value = id;\r
- formObj.lang.value = lang;\r
- formObj.style.value = ed.dom.serializeStyle(st);\r
- selectByValue(formObj, 'align', align);\r
- selectByValue(formObj, 'valign', valign);\r
- selectByValue(formObj, 'class', className, true, true);\r
- selectByValue(formObj, 'celltype', celltype);\r
- selectByValue(formObj, 'dir', dir);\r
- selectByValue(formObj, 'scope', scope);\r
-\r
- // Resize some elements\r
- if (isVisible('backgroundimagebrowser'))\r
- document.getElementById('backgroundimage').style.width = '180px';\r
-\r
- updateColor('bordercolor_pick', 'bordercolor');\r
- updateColor('bgcolor_pick', 'bgcolor');\r
- } else\r
- tinyMCEPopup.dom.hide('action');\r
-}\r
-\r
-function updateAction() {\r
- var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];\r
-\r
- if (!AutoValidator.validate(formObj)) {\r
- tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');\r
- return false;\r
- }\r
-\r
- tinyMCEPopup.restoreSelection();\r
- el = ed.selection.getStart();\r
- tdElm = ed.dom.getParent(el, "td,th");\r
- trElm = ed.dom.getParent(el, "tr");\r
- tableElm = ed.dom.getParent(el, "table");\r
-\r
- // Cell is selected\r
- if (ed.dom.hasClass(tdElm, 'mceSelected')) {\r
- // Update all selected sells\r
- tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) {\r
- updateCell(td);\r
- });\r
-\r
- ed.addVisual();\r
- ed.nodeChanged();\r
- inst.execCommand('mceEndUndoLevel');\r
- tinyMCEPopup.close();\r
- return;\r
- }\r
-\r
- switch (getSelectValue(formObj, 'action')) {\r
- case "cell":\r
- var celltype = getSelectValue(formObj, 'celltype');\r
- var scope = getSelectValue(formObj, 'scope');\r
-\r
- function doUpdate(s) {\r
- if (s) {\r
- updateCell(tdElm);\r
-\r
- ed.addVisual();\r
- ed.nodeChanged();\r
- inst.execCommand('mceEndUndoLevel');\r
- tinyMCEPopup.close();\r
- }\r
- };\r
-\r
- if (ed.getParam("accessibility_warnings", 1)) {\r
- if (celltype == "th" && scope == "")\r
- tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate);\r
- else\r
- doUpdate(1);\r
-\r
- return;\r
- }\r
-\r
- updateCell(tdElm);\r
- break;\r
-\r
- case "row":\r
- var cell = trElm.firstChild;\r
-\r
- if (cell.nodeName != "TD" && cell.nodeName != "TH")\r
- cell = nextCell(cell);\r
-\r
- do {\r
- cell = updateCell(cell, true);\r
- } while ((cell = nextCell(cell)) != null);\r
-\r
- break;\r
-\r
- case "col":\r
- var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr");\r
-\r
- if (cell.nodeName != "TD" && cell.nodeName != "TH")\r
- cell = nextCell(cell);\r
-\r
- do {\r
- if (cell == tdElm)\r
- break;\r
- col += cell.getAttribute("colspan")?cell.getAttribute("colspan"):1;\r
- } while ((cell = nextCell(cell)) != null);\r
-\r
- for (var i=0; i<rows.length; i++) {\r
- cell = rows[i].firstChild;\r
-\r
- if (cell.nodeName != "TD" && cell.nodeName != "TH")\r
- cell = nextCell(cell);\r
-\r
- curr = 0;\r
- do {\r
- if (curr == col) {\r
- cell = updateCell(cell, true);\r
- break;\r
- }\r
- curr += cell.getAttribute("colspan")?cell.getAttribute("colspan"):1;\r
- } while ((cell = nextCell(cell)) != null);\r
- }\r
-\r
- break;\r
-\r
- case "all":\r
- var rows = tableElm.getElementsByTagName("tr");\r
-\r
- for (var i=0; i<rows.length; i++) {\r
- var cell = rows[i].firstChild;\r
-\r
- if (cell.nodeName != "TD" && cell.nodeName != "TH")\r
- cell = nextCell(cell);\r
-\r
- do {\r
- cell = updateCell(cell, true);\r
- } while ((cell = nextCell(cell)) != null);\r
- }\r
-\r
- break;\r
- }\r
-\r
- ed.addVisual();\r
- ed.nodeChanged();\r
- inst.execCommand('mceEndUndoLevel');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function nextCell(elm) {\r
- while ((elm = elm.nextSibling) != null) {\r
- if (elm.nodeName == "TD" || elm.nodeName == "TH")\r
- return elm;\r
- }\r
-\r
- return null;\r
-}\r
-\r
-function updateCell(td, skip_id) {\r
- var inst = ed;\r
- var formObj = document.forms[0];\r
- var curCellType = td.nodeName.toLowerCase();\r
- var celltype = getSelectValue(formObj, 'celltype');\r
- var doc = inst.getDoc();\r
- var dom = ed.dom;\r
-\r
- if (!skip_id)\r
- dom.setAttrib(td, 'id', formObj.id.value);\r
-\r
- dom.setAttrib(td, 'align', formObj.align.value);\r
- dom.setAttrib(td, 'vAlign', formObj.valign.value);\r
- dom.setAttrib(td, 'lang', formObj.lang.value);\r
- dom.setAttrib(td, 'dir', getSelectValue(formObj, 'dir'));\r
- dom.setAttrib(td, 'style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));\r
- dom.setAttrib(td, 'scope', formObj.scope.value);\r
- dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));\r
-\r
- // Clear deprecated attributes\r
- ed.dom.setAttrib(td, 'width', '');\r
- ed.dom.setAttrib(td, 'height', '');\r
- ed.dom.setAttrib(td, 'bgColor', '');\r
- ed.dom.setAttrib(td, 'borderColor', '');\r
- ed.dom.setAttrib(td, 'background', '');\r
-\r
- // Set styles\r
- td.style.width = getCSSSize(formObj.width.value);\r
- td.style.height = getCSSSize(formObj.height.value);\r
- if (formObj.bordercolor.value != "") {\r
- td.style.borderColor = formObj.bordercolor.value;\r
- td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;\r
- td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;\r
- } else\r
- td.style.borderColor = '';\r
-\r
- td.style.backgroundColor = formObj.bgcolor.value;\r
-\r
- if (formObj.backgroundimage.value != "")\r
- td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";\r
- else\r
- td.style.backgroundImage = '';\r
-\r
- if (curCellType != celltype) {\r
- // changing to a different node type\r
- var newCell = doc.createElement(celltype);\r
-\r
- for (var c=0; c<td.childNodes.length; c++)\r
- newCell.appendChild(td.childNodes[c].cloneNode(1));\r
-\r
- for (var a=0; a<td.attributes.length; a++)\r
- ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name));\r
-\r
- td.parentNode.replaceChild(newCell, td);\r
- td = newCell;\r
- }\r
-\r
- dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));\r
-\r
- return td;\r
-}\r
-\r
-function changedBackgroundImage() {\r
- var formObj = document.forms[0];\r
- var st = ed.dom.parseStyle(formObj.style.value);\r
-\r
- st['background-image'] = "url('" + formObj.backgroundimage.value + "')";\r
-\r
- formObj.style.value = ed.dom.serializeStyle(st);\r
-}\r
-\r
-function changedSize() {\r
- var formObj = document.forms[0];\r
- var st = ed.dom.parseStyle(formObj.style.value);\r
-\r
- var width = formObj.width.value;\r
- if (width != "")\r
- st['width'] = getCSSSize(width);\r
- else\r
- st['width'] = "";\r
-\r
- var height = formObj.height.value;\r
- if (height != "")\r
- st['height'] = getCSSSize(height);\r
- else\r
- st['height'] = "";\r
-\r
- formObj.style.value = ed.dom.serializeStyle(st);\r
-}\r
-\r
-function changedColor() {\r
- var formObj = document.forms[0];\r
- var st = ed.dom.parseStyle(formObj.style.value);\r
-\r
- st['background-color'] = formObj.bgcolor.value;\r
- st['border-color'] = formObj.bordercolor.value;\r
-\r
- formObj.style.value = ed.dom.serializeStyle(st);\r
-}\r
-\r
-function changedStyle() {\r
- var formObj = document.forms[0];\r
- var st = ed.dom.parseStyle(formObj.style.value);\r
-\r
- if (st['background-image'])\r
- formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
- else\r
- formObj.backgroundimage.value = '';\r
-\r
- if (st['width'])\r
- formObj.width.value = trimSize(st['width']);\r
-\r
- if (st['height'])\r
- formObj.height.value = trimSize(st['height']);\r
-\r
- if (st['background-color']) {\r
- formObj.bgcolor.value = st['background-color'];\r
- updateColor('bgcolor_pick','bgcolor');\r
- }\r
-\r
- if (st['border-color']) {\r
- formObj.bordercolor.value = st['border-color'];\r
- updateColor('bordercolor_pick','bordercolor');\r
- }\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var MergeCellsDialog = {\r
- init : function() {\r
- var f = document.forms[0];\r
-\r
- f.numcols.value = tinyMCEPopup.getWindowArg('cols', 1);\r
- f.numrows.value = tinyMCEPopup.getWindowArg('rows', 1);\r
- },\r
-\r
- merge : function() {\r
- var func, f = document.forms[0];\r
-\r
- tinyMCEPopup.restoreSelection();\r
-\r
- func = tinyMCEPopup.getWindowArg('onaction');\r
-\r
- func({\r
- cols : f.numcols.value,\r
- rows : f.numrows.value\r
- });\r
-\r
- tinyMCEPopup.close();\r
- }\r
-};\r
-\r
-tinyMCEPopup.onInit.add(MergeCellsDialog.init, MergeCellsDialog);\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-function init() {\r
- tinyMCEPopup.resizeToInnerSize();\r
-\r
- document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
-\r
- var inst = tinyMCEPopup.editor;\r
- var dom = inst.dom;\r
- var trElm = dom.getParent(inst.selection.getStart(), "tr");\r
- var formObj = document.forms[0];\r
- var st = dom.parseStyle(dom.getAttrib(trElm, "style"));\r
-\r
- // Get table row data\r
- var rowtype = trElm.parentNode.nodeName.toLowerCase();\r
- var align = dom.getAttrib(trElm, 'align');\r
- var valign = dom.getAttrib(trElm, 'valign');\r
- var height = trimSize(getStyle(trElm, 'height', 'height'));\r
- var className = dom.getAttrib(trElm, 'class');\r
- var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));\r
- var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");\r
- var id = dom.getAttrib(trElm, 'id');\r
- var lang = dom.getAttrib(trElm, 'lang');\r
- var dir = dom.getAttrib(trElm, 'dir');\r
-\r
- selectByValue(formObj, 'rowtype', rowtype);\r
- setActionforRowType(formObj, rowtype);\r
-\r
- // Any cells selected\r
- if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {\r
- // Setup form\r
- addClassesToList('class', 'table_row_styles');\r
- TinyMCE_EditableSelects.init();\r
-\r
- formObj.bgcolor.value = bgcolor;\r
- formObj.backgroundimage.value = backgroundimage;\r
- formObj.height.value = height;\r
- formObj.id.value = id;\r
- formObj.lang.value = lang;\r
- formObj.style.value = dom.serializeStyle(st);\r
- selectByValue(formObj, 'align', align);\r
- selectByValue(formObj, 'valign', valign);\r
- selectByValue(formObj, 'class', className, true, true);\r
- selectByValue(formObj, 'dir', dir);\r
-\r
- // Resize some elements\r
- if (isVisible('backgroundimagebrowser'))\r
- document.getElementById('backgroundimage').style.width = '180px';\r
-\r
- updateColor('bgcolor_pick', 'bgcolor');\r
- } else\r
- tinyMCEPopup.dom.hide('action');\r
-}\r
-\r
-function updateAction() {\r
- var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];\r
- var action = getSelectValue(formObj, 'action');\r
-\r
- if (!AutoValidator.validate(formObj)) {\r
- tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');\r
- return false;\r
- }\r
-\r
- tinyMCEPopup.restoreSelection();\r
- trElm = dom.getParent(inst.selection.getStart(), "tr");\r
- tableElm = dom.getParent(inst.selection.getStart(), "table");\r
-\r
- // Update all selected rows\r
- if (dom.select('td.mceSelected,th.mceSelected', trElm).length > 0) {\r
- tinymce.each(tableElm.rows, function(tr) {\r
- var i;\r
-\r
- for (i = 0; i < tr.cells.length; i++) {\r
- if (dom.hasClass(tr.cells[i], 'mceSelected')) {\r
- updateRow(tr, true);\r
- return;\r
- }\r
- }\r
- });\r
-\r
- inst.addVisual();\r
- inst.nodeChanged();\r
- inst.execCommand('mceEndUndoLevel');\r
- tinyMCEPopup.close();\r
- return;\r
- }\r
-\r
- switch (action) {\r
- case "row":\r
- updateRow(trElm);\r
- break;\r
-\r
- case "all":\r
- var rows = tableElm.getElementsByTagName("tr");\r
-\r
- for (var i=0; i<rows.length; i++)\r
- updateRow(rows[i], true);\r
-\r
- break;\r
-\r
- case "odd":\r
- case "even":\r
- var rows = tableElm.getElementsByTagName("tr");\r
-\r
- for (var i=0; i<rows.length; i++) {\r
- if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))\r
- updateRow(rows[i], true, true);\r
- }\r
-\r
- break;\r
- }\r
-\r
- inst.addVisual();\r
- inst.nodeChanged();\r
- inst.execCommand('mceEndUndoLevel');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function updateRow(tr_elm, skip_id, skip_parent) {\r
- var inst = tinyMCEPopup.editor;\r
- var formObj = document.forms[0];\r
- var dom = inst.dom;\r
- var curRowType = tr_elm.parentNode.nodeName.toLowerCase();\r
- var rowtype = getSelectValue(formObj, 'rowtype');\r
- var doc = inst.getDoc();\r
-\r
- // Update row element\r
- if (!skip_id)\r
- dom.setAttrib(tr_elm, 'id', formObj.id.value);\r
-\r
- dom.setAttrib(tr_elm, 'align', getSelectValue(formObj, 'align'));\r
- dom.setAttrib(tr_elm, 'vAlign', getSelectValue(formObj, 'valign'));\r
- dom.setAttrib(tr_elm, 'lang', formObj.lang.value);\r
- dom.setAttrib(tr_elm, 'dir', getSelectValue(formObj, 'dir'));\r
- dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));\r
- dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));\r
-\r
- // Clear deprecated attributes\r
- dom.setAttrib(tr_elm, 'background', '');\r
- dom.setAttrib(tr_elm, 'bgColor', '');\r
- dom.setAttrib(tr_elm, 'height', '');\r
-\r
- // Set styles\r
- tr_elm.style.height = getCSSSize(formObj.height.value);\r
- tr_elm.style.backgroundColor = formObj.bgcolor.value;\r
-\r
- if (formObj.backgroundimage.value != "")\r
- tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";\r
- else\r
- tr_elm.style.backgroundImage = '';\r
-\r
- // Setup new rowtype\r
- if (curRowType != rowtype && !skip_parent) {\r
- // first, clone the node we are working on\r
- var newRow = tr_elm.cloneNode(1);\r
-\r
- // next, find the parent of its new destination (creating it if necessary)\r
- var theTable = dom.getParent(tr_elm, "table");\r
- var dest = rowtype;\r
- var newParent = null;\r
- for (var i = 0; i < theTable.childNodes.length; i++) {\r
- if (theTable.childNodes[i].nodeName.toLowerCase() == dest)\r
- newParent = theTable.childNodes[i];\r
- }\r
-\r
- if (newParent == null) {\r
- newParent = doc.createElement(dest);\r
-\r
- if (theTable.firstChild.nodeName == 'CAPTION')\r
- inst.dom.insertAfter(newParent, theTable.firstChild);\r
- else\r
- theTable.insertBefore(newParent, theTable.firstChild);\r
- }\r
-\r
- // append the row to the new parent\r
- newParent.appendChild(newRow);\r
-\r
- // remove the original\r
- tr_elm.parentNode.removeChild(tr_elm);\r
-\r
- // set tr_elm to the new node\r
- tr_elm = newRow;\r
- }\r
-\r
- dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));\r
-}\r
-\r
-function changedBackgroundImage() {\r
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
- var st = dom.parseStyle(formObj.style.value);\r
-\r
- st['background-image'] = "url('" + formObj.backgroundimage.value + "')";\r
-\r
- formObj.style.value = dom.serializeStyle(st);\r
-}\r
-\r
-function changedStyle() {\r
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
- var st = dom.parseStyle(formObj.style.value);\r
-\r
- if (st['background-image'])\r
- formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
- else\r
- formObj.backgroundimage.value = '';\r
-\r
- if (st['height'])\r
- formObj.height.value = trimSize(st['height']);\r
-\r
- if (st['background-color']) {\r
- formObj.bgcolor.value = st['background-color'];\r
- updateColor('bgcolor_pick','bgcolor');\r
- }\r
-}\r
-\r
-function changedSize() {\r
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
- var st = dom.parseStyle(formObj.style.value);\r
-\r
- var height = formObj.height.value;\r
- if (height != "")\r
- st['height'] = getCSSSize(height);\r
- else\r
- st['height'] = "";\r
-\r
- formObj.style.value = dom.serializeStyle(st);\r
-}\r
-\r
-function changedColor() {\r
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
- var st = dom.parseStyle(formObj.style.value);\r
-\r
- st['background-color'] = formObj.bgcolor.value;\r
-\r
- formObj.style.value = dom.serializeStyle(st);\r
-}\r
-\r
-function changedRowType() {\r
- var formObj = document.forms[0];\r
- var rowtype = getSelectValue(formObj, 'rowtype');\r
-\r
- setActionforRowType(formObj, rowtype);\r
-\r
-}\r
-\r
-function setActionforRowType(formObj, rowtype) {\r
- if (rowtype === "tbody") {\r
- formObj.action.disabled = false;\r
- } else {\r
- selectByValue(formObj, 'action', "row");\r
- formObj.action.disabled = true;\r
- }\r
-}\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;\r
-\r
-function insertTable() {\r
- var formObj = document.forms[0];\r
- var inst = tinyMCEPopup.editor, dom = inst.dom;\r
- var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;\r
- var html = '', capEl, elm;\r
- var cellLimit, rowLimit, colLimit;\r
-\r
- tinyMCEPopup.restoreSelection();\r
-\r
- if (!AutoValidator.validate(formObj)) {\r
- tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');\r
- return false;\r
- }\r
-\r
- elm = dom.getParent(inst.selection.getNode(), 'table');\r
-\r
- // Get form data\r
- cols = formObj.elements['cols'].value;\r
- rows = formObj.elements['rows'].value;\r
- border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;\r
- cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";\r
- cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";\r
- align = getSelectValue(formObj, "align");\r
- frame = getSelectValue(formObj, "tframe");\r
- rules = getSelectValue(formObj, "rules");\r
- width = formObj.elements['width'].value;\r
- height = formObj.elements['height'].value;\r
- bordercolor = formObj.elements['bordercolor'].value;\r
- bgcolor = formObj.elements['bgcolor'].value;\r
- className = getSelectValue(formObj, "class");\r
- id = formObj.elements['id'].value;\r
- summary = formObj.elements['summary'].value;\r
- style = formObj.elements['style'].value;\r
- dir = formObj.elements['dir'].value;\r
- lang = formObj.elements['lang'].value;\r
- background = formObj.elements['backgroundimage'].value;\r
- caption = formObj.elements['caption'].checked;\r
-\r
- cellLimit = tinyMCEPopup.getParam('table_cell_limit', false);\r
- rowLimit = tinyMCEPopup.getParam('table_row_limit', false);\r
- colLimit = tinyMCEPopup.getParam('table_col_limit', false);\r
-\r
- // Validate table size\r
- if (colLimit && cols > colLimit) {\r
- tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));\r
- return false;\r
- } else if (rowLimit && rows > rowLimit) {\r
- tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));\r
- return false;\r
- } else if (cellLimit && cols * rows > cellLimit) {\r
- tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));\r
- return false;\r
- }\r
-\r
- // Update table\r
- if (action == "update") {\r
- dom.setAttrib(elm, 'cellPadding', cellpadding, true);\r
- dom.setAttrib(elm, 'cellSpacing', cellspacing, true);\r
-\r
- if (!isCssSize(border)) {\r
- dom.setAttrib(elm, 'border', border);\r
- } else {\r
- dom.setAttrib(elm, 'border', '');\r
- }\r
-\r
- if (border == '') {\r
- dom.setStyle(elm, 'border-width', '');\r
- dom.setStyle(elm, 'border', '');\r
- dom.setAttrib(elm, 'border', '');\r
- }\r
-\r
- dom.setAttrib(elm, 'align', align);\r
- dom.setAttrib(elm, 'frame', frame);\r
- dom.setAttrib(elm, 'rules', rules);\r
- dom.setAttrib(elm, 'class', className);\r
- dom.setAttrib(elm, 'style', style);\r
- dom.setAttrib(elm, 'id', id);\r
- dom.setAttrib(elm, 'summary', summary);\r
- dom.setAttrib(elm, 'dir', dir);\r
- dom.setAttrib(elm, 'lang', lang);\r
-\r
- capEl = inst.dom.select('caption', elm)[0];\r
-\r
- if (capEl && !caption)\r
- capEl.parentNode.removeChild(capEl);\r
-\r
- if (!capEl && caption) {\r
- capEl = elm.ownerDocument.createElement('caption');\r
-\r
- if (!tinymce.isIE)\r
- capEl.innerHTML = '<br data-mce-bogus="1"/>';\r
-\r
- elm.insertBefore(capEl, elm.firstChild);\r
- }\r
-\r
- if (width && inst.settings.inline_styles) {\r
- dom.setStyle(elm, 'width', width);\r
- dom.setAttrib(elm, 'width', '');\r
- } else {\r
- dom.setAttrib(elm, 'width', width, true);\r
- dom.setStyle(elm, 'width', '');\r
- }\r
-\r
- // Remove these since they are not valid XHTML\r
- dom.setAttrib(elm, 'borderColor', '');\r
- dom.setAttrib(elm, 'bgColor', '');\r
- dom.setAttrib(elm, 'background', '');\r
-\r
- if (height && inst.settings.inline_styles) {\r
- dom.setStyle(elm, 'height', height);\r
- dom.setAttrib(elm, 'height', '');\r
- } else {\r
- dom.setAttrib(elm, 'height', height, true);\r
- dom.setStyle(elm, 'height', '');\r
- }\r
-\r
- if (background != '')\r
- elm.style.backgroundImage = "url('" + background + "')";\r
- else\r
- elm.style.backgroundImage = '';\r
-\r
-/* if (tinyMCEPopup.getParam("inline_styles")) {\r
- if (width != '')\r
- elm.style.width = getCSSSize(width);\r
- }*/\r
-\r
- if (bordercolor != "") {\r
- elm.style.borderColor = bordercolor;\r
- elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;\r
- elm.style.borderWidth = cssSize(border);\r
- } else\r
- elm.style.borderColor = '';\r
-\r
- elm.style.backgroundColor = bgcolor;\r
- elm.style.height = getCSSSize(height);\r
-\r
- inst.addVisual();\r
-\r
- // Fix for stange MSIE align bug\r
- //elm.outerHTML = elm.outerHTML;\r
-\r
- inst.nodeChanged();\r
- inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true});\r
-\r
- // Repaint if dimensions changed\r
- if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)\r
- inst.execCommand('mceRepaint');\r
-\r
- tinyMCEPopup.close();\r
- return true;\r
- }\r
-\r
- // Create new table\r
- html += '<table';\r
-\r
- html += makeAttrib('id', id);\r
- if (!isCssSize(border)) {\r
- html += makeAttrib('border', border);\r
- }\r
-\r
- html += makeAttrib('cellpadding', cellpadding);\r
- html += makeAttrib('cellspacing', cellspacing);\r
- html += makeAttrib('data-mce-new', '1');\r
-\r
- if (width && inst.settings.inline_styles) {\r
- if (style)\r
- style += '; ';\r
-\r
- // Force px\r
- if (/^[0-9\.]+$/.test(width))\r
- width += 'px';\r
-\r
- style += 'width: ' + width;\r
- } else\r
- html += makeAttrib('width', width);\r
-\r
-/* if (height) {\r
- if (style)\r
- style += '; ';\r
-\r
- style += 'height: ' + height;\r
- }*/\r
-\r
- //html += makeAttrib('height', height);\r
- //html += makeAttrib('bordercolor', bordercolor);\r
- //html += makeAttrib('bgcolor', bgcolor);\r
- html += makeAttrib('align', align);\r
- html += makeAttrib('frame', frame);\r
- html += makeAttrib('rules', rules);\r
- html += makeAttrib('class', className);\r
- html += makeAttrib('style', style);\r
- html += makeAttrib('summary', summary);\r
- html += makeAttrib('dir', dir);\r
- html += makeAttrib('lang', lang);\r
- html += '>';\r
-\r
- if (caption) {\r
- if (!tinymce.isIE)\r
- html += '<caption><br data-mce-bogus="1"/></caption>';\r
- else\r
- html += '<caption></caption>';\r
- }\r
-\r
- for (var y=0; y<rows; y++) {\r
- html += "<tr>";\r
-\r
- for (var x=0; x<cols; x++) {\r
- if (!tinymce.isIE)\r
- html += '<td><br data-mce-bogus="1"/></td>';\r
- else\r
- html += '<td></td>';\r
- }\r
-\r
- html += "</tr>";\r
- }\r
-\r
- html += "</table>";\r
-\r
- // Move table\r
- if (inst.settings.fix_table_elements) {\r
- var patt = '';\r
-\r
- inst.focus();\r
- inst.selection.setContent('<br class="_mce_marker" />');\r
-\r
- tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) {\r
- if (patt)\r
- patt += ',';\r
-\r
- patt += n + ' ._mce_marker';\r
- });\r
-\r
- tinymce.each(inst.dom.select(patt), function(n) {\r
- inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n);\r
- });\r
-\r
- dom.setOuterHTML(dom.select('br._mce_marker')[0], html);\r
- } else\r
- inst.execCommand('mceInsertContent', false, html);\r
-\r
- tinymce.each(dom.select('table[data-mce-new]'), function(node) {
- var tdorth = dom.select('td,th', node);\r
-
- // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document\r
- if (tinymce.isIE && node.nextSibling == null) {\r
- if (inst.settings.forced_root_block)\r
- dom.insertAfter(dom.create(inst.settings.forced_root_block), node);\r
- else\r
- dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);\r
- }
-\r
- try {\r
- // IE9 might fail to do this selection \r
- inst.selection.setCursorLocation(tdorth[0], 0);\r
- } catch (ex) {\r
- // Ignore\r
- }\r
-\r
- dom.setAttrib(node, 'data-mce-new', '');\r
- });\r
-\r
- inst.addVisual();\r
- inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true});\r
-\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function makeAttrib(attrib, value) {\r
- var formObj = document.forms[0];\r
- var valueElm = formObj.elements[attrib];\r
-\r
- if (typeof(value) == "undefined" || value == null) {\r
- value = "";\r
-\r
- if (valueElm)\r
- value = valueElm.value;\r
- }\r
-\r
- if (value == "")\r
- return "";\r
-\r
- // XML encode it\r
- value = value.replace(/&/g, '&');\r
- value = value.replace(/\"/g, '"');\r
- value = value.replace(/</g, '<');\r
- value = value.replace(/>/g, '>');\r
-\r
- return ' ' + attrib + '="' + value + '"';\r
-}\r
-\r
-function init() {\r
- tinyMCEPopup.resizeToInnerSize();\r
-\r
- document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
- document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
- document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');\r
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
-\r
- var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');\r
- var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";\r
- var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = "";\r
- var inst = tinyMCEPopup.editor, dom = inst.dom;\r
- var formObj = document.forms[0];\r
- var elm = dom.getParent(inst.selection.getNode(), "table");\r
-\r
- // Hide advanced fields that isn't available in the schema\r
- tinymce.each("summary id rules dir style frame".split(" "), function(name) {\r
- var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr");\r
-\r
- if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) {\r
- tr.style.display = 'none';\r
- }\r
- });\r
-\r
- action = tinyMCEPopup.getWindowArg('action');\r
-\r
- if (!action)\r
- action = elm ? "update" : "insert";\r
-\r
- if (elm && action != "insert") {\r
- var rowsAr = elm.rows;\r
- var cols = 0;\r
- for (var i=0; i<rowsAr.length; i++)\r
- if (rowsAr[i].cells.length > cols)\r
- cols = rowsAr[i].cells.length;\r
-\r
- cols = cols;\r
- rows = rowsAr.length;\r
-\r
- st = dom.parseStyle(dom.getAttrib(elm, "style"));\r
- border = trimSize(getStyle(elm, 'border', 'borderWidth'));\r
- cellpadding = dom.getAttrib(elm, 'cellpadding', "");\r
- cellspacing = dom.getAttrib(elm, 'cellspacing', "");\r
- width = trimSize(getStyle(elm, 'width', 'width'));\r
- height = trimSize(getStyle(elm, 'height', 'height'));\r
- bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));\r
- bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));\r
- align = dom.getAttrib(elm, 'align', align);\r
- frame = dom.getAttrib(elm, 'frame');\r
- rules = dom.getAttrib(elm, 'rules');\r
- className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, ''));\r
- id = dom.getAttrib(elm, 'id');\r
- summary = dom.getAttrib(elm, 'summary');\r
- style = dom.serializeStyle(st);\r
- dir = dom.getAttrib(elm, 'dir');\r
- lang = dom.getAttrib(elm, 'lang');\r
- background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");\r
- formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;\r
-\r
- orgTableWidth = width;\r
- orgTableHeight = height;\r
-\r
- action = "update";\r
- formObj.insert.value = inst.getLang('update');\r
- }\r
-\r
- addClassesToList('class', "table_styles");\r
- TinyMCE_EditableSelects.init();\r
-\r
- // Update form\r
- selectByValue(formObj, 'align', align);\r
- selectByValue(formObj, 'tframe', frame);\r
- selectByValue(formObj, 'rules', rules);\r
- selectByValue(formObj, 'class', className, true, true);\r
- formObj.cols.value = cols;\r
- formObj.rows.value = rows;\r
- formObj.border.value = border;\r
- formObj.cellpadding.value = cellpadding;\r
- formObj.cellspacing.value = cellspacing;\r
- formObj.width.value = width;\r
- formObj.height.value = height;\r
- formObj.bordercolor.value = bordercolor;\r
- formObj.bgcolor.value = bgcolor;\r
- formObj.id.value = id;\r
- formObj.summary.value = summary;\r
- formObj.style.value = style;\r
- formObj.dir.value = dir;\r
- formObj.lang.value = lang;\r
- formObj.backgroundimage.value = background;\r
-\r
- updateColor('bordercolor_pick', 'bordercolor');\r
- updateColor('bgcolor_pick', 'bgcolor');\r
-\r
- // Resize some elements\r
- if (isVisible('backgroundimagebrowser'))\r
- document.getElementById('backgroundimage').style.width = '180px';\r
-\r
- // Disable some fields in update mode\r
- if (action == "update") {\r
- formObj.cols.disabled = true;\r
- formObj.rows.disabled = true;\r
- }\r
-}\r
-\r
-function changedSize() {\r
- var formObj = document.forms[0];\r
- var st = dom.parseStyle(formObj.style.value);\r
-\r
-/* var width = formObj.width.value;\r
- if (width != "")\r
- st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : "";\r
- else\r
- st['width'] = "";*/\r
-\r
- var height = formObj.height.value;\r
- if (height != "")\r
- st['height'] = getCSSSize(height);\r
- else\r
- st['height'] = "";\r
-\r
- formObj.style.value = dom.serializeStyle(st);\r
-}\r
-\r
-function isCssSize(value) {\r
- return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value);\r
-}\r
-\r
-function cssSize(value, def) {\r
- value = tinymce.trim(value || def);\r
-\r
- if (!isCssSize(value)) {\r
- return parseInt(value, 10) + 'px';\r
- }\r
-\r
- return value;\r
-}\r
-\r
-function changedBackgroundImage() {\r
- var formObj = document.forms[0];\r
- var st = dom.parseStyle(formObj.style.value);\r
-\r
- st['background-image'] = "url('" + formObj.backgroundimage.value + "')";\r
-\r
- formObj.style.value = dom.serializeStyle(st);\r
-}\r
-\r
-function changedBorder() {\r
- var formObj = document.forms[0];\r
- var st = dom.parseStyle(formObj.style.value);\r
-\r
- // Update border width if the element has a color\r
- if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != ""))\r
- st['border-width'] = cssSize(formObj.border.value);\r
- else {\r
- if (!formObj.border.value) {\r
- st['border'] = '';\r
- st['border-width'] = '';\r
- }\r
- }\r
-\r
- formObj.style.value = dom.serializeStyle(st);\r
-}\r
-\r
-function changedColor() {\r
- var formObj = document.forms[0];\r
- var st = dom.parseStyle(formObj.style.value);\r
-\r
- st['background-color'] = formObj.bgcolor.value;\r
-\r
- if (formObj.bordercolor.value != "") {\r
- st['border-color'] = formObj.bordercolor.value;\r
-\r
- // Add border-width if it's missing\r
- if (!st['border-width'])\r
- st['border-width'] = cssSize(formObj.border.value, 1);\r
- }\r
-\r
- formObj.style.value = dom.serializeStyle(st);\r
-}\r
-\r
-function changedStyle() {\r
- var formObj = document.forms[0];\r
- var st = dom.parseStyle(formObj.style.value);\r
-\r
- if (st['background-image'])\r
- formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");\r
- else\r
- formObj.backgroundimage.value = '';\r
-\r
- if (st['width'])\r
- formObj.width.value = trimSize(st['width']);\r
-\r
- if (st['height'])\r
- formObj.height.value = trimSize(st['height']);\r
-\r
- if (st['background-color']) {\r
- formObj.bgcolor.value = st['background-color'];\r
- updateColor('bgcolor_pick','bgcolor');\r
- }\r
-\r
- if (st['border-color']) {\r
- formObj.bordercolor.value = st['border-color'];\r
- updateColor('bordercolor_pick','bordercolor');\r
- }\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-tinyMCE.addI18n('en.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table Caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Footer",tbody:"Body",thead:"Header","row_all":"Update All Rows in Table","row_even":"Update Even Rows in Table","row_odd":"Update Odd Rows in Table","row_row":"Update Current Row","cell_all":"Update All Cells in Table","cell_row":"Update All Cells in Row","cell_cell":"Update Current Cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background Image",rtl:"Right to Left",ltr:"Left to Right",mime:"Target MIME Type",langcode:"Language Code",langdir:"Language Direction",style:"Style",id:"ID","merge_cells_title":"Merge Table Cells",bgcolor:"Background Color",bordercolor:"Border Color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical Alignment","cell_type":"Cell Type","cell_title":"Table Cell Properties","row_title":"Table Row Properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cell Padding",cellspacing:"Cell Spacing",rows:"Rows",cols:"Columns",height:"Height",width:"Width",title:"Insert/Edit Table",rowtype:"Row Type","advanced_props":"Advanced Properties","general_props":"General Properties","advanced_tab":"Advanced","general_tab":"General","cell_col":"Update all cells in column"});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#table_dlg.merge_cells_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/validate.js"></script>\r
- <script type="text/javascript" src="js/merge_cells.js"></script>\r
-</head>\r
-<body style="margin: 8px" role="application">\r
-<form onsubmit="MergeCellsDialog.merge();return false;" action="#">\r
- <fieldset>\r
- <legend>{#table_dlg.merge_cells_title}</legend>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="3" width="100%">\r
- <tr>\r
- <td><label for="numcols">{#table_dlg.cols}</label>:</td>\r
- <td align="right"><input type="text" id="numcols" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" aria-required="true" /></td>\r
- </tr>\r
- <tr>\r
- <td><label for="numrows">{#table_dlg.rows}</label>:</td>\r
- <td align="right"><input type="text" id="numrows" name="numrows" value="" class="number min1" style="width: 30px" aria-required="true" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#update}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#table_dlg.row_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/validate.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="js/row.js"></script>\r
- <link href="css/row.css" rel="stylesheet" type="text/css" />\r
-</head>\r
-<body id="tablerow" style="display: none" role="application">\r
- <form onsubmit="updateAction();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>\r
- <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#table_dlg.general_props}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td><label for="rowtype">{#table_dlg.rowtype}</label></td>\r
- <td class="col2">\r
- <select id="rowtype" name="rowtype" class="mceFocus" onChange="changedRowType();">\r
- <option value="thead">{#table_dlg.thead}</option>\r
- <option value="tbody">{#table_dlg.tbody}</option>\r
- <option value="tfoot">{#table_dlg.tfoot}</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="align">{#table_dlg.align}</label></td>\r
- <td class="col2">\r
- <select id="align" name="align">\r
- <option value="">{#not_set}</option>\r
- <option value="center">{#table_dlg.align_middle}</option>\r
- <option value="left">{#table_dlg.align_left}</option>\r
- <option value="right">{#table_dlg.align_right}</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="valign">{#table_dlg.valign}</label></td>\r
- <td class="col2">\r
- <select id="valign" name="valign">\r
- <option value="">{#not_set}</option>\r
- <option value="top">{#table_dlg.align_top}</option>\r
- <option value="middle">{#table_dlg.align_middle}</option>\r
- <option value="bottom">{#table_dlg.align_bottom}</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr id="styleSelectRow">\r
- <td><label for="class">{#class_name}</label></td>\r
- <td class="col2">\r
- <select id="class" name="class" class="mceEditableSelect">\r
- <option value="" selected="selected">{#not_set}</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="height">{#table_dlg.height}</label></td>\r
- <td class="col2"><input name="height" type="text" id="height" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="advanced_panel" class="panel">\r
- <fieldset>\r
- <legend>{#table_dlg.advanced_props}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="column1"><label for="id">{#table_dlg.id}</label></td>\r
- <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label for="style">{#table_dlg.style}</label></td>\r
- <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>\r
- <td>\r
- <select id="dir" name="dir" style="width: 200px">\r
- <option value="">{#not_set}</option>\r
- <option value="ltr">{#table_dlg.ltr}</option>\r
- <option value="rtl">{#table_dlg.rtl}</option>\r
- </select>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>\r
- <td>\r
- <input id="lang" name="lang" type="text" value="" style="width: 200px" />\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>\r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>\r
- <td id="backgroundimagebrowsercontainer"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>\r
- <td>\r
- <span role="group" aria-labelledby="bgcolor_label">\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>\r
- <td id="bgcolor_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </span>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <div>\r
- <select id="action" name="action">\r
- <option value="row">{#table_dlg.row_row}</option>\r
- <option value="odd">{#table_dlg.row_odd}</option>\r
- <option value="even">{#table_dlg.row_even}</option>\r
- <option value="all">{#table_dlg.row_all}</option>\r
- </select>\r
- </div>\r
-\r
- <input type="submit" id="insert" name="insert" value="{#update}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
- </form>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#table_dlg.title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/validate.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="js/table.js"></script>\r
- <link href="css/table.css" rel="stylesheet" type="text/css" />\r
-</head>\r
-<body id="table" style="display: none" role="application" aria-labelledby="app_title">\r
- <span style="display:none;" id="app_title">{#table_dlg.title}</span>\r
- <form onsubmit="insertTable();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" aria-controls="general_panel" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>\r
- <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#table_dlg.general_props}</legend>\r
- <table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">\r
- <tr>\r
- <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td>\r
- <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" aria-required="true" /></td>\r
- <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td>\r
- <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" aria-required="true" /></td>\r
- </tr>\r
- <tr>\r
- <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>\r
- <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>\r
- <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>\r
- <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>\r
- </tr>\r
- <tr>\r
- <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>\r
- <td><select id="align" name="align">\r
- <option value="">{#not_set}</option>\r
- <option value="center">{#table_dlg.align_middle}</option>\r
- <option value="left">{#table_dlg.align_left}</option>\r
- <option value="right">{#table_dlg.align_right}</option>\r
- </select></td>\r
- <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>\r
- <td><input id="border" name="border" type="text" value="" size="3" maxlength="5" onchange="changedBorder();" class="size" /></td>\r
- </tr>\r
- <tr id="width_row">\r
- <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>\r
- <td><input name="width" type="text" id="width" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>\r
- <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>\r
- <td><input name="height" type="text" id="height" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>\r
- </tr>\r
- <tr id="styleSelectRow" >\r
- <td><label id="classlabel" for="class">{#class_name}</label></td>\r
- <td colspan="3" >\r
- <select id="class" name="class" class="mceEditableSelect">\r
- <option value="" selected="selected">{#not_set}</option>\r
- </select></td>\r
- </tr>\r
- <tr>\r
- <td class="column1" ><label for="caption">{#table_dlg.caption}</label></td> \r
- <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="advanced_panel" class="panel">\r
- <fieldset>\r
- <legend>{#table_dlg.advanced_props}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="column1"><label for="id">{#table_dlg.id}</label></td> \r
- <td><input id="id" name="id" type="text" value="" class="advfield" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="summary">{#table_dlg.summary}</label></td> \r
- <td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td><label for="style">{#table_dlg.style}</label></td>\r
- <td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" class="advfield" />\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> \r
- <td>\r
- <table role="presentation" aria-labelledby="backgroundimage_label" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>\r
- <td id="backgroundimagebrowsercontainer"> </td>\r
- </tr>\r
- </table>\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="tframe">{#table_dlg.frame}</label></td> \r
- <td>\r
- <select id="tframe" name="tframe" class="advfield"> \r
- <option value="">{#not_set}</option>\r
- <option value="void">{#table_dlg.rules_void}</option>\r
- <option value="above">{#table_dlg.rules_above}</option> \r
- <option value="below">{#table_dlg.rules_below}</option> \r
- <option value="hsides">{#table_dlg.rules_hsides}</option> \r
- <option value="lhs">{#table_dlg.rules_lhs}</option> \r
- <option value="rhs">{#table_dlg.rules_rhs}</option> \r
- <option value="vsides">{#table_dlg.rules_vsides}</option> \r
- <option value="box">{#table_dlg.rules_box}</option> \r
- <option value="border">{#table_dlg.rules_border}</option> \r
- </select>\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="rules">{#table_dlg.rules}</label></td> \r
- <td>\r
- <select id="rules" name="rules" class="advfield"> \r
- <option value="">{#not_set}</option> \r
- <option value="none">{#table_dlg.frame_none}</option>\r
- <option value="groups">{#table_dlg.frame_groups}</option>\r
- <option value="rows">{#table_dlg.frame_rows}</option>\r
- <option value="cols">{#table_dlg.frame_cols}</option>\r
- <option value="all">{#table_dlg.frame_all}</option>\r
- </select>\r
- </td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> \r
- <td>\r
- <select id="dir" name="dir" class="advfield"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#table_dlg.ltr}</option> \r
- <option value="rtl">{#table_dlg.rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
-\r
- <tr role="group" aria-labelledby="bordercolor_label">\r
- <td class="column1"><label id="bordercolor_label" for="bordercolor">{#table_dlg.bordercolor}</label></td> \r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>\r
- <td id="bordercolor_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td> \r
- </tr>\r
-\r
- <tr role="group" aria-labelledby="bgcolor_label">\r
- <td class="column1"><label id="bgcolor_label" for="bgcolor">{#table_dlg.bgcolor}</label></td> \r
- <td>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>\r
- <td id="bgcolor_pickcontainer"> </td>\r
- </tr>\r
- </table>\r
- </td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
- </form>\r
-</body>\r
-</html>\r
+++ /dev/null
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>blank_page</title>\r
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
- <script type="text/javascript">\r
- parent.TemplateDialog.loadCSSFiles(document);\r
- </script>\r
-</head>\r
-<body id="mceTemplatePreview" class="mceContentBody">\r
-\r
-</body>\r
-</html>\r
+++ /dev/null
-#frmbody {\r
- padding: 10px;\r
- background-color: #FFF;\r
- border: 1px solid #CCC;\r
-}\r
-\r
-.frmRow {\r
- margin-bottom: 10px;\r
-}\r
-\r
-#templatesrc {\r
- border: none;\r
- width: 320px;\r
- height: 240px;\r
-}\r
-\r
-.title {\r
- padding-bottom: 5px;\r
-}\r
-\r
-.mceActionPanel {\r
- padding-top: 5px;\r
-}\r
+++ /dev/null
-(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length<d){for(f=0;f<(d-g.length);f++){g="0"+g}}return g}b=b.replace("%D","%m/%d/%y");b=b.replace("%r","%I:%M:%S %p");b=b.replace("%Y",""+e.getFullYear());b=b.replace("%y",""+e.getYear());b=b.replace("%m",c(e.getMonth()+1,2));b=b.replace("%d",c(e.getDate(),2));b=b.replace("%H",""+c(e.getHours(),2));b=b.replace("%M",""+c(e.getMinutes(),2));b=b.replace("%S",""+c(e.getSeconds(),2));b=b.replace("%I",""+((e.getHours()+11)%12+1));b=b.replace("%p",""+(e.getHours()<12?"AM":"PM"));b=b.replace("%B",""+this.editor.getLang("template_months_long").split(",")[e.getMonth()]);b=b.replace("%b",""+this.editor.getLang("template_months_short").split(",")[e.getMonth()]);b=b.replace("%A",""+this.editor.getLang("template_day_long").split(",")[e.getDay()]);b=b.replace("%a",""+this.editor.getLang("template_day_short").split(",")[e.getDay()]);b=b.replace("%%","%");return b}});tinymce.PluginManager.add("template",tinymce.plugins.TemplatePlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var each = tinymce.each;\r
-\r
- tinymce.create('tinymce.plugins.TemplatePlugin', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
-\r
- // Register commands\r
- ed.addCommand('mceTemplate', function(ui) {\r
- ed.windowManager.open({\r
- file : url + '/template.htm',\r
- width : ed.getParam('template_popup_width', 750),\r
- height : ed.getParam('template_popup_height', 600),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- ed.addCommand('mceInsertTemplate', t._insertTemplate, t);\r
-\r
- // Register buttons\r
- ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'});\r
-\r
- ed.onPreProcess.add(function(ed, o) {\r
- var dom = ed.dom;\r
-\r
- each(dom.select('div', o.node), function(e) {\r
- if (dom.hasClass(e, 'mceTmpl')) {\r
- each(dom.select('*', e), function(e) {\r
- if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|')))\r
- e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));\r
- });\r
-\r
- t._replaceVals(e);\r
- }\r
- });\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Template plugin',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://www.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- _insertTemplate : function(ui, v) {\r
- var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent();\r
-\r
- h = v.content;\r
-\r
- each(t.editor.getParam('template_replace_values'), function(v, k) {\r
- if (typeof(v) != 'function')\r
- h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);\r
- });\r
-\r
- el = dom.create('div', null, h);\r
-\r
- // Find template element within div\r
- n = dom.select('.mceTmpl', el);\r
- if (n && n.length > 0) {\r
- el = dom.create('div', null);\r
- el.appendChild(n[0].cloneNode(true));\r
- }\r
-\r
- function hasClass(n, c) {\r
- return new RegExp('\\b' + c + '\\b', 'g').test(n.className);\r
- };\r
-\r
- each(dom.select('*', el), function(n) {\r
- // Replace cdate\r
- if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|')))\r
- n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format")));\r
-\r
- // Replace mdate\r
- if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|')))\r
- n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));\r
-\r
- // Replace selection\r
- if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|')))\r
- n.innerHTML = sel;\r
- });\r
-\r
- t._replaceVals(el);\r
-\r
- ed.execCommand('mceInsertContent', false, el.innerHTML);\r
- ed.addVisual();\r
- },\r
-\r
- _replaceVals : function(e) {\r
- var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values');\r
-\r
- each(dom.select('*', e), function(e) {\r
- each(vl, function(v, k) {\r
- if (dom.hasClass(e, k)) {\r
- if (typeof(vl[k]) == 'function')\r
- vl[k](e);\r
- }\r
- });\r
- });\r
- },\r
-\r
- _getDateTime : function(d, fmt) {\r
- if (!fmt)\r
- return "";\r
-\r
- function addZeros(value, len) {\r
- var i;\r
-\r
- value = "" + value;\r
-\r
- if (value.length < len) {\r
- for (i=0; i<(len-value.length); i++)\r
- value = "0" + value;\r
- }\r
-\r
- return value;\r
- }\r
-\r
- fmt = fmt.replace("%D", "%m/%d/%y");\r
- fmt = fmt.replace("%r", "%I:%M:%S %p");\r
- fmt = fmt.replace("%Y", "" + d.getFullYear());\r
- fmt = fmt.replace("%y", "" + d.getYear());\r
- fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));\r
- fmt = fmt.replace("%d", addZeros(d.getDate(), 2));\r
- fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));\r
- fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));\r
- fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));\r
- fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));\r
- fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));\r
- fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]);\r
- fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]);\r
- fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]);\r
- fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]);\r
- fmt = fmt.replace("%%", "%");\r
-\r
- return fmt;\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var TemplateDialog = {\r
- preInit : function() {\r
- var url = tinyMCEPopup.getParam("template_external_list_url");\r
-\r
- if (url != null)\r
- document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></sc'+'ript>');\r
- },\r
-\r
- init : function() {\r
- var ed = tinyMCEPopup.editor, tsrc, sel, x, u;\r
-\r
- tsrc = ed.getParam("template_templates", false);\r
- sel = document.getElementById('tpath');\r
-\r
- // Setup external template list\r
- if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') {\r
- for (x=0, tsrc = []; x<tinyMCETemplateList.length; x++)\r
- tsrc.push({title : tinyMCETemplateList[x][0], src : tinyMCETemplateList[x][1], description : tinyMCETemplateList[x][2]});\r
- }\r
-\r
- for (x=0; x<tsrc.length; x++)\r
- sel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src));\r
-\r
- this.resize();\r
- this.tsrc = tsrc;\r
- },\r
-\r
- resize : function() {\r
- var w, h, e;\r
-\r
- if (!self.innerWidth) {\r
- w = document.body.clientWidth - 50;\r
- h = document.body.clientHeight - 160;\r
- } else {\r
- w = self.innerWidth - 50;\r
- h = self.innerHeight - 170;\r
- }\r
-\r
- e = document.getElementById('templatesrc');\r
-\r
- if (e) {\r
- e.style.height = Math.abs(h) + 'px';\r
- e.style.width = Math.abs(w - 5) + 'px';\r
- }\r
- },\r
-\r
- loadCSSFiles : function(d) {\r
- var ed = tinyMCEPopup.editor;\r
-\r
- tinymce.each(ed.getParam("content_css", '').split(','), function(u) {\r
- d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />');\r
- });\r
- },\r
-\r
- selectTemplate : function(u, ti) {\r
- var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc;\r
-\r
- if (!u)\r
- return;\r
-\r
- d.body.innerHTML = this.templateHTML = this.getFileContents(u);\r
-\r
- for (x=0; x<tsrc.length; x++) {\r
- if (tsrc[x].title == ti)\r
- document.getElementById('tmpldesc').innerHTML = tsrc[x].description || '';\r
- }\r
- },\r
-\r
- insert : function() {\r
- tinyMCEPopup.execCommand('mceInsertTemplate', false, {\r
- content : this.templateHTML,\r
- selection : tinyMCEPopup.editor.selection.getContent()\r
- });\r
-\r
- tinyMCEPopup.close();\r
- },\r
-\r
- getFileContents : function(u) {\r
- var x, d, t = 'text/plain';\r
-\r
- function g(s) {\r
- x = 0;\r
-\r
- try {\r
- x = new ActiveXObject(s);\r
- } catch (s) {\r
- }\r
-\r
- return x;\r
- };\r
-\r
- x = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest();\r
-\r
- // Synchronous AJAX load file\r
- x.overrideMimeType && x.overrideMimeType(t);\r
- x.open("GET", u, false);\r
- x.send(null);\r
-\r
- return x.responseText;\r
- }\r
-};\r
-\r
-TemplateDialog.preInit();\r
-tinyMCEPopup.onInit.add(TemplateDialog.init, TemplateDialog);\r
+++ /dev/null
-tinyMCE.addI18n('en.template_dlg',{title:"Templates",label:"Template","desc_label":"Description",desc:"Insert Predefined Template Content",select:"Select a Template",preview:"Preview",warning:"Warning: Updating a template with a different one may cause data loss.","mdate_format":"%Y-%m-%d %H:%M:%S","cdate_format":"%Y-%m-%d %H:%M:%S","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"});
\ No newline at end of file
+++ /dev/null
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#template_dlg.title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/template.js"></script>\r
- <link href="css/template.css" rel="stylesheet" type="text/css" />\r
-</head>\r
-<body onresize="TemplateDialog.resize();"> \r
- <form onsubmit="TemplateDialog.insert();return false;">\r
- <div id="frmbody">\r
- <div class="title">{#template_dlg.desc}</div>\r
- <div class="frmRow"><label for="tpath" title="{#template_dlg.select}">{#template_dlg.label}:</label>\r
- <select id="tpath" name="tpath" onchange="TemplateDialog.selectTemplate(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text);" class="mceFocus">\r
- <option value="">{#template_dlg.select}...</option>\r
- </select>\r
- <span id="warning"></span></div>\r
- <div class="frmRow"><label for="tdesc">{#template_dlg.desc_label}:</label>\r
- <span id="tmpldesc"></span></div>\r
- <fieldset>\r
- <legend>{#template_dlg.preview}</legend>\r
- <iframe id="templatesrc" name="templatesrc" src="blank.htm" width="690" height="400" frameborder="0"></iframe>\r
- </fieldset>\r
- </div>\r
- \r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
- </form>\r
-</body> \r
-</html> \r
+++ /dev/null
-p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, blockquote, address, pre, figure {display: block; padding-top: 10px; border: 1px dashed #BBB; background: transparent no-repeat}\r
-p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, address, pre, figure {margin-left: 3px}\r
-section, article, address, hgroup, aside, figure {margin: 0 0 1em 3px}\r
-\r
-p {background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}\r
-h1 {background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}\r
-h2 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}\r
-h3 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}\r
-h4 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}\r
-h5 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}\r
-h6 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}\r
-div {background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}\r
-section {background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}\r
-article {background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}\r
-blockquote {background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}\r
-address {background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}\r
-pre {background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}\r
-hgroup {background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}\r
-aside {background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}\r
-figure {background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}\r
-figcaption {border: 1px dashed #BBB}\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.VisualBlocks",{init:function(a,b){var c;if(!window.NodeList){return}a.addCommand("mceVisualBlocks",function(){var e=a.dom,d;if(!c){c=e.uniqueId();d=e.create("link",{id:c,rel:"stylesheet",href:b+"/css/visualblocks.css"});a.getDoc().getElementsByTagName("head")[0].appendChild(d)}else{d=e.get(c);d.disabled=!d.disabled}a.controlManager.setActive("visualblocks",!d.disabled)});a.addButton("visualblocks",{title:"visualblocks.desc",cmd:"mceVisualBlocks"});a.onInit.add(function(){if(a.settings.visualblocks_default_state){a.execCommand("mceVisualBlocks",false,null,{skip_focus:true})}})},getInfo:function(){return{longname:"Visual blocks",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("visualblocks",tinymce.plugins.VisualBlocks)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2012, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.VisualBlocks', {\r
- init : function(ed, url) {\r
- var cssId;\r
-\r
- // We don't support older browsers like IE6/7 and they don't provide prototypes for DOM objects\r
- if (!window.NodeList) {\r
- return;\r
- }\r
-\r
- ed.addCommand('mceVisualBlocks', function() {\r
- var dom = ed.dom, linkElm;\r
-\r
- if (!cssId) {\r
- cssId = dom.uniqueId();\r
- linkElm = dom.create('link', {\r
- id: cssId,\r
- rel : 'stylesheet',\r
- href : url + '/css/visualblocks.css'\r
- });\r
-\r
- ed.getDoc().getElementsByTagName('head')[0].appendChild(linkElm);\r
- } else {\r
- linkElm = dom.get(cssId);\r
- linkElm.disabled = !linkElm.disabled;\r
- }\r
-\r
- ed.controlManager.setActive('visualblocks', !linkElm.disabled);\r
- });\r
-\r
- ed.addButton('visualblocks', {title : 'visualblocks.desc', cmd : 'mceVisualBlocks'});\r
-\r
- ed.onInit.add(function() {\r
- if (ed.settings.visualblocks_default_state) {\r
- ed.execCommand('mceVisualBlocks', false, null, {skip_focus : true});\r
- }\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Visual blocks',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('visualblocks', tinymce.plugins.VisualBlocks);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state&&e.format!="raw"&&!e.draft){c.state=true;c._toggleVisualChars(false)}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(m){var p=this,k=p.editor,a,g,j,n=k.getDoc(),o=k.getBody(),l,q=k.selection,e,c,f;p.state=!p.state;k.controlManager.setActive("visualchars",p.state);if(m){f=q.getBookmark()}if(p.state){a=[];tinymce.walk(o,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(g=0;g<a.length;g++){l=a[g].nodeValue;l=l.replace(/(\u00a0)/g,'<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp">$1</span>');c=k.dom.create("div",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select("span.mceItemNbsp",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.VisualChars', {\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
-\r
- // Register commands\r
- ed.addCommand('mceVisualChars', t._toggleVisualChars, t);\r
-\r
- // Register buttons\r
- ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'});\r
-\r
- ed.onBeforeGetContent.add(function(ed, o) {\r
- if (t.state && o.format != 'raw' && !o.draft) {\r
- t.state = true;\r
- t._toggleVisualChars(false);\r
- }\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Visual characters',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- // Private methods\r
-\r
- _toggleVisualChars : function(bookmark) {\r
- var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm;\r
-\r
- t.state = !t.state;\r
- ed.controlManager.setActive('visualchars', t.state);\r
-\r
- if (bookmark)\r
- bm = s.getBookmark();\r
-\r
- if (t.state) {\r
- nl = [];\r
- tinymce.walk(b, function(n) {\r
- if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1)\r
- nl.push(n);\r
- }, 'childNodes');\r
-\r
- for (i = 0; i < nl.length; i++) {\r
- nv = nl[i].nodeValue;\r
- nv = nv.replace(/(\u00a0)/g, '<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp">$1</span>');\r
-\r
- div = ed.dom.create('div', null, nv);\r
- while (node = div.lastChild)\r
- ed.dom.insertAfter(node, nl[i]);\r
-\r
- ed.dom.remove(nl[i]);\r
- }\r
- } else {\r
- nl = ed.dom.select('span.mceItemNbsp', b);\r
-\r
- for (i = nl.length - 1; i >= 0; i--)\r
- ed.dom.remove(nl[i], 1);\r
- }\r
-\r
- s.moveToBookmark(bm);\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars);\r
-})();
\ No newline at end of file
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'<span id="'+e.id+'">0</span>')}}else{tinymce.DOM.add(k,"span",{},'<span id="'+e.id+'">0</span>')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.WordCount', {\r
- block : 0,\r
- id : null,\r
- countre : null,\r
- cleanre : null,\r
-\r
- init : function(ed, url) {\r
- var t = this, last = 0, VK = tinymce.VK;\r
-\r
- t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’\r
- t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);\r
- t.update_rate = ed.getParam('wordcount_update_rate', 2000);\r
- t.update_on_delete = ed.getParam('wordcount_update_on_delete', false);\r
- t.id = ed.id + '-word-count';\r
-\r
- ed.onPostRender.add(function(ed, cm) {\r
- var row, id;\r
-\r
- // Add it to the specified id or the theme advanced path\r
- id = ed.getParam('wordcount_target_id');\r
- if (!id) {\r
- row = tinymce.DOM.get(ed.id + '_path_row');\r
-\r
- if (row)\r
- tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '<span id="' + t.id + '">0</span>');\r
- } else {\r
- tinymce.DOM.add(id, 'span', {}, '<span id="' + t.id + '">0</span>');\r
- }\r
- });\r
-\r
- ed.onInit.add(function(ed) {\r
- ed.selection.onSetContent.add(function() {\r
- t._count(ed);\r
- });\r
-\r
- t._count(ed);\r
- });\r
-\r
- ed.onSetContent.add(function(ed) {\r
- t._count(ed);\r
- });\r
-\r
- function checkKeys(key) {\r
- return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last));\r
- }\r
-\r
- function checkDelOrBksp(key) {\r
- return key === VK.DELETE || key === VK.BACKSPACE;\r
- }\r
-\r
- ed.onKeyUp.add(function(ed, e) {\r
- if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) {\r
- t._count(ed);\r
- }\r
-\r
- last = e.keyCode;\r
- });\r
- },\r
-\r
- _getCount : function(ed) {\r
- var tc = 0;\r
- var tx = ed.getContent({ format: 'raw' });\r
-\r
- if (tx) {\r
- tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces\r
- tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars\r
-\r
- // deal with html entities\r
- tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' ');\r
- tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation\r
-\r
- var wordArray = tx.match(this.countre);\r
- if (wordArray) {\r
- tc = wordArray.length;\r
- }\r
- }\r
-\r
- return tc;\r
- },\r
-\r
- _count : function(ed) {\r
- var t = this;\r
-\r
- // Keep multiple calls from happening at the same time\r
- if (t.block)\r
- return;\r
-\r
- t.block = 1;\r
-\r
- setTimeout(function() {\r
- if (!ed.destroyed) {\r
- var tc = t._getCount(ed);\r
- tinymce.DOM.setHTML(t.id, tc.toString());\r
- setTimeout(function() {t.block = 0;}, t.update_rate);\r
- }\r
- }, 1);\r
- },\r
-\r
- getInfo: function() {\r
- return {\r
- longname : 'Word Count plugin',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount);\r
-})();\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#xhtmlxtras_dlg.title_abbr_element}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="js/element_common.js"></script>\r
- <script type="text/javascript" src="js/abbr.js"></script>\r
- <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
-</head>\r
-<body style="display: none" role="application" aria-labelledby="app_title">\r
-<span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_abbr_element}</span>\r
-<form onsubmit="insertAbbr();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
- <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
- <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
- <td>\r
- <select id="class" name="class" class="field mceEditableSelect">\r
- <option value="">{#not_set}</option> \r
- </select>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
- <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
- <td>\r
- <select id="dir" name="dir" class="field"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" class="field" />\r
- </td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- <div id="events_panel" class="panel">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label for="onfocus">onfocus</label>:</td> \r
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onblur">onblur</label>:</td> \r
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onclick">onclick</label>:</td> \r
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#update}" />\r
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#xhtmlxtras_dlg.title_acronym_element}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="js/element_common.js"></script>\r
- <script type="text/javascript" src="js/acronym.js"></script>\r
- <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
-</head>\r
-<body style="display: none" role="application" aria-labelledby="app_title">\r
-<span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_acronym_element}</span>\r
-<form onsubmit="insertAcronym();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
- <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
- <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
- <td>\r
- <select id="class" name="class" class="field mceEditableSelect">\r
- <option value="">{#not_set}</option> \r
- </select>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
- <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
- <td>\r
- <select id="dir" name="dir" class="field"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" class="field" />\r
- </td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- <div id="events_panel" class="panel">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label for="onfocus">onfocus</label>:</td> \r
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onblur">onblur</label>:</td> \r
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onclick">onclick</label>:</td> \r
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#update}" />\r
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#xhtmlxtras_dlg.attribs_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="js/attributes.js"></script>\r
- <link rel="stylesheet" type="text/css" href="css/attributes.css" />\r
-</head>\r
-<body style="display: none" role="application" aria-labelledby="app_title">\r
-<span style="display:none;" id="app_title">{#xhtmlxtras_dlg.attribs_title}</span>\r
-<form onsubmit="insertAction();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li>\r
- <li id="events_tab" aria-controls="events_panel"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
- <td><input id="title" name="title" type="text" value="" class="mceFocus" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
- <td><input id="id" name="id" type="text" value="" /></td> \r
- </tr>\r
- <tr>\r
- <td><label id="classlabel" for="classlist">{#class_name}</label></td>\r
- <td>\r
- <select id="classlist" name="classlist" class="mceEditableSelect">\r
- <option value="" selected="selected">{#not_set}</option>\r
- </select>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
- <td><input id="style" name="style" type="text" value="" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
- <td>\r
- <select id="dir" name="dir"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option> \r
- <option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" />\r
- </td> \r
- </tr>\r
- <tr>\r
- <td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td>\r
- <td><input type="text" id="tabindex" name="tabindex" value="" /></td>\r
- </tr>\r
-\r
- <tr>\r
- <td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td>\r
- <td><input type="text" id="accesskey" name="accesskey" value="" /></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- <div id="events_panel" class="panel">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label for="onfocus">onfocus</label>:</td> \r
- <td><input id="onfocus" name="onfocus" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onblur">onblur</label>:</td> \r
- <td><input id="onblur" name="onblur" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onclick">onclick</label>:</td> \r
- <td><input id="onclick" name="onclick" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
- <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
- <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
- <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
- <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
- <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
- <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
- <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
- <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
- <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#xhtmlxtras_dlg.title_cite_element}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="js/element_common.js"></script>\r
- <script type="text/javascript" src="js/cite.js"></script>\r
- <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
-</head>\r
-<body style="display: none" role="application" aria-labelledby="app_title">\r
-<span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_cite_element}</span>\r
-<form onsubmit="insertCite();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
- <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
- <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
- <td>\r
- <select id="class" name="class" class="field mceEditableSelect">\r
- <option value="">{#not_set}</option> \r
- </select>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
- <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
- <td>\r
- <select id="dir" name="dir" class="field"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" class="field" />\r
- </td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- <div id="events_panel" class="panel">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label for="onfocus">onfocus</label>:</td> \r
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onblur">onblur</label>:</td> \r
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onclick">onclick</label>:</td> \r
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#update}" />\r
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-.panel_wrapper div.current {\r
- height: 290px;\r
-}\r
-\r
-#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey {\r
- width: 200px;\r
-}\r
-\r
-#events_panel input {\r
- width: 200px;\r
-}\r
+++ /dev/null
-input.field, select.field {width:200px;}\r
-input.picker {width:179px; margin-left: 5px;}\r
-input.disabled {border-color:#F2F2F2;}\r
-img.picker {vertical-align:text-bottom; cursor:pointer;}\r
-h1 {padding: 0 0 5px 0;}\r
-.panel_wrapper div.current {height:160px;}\r
-#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;}\r
-a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;}\r
-#datetime {width:180px;}\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#xhtmlxtras_dlg.title_del_element}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="js/element_common.js"></script>\r
- <script type="text/javascript" src="js/del.js"></script>\r
- <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
-</head>\r
-<body id="xhtmlxtrasins" style="display: none" role="application" aria-labelledby="app_title">\r
-<span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_del_element}</span>\r
-<form onsubmit="insertDel();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>\r
- <td>\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr> \r
- <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> \r
- <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse" role="button" aria-labelledby="datetimelabel"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>\r
- <td><input id="cite" name="cite" type="text" value="" class="field" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
- <td><input id="title" name="title" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
- <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
- <td>\r
- <select id="class" name="class" class="field mceEditableSelect">\r
- <option value="">{#not_set}</option> \r
- </select>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
- <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
- <td>\r
- <select id="dir" name="dir" class="field"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" class="field" />\r
- </td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- <div id="events_panel" class="panel">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label for="onfocus">onfocus</label>:</td> \r
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onblur">onblur</label>:</td> \r
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onclick">onclick</label>:</td> \r
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#update}" />\r
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380+parseInt(a.getLang("xhtmlxtras.attr_delta_width",0)),height:370+parseInt(a.getLang("xhtmlxtras.attr_delta_height",0)),inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {\r
- init : function(ed, url) {\r
- // Register commands\r
- ed.addCommand('mceCite', function() {\r
- ed.windowManager.open({\r
- file : url + '/cite.htm',\r
- width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)),\r
- height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- ed.addCommand('mceAcronym', function() {\r
- ed.windowManager.open({\r
- file : url + '/acronym.htm',\r
- width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),\r
- height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- ed.addCommand('mceAbbr', function() {\r
- ed.windowManager.open({\r
- file : url + '/abbr.htm',\r
- width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),\r
- height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- ed.addCommand('mceDel', function() {\r
- ed.windowManager.open({\r
- file : url + '/del.htm',\r
- width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),\r
- height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- ed.addCommand('mceIns', function() {\r
- ed.windowManager.open({\r
- file : url + '/ins.htm',\r
- width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),\r
- height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- ed.addCommand('mceAttributes', function() {\r
- ed.windowManager.open({\r
- file : url + '/attributes.htm',\r
- width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)),\r
- height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)),\r
- inline : 1\r
- }, {\r
- plugin_url : url\r
- });\r
- });\r
-\r
- // Register buttons\r
- ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'});\r
- ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'});\r
- ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'});\r
- ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'});\r
- ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'});\r
- ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});\r
-\r
- ed.onNodeChange.add(function(ed, cm, n, co) {\r
- n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS');\r
-\r
- cm.setDisabled('cite', co);\r
- cm.setDisabled('acronym', co);\r
- cm.setDisabled('abbr', co);\r
- cm.setDisabled('del', co);\r
- cm.setDisabled('ins', co);\r
- cm.setDisabled('attribs', n && n.nodeName == 'BODY');\r
- cm.setActive('cite', 0);\r
- cm.setActive('acronym', 0);\r
- cm.setActive('abbr', 0);\r
- cm.setActive('del', 0);\r
- cm.setActive('ins', 0);\r
-\r
- // Activate all\r
- if (n) {\r
- do {\r
- cm.setDisabled(n.nodeName.toLowerCase(), 0);\r
- cm.setActive(n.nodeName.toLowerCase(), 1);\r
- } while (n = n.parentNode);\r
- }\r
- });\r
-\r
- ed.onPreInit.add(function() {\r
- // Fixed IE issue where it can't handle these elements correctly\r
- ed.dom.create('abbr');\r
- });\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'XHTML Xtras Plugin',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin);\r
-})();
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#xhtmlxtras_dlg.title_ins_element}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
- <script type="text/javascript" src="js/element_common.js"></script>\r
- <script type="text/javascript" src="js/ins.js"></script>\r
- <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
-</head>\r
-<body id="xhtmlxtrasins" style="display: none" role="application" aria-labelledby="app_title">\r
-<span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_ins_element}</span>\r
-<form onsubmit="insertIns();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td> \r
- <td>\r
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">\r
- <tr> \r
- <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> \r
- <td ><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse" role="button" aria-labelledby="datetimelabel"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- <tr >\r
- <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td> \r
- <td><input id="cite" name="cite" type="text" value="" class="field" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
- <td><input id="title" name="title" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
- <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
- <td>\r
- <select id="class" name="class" class="field mceEditableSelect">\r
- <option value="">{#not_set}</option> \r
- </select>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
- <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
- <td>\r
- <select id="dir" name="dir" class="field"> \r
- <option value="">{#not_set}</option> \r
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
- </select>\r
- </td> \r
- </tr>\r
- <tr>\r
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
- <td>\r
- <input id="lang" name="lang" type="text" value="" class="field" />\r
- </td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- <div id="events_panel" class="panel">\r
- <fieldset>\r
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
-\r
- <table role="presentation" border="0" cellpadding="0" cellspacing="4">\r
- <tr>\r
- <td class="label"><label for="onfocus">onfocus</label>:</td> \r
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onblur">onblur</label>:</td> \r
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onclick">onclick</label>:</td> \r
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
- </tr>\r
-\r
- <tr>\r
- <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
- </tr>\r
- </table>\r
- </fieldset>\r
- </div>\r
- </div>\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#update}" />\r
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-/**\r
- * abbr.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-function init() {\r
- SXE.initElementDialog('abbr');\r
- if (SXE.currentAction == "update") {\r
- SXE.showRemoveButton();\r
- }\r
-}\r
-\r
-function insertAbbr() {\r
- SXE.insertElement('abbr');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function removeAbbr() {\r
- SXE.removeElement('abbr');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-/**\r
- * acronym.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-function init() {\r
- SXE.initElementDialog('acronym');\r
- if (SXE.currentAction == "update") {\r
- SXE.showRemoveButton();\r
- }\r
-}\r
-\r
-function insertAcronym() {\r
- SXE.insertElement('acronym');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function removeAcronym() {\r
- SXE.removeElement('acronym');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-/**\r
- * attributes.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-function init() {\r
- tinyMCEPopup.resizeToInnerSize();\r
- var inst = tinyMCEPopup.editor;\r
- var dom = inst.dom;\r
- var elm = inst.selection.getNode();\r
- var f = document.forms[0];\r
- var onclick = dom.getAttrib(elm, 'onclick');\r
-\r
- setFormValue('title', dom.getAttrib(elm, 'title'));\r
- setFormValue('id', dom.getAttrib(elm, 'id'));\r
- setFormValue('style', dom.getAttrib(elm, "style"));\r
- setFormValue('dir', dom.getAttrib(elm, 'dir'));\r
- setFormValue('lang', dom.getAttrib(elm, 'lang'));\r
- setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));\r
- setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));\r
- setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));\r
- setFormValue('onblur', dom.getAttrib(elm, 'onblur'));\r
- setFormValue('onclick', onclick);\r
- setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));\r
- setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));\r
- setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));\r
- setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));\r
- setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));\r
- setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));\r
- setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));\r
- setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));\r
- setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));\r
- className = dom.getAttrib(elm, 'class');\r
-\r
- addClassesToList('classlist', 'advlink_styles');\r
- selectByValue(f, 'classlist', className, true);\r
-\r
- TinyMCE_EditableSelects.init();\r
-}\r
-\r
-function setFormValue(name, value) {\r
- if(value && document.forms[0].elements[name]){\r
- document.forms[0].elements[name].value = value;\r
- }\r
-}\r
-\r
-function insertAction() {\r
- var inst = tinyMCEPopup.editor;\r
- var elm = inst.selection.getNode();\r
-\r
- setAllAttribs(elm);\r
- tinyMCEPopup.execCommand("mceEndUndoLevel");\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function setAttrib(elm, attrib, value) {\r
- var formObj = document.forms[0];\r
- var valueElm = formObj.elements[attrib.toLowerCase()];\r
- var inst = tinyMCEPopup.editor;\r
- var dom = inst.dom;\r
-\r
- if (typeof(value) == "undefined" || value == null) {\r
- value = "";\r
-\r
- if (valueElm)\r
- value = valueElm.value;\r
- }\r
-\r
- dom.setAttrib(elm, attrib.toLowerCase(), value);\r
-}\r
-\r
-function setAllAttribs(elm) {\r
- var f = document.forms[0];\r
-\r
- setAttrib(elm, 'title');\r
- setAttrib(elm, 'id');\r
- setAttrib(elm, 'style');\r
- setAttrib(elm, 'class', getSelectValue(f, 'classlist'));\r
- setAttrib(elm, 'dir');\r
- setAttrib(elm, 'lang');\r
- setAttrib(elm, 'tabindex');\r
- setAttrib(elm, 'accesskey');\r
- setAttrib(elm, 'onfocus');\r
- setAttrib(elm, 'onblur');\r
- setAttrib(elm, 'onclick');\r
- setAttrib(elm, 'ondblclick');\r
- setAttrib(elm, 'onmousedown');\r
- setAttrib(elm, 'onmouseup');\r
- setAttrib(elm, 'onmouseover');\r
- setAttrib(elm, 'onmousemove');\r
- setAttrib(elm, 'onmouseout');\r
- setAttrib(elm, 'onkeypress');\r
- setAttrib(elm, 'onkeydown');\r
- setAttrib(elm, 'onkeyup');\r
-\r
- // Refresh in old MSIE\r
-// if (tinyMCE.isMSIE5)\r
-// elm.outerHTML = elm.outerHTML;\r
-}\r
-\r
-function insertAttribute() {\r
- tinyMCEPopup.close();\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
-tinyMCEPopup.requireLangPack();\r
+++ /dev/null
-/**\r
- * cite.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-function init() {\r
- SXE.initElementDialog('cite');\r
- if (SXE.currentAction == "update") {\r
- SXE.showRemoveButton();\r
- }\r
-}\r
-\r
-function insertCite() {\r
- SXE.insertElement('cite');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function removeCite() {\r
- SXE.removeElement('cite');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-/**\r
- * del.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-function init() {\r
- SXE.initElementDialog('del');\r
- if (SXE.currentAction == "update") {\r
- setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));\r
- setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));\r
- SXE.showRemoveButton();\r
- }\r
-}\r
-\r
-function setElementAttribs(elm) {\r
- setAllCommonAttribs(elm);\r
- setAttrib(elm, 'datetime');\r
- setAttrib(elm, 'cite');\r
- elm.removeAttribute('data-mce-new');\r
-}\r
-\r
-function insertDel() {\r
- var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');\r
-\r
- if (elm == null) {\r
- var s = SXE.inst.selection.getContent();\r
- if(s.length > 0) {\r
- insertInlineElement('del');\r
- var elementArray = SXE.inst.dom.select('del[data-mce-new]');\r
- for (var i=0; i<elementArray.length; i++) {\r
- var elm = elementArray[i];\r
- setElementAttribs(elm);\r
- }\r
- }\r
- } else {\r
- setElementAttribs(elm);\r
- }\r
- tinyMCEPopup.editor.nodeChanged();\r
- tinyMCEPopup.execCommand('mceEndUndoLevel');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function removeDel() {\r
- SXE.removeElement('del');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-/**\r
- * element_common.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-tinyMCEPopup.requireLangPack();\r
-\r
-function initCommonAttributes(elm) {\r
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
-\r
- // Setup form data for common element attributes\r
- setFormValue('title', dom.getAttrib(elm, 'title'));\r
- setFormValue('id', dom.getAttrib(elm, 'id'));\r
- selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);\r
- setFormValue('style', dom.getAttrib(elm, 'style'));\r
- selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));\r
- setFormValue('lang', dom.getAttrib(elm, 'lang'));\r
- setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));\r
- setFormValue('onblur', dom.getAttrib(elm, 'onblur'));\r
- setFormValue('onclick', dom.getAttrib(elm, 'onclick'));\r
- setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));\r
- setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));\r
- setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));\r
- setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));\r
- setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));\r
- setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));\r
- setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));\r
- setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));\r
- setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));\r
-}\r
-\r
-function setFormValue(name, value) {\r
- if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;\r
-}\r
-\r
-function insertDateTime(id) {\r
- document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");\r
-}\r
-\r
-function getDateTime(d, fmt) {\r
- fmt = fmt.replace("%D", "%m/%d/%y");\r
- fmt = fmt.replace("%r", "%I:%M:%S %p");\r
- fmt = fmt.replace("%Y", "" + d.getFullYear());\r
- fmt = fmt.replace("%y", "" + d.getYear());\r
- fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));\r
- fmt = fmt.replace("%d", addZeros(d.getDate(), 2));\r
- fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));\r
- fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));\r
- fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));\r
- fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));\r
- fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));\r
- fmt = fmt.replace("%%", "%");\r
-\r
- return fmt;\r
-}\r
-\r
-function addZeros(value, len) {\r
- var i;\r
-\r
- value = "" + value;\r
-\r
- if (value.length < len) {\r
- for (i=0; i<(len-value.length); i++)\r
- value = "0" + value;\r
- }\r
-\r
- return value;\r
-}\r
-\r
-function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {\r
- if (!form_obj || !form_obj.elements[field_name])\r
- return;\r
-\r
- var sel = form_obj.elements[field_name];\r
-\r
- var found = false;\r
- for (var i=0; i<sel.options.length; i++) {\r
- var option = sel.options[i];\r
-\r
- if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {\r
- option.selected = true;\r
- found = true;\r
- } else\r
- option.selected = false;\r
- }\r
-\r
- if (!found && add_custom && value != '') {\r
- var option = new Option('Value: ' + value, value);\r
- option.selected = true;\r
- sel.options[sel.options.length] = option;\r
- }\r
-\r
- return found;\r
-}\r
-\r
-function setAttrib(elm, attrib, value) {\r
- var formObj = document.forms[0];\r
- var valueElm = formObj.elements[attrib.toLowerCase()];\r
- tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);\r
-}\r
-\r
-function setAllCommonAttribs(elm) {\r
- setAttrib(elm, 'title');\r
- setAttrib(elm, 'id');\r
- setAttrib(elm, 'class');\r
- setAttrib(elm, 'style');\r
- setAttrib(elm, 'dir');\r
- setAttrib(elm, 'lang');\r
- /*setAttrib(elm, 'onfocus');\r
- setAttrib(elm, 'onblur');\r
- setAttrib(elm, 'onclick');\r
- setAttrib(elm, 'ondblclick');\r
- setAttrib(elm, 'onmousedown');\r
- setAttrib(elm, 'onmouseup');\r
- setAttrib(elm, 'onmouseover');\r
- setAttrib(elm, 'onmousemove');\r
- setAttrib(elm, 'onmouseout');\r
- setAttrib(elm, 'onkeypress');\r
- setAttrib(elm, 'onkeydown');\r
- setAttrib(elm, 'onkeyup');*/\r
-}\r
-\r
-SXE = {\r
- currentAction : "insert",\r
- inst : tinyMCEPopup.editor,\r
- updateElement : null\r
-}\r
-\r
-SXE.focusElement = SXE.inst.selection.getNode();\r
-\r
-SXE.initElementDialog = function(element_name) {\r
- addClassesToList('class', 'xhtmlxtras_styles');\r
- TinyMCE_EditableSelects.init();\r
-\r
- element_name = element_name.toLowerCase();\r
- var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());\r
- if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) {\r
- SXE.currentAction = "update";\r
- }\r
-\r
- if (SXE.currentAction == "update") {\r
- initCommonAttributes(elm);\r
- SXE.updateElement = elm;\r
- }\r
-\r
- document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true); \r
-}\r
-\r
-SXE.insertElement = function(element_name) {\r
- var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;\r
-\r
- if (elm == null) {\r
- var s = SXE.inst.selection.getContent();\r
- if(s.length > 0) {\r
- tagName = element_name;\r
-\r
- insertInlineElement(element_name);\r
- var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));\r
- for (var i=0; i<elementArray.length; i++) {\r
- var elm = elementArray[i];\r
-\r
- if (SXE.inst.dom.getAttrib(elm, 'data-mce-new')) {\r
- elm.id = '';\r
- elm.setAttribute('id', '');\r
- elm.removeAttribute('id');\r
- elm.removeAttribute('data-mce-new');\r
-\r
- setAllCommonAttribs(elm);\r
- }\r
- }\r
- }\r
- } else {\r
- setAllCommonAttribs(elm);\r
- }\r
- SXE.inst.nodeChanged();\r
- tinyMCEPopup.execCommand('mceEndUndoLevel');\r
-}\r
-\r
-SXE.removeElement = function(element_name){\r
- element_name = element_name.toLowerCase();\r
- elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());\r
- if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){\r
- tinyMCE.execCommand('mceRemoveNode', false, elm);\r
- SXE.inst.nodeChanged();\r
- tinyMCEPopup.execCommand('mceEndUndoLevel');\r
- }\r
-}\r
-\r
-SXE.showRemoveButton = function() {\r
- document.getElementById("remove").style.display = '';\r
-}\r
-\r
-SXE.containsClass = function(elm,cl) {\r
- return (elm.className.indexOf(cl) > -1) ? true : false;\r
-}\r
-\r
-SXE.removeClass = function(elm,cl) {\r
- if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {\r
- return true;\r
- }\r
- var classNames = elm.className.split(" ");\r
- var newClassNames = "";\r
- for (var x = 0, cnl = classNames.length; x < cnl; x++) {\r
- if (classNames[x] != cl) {\r
- newClassNames += (classNames[x] + " ");\r
- }\r
- }\r
- elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end\r
-}\r
-\r
-SXE.addClass = function(elm,cl) {\r
- if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;\r
- return true;\r
-}\r
-\r
-function insertInlineElement(en) {\r
- var ed = tinyMCEPopup.editor, dom = ed.dom;\r
-\r
- ed.getDoc().execCommand('FontName', false, 'mceinline');\r
- tinymce.each(dom.select('span,font'), function(n) {\r
- if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
- dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1);\r
- });\r
-}\r
+++ /dev/null
-/**\r
- * ins.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-function init() {\r
- SXE.initElementDialog('ins');\r
- if (SXE.currentAction == "update") {\r
- setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));\r
- setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));\r
- SXE.showRemoveButton();\r
- }\r
-}\r
-\r
-function setElementAttribs(elm) {\r
- setAllCommonAttribs(elm);\r
- setAttrib(elm, 'datetime');\r
- setAttrib(elm, 'cite');\r
- elm.removeAttribute('data-mce-new');\r
-}\r
-\r
-function insertIns() {\r
- var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');\r
-\r
- if (elm == null) {\r
- var s = SXE.inst.selection.getContent();\r
- if(s.length > 0) {\r
- insertInlineElement('ins');\r
- var elementArray = SXE.inst.dom.select('ins[data-mce-new]');\r
- for (var i=0; i<elementArray.length; i++) {\r
- var elm = elementArray[i];\r
- setElementAttribs(elm);\r
- }\r
- }\r
- } else {\r
- setElementAttribs(elm);\r
- }\r
- tinyMCEPopup.editor.nodeChanged();\r
- tinyMCEPopup.execCommand('mceEndUndoLevel');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function removeIns() {\r
- SXE.removeElement('ins');\r
- tinyMCEPopup.close();\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-tinyMCE.addI18n('en.xhtmlxtras_dlg',{"attribs_title":"Insert/Edit Attributes","option_rtl":"Right to Left","option_ltr":"Left to Right","insert_date":"Insert Current Date/Time",remove:"Remove","title_cite_element":"Citation Element","title_abbr_element":"Abbreviation Element","title_acronym_element":"Acronym Element","title_del_element":"Deletion Element","title_ins_element":"Insertion Element","fieldset_events_tab":"Element Events","fieldset_attrib_tab":"Element Attributes","fieldset_general_tab":"General Settings","events_tab":"Events","attrib_tab":"Attributes","general_tab":"General","attribute_attrib_tab":"Attributes","attribute_events_tab":"Events","attribute_label_accesskey":"AccessKey","attribute_label_tabindex":"TabIndex","attribute_label_langcode":"Language","attribute_option_rtl":"Right to Left","attribute_option_ltr":"Left to Right","attribute_label_langdir":"Text Direction","attribute_label_datetime":"Date/Time","attribute_label_cite":"Cite","attribute_label_style":"Style","attribute_label_class":"Class","attribute_label_id":"ID","attribute_label_title":"Title"});
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> \r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advanced_dlg.about_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="js/about.js"></script>\r
-</head>\r
-<body id="about" style="display: none">\r
- <div class="tabs">\r
- <ul>\r
- <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>\r
- <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>\r
- <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>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <h3>{#advanced_dlg.about_title}</h3>\r
- <p>Version: <span id="version"></span> (<span id="date"></span>)</p>\r
- <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>\r
- by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>\r
- <p>Copyright © 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>\r
- <p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>\r
-\r
- <div id="buttoncontainer">\r
- <a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>\r
- </div>\r
- </div>\r
-\r
- <div id="plugins_panel" class="panel">\r
- <div id="pluginscontainer">\r
- <h3>{#advanced_dlg.about_loaded}</h3>\r
-\r
- <div id="plugintablecontainer">\r
- </div>\r
-\r
- <p> </p>\r
- </div>\r
- </div>\r
-\r
- <div id="help_panel" class="panel noscroll" style="overflow: visible;">\r
- <div id="iframecontainer"></div>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advanced_dlg.anchor_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/anchor.js"></script>\r
-</head>\r
-<body style="display: none" role="application" aria-labelledby="app_title">\r
-<form onsubmit="AnchorDialog.update();return false;" action="#">\r
- <table border="0" cellpadding="4" cellspacing="0" role="presentation">\r
- <tr>\r
- <td colspan="2" class="title" id="app_title">{#advanced_dlg.anchor_title}</td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="anchorName">{#advanced_dlg.anchor_name}:</label></td>\r
- <td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" aria-required="true" /></td>\r
- </tr>\r
- </table>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#update}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advanced_dlg.charmap_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/charmap.js"></script>\r
-</head>\r
-<body id="charmap" style="display:none" role="application">\r
-<table align="center" border="0" cellspacing="0" cellpadding="2" role="presentation">\r
- <tr>\r
- <td colspan="2" class="title" ><label for="charmapView" id="charmap_label">{#advanced_dlg.charmap_title}</label></td>\r
- </tr>\r
- <tr>\r
- <td id="charmapView" rowspan="2" align="left" valign="top">\r
- <!-- Chars will be rendered here -->\r
- </td>\r
- <td width="100" align="center" valign="top">\r
- <table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px" role="presentation">\r
- <tr>\r
- <td id="codeV"> </td>\r
- </tr>\r
- <tr>\r
- <td id="codeN"> </td>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td valign="bottom" style="padding-bottom: 3px;">\r
- <table width="100" align="center" border="0" cellpadding="2" cellspacing="0" role="presentation">\r
- <tr>\r
- <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>\r
- </tr>\r
- <tr>\r
- <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>\r
- </tr>\r
- <tr>\r
- <td style="font-size: 1px;"> </td>\r
- </tr>\r
- <tr>\r
- <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>\r
- </tr>\r
- <tr>\r
- <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>\r
- </tr>\r
- </table>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td colspan="2" id="charmap_usage">{#advanced_dlg.charmap_usage}</td>\r
- </tr>\r
- \r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advanced_dlg.colorpicker_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="js/color_picker.js"></script>\r
-</head>\r
-<body id="colorpicker" style="display: none" role="application" aria-labelledby="app_label">\r
- <span class="mceVoiceLabel" id="app_label" style="display:none;">{#advanced_dlg.colorpicker_title}</span>\r
-<form onsubmit="insertAction();return false" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <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>\r
- <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>\r
- <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>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="picker_panel" class="panel current">\r
- <fieldset>\r
- <legend>{#advanced_dlg.colorpicker_picker_title}</legend>\r
- <div id="picker">\r
- <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="" />\r
-\r
- <div id="light">\r
- <!-- Will be filled with divs -->\r
- </div>\r
-\r
- <br style="clear: both" />\r
- </div>\r
- </fieldset>\r
- </div>\r
-\r
- <div id="rgb_panel" class="panel">\r
- <fieldset>\r
- <legend id="webcolors_title">{#advanced_dlg.colorpicker_palette_title}</legend>\r
- <div id="webcolors">\r
- <!-- Gets filled with web safe colors-->\r
- </div>\r
-\r
- <br style="clear: both" />\r
- </fieldset>\r
- </div>\r
-\r
- <div id="named_panel" class="panel">\r
- <fieldset id="named_picker_label">\r
- <legend id="named_title">{#advanced_dlg.colorpicker_named_title}</legend>\r
- <div id="namedcolors" role="listbox" tabindex="0" aria-labelledby="named_picker_label">\r
- <!-- Gets filled with named colors-->\r
- </div>\r
-\r
- <br style="clear: both" />\r
-\r
- <div id="colornamecontainer">\r
- {#advanced_dlg.colorpicker_name} <span id="colorname"></span>\r
- </div>\r
- </fieldset>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#apply}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();"/>\r
- <div id="preview_wrapper"><div id="previewblock"><label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" class="text mceFocus" aria-required="true" /></div><span id="preview"></span></div>\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(p,m){var k,l,o=p.dom,j="",n,r;previewStyles=p.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function q(s){return s.replace(/%(\w+)/g,"")}k=m.block||m.inline||"span";l=o.create(k);f(m.styles,function(t,s){t=q(t);if(t){o.setStyle(l,s,t)}});f(m.attributes,function(t,s){t=q(t);if(t){o.setAttrib(l,s,t)}});f(m.classes,function(s){s=q(s);if(!o.hasClass(l,s)){o.addClass(l,s)}});o.setStyles(l,{position:"absolute",left:-65535});p.getBody().appendChild(l);n=o.getStyle(p.getBody(),"fontSize",true);n=/px$/.test(n)?parseInt(n,10):0;f(previewStyles.split(" "),function(s){var t=o.getStyle(l,s,true);if(s=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)){t=o.getStyle(p.getBody(),s,true);if(o.toHex(t).toLowerCase()=="#ffffff"){return}}if(s=="font-size"){if(/em|%$/.test(t)){if(n===0){return}t=parseFloat(t,10)/(/%$/.test(t)?100:1);t=(t*n)+"px"}}j+=s+":"+t+";"});o.remove(l);return j}h.ThemeManager.requireLangPack("advanced");h.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(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);n=k.settings;k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;if(!n.theme_advanced_buttons1){n=c({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"},n)}m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"top",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",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",theme_advanced_show_current_color:0,readonly:k.settings.readonly},n);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){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((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={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"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")+(u.settings.directionality=="rtl"?" mceRtl":"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j<o.clientWidth){j=o.clientWidth;i.setStyle(p,"width",o.clientWidth)}}if(l&&m.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+k.id+"_size",{cw:j,ch:n})}},destroy:function(){var j=this.editor.id;g.clear(j+"_resize");g.clear(j+"_path_row");g.clear(j+"_external_close")},_simpleLayout:function(z,u,l,j){var y=this,v=y.editor,w=z.theme_advanced_toolbar_location,q=z.theme_advanced_statusbar_location,m,k,r,x;if(z.readonly){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});return k}if(w=="top"){y._addToolbars(u,l)}if(w=="external"){m=x=i.create("div",{style:"position:relative"});m=i.add(m,"div",{id:v.id+"_external","class":"mceExternalToolbar"});i.add(m,"a",{id:v.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});m=i.add(m,"table",{id:v.id+"_tblext",cellSpacing:0,cellPadding:0});r=i.add(m,"tbody");if(j.firstChild.className=="mceOldBoxModel"){j.firstChild.appendChild(x)}else{j.insertBefore(x,j.firstChild)}y._addToolbars(r,l);v.onMouseUp.add(function(){var o=i.get(v.id+"_external");i.show(o);i.hide(e);var n=g.add(v.id+"_external_close","click",function(){i.hide(v.id+"_external");g.remove(v.id+"_external_close","click",n);return false});i.show(o);i.setStyle(o,"top",0-i.getRect(v.id+"_tblext").h-1);i.hide(o);i.show(o);o.style.filter="";e=v.id+"_external";o=null})}if(q=="top"){y._addStatusBar(u,l)}if(!z.theme_advanced_toolbar_container){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"})}if(w=="bottom"){y._addToolbars(u,l)}if(q=="bottom"){y._addStatusBar(u,l)}return k},_rowLayout:function(x,p,l){var w=this,q=w.editor,v,y,j=q.controlManager,m,k,u,r;v=x.theme_advanced_containers_default_class||"";y=x.theme_advanced_containers_default_align||"center";f(d(x.theme_advanced_containers||""),function(s,o){var n=x["theme_advanced_container_"+s]||"";switch(s.toLowerCase()){case"mceeditor":m=i.add(p,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":w._addStatusBar(p,l);break;default:r=(x["theme_advanced_container_"+s+"_align"]||y).toLowerCase();r="mce"+w._ufirst(r);m=i.add(i.add(p,"tr"),"td",{"class":"mceToolbar "+(x["theme_advanced_container_"+s+"_class"]||v)+" "+r||y});u=j.createToolbar("toolbar"+o);w._addControls(n,u);i.setHTML(m,u.renderHTML());l.deltaHeight-=x.theme_advanced_row_height}});return k},_addControls:function(k,j){var l=this,m=l.settings,n,o=l.editor.controlManager;if(m.theme_advanced_disable&&!l._disabled){n={};f(d(m.theme_advanced_disable),function(p){n[p]=1});l._disabled=n}else{n=l._disabled}f(d(k),function(q){var p;if(n&&n[q]){return}if(q=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(r){r=l.createControl(r,o);if(r){j.add(r)}});return}p=l.createControl(q,o);if(p){j.add(p)}})},_addToolbars:function(y,k){var B=this,q,p,u=B.editor,C=B.settings,A,j=u.controlManager,w,l,r=[],z,x,m=false;x=j.createToolbarGroup("toolbargroup",{name:u.getLang("advanced.toolbar"),tab_focus_toolbar:u.getParam("theme_advanced_tab_focus_toolbar")});B.toolbarGroup=x;z=C.theme_advanced_toolbar_align.toLowerCase();z="mce"+B._ufirst(z);l=i.add(i.add(y,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+z,role:"toolbar"});for(q=1;(A=C["theme_advanced_buttons"+q]);q++){m=true;p=j.createToolbar("toolbar"+q,{"class":"mceToolbarRow"+q});if(C["theme_advanced_buttons"+q+"_add"]){A+=","+C["theme_advanced_buttons"+q+"_add"]}if(C["theme_advanced_buttons"+q+"_add_before"]){A=C["theme_advanced_buttons"+q+"_add_before"]+","+A}B._addControls(A,p);x.add(p);k.deltaHeight-=C.theme_advanced_row_height}if(!m){k.deltaHeight-=C.theme_advanced_row_height}r.push(x.renderHTML());r.push(i.createHTML("a",{href:"#",accesskey:"z",title:u.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+u.id+"').focus();"},"<!-- IE -->"));i.setHTML(l,r.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true);q.nodeChanged()}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.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]}}}u.setActive("visualaid",o.hasVisual);z._updateUndoStatus(o);u.setDisabled("outdent",!o.queryCommandState("Outdent"));D=q("A");if(H=u.get("link")){H.setDisabled((!D&&r)||(D&&!D.href));H.setActive(!!D&&(!D.name&&!D.id))}if(H=u.get("unlink")){H.setDisabled(!D&&r);H.setActive(!!D&&!D.name&&!D.id)}if(H=u.get("anchor")){H.setActive(!r&&!!D&&(D.name||(D.id&&!D.href)))}D=q("IMG");if(H=u.get("image")){H.setActive(!r&&!!D&&E.className.indexOf("mceItem")==-1)}if(H=u.get("styleselect")){z._importClasses();k=[];f(H.items,function(n){k.push(n.value)});j=o.formatter.matchAll(k);H.select(j[0]);h.each(j,function(p,n){if(n>0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(o.dom.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"&&I.scopeName){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(o.dom.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce));
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_template_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function(tinymce) {\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;\r
-\r
- // Generates a preview for a format\r
- function getPreviewCss(ed, fmt) {\r
- var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;\r
-\r
- previewStyles = ed.settings.preview_styles;\r
-\r
- // No preview forced\r
- if (previewStyles === false)\r
- return '';\r
-\r
- // Default preview\r
- if (!previewStyles)\r
- previewStyles = 'font-family font-size font-weight text-decoration text-transform color background-color';\r
-\r
- // Removes any variables since these can't be previewed\r
- function removeVars(val) {\r
- return val.replace(/%(\w+)/g, '');\r
- };\r
-\r
- // Create block/inline element to use for preview\r
- name = fmt.block || fmt.inline || 'span';\r
- previewElm = dom.create(name);\r
-\r
- // Add format styles to preview element\r
- each(fmt.styles, function(value, name) {\r
- value = removeVars(value);\r
-\r
- if (value)\r
- dom.setStyle(previewElm, name, value);\r
- });\r
-\r
- // Add attributes to preview element\r
- each(fmt.attributes, function(value, name) {\r
- value = removeVars(value);\r
-\r
- if (value)\r
- dom.setAttrib(previewElm, name, value);\r
- });\r
-\r
- // Add classes to preview element\r
- each(fmt.classes, function(value) {\r
- value = removeVars(value);\r
-\r
- if (!dom.hasClass(previewElm, value))\r
- dom.addClass(previewElm, value);\r
- });\r
-\r
- // Add the previewElm outside the visual area\r
- dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF});\r
- ed.getBody().appendChild(previewElm);\r
-\r
- // Get parent container font size so we can compute px values out of em/% for older IE:s\r
- parentFontSize = dom.getStyle(ed.getBody(), 'fontSize', true);\r
- parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;\r
-\r
- each(previewStyles.split(' '), function(name) {\r
- var value = dom.getStyle(previewElm, name, true);\r
-\r
- // If background is transparent then check if the body has a background color we can use\r
- if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {\r
- value = dom.getStyle(ed.getBody(), name, true);\r
-\r
- // Ignore white since it's the default color, not the nicest fix\r
- if (dom.toHex(value).toLowerCase() == '#ffffff') {\r
- return;\r
- }\r
- }\r
-\r
- // Old IE won't calculate the font size so we need to do that manually\r
- if (name == 'font-size') {\r
- if (/em|%$/.test(value)) {\r
- if (parentFontSize === 0) {\r
- return;\r
- }\r
-\r
- // Convert font size from em/% to px\r
- value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1);\r
- value = (value * parentFontSize) + 'px';\r
- }\r
- }\r
-\r
- previewCss += name + ':' + value + ';';\r
- });\r
-\r
- dom.remove(previewElm);\r
-\r
- return previewCss;\r
- };\r
-\r
- // Tell it to load theme specific language pack(s)\r
- tinymce.ThemeManager.requireLangPack('advanced');\r
-\r
- tinymce.create('tinymce.themes.AdvancedTheme', {\r
- sizes : [8, 10, 12, 14, 18, 24, 36],\r
-\r
- // Control name lookup, format: title, command\r
- controls : {\r
- bold : ['bold_desc', 'Bold'],\r
- italic : ['italic_desc', 'Italic'],\r
- underline : ['underline_desc', 'Underline'],\r
- strikethrough : ['striketrough_desc', 'Strikethrough'],\r
- justifyleft : ['justifyleft_desc', 'JustifyLeft'],\r
- justifycenter : ['justifycenter_desc', 'JustifyCenter'],\r
- justifyright : ['justifyright_desc', 'JustifyRight'],\r
- justifyfull : ['justifyfull_desc', 'JustifyFull'],\r
- bullist : ['bullist_desc', 'InsertUnorderedList'],\r
- numlist : ['numlist_desc', 'InsertOrderedList'],\r
- outdent : ['outdent_desc', 'Outdent'],\r
- indent : ['indent_desc', 'Indent'],\r
- cut : ['cut_desc', 'Cut'],\r
- copy : ['copy_desc', 'Copy'],\r
- paste : ['paste_desc', 'Paste'],\r
- undo : ['undo_desc', 'Undo'],\r
- redo : ['redo_desc', 'Redo'],\r
- link : ['link_desc', 'mceLink'],\r
- unlink : ['unlink_desc', 'unlink'],\r
- image : ['image_desc', 'mceImage'],\r
- cleanup : ['cleanup_desc', 'mceCleanup'],\r
- help : ['help_desc', 'mceHelp'],\r
- code : ['code_desc', 'mceCodeEditor'],\r
- hr : ['hr_desc', 'InsertHorizontalRule'],\r
- removeformat : ['removeformat_desc', 'RemoveFormat'],\r
- sub : ['sub_desc', 'subscript'],\r
- sup : ['sup_desc', 'superscript'],\r
- forecolor : ['forecolor_desc', 'ForeColor'],\r
- forecolorpicker : ['forecolor_desc', 'mceForeColor'],\r
- backcolor : ['backcolor_desc', 'HiliteColor'],\r
- backcolorpicker : ['backcolor_desc', 'mceBackColor'],\r
- charmap : ['charmap_desc', 'mceCharMap'],\r
- visualaid : ['visualaid_desc', 'mceToggleVisualAid'],\r
- anchor : ['anchor_desc', 'mceInsertAnchor'],\r
- newdocument : ['newdocument_desc', 'mceNewDocument'],\r
- blockquote : ['blockquote_desc', 'mceBlockQuote']\r
- },\r
-\r
- stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],\r
-\r
- init : function(ed, url) {\r
- var t = this, s, v, o;\r
-\r
- t.editor = ed;\r
- t.url = url;\r
- t.onResolveName = new tinymce.util.Dispatcher(this);\r
- s = ed.settings;\r
-\r
- ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();\r
- ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;\r
-\r
- // Setup default buttons\r
- if (!s.theme_advanced_buttons1) {\r
- s = extend({\r
- theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",\r
- theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",\r
- theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap"\r
- }, s);\r
- }\r
-\r
- // Default settings\r
- t.settings = s = extend({\r
- theme_advanced_path : true,\r
- theme_advanced_toolbar_location : 'top',\r
- theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",\r
- theme_advanced_toolbar_align : "left",\r
- theme_advanced_statusbar_location : "bottom",\r
- 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",\r
- theme_advanced_more_colors : 1,\r
- theme_advanced_row_height : 23,\r
- theme_advanced_resize_horizontal : 1,\r
- theme_advanced_resizing_use_cookie : 1,\r
- theme_advanced_font_sizes : "1,2,3,4,5,6,7",\r
- theme_advanced_font_selector : "span",\r
- theme_advanced_show_current_color: 0,\r
- readonly : ed.settings.readonly\r
- }, s);\r
-\r
- // Setup default font_size_style_values\r
- if (!s.font_size_style_values)\r
- s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";\r
-\r
- if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {\r
- s.font_size_style_values = tinymce.explode(s.font_size_style_values);\r
- s.font_size_classes = tinymce.explode(s.font_size_classes || '');\r
-\r
- // Parse string value\r
- o = {};\r
- ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;\r
- each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {\r
- var cl;\r
-\r
- if (k == v && v >= 1 && v <= 7) {\r
- k = v + ' (' + t.sizes[v - 1] + 'pt)';\r
- cl = s.font_size_classes[v - 1];\r
- v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');\r
- }\r
-\r
- if (/^\s*\./.test(v))\r
- cl = v.replace(/\./g, '');\r
-\r
- o[k] = cl ? {'class' : cl} : {fontSize : v};\r
- });\r
-\r
- s.theme_advanced_font_sizes = o;\r
- }\r
-\r
- if ((v = s.theme_advanced_path_location) && v != 'none')\r
- s.theme_advanced_statusbar_location = s.theme_advanced_path_location;\r
-\r
- if (s.theme_advanced_statusbar_location == 'none')\r
- s.theme_advanced_statusbar_location = 0;\r
-\r
- if (ed.settings.content_css !== false)\r
- ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css"));\r
-\r
- // Init editor\r
- ed.onInit.add(function() {\r
- if (!ed.settings.readonly) {\r
- ed.onNodeChange.add(t._nodeChanged, t);\r
- ed.onKeyUp.add(t._updateUndoStatus, t);\r
- ed.onMouseUp.add(t._updateUndoStatus, t);\r
- ed.dom.bind(ed.dom.getRoot(), 'dragend', function() {\r
- t._updateUndoStatus(ed);\r
- });\r
- }\r
- });\r
-\r
- ed.onSetProgressState.add(function(ed, b, ti) {\r
- var co, id = ed.id, tb;\r
-\r
- if (b) {\r
- t.progressTimer = setTimeout(function() {\r
- co = ed.getContainer();\r
- co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);\r
- tb = DOM.get(ed.id + '_tbl');\r
-\r
- DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});\r
- DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});\r
- }, ti || 0);\r
- } else {\r
- DOM.remove(id + '_blocker');\r
- DOM.remove(id + '_progress');\r
- clearTimeout(t.progressTimer);\r
- }\r
- });\r
-\r
- DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");\r
-\r
- if (s.skin_variant)\r
- DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");\r
- },\r
-\r
- _isHighContrast : function() {\r
- var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'});\r
-\r
- actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, '');\r
- DOM.remove(div);\r
-\r
- return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56';\r
- },\r
-\r
- createControl : function(n, cf) {\r
- var cd, c;\r
-\r
- if (c = cf.createControl(n))\r
- return c;\r
-\r
- switch (n) {\r
- case "styleselect":\r
- return this._createStyleSelect();\r
-\r
- case "formatselect":\r
- return this._createBlockFormats();\r
-\r
- case "fontselect":\r
- return this._createFontSelect();\r
-\r
- case "fontsizeselect":\r
- return this._createFontSizeSelect();\r
-\r
- case "forecolor":\r
- return this._createForeColorMenu();\r
-\r
- case "backcolor":\r
- return this._createBackColorMenu();\r
- }\r
-\r
- if ((cd = this.controls[n]))\r
- return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});\r
- },\r
-\r
- execCommand : function(cmd, ui, val) {\r
- var f = this['_' + cmd];\r
-\r
- if (f) {\r
- f.call(this, ui, val);\r
- return true;\r
- }\r
-\r
- return false;\r
- },\r
-\r
- _importClasses : function(e) {\r
- var ed = this.editor, ctrl = ed.controlManager.get('styleselect');\r
-\r
- if (ctrl.getLength() == 0) {\r
- each(ed.dom.getClasses(), function(o, idx) {\r
- var name = 'style_' + idx, fmt;\r
-\r
- fmt = {\r
- inline : 'span',\r
- attributes : {'class' : o['class']},\r
- selector : '*'\r
- };\r
-\r
- ed.formatter.register(name, fmt);\r
-\r
- ctrl.add(o['class'], name, {\r
- style: function() {\r
- return getPreviewCss(ed, fmt);\r
- }\r
- });\r
- });\r
- }\r
- },\r
-\r
- _createStyleSelect : function(n) {\r
- var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;\r
-\r
- // Setup style select box\r
- ctrl = ctrlMan.createListBox('styleselect', {\r
- title : 'advanced.style_select',\r
- onselect : function(name) {\r
- var matches, formatNames = [], removedFormat;\r
-\r
- each(ctrl.items, function(item) {\r
- formatNames.push(item.value);\r
- });\r
-\r
- ed.focus();\r
- ed.undoManager.add();\r
-\r
- // Toggle off the current format(s)\r
- matches = ed.formatter.matchAll(formatNames);\r
- tinymce.each(matches, function(match) {\r
- if (!name || match == name) {\r
- if (match)\r
- ed.formatter.remove(match);\r
-\r
- removedFormat = true;\r
- }\r
- });\r
-\r
- if (!removedFormat)\r
- ed.formatter.apply(name);\r
-\r
- ed.undoManager.add();\r
- ed.nodeChanged();\r
-\r
- return false; // No auto select\r
- }\r
- });\r
-\r
- // Handle specified format\r
- ed.onPreInit.add(function() {\r
- var counter = 0, formats = ed.getParam('style_formats');\r
-\r
- if (formats) {\r
- each(formats, function(fmt) {\r
- var name, keys = 0;\r
-\r
- each(fmt, function() {keys++;});\r
-\r
- if (keys > 1) {\r
- name = fmt.name = fmt.name || 'style_' + (counter++);\r
- ed.formatter.register(name, fmt);\r
- ctrl.add(fmt.title, name, {\r
- style: function() {\r
- return getPreviewCss(ed, fmt);\r
- }\r
- });\r
- } else\r
- ctrl.add(fmt.title);\r
- });\r
- } else {\r
- each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {\r
- var name, fmt;\r
-\r
- if (val) {\r
- name = 'style_' + (counter++);\r
- fmt = {\r
- inline : 'span',\r
- classes : val,\r
- selector : '*'\r
- };\r
-\r
- ed.formatter.register(name, fmt);\r
- ctrl.add(t.editor.translate(key), name, {\r
- style: function() {\r
- return getPreviewCss(ed, fmt);\r
- }\r
- });\r
- }\r
- });\r
- }\r
- });\r
-\r
- // Auto import classes if the ctrl box is empty\r
- if (ctrl.getLength() == 0) {\r
- ctrl.onPostRender.add(function(ed, n) {\r
- if (!ctrl.NativeListBox) {\r
- Event.add(n.id + '_text', 'focus', t._importClasses, t);\r
- Event.add(n.id + '_text', 'mousedown', t._importClasses, t);\r
- Event.add(n.id + '_open', 'focus', t._importClasses, t);\r
- Event.add(n.id + '_open', 'mousedown', t._importClasses, t);\r
- } else\r
- Event.add(n.id, 'focus', t._importClasses, t);\r
- });\r
- }\r
-\r
- return ctrl;\r
- },\r
-\r
- _createFontSelect : function() {\r
- var c, t = this, ed = t.editor;\r
-\r
- c = ed.controlManager.createListBox('fontselect', {\r
- title : 'advanced.fontdefault',\r
- onselect : function(v) {\r
- var cur = c.items[c.selectedIndex];\r
-\r
- if (!v && cur) {\r
- ed.execCommand('FontName', false, cur.value);\r
- return;\r
- }\r
-\r
- ed.execCommand('FontName', false, v);\r
-\r
- // Fake selection, execCommand will fire a nodeChange and update the selection\r
- c.select(function(sv) {\r
- return v == sv;\r
- });\r
-\r
- if (cur && cur.value == v) {\r
- c.select(null);\r
- }\r
-\r
- return false; // No auto select\r
- }\r
- });\r
-\r
- if (c) {\r
- each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {\r
- c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});\r
- });\r
- }\r
-\r
- return c;\r
- },\r
-\r
- _createFontSizeSelect : function() {\r
- var t = this, ed = t.editor, c, i = 0, cl = [];\r
-\r
- c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {\r
- var cur = c.items[c.selectedIndex];\r
-\r
- if (!v && cur) {\r
- cur = cur.value;\r
-\r
- if (cur['class']) {\r
- ed.formatter.toggle('fontsize_class', {value : cur['class']});\r
- ed.undoManager.add();\r
- ed.nodeChanged();\r
- } else {\r
- ed.execCommand('FontSize', false, cur.fontSize);\r
- }\r
-\r
- return;\r
- }\r
-\r
- if (v['class']) {\r
- ed.focus();\r
- ed.undoManager.add();\r
- ed.formatter.toggle('fontsize_class', {value : v['class']});\r
- ed.undoManager.add();\r
- ed.nodeChanged();\r
- } else\r
- ed.execCommand('FontSize', false, v.fontSize);\r
-\r
- // Fake selection, execCommand will fire a nodeChange and update the selection\r
- c.select(function(sv) {\r
- return v == sv;\r
- });\r
-\r
- if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) {\r
- c.select(null);\r
- }\r
-\r
- return false; // No auto select\r
- }});\r
-\r
- if (c) {\r
- each(t.settings.theme_advanced_font_sizes, function(v, k) {\r
- var fz = v.fontSize;\r
-\r
- if (fz >= 1 && fz <= 7)\r
- fz = t.sizes[parseInt(fz) - 1] + 'pt';\r
-\r
- c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});\r
- });\r
- }\r
-\r
- return c;\r
- },\r
-\r
- _createBlockFormats : function() {\r
- var c, fmts = {\r
- p : 'advanced.paragraph',\r
- address : 'advanced.address',\r
- pre : 'advanced.pre',\r
- h1 : 'advanced.h1',\r
- h2 : 'advanced.h2',\r
- h3 : 'advanced.h3',\r
- h4 : 'advanced.h4',\r
- h5 : 'advanced.h5',\r
- h6 : 'advanced.h6',\r
- div : 'advanced.div',\r
- blockquote : 'advanced.blockquote',\r
- code : 'advanced.code',\r
- dt : 'advanced.dt',\r
- dd : 'advanced.dd',\r
- samp : 'advanced.samp'\r
- }, t = this;\r
-\r
- c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) {\r
- t.editor.execCommand('FormatBlock', false, v);\r
- return false;\r
- }});\r
-\r
- if (c) {\r
- each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {\r
- c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v, style: function() {\r
- return getPreviewCss(t.editor, {block: v});\r
- }});\r
- });\r
- }\r
-\r
- return c;\r
- },\r
-\r
- _createForeColorMenu : function() {\r
- var c, t = this, s = t.settings, o = {}, v;\r
-\r
- if (s.theme_advanced_more_colors) {\r
- o.more_colors_func = function() {\r
- t._mceColorPicker(0, {\r
- color : c.value,\r
- func : function(co) {\r
- c.setColor(co);\r
- }\r
- });\r
- };\r
- }\r
-\r
- if (v = s.theme_advanced_text_colors)\r
- o.colors = v;\r
-\r
- if (s.theme_advanced_default_foreground_color)\r
- o.default_color = s.theme_advanced_default_foreground_color;\r
-\r
- o.title = 'advanced.forecolor_desc';\r
- o.cmd = 'ForeColor';\r
- o.scope = this;\r
-\r
- c = t.editor.controlManager.createColorSplitButton('forecolor', o);\r
-\r
- return c;\r
- },\r
-\r
- _createBackColorMenu : function() {\r
- var c, t = this, s = t.settings, o = {}, v;\r
-\r
- if (s.theme_advanced_more_colors) {\r
- o.more_colors_func = function() {\r
- t._mceColorPicker(0, {\r
- color : c.value,\r
- func : function(co) {\r
- c.setColor(co);\r
- }\r
- });\r
- };\r
- }\r
-\r
- if (v = s.theme_advanced_background_colors)\r
- o.colors = v;\r
-\r
- if (s.theme_advanced_default_background_color)\r
- o.default_color = s.theme_advanced_default_background_color;\r
-\r
- o.title = 'advanced.backcolor_desc';\r
- o.cmd = 'HiliteColor';\r
- o.scope = this;\r
-\r
- c = t.editor.controlManager.createColorSplitButton('backcolor', o);\r
-\r
- return c;\r
- },\r
-\r
- renderUI : function(o) {\r
- var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;\r
-\r
- if (ed.settings) {\r
- ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut');\r
- }\r
-\r
- // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for.\r
- // Maybe actually inherit it from the original textara?\r
- 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) : '') + (ed.settings.directionality == "rtl" ? ' mceRtl' : '')});\r
- DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label);\r
-\r
- if (!DOM.boxModel)\r
- n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});\r
-\r
- n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});\r
- n = tb = DOM.add(n, 'tbody');\r
-\r
- switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {\r
- case "rowlayout":\r
- ic = t._rowLayout(s, tb, o);\r
- break;\r
-\r
- case "customlayout":\r
- ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);\r
- break;\r
-\r
- default:\r
- ic = t._simpleLayout(s, tb, o, p);\r
- }\r
-\r
- n = o.targetNode;\r
-\r
- // Add classes to first and last TRs\r
- nl = sc.rows;\r
- DOM.addClass(nl[0], 'mceFirst');\r
- DOM.addClass(nl[nl.length - 1], 'mceLast');\r
-\r
- // Add classes to first and last TDs\r
- each(DOM.select('tr', tb), function(n) {\r
- DOM.addClass(n.firstChild, 'mceFirst');\r
- DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');\r
- });\r
-\r
- if (DOM.get(s.theme_advanced_toolbar_container))\r
- DOM.get(s.theme_advanced_toolbar_container).appendChild(p);\r
- else\r
- DOM.insertAfter(p, n);\r
-\r
- Event.add(ed.id + '_path_row', 'click', function(e) {\r
- e = e.target;\r
-\r
- if (e.nodeName == 'A') {\r
- t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));\r
- return false;\r
- }\r
- });\r
-/*\r
- if (DOM.get(ed.id + '_path_row')) {\r
- Event.add(ed.id + '_tbl', 'mouseover', function(e) {\r
- var re;\r
-\r
- e = e.target;\r
-\r
- if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {\r
- re = DOM.get(ed.id + '_path_row');\r
- t.lastPath = re.innerHTML;\r
- DOM.setHTML(re, e.parentNode.title);\r
- }\r
- });\r
-\r
- Event.add(ed.id + '_tbl', 'mouseout', function(e) {\r
- if (t.lastPath) {\r
- DOM.setHTML(ed.id + '_path_row', t.lastPath);\r
- t.lastPath = 0;\r
- }\r
- });\r
- }\r
-*/\r
-\r
- if (!ed.getParam('accessibility_focus'))\r
- Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});\r
-\r
- if (s.theme_advanced_toolbar_location == 'external')\r
- o.deltaHeight = 0;\r
-\r
- t.deltaHeight = o.deltaHeight;\r
- o.targetNode = null;\r
-\r
- ed.onKeyDown.add(function(ed, evt) {\r
- var DOM_VK_F10 = 121, DOM_VK_F11 = 122;\r
-\r
- if (evt.altKey) {\r
- if (evt.keyCode === DOM_VK_F10) {\r
- // Make sure focus is given to toolbar in Safari.\r
- // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame\r
- if (tinymce.isWebKit) {\r
- window.focus();\r
- }\r
- t.toolbarGroup.focus();\r
- return Event.cancel(evt);\r
- } else if (evt.keyCode === DOM_VK_F11) {\r
- DOM.get(ed.id + '_path_row').focus();\r
- return Event.cancel(evt);\r
- }\r
- }\r
- });\r
-\r
- // alt+0 is the UK recommended shortcut for accessing the list of access controls.\r
- ed.addShortcut('alt+0', '', 'mceShortcuts', t);\r
-\r
- return {\r
- iframeContainer : ic,\r
- editorContainer : ed.id + '_parent',\r
- sizeContainer : sc,\r
- deltaHeight : o.deltaHeight\r
- };\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Advanced theme',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- }\r
- },\r
-\r
- resizeBy : function(dw, dh) {\r
- var e = DOM.get(this.editor.id + '_ifr');\r
-\r
- this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);\r
- },\r
-\r
- resizeTo : function(w, h, store) {\r
- var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');\r
-\r
- // Boundery fix box\r
- w = Math.max(s.theme_advanced_resizing_min_width || 100, w);\r
- h = Math.max(s.theme_advanced_resizing_min_height || 100, h);\r
- w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);\r
- h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);\r
-\r
- // Resize iframe and container\r
- DOM.setStyle(e, 'height', '');\r
- DOM.setStyle(ifr, 'height', h);\r
-\r
- if (s.theme_advanced_resize_horizontal) {\r
- DOM.setStyle(e, 'width', '');\r
- DOM.setStyle(ifr, 'width', w);\r
-\r
- // Make sure that the size is never smaller than the over all ui\r
- if (w < e.clientWidth) {\r
- w = e.clientWidth;\r
- DOM.setStyle(ifr, 'width', e.clientWidth);\r
- }\r
- }\r
-\r
- // Store away the size\r
- if (store && s.theme_advanced_resizing_use_cookie) {\r
- Cookie.setHash("TinyMCE_" + ed.id + "_size", {\r
- cw : w,\r
- ch : h\r
- });\r
- }\r
- },\r
-\r
- destroy : function() {\r
- var id = this.editor.id;\r
-\r
- Event.clear(id + '_resize');\r
- Event.clear(id + '_path_row');\r
- Event.clear(id + '_external_close');\r
- },\r
-\r
- // Internal functions\r
-\r
- _simpleLayout : function(s, tb, o, p) {\r
- var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;\r
-\r
- if (s.readonly) {\r
- n = DOM.add(tb, 'tr');\r
- n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
- return ic;\r
- }\r
-\r
- // Create toolbar container at top\r
- if (lo == 'top')\r
- t._addToolbars(tb, o);\r
-\r
- // Create external toolbar\r
- if (lo == 'external') {\r
- n = c = DOM.create('div', {style : 'position:relative'});\r
- n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});\r
- DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});\r
- n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});\r
- etb = DOM.add(n, 'tbody');\r
-\r
- if (p.firstChild.className == 'mceOldBoxModel')\r
- p.firstChild.appendChild(c);\r
- else\r
- p.insertBefore(c, p.firstChild);\r
-\r
- t._addToolbars(etb, o);\r
-\r
- ed.onMouseUp.add(function() {\r
- var e = DOM.get(ed.id + '_external');\r
- DOM.show(e);\r
-\r
- DOM.hide(lastExtID);\r
-\r
- var f = Event.add(ed.id + '_external_close', 'click', function() {\r
- DOM.hide(ed.id + '_external');\r
- Event.remove(ed.id + '_external_close', 'click', f);\r
- return false;\r
- });\r
-\r
- DOM.show(e);\r
- DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);\r
-\r
- // Fixes IE rendering bug\r
- DOM.hide(e);\r
- DOM.show(e);\r
- e.style.filter = '';\r
-\r
- lastExtID = ed.id + '_external';\r
-\r
- e = null;\r
- });\r
- }\r
-\r
- if (sl == 'top')\r
- t._addStatusBar(tb, o);\r
-\r
- // Create iframe container\r
- if (!s.theme_advanced_toolbar_container) {\r
- n = DOM.add(tb, 'tr');\r
- n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
- }\r
-\r
- // Create toolbar container at bottom\r
- if (lo == 'bottom')\r
- t._addToolbars(tb, o);\r
-\r
- if (sl == 'bottom')\r
- t._addStatusBar(tb, o);\r
-\r
- return ic;\r
- },\r
-\r
- _rowLayout : function(s, tb, o) {\r
- var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;\r
-\r
- dc = s.theme_advanced_containers_default_class || '';\r
- da = s.theme_advanced_containers_default_align || 'center';\r
-\r
- each(explode(s.theme_advanced_containers || ''), function(c, i) {\r
- var v = s['theme_advanced_container_' + c] || '';\r
-\r
- switch (c.toLowerCase()) {\r
- case 'mceeditor':\r
- n = DOM.add(tb, 'tr');\r
- n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
- break;\r
-\r
- case 'mceelementpath':\r
- t._addStatusBar(tb, o);\r
- break;\r
-\r
- default:\r
- a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();\r
- a = 'mce' + t._ufirst(a);\r
-\r
- n = DOM.add(DOM.add(tb, 'tr'), 'td', {\r
- 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da\r
- });\r
-\r
- to = cf.createToolbar("toolbar" + i);\r
- t._addControls(v, to);\r
- DOM.setHTML(n, to.renderHTML());\r
- o.deltaHeight -= s.theme_advanced_row_height;\r
- }\r
- });\r
-\r
- return ic;\r
- },\r
-\r
- _addControls : function(v, tb) {\r
- var t = this, s = t.settings, di, cf = t.editor.controlManager;\r
-\r
- if (s.theme_advanced_disable && !t._disabled) {\r
- di = {};\r
-\r
- each(explode(s.theme_advanced_disable), function(v) {\r
- di[v] = 1;\r
- });\r
-\r
- t._disabled = di;\r
- } else\r
- di = t._disabled;\r
-\r
- each(explode(v), function(n) {\r
- var c;\r
-\r
- if (di && di[n])\r
- return;\r
-\r
- // Compatiblity with 2.x\r
- if (n == 'tablecontrols') {\r
- each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {\r
- n = t.createControl(n, cf);\r
-\r
- if (n)\r
- tb.add(n);\r
- });\r
-\r
- return;\r
- }\r
-\r
- c = t.createControl(n, cf);\r
-\r
- if (c)\r
- tb.add(c);\r
- });\r
- },\r
-\r
- _addToolbars : function(c, o) {\r
- var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup, toolbarsExist = false;\r
-\r
- toolbarGroup = cf.createToolbarGroup('toolbargroup', {\r
- 'name': ed.getLang('advanced.toolbar'),\r
- 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar')\r
- });\r
-\r
- t.toolbarGroup = toolbarGroup;\r
-\r
- a = s.theme_advanced_toolbar_align.toLowerCase();\r
- a = 'mce' + t._ufirst(a);\r
-\r
- n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"});\r
-\r
- // Create toolbar and add the controls\r
- for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {\r
- toolbarsExist = true;\r
- tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});\r
-\r
- if (s['theme_advanced_buttons' + i + '_add'])\r
- v += ',' + s['theme_advanced_buttons' + i + '_add'];\r
-\r
- if (s['theme_advanced_buttons' + i + '_add_before'])\r
- v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;\r
-\r
- t._addControls(v, tb);\r
- toolbarGroup.add(tb);\r
-\r
- o.deltaHeight -= s.theme_advanced_row_height;\r
- }\r
- // Handle case when there are no toolbar buttons and ensure editor height is adjusted accordingly\r
- if (!toolbarsExist)\r
- o.deltaHeight -= s.theme_advanced_row_height;\r
- h.push(toolbarGroup.renderHTML());\r
- h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));\r
- DOM.setHTML(n, h.join(''));\r
- },\r
-\r
- _addStatusBar : function(tb, o) {\r
- var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;\r
-\r
- n = DOM.add(tb, 'tr');\r
- n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});\r
- n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});\r
- if (s.theme_advanced_path) {\r
- DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));\r
- DOM.add(n, 'span', {}, ': ');\r
- } else {\r
- DOM.add(n, 'span', {}, ' ');\r
- }\r
-\r
-\r
- if (s.theme_advanced_resizing) {\r
- DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"});\r
-\r
- if (s.theme_advanced_resizing_use_cookie) {\r
- ed.onPostRender.add(function() {\r
- var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');\r
-\r
- if (!o)\r
- return;\r
-\r
- t.resizeTo(o.cw, o.ch);\r
- });\r
- }\r
-\r
- ed.onPostRender.add(function() {\r
- Event.add(ed.id + '_resize', 'click', function(e) {\r
- e.preventDefault();\r
- });\r
-\r
- Event.add(ed.id + '_resize', 'mousedown', function(e) {\r
- var mouseMoveHandler1, mouseMoveHandler2,\r
- mouseUpHandler1, mouseUpHandler2,\r
- startX, startY, startWidth, startHeight, width, height, ifrElm;\r
-\r
- function resizeOnMove(e) {\r
- e.preventDefault();\r
-\r
- width = startWidth + (e.screenX - startX);\r
- height = startHeight + (e.screenY - startY);\r
-\r
- t.resizeTo(width, height);\r
- };\r
-\r
- function endResize(e) {\r
- // Stop listening\r
- Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);\r
- Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);\r
- Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);\r
- Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);\r
-\r
- width = startWidth + (e.screenX - startX);\r
- height = startHeight + (e.screenY - startY);\r
- t.resizeTo(width, height, true);\r
-\r
- ed.nodeChanged();\r
- };\r
-\r
- e.preventDefault();\r
-\r
- // Get the current rect size\r
- startX = e.screenX;\r
- startY = e.screenY;\r
- ifrElm = DOM.get(t.editor.id + '_ifr');\r
- startWidth = width = ifrElm.clientWidth;\r
- startHeight = height = ifrElm.clientHeight;\r
-\r
- // Register envent handlers\r
- mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);\r
- mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);\r
- mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);\r
- mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);\r
- });\r
- });\r
- }\r
-\r
- o.deltaHeight -= 21;\r
- n = tb = null;\r
- },\r
-\r
- _updateUndoStatus : function(ed) {\r
- var cm = ed.controlManager, um = ed.undoManager;\r
-\r
- cm.setDisabled('undo', !um.hasUndo() && !um.typing);\r
- cm.setDisabled('redo', !um.hasRedo());\r
- },\r
-\r
- _nodeChanged : function(ed, cm, n, co, ob) {\r
- var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches;\r
-\r
- tinymce.each(t.stateControls, function(c) {\r
- cm.setActive(c, ed.queryCommandState(t.controls[c][1]));\r
- });\r
-\r
- function getParent(name) {\r
- var i, parents = ob.parents, func = name;\r
-\r
- if (typeof(name) == 'string') {\r
- func = function(node) {\r
- return node.nodeName == name;\r
- };\r
- }\r
-\r
- for (i = 0; i < parents.length; i++) {\r
- if (func(parents[i]))\r
- return parents[i];\r
- }\r
- };\r
-\r
- cm.setActive('visualaid', ed.hasVisual);\r
- t._updateUndoStatus(ed);\r
- cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));\r
-\r
- p = getParent('A');\r
- if (c = cm.get('link')) {\r
- c.setDisabled((!p && co) || (p && !p.href));\r
- c.setActive(!!p && (!p.name && !p.id));\r
- }\r
-\r
- if (c = cm.get('unlink')) {\r
- c.setDisabled(!p && co);\r
- c.setActive(!!p && !p.name && !p.id);\r
- }\r
-\r
- if (c = cm.get('anchor')) {\r
- c.setActive(!co && !!p && (p.name || (p.id && !p.href)));\r
- }\r
-\r
- p = getParent('IMG');\r
- if (c = cm.get('image'))\r
- c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1);\r
-\r
- if (c = cm.get('styleselect')) {\r
- t._importClasses();\r
-\r
- formatNames = [];\r
- each(c.items, function(item) {\r
- formatNames.push(item.value);\r
- });\r
-\r
- matches = ed.formatter.matchAll(formatNames);\r
- c.select(matches[0]);\r
- tinymce.each(matches, function(match, index) {\r
- if (index > 0) {\r
- c.mark(match);\r
- }\r
- });\r
- }\r
-\r
- if (c = cm.get('formatselect')) {\r
- p = getParent(ed.dom.isBlock);\r
-\r
- if (p)\r
- c.select(p.nodeName.toLowerCase());\r
- }\r
-\r
- // Find out current fontSize, fontFamily and fontClass\r
- getParent(function(n) {\r
- if (n.nodeName === 'SPAN') {\r
- if (!cl && n.className)\r
- cl = n.className;\r
- }\r
-\r
- if (ed.dom.is(n, s.theme_advanced_font_selector)) {\r
- if (!fz && n.style.fontSize)\r
- fz = n.style.fontSize;\r
-\r
- if (!fn && n.style.fontFamily)\r
- fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();\r
-\r
- if (!fc && n.style.color)\r
- fc = n.style.color;\r
-\r
- if (!bc && n.style.backgroundColor)\r
- bc = n.style.backgroundColor;\r
- }\r
-\r
- return false;\r
- });\r
-\r
- if (c = cm.get('fontselect')) {\r
- c.select(function(v) {\r
- return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;\r
- });\r
- }\r
-\r
- // Select font size\r
- if (c = cm.get('fontsizeselect')) {\r
- // Use computed style\r
- if (s.theme_advanced_runtime_fontsize && !fz && !cl)\r
- fz = ed.dom.getStyle(n, 'fontSize', true);\r
-\r
- c.select(function(v) {\r
- if (v.fontSize && v.fontSize === fz)\r
- return true;\r
-\r
- if (v['class'] && v['class'] === cl)\r
- return true;\r
- });\r
- }\r
-\r
- if (s.theme_advanced_show_current_color) {\r
- function updateColor(controlId, color) {\r
- if (c = cm.get(controlId)) {\r
- if (!color)\r
- color = c.settings.default_color;\r
- if (color !== c.value) {\r
- c.displayColor(color);\r
- }\r
- }\r
- }\r
- updateColor('forecolor', fc);\r
- updateColor('backcolor', bc);\r
- }\r
-\r
- if (s.theme_advanced_show_current_color) {\r
- function updateColor(controlId, color) {\r
- if (c = cm.get(controlId)) {\r
- if (!color)\r
- color = c.settings.default_color;\r
- if (color !== c.value) {\r
- c.displayColor(color);\r
- }\r
- }\r
- };\r
-\r
- updateColor('forecolor', fc);\r
- updateColor('backcolor', bc);\r
- }\r
-\r
- if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {\r
- p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});\r
-\r
- if (t.statusKeyboardNavigation) {\r
- t.statusKeyboardNavigation.destroy();\r
- t.statusKeyboardNavigation = null;\r
- }\r
-\r
- DOM.setHTML(p, '');\r
-\r
- getParent(function(n) {\r
- var na = n.nodeName.toLowerCase(), u, pi, ti = '';\r
-\r
- // Ignore non element and bogus/hidden elements\r
- if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))\r
- return;\r
-\r
- // Handle prefix\r
- if (tinymce.isIE && n.scopeName !== 'HTML' && n.scopeName)\r
- na = n.scopeName + ':' + na;\r
-\r
- // Remove internal prefix\r
- na = na.replace(/mce\:/g, '');\r
-\r
- // Handle node name\r
- switch (na) {\r
- case 'b':\r
- na = 'strong';\r
- break;\r
-\r
- case 'i':\r
- na = 'em';\r
- break;\r
-\r
- case 'img':\r
- if (v = DOM.getAttrib(n, 'src'))\r
- ti += 'src: ' + v + ' ';\r
-\r
- break;\r
-\r
- case 'a':\r
- if (v = DOM.getAttrib(n, 'name')) {\r
- ti += 'name: ' + v + ' ';\r
- na += '#' + v;\r
- }\r
-\r
- if (v = DOM.getAttrib(n, 'href'))\r
- ti += 'href: ' + v + ' ';\r
-\r
- break;\r
-\r
- case 'font':\r
- if (v = DOM.getAttrib(n, 'face'))\r
- ti += 'font: ' + v + ' ';\r
-\r
- if (v = DOM.getAttrib(n, 'size'))\r
- ti += 'size: ' + v + ' ';\r
-\r
- if (v = DOM.getAttrib(n, 'color'))\r
- ti += 'color: ' + v + ' ';\r
-\r
- break;\r
-\r
- case 'span':\r
- if (v = DOM.getAttrib(n, 'style'))\r
- ti += 'style: ' + v + ' ';\r
-\r
- break;\r
- }\r
-\r
- if (v = DOM.getAttrib(n, 'id'))\r
- ti += 'id: ' + v + ' ';\r
-\r
- if (v = n.className) {\r
- v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '');\r
-\r
- if (v) {\r
- ti += 'class: ' + v + ' ';\r
-\r
- if (ed.dom.isBlock(n) || na == 'img' || na == 'span')\r
- na += '.' + v;\r
- }\r
- }\r
-\r
- na = na.replace(/(html:)/g, '');\r
- na = {name : na, node : n, title : ti};\r
- t.onResolveName.dispatch(t, na);\r
- ti = na.title;\r
- na = na.name;\r
-\r
- //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";\r
- pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);\r
-\r
- if (p.hasChildNodes()) {\r
- p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild);\r
- p.insertBefore(pi, p.firstChild);\r
- } else\r
- p.appendChild(pi);\r
- }, ed.getBody());\r
-\r
- if (DOM.select('a', p).length > 0) {\r
- t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({\r
- root: ed.id + "_path_row",\r
- items: DOM.select('a', p),\r
- excludeFromTabOrder: true,\r
- onCancel: function() {\r
- ed.focus();\r
- }\r
- }, DOM);\r
- }\r
- }\r
- },\r
-\r
- // Commands gets called by execCommand\r
-\r
- _sel : function(v) {\r
- this.editor.execCommand('mceSelectNodeDepth', false, v);\r
- },\r
-\r
- _mceInsertAnchor : function(ui, v) {\r
- var ed = this.editor;\r
-\r
- ed.windowManager.open({\r
- url : this.url + '/anchor.htm',\r
- width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),\r
- height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),\r
- inline : true\r
- }, {\r
- theme_url : this.url\r
- });\r
- },\r
-\r
- _mceCharMap : function() {\r
- var ed = this.editor;\r
-\r
- ed.windowManager.open({\r
- url : this.url + '/charmap.htm',\r
- width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),\r
- height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),\r
- inline : true\r
- }, {\r
- theme_url : this.url\r
- });\r
- },\r
-\r
- _mceHelp : function() {\r
- var ed = this.editor;\r
-\r
- ed.windowManager.open({\r
- url : this.url + '/about.htm',\r
- width : 480,\r
- height : 380,\r
- inline : true\r
- }, {\r
- theme_url : this.url\r
- });\r
- },\r
-\r
- _mceShortcuts : function() {\r
- var ed = this.editor;\r
- ed.windowManager.open({\r
- url: this.url + '/shortcuts.htm',\r
- width: 480,\r
- height: 380,\r
- inline: true\r
- }, {\r
- theme_url: this.url\r
- });\r
- },\r
-\r
- _mceColorPicker : function(u, v) {\r
- var ed = this.editor;\r
-\r
- v = v || {};\r
-\r
- ed.windowManager.open({\r
- url : this.url + '/color_picker.htm',\r
- width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),\r
- height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),\r
- close_previous : false,\r
- inline : true\r
- }, {\r
- input_color : v.color,\r
- func : v.func,\r
- theme_url : this.url\r
- });\r
- },\r
-\r
- _mceCodeEditor : function(ui, val) {\r
- var ed = this.editor;\r
-\r
- ed.windowManager.open({\r
- url : this.url + '/source_editor.htm',\r
- width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),\r
- height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),\r
- inline : true,\r
- resizable : true,\r
- maximizable : true\r
- }, {\r
- theme_url : this.url\r
- });\r
- },\r
-\r
- _mceImage : function(ui, val) {\r
- var ed = this.editor;\r
-\r
- // Internal image object like a flash placeholder\r
- if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)\r
- return;\r
-\r
- ed.windowManager.open({\r
- url : this.url + '/image.htm',\r
- width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),\r
- height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),\r
- inline : true\r
- }, {\r
- theme_url : this.url\r
- });\r
- },\r
-\r
- _mceLink : function(ui, val) {\r
- var ed = this.editor;\r
-\r
- ed.windowManager.open({\r
- url : this.url + '/link.htm',\r
- width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),\r
- height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),\r
- inline : true\r
- }, {\r
- theme_url : this.url\r
- });\r
- },\r
-\r
- _mceNewDocument : function() {\r
- var ed = this.editor;\r
-\r
- ed.windowManager.confirm('advanced.newdocument', function(s) {\r
- if (s)\r
- ed.execCommand('mceSetContent', false, '');\r
- });\r
- },\r
-\r
- _mceForeColor : function() {\r
- var t = this;\r
-\r
- this._mceColorPicker(0, {\r
- color: t.fgColor,\r
- func : function(co) {\r
- t.fgColor = co;\r
- t.editor.execCommand('ForeColor', false, co);\r
- }\r
- });\r
- },\r
-\r
- _mceBackColor : function() {\r
- var t = this;\r
-\r
- this._mceColorPicker(0, {\r
- color: t.bgColor,\r
- func : function(co) {\r
- t.bgColor = co;\r
- t.editor.execCommand('HiliteColor', false, co);\r
- }\r
- });\r
- },\r
-\r
- _ufirst : function(s) {\r
- return s.substring(0, 1).toUpperCase() + s.substring(1);\r
- }\r
- });\r
-\r
- tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);\r
-}(tinymce));\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advanced_dlg.image_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="js/image.js"></script>\r
-</head>\r
-<body id="image" style="display: none">\r
-<form onsubmit="ImageDialog.update();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.image_title}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <table border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td>\r
- <td><table border="0" cellspacing="0" cellpadding="0">\r
- <tr>\r
- <td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td>\r
- <td id="srcbrowsercontainer"> </td>\r
- </tr>\r
- </table></td>\r
- </tr>\r
- <tr>\r
- <td><label for="image_list">{#advanced_dlg.image_list}</label></td>\r
- <td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td>\r
- <td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td>\r
- <td><select id="align" name="align" onchange="ImageDialog.updateStyle();">\r
- <option value="">{#not_set}</option>\r
- <option value="baseline">{#advanced_dlg.image_align_baseline}</option>\r
- <option value="top">{#advanced_dlg.image_align_top}</option>\r
- <option value="middle">{#advanced_dlg.image_align_middle}</option>\r
- <option value="bottom">{#advanced_dlg.image_align_bottom}</option>\r
- <option value="text-top">{#advanced_dlg.image_align_texttop}</option>\r
- <option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option>\r
- <option value="left">{#advanced_dlg.image_align_left}</option>\r
- <option value="right">{#advanced_dlg.image_align_right}</option>\r
- </select></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td>\r
- <td><input id="width" name="width" type="text" value="" size="3" maxlength="5" />\r
- x \r
- <input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td>\r
- <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td>\r
- <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td>\r
- <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>\r
- </tr>\r
- </table>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-function init() {\r
- var ed, tcont;\r
-\r
- tinyMCEPopup.resizeToInnerSize();\r
- ed = tinyMCEPopup.editor;\r
-\r
- // Give FF some time\r
- window.setTimeout(insertHelpIFrame, 10);\r
-\r
- tcont = document.getElementById('plugintablecontainer');\r
- document.getElementById('plugins_tab').style.display = 'none';\r
-\r
- var html = "";\r
- html += '<table id="plugintable">';\r
- html += '<thead>';\r
- html += '<tr>';\r
- html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>';\r
- html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>';\r
- html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>';\r
- html += '</tr>';\r
- html += '</thead>';\r
- html += '<tbody>';\r
-\r
- tinymce.each(ed.plugins, function(p, n) {\r
- var info;\r
-\r
- if (!p.getInfo)\r
- return;\r
-\r
- html += '<tr>';\r
-\r
- info = p.getInfo();\r
-\r
- if (info.infourl != null && info.infourl != '')\r
- html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>';\r
- else\r
- html += '<td width="50%" title="' + n + '">' + info.longname + '</td>';\r
-\r
- if (info.authorurl != null && info.authorurl != '')\r
- html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>';\r
- else\r
- html += '<td width="35%">' + info.author + '</td>';\r
-\r
- html += '<td width="15%">' + info.version + '</td>';\r
- html += '</tr>';\r
-\r
- document.getElementById('plugins_tab').style.display = '';\r
-\r
- });\r
-\r
- html += '</tbody>';\r
- html += '</table>';\r
-\r
- tcont.innerHTML = html;\r
-\r
- tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;\r
- tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate;\r
-}\r
-\r
-function insertHelpIFrame() {\r
- var html;\r
-\r
- if (tinyMCEPopup.getParam('docs_url')) {\r
- html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';\r
- document.getElementById('iframecontainer').innerHTML = html;\r
- document.getElementById('help_tab').style.display = 'block';\r
- document.getElementById('help_tab').setAttribute("aria-hidden", "false");\r
- }\r
-}\r
-\r
-tinyMCEPopup.onInit.add(init);\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var AnchorDialog = {\r
- init : function(ed) {\r
- var action, elm, f = document.forms[0];\r
-\r
- this.editor = ed;\r
- elm = ed.dom.getParent(ed.selection.getNode(), 'A');\r
- v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id');\r
-\r
- if (v) {\r
- this.action = 'update';\r
- f.anchorName.value = v;\r
- }\r
-\r
- f.insert.value = ed.getLang(elm ? 'update' : 'insert');\r
- },\r
-\r
- update : function() {\r
- var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName;\r
-\r
- if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) {\r
- tinyMCEPopup.alert('advanced_dlg.anchor_invalid');\r
- return;\r
- }\r
-\r
- tinyMCEPopup.restoreSelection();\r
-\r
- if (this.action != 'update')\r
- ed.selection.collapse(1);\r
-\r
- var aRule = ed.schema.getElementRule('a');\r
- if (!aRule || aRule.attributes.name) {\r
- attribName = 'name';\r
- } else {\r
- attribName = 'id';\r
- }\r
-\r
- elm = ed.dom.getParent(ed.selection.getNode(), 'A');\r
- if (elm) {\r
- elm.setAttribute(attribName, name);\r
- elm[attribName] = name;\r
- ed.undoManager.add();\r
- } else {\r
- // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it\r
- var attrs = {'class' : 'mceItemAnchor'};\r
- attrs[attribName] = name;\r
- ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF'));\r
- ed.nodeChanged();\r
- }\r
-\r
- tinyMCEPopup.close();\r
- }\r
-};\r
-\r
-tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);\r
+++ /dev/null
-/**\r
- * charmap.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-tinyMCEPopup.requireLangPack();\r
-\r
-var charmap = [\r
- [' ', ' ', true, 'no-break space'],\r
- ['&', '&', true, 'ampersand'],\r
- ['"', '"', true, 'quotation mark'],\r
-// finance\r
- ['¢', '¢', true, 'cent sign'],\r
- ['€', '€', true, 'euro sign'],\r
- ['£', '£', true, 'pound sign'],\r
- ['¥', '¥', true, 'yen sign'],\r
-// signs\r
- ['©', '©', true, 'copyright sign'],\r
- ['®', '®', true, 'registered sign'],\r
- ['™', '™', true, 'trade mark sign'],\r
- ['‰', '‰', true, 'per mille sign'],\r
- ['µ', 'µ', true, 'micro sign'],\r
- ['·', '·', true, 'middle dot'],\r
- ['•', '•', true, 'bullet'],\r
- ['…', '…', true, 'three dot leader'],\r
- ['′', '′', true, 'minutes / feet'],\r
- ['″', '″', true, 'seconds / inches'],\r
- ['§', '§', true, 'section sign'],\r
- ['¶', '¶', true, 'paragraph sign'],\r
- ['ß', 'ß', true, 'sharp s / ess-zed'],\r
-// quotations\r
- ['‹', '‹', true, 'single left-pointing angle quotation mark'],\r
- ['›', '›', true, 'single right-pointing angle quotation mark'],\r
- ['«', '«', true, 'left pointing guillemet'],\r
- ['»', '»', true, 'right pointing guillemet'],\r
- ['‘', '‘', true, 'left single quotation mark'],\r
- ['’', '’', true, 'right single quotation mark'],\r
- ['“', '“', true, 'left double quotation mark'],\r
- ['”', '”', true, 'right double quotation mark'],\r
- ['‚', '‚', true, 'single low-9 quotation mark'],\r
- ['„', '„', true, 'double low-9 quotation mark'],\r
- ['<', '<', true, 'less-than sign'],\r
- ['>', '>', true, 'greater-than sign'],\r
- ['≤', '≤', true, 'less-than or equal to'],\r
- ['≥', '≥', true, 'greater-than or equal to'],\r
- ['–', '–', true, 'en dash'],\r
- ['—', '—', true, 'em dash'],\r
- ['¯', '¯', true, 'macron'],\r
- ['‾', '‾', true, 'overline'],\r
- ['¤', '¤', true, 'currency sign'],\r
- ['¦', '¦', true, 'broken bar'],\r
- ['¨', '¨', true, 'diaeresis'],\r
- ['¡', '¡', true, 'inverted exclamation mark'],\r
- ['¿', '¿', true, 'turned question mark'],\r
- ['ˆ', 'ˆ', true, 'circumflex accent'],\r
- ['˜', '˜', true, 'small tilde'],\r
- ['°', '°', true, 'degree sign'],\r
- ['−', '−', true, 'minus sign'],\r
- ['±', '±', true, 'plus-minus sign'],\r
- ['÷', '÷', true, 'division sign'],\r
- ['⁄', '⁄', true, 'fraction slash'],\r
- ['×', '×', true, 'multiplication sign'],\r
- ['¹', '¹', true, 'superscript one'],\r
- ['²', '²', true, 'superscript two'],\r
- ['³', '³', true, 'superscript three'],\r
- ['¼', '¼', true, 'fraction one quarter'],\r
- ['½', '½', true, 'fraction one half'],\r
- ['¾', '¾', true, 'fraction three quarters'],\r
-// math / logical\r
- ['ƒ', 'ƒ', true, 'function / florin'],\r
- ['∫', '∫', true, 'integral'],\r
- ['∑', '∑', true, 'n-ary sumation'],\r
- ['∞', '∞', true, 'infinity'],\r
- ['√', '√', true, 'square root'],\r
- ['∼', '∼', false,'similar to'],\r
- ['≅', '≅', false,'approximately equal to'],\r
- ['≈', '≈', true, 'almost equal to'],\r
- ['≠', '≠', true, 'not equal to'],\r
- ['≡', '≡', true, 'identical to'],\r
- ['∈', '∈', false,'element of'],\r
- ['∉', '∉', false,'not an element of'],\r
- ['∋', '∋', false,'contains as member'],\r
- ['∏', '∏', true, 'n-ary product'],\r
- ['∧', '∧', false,'logical and'],\r
- ['∨', '∨', false,'logical or'],\r
- ['¬', '¬', true, 'not sign'],\r
- ['∩', '∩', true, 'intersection'],\r
- ['∪', '∪', false,'union'],\r
- ['∂', '∂', true, 'partial differential'],\r
- ['∀', '∀', false,'for all'],\r
- ['∃', '∃', false,'there exists'],\r
- ['∅', '∅', false,'diameter'],\r
- ['∇', '∇', false,'backward difference'],\r
- ['∗', '∗', false,'asterisk operator'],\r
- ['∝', '∝', false,'proportional to'],\r
- ['∠', '∠', false,'angle'],\r
-// undefined\r
- ['´', '´', true, 'acute accent'],\r
- ['¸', '¸', true, 'cedilla'],\r
- ['ª', 'ª', true, 'feminine ordinal indicator'],\r
- ['º', 'º', true, 'masculine ordinal indicator'],\r
- ['†', '†', true, 'dagger'],\r
- ['‡', '‡', true, 'double dagger'],\r
-// alphabetical special chars\r
- ['À', 'À', true, 'A - grave'],\r
- ['Á', 'Á', true, 'A - acute'],\r
- ['Â', 'Â', true, 'A - circumflex'],\r
- ['Ã', 'Ã', true, 'A - tilde'],\r
- ['Ä', 'Ä', true, 'A - diaeresis'],\r
- ['Å', 'Å', true, 'A - ring above'],\r
- ['Æ', 'Æ', true, 'ligature AE'],\r
- ['Ç', 'Ç', true, 'C - cedilla'],\r
- ['È', 'È', true, 'E - grave'],\r
- ['É', 'É', true, 'E - acute'],\r
- ['Ê', 'Ê', true, 'E - circumflex'],\r
- ['Ë', 'Ë', true, 'E - diaeresis'],\r
- ['Ì', 'Ì', true, 'I - grave'],\r
- ['Í', 'Í', true, 'I - acute'],\r
- ['Î', 'Î', true, 'I - circumflex'],\r
- ['Ï', 'Ï', true, 'I - diaeresis'],\r
- ['Ð', 'Ð', true, 'ETH'],\r
- ['Ñ', 'Ñ', true, 'N - tilde'],\r
- ['Ò', 'Ò', true, 'O - grave'],\r
- ['Ó', 'Ó', true, 'O - acute'],\r
- ['Ô', 'Ô', true, 'O - circumflex'],\r
- ['Õ', 'Õ', true, 'O - tilde'],\r
- ['Ö', 'Ö', true, 'O - diaeresis'],\r
- ['Ø', 'Ø', true, 'O - slash'],\r
- ['Œ', 'Œ', true, 'ligature OE'],\r
- ['Š', 'Š', true, 'S - caron'],\r
- ['Ù', 'Ù', true, 'U - grave'],\r
- ['Ú', 'Ú', true, 'U - acute'],\r
- ['Û', 'Û', true, 'U - circumflex'],\r
- ['Ü', 'Ü', true, 'U - diaeresis'],\r
- ['Ý', 'Ý', true, 'Y - acute'],\r
- ['Ÿ', 'Ÿ', true, 'Y - diaeresis'],\r
- ['Þ', 'Þ', true, 'THORN'],\r
- ['à', 'à', true, 'a - grave'],\r
- ['á', 'á', true, 'a - acute'],\r
- ['â', 'â', true, 'a - circumflex'],\r
- ['ã', 'ã', true, 'a - tilde'],\r
- ['ä', 'ä', true, 'a - diaeresis'],\r
- ['å', 'å', true, 'a - ring above'],\r
- ['æ', 'æ', true, 'ligature ae'],\r
- ['ç', 'ç', true, 'c - cedilla'],\r
- ['è', 'è', true, 'e - grave'],\r
- ['é', 'é', true, 'e - acute'],\r
- ['ê', 'ê', true, 'e - circumflex'],\r
- ['ë', 'ë', true, 'e - diaeresis'],\r
- ['ì', 'ì', true, 'i - grave'],\r
- ['í', 'í', true, 'i - acute'],\r
- ['î', 'î', true, 'i - circumflex'],\r
- ['ï', 'ï', true, 'i - diaeresis'],\r
- ['ð', 'ð', true, 'eth'],\r
- ['ñ', 'ñ', true, 'n - tilde'],\r
- ['ò', 'ò', true, 'o - grave'],\r
- ['ó', 'ó', true, 'o - acute'],\r
- ['ô', 'ô', true, 'o - circumflex'],\r
- ['õ', 'õ', true, 'o - tilde'],\r
- ['ö', 'ö', true, 'o - diaeresis'],\r
- ['ø', 'ø', true, 'o slash'],\r
- ['œ', 'œ', true, 'ligature oe'],\r
- ['š', 'š', true, 's - caron'],\r
- ['ù', 'ù', true, 'u - grave'],\r
- ['ú', 'ú', true, 'u - acute'],\r
- ['û', 'û', true, 'u - circumflex'],\r
- ['ü', 'ü', true, 'u - diaeresis'],\r
- ['ý', 'ý', true, 'y - acute'],\r
- ['þ', 'þ', true, 'thorn'],\r
- ['ÿ', 'ÿ', true, 'y - diaeresis'],\r
- ['Α', 'Α', true, 'Alpha'],\r
- ['Β', 'Β', true, 'Beta'],\r
- ['Γ', 'Γ', true, 'Gamma'],\r
- ['Δ', 'Δ', true, 'Delta'],\r
- ['Ε', 'Ε', true, 'Epsilon'],\r
- ['Ζ', 'Ζ', true, 'Zeta'],\r
- ['Η', 'Η', true, 'Eta'],\r
- ['Θ', 'Θ', true, 'Theta'],\r
- ['Ι', 'Ι', true, 'Iota'],\r
- ['Κ', 'Κ', true, 'Kappa'],\r
- ['Λ', 'Λ', true, 'Lambda'],\r
- ['Μ', 'Μ', true, 'Mu'],\r
- ['Ν', 'Ν', true, 'Nu'],\r
- ['Ξ', 'Ξ', true, 'Xi'],\r
- ['Ο', 'Ο', true, 'Omicron'],\r
- ['Π', 'Π', true, 'Pi'],\r
- ['Ρ', 'Ρ', true, 'Rho'],\r
- ['Σ', 'Σ', true, 'Sigma'],\r
- ['Τ', 'Τ', true, 'Tau'],\r
- ['Υ', 'Υ', true, 'Upsilon'],\r
- ['Φ', 'Φ', true, 'Phi'],\r
- ['Χ', 'Χ', true, 'Chi'],\r
- ['Ψ', 'Ψ', true, 'Psi'],\r
- ['Ω', 'Ω', true, 'Omega'],\r
- ['α', 'α', true, 'alpha'],\r
- ['β', 'β', true, 'beta'],\r
- ['γ', 'γ', true, 'gamma'],\r
- ['δ', 'δ', true, 'delta'],\r
- ['ε', 'ε', true, 'epsilon'],\r
- ['ζ', 'ζ', true, 'zeta'],\r
- ['η', 'η', true, 'eta'],\r
- ['θ', 'θ', true, 'theta'],\r
- ['ι', 'ι', true, 'iota'],\r
- ['κ', 'κ', true, 'kappa'],\r
- ['λ', 'λ', true, 'lambda'],\r
- ['μ', 'μ', true, 'mu'],\r
- ['ν', 'ν', true, 'nu'],\r
- ['ξ', 'ξ', true, 'xi'],\r
- ['ο', 'ο', true, 'omicron'],\r
- ['π', 'π', true, 'pi'],\r
- ['ρ', 'ρ', true, 'rho'],\r
- ['ς', 'ς', true, 'final sigma'],\r
- ['σ', 'σ', true, 'sigma'],\r
- ['τ', 'τ', true, 'tau'],\r
- ['υ', 'υ', true, 'upsilon'],\r
- ['φ', 'φ', true, 'phi'],\r
- ['χ', 'χ', true, 'chi'],\r
- ['ψ', 'ψ', true, 'psi'],\r
- ['ω', 'ω', true, 'omega'],\r
-// symbols\r
- ['ℵ', 'ℵ', false,'alef symbol'],\r
- ['ϖ', 'ϖ', false,'pi symbol'],\r
- ['ℜ', 'ℜ', false,'real part symbol'],\r
- ['ϑ','ϑ', false,'theta symbol'],\r
- ['ϒ', 'ϒ', false,'upsilon - hook symbol'],\r
- ['℘', '℘', false,'Weierstrass p'],\r
- ['ℑ', 'ℑ', false,'imaginary part'],\r
-// arrows\r
- ['←', '←', true, 'leftwards arrow'],\r
- ['↑', '↑', true, 'upwards arrow'],\r
- ['→', '→', true, 'rightwards arrow'],\r
- ['↓', '↓', true, 'downwards arrow'],\r
- ['↔', '↔', true, 'left right arrow'],\r
- ['↵', '↵', false,'carriage return'],\r
- ['⇐', '⇐', false,'leftwards double arrow'],\r
- ['⇑', '⇑', false,'upwards double arrow'],\r
- ['⇒', '⇒', false,'rightwards double arrow'],\r
- ['⇓', '⇓', false,'downwards double arrow'],\r
- ['⇔', '⇔', false,'left right double arrow'],\r
- ['∴', '∴', false,'therefore'],\r
- ['⊂', '⊂', false,'subset of'],\r
- ['⊃', '⊃', false,'superset of'],\r
- ['⊄', '⊄', false,'not a subset of'],\r
- ['⊆', '⊆', false,'subset of or equal to'],\r
- ['⊇', '⊇', false,'superset of or equal to'],\r
- ['⊕', '⊕', false,'circled plus'],\r
- ['⊗', '⊗', false,'circled times'],\r
- ['⊥', '⊥', false,'perpendicular'],\r
- ['⋅', '⋅', false,'dot operator'],\r
- ['⌈', '⌈', false,'left ceiling'],\r
- ['⌉', '⌉', false,'right ceiling'],\r
- ['⌊', '⌊', false,'left floor'],\r
- ['⌋', '⌋', false,'right floor'],\r
- ['⟨', '〈', false,'left-pointing angle bracket'],\r
- ['⟩', '〉', false,'right-pointing angle bracket'],\r
- ['◊', '◊', true, 'lozenge'],\r
- ['♠', '♠', true, 'black spade suit'],\r
- ['♣', '♣', true, 'black club suit'],\r
- ['♥', '♥', true, 'black heart suit'],\r
- ['♦', '♦', true, 'black diamond suit'],\r
- [' ', ' ', false,'en space'],\r
- [' ', ' ', false,'em space'],\r
- [' ', ' ', false,'thin space'],\r
- ['‌', '‌', false,'zero width non-joiner'],\r
- ['‍', '‍', false,'zero width joiner'],\r
- ['‎', '‎', false,'left-to-right mark'],\r
- ['‏', '‏', false,'right-to-left mark'],\r
- ['­', '­', false,'soft hyphen']\r
-];\r
-\r
-tinyMCEPopup.onInit.add(function() {\r
- tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());\r
- addKeyboardNavigation();\r
-});\r
-\r
-function addKeyboardNavigation(){\r
- var tableElm, cells, settings;\r
-\r
- cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup");\r
-\r
- settings ={\r
- root: "charmapgroup",\r
- items: cells\r
- };\r
- cells[0].tabindex=0;\r
- tinyMCEPopup.dom.addClass(cells[0], "mceFocus");\r
- if (tinymce.isGecko) {\r
- cells[0].focus(); \r
- } else {\r
- setTimeout(function(){\r
- cells[0].focus();\r
- }, 100);\r
- }\r
- tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);\r
-}\r
-\r
-function renderCharMapHTML() {\r
- var charsPerRow = 20, tdWidth=20, tdHeight=20, i;\r
- var html = '<div id="charmapgroup" aria-labelledby="charmap_label" tabindex="0" role="listbox">'+\r
- '<table role="presentation" border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + \r
- '"><tr height="' + tdHeight + '">';\r
- var cols=-1;\r
-\r
- for (i=0; i<charmap.length; i++) {\r
- var previewCharFn;\r
-\r
- if (charmap[i][2]==true) {\r
- cols++;\r
- previewCharFn = 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');';\r
- html += ''\r
- + '<td class="charmap">'\r
- + '<a class="charmaplink" role="button" onmouseover="'+previewCharFn+'" onfocus="'+previewCharFn+'" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + ' '+ tinyMCEPopup.editor.translate("advanced_dlg.charmap_usage")+'">'\r
- + charmap[i][1]\r
- + '</a></td>';\r
- if ((cols+1) % charsPerRow == 0)\r
- html += '</tr><tr height="' + tdHeight + '">';\r
- }\r
- }\r
-\r
- if (cols % charsPerRow > 0) {\r
- var padd = charsPerRow - (cols % charsPerRow);\r
- for (var i=0; i<padd-1; i++)\r
- html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"> </td>';\r
- }\r
-\r
- html += '</tr></table></div>';\r
- html = html.replace(/<tr height="20"><\/tr>/g, '');\r
-\r
- return html;\r
-}\r
-\r
-function insertChar(chr) {\r
- tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');\r
-\r
- // Refocus in window\r
- if (tinyMCEPopup.isWindow)\r
- window.focus();\r
-\r
- tinyMCEPopup.editor.focus();\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function previewChar(codeA, codeB, codeN) {\r
- var elmA = document.getElementById('codeA');\r
- var elmB = document.getElementById('codeB');\r
- var elmV = document.getElementById('codeV');\r
- var elmN = document.getElementById('codeN');\r
-\r
- if (codeA=='#160;') {\r
- elmV.innerHTML = '__';\r
- } else {\r
- elmV.innerHTML = '&' + codeA;\r
- }\r
-\r
- elmB.innerHTML = '&' + codeA;\r
- elmA.innerHTML = '&' + codeB;\r
- elmN.innerHTML = codeN;\r
-}\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();
-
-var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
-
-var colors = [
- "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
- "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
- "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
- "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
- "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
- "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
- "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
- "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
- "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
- "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
- "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
- "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
- "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
- "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
- "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
- "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
- "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
- "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
- "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
- "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
- "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
- "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
- "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
- "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
- "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
- "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
- "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
-];
-
-var named = {
- '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
- '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
- '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
- '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
- '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
- '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
- '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
- '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
- '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
- '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
- '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
- '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
- '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
- '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
- '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
- '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
- '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
- '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
- '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
- '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
- '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
- '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
- '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
-};
-
-var namedLookup = {};
-
-function init() {
- var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
-
- tinyMCEPopup.resizeToInnerSize();
-
- generatePicker();
- generateWebColors();
- generateNamedColors();
-
- if (inputColor) {
- changeFinalColor(inputColor);
-
- col = convertHexToRGB(inputColor);
-
- if (col)
- updateLight(col.r, col.g, col.b);
- }
-
- for (key in named) {
- value = named[key];
- namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
- }
-}
-
-function toHexColor(color) {
- var matches, red, green, blue, toInt = parseInt;
-
- function hex(value) {
- value = parseInt(value).toString(16);
-
- return value.length > 1 ? value : '0' + value; // Padd with leading zero
- };
-
- color = tinymce.trim(color);
- color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
- color = namedLookup[color] || color;
-
- matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
-
- if (matches) {
- red = toInt(matches[1]);
- green = toInt(matches[2]);
- blue = toInt(matches[3]);
- } else {
- matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
-
- if (matches) {
- red = toInt(matches[1], 16);
- green = toInt(matches[2], 16);
- blue = toInt(matches[3], 16);
- } else {
- matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
-
- if (matches) {
- red = toInt(matches[1] + matches[1], 16);
- green = toInt(matches[2] + matches[2], 16);
- blue = toInt(matches[3] + matches[3], 16);
- } else {
- return '';
- }
- }
- }
-
- return '#' + hex(red) + hex(green) + hex(blue);
-}
-
-function insertAction() {
- var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
-
- var hexColor = toHexColor(color);
-
- if (hexColor === '') {
- var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
- tinyMCEPopup.alert(text + ': ' + color);
- }
- else {
- tinyMCEPopup.restoreSelection();
-
- if (f)
- f(hexColor);
-
- tinyMCEPopup.close();
- }
-}
-
-function showColor(color, name) {
- if (name)
- document.getElementById("colorname").innerHTML = name;
-
- document.getElementById("preview").style.backgroundColor = color;
- document.getElementById("color").value = color.toUpperCase();
-}
-
-function convertRGBToHex(col) {
- var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
-
- if (!col)
- return col;
-
- var rgb = col.replace(re, "$1,$2,$3").split(',');
- if (rgb.length == 3) {
- r = parseInt(rgb[0]).toString(16);
- g = parseInt(rgb[1]).toString(16);
- b = parseInt(rgb[2]).toString(16);
-
- r = r.length == 1 ? '0' + r : r;
- g = g.length == 1 ? '0' + g : g;
- b = b.length == 1 ? '0' + b : b;
-
- return "#" + r + g + b;
- }
-
- return col;
-}
-
-function convertHexToRGB(col) {
- if (col.indexOf('#') != -1) {
- col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
-
- r = parseInt(col.substring(0, 2), 16);
- g = parseInt(col.substring(2, 4), 16);
- b = parseInt(col.substring(4, 6), 16);
-
- return {r : r, g : g, b : b};
- }
-
- return null;
-}
-
-function generatePicker() {
- var el = document.getElementById('light'), h = '', i;
-
- for (i = 0; i < detail; i++){
- h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
- + ' onclick="changeFinalColor(this.style.backgroundColor)"'
- + ' onmousedown="isMouseDown = true; return false;"'
- + ' onmouseup="isMouseDown = false;"'
- + ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
- + ' onmouseover="isMouseOver = true;"'
- + ' onmouseout="isMouseOver = false;"'
- + '></div>';
- }
-
- el.innerHTML = h;
-}
-
-function generateWebColors() {
- var el = document.getElementById('webcolors'), h = '', i;
-
- if (el.className == 'generated')
- return;
-
- // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
- h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
- + '<tr>';
-
- for (i=0; i<colors.length; i++) {
- h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
- + '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
- if (tinyMCEPopup.editor.forcedHighContrastMode) {
- h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
- }
- h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
- h += '</a></td>';
- if ((i+1) % 18 == 0)
- h += '</tr><tr>';
- }
-
- h += '</table></div>';
-
- el.innerHTML = h;
- el.className = 'generated';
-
- paintCanvas(el);
- enableKeyboardNavigation(el.firstChild);
-}
-
-function paintCanvas(el) {
- tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
- var context;
- if (canvas.getContext && (context = canvas.getContext("2d"))) {
- context.fillStyle = canvas.getAttribute('data-color');
- context.fillRect(0, 0, 10, 10);
- }
- });
-}
-function generateNamedColors() {
- var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
-
- if (el.className == 'generated')
- return;
-
- for (n in named) {
- v = named[n];
- h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
- if (tinyMCEPopup.editor.forcedHighContrastMode) {
- h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
- }
- h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
- h += '</a>';
- i++;
- }
-
- el.innerHTML = h;
- el.className = 'generated';
-
- paintCanvas(el);
- enableKeyboardNavigation(el);
-}
-
-function enableKeyboardNavigation(el) {
- tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
- root: el,
- items: tinyMCEPopup.dom.select('a', el)
- }, tinyMCEPopup.dom);
-}
-
-function dechex(n) {
- return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
-}
-
-function computeColor(e) {
- var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
-
- x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
- y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
-
- partWidth = document.getElementById('colors').width / 6;
- partDetail = detail / 2;
- imHeight = document.getElementById('colors').height;
-
- r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
- g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
- b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
-
- coef = (imHeight - y) / imHeight;
- r = 128 + (r - 128) * coef;
- g = 128 + (g - 128) * coef;
- b = 128 + (b - 128) * coef;
-
- changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
- updateLight(r, g, b);
-}
-
-function updateLight(r, g, b) {
- var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
-
- for (i=0; i<detail; i++) {
- if ((i>=0) && (i<partDetail)) {
- finalCoef = i / partDetail;
- finalR = dechex(255 - (255 - r) * finalCoef);
- finalG = dechex(255 - (255 - g) * finalCoef);
- finalB = dechex(255 - (255 - b) * finalCoef);
- } else {
- finalCoef = 2 - i / partDetail;
- finalR = dechex(r * finalCoef);
- finalG = dechex(g * finalCoef);
- finalB = dechex(b * finalCoef);
- }
-
- color = finalR + finalG + finalB;
-
- setCol('gs' + i, '#'+color);
- }
-}
-
-function changeFinalColor(color) {
- if (color.indexOf('#') == -1)
- color = convertRGBToHex(color);
-
- setCol('preview', color);
- document.getElementById('color').value = color;
-}
-
-function setCol(e, c) {
- try {
- document.getElementById(e).style.backgroundColor = c;
- } catch (ex) {
- // Ignore IE warning
- }
-}
-
-tinyMCEPopup.onInit.add(init);
+++ /dev/null
-var ImageDialog = {\r
- preInit : function() {\r
- var url;\r
-\r
- tinyMCEPopup.requireLangPack();\r
-\r
- if (url = tinyMCEPopup.getParam("external_image_list_url"))\r
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
- },\r
-\r
- init : function() {\r
- var f = document.forms[0], ed = tinyMCEPopup.editor;\r
-\r
- // Setup browse button\r
- document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');\r
- if (isVisible('srcbrowser'))\r
- document.getElementById('src').style.width = '180px';\r
-\r
- e = ed.selection.getNode();\r
-\r
- this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'));\r
-\r
- if (e.nodeName == 'IMG') {\r
- f.src.value = ed.dom.getAttrib(e, 'src');\r
- f.alt.value = ed.dom.getAttrib(e, 'alt');\r
- f.border.value = this.getAttrib(e, 'border');\r
- f.vspace.value = this.getAttrib(e, 'vspace');\r
- f.hspace.value = this.getAttrib(e, 'hspace');\r
- f.width.value = ed.dom.getAttrib(e, 'width');\r
- f.height.value = ed.dom.getAttrib(e, 'height');\r
- f.insert.value = ed.getLang('update');\r
- this.styleVal = ed.dom.getAttrib(e, 'style');\r
- selectByValue(f, 'image_list', f.src.value);\r
- selectByValue(f, 'align', this.getAttrib(e, 'align'));\r
- this.updateStyle();\r
- }\r
- },\r
-\r
- fillFileList : function(id, l) {\r
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
-\r
- l = typeof(l) === 'function' ? l() : window[l];\r
-\r
- if (l && l.length > 0) {\r
- lst.options[lst.options.length] = new Option('', '');\r
-\r
- tinymce.each(l, function(o) {\r
- lst.options[lst.options.length] = new Option(o[0], o[1]);\r
- });\r
- } else\r
- dom.remove(dom.getParent(id, 'tr'));\r
- },\r
-\r
- update : function() {\r
- var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;\r
-\r
- tinyMCEPopup.restoreSelection();\r
-\r
- if (f.src.value === '') {\r
- if (ed.selection.getNode().nodeName == 'IMG') {\r
- ed.dom.remove(ed.selection.getNode());\r
- ed.execCommand('mceRepaint');\r
- }\r
-\r
- tinyMCEPopup.close();\r
- return;\r
- }\r
-\r
- if (!ed.settings.inline_styles) {\r
- args = tinymce.extend(args, {\r
- vspace : nl.vspace.value,\r
- hspace : nl.hspace.value,\r
- border : nl.border.value,\r
- align : getSelectValue(f, 'align')\r
- });\r
- } else\r
- args.style = this.styleVal;\r
-\r
- tinymce.extend(args, {\r
- src : f.src.value.replace(/ /g, '%20'),\r
- alt : f.alt.value,\r
- width : f.width.value,\r
- height : f.height.value\r
- });\r
-\r
- el = ed.selection.getNode();\r
-\r
- if (el && el.nodeName == 'IMG') {\r
- ed.dom.setAttribs(el, args);\r
- tinyMCEPopup.editor.execCommand('mceRepaint');\r
- tinyMCEPopup.editor.focus();\r
- } else {\r
- tinymce.each(args, function(value, name) {\r
- if (value === "") {\r
- delete args[name];\r
- }\r
- });\r
-\r
- ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});\r
- ed.undoManager.add();\r
- }\r
-\r
- tinyMCEPopup.close();\r
- },\r
-\r
- updateStyle : function() {\r
- var dom = tinyMCEPopup.dom, st = {}, v, f = document.forms[0];\r
-\r
- if (tinyMCEPopup.editor.settings.inline_styles) {\r
- tinymce.each(tinyMCEPopup.dom.parseStyle(this.styleVal), function(value, key) {\r
- st[key] = value;\r
- });\r
-\r
- // Handle align\r
- v = getSelectValue(f, 'align');\r
- if (v) {\r
- if (v == 'left' || v == 'right') {\r
- st['float'] = v;\r
- delete st['vertical-align'];\r
- } else {\r
- st['vertical-align'] = v;\r
- delete st['float'];\r
- }\r
- } else {\r
- delete st['float'];\r
- delete st['vertical-align'];\r
- }\r
-\r
- // Handle border\r
- v = f.border.value;\r
- if (v || v == '0') {\r
- if (v == '0')\r
- st['border'] = '0';\r
- else\r
- st['border'] = v + 'px solid black';\r
- } else\r
- delete st['border'];\r
-\r
- // Handle hspace\r
- v = f.hspace.value;\r
- if (v) {\r
- delete st['margin'];\r
- st['margin-left'] = v + 'px';\r
- st['margin-right'] = v + 'px';\r
- } else {\r
- delete st['margin-left'];\r
- delete st['margin-right'];\r
- }\r
-\r
- // Handle vspace\r
- v = f.vspace.value;\r
- if (v) {\r
- delete st['margin'];\r
- st['margin-top'] = v + 'px';\r
- st['margin-bottom'] = v + 'px';\r
- } else {\r
- delete st['margin-top'];\r
- delete st['margin-bottom'];\r
- }\r
-\r
- // Merge\r
- st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img');\r
- this.styleVal = dom.serializeStyle(st, 'img');\r
- }\r
- },\r
-\r
- getAttrib : function(e, at) {\r
- var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;\r
-\r
- if (ed.settings.inline_styles) {\r
- switch (at) {\r
- case 'align':\r
- if (v = dom.getStyle(e, 'float'))\r
- return v;\r
-\r
- if (v = dom.getStyle(e, 'vertical-align'))\r
- return v;\r
-\r
- break;\r
-\r
- case 'hspace':\r
- v = dom.getStyle(e, 'margin-left')\r
- v2 = dom.getStyle(e, 'margin-right');\r
- if (v && v == v2)\r
- return parseInt(v.replace(/[^0-9]/g, ''));\r
-\r
- break;\r
-\r
- case 'vspace':\r
- v = dom.getStyle(e, 'margin-top')\r
- v2 = dom.getStyle(e, 'margin-bottom');\r
- if (v && v == v2)\r
- return parseInt(v.replace(/[^0-9]/g, ''));\r
-\r
- break;\r
-\r
- case 'border':\r
- v = 0;\r
-\r
- tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {\r
- sv = dom.getStyle(e, 'border-' + sv + '-width');\r
-\r
- // False or not the same as prev\r
- if (!sv || (sv != v && v !== 0)) {\r
- v = 0;\r
- return false;\r
- }\r
-\r
- if (sv)\r
- v = sv;\r
- });\r
-\r
- if (v)\r
- return parseInt(v.replace(/[^0-9]/g, ''));\r
-\r
- break;\r
- }\r
- }\r
-\r
- if (v = dom.getAttrib(e, at))\r
- return v;\r
-\r
- return '';\r
- },\r
-\r
- resetImageData : function() {\r
- var f = document.forms[0];\r
-\r
- f.width.value = f.height.value = ""; \r
- },\r
-\r
- updateImageData : function() {\r
- var f = document.forms[0], t = ImageDialog;\r
-\r
- if (f.width.value == "")\r
- f.width.value = t.preloadImg.width;\r
-\r
- if (f.height.value == "")\r
- f.height.value = t.preloadImg.height;\r
- },\r
-\r
- getImageData : function() {\r
- var f = document.forms[0];\r
-\r
- this.preloadImg = new Image();\r
- this.preloadImg.onload = this.updateImageData;\r
- this.preloadImg.onerror = this.resetImageData;\r
- this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value);\r
- }\r
-};\r
-\r
-ImageDialog.preInit();\r
-tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-\r
-var LinkDialog = {\r
- preInit : function() {\r
- var url;\r
-\r
- if (url = tinyMCEPopup.getParam("external_link_list_url"))\r
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
- },\r
-\r
- init : function() {\r
- var f = document.forms[0], ed = tinyMCEPopup.editor;\r
-\r
- // Setup browse button\r
- document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link');\r
- if (isVisible('hrefbrowser'))\r
- document.getElementById('href').style.width = '180px';\r
-\r
- this.fillClassList('class_list');\r
- this.fillFileList('link_list', 'tinyMCELinkList');\r
- this.fillTargetList('target_list');\r
-\r
- if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) {\r
- f.href.value = ed.dom.getAttrib(e, 'href');\r
- f.linktitle.value = ed.dom.getAttrib(e, 'title');\r
- f.insert.value = ed.getLang('update');\r
- selectByValue(f, 'link_list', f.href.value);\r
- selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target'));\r
- selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class'));\r
- }\r
- },\r
-\r
- update : function() {\r
- var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20');\r
-\r
- tinyMCEPopup.restoreSelection();\r
- e = ed.dom.getParent(ed.selection.getNode(), 'A');\r
-\r
- // Remove element if there is no href\r
- if (!f.href.value) {\r
- if (e) {\r
- b = ed.selection.getBookmark();\r
- ed.dom.remove(e, 1);\r
- ed.selection.moveToBookmark(b);\r
- tinyMCEPopup.execCommand("mceEndUndoLevel");\r
- tinyMCEPopup.close();\r
- return;\r
- }\r
- }\r
-\r
- // Create new anchor elements\r
- if (e == null) {\r
- ed.getDoc().execCommand("unlink", false, null);\r
- tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});\r
-\r
- tinymce.each(ed.dom.select("a"), function(n) {\r
- if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {\r
- e = n;\r
-\r
- ed.dom.setAttribs(e, {\r
- href : href,\r
- title : f.linktitle.value,\r
- target : f.target_list ? getSelectValue(f, "target_list") : null,\r
- 'class' : f.class_list ? getSelectValue(f, "class_list") : null\r
- });\r
- }\r
- });\r
- } else {\r
- ed.dom.setAttribs(e, {\r
- href : href,\r
- title : f.linktitle.value\r
- });\r
- \r
- if (f.target_list) {\r
- ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list"));\r
- }\r
-\r
- if (f.class_list) {\r
- ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list"));\r
- }\r
- }\r
-\r
- // Don't move caret if selection was image\r
- if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') {\r
- ed.focus();\r
- ed.selection.select(e);\r
- ed.selection.collapse(0);\r
- tinyMCEPopup.storeSelection();\r
- }\r
-\r
- tinyMCEPopup.execCommand("mceEndUndoLevel");\r
- tinyMCEPopup.close();\r
- },\r
-\r
- checkPrefix : function(n) {\r
- if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email')))\r
- n.value = 'mailto:' + n.value;\r
-\r
- if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))\r
- n.value = 'http://' + n.value;\r
- },\r
-\r
- fillFileList : function(id, l) {\r
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
-\r
- l = window[l];\r
-\r
- if (l && l.length > 0) {\r
- lst.options[lst.options.length] = new Option('', '');\r
-\r
- tinymce.each(l, function(o) {\r
- lst.options[lst.options.length] = new Option(o[0], o[1]);\r
- });\r
- } else\r
- dom.remove(dom.getParent(id, 'tr'));\r
- },\r
-\r
- fillClassList : function(id) {\r
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
-\r
- if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {\r
- cl = [];\r
-\r
- tinymce.each(v.split(';'), function(v) {\r
- var p = v.split('=');\r
-\r
- cl.push({'title' : p[0], 'class' : p[1]});\r
- });\r
- } else\r
- cl = tinyMCEPopup.editor.dom.getClasses();\r
-\r
- if (cl.length > 0) {\r
- lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
-\r
- tinymce.each(cl, function(o) {\r
- lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);\r
- });\r
- } else\r
- dom.remove(dom.getParent(id, 'tr'));\r
- },\r
-\r
- fillTargetList : function(id) {\r
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v;\r
-\r
- lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
- lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');\r
- lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank');\r
-\r
- if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) {\r
- tinymce.each(v.split(','), function(v) {\r
- v = v.split('=');\r
- lst.options[lst.options.length] = new Option(v[0], v[1]);\r
- });\r
- }\r
- }\r
-};\r
-\r
-LinkDialog.preInit();\r
-tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog);\r
+++ /dev/null
-tinyMCEPopup.requireLangPack();\r
-tinyMCEPopup.onInit.add(onLoadInit);\r
-\r
-function saveContent() {\r
- tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});\r
- tinyMCEPopup.close();\r
-}\r
-\r
-function onLoadInit() {\r
- tinyMCEPopup.resizeToInnerSize();\r
-\r
- // Remove Gecko spellchecking\r
- if (tinymce.isGecko)\r
- document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");\r
-\r
- document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});\r
-\r
- if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {\r
- turnWrapOn();\r
- document.getElementById('wraped').checked = true;\r
- }\r
-\r
- resizeInputs();\r
-}\r
-\r
-function setWrap(val) {\r
- var v, n, s = document.getElementById('htmlSource');\r
-\r
- s.wrap = val;\r
-\r
- if (!tinymce.isIE) {\r
- v = s.value;\r
- n = s.cloneNode(false);\r
- n.setAttribute("wrap", val);\r
- s.parentNode.replaceChild(n, s);\r
- n.value = v;\r
- }\r
-}\r
-\r
-function setWhiteSpaceCss(value) {\r
- var el = document.getElementById('htmlSource');\r
- tinymce.DOM.setStyle(el, 'white-space', value);\r
-}\r
-\r
-function turnWrapOff() {\r
- if (tinymce.isWebKit) {\r
- setWhiteSpaceCss('pre');\r
- } else {\r
- setWrap('off');\r
- }\r
-}\r
-\r
-function turnWrapOn() {\r
- if (tinymce.isWebKit) {\r
- setWhiteSpaceCss('pre-wrap');\r
- } else {\r
- setWrap('soft');\r
- }\r
-}\r
-\r
-function toggleWordWrap(elm) {\r
- if (elm.checked) {\r
- turnWrapOn();\r
- } else {\r
- turnWrapOff();\r
- }\r
-}\r
-\r
-function resizeInputs() {\r
- var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
-\r
- el = document.getElementById('htmlSource');\r
-\r
- if (el) {\r
- el.style.width = (vp.w - 20) + 'px';\r
- el.style.height = (vp.h - 65) + 'px';\r
- }\r
-}\r
+++ /dev/null
-tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"});
\ No newline at end of file
+++ /dev/null
-tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""});
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advanced_dlg.link_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
- <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
- <script type="text/javascript" src="../../utils/validate.js"></script>\r
- <script type="text/javascript" src="js/link.js"></script>\r
-</head>\r
-<body id="link" style="display: none">\r
-<form onsubmit="LinkDialog.update();return false;" action="#">\r
- <div class="tabs">\r
- <ul>\r
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.link_title}</a></span></li>\r
- </ul>\r
- </div>\r
-\r
- <div class="panel_wrapper">\r
- <div id="general_panel" class="panel current">\r
- <table border="0" cellpadding="4" cellspacing="0">\r
- <tr>\r
- <td class="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td>\r
- <td><table border="0" cellspacing="0" cellpadding="0"> \r
- <tr> \r
- <td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td> \r
- <td id="hrefbrowsercontainer"> </td>\r
- </tr> \r
- </table></td>\r
- </tr>\r
- <tr>\r
- <td><label for="link_list">{#advanced_dlg.link_list}</label></td>\r
- <td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td>\r
- </tr>\r
- <tr>\r
- <td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>\r
- <td><select id="target_list" name="target_list"></select></td>\r
- </tr>\r
- <tr>\r
- <td class="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td>\r
- <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td>\r
- </tr>\r
- <tr>\r
- <td><label for="class_list">{#class_name}</label></td>\r
- <td><select id="class_list" name="class_list"></select></td>\r
- </tr>\r
- </table>\r
- </div>\r
- </div>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" id="insert" name="insert" value="{#insert}" />\r
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
- </div>\r
-</form>\r
-</body>\r
-</html>\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
- <head>\r
- <title>{#advanced_dlg.accessibility_help}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript">tinyMCEPopup.requireLangPack();</script>\r
- </head>\r
- <body id="content">\r
- <h1>{#advanced_dlg.accessibility_usage_title}</h1>\r
- <h2>Toolbars</h2>\r
- <p>Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys.\r
- Press enter to activate a button and return focus to the editor.\r
- Press escape to return focus to the editor without performing any actions.</p>\r
- \r
- <h2>Status Bar</h2>\r
- <p>To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path.\r
- Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.</p>\r
- \r
- <h2>Context Menu</h2>\r
- <p>Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key.\r
- To close submenus press the left arrow key. Press escape to close the context menu.</p>\r
- \r
- <h1>Keyboard Shortcuts</h1>\r
- <table>\r
- <thead>\r
- <tr>\r
- <th>Keystroke</th>\r
- <th>Function</th>\r
- </tr>\r
- </thead>\r
- <tbody>\r
- <tr>\r
- <td>Control-B</td><td>Bold</td>\r
- </tr>\r
- <tr>\r
- <td>Control-I</td><td>Italic</td>\r
- </tr>\r
- <tr>\r
- <td>Control-Z</td><td>Undo</td>\r
- </tr>\r
- <tr>\r
- <td>Control-Y</td><td>Redo</td>\r
- </tr>\r
- </tbody>\r
- </table>\r
- </body>\r
-</html>\r
+++ /dev/null
-body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}\r
-body {background:#FFF;}\r
-body.mceForceColors {background:#FFF; color:#000;}\r
-body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;}\r
-h1 {font-size: 2em}\r
-h2 {font-size: 1.5em}\r
-h3 {font-size: 1.17em}\r
-h4 {font-size: 1em}\r
-h5 {font-size: .83em}\r
-h6 {font-size: .75em}\r
-.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}\r
-a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center}\r
-span.mceItemNbsp {background: #DDD}\r
-td.mceSelected, th.mceSelected {background-color:#3399ff !important}\r
-img {border:0;}\r
-table, img, hr, .mceItemAnchor {cursor:default}\r
-table td, table th {cursor:text}\r
-ins {border-bottom:1px solid green; text-decoration: none; color:green}\r
-del {color:red; text-decoration:line-through}\r
-cite {border-bottom:1px dashed blue}\r
-acronym {border-bottom:1px dotted #CCC; cursor:help}\r
-abbr {border-bottom:1px dashed #CCC; cursor:help}\r
-\r
-/* IE */\r
-* html body {\r
-scrollbar-3dlight-color:#F0F0EE;\r
-scrollbar-arrow-color:#676662;\r
-scrollbar-base-color:#F0F0EE;\r
-scrollbar-darkshadow-color:#DDD;\r
-scrollbar-face-color:#E0E0DD;\r
-scrollbar-highlight-color:#F0F0EE;\r
-scrollbar-shadow-color:#F0F0EE;\r
-scrollbar-track-color:#F5F5F5;\r
-}\r
-\r
-img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}\r
-font[face=mceinline] {font-family:inherit !important}\r
-*[contentEditable]:focus {outline:0}\r
-\r
-.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc}\r
-.mceItemShockWave {background-image:url(../../img/shockwave.gif)}\r
-.mceItemFlash {background-image:url(../../img/flash.gif)}\r
-.mceItemQuickTime {background-image:url(../../img/quicktime.gif)}\r
-.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)}\r
-.mceItemRealMedia {background-image:url(../../img/realmedia.gif)}\r
-.mceItemVideo {background-image:url(../../img/video.gif)}\r
-.mceItemAudio {background-image:url(../../img/video.gif)}\r
-.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)}\r
-.mceItemIframe {background-image:url(../../img/iframe.gif)}\r
-.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}\r
+++ /dev/null
-/* Generic */\r
-body {\r
-font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
-scrollbar-3dlight-color:#F0F0EE;\r
-scrollbar-arrow-color:#676662;\r
-scrollbar-base-color:#F0F0EE;\r
-scrollbar-darkshadow-color:#DDDDDD;\r
-scrollbar-face-color:#E0E0DD;\r
-scrollbar-highlight-color:#F0F0EE;\r
-scrollbar-shadow-color:#F0F0EE;\r
-scrollbar-track-color:#F5F5F5;\r
-background:#F0F0EE;\r
-padding:0;\r
-margin:8px 8px 0 8px;\r
-}\r
-\r
-html {background:#F0F0EE;}\r
-td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
-textarea {resize:none;outline:none;}\r
-a:link, a:visited {color:black;}\r
-a:hover {color:#2B6FB6;}\r
-.nowrap {white-space: nowrap}\r
-\r
-/* Forms */\r
-fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}\r
-legend {color:#2B6FB6; font-weight:bold;}\r
-label.msg {display:none;}\r
-label.invalid {color:#EE0000; display:inline;}\r
-input.invalid {border:1px solid #EE0000;}\r
-input {background:#FFF; border:1px solid #CCC;}\r
-input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
-input, select, textarea {border:1px solid #808080;}\r
-input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}\r
-input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}\r
-.input_noborder {border:0;}\r
-\r
-/* Buttons */\r
-#insert, #cancel, input.button, .updateButton {\r
-border:0; margin:0; padding:0;\r
-font-weight:bold;\r
-width:94px; height:26px;\r
-background:url(img/buttons.png) 0 -26px;\r
-cursor:pointer;\r
-padding-bottom:2px;\r
-float:left;\r
-}\r
-\r
-#insert {background:url(img/buttons.png) 0 -52px}\r
-#cancel {background:url(img/buttons.png) 0 0; float:right}\r
-\r
-/* Browse */\r
-a.pickcolor, a.browse {text-decoration:none}\r
-a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}\r
-.mceOldBoxModel a.browse span {width:22px; height:20px;}\r
-a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}\r
-a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}\r
-a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}\r
-.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}\r
-a.pickcolor:hover span {background-color:#B2BBD0;}\r
-a.pickcolor:hover span.disabled {}\r
-\r
-/* Charmap */\r
-table.charmap {border:1px solid #AAA; text-align:center}\r
-td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}\r
-#charmap a {display:block; color:#000; text-decoration:none; border:0}\r
-#charmap a:hover {background:#CCC;color:#2B6FB6}\r
-#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}\r
-#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}\r
-\r
-/* Source */\r
-.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}\r
-.mceActionPanel {margin-top:5px;}\r
-\r
-/* Tabs classes */\r
-.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}\r
-.tabs ul {margin:0; padding:0; list-style:none;}\r
-.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}\r
-.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}\r
-.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}\r
-.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}\r
-.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}\r
-.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}\r
-\r
-/* Panels */\r
-.panel_wrapper div.panel {display:none;}\r
-.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}\r
-.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}\r
-\r
-/* Columns */\r
-.column {float:left;}\r
-.properties {width:100%;}\r
-.properties .column1 {}\r
-.properties .column2 {text-align:left;}\r
-\r
-/* Titles */\r
-h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}\r
-h3 {font-size:14px;}\r
-.title {font-size:12px; font-weight:bold; color:#2B6FB6;}\r
-\r
-/* Dialog specific */\r
-#link .panel_wrapper, #link div.current {height:125px;}\r
-#image .panel_wrapper, #image div.current {height:200px;}\r
-#plugintable thead {font-weight:bold; background:#DDD;}\r
-#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
-#plugintable {width:96%; margin-top:10px;}\r
-#pluginscontainer {height:290px; overflow:auto;}\r
-#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}\r
-#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}\r
-#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}\r
-#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
-#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
-#colorpicker #light div {overflow:hidden;}\r
-#colorpicker .panel_wrapper div.current {height:175px;}\r
-#colorpicker #namedcolors {width:150px;}\r
-#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
-#colorpicker #colornamecontainer {margin-top:5px;}\r
-#colorpicker #picker_panel fieldset {margin:auto;width:325px;}\r
+++ /dev/null
-/* Reset */\r
-.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}\r
-.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
-.defaultSkin table td {vertical-align:middle}\r
-\r
-/* Containers */\r
-.defaultSkin table {direction:ltr;background:transparent}\r
-.defaultSkin iframe {display:block;}\r
-.defaultSkin .mceToolbar {height:26px}\r
-.defaultSkin .mceLeft {text-align:left}\r
-.defaultSkin .mceRight {text-align:right}\r
-\r
-/* External */\r
-.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;}\r
-.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}\r
-.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}\r
-\r
-/* Layout */\r
-.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC}\r
-.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}\r
-.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}\r
-.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}\r
-.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top}\r
-.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}\r
-.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}\r
-.defaultSkin .mceStatusbar div {float:left; margin:2px}\r
-.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}\r
-.defaultSkin .mceStatusbar a:hover {text-decoration:underline}\r
-.defaultSkin table.mceToolbar {margin-left:3px}\r
-.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}\r
-.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
-.defaultSkin td.mceCenter {text-align:center;}\r
-.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;}\r
-.defaultSkin td.mceRight table {margin:0 0 0 auto;}\r
-\r
-/* Button */\r
-.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px}\r
-.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}\r
-.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}\r
-.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-.defaultSkin .mceButtonLabeled {width:auto}\r
-.defaultSkin .mceButtonLabeled span.mceIcon {float:left}\r
-.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}\r
-.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888}\r
-\r
-/* Separator */\r
-.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}\r
-\r
-/* ListBox */\r
-.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}\r
-.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}\r
-.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}\r
-.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF}\r
-.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0}\r
-.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;}\r
-.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}\r
-.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px}\r
-.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;}\r
-.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}\r
-\r
-/* SplitButton */\r
-.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}\r
-.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}\r
-.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}\r
-.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}\r
-.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}\r
-.defaultSkin .mceSplitButton span.mceOpen {display:none}\r
-.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}\r
-.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;}\r
-.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0}\r
-.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;}\r
-\r
-/* ColorSplitButton */\r
-.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}\r
-.defaultSkin .mceColorSplitMenu td {padding:2px}\r
-.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}\r
-.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}\r
-.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}\r
-.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}\r
-.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}\r
-.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a}\r
-.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}\r
-\r
-/* Menu */\r
-.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8; direction:ltr}\r
-.defaultSkin .mceNoIcons span.mceIcon {width:0;}\r
-.defaultSkin .mceNoIcons a .mceText {padding-left:10px}\r
-.defaultSkin .mceMenu table {background:#FFF}\r
-.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}\r
-.defaultSkin .mceMenu td {height:20px}\r
-.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}\r
-.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}\r
-.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px}\r
-.defaultSkin .mceMenu pre.mceText {font-family:Monospace}\r
-.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}\r
-.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}\r
-.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}\r
-.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}\r
-.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}\r
-.defaultSkin .mceMenuItemDisabled .mceText {color:#888}\r
-.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)}\r
-.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}\r
-.defaultSkin .mceMenu span.mceMenuLine {display:none}\r
-.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}\r
-.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal}\r
-\r
-/* Progress,Resize */\r
-.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}\r
-.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}\r
-\r
-/* Rtl */\r
-.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0}\r
-.mceRtl .mceMenuItem .mceText {text-align: right}\r
-\r
-/* Formats */\r
-.defaultSkin .mce_formatPreview a {font-size:10px}\r
-.defaultSkin .mce_p span.mceText {}\r
-.defaultSkin .mce_address span.mceText {font-style:italic}\r
-.defaultSkin .mce_pre span.mceText {font-family:monospace}\r
-.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}\r
-.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}\r
-.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}\r
-.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}\r
-.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}\r
-.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}\r
-\r
-/* Theme */\r
-.defaultSkin span.mce_bold {background-position:0 0}\r
-.defaultSkin span.mce_italic {background-position:-60px 0}\r
-.defaultSkin span.mce_underline {background-position:-140px 0}\r
-.defaultSkin span.mce_strikethrough {background-position:-120px 0}\r
-.defaultSkin span.mce_undo {background-position:-160px 0}\r
-.defaultSkin span.mce_redo {background-position:-100px 0}\r
-.defaultSkin span.mce_cleanup {background-position:-40px 0}\r
-.defaultSkin span.mce_bullist {background-position:-20px 0}\r
-.defaultSkin span.mce_numlist {background-position:-80px 0}\r
-.defaultSkin span.mce_justifyleft {background-position:-460px 0}\r
-.defaultSkin span.mce_justifyright {background-position:-480px 0}\r
-.defaultSkin span.mce_justifycenter {background-position:-420px 0}\r
-.defaultSkin span.mce_justifyfull {background-position:-440px 0}\r
-.defaultSkin span.mce_anchor {background-position:-200px 0}\r
-.defaultSkin span.mce_indent {background-position:-400px 0}\r
-.defaultSkin span.mce_outdent {background-position:-540px 0}\r
-.defaultSkin span.mce_link {background-position:-500px 0}\r
-.defaultSkin span.mce_unlink {background-position:-640px 0}\r
-.defaultSkin span.mce_sub {background-position:-600px 0}\r
-.defaultSkin span.mce_sup {background-position:-620px 0}\r
-.defaultSkin span.mce_removeformat {background-position:-580px 0}\r
-.defaultSkin span.mce_newdocument {background-position:-520px 0}\r
-.defaultSkin span.mce_image {background-position:-380px 0}\r
-.defaultSkin span.mce_help {background-position:-340px 0}\r
-.defaultSkin span.mce_code {background-position:-260px 0}\r
-.defaultSkin span.mce_hr {background-position:-360px 0}\r
-.defaultSkin span.mce_visualaid {background-position:-660px 0}\r
-.defaultSkin span.mce_charmap {background-position:-240px 0}\r
-.defaultSkin span.mce_paste {background-position:-560px 0}\r
-.defaultSkin span.mce_copy {background-position:-700px 0}\r
-.defaultSkin span.mce_cut {background-position:-680px 0}\r
-.defaultSkin span.mce_blockquote {background-position:-220px 0}\r
-.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0}\r
-.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0}\r
-.defaultSkin span.mce_forecolorpicker {background-position:-720px 0}\r
-.defaultSkin span.mce_backcolorpicker {background-position:-760px 0}\r
-\r
-/* Plugins */\r
-.defaultSkin span.mce_advhr {background-position:-0px -20px}\r
-.defaultSkin span.mce_ltr {background-position:-20px -20px}\r
-.defaultSkin span.mce_rtl {background-position:-40px -20px}\r
-.defaultSkin span.mce_emotions {background-position:-60px -20px}\r
-.defaultSkin span.mce_fullpage {background-position:-80px -20px}\r
-.defaultSkin span.mce_fullscreen {background-position:-100px -20px}\r
-.defaultSkin span.mce_iespell {background-position:-120px -20px}\r
-.defaultSkin span.mce_insertdate {background-position:-140px -20px}\r
-.defaultSkin span.mce_inserttime {background-position:-160px -20px}\r
-.defaultSkin span.mce_absolute {background-position:-180px -20px}\r
-.defaultSkin span.mce_backward {background-position:-200px -20px}\r
-.defaultSkin span.mce_forward {background-position:-220px -20px}\r
-.defaultSkin span.mce_insert_layer {background-position:-240px -20px}\r
-.defaultSkin span.mce_insertlayer {background-position:-260px -20px}\r
-.defaultSkin span.mce_movebackward {background-position:-280px -20px}\r
-.defaultSkin span.mce_moveforward {background-position:-300px -20px}\r
-.defaultSkin span.mce_media {background-position:-320px -20px}\r
-.defaultSkin span.mce_nonbreaking {background-position:-340px -20px}\r
-.defaultSkin span.mce_pastetext {background-position:-360px -20px}\r
-.defaultSkin span.mce_pasteword {background-position:-380px -20px}\r
-.defaultSkin span.mce_selectall {background-position:-400px -20px}\r
-.defaultSkin span.mce_preview {background-position:-420px -20px}\r
-.defaultSkin span.mce_print {background-position:-440px -20px}\r
-.defaultSkin span.mce_cancel {background-position:-460px -20px}\r
-.defaultSkin span.mce_save {background-position:-480px -20px}\r
-.defaultSkin span.mce_replace {background-position:-500px -20px}\r
-.defaultSkin span.mce_search {background-position:-520px -20px}\r
-.defaultSkin span.mce_styleprops {background-position:-560px -20px}\r
-.defaultSkin span.mce_table {background-position:-580px -20px}\r
-.defaultSkin span.mce_cell_props {background-position:-600px -20px}\r
-.defaultSkin span.mce_delete_table {background-position:-620px -20px}\r
-.defaultSkin span.mce_delete_col {background-position:-640px -20px}\r
-.defaultSkin span.mce_delete_row {background-position:-660px -20px}\r
-.defaultSkin span.mce_col_after {background-position:-680px -20px}\r
-.defaultSkin span.mce_col_before {background-position:-700px -20px}\r
-.defaultSkin span.mce_row_after {background-position:-720px -20px}\r
-.defaultSkin span.mce_row_before {background-position:-740px -20px}\r
-.defaultSkin span.mce_merge_cells {background-position:-760px -20px}\r
-.defaultSkin span.mce_table_props {background-position:-980px -20px}\r
-.defaultSkin span.mce_row_props {background-position:-780px -20px}\r
-.defaultSkin span.mce_split_cells {background-position:-800px -20px}\r
-.defaultSkin span.mce_template {background-position:-820px -20px}\r
-.defaultSkin span.mce_visualchars {background-position:-840px -20px}\r
-.defaultSkin span.mce_abbr {background-position:-860px -20px}\r
-.defaultSkin span.mce_acronym {background-position:-880px -20px}\r
-.defaultSkin span.mce_attribs {background-position:-900px -20px}\r
-.defaultSkin span.mce_cite {background-position:-920px -20px}\r
-.defaultSkin span.mce_del {background-position:-940px -20px}\r
-.defaultSkin span.mce_ins {background-position:-960px -20px}\r
-.defaultSkin span.mce_pagebreak {background-position:0 -40px}\r
-.defaultSkin span.mce_restoredraft {background-position:-20px -40px}\r
-.defaultSkin span.mce_spellchecker {background-position:-540px -20px}\r
-.defaultSkin span.mce_visualblocks {background-position: -40px -40px}\r
+++ /dev/null
-body, td, pre { margin:8px;}\r
-body.mceForceColors {background:#FFF; color:#000;}\r
-h1 {font-size: 2em}\r
-h2 {font-size: 1.5em}\r
-h3 {font-size: 1.17em}\r
-h4 {font-size: 1em}\r
-h5 {font-size: .83em}\r
-h6 {font-size: .75em}\r
-.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}\r
-a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}\r
-span.mceItemNbsp {background: #DDD}\r
-td.mceSelected, th.mceSelected {background-color:#3399ff !important}\r
-img {border:0;}\r
-table, img, hr, .mceItemAnchor {cursor:default}\r
-table td, table th {cursor:text}\r
-ins {border-bottom:1px solid green; text-decoration: none; color:green}\r
-del {color:red; text-decoration:line-through}\r
-cite {border-bottom:1px dashed blue}\r
-acronym {border-bottom:1px dotted #CCC; cursor:help}\r
-abbr {border-bottom:1px dashed #CCC; cursor:help}\r
-\r
-img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}\r
-font[face=mceinline] {font-family:inherit !important}\r
-*[contentEditable]:focus {outline:0}\r
+++ /dev/null
-/* Generic */\r
-body {\r
-font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
-background:#F0F0EE;\r
-color: black;\r
-padding:0;\r
-margin:8px 8px 0 8px;\r
-}\r
-\r
-html {background:#F0F0EE; color:#000;}\r
-td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
-textarea {resize:none;outline:none;}\r
-a:link, a:visited {color:black;background-color:transparent;}\r
-a:hover {color:#2B6FB6;background-color:transparent;}\r
-.nowrap {white-space: nowrap}\r
-\r
-/* Forms */\r
-fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}\r
-legend {color:#2B6FB6; font-weight:bold;}\r
-label.msg {display:none;}\r
-label.invalid {color:#EE0000; display:inline;background-color:transparent;}\r
-input.invalid {border:1px solid #EE0000;background-color:transparent;}\r
-input {background:#FFF; border:1px solid #CCC;color:black;}\r
-input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
-input, select, textarea {border:1px solid #808080;}\r
-input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}\r
-input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}\r
-.input_noborder {border:0;}\r
-\r
-/* Buttons */\r
-#insert, #cancel, input.button, .updateButton {\r
-font-weight:bold;\r
-width:94px; height:23px;\r
-cursor:pointer;\r
-padding-bottom:2px;\r
-float:left;\r
-}\r
-\r
-#cancel {float:right}\r
-\r
-/* Browse */\r
-a.pickcolor, a.browse {text-decoration:none}\r
-a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}\r
-.mceOldBoxModel a.browse span {width:22px; height:20px;}\r
-a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}\r
-a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}\r
-a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}\r
-.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}\r
-a.pickcolor:hover span {background-color:#B2BBD0;}\r
-a.pickcolor:hover span.disabled {}\r
-\r
-/* Charmap */\r
-table.charmap {border:1px solid #AAA; text-align:center}\r
-td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}\r
-#charmap a {display:block; color:#000; text-decoration:none; border:0}\r
-#charmap a:hover {background:#CCC;color:#2B6FB6}\r
-#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}\r
-#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}\r
-\r
-/* Source */\r
-.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}\r
-.mceActionPanel {margin-top:5px;}\r
-\r
-/* Tabs classes */\r
-.tabs {width:100%; height:18px; line-height:normal;}\r
-.tabs ul {margin:0; padding:0; list-style:none;}\r
-.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;}\r
-.tabs li.current {font-weight: bold; margin-right:2px;}\r
-.tabs span {float:left; display:block; padding:0px 10px 0 0;}\r
-.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}\r
-.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}\r
-\r
-/* Panels */\r
-.panel_wrapper div.panel {display:none;}\r
-.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}\r
-.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;}\r
-\r
-/* Columns */\r
-.column {float:left;}\r
-.properties {width:100%;}\r
-.properties .column1 {}\r
-.properties .column2 {text-align:left;}\r
-\r
-/* Titles */\r
-h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}\r
-h3 {font-size:14px;}\r
-.title {font-size:12px; font-weight:bold; color:#2B6FB6;}\r
-\r
-/* Dialog specific */\r
-#link .panel_wrapper, #link div.current {height:125px;}\r
-#image .panel_wrapper, #image div.current {height:200px;}\r
-#plugintable thead {font-weight:bold; background:#DDD;}\r
-#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
-#plugintable {width:96%; margin-top:10px;}\r
-#pluginscontainer {height:290px; overflow:auto;}\r
-#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}\r
-#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}\r
-#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}\r
-#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
-#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
-#colorpicker #light div {overflow:hidden;}\r
-#colorpicker .panel_wrapper div.current {height:175px;}\r
-#colorpicker #namedcolors {width:150px;}\r
-#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
-#colorpicker #colornamecontainer {margin-top:5px;}\r
+++ /dev/null
-/* Reset */\r
-.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;}\r
-.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;}\r
-.highcontrastSkin table td {vertical-align:middle}\r
-\r
-.highcontrastSkin .mceIconOnly {display: block !important;}\r
-\r
-/* External */\r
-.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;}\r
-.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}\r
-.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;}\r
-\r
-/* Layout */\r
-.highcontrastSkin table.mceLayout {border: 1px solid;}\r
-.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid}\r
-.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline}\r
-.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;}\r
-.highcontrastSkin .mceStatusbar div {float:left}\r
-.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0}\r
-\r
-.highcontrastSkin .mceToolbar td { display: inline-block; float: left;}\r
-.highcontrastSkin .mceToolbar tr { display: block;}\r
-.highcontrastSkin .mceToolbar table { display: block; }\r
-\r
-/* Button */\r
-\r
-.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;}\r
-.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em}\r
-.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);}\r
-.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;}\r
-\r
-/* Separator */\r
-.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;}\r
-\r
-/* ListBox */\r
-.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;}\r
-.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;}\r
-.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);}\r
-.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;}\r
-.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;}\r
-.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;}\r
-.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;}\r
-\r
-.highcontrastSkin .mceListBoxMenu {overflow-y:auto}\r
-\r
-/* SplitButton */\r
-.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-\r
-.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;}\r
-.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;}\r
-.highcontrastSkin .mceSplitButton tr { display: table-row; }\r
-.highcontrastSkin table.mceSplitButton { display: table; }\r
-.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;}\r
-.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;}\r
-.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } \r
-.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;}\r
-.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;}\r
-\r
-/* Menu */\r
-.highcontrastSkin .mceNoIcons span.mceIcon {width:0;}\r
-.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; direction:ltr}\r
-.highcontrastSkin .mceMenu table {background:white; color: black}\r
-.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px}\r
-.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black}\r
-.highcontrastSkin .mceMenu td {height:2em}\r
-.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;}\r
-.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;}\r
-.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace}\r
-.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;}\r
-.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px}\r
-.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid}\r
-.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px}\r
-.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";}\r
-.highcontrastSkin .mceMenu span.mceMenuLine {display:none}\r
-.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"}\r
-.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal}\r
-\r
-/* ColorSplitButton */\r
-.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000}\r
-.highcontrastSkin .mceColorSplitMenu td {padding:2px}\r
-.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;}\r
-.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}\r
-.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}\r
-.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2}\r
-.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;}\r
-.highcontrastSkin .mceColorPreview {display:none;}\r
-.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden}\r
-\r
-/* Progress,Resize */\r
-.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}\r
-.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}\r
-\r
-/* Rtl */\r
-.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0}\r
-.mceRtl .mceMenuItem .mceText {text-align: right}\r
-\r
-/* Formats */\r
-.highcontrastSkin .mce_p span.mceText {}\r
-.highcontrastSkin .mce_address span.mceText {font-style:italic}\r
-.highcontrastSkin .mce_pre span.mceText {font-family:monospace}\r
-.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}\r
-.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}\r
-.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}\r
-.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}\r
-.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}\r
-.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}\r
+++ /dev/null
-body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}\r
-body {background:#FFF;}\r
-body.mceForceColors {background:#FFF; color:#000;}\r
-h1 {font-size: 2em}\r
-h2 {font-size: 1.5em}\r
-h3 {font-size: 1.17em}\r
-h4 {font-size: 1em}\r
-h5 {font-size: .83em}\r
-h6 {font-size: .75em}\r
-.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}\r
-a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}\r
-span.mceItemNbsp {background: #DDD}\r
-td.mceSelected, th.mceSelected {background-color:#3399ff !important}\r
-img {border:0;}\r
-table, img, hr, .mceItemAnchor {cursor:default}\r
-table td, table th {cursor:text}\r
-ins {border-bottom:1px solid green; text-decoration: none; color:green}\r
-del {color:red; text-decoration:line-through}\r
-cite {border-bottom:1px dashed blue}\r
-acronym {border-bottom:1px dotted #CCC; cursor:help}\r
-abbr {border-bottom:1px dashed #CCC; cursor:help}\r
-\r
-/* IE */\r
-* html body {\r
-scrollbar-3dlight-color:#F0F0EE;\r
-scrollbar-arrow-color:#676662;\r
-scrollbar-base-color:#F0F0EE;\r
-scrollbar-darkshadow-color:#DDD;\r
-scrollbar-face-color:#E0E0DD;\r
-scrollbar-highlight-color:#F0F0EE;\r
-scrollbar-shadow-color:#F0F0EE;\r
-scrollbar-track-color:#F5F5F5;\r
-}\r
-\r
-img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}\r
-font[face=mceinline] {font-family:inherit !important}\r
-*[contentEditable]:focus {outline:0}\r
-\r
-.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc}\r
-.mceItemShockWave {background-image:url(../../img/shockwave.gif)}\r
-.mceItemFlash {background-image:url(../../img/flash.gif)}\r
-.mceItemQuickTime {background-image:url(../../img/quicktime.gif)}\r
-.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)}\r
-.mceItemRealMedia {background-image:url(../../img/realmedia.gif)}\r
-.mceItemVideo {background-image:url(../../img/video.gif)}\r
-.mceItemAudio {background-image:url(../../img/video.gif)}\r
-.mceItemIframe {background-image:url(../../img/iframe.gif)}\r
-.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}\r
+++ /dev/null
-/* Generic */\r
-body {\r
-font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
-scrollbar-3dlight-color:#F0F0EE;\r
-scrollbar-arrow-color:#676662;\r
-scrollbar-base-color:#F0F0EE;\r
-scrollbar-darkshadow-color:#DDDDDD;\r
-scrollbar-face-color:#E0E0DD;\r
-scrollbar-highlight-color:#F0F0EE;\r
-scrollbar-shadow-color:#F0F0EE;\r
-scrollbar-track-color:#F5F5F5;\r
-background:#F0F0EE;\r
-padding:0;\r
-margin:8px 8px 0 8px;\r
-}\r
-\r
-html {background:#F0F0EE;}\r
-td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
-textarea {resize:none;outline:none;}\r
-a:link, a:visited {color:black;}\r
-a:hover {color:#2B6FB6;}\r
-.nowrap {white-space: nowrap}\r
-\r
-/* Forms */\r
-fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}\r
-legend {color:#2B6FB6; font-weight:bold;}\r
-label.msg {display:none;}\r
-label.invalid {color:#EE0000; display:inline;}\r
-input.invalid {border:1px solid #EE0000;}\r
-input {background:#FFF; border:1px solid #CCC;}\r
-input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
-input, select, textarea {border:1px solid #808080;}\r
-input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}\r
-input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}\r
-.input_noborder {border:0;}\r
-\r
-/* Buttons */\r
-#insert, #cancel, input.button, .updateButton {\r
-border:0; margin:0; padding:0;\r
-font-weight:bold;\r
-width:94px; height:26px;\r
-background:url(../default/img/buttons.png) 0 -26px;\r
-cursor:pointer;\r
-padding-bottom:2px;\r
-float:left;\r
-}\r
-\r
-#insert {background:url(../default/img/buttons.png) 0 -52px}\r
-#cancel {background:url(../default/img/buttons.png) 0 0; float:right}\r
-\r
-/* Browse */\r
-a.pickcolor, a.browse {text-decoration:none}\r
-a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}\r
-.mceOldBoxModel a.browse span {width:22px; height:20px;}\r
-a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}\r
-a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}\r
-a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}\r
-.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}\r
-a.pickcolor:hover span {background-color:#B2BBD0;}\r
-a.pickcolor:hover span.disabled {}\r
-\r
-/* Charmap */\r
-table.charmap {border:1px solid #AAA; text-align:center}\r
-td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}\r
-#charmap a {display:block; color:#000; text-decoration:none; border:0}\r
-#charmap a:hover {background:#CCC;color:#2B6FB6}\r
-#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}\r
-#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}\r
-\r
-/* Source */\r
-.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}\r
-.mceActionPanel {margin-top:5px;}\r
-\r
-/* Tabs classes */\r
-.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;}\r
-.tabs ul {margin:0; padding:0; list-style:none;}\r
-.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}\r
-.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}\r
-.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}\r
-.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}\r
-.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}\r
-.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}\r
-\r
-/* Panels */\r
-.panel_wrapper div.panel {display:none;}\r
-.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}\r
-.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}\r
-\r
-/* Columns */\r
-.column {float:left;}\r
-.properties {width:100%;}\r
-.properties .column1 {}\r
-.properties .column2 {text-align:left;}\r
-\r
-/* Titles */\r
-h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}\r
-h3 {font-size:14px;}\r
-.title {font-size:12px; font-weight:bold; color:#2B6FB6;}\r
-\r
-/* Dialog specific */\r
-#link .panel_wrapper, #link div.current {height:125px;}\r
-#image .panel_wrapper, #image div.current {height:200px;}\r
-#plugintable thead {font-weight:bold; background:#DDD;}\r
-#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
-#plugintable {width:96%; margin-top:10px;}\r
-#pluginscontainer {height:290px; overflow:auto;}\r
-#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}\r
-#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}\r
-#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}\r
-#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
-#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
-#colorpicker #light div {overflow:hidden;}\r
-#colorpicker .panel_wrapper div.current {height:175px;}\r
-#colorpicker #namedcolors {width:150px;}\r
-#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
-#colorpicker #colornamecontainer {margin-top:5px;}\r
-#colorpicker #picker_panel fieldset {margin:auto;width:325px;}\r
+++ /dev/null
-/* Reset */\r
-.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}\r
-.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
-.o2k7Skin table td {vertical-align:middle}\r
-\r
-/* Containers */\r
-.o2k7Skin table {background:transparent}\r
-.o2k7Skin iframe {display:block;}\r
-.o2k7Skin .mceToolbar {height:26px}\r
-\r
-/* External */\r
-.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none}\r
-.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;}\r
-.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}\r
-\r
-/* Layout */\r
-.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD}\r
-.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD}\r
-.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}\r
-.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}\r
-.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}\r
-.o2k7Skin td.mceToolbar{background:#E5EFFD}\r
-.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px}\r
-.o2k7Skin .mceStatusbar div {float:left; padding:2px}\r
-.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}\r
-.o2k7Skin .mceStatusbar a:hover {text-decoration:underline}\r
-.o2k7Skin table.mceToolbar {margin-left:3px}\r
-.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}\r
-.o2k7Skin .mceToolbar td.mceFirst span {margin:0}\r
-.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}\r
-.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none}\r
-.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px}\r
-.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
-.o2k7Skin td.mceCenter {text-align:center;}\r
-.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;}\r
-.o2k7Skin td.mceRight table {margin:0 0 0 auto;}\r
-\r
-/* Button */\r
-.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}\r
-.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px}\r
-.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px}\r
-.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}\r
-.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px}\r
-.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-.o2k7Skin .mceButtonLabeled {width:auto}\r
-.o2k7Skin .mceButtonLabeled span.mceIcon {float:left}\r
-.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}\r
-.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888}\r
-\r
-/* Separator */\r
-.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}\r
-\r
-/* ListBox */\r
-.o2k7Skin .mceListBox {padding-left: 3px}\r
-.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}\r
-.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}\r
-.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}\r
-.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF}\r
-.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}\r
-.o2k7Skin .mceListBoxDisabled .mceText {color:gray}\r
-.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px}\r
-.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px}\r
-.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}\r
-\r
-/* SplitButton */\r
-.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr}\r
-.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)}\r
-.o2k7Skin .mceSplitButton a.mceAction {width:22px}\r
-.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)}\r
-.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0}\r
-.o2k7Skin .mceSplitButton span.mceOpen {display:none}\r
-.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px}\r
-.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px}\r
-.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-.o2k7Skin .mceSplitButtonActive {background-position:0 -44px}\r
-\r
-/* ColorSplitButton */\r
-.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}\r
-.o2k7Skin .mceColorSplitMenu td {padding:2px}\r
-.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}\r
-.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}\r
-.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}\r
-.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}\r
-.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A}\r
-.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden}\r
-.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden}\r
-\r
-/* Menu */\r
-.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD; direction:ltr}\r
-.o2k7Skin .mceNoIcons span.mceIcon {width:0;}\r
-.o2k7Skin .mceNoIcons a .mceText {padding-left:10px}\r
-.o2k7Skin .mceMenu table {background:#FFF}\r
-.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block}\r
-.o2k7Skin .mceMenu td {height:20px}\r
-.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0}\r
-.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}\r
-.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px}\r
-.o2k7Skin .mceMenu pre.mceText {font-family:Monospace}\r
-.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}\r
-.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3}\r
-.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px}\r
-.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD}\r
-.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}\r
-.o2k7Skin .mceMenuItemDisabled .mceText {color:#888}\r
-.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)}\r
-.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}\r
-.o2k7Skin .mceMenu span.mceMenuLine {display:none}\r
-.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}\r
-.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal}\r
-\r
-/* Progress,Resize */\r
-.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}\r
-.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}\r
-\r
-/* Rtl */\r
-.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0}\r
-.mceRtl .mceMenuItem .mceText {text-align: right}\r
-\r
-/* Formats */\r
-.o2k7Skin .mce_formatPreview a {font-size:10px}\r
-.o2k7Skin .mce_p span.mceText {}\r
-.o2k7Skin .mce_address span.mceText {font-style:italic}\r
-.o2k7Skin .mce_pre span.mceText {font-family:monospace}\r
-.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}\r
-.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}\r
-.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}\r
-.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}\r
-.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}\r
-.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}\r
-\r
-/* Theme */\r
-.o2k7Skin span.mce_bold {background-position:0 0}\r
-.o2k7Skin span.mce_italic {background-position:-60px 0}\r
-.o2k7Skin span.mce_underline {background-position:-140px 0}\r
-.o2k7Skin span.mce_strikethrough {background-position:-120px 0}\r
-.o2k7Skin span.mce_undo {background-position:-160px 0}\r
-.o2k7Skin span.mce_redo {background-position:-100px 0}\r
-.o2k7Skin span.mce_cleanup {background-position:-40px 0}\r
-.o2k7Skin span.mce_bullist {background-position:-20px 0}\r
-.o2k7Skin span.mce_numlist {background-position:-80px 0}\r
-.o2k7Skin span.mce_justifyleft {background-position:-460px 0}\r
-.o2k7Skin span.mce_justifyright {background-position:-480px 0}\r
-.o2k7Skin span.mce_justifycenter {background-position:-420px 0}\r
-.o2k7Skin span.mce_justifyfull {background-position:-440px 0}\r
-.o2k7Skin span.mce_anchor {background-position:-200px 0}\r
-.o2k7Skin span.mce_indent {background-position:-400px 0}\r
-.o2k7Skin span.mce_outdent {background-position:-540px 0}\r
-.o2k7Skin span.mce_link {background-position:-500px 0}\r
-.o2k7Skin span.mce_unlink {background-position:-640px 0}\r
-.o2k7Skin span.mce_sub {background-position:-600px 0}\r
-.o2k7Skin span.mce_sup {background-position:-620px 0}\r
-.o2k7Skin span.mce_removeformat {background-position:-580px 0}\r
-.o2k7Skin span.mce_newdocument {background-position:-520px 0}\r
-.o2k7Skin span.mce_image {background-position:-380px 0}\r
-.o2k7Skin span.mce_help {background-position:-340px 0}\r
-.o2k7Skin span.mce_code {background-position:-260px 0}\r
-.o2k7Skin span.mce_hr {background-position:-360px 0}\r
-.o2k7Skin span.mce_visualaid {background-position:-660px 0}\r
-.o2k7Skin span.mce_charmap {background-position:-240px 0}\r
-.o2k7Skin span.mce_paste {background-position:-560px 0}\r
-.o2k7Skin span.mce_copy {background-position:-700px 0}\r
-.o2k7Skin span.mce_cut {background-position:-680px 0}\r
-.o2k7Skin span.mce_blockquote {background-position:-220px 0}\r
-.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0}\r
-.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0}\r
-.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0}\r
-.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0}\r
-\r
-/* Plugins */\r
-.o2k7Skin span.mce_advhr {background-position:-0px -20px}\r
-.o2k7Skin span.mce_ltr {background-position:-20px -20px}\r
-.o2k7Skin span.mce_rtl {background-position:-40px -20px}\r
-.o2k7Skin span.mce_emotions {background-position:-60px -20px}\r
-.o2k7Skin span.mce_fullpage {background-position:-80px -20px}\r
-.o2k7Skin span.mce_fullscreen {background-position:-100px -20px}\r
-.o2k7Skin span.mce_iespell {background-position:-120px -20px}\r
-.o2k7Skin span.mce_insertdate {background-position:-140px -20px}\r
-.o2k7Skin span.mce_inserttime {background-position:-160px -20px}\r
-.o2k7Skin span.mce_absolute {background-position:-180px -20px}\r
-.o2k7Skin span.mce_backward {background-position:-200px -20px}\r
-.o2k7Skin span.mce_forward {background-position:-220px -20px}\r
-.o2k7Skin span.mce_insert_layer {background-position:-240px -20px}\r
-.o2k7Skin span.mce_insertlayer {background-position:-260px -20px}\r
-.o2k7Skin span.mce_movebackward {background-position:-280px -20px}\r
-.o2k7Skin span.mce_moveforward {background-position:-300px -20px}\r
-.o2k7Skin span.mce_media {background-position:-320px -20px}\r
-.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px}\r
-.o2k7Skin span.mce_pastetext {background-position:-360px -20px}\r
-.o2k7Skin span.mce_pasteword {background-position:-380px -20px}\r
-.o2k7Skin span.mce_selectall {background-position:-400px -20px}\r
-.o2k7Skin span.mce_preview {background-position:-420px -20px}\r
-.o2k7Skin span.mce_print {background-position:-440px -20px}\r
-.o2k7Skin span.mce_cancel {background-position:-460px -20px}\r
-.o2k7Skin span.mce_save {background-position:-480px -20px}\r
-.o2k7Skin span.mce_replace {background-position:-500px -20px}\r
-.o2k7Skin span.mce_search {background-position:-520px -20px}\r
-.o2k7Skin span.mce_styleprops {background-position:-560px -20px}\r
-.o2k7Skin span.mce_table {background-position:-580px -20px}\r
-.o2k7Skin span.mce_cell_props {background-position:-600px -20px}\r
-.o2k7Skin span.mce_delete_table {background-position:-620px -20px}\r
-.o2k7Skin span.mce_delete_col {background-position:-640px -20px}\r
-.o2k7Skin span.mce_delete_row {background-position:-660px -20px}\r
-.o2k7Skin span.mce_col_after {background-position:-680px -20px}\r
-.o2k7Skin span.mce_col_before {background-position:-700px -20px}\r
-.o2k7Skin span.mce_row_after {background-position:-720px -20px}\r
-.o2k7Skin span.mce_row_before {background-position:-740px -20px}\r
-.o2k7Skin span.mce_merge_cells {background-position:-760px -20px}\r
-.o2k7Skin span.mce_table_props {background-position:-980px -20px}\r
-.o2k7Skin span.mce_row_props {background-position:-780px -20px}\r
-.o2k7Skin span.mce_split_cells {background-position:-800px -20px}\r
-.o2k7Skin span.mce_template {background-position:-820px -20px}\r
-.o2k7Skin span.mce_visualchars {background-position:-840px -20px}\r
-.o2k7Skin span.mce_abbr {background-position:-860px -20px}\r
-.o2k7Skin span.mce_acronym {background-position:-880px -20px}\r
-.o2k7Skin span.mce_attribs {background-position:-900px -20px}\r
-.o2k7Skin span.mce_cite {background-position:-920px -20px}\r
-.o2k7Skin span.mce_del {background-position:-940px -20px}\r
-.o2k7Skin span.mce_ins {background-position:-960px -20px}\r
-.o2k7Skin span.mce_pagebreak {background-position:0 -40px}\r
-.o2k7Skin span.mce_restoredraft {background-position:-20px -40px}\r
-.o2k7Skin span.mce_spellchecker {background-position:-540px -20px}\r
-.o2k7Skin span.mce_visualblocks {background-position: -40px -40px}\r
+++ /dev/null
-/* Black */\r
-.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)}\r
-.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF}\r
-.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0}\r
-.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0}\r
-.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;}\r
-.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)}\r
-.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1}
\ No newline at end of file
+++ /dev/null
-/* Silver */\r
-.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)}\r
-.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee}\r
-.o2k7SkinSilver .mceListBox .mceText {background:#FFF}\r
-.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb}\r
+++ /dev/null
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
- <title>{#advanced_dlg.code_title}</title>\r
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
- <script type="text/javascript" src="js/source_editor.js"></script>\r
-</head>\r
-<body onresize="resizeInputs();" style="display:none; overflow:hidden;" spellcheck="false">\r
- <form name="source" onsubmit="saveContent();return false;" action="#">\r
- <div style="float: left" class="title"><label for="htmlSource">{#advanced_dlg.code_title}</label></div>\r
-\r
- <div id="wrapline" style="float: right">\r
- <input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label>\r
- </div>\r
-\r
- <br style="clear: both" />\r
-\r
- <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>\r
-\r
- <div class="mceActionPanel">\r
- <input type="submit" role="button" name="insert" value="{#update}" id="insert" />\r
- <input type="button" role="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />\r
- </div>\r
- </form>\r
-</body>\r
-</html>\r
+++ /dev/null
-(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * editor_template_src.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var DOM = tinymce.DOM;\r
-\r
- // Tell it to load theme specific language pack(s)\r
- tinymce.ThemeManager.requireLangPack('simple');\r
-\r
- tinymce.create('tinymce.themes.SimpleTheme', {\r
- init : function(ed, url) {\r
- var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;\r
-\r
- t.editor = ed;\r
- ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css");\r
-\r
- ed.onInit.add(function() {\r
- ed.onNodeChange.add(function(ed, cm) {\r
- tinymce.each(states, function(c) {\r
- cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));\r
- });\r
- });\r
- });\r
-\r
- DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");\r
- },\r
-\r
- renderUI : function(o) {\r
- var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc;\r
-\r
- n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n);\r
- n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'});\r
- n = tb = DOM.add(n, 'tbody');\r
-\r
- // Create iframe container\r
- n = DOM.add(tb, 'tr');\r
- n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'});\r
-\r
- // Create toolbar container\r
- n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'});\r
-\r
- // Create toolbar\r
- tb = t.toolbar = cf.createToolbar("tools1");\r
- tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'}));\r
- tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'}));\r
- tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'}));\r
- tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'}));\r
- tb.add(cf.createSeparator());\r
- tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'}));\r
- tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'}));\r
- tb.add(cf.createSeparator());\r
- tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'}));\r
- tb.add(cf.createSeparator());\r
- tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'}));\r
- tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'}));\r
- tb.renderTo(n);\r
-\r
- return {\r
- iframeContainer : ic,\r
- editorContainer : ed.id + '_container',\r
- sizeContainer : sc,\r
- deltaHeight : -20\r
- };\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Simple theme',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- }\r
- }\r
- });\r
-\r
- tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme);\r
-})();
\ No newline at end of file
+++ /dev/null
-tinyMCE.addI18n('en.simple',{"cleanup_desc":"Cleanup Messy Code","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","striketrough_desc":"Strikethrough","underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)"});
\ No newline at end of file
+++ /dev/null
-body, td, pre {\r
- font-family: Verdana, Arial, Helvetica, sans-serif;\r
- font-size: 10px;\r
-}\r
-\r
-body {\r
- background-color: #FFFFFF;\r
-}\r
-\r
-.mceVisualAid {\r
- border: 1px dashed #BBBBBB;\r
-}\r
-\r
-/* MSIE specific */\r
-\r
-* html body {\r
- scrollbar-3dlight-color: #F0F0EE;\r
- scrollbar-arrow-color: #676662;\r
- scrollbar-base-color: #F0F0EE;\r
- scrollbar-darkshadow-color: #DDDDDD;\r
- scrollbar-face-color: #E0E0DD;\r
- scrollbar-highlight-color: #F0F0EE;\r
- scrollbar-shadow-color: #F0F0EE;\r
- scrollbar-track-color: #F5F5F5; \r
-}\r
+++ /dev/null
-/* Reset */\r
-.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
-\r
-/* Containers */\r
-.defaultSimpleSkin {position:relative}\r
-.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;}\r
-.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;}\r
-.defaultSimpleSkin .mceToolbar {height:24px;}\r
-\r
-/* Layout */\r
-.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px}\r
-.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
-\r
-/* Button */\r
-.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px}\r
-.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}\r
-.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0}\r
-.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-\r
-/* Separator */\r
-.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px}\r
-\r
-/* Theme */\r
-.defaultSimpleSkin span.mce_bold {background-position:0 0}\r
-.defaultSimpleSkin span.mce_italic {background-position:-60px 0}\r
-.defaultSimpleSkin span.mce_underline {background-position:-140px 0}\r
-.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0}\r
-.defaultSimpleSkin span.mce_undo {background-position:-160px 0}\r
-.defaultSimpleSkin span.mce_redo {background-position:-100px 0}\r
-.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0}\r
-.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}\r
-.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0}\r
+++ /dev/null
-body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
-\r
-body {background: #FFF;}\r
-.mceVisualAid {border: 1px dashed #BBB;}\r
-\r
-/* IE */\r
-\r
-* html body {\r
-scrollbar-3dlight-color: #F0F0EE;\r
-scrollbar-arrow-color: #676662;\r
-scrollbar-base-color: #F0F0EE;\r
-scrollbar-darkshadow-color: #DDDDDD;\r
-scrollbar-face-color: #E0E0DD;\r
-scrollbar-highlight-color: #F0F0EE;\r
-scrollbar-shadow-color: #F0F0EE;\r
-scrollbar-track-color: #F5F5F5; \r
-}\r
+++ /dev/null
-/* Reset */\r
-.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
-\r
-/* Containers */\r
-.o2k7SimpleSkin {position:relative}\r
-.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;}\r
-.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;}\r
-.o2k7SimpleSkin .mceToolbar {height:26px;}\r
-\r
-/* Layout */\r
-.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }\r
-.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}\r
-.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px}\r
-.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
-\r
-/* Button */\r
-.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}\r
-.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px}\r
-.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}\r
-.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px}\r
-.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
-\r
-/* Separator */\r
-.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}\r
-\r
-/* Theme */\r
-.o2k7SimpleSkin span.mce_bold {background-position:0 0}\r
-.o2k7SimpleSkin span.mce_italic {background-position:-60px 0}\r
-.o2k7SimpleSkin span.mce_underline {background-position:-140px 0}\r
-.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0}\r
-.o2k7SimpleSkin span.mce_undo {background-position:-160px 0}\r
-.o2k7SimpleSkin span.mce_redo {background-position:-100px 0}\r
-.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0}\r
-.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}\r
-.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0}\r
+++ /dev/null
-(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"3",minorVersion:"5.8",releaseDate:"2012-11-20",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){r=f[m].href;if(r){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==b}if(f=="array"&&c.isArray(g)){return true}return typeof(g)==f},isArray:Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},makeMap:function(f,j,h){var g;f=f||[];j=j||",";if(typeof(f)=="string"){f=f.split(j)}h=h||{};g=f.length;while(g--){h[f[g]]={}}return h},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==b){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},map:function(g,h){var i=[];c.each(g,function(f){i.push(h(f))});return i},grep:function(g,h){var i=[];c.each(g,function(f){if(!h||h(f)){i.push(f)}});return i},inArray:function(g,h){var j,f;if(g){for(j=0,f=g.length;j<f;j++){if(g[j]===h){return j}}}return -1},extend:function(n,k){var j,f,h,g=arguments,m;for(j=1,f=g.length;j<f;j++){k=g[j];for(h in k){if(k.hasOwnProperty(h)){m=k[h];if(m!==b){n[h]=m}}}}return n},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(o,f,j){var n=this,g,i,k,l,h,m=0;o=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(o);k=o[3].match(/(^|\.)(\w+)$/i)[2];i=n.createNS(o[3].replace(/\.\w+$/,""),j);if(i[k]){return}if(o[2]=="static"){i[k]=f;if(this.onCreate){this.onCreate(o[2],o[3],i[k])}return}if(!f[k]){f[k]=function(){};m=1}i[k]=f[k];n.extend(i[k].prototype,f);if(o[5]){g=n.resolve(o[5]).prototype;l=o[5].match(/\.(\w+)$/i)[1];h=i[k];if(m){i[k]=function(){return g[l].apply(this,arguments)}}else{i[k]=function(){this.parent=g[l];return h.apply(this,arguments)}}i[k].prototype[k]=i[k];n.each(g,function(p,q){i[k].prototype[q]=g[q]});n.each(f,function(p,q){if(g[q]){i[k].prototype[q]=function(){this.parent=g[q];return p.apply(this,arguments)}}else{if(q!=k){i[k].prototype[q]=p}}})}n.each(f["static"],function(p,q){i[k][q]=p});if(this.onCreate){this.onCreate(o[2],o[3],i[k].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}c.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}c.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this,g;g=function(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(e.detachEvent){e.detachEvent("onbeforeunload",k);e.detachEvent("onunload",g)}else{if(e.removeEventListener){e.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(e.CollectGarbage){CollectGarbage()}}};function k(){var l=document;function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l.readyState=="interactive"){if(l){l.attachEvent("onstop",f)}e.setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}j={func:j,scope:i||this};if(!h.unloads){if(e.attachEvent){e.attachEvent("onunload",g);e.attachEvent("onbeforeunload",k)}else{if(e.addEventListener){e.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;c.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){if(!f||c.is(f,"array")){return f}return c.map(f.split(g||","),c.trim)},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(d){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===b){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};c._init();e.tinymce=e.tinyMCE=c})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,inDispatch:false,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(b,a){this.listeners.push({cb:b,scope:a||this.scope});return b},addToTop:function(d,b){var a=this,c={cb:d,scope:b||a.scope};if(a.inDispatch){a.listeners=[c].concat(a.listeners)}else{a.listeners.unshift(c)}return d},remove:function(c){var b=this.listeners,a=null;tinymce.each(b,function(e,d){if(c==e.cb){a=e;b.splice(d,1);return false}});return a},dispatch:function(){var a=this,e,b=arguments,c,d=a.listeners,f;a.inDispatch=true;for(c=0;c<d.length;c++){f=d[c];e=f.cb.apply(f.scope,b.length>0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(c,e,d){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,e,d)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&Object.prototype.toString.call(o)==="[object Array]"){for(i=0,v="[";i<o.length;i++){v+=(i>0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey},metaKeyPressed:function(b){return a.isMac?b.metaKey:b.ctrlKey&&!b.altKey}}})(tinymce);tinymce.util.Quirks=function(a){var j=tinymce.VK,f=j.BACKSPACE,k=j.DELETE,e=a.dom,l=a.selection,H=a.settings,v=a.parser,o=a.serializer,E=tinymce.each;function A(N,M){try{a.getDoc().execCommand(N,false,M)}catch(L){}}function n(){var L=a.getDoc().documentMode;return L?L:6}function z(L){return L.isDefaultPrevented()}function J(){function L(O){var M,Q,N,P;M=l.getRng();Q=e.getParent(M.startContainer,e.isBlock);if(O){Q=e.getNext(Q,e.isBlock)}if(Q){N=Q.firstChild;while(N&&N.nodeType==3&&N.nodeValue.length===0){N=N.nextSibling}if(N&&N.nodeName==="SPAN"){P=N.cloneNode(false)}}E(e.select("span",Q),function(R){R.setAttribute("data-mce-mark","1")});a.getDoc().execCommand(O?"ForwardDelete":"Delete",false,null);Q=e.getParent(M.startContainer,e.isBlock);E(e.select("span",Q),function(R){var S=l.getBookmark();if(P){e.replace(P.cloneNode(false),R,true)}else{if(!R.getAttribute("data-mce-mark")){e.remove(R,true)}else{R.removeAttribute("data-mce-mark")}}l.moveToBookmark(S)})}a.onKeyDown.add(function(M,O){var N;N=O.keyCode==k;if(!z(O)&&(N||O.keyCode==f)&&!j.modifierPressed(O)){O.preventDefault();L(N)}});a.addCommand("Delete",function(){L()})}function q(){function L(O){var N=e.create("body");var P=O.cloneContents();N.appendChild(P);return l.serializer.serialize(N,{format:"html"})}function M(N){var P=L(N);var Q=e.createRng();Q.selectNode(a.getBody());var O=L(Q);return P===O}a.onKeyDown.add(function(O,Q){var P=Q.keyCode,N;if(!z(Q)&&(P==k||P==f)){N=O.selection.isCollapsed();if(N&&!e.isEmpty(O.getBody())){return}if(tinymce.isIE&&!N){return}if(!N&&!M(O.selection.getRng())){return}O.setContent("");O.selection.setCursorLocation(O.getBody(),0);O.nodeChanged()}})}function I(){a.onKeyDown.add(function(L,M){if(!z(M)&&M.keyCode==65&&j.metaKeyPressed(M)){M.preventDefault();L.execCommand("SelectAll")}})}function K(){if(!a.settings.content_editable){e.bind(a.getDoc(),"focusin",function(L){l.setRng(l.getRng())});e.bind(a.getDoc(),"mousedown",function(L){if(L.target==a.getDoc().documentElement){a.getWin().focus();l.setRng(l.getRng())}})}}function B(){a.onKeyDown.add(function(L,O){if(!z(O)&&O.keyCode===f){if(l.isCollapsed()&&l.getRng(true).startOffset===0){var N=l.getNode();var M=N.previousSibling;if(M&&M.nodeName&&M.nodeName.toLowerCase()==="hr"){e.remove(M);tinymce.dom.Event.cancel(O)}}}})}function y(){if(!Range.prototype.getClientRects){a.onMouseDown.add(function(M,N){if(!z(N)&&N.target.nodeName==="HTML"){var L=M.getBody();L.blur();setTimeout(function(){L.focus()},0)}})}}function h(){a.onClick.add(function(L,M){M=M.target;if(/^(IMG|HR)$/.test(M.nodeName)){l.getSel().setBaseAndExtent(M,0,M,1)}if(M.nodeName=="A"&&e.hasClass(M,"mceItemAnchor")){l.select(M)}L.nodeChanged()})}function c(){function M(){var O=e.getAttribs(l.getStart().cloneNode(false));return function(){var P=l.getStart();if(P!==a.getBody()){e.setAttrib(P,"style",null);E(O,function(Q){P.setAttributeNode(Q.cloneNode(true))})}}}function L(){return !l.isCollapsed()&&e.getParent(l.getStart(),e.isBlock)!=e.getParent(l.getEnd(),e.isBlock)}function N(O,P){P.preventDefault();return false}a.onKeyPress.add(function(O,Q){var P;if(!z(Q)&&(Q.keyCode==8||Q.keyCode==46)&&L()){P=M();O.getDoc().execCommand("delete",false,null);P();Q.preventDefault();return false}});e.bind(a.getDoc(),"cut",function(P){var O;if(!z(P)&&L()){O=M();a.onKeyUp.addToTop(N);setTimeout(function(){O();a.onKeyUp.remove(N)},0)}})}function b(){var M,L;e.bind(a.getDoc(),"selectionchange",function(){if(L){clearTimeout(L);L=0}L=window.setTimeout(function(){var N=l.getRng();if(!M||!tinymce.dom.RangeUtils.compareRanges(N,M)){a.nodeChanged();M=N}},50)})}function x(){document.body.setAttribute("role","application")}function t(){a.onKeyDown.add(function(L,N){if(!z(N)&&N.keyCode===f){if(l.isCollapsed()&&l.getRng(true).startOffset===0){var M=l.getNode().previousSibling;if(M&&M.nodeName&&M.nodeName.toLowerCase()==="table"){return tinymce.dom.Event.cancel(N)}}}})}function C(){if(n()>7){return}A("RespectVisibilityInDesign",true);a.contentStyles.push(".mceHideBrInPre pre br {display: none}");e.addClass(a.getBody(),"mceHideBrInPre");v.addNodeFilter("pre",function(L,N){var O=L.length,Q,M,R,P;while(O--){Q=L[O].getAll("br");M=Q.length;while(M--){R=Q[M];P=R.prev;if(P&&P.type===3&&P.value.charAt(P.value-1)!="\n"){P.value+="\n"}else{R.parent.insert(new tinymce.html.Node("#text",3),R,true).value="\n"}}}});o.addNodeFilter("pre",function(L,N){var O=L.length,Q,M,R,P;while(O--){Q=L[O].getAll("br");M=Q.length;while(M--){R=Q[M];P=R.prev;if(P&&P.type==3){P.value=P.value.replace(/\r?\n$/,"")}}}})}function g(){e.bind(a.getBody(),"mouseup",function(N){var M,L=l.getNode();if(L.nodeName=="IMG"){if(M=e.getStyle(L,"width")){e.setAttrib(L,"width",M.replace(/[^0-9%]+/g,""));e.setStyle(L,"width","")}if(M=e.getStyle(L,"height")){e.setAttrib(L,"height",M.replace(/[^0-9%]+/g,""));e.setStyle(L,"height","")}}})}function d(){a.onKeyDown.add(function(R,S){var Q,L,M,O,P,T,N;Q=S.keyCode==k;if(!z(S)&&(Q||S.keyCode==f)&&!j.modifierPressed(S)){L=l.getRng();M=L.startContainer;O=L.startOffset;N=L.collapsed;if(M.nodeType==3&&M.nodeValue.length>0&&((O===0&&!N)||(N&&O===(Q?0:1)))){nonEmptyElements=R.schema.getNonEmptyElements();S.preventDefault();P=e.create("br",{id:"__tmp"});M.parentNode.insertBefore(P,M);R.getDoc().execCommand(Q?"ForwardDelete":"Delete",false,null);M=l.getRng().startContainer;T=M.previousSibling;if(T&&T.nodeType==1&&!e.isBlock(T)&&e.isEmpty(T)&&!nonEmptyElements[T.nodeName.toLowerCase()]){e.remove(T)}e.remove("__tmp")}}})}function G(){a.onKeyDown.add(function(P,Q){var N,M,R,L,O;if(z(Q)||Q.keyCode!=j.BACKSPACE){return}N=l.getRng();M=N.startContainer;R=N.startOffset;L=e.getRoot();O=M;if(!N.collapsed||R!==0){return}while(O&&O.parentNode&&O.parentNode.firstChild==O&&O.parentNode!=L){O=O.parentNode}if(O.tagName==="BLOCKQUOTE"){P.formatter.toggle("blockquote",null,O);N=e.createRng();N.setStart(M,0);N.setEnd(M,0);l.setRng(N)}})}function F(){function L(){a._refreshContentEditable();A("StyleWithCSS",false);A("enableInlineTableEditing",false);if(!H.object_resizing){A("enableObjectResizing",false)}}if(!H.readonly){a.onBeforeExecCommand.add(L);a.onMouseDown.add(L)}}function s(){function L(M,N){E(e.select("a"),function(Q){var O=Q.parentNode,P=e.getRoot();if(O.lastChild===Q){while(O&&!e.isBlock(O)){if(O.parentNode.lastChild!==O||O===P){return}O=O.parentNode}e.add(O,"br",{"data-mce-bogus":1})}})}a.onExecCommand.add(function(M,N){if(N==="CreateLink"){L(M)}});a.onSetContent.add(l.onSetContent.add(L))}function m(){if(H.forced_root_block){a.onInit.add(function(){A("DefaultParagraphSeparator",H.forced_root_block)})}}function p(){function L(N,M){if(!N||!M.initial){a.execCommand("mceRepaint")}}a.onUndo.add(L);a.onRedo.add(L);a.onSetContent.add(L)}function i(){a.onKeyDown.add(function(M,N){var L;if(!z(N)&&N.keyCode==f){L=M.getDoc().selection.createRange();if(L&&L.item){N.preventDefault();M.undoManager.beforeChange();e.remove(L.item(0));M.undoManager.add()}}})}function r(){var L;if(n()>=10){L="";E("p div h1 h2 h3 h4 h5 h6".split(" "),function(M,N){L+=(N>0?",":"")+M+":empty"});a.contentStyles.push(L+"{padding-right: 1px !important}")}}function u(){var N,M,ad,L,Y,ab,Z,ac,O,P,aa,W,V,X=document,T=a.getDoc();if(!H.object_resizing||H.webkit_fake_resize===false){return}A("enableObjectResizing",false);aa={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,0.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};function R(ah){var ag,af;ag=ah.screenX-ab;af=ah.screenY-Z;W=ag*Y[2]+ac;V=af*Y[3]+O;W=W<5?5:W;V=V<5?5:V;if(j.modifierPressed(ah)||(ad.nodeName=="IMG"&&Y[2]*Y[3]!==0)){W=Math.round(V/P);V=Math.round(W*P)}e.setStyles(L,{width:W,height:V});if(Y[2]<0&&L.clientWidth<=W){e.setStyle(L,"left",N+(ac-W))}if(Y[3]<0&&L.clientHeight<=V){e.setStyle(L,"top",M+(O-V))}}function ae(){function af(ag,ah){if(ah){if(ad.style[ag]||!a.schema.isValid(ad.nodeName.toLowerCase(),ag)){e.setStyle(ad,ag,ah)}else{e.setAttrib(ad,ag,ah)}}}af("width",W);af("height",V);e.unbind(T,"mousemove",R);e.unbind(T,"mouseup",ae);if(X!=T){e.unbind(X,"mousemove",R);e.unbind(X,"mouseup",ae)}e.remove(L);Q(ad)}function Q(ai){var ag,ah,af;S();ag=e.getPos(ai);N=ag.x;M=ag.y;ah=ai.offsetWidth;af=ai.offsetHeight;if(ad!=ai){ad=ai;W=V=0}E(aa,function(al,aj){var ak;ak=e.get("mceResizeHandle"+aj);if(!ak){ak=e.add(T.documentElement,"div",{id:"mceResizeHandle"+aj,"class":"mceResizeHandle",style:"cursor:"+aj+"-resize; margin:0; padding:0"});e.bind(ak,"mousedown",function(am){am.preventDefault();ae();ab=am.screenX;Z=am.screenY;ac=ad.clientWidth;O=ad.clientHeight;P=O/ac;Y=al;L=ad.cloneNode(true);e.addClass(L,"mceClonedResizable");e.setStyles(L,{left:N,top:M,margin:0});T.documentElement.appendChild(L);e.bind(T,"mousemove",R);e.bind(T,"mouseup",ae);if(X!=T){e.bind(X,"mousemove",R);e.bind(X,"mouseup",ae)}})}else{e.show(ak)}e.setStyles(ak,{left:(ah*al[0]+N)-(ak.offsetWidth/2),top:(af*al[1]+M)-(ak.offsetHeight/2)})});if(!tinymce.isOpera&&ad.nodeName=="IMG"){ad.setAttribute("data-mce-selected","1")}}function S(){if(ad){ad.removeAttribute("data-mce-selected")}for(var af in aa){e.hide("mceResizeHandle"+af)}}a.contentStyles.push(".mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}.mceResizeHandle:hover {background: #000}img[data-mce-selected] {outline: 1px solid black}img.mceClonedResizable, table.mceClonedResizable {position: absolute;outline: 1px dashed black;opacity: .5;z-index: 10000}");function U(){var af=e.getParent(l.getNode(),"table,img");E(e.select("img[data-mce-selected]"),function(ag){ag.removeAttribute("data-mce-selected")});if(af){Q(af)}else{S()}}a.onNodeChange.add(U);e.bind(T,"selectionchange",U);a.serializer.addAttributeFilter("data-mce-selected",function(af,ag){var ah=af.length;while(ah--){af[ah].attr(ag,null)}})}function D(){if(n()<9){v.addNodeFilter("noscript",function(L){var M=L.length,N,O;while(M--){N=L[M];O=N.firstChild;if(O){N.attr("data-mce-innertext",O.value)}}});o.addNodeFilter("noscript",function(L){var M=L.length,N,P,O;while(M--){N=L[M];P=L[M].firstChild;if(P){P.value=tinymce.html.Entities.decode(P.value)}else{O=N.attributes.map["data-mce-innertext"];if(O){N.attr("data-mce-innertext",null);P=new tinymce.html.Node("#text",3);P.value=O;P.raw=true;N.append(P)}}}})}}t();G();q();if(tinymce.isWebKit){d();J();K();h();m();if(tinymce.isIDevice){b()}else{u();I()}}if(tinymce.isIE){B();x();C();g();i();r();D()}if(tinymce.isGecko){B();y();c();F();s();p()}if(tinymce.isOpera){u()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n<m.length;n+=2){o=String.fromCharCode(parseInt(m[n],p));if(!g[o]){l="&"+m[n+1]+";";q[o]=l;q[l]=o}}return q}}a=e("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);j.html=j.html||{};j.html.Entities={encodeRaw:function(m,l){return m.replace(l?k:b,function(n){return g[n]||n})},encodeAllRaw:function(l){return(""+l).replace(f,function(m){return g[m]||m})},encodeNumeric:function(m,l){return m.replace(l?k:b,function(n){if(n.length>1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g<j.length;g++){a[j[g]]="\uFEFF"+g;a["\uFEFF"+g]=j[g]}function c(n,q,p,i){function o(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u<s;u++){t=x[u];v=p[t];if(v!==e&&v.length>0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|border][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]wbr[A][]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script noscript style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);textBlockElementsMap=m("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure");v=m("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",textBlockElementsMap);function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K<G;K++){F=N.exec(L[K]);if(F){W=F[1];Q=F[2];E=F[3];X=F[4];O={};J=[];I={attributes:O,attributesOrder:J};if(W==="#"){I.paddEmpty=true}if(W==="-"){I.removeEmpty=true}if(S){for(ad in S){O[ad]=S[ad]}J.push.apply(J,H)}if(X){X=d(X,"|");for(Z=0,V=X.length;Z<V;Z++){F=R.exec(X[Z]);if(F){U={};ac=F[1];Y=F[2].replace(/::/g,":");W=F[3];T=F[4];if(ac==="!"){I.attributesRequired=I.attributesRequired||[];I.attributesRequired.push(Y);U.required=true}if(ac==="-"){delete O[Y];J.splice(f.inArray(J,Y),1);continue}if(W){if(W==="="){I.attributesDefault=I.attributesDefault||[];I.attributesDefault.push({name:Y,value:T});U.defaultValue=T}if(W===":"){I.attributesForced=I.attributesForced||[];I.attributesForced.push({name:Y,value:T});U.forcedValue=T}if(W==="<"){U.validValues=e(T,"?")}}if(M.test(Y)){I.attributePatterns=I.attributePatterns||[];U.pattern=i(Y);I.attributePatterns.push(U)}else{if(!O[Y]){J.push(Y)}O[Y]=U}}}}if(!S&&Q=="@"){S=O;H=J}if(E){I.outputName=Q;s[E]=I}if(M.test(Q)){I.pattern=i(Q);j.push(I)}else{s[Q]=I}}}}}function t(E){s={};j=[];C(E);g(y,function(G,F){k[F]=G.children})}function l(F){var E=/^(~)?(.+)$/;if(F){g(d(F),function(J){var H=E.exec(J),I=H[1]==="~",K=I?"span":"div",G=H[2];k[G]=k[K];p[G]=K;if(!I){v[G.toUpperCase()]={};v[G]={}}if(!s[G]){s[G]=s[K]}g(k,function(L,M){if(L[K]){L[G]=L[K]}})})}}function x(F){var E=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(F){g(d(F),function(J){var I=E.exec(J),G,H;if(I){H=I[1];if(H){G=k[I[2]]}else{G=k[I[2]]={"#comment":{}}}G=k[I[2]];g(d(I[3],"|"),function(K){if(H==="-"){delete G[K]}else{G[K]={}}})}})}}function B(E){var G=s[E],F;if(G){return G}F=j.length;while(F--){G=j[F];if(G.pattern.test(E)){return G}}}if(!A.valid_elements){g(y,function(F,E){s[E]={attributes:F.attributes,attributesOrder:F.attributesOrder};k[E]=F.children});if(A.schema!="html5"){g(d("strong/b,em/i"),function(E){E=d(E,"/");s[E[1]].outputName=E[0]})}s.img.attributesDefault=[{name:"alt",value:""}];g(d("ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr,strong,em,b,i"),function(E){if(s[E]){s[E].removeEmpty=true}});g(d("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(E){s[E].paddEmpty=true})}else{t(A.valid_elements)}l(A.custom_elements);x(A.valid_children);C(A.extended_valid_elements);x("+ol[ul|ol],+ul[ul|ol]");if(A.invalid_elements){f.each(f.explode(A.invalid_elements),function(E){if(s[E]){delete s[E]}})}if(!B("span")){C("span[!data-mce-type|*]")}u.children=k;u.styles=D;u.getBoolAttrs=function(){return r};u.getBlockElements=function(){return v};u.getTextBlockElements=function(){return textBlockElementsMap};u.getShortEndedElements=function(){return z};u.getSelfClosingElements=function(){return q};u.getNonEmptyElements=function(){return n};u.getWhiteSpaceElements=function(){return o};u.isValidChild=function(E,G){var F=k[E];return !!(F&&F[G])};u.isValid=function(F,E){var H,G,I=B(F);if(I){if(E){if(I.attributes[E]){return true}H=I.attributePatterns;if(H){G=H.length;while(G--){if(H[G].pattern.test(F)){return true}}}}else{return true}}return false};u.getElementRule=B;u.getCustomElements=function(){return p};u.addValidElements=C;u.setValidElements=t;u.addCustomElements=l;u.addValidChildren=x;u.elements=s}})(tinymce);(function(a){a.html.SaxParser=function(c,e){var b=this,d=function(){};c=c||{};b.schema=e=e||new a.html.Schema();if(c.fix_self_closing!==false){c.fix_self_closing=true}a.each("comment cdata text start end pi doctype".split(" "),function(f){if(f){b[f]=c[f]||d}});b.parse=function(E){var n=this,g,G=0,I,B,A=[],N,Q,C,r,z,s,M,H,O,v,m,k,t,R,o,P,F,S,L,f,J,l,D,K,h,x=0,j=a.html.Entities.decode,y,q;function u(T){var V,U;V=A.length;while(V--){if(A[V].name===T){break}}if(V>=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G<g.index){n.text(j(E.substr(G,g.index-G)))}if(I=g[6]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}u(I)}else{if(I=g[7]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}O=I in M;if(y&&J[I]&&A.length>0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G<E.length){n.text(j(E.substr(G)))}for(Q=A.length-1;Q>=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h<f;h++){j=m[h];if(j.name!=="id"){k[k.length]={name:j.name,value:j.value};k.map[j.name]=j.value}}n.attributes=k}n.value=g.value;n.shortEnded=g.shortEnded;return n},wrap:function(g){var f=this;f.parent.insert(g,f);g.append(f);return f},unwrap:function(){var f=this,h,g;for(h=f.firstChild;h;){g=h.next;f.insert(h,f,true);h=g}f.remove()},remove:function(){var f=this,h=f.parent,g=f.next,i=f.prev;if(h){if(h.firstChild===f){h.firstChild=g;if(g){g.prev=null}}else{i.next=g}if(h.lastChild===f){h.lastChild=i;if(i){i.next=null}}else{g.prev=i}f.parent=f.next=f.prev=null}return f},append:function(h){var f=this,g;if(h.parent){h.remove()}g=f.lastChild;if(g){g.next=h;h.prev=g;f.lastChild=h}else{f.lastChild=f.firstChild=h}h.parent=f;return h},insert:function(h,f,i){var g;if(h.parent){h.remove()}g=f.parent||this;if(i){if(f===g.firstChild){g.firstChild=h}else{f.prev.next=h}h.prev=f.prev;h.next=f;f.prev=h}else{if(f===g.lastChild){g.lastChild=h}else{f.next.prev=h}h.next=f.next;h.prev=f;f.next=h}h.parent=g;return h},getAll:function(g){var f=this,h,i=[];for(h=f.firstChild;h;h=a(h,f)){if(h.name===g){i.push(h)}}return i},empty:function(){var g=this,f,h,j;if(g.firstChild){f=[];for(j=g.firstChild;j;j=a(j,g)){f.push(j)}h=f.length;while(h--){j=f[h];j.parent=j.firstChild=j.lastChild=j.next=j.prev=null}}g.firstChild=g.lastChild=null;return g},isEmpty:function(k){var f=this,j=f.firstChild,h,g;if(j){do{if(j.type===1){if(j.attributes.map["data-mce-bogus"]){continue}if(k[j.name]){return false}h=j.attributes.length;while(h--){g=j.attributes[h].name;if(g==="name"||g.indexOf("data-mce-")===0){return false}}}if(j.type===8){return false}if((j.type===3&&!c.test(j.value))){return false}}while(j=a(j,f))}return true},walk:function(f){return a(this,null,f)}});d.extend(b,{create:function(g,f){var i,h;i=new b(g,e[g]||1);if(f){for(h in f){i.attr(h,f[h])}}return i}});d.html.Node=b})(tinymce);(function(b){var a=b.html.Node;b.html.DomParser=function(g,h){var f=this,e={},d=[],i={},c={};g=g||{};g.validate="validate" in g?g.validate:true;g.root_name=g.root_name||"body";f.schema=h=h||new b.html.Schema();function j(n){var p,q,y,x,A,o,r,l,u,v,k,t,m,z,s;t=b.makeMap("tr,td,th,tbody,thead,tfoot,table");k=h.getNonEmptyElements();m=h.getTextBlockElements();for(p=0;p<n.length;p++){q=n[p];if(!q.parent||q.fixed){continue}if(m[q.name]&&q.parent.name=="li"){z=q.next;while(z){if(m[z.name]){z.name="li";z.fixed=true;q.parent.insert(z,q.parent)}else{break}z=z.next}q.unwrap(q);continue}x=[q];for(y=q.parent;y&&!h.isValidChild(y.name,q.name)&&!t[y.name];y=y.parent){x.push(y)}if(y&&x.length>1){x.reverse();A=o=f.filterNode(x[0].clone());for(u=0;u<x.length-1;u++){if(h.isValidChild(o.name,x[u].name)){r=f.filterNode(x[u].clone());o.append(r)}else{r=o}for(l=x[u].firstChild;l&&l!=x[u+1];){s=l.next;r.append(l);l=s}o=r}if(!A.isEmpty(k)){y.insert(A,x[0],true);y.insert(q,A)}else{y.insert(q,x[0],true)}y=x[0];if(y.isEmpty(k)||y.firstChild===y.lastChild&&y.firstChild.name==="br"){y.empty().remove()}}else{if(q.parent){if(q.name==="li"){z=q.prev;if(z&&(z.name==="ul"||z.name==="ul")){z.append(q);continue}z=q.next;if(z&&(z.name==="ul"||z.name==="ul")){z.insert(q,z.firstChild,true);continue}q.wrap(f.filterNode(new a("ul",1)));continue}if(h.isValidChild(q.parent.name,"div")&&h.isValidChild("div",q.name)){q.wrap(f.filterNode(new a("div",1)))}else{if(q.name==="style"||q.name==="script"){q.empty().remove()}else{q.unwrap()}}}}}}f.filterNode=function(m){var l,k,n;if(k in e){n=i[k];if(n){n.push(m)}else{i[k]=[m]}}l=d.length;while(l--){k=d[l].name;if(k in m.attributes.map){n=c[k];if(n){n.push(m)}else{c[k]=[m]}}}return m};f.addNodeFilter=function(k,l){b.each(b.explode(k),function(m){var n=e[m];if(!n){e[m]=n=[]}n.push(l)})};f.addAttributeFilter=function(k,l){b.each(b.explode(k),function(m){var n;for(n=0;n<d.length;n++){if(d[n].name===m){d[n].callbacks.push(l);return}}d.push({name:m,callbacks:[l]})})};f.parse=function(v,m){var n,J,B,A,D,C,x,r,F,N,z,o,E,M=[],L,t,k,y,s,p,u,q;m=m||{};i={};c={};o=b.extend(b.makeMap("script,style,head,html,body,title,meta,param"),h.getBlockElements());u=h.getNonEmptyElements();p=h.children;z=g.validate;q="forced_root_block" in m?m.forced_root_block:g.forced_root_block;s=h.getWhiteSpaceElements();E=/^[ \t\r\n]+/;t=/[ \t\r\n]+$/;k=/[ \t\r\n]+/g;y=/^[ \t\r\n]+$/;function G(){var O=J.firstChild,l,P;while(O){l=O.next;if(O.type==3||(O.type==1&&O.name!=="p"&&!o[O.name]&&!O.attr("data-mce-type"))){if(!P){P=K(q,1);J.insert(P,O);P.append(O)}else{P.append(O)}}else{P=null}O=l}}function K(l,O){var P=new a(l,O),Q;if(l in e){Q=i[l];if(Q){Q.push(P)}else{i[l]=[P]}}return P}function I(P){var Q,l,O;for(Q=P.prev;Q&&Q.type===3;){l=Q.value.replace(t,"");if(l.length>0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},pi:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D<C;D++){F[D](A,N,m)}}for(D=0,C=d.length;D<C;D++){F=d[D];if(F.name in c){A=c[F.name];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(x=0,r=F.callbacks.length;x<r;x++){F.callbacks[x](A,F.name,m)}}}}return J};if(g.remove_trailing_brs){f.addNodeFilter("br",function(n,m){var r,q=n.length,o,v=b.extend({},h.getBlockElements()),k=h.getNonEmptyElements(),t,s,p,u;v.body=1;for(r=0;r<q;r++){o=n[r];t=o.parent;if(v[o.parent.name]&&o===t.lastChild){p=o.prev;while(p){u=p.name;if(u!=="span"||p.attr("data-mce-type")!=="bookmark"){if(u!=="br"){break}if(u==="br"){o=null;break}}p=p.prev}if(o){o.remove();if(t.isEmpty(k)){elementRule=h.getElementRule(t.name);if(elementRule){if(elementRule.removeEmpty){t.remove()}else{if(elementRule.paddEmpty){t.empty().append(new b.html.Node("#text",3)).value="\u00a0"}}}}}}else{s=o;while(t.firstChild===s&&t.lastChild===s){s=t;if(v[t.name]){break}t=t.parent}if(s===t){textNode=new b.html.Node("#text",3);textNode.value="\u00a0";o.replace(textNode)}}}})}if(!g.allow_html_in_named_anchor){f.addAttributeFilter("id,name",function(k,l){var n=k.length,p,m,o,q;while(n--){q=k[n];if(q.name==="a"&&q.firstChild&&!q.attr("href")){o=q.parent;p=q.lastChild;do{m=p.prev;o.insert(p,q);p=m}while(p)}}})}}})(tinymce);tinymce.html.Writer=function(e){var c=[],a,b,d,f,g;e=e||{};a=e.indent;b=tinymce.makeMap(e.indent_before||"");d=tinymce.makeMap(e.indent_after||"");f=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities);g=e.element_format=="html";return{start:function(m,k,p){var n,j,h,o;if(a&&b[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n<j;n++){h=k[n];c.push(" ",h.name,'="',f(h.value,true),'"')}}if(!p||g){c[c.length]=">"}else{c[c.length]=" />"}if(p&&a&&d[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("</",h,">");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("<![CDATA[",h,"]]>")},comment:function(h){c.push("<!--",h,"-->")},pi:function(h,i){if(i){c.push("<?",h," ",i,"?>")}else{c.push("<?",h,"?>")}if(a){c.push("\n")}},doctype:function(h){c.push("<!DOCTYPE",h,">",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n<m;n++){r=q.attributesOrder[n];if(r in s.map){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}for(n=0,m=s.length;n<m;n++){r=s[n].name;if(!(r in u.map)){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}s=u}e.start(k.name,s,o);if(!o){if((k=k.firstChild)){do{f(k)}while(k=k.next)}e.end(j)}}else{t(k)}}if(h.type==1&&!c.inner){f(h)}else{g[11](h)}return e.getContent()}}})(tinymce);tinymce.dom={};(function(b,h){var g=!!document.addEventListener;function c(k,j,l,i){if(k.addEventListener){k.addEventListener(j,l,i||false)}else{if(k.attachEvent){k.attachEvent("on"+j,l)}}}function e(k,j,l,i){if(k.removeEventListener){k.removeEventListener(j,l,i||false)}else{if(k.detachEvent){k.detachEvent("on"+j,l)}}}function a(n,l){var i,k=l||{};function j(){return false}function m(){return true}for(i in n){if(i!=="layerX"&&i!=="layerY"){k[i]=n[i]}}if(!k.target){k.target=k.srcElement||document}k.preventDefault=function(){k.isDefaultPrevented=m;if(n){if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}}};k.stopPropagation=function(){k.isPropagationStopped=m;if(n){if(n.stopPropagation){n.stopPropagation()}else{n.cancelBubble=true}}};k.stopImmediatePropagation=function(){k.isImmediatePropagationStopped=m;k.stopPropagation()};if(!k.isDefaultPrevented){k.isDefaultPrevented=j;k.isPropagationStopped=j;k.isImmediatePropagationStopped=j}return k}function d(m,n,l){var k=m.document,j={type:"ready"};function i(){if(!l.domLoaded){l.domLoaded=true;n(j)}}if(k.readyState=="complete"){i();return}if(g){c(m,"DOMContentLoaded",i)}else{c(k,"readystatechange",function(){if(k.readyState==="complete"){e(k,"readystatechange",arguments.callee);i()}});if(k.documentElement.doScroll&&m===m.top){(function(){try{k.documentElement.doScroll("left")}catch(o){setTimeout(arguments.callee,0);return}i()})()}}c(m,"load",i)}function f(k){var q=this,p={},i,o,n,m,l;m="onmouseenter" in document.documentElement;n="onfocusin" in document.documentElement;l={mouseenter:"mouseover",mouseleave:"mouseout"};i=1;q.domLoaded=false;q.events=p;function j(t,x){var s,u,r,v;s=p[x][t.type];if(s){for(u=0,r=s.length;u<r;u++){v=s[u];if(v&&v.func.call(v.scope,t)===false){t.preventDefault()}if(t.isImmediatePropagationStopped()){return}}}}q.bind=function(x,A,D,E){var s,t,u,r,B,z,C,v=window;function y(F){j(a(F||v.event),s)}if(!x||x.nodeType===3||x.nodeType===8){return}if(!x[h]){s=i++;x[h]=s;p[s]={}}else{s=x[h];if(!p[s]){p[s]={}}}E=E||x;A=A.split(" ");u=A.length;while(u--){r=A[u];z=y;B=C=false;if(r==="DOMContentLoaded"){r="ready"}if((q.domLoaded||x.readyState=="complete")&&r==="ready"){q.domLoaded=true;D.call(E,a({type:r}));continue}if(!m){B=l[r];if(B){z=function(F){var H,G;H=F.currentTarget;G=F.relatedTarget;if(G&&H.contains){G=H.contains(G)}else{while(G&&G!==H){G=G.parentNode}}if(!G){F=a(F||v.event);F.type=F.type==="mouseout"?"mouseleave":"mouseenter";F.target=H;j(F,s)}}}}if(!n&&(r==="focusin"||r==="focusout")){C=true;B=r==="focusin"?"focus":"blur";z=function(F){F=a(F||v.event);F.type=F.type==="focus"?"focusin":"focusout";j(F,s)}}t=p[s][r];if(!t){p[s][r]=t=[{func:D,scope:E}];t.fakeName=B;t.capture=C;t.nativeHandler=z;if(!g){t.proxyHandler=k(s)}if(r==="ready"){d(x,z,q)}else{c(x,B||r,g?z:t.proxyHandler,C)}}else{t.push({func:D,scope:E})}}x=t=0;return D};q.unbind=function(x,z,A){var s,u,v,B,r,t;if(!x||x.nodeType===3||x.nodeType===8){return q}s=x[h];if(s){t=p[s];if(z){z=z.split(" ");v=z.length;while(v--){r=z[v];u=t[r];if(u){if(A){B=u.length;while(B--){if(u[B].func===A){u.splice(B,1)}}}if(!A||u.length===0){delete t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}}}}else{for(r in t){u=t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}t={}}for(r in t){return q}delete p[s];try{delete x[h]}catch(y){x[h]=null}}return q};q.fire=function(u,s,r){var v,t;if(!u||u.nodeType===3||u.nodeType===8){return q}t=a(null,r);t.type=s;do{v=u[h];if(v){j(t,v)}u=u.parentNode||u.ownerDocument||u.defaultView||u.parentWindow}while(u&&!t.isPropagationStopped());return q};q.clean=function(u){var s,r,t=q.unbind;if(!u||u.nodeType===3||u.nodeType===8){return q}if(u[h]){t(u)}if(!u.getElementsByTagName){u=u.document}if(u&&u.getElementsByTagName){t(u);r=u.getElementsByTagName("*");s=r.length;while(s--){u=r[s];if(u[h]){t(u)}}}return q};q.callNativeHandler=function(s,r){if(p){p[s][r.type].nativeHandler(r)}};q.destory=function(){p={}};q.add=function(v,s,u,t){if(typeof(v)==="string"){v=document.getElementById(v)}if(v&&v instanceof Array){var r=v.length;while(r--){q.add(v[r],s,u,t)}return}if(s==="init"){s="ready"}return q.bind(v,s instanceof Array?s.join(" "):s,u,t)};q.remove=function(v,s,u,t){if(!v){return q}if(typeof(v)==="string"){v=document.getElementById(v)}if(v instanceof Array){var r=v.length;while(r--){q.remove(v[r],s,u,t)}return q}return q.unbind(v,s instanceof Array?s.join(" "):s,u)};q.clear=function(r){if(typeof(r)==="string"){r=document.getElementById(r)}return q.clean(r)};q.cancel=function(r){if(r){q.prevent(r);q.stop(r)}return false};q.prevent=function(r){if(!r.preventDefault){r=a(r)}r.preventDefault();return false};q.stop=function(r){if(!r.stopPropagation){r=a(r)}r.stopPropagation();return false}}b.EventUtils=f;b.Event=new f(function(i){return function(j){tinymce.dom.Event.callNativeHandler(i,j)}});b.Event.bind(window,"ready",function(){});b=0})(tinymce.dom,"data-mce-expando");tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(e){var g=e.each,d=e.is,f=e.isWebKit,b=e.isIE,h=e.html.Entities,c=/^([a-z0-9],?)+$/i,a=/^[ \t\r\n]*$/;e.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(o,l){var k=this,i,j,n;k.doc=o;k.win=window;k.files={};k.cssFlicker=false;k.counter=0;k.stdMode=!e.isIE||o.documentMode>=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){if(!q){return false}var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+"</"+q+">"}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},addStyle:function(j){var k=this.doc,i;styleElm=k.getElementById("mceDefaultStyles");if(!styleElm){styleElm=k.createElement("style"),styleElm.id="mceDefaultStyles";styleElm.type="text/css";i=k.getElementsByTagName("head")[0];if(i.firstChild){i.insertBefore(styleElm,i.firstChild)}else{i.appendChild(styleElm)}}if(styleElm.styleSheet){styleElm.styleSheet.cssText+=j}else{styleElm.appendChild(k.createTextNode(j))}},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="<br />"+j;m.removeChild(m.firstChild)}catch(l){var n=i.create("div");n.innerHTML="<br />"+j;g(e.grep(n.childNodes),function(p,o){if(o&&m.canHaveHTML){m.appendChild(p)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab<aa){return -1}return 1}ac=X;while(ac&&ac.parentNode!=Z){ac=ac.parentNode}if(ac){Y=0;t=Z.firstChild;while(t!=ac&&Y<ab){Y++;t=t.nextSibling}if(ab<=Y){return -1}return 1}ac=Z;while(ac&&ac.parentNode!=X){ac=ac.parentNode}if(ac){Y=0;t=X.firstChild;while(t!=ac&&Y<aa){Y++;t=t.nextSibling}if(Y<aa){return -1}return 1}ad=c.findCommonAncestor(Z,X);af=Z;while(af&&af.parentNode!=ad){af=af.parentNode}if(!af){af=ad}ae=X;while(ae&&ae.parentNode!=ad){ae=ae.parentNode}if(!ae){ae=ad}if(af==ae){return 0}t=ad.firstChild;while(t){if(t==af){return -1}if(t==ae){return 1}t=t.nextSibling}}function C(X,aa,Z){var t,Y;if(X){O[h]=aa;O[W]=Z}else{O[Q]=aa;O[A]=Z}t=O[Q];while(t.parentNode){t=t.parentNode}Y=O[h];while(Y.parentNode){Y=Y.parentNode}if(Y==t){if(H(O[h],O[W],O[Q],O[A])>0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.nodeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(ab,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nodeValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,v,q,t,s=d.dom.doc,m=s.body,r,u;function j(C){var y,B,x,A,z;x=h.create("a");y=C?k:v;B=C?p:q;A=n.duplicate();if(y==s||y==s.documentElement){y=m;B=0}if(y.nodeType==3){y.parentNode.insertBefore(x,y);A.moveToElementText(x);A.moveStart("character",B);h.remove(x);n.setEndPoint(C?"StartToStart":"EndToEnd",A)}else{z=y.childNodes;if(z.length){if(B>=z.length){h.insertAfter(x,z[z.length-1])}else{y.insertBefore(x,z[B])}A.moveToElementText(x)}else{if(y.canHaveHTML){y.innerHTML="<span>\uFEFF</span>";x=y.firstChild;A.moveToElementText(x);A.collapse(f)}}n.setEndPoint(C?"StartToStart":"EndToEnd",A);h.remove(x)}}k=i.startContainer;p=i.startOffset;v=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==v&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){t=k.previousSibling;if(t&&!t.hasChildNodes()&&h.isBlock(t)){t.innerHTML="\uFEFF"}else{t=null}k.innerHTML="<span>\uFEFF</span><span>\uFEFF</span>";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(t){t.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{u=k.childNodes[p];l=m.createControlRange();l.addElement(u);l.select();r=d.getRng();if(r.item&&u===r.item(0)){return}}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e<y.length;e++){if(y[e]===y[e-1]){y.splice(e--,1)}}}}return y};d.matches=function(e,y){return d(e,null,null,y)};d.matchesSelector=function(e,y){return d(y,null,null,[e]).length>0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z<B;z++){C=k.order[z];if((A=k.leftMatch[C].exec(E))){y=A[1];A.splice(1,1);if(y.substr(y.length-1)!=="\\"){A[1]=(A[1]||"").replace(q,"");D=k.find[C](A,e,F);if(D!=null){E=E.replace(k.match[C],"");break}}}}if(!D){D=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:D,expr:E}};d.filter=function(I,H,L,B){var D,e,G,N,K,y,A,C,J,z=I,M=[],F=H,E=H&&H[0]&&d.isXML(H[0]);while(I&&H.length){for(G in k.filter){if((D=k.leftMatch[G].exec(I))!=null&&D[2]){y=k.filter[G];A=D[1];e=false;D.splice(1,1);if(A.substr(A.length-1)==="\\"){continue}if(F===M){M=[]}if(k.preFilter[G]){D=k.preFilter[G](D,F,L,M,B,E);if(!D){e=N=true}else{if(D===true){continue}}}if(D){for(C=0;(K=F[C])!=null;C++){if(K){N=y(K,D,C,F);J=B^N;if(L&&N!=null){if(J){e=true}else{F[C]=false}}else{if(J){M.push(K);e=true}}}}}if(N!==undefined){if(!L){F=M}I=I.replace(k.match[G],"");if(!e){return[]}break}}}if(I===z){if(e==null){d.error(I)}else{break}}z=I}return F};d.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var b=d.getText=function(B){var z,A,e=B.nodeType,y="";if(e){if(e===1||e===9||e===11){if(typeof B.textContent==="string"){return B.textContent}else{if(typeof B.innerText==="string"){return B.innerText.replace(u,"")}else{for(B=B.firstChild;B;B=B.nextSibling){y+=b(B)}}}}else{if(e===3||e===4){return B.nodeValue}}}else{for(z=0;(A=B[z]);z++){if(A.nodeType!==8){y+=b(A)}}}return y};var k=d.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(D,y){var A=typeof y==="string",C=A&&!x.test(y),E=A&&!C;if(C){y=y.toLowerCase()}for(var z=0,e=D.length,B;z<e;z++){if((B=D[z])){while((B=B.previousSibling)&&B.nodeType!==1){}D[z]=E||B&&B.nodeName.toLowerCase()===y?B||false:B===y}}if(E){d.filter(y,D,true)}},">":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z<e;z++){C=D[z];if(C){var A=C.parentNode;D[z]=A.nodeName.toLowerCase()===y?A:false}}}else{for(;z<e;z++){C=D[z];if(C){D[z]=B?C.parentNode:C.parentNode===y}}if(B){d.filter(y,D,true)}}},"":function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("parentNode",y,z,A,B,C)},"~":function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("previousSibling",y,z,A,B,C)}},find:{ID:function(y,z,A){if(typeof z.getElementById!=="undefined"&&!A){var e=z.getElementById(y[1]);return e&&e.parentNode?[e]:[]}},NAME:function(z,C){if(typeof C.getElementsByName!=="undefined"){var y=[],B=C.getElementsByName(z[1]);for(var A=0,e=B.length;A<e;A++){if(B[A].getAttribute("name")===z[1]){y.push(B[A])}}return y.length===0?null:y}},TAG:function(e,y){if(typeof y.getElementsByTagName!=="undefined"){return y.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(A,y,z,e,D,E){A=" "+A[1].replace(q,"")+" ";if(E){return A}for(var B=0,C;(C=y[B])!=null;B++){if(C){if(D^(C.className&&(" "+C.className+" ").replace(/[\t\n\r]/g," ").indexOf(A)>=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return y<e[3]-0},gt:function(z,y,e){return y>e[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C<B;C++){if(A[C]===z){return false}}return true}else{d.error(e)}}}},CHILD:function(z,B){var A,H,D,G,e,C,F,E=B[1],y=z;switch(E){case"only":case"first":while((y=y.previousSibling)){if(y.nodeType===1){return false}}if(E==="first"){return true}y=z;case"last":while((y=y.nextSibling)){if(y.nodeType===1){return false}}return true;case"nth":A=B[2];H=B[3];if(A===1&&H===0){return true}D=B[0];G=z.parentNode;if(G&&(G[i]!==D||!z.nodeIndex)){C=0;for(y=G.firstChild;y;y=y.nextSibling){if(y.nodeType===1){y.nodeIndex=++C}}G[i]=D}F=z.nodeIndex-H;if(A===0){return F===0}else{return(F%A===0&&F/A>=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z<e;z++){y.push(B[z])}}else{for(;B[z];z++){y.push(B[z])}}}return y}}var p,m;if(document.documentElement.compareDocumentPosition){p=function(y,e){if(y===e){h=true;return 0}if(!y.compareDocumentPosition||!e.compareDocumentPosition){return y.compareDocumentPosition?-1:1}return y.compareDocumentPosition(e)&4?-1:1}}else{p=function(F,E){if(F===E){h=true;return 0}else{if(F.sourceIndex&&E.sourceIndex){return F.sourceIndex-E.sourceIndex}}var C,y,z=[],e=[],B=F.parentNode,D=E.parentNode,G=B;if(B===D){return m(F,E)}else{if(!B){return -1}else{if(!D){return 1}}}while(G){z.unshift(G);G=G.parentNode}G=D;while(G){e.unshift(G);G=G.parentNode}C=z.length;y=e.length;for(var A=0;A<C&&A<y;A++){if(z[A]!==e[A]){return m(z[A],e[A])}}return A===C?m(F,e[A],-1):m(z[A],E,1)};m=function(y,e,z){if(y===e){return z}var A=y.nextSibling;while(A){if(A===e){return -1}A=A.nextSibling}return 1}}(function(){var y=document.createElement("div"),z="script"+(new Date()).getTime(),e=document.documentElement;y.innerHTML="<a name='"+z+"'/>";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="<p class='TEST'></p>";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1&&!F){e[i]=C;e.sizset=A}if(e.nodeName.toLowerCase()===D){B=e;break}e=e[y]}G[A]=B}}}function t(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1){if(!F){e[i]=C;e.sizset=A}if(typeof D!=="string"){if(e===D){B=true;break}}else{if(d.filter(D,[e]).length>0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A<y;A++){d(z,F[A],E,D)}return d.filter(B,E)};window.tinymce.dom.Sizzle=d})();(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(d){function f(g){return g.replace(/[\n\r]+/g,"")}var c=d.is,b=d.isIE,e=d.each,a=d.dom.TreeWalker;d.create("tinymce.dom.Selection",{Selection:function(k,j,i,h){var g=this;g.dom=k;g.win=j;g.serializer=i;g.editor=h;e(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(l){g[l]=new d.util.Dispatcher(g)});if(!g.win.getSelection){g.tridentSel=new d.dom.TridentSelection(g)}if(d.isIE&&k.boxModel){this._fixIESelection()}d.addUnload(g.destroy,g)},setCursorLocation:function(i,j){var g=this;var h=g.dom.createRng();h.setStart(i,j);h.setEnd(i,j);g.setRng(h);g.collapse(false)},getContent:function(h){var g=this,i=g.getRng(),m=g.dom.create("body"),k=g.getSel(),j,l,o;h=h||{};j=l="";h.get=true;h.format=h.format||"html";h.forced_root_block="";g.onBeforeGetContent.dispatch(g,h);if(h.format=="text"){return g.isCollapsed()?"":(i.text||(k.toString?k.toString():""))}if(i.cloneContents){o=i.cloneContents();if(o){m.appendChild(o)}}else{if(c(i.item)||c(i.htmlText)){m.innerHTML="<br>"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='<span id="__caret">_</span>';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('<span id="__mce_tmp">_</span>'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var i=this,h=i.getRng(),j,g,l,k;if(h.duplicate||h.item){if(h.item){return h.item(0)}l=h.duplicate();l.collapse(1);j=l.parentElement();if(j.ownerDocument!==i.dom.doc){j=i.dom.getRoot()}g=k=h.parentElement();while(k=k.parentNode){if(k==j){j=g;break}}return j}else{j=h.startContainer;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[Math.min(j.childNodes.length-1,h.startOffset)]}if(j&&j.nodeType==3){return j.parentNode}return j}},getEnd:function(){var h=this,g=h.getRng(),j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);j=g.parentElement();if(j.ownerDocument!==h.dom.doc){j=h.dom.getRoot()}if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=g.endContainer;i=g.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[i>0?i-1:i]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_start" style="'+x+'">'+m+"</span>");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_end" style="'+x+'">'+m+"</span>")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='<br data-mce-bogus="1" />'}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},selectorChanged:function(g,j){var h=this,i;if(!h.selectorChangedData){h.selectorChangedData={};i={};h.editor.onNodeChange.addToTop(function(l,k,o){var p=h.dom,m=p.getParents(o,null,p.getRoot()),n={};e(h.selectorChangedData,function(r,q){e(m,function(s){if(p.is(s,q)){if(!i[q]){e(r,function(t){t(true,{node:s,selector:q,parents:m})});i[q]=r}n[q]=r;return false}})});e(i,function(r,q){if(!n[q]){delete i[q];e(r,function(s){s(false,{node:o,selector:q,parents:m})})}})})}if(!h.selectorChangedData[g]){h.selectorChangedData[g]=[]}h.selectorChangedData[g].push(j);return h},scrollIntoView:function(k){var j,h,g=this,i=g.dom;h=i.getViewPort(g.editor.getWin());j=i.getPos(k).y;if(j<h.y||j+25>h.y+h.h){g.editor.getWin().scrollTo(0,j<h.y?j:j-h.h+25)}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("noscript",function(j){var k=j.length,l;while(k--){l=j[k].firstChild;if(l){l.value=a.html.Entities.decode(l.value)}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// <![CDATA[\n"+j(o)+"\n// ]]>"}}else{if(o.length>0){n.firstChild.value="<!--\n"+j(o)+"\n-->"}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&d<h.nodeValue.length){i=f(h,d);h=i.previousSibling;if(g>d){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d<h.nodeValue.length){h=f(h,d);d=0}if(i.nodeType==3&&g>0&&g<i.nodeValue.length){i=f(i,g).previousSibling;g=i.nodeValue.length}}return{startContainer:h,startOffset:d,endContainer:i,endOffset:g}}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(b){var a=b.dom.Event,c=b.each;b.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(e,f){var q=this,n=e.root,m=e.items,o=e.enableUpDown,i=e.enableLeftRight||!e.enableUpDown,l=e.excludeFromTabOrder,k,h,p,d,g;f=f||b.DOM;k=function(r){g=r.target.id};h=function(r){f.setAttrib(r.target.id,"tabindex","-1")};d=function(r){var s=f.get(g);f.setAttrib(s,"tabindex","0");s.focus()};q.focus=function(){f.get(g).focus()};q.destroy=function(){c(m,function(s){var t=f.get(s.id);f.unbind(t,"focus",k);f.unbind(t,"blur",h)});var r=f.get(n);f.unbind(r,"focus",d);f.unbind(r,"keydown",p);m=f=n=q.focus=k=h=p=d=null;q.destroy=function(){}};q.moveFocus=function(v,s){var r=-1,u=q.controls,t;if(!g){return}c(m,function(y,x){if(y.id===g){r=x;return false}});r+=v;if(r<0){r=m.length-1}else{if(r>=m.length){r=0}}t=m[r];f.setAttrib(g,"tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}break;case u:if(i){q.moveFocus(1)}break;case y:if(o){q.moveFocus(-1)}break;case A:if(o){q.moveFocus(1)}break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a role="button" id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" aria-labelledby="'+this.id+'_voice" title="'+a.encode(e.title)+'">';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+='<span class="mceIcon '+e["class"]+'"><img class="mceIcon" src="'+e.image+'" alt="'+a.encode(e.title)+'" /></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}d+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+e.title+"</span>";d+="</a>";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='<span role="listbox" aria-haspopup="true" aria-labelledby="'+g.id+'_voiceDesc" aria-describedby="'+g.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+g.id+'" cellpadding="0" cellspacing="0" class="'+k+" "+k+"Enabled"+(i["class"]?(" "+i["class"]):"")+'"><tbody><tr>';j+="<td>"+d.createHTML("span",{id:g.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},g.settings.title);j+=d.createHTML("a",{id:g.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},d.encode(g.settings.title))+"</td>";j+="<td>"+d.createHTML("a",{id:g.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>')+"</td>";j+="</tr></tbody></table></span>";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'<span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>');i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.keyboardNav=new d.ui.KeyboardNavigation({root:f.id+"_menu",items:c.select("a",f.id+"_menu"),onCancel:function(){f.hideMenu();f.focus()}});f.keyboardNav.focus();f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch();f.keyboardNav.destroy()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){var f=this;f.parent();a.clear(f.id+"_menu");a.clear(f.id+"_more");c.remove(f.id+"_menu");if(f.keyboardNav){f.keyboardNav.destroy()}}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('<div id="'+f.id+'" role="group" aria-labelledby="'+f.id+'_voice">');i.push("<span role='application'>");i.push('<span id="'+f.id+'_voice" class="mceVoiceLabel" style="display:none;">'+d.encode(g.name)+"</span>");j(e,function(h){i.push(h.renderHTML())});i.push("</span>");i.push("</div>");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e<l.length;e++){k=l[e];d=l[e-1];g=l[e+1];if(e===0){j="mceToolbarStart";if(k.Button){j+=" mceToolbarStartButton"}else{if(k.SplitButton){j+=" mceToolbarStartSplitButton"}else{if(k.ListBox){j+=" mceToolbarStartListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,"<!-- IE -->"))}}if(c.stdMode){f+='<td style="position: relative">'+k.renderHTML()+"</td>"}else{f+="<td>"+k.renderHTML()+"</td>"}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,"<!-- IE -->"))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},"<tbody><tr>"+f+"</tr></tbody>")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}if(!this.editors.hasOwnProperty(l)){return a}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(k){var l=k.DOM,j=k.dom.Event,f=k.extend,i=k.each,a=k.isGecko,b=k.isIE,e=k.isWebKit,d=k.is,h=k.ThemeManager,c=k.PluginManager,g=k.explode;k.create("tinymce.Editor",{Editor:function(p,o){var m=this,n=true;m.settings=o=f({id:p,language:"en",theme:"advanced",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:k.documentBaseURL,add_form_submit_trigger:n,submit_patch:n,add_unload_trigger:n,convert_urls:n,relative_urls:n,remove_script_host:n,table_inline_editing:false,object_resizing:n,accessibility_focus:n,doctype:k.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.contentStyles=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(!q.content_editable){p.orgVisibility=p.getElement().style.visibility;p.getElement().style.visibility="hidden"}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/langs/"+q.language+".js")}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,G=this,H=G.settings,D,y,z,C=G.getElement(),p,m,E,v,B,F,x,r=[];k.add(G);H.aria_label=H.aria_label||l.getAttrib(C,"aria-label",G.getLang("aria.rich_text_area"));if(H.theme){if(typeof H.theme!="function"){H.theme=H.theme.replace(/-/,"");p=h.get(H.theme);G.theme=new p();if(G.theme.init){G.theme.init(G,h.urls[H.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{G.theme=H.theme}}function A(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){A(u)});n=new t(G,o);G.plugins[s]=n;if(n.init){n.init(G,o);r.push(s)}}}i(g(H.plugins.replace(/\-/g,"")),A);if(H.popup_css!==false){if(H.popup_css){H.popup_css=G.documentBaseURI.toAbsolute(H.popup_css)}else{H.popup_css=G.baseURI.toAbsolute("themes/"+H.theme+"/skins/"+H.skin+"/dialog.css")}}if(H.popup_css_add){H.popup_css+=","+G.documentBaseURI.toAbsolute(H.popup_css_add)}G.controlManager=new k.ControlManager(G);G.onBeforeRenderUI.dispatch(G,G.controlManager);if(H.render_ui&&G.theme){G.orgDisplay=C.style.display;if(typeof H.theme!="function"){D=H.width||C.style.width||C.offsetWidth;y=H.height||C.style.height||C.offsetHeight;z=H.min_height||100;F=/^[0-9\.]+(|px)$/i;if(F.test(""+D)){D=Math.max(parseInt(D,10)+(p.deltaWidth||0),100)}if(F.test(""+y)){y=Math.max(parseInt(y,10)+(p.deltaHeight||0),z)}p=G.theme.renderUI({targetNode:C,width:D,height:y,deltaWidth:H.delta_width,deltaHeight:H.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:D,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<z){y=z}}else{p=H.theme(G,C);if(p.editorContainer.nodeType){p.editorContainer=p.editorContainer.id=p.editorContainer.id||G.id+"_parent"}if(p.iframeContainer.nodeType){p.iframeContainer=p.iframeContainer.id=p.iframeContainer.id||G.id+"_iframecontainer"}y=p.iframeHeight||C.offsetHeight;if(b){G.onInit.add(function(n){n.dom.bind(n.getBody(),"beforedeactivate keydown",function(){n.lastIERng=n.selection.getRng()})})}}G.editorContainer=p.editorContainer}if(H.content_css){i(g(H.content_css),function(n){G.contentCSS.push(G.documentBaseURI.toAbsolute(n))})}if(H.content_style){G.contentStyles.push(H.content_style)}if(H.content_editable){C=q=p=null;return G.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}G.iframeHTML=H.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(H.document_base_url!=k.documentBaseURL){G.iframeHTML+='<base href="'+G.documentBaseURI.getURI()+'" />'}if(k.isIE8){if(H.ie7_compat){G.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}else{G.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=edge" />'}}G.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(x=0;x<G.contentCSS.length;x++){G.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+G.contentCSS[x]+'" />'}G.contentCSS=[];v=H.body_id||"tinymce";if(v.indexOf("=")!=-1){v=G.getParam("body_id","","hash");v=v[G.id]||v}B=H.body_class||"";if(B.indexOf("=")!=-1){B=G.getParam("body_class","","hash");B=B[G.id]||""}G.iframeHTML+='</head><body id="'+v+'" class="mceContentBody '+B+'" onload="window.parent.tinyMCE.get(\''+G.id+"').onLoad.dispatch();\"><br></body></html>";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){E='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+G.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:G.id+"_ifr",src:E||'javascript:""',frameBorder:"0",allowTransparency:"true",title:H.aria_label,style:{width:"100%",height:y,display:"block"}});G.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=G.orgDisplay}C.style.visibility=G.orgVisibility;l.get(G.id).style.display="none";l.setAttrib(G.id,"aria-hidden",true);if(!k.relaxedDomain||!E){G.initContentBody()}C=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m,s;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(t,u){var v=t.length,y,A=n.dom,z,x;while(v--){y=t[v];z=y.attr(u);x="data-mce-"+u;if(!y.attributes.map[x]){if(u==="style"){y.attr(x,A.serializeStyle(A.parseStyle(z),y.name))}else{y.attr(x,n.convertURL(z,u,y.name))}}}});n.parser.addNodeFilter("script",function(t,u){var v=t.length,x;while(v--){x=t[v];x.attr("type","mce-"+(x.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(t,u){var v=t.length,x;while(v--){x=t[v];x.type=8;x.name="#comment";x.value="[CDATA["+x.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(u,v){var x=u.length,y,t=n.schema.getNonEmptyElements();while(x--){y=u[x];if(y.isEmpty(t)){y.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer,n);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.onExecCommand.add(function(t,u){if(!/^(FontName|FontSize)$/.test(u)){n.nodeChanged()}});n.serializer.onPreProcess.add(function(t,u){return n.onPreProcess.dispatch(n,u,t)});n.serializer.onPostProcess.add(function(t,u){return n.onPostProcess.dispatch(n,u,t)});n.onPreInit.dispatch(n);if(!p.browser_spellcheck&&!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(t,u){i(p.protect,function(v){u.content=u.content.replace(v,function(x){return"<!--mce:protected "+escape(x)+"-->"})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(t,u){u.content=u.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});if(n.contentStyles.length>0){s="";i(n.contentStyles,function(t){s+=t+"\r\n"});n.dom.addStyle(s)}i(n.contentCSS,function(t){n.dom.loadCSS(t)});if(p.auto_focus){setTimeout(function(){var t=k.get(p.auto_focus);t.selection.select(t.getBody(),1);t.selection.collapse(1);t.getBody().focus();t.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){if(u.lastIERng){t.setRng(u.lastIERng)}n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'><br data-mce-bogus="1"></'+q+">"}else{r='<br data-mce-bogus="1">'}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}if(!o.settings.content_editable||document.activeElement===o.getBody()){o.selection.normalize()}return p.content},getContent:function(o){var n=this,p,m=n.getBody();o=o||{};o.format=o.format||"html";o.get=true;o.getInner=true;if(!o.no_events){n.onBeforeGetContent.dispatch(n,o)}if(o.format=="raw"){p=m.innerHTML}else{if(o.format=="text"){p=m.innerText||m.textContent}else{p=n.serializer.serialize(m,o)}}if(o.format!="text"){o.content=k.trim(p)}else{o.content=p}if(!o.no_events){n.onGetContent.dispatch(n,o)}return o.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!p.getAttrib(s,"href",false)){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,o=m.getContainer(),n=m.getDoc();if(!m.removed){m.removed=1;if(b&&n){n.execCommand("SelectAll")}m.save();l.setStyle(m.id,"display",m.orgDisplay);if(!m.settings.content_editable){j.unbind(m.getWin());j.unbind(m.getDoc())}j.unbind(m.getBody());j.clear(o);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(o)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){g.preventDefault();g.stopPropagation()}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(i,m){if(m.keyCode!=65||!a.VK.metaKeyPressed(m)){l.selection.normalize()}l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k(i,n)}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=p.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.y<L.y)||(C.x>L.x+L.w||C.x<L.x)){H=d.isIE?n.getDoc().documentElement:n.getBody();H.scrollLeft=C.x;H.scrollTop=C.y-L.h+25}x=m.createRng();A=D.previousSibling;if(A&&A.nodeType==3){x.setStart(A,A.nodeValue.length)}else{x.setStartBefore(D);x.setEndBefore(D)}m.remove(D);p.setRng(x);p.onSetContent.dispatch(p,G);n.addVisual()},mceInsertRawHTML:function(y,x,v){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return v}))},mceToggleFormat:function(y,x,v){s(v)},mceSetContent:function(y,x,v){n.setContent(v)},"Indent,Outdent":function(z){var x,v,y;x=k.indentation;v=/[a-z%]+$/i.exec(x);x=parseInt(x);if(!l("InsertUnorderedList")&&!l("InsertOrderedList")){if(!k.forced_root_block&&!m.getParent(p.getNode(),m.isBlock)){q.apply("div")}e(p.getSelectedBlocks(),function(A){if(z=="outdent"){y=Math.max(0,parseInt(A.style.paddingLeft||0)-x);m.setStyle(A,"paddingLeft",y?y+v:"")}else{m.setStyle(A,"paddingLeft",(parseInt(A.style.paddingLeft||0)+x)+v)}})}else{f(z)}},mceRepaint:function(){var x;if(d.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(v){}}},mceToggleFormat:function(y,x,v){q.toggle(v)},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();if(p.getRng().setStart){v.setStart(x,0);v.setEnd(x,x.childNodes.length);p.setRng(v)}else{f("SelectAll")}}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(x){var v=m.getParent(p.getNode(),"ul,ol");return v&&(x==="insertunorderedlist"&&v.tagName==="UL"||x==="insertorderedlist"&&v.tagName==="OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getBody(),"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m<e.length-1;m++){e[m]=e[m+1]}e.length--;i=e.length}}p.bookmark=h.selection.getBookmark(2,true);if(i<e.length-1){e.length=i+1}e.push(p);i=e.length-1;l.onAdd.dispatch(l,p);h.isNotDirty=0;return p},undo:function(){var n,m;if(l.typing){l.add();l.typing=false}if(i>0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i<e.length-1){m=e[++i];h.setContent(m.content,{format:"raw"});h.selection.moveToBookmark(m.bookmark);l.onRedo.dispatch(l,m)}return m},clear:function(){e=[];i=0;l.typing=false},hasUndo:function(){return i>0||this.typing},hasRedo:function(){return i<e.length-1&&!this.typing}};return l}})(tinymce);tinymce.ForceBlocks=function(c){var b=c.settings,e=c.dom,a=c.selection,d=c.schema.getBlockElements();function f(){var j=a.getStart(),h=c.getBody(),g,k,o,s,q,i,l,m=-16777215,p,r;if(!j||j.nodeType!==1||!b.forced_root_block){return}while(j&&j!=h){if(d[j.nodeName]){return}j=j.parentNode}g=a.getRng();if(g.setStart){k=g.startContainer;o=g.startOffset;s=g.endContainer;q=g.endOffset}else{if(g.item){j=g.item(0);g=c.getDoc().body.createTextRange();g.moveToElementText(j)}r=g.parentElement().ownerDocument===c.getDoc();tmpRng=g.duplicate();tmpRng.collapse(true);o=tmpRng.move("character",m)*-1;if(!tmpRng.collapsed){tmpRng=g.duplicate();tmpRng.collapse(false);q=(tmpRng.move("character",m)*-1)-o}}j=h.firstChild;while(j){if(j.nodeType===3||(j.nodeType==1&&!d[j.nodeName])){if(j.nodeType===3&&j.nodeValue.length==0){l=j;j=j.nextSibling;e.remove(l);continue}if(!i){i=e.create(b.forced_root_block);j.parentNode.insertBefore(i,j);p=true}l=j;j=j.nextSibling;i.appendChild(l)}else{i=null;j=j.nextSibling}}if(p){if(g.setStart){g.setStart(k,o);g.setEnd(s,q);a.setRng(g)}else{if(r){try{g=c.getDoc().body.createTextRange();g.moveToElementText(h);g.collapse(true);g.moveStart("character",o);if(q>0){g.moveEnd("character",q)}g.select()}catch(n){}}}c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k<g;k++){o=n[k].createControl(j,h);if(o){return h.add(o)}}if(j==="|"||j==="separator"){return h.createSeparator()}if(m.buttons&&(o=m.buttons[j])){return h.createButton(j,o)}return h.add(o)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}n["class"]+=i.settings.directionality=="rtl"?" mceRtl":"";f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(aa){var Q={},T=a.each,c=aa.dom,r=aa.selection,t=a.dom.TreeWalker,N=new a.dom.RangeUtils(c),d=aa.schema.isValidChild,A=a.isArray,H=c.isBlock,m=aa.settings.forced_root_block,s=c.nodeIndex,G="\uFEFF",e=/^(src|href|style)$/,X=false,C=true,P,D,x=c.getContentEditable;function I(ab){return !!aa.schema.getTextBlocks()[ab.toLowerCase()]}function n(ac,ab){return c.getParents(ac,ab,c.getRoot())}function b(ab){return ab.nodeType===1&&ab.id==="_mce_caret"}function j(){l({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(ab){return true},onformat:function(ad,ab,ac){T(ac,function(af,ae){c.setAttrib(ad,ae,af)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});T("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(ab){l(ab,{block:ab,remove:"all"})});l(aa.settings.formats)}function W(){aa.addShortcut("ctrl+b","bold_desc","Bold");aa.addShortcut("ctrl+i","italic_desc","Italic");aa.addShortcut("ctrl+u","underline_desc","Underline");for(var ab=1;ab<=6;ab++){aa.addShortcut("ctrl+"+ab,"",["FormatBlock",false,"h"+ab])}aa.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);aa.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);aa.addShortcut("ctrl+9","",["FormatBlock",false,"address"])}function V(ab){return ab?Q[ab]:Q}function l(ab,ac){if(ab){if(typeof(ab)!=="string"){T(ab,function(ae,ad){l(ad,ae)})}else{ac=ac.length?ac:[ac];T(ac,function(ad){if(ad.deep===D){ad.deep=!ad.selector}if(ad.split===D){ad.split=!ad.selector||ad.inline}if(ad.remove===D&&ad.selector&&!ad.inline){ad.remove="none"}if(ad.selector&&ad.inline){ad.mixed=true;ad.block_expand=true}if(typeof(ad.classes)==="string"){ad.classes=ad.classes.split(/\s+/)}});Q[ab]=ac}}}var i=function(ac){var ab;aa.dom.getParent(ac,function(ad){ab=aa.dom.getStyle(ad,"text-decoration");return ab&&ab!=="none"});return ab};var L=function(ab){var ac;if(ab.nodeType===1&&ab.parentNode&&ab.parentNode.nodeType===1){ac=i(ab.parentNode);if(aa.dom.getStyle(ab,"color")&&ac){aa.dom.setStyle(ab,"text-decoration",ac)}else{if(aa.dom.getStyle(ab,"textdecoration")===ac){aa.dom.setStyle(ab,"text-decoration",null)}}}};function Y(ae,al,ag){var ah=V(ae),am=ah[0],ak,ac,aj,ai=r.isCollapsed();function ab(aq,ap){ap=ap||am;if(aq){if(ap.onformat){ap.onformat(aq,ap,al,ag)}T(ap.styles,function(at,ar){c.setStyle(aq,ar,q(at,al))});T(ap.attributes,function(at,ar){c.setAttrib(aq,ar,q(at,al))});T(ap.classes,function(ar){ar=q(ar,al);if(!c.hasClass(aq,ar)){c.addClass(aq,ar)}})}}function af(){function ar(ay,aw){var ax=new t(aw);for(ag=ax.current();ag;ag=ax.prev()){if(ag.childNodes.length>1||ag==ay||ag.tagName=="BR"){return ag}}}var aq=aa.selection.getRng();var av=aq.startContainer;var ap=aq.endContainer;if(av!=ap&&aq.endOffset===0){var au=ar(av,ap);var at=au.nodeType==3?au.length:au.childNodes.length;aq.setEnd(au,at)}return aq}function ad(at,ay,aw,av,aq){var ap=[],ar=-1,ax,aA=-1,au=-1,az;T(at.childNodes,function(aC,aB){if(aC.nodeName==="UL"||aC.nodeName==="OL"){ar=aB;ax=aC;return false}});T(at.childNodes,function(aC,aB){if(aC.nodeName==="SPAN"&&c.getAttrib(aC,"data-mce-type")=="bookmark"){if(aC.id==ay.id+"_start"){aA=aB}else{if(aC.id==ay.id+"_end"){au=aB}}}});if(ar<=0||(aA<ar&&au>ar)){T(a.grep(at.childNodes),aq);return 0}else{az=c.clone(aw,X);T(a.grep(at.childNodes),function(aC,aB){if((aA<ar&&aB<ar)||(aA>ar&&aB>ar)){ap.push(aC);aC.parentNode.removeChild(aC)}});if(aA<ar){at.insertBefore(az,ax)}else{if(aA>ar){at.insertBefore(az,ax.nextSibling)}}av.push(az);T(ap,function(aB){az.appendChild(aB)});return az}}function an(aq,at,aw){var ap=[],av,ar,au=true;av=am.inline||am.block;ar=c.create(av);ab(ar);N.walk(aq,function(ax){var ay;function az(aA){var aF,aD,aB,aC,aE;aE=au;aF=aA.nodeName.toLowerCase();aD=aA.parentNode.nodeName.toLowerCase();if(aA.nodeType===1&&x(aA)){aE=au;au=x(aA)==="true";aC=true}if(g(aF,"br")){ay=0;if(am.block){c.remove(aA)}return}if(am.wrapper&&y(aA,ae,al)){ay=0;return}if(au&&!aC&&am.block&&!am.wrapper&&I(aF)){aA=c.rename(aA,av);ab(aA);ap.push(aA);ay=0;return}if(am.selector){T(ah,function(aG){if("collapsed" in aG&&aG.collapsed!==ai){return}if(c.is(aA,aG.selector)&&!b(aA)){ab(aA,aG);aB=true}});if(!am.inline||aB){ay=0;return}}if(au&&!aC&&d(av,aF)&&d(aD,av)&&!(!aw&&aA.nodeType===3&&aA.nodeValue.length===1&&aA.nodeValue.charCodeAt(0)===65279)&&!b(aA)){if(!ay){ay=c.clone(ar,X);aA.parentNode.insertBefore(ay,aA);ap.push(ay)}ay.appendChild(aA)}else{if(aF=="li"&&at){ay=ad(aA,at,ar,ap,az)}else{ay=0;T(a.grep(aA.childNodes),az);if(aC){au=aE}ay=0}}}T(ax,az)});if(am.wrap_links===false){T(ap,function(ax){function ay(aC){var aB,aA,az;if(aC.nodeName==="A"){aA=c.clone(ar,X);ap.push(aA);az=a.grep(aC.childNodes);for(aB=0;aB<az.length;aB++){aA.appendChild(az[aB])}aC.appendChild(aA)}T(a.grep(aC.childNodes),ay)}ay(ax)})}T(ap,function(az){var ax;function aA(aC){var aB=0;T(aC.childNodes,function(aD){if(!f(aD)&&!K(aD)){aB++}});return aB}function ay(aB){var aD,aC;T(aB.childNodes,function(aE){if(aE.nodeType==1&&!K(aE)&&!b(aE)){aD=aE;return X}});if(aD&&h(aD,am)){aC=c.clone(aD,X);ab(aC);c.replace(aC,aB,C);c.remove(aD,1)}return aC||aB}ax=aA(az);if((ap.length>1||!H(az))&&ax===0){c.remove(az,1);return}if(am.inline||am.wrapper){if(!am.exact&&ax===1){az=ay(az)}T(ah,function(aB){T(c.select(aB.inline,az),function(aD){var aC;if(aB.wrap_links===false){aC=aD.parentNode;do{if(aC.nodeName==="A"){return}}while(aC=aC.parentNode)}Z(aB,al,aD,aB.exact?aD:null)})});if(y(az.parentNode,ae,al)){c.remove(az,1);az=0;return C}if(am.merge_with_parents){c.getParent(az.parentNode,function(aB){if(y(aB,ae,al)){c.remove(az,1);az=0;return C}})}if(az&&am.merge_siblings!==false){az=u(E(az),az);az=u(az,E(az,C))}}})}if(am){if(ag){if(ag.nodeType){ac=c.createRng();ac.setStartBefore(ag);ac.setEndAfter(ag);an(p(ac,ah),null,true)}else{an(ag,null,true)}}else{if(!ai||!am.inline||c.select("td.mceSelected,th.mceSelected").length){var ao=aa.selection.getNode();if(!m&&ah[0].defaultBlock&&!c.getParent(ao,c.isBlock)){Y(ah[0].defaultBlock)}aa.selection.setRng(af());ak=r.getBookmark();an(p(r.getRng(C),ah),ak);if(am.styles&&(am.styles.color||am.styles.textDecoration)){a.walk(ao,L,"childNodes");L(ao)}r.moveToBookmark(ak);R(r.getRng(C));aa.nodeChanged()}else{U("apply",ae,al)}}}}function B(ad,am,af){var ag=V(ad),ao=ag[0],ak,aj,ac,al=true;function ae(av){var au,at,ar,aq,ax,aw;if(av.nodeType===3){return}if(av.nodeType===1&&x(av)){ax=al;al=x(av)==="true";aw=true}au=a.grep(av.childNodes);if(al&&!aw){for(at=0,ar=ag.length;at<ar;at++){if(Z(ag[at],am,av,av)){break}}}if(ao.deep){if(au.length){for(at=0,ar=au.length;at<ar;at++){ae(au[at])}if(aw){al=ax}}}}function ah(aq){var ar;T(n(aq.parentNode).reverse(),function(at){var au;if(!ar&&at.id!="_start"&&at.id!="_end"){au=y(at,ad,am);if(au&&au.split!==false){ar=at}}});return ar}function ab(au,aq,aw,az){var aA,ay,ax,at,av,ar;if(au){ar=au.parentNode;for(aA=aq.parentNode;aA&&aA!=ar;aA=aA.parentNode){ay=c.clone(aA,X);for(av=0;av<ag.length;av++){if(Z(ag[av],am,ay,ay)){ay=0;break}}if(ay){if(ax){ay.appendChild(ax)}if(!at){at=ay}ax=ay}}if(az&&(!ao.mixed||!H(au))){aq=c.split(au,aq)}if(ax){aw.parentNode.insertBefore(ax,aw);at.appendChild(aw)}}return aq}function an(aq){return ab(ah(aq),aq,aq,true)}function ai(at){var ar=c.get(at?"_start":"_end"),aq=ar[at?"firstChild":"lastChild"];if(K(aq)){aq=aq[at?"firstChild":"lastChild"]}c.remove(ar,true);return aq}function ap(aq){var at,au,ar;aq=p(aq,ag,C);if(ao.split){at=M(aq,C);au=M(aq);if(at!=au){if(/^(TR|TD)$/.test(at.nodeName)&&at.firstChild){at=(at.nodeName=="TD"?at.firstChild:at.firstChild.firstChild)||at}at=S(at,"span",{id:"_start","data-mce-type":"bookmark"});au=S(au,"span",{id:"_end","data-mce-type":"bookmark"});an(at);an(au);at=ai(C);au=ai()}else{at=au=an(at)}aq.startContainer=at.parentNode;aq.startOffset=s(at);aq.endContainer=au.parentNode;aq.endOffset=s(au)+1}N.walk(aq,function(av){T(av,function(aw){ae(aw);if(aw.nodeType===1&&aa.dom.getStyle(aw,"text-decoration")==="underline"&&aw.parentNode&&i(aw.parentNode)==="underline"){Z({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,aw)}})})}if(af){if(af.nodeType){ac=c.createRng();ac.setStartBefore(af);ac.setEndAfter(af);ap(ac)}else{ap(af)}return}if(!r.isCollapsed()||!ao.inline||c.select("td.mceSelected,th.mceSelected").length){ak=r.getBookmark();ap(r.getRng(C));r.moveToBookmark(ak);if(ao.inline&&k(ad,am,r.getStart())){R(r.getRng(true))}aa.nodeChanged()}else{U("remove",ad,am)}}function F(ac,ae,ad){var ab=V(ac);if(k(ac,ae,ad)&&(!("toggle" in ab[0])||ab[0].toggle)){B(ac,ae,ad)}else{Y(ac,ae,ad)}}function y(ac,ab,ah,af){var ad=V(ab),ai,ag,ae;function aj(an,ap,aq){var am,ao,ak=ap[aq],al;if(ap.onmatch){return ap.onmatch(an,ap,aq)}if(ak){if(ak.length===D){for(am in ak){if(ak.hasOwnProperty(am)){if(aq==="attributes"){ao=c.getAttrib(an,am)}else{ao=O(an,am)}if(af&&!ao&&!ap.exact){return}if((!af||ap.exact)&&!g(ao,q(ak[am],ah))){return}}}}else{for(al=0;al<ak.length;al++){if(aq==="attributes"?c.getAttrib(an,ak[al]):O(an,ak[al])){return ap}}}}return ap}if(ad&&ac){for(ag=0;ag<ad.length;ag++){ai=ad[ag];if(h(ac,ai)&&aj(ac,ai,"attributes")&&aj(ac,ai,"styles")){if(ae=ai.classes){for(ag=0;ag<ae.length;ag++){if(!c.hasClass(ac,ae[ag])){return}}}return ai}}}}function k(ad,af,ae){var ac;function ab(ag){ag=c.getParent(ag,function(ah){return !!y(ah,ad,af,true)});return y(ag,ad,af)}if(ae){return ab(ae)}ae=r.getNode();if(ab(ae)){return C}ac=r.getStart();if(ac!=ae){if(ab(ac)){return C}}return X}function v(ai,ah){var af,ag=[],ae={},ad,ac,ab;af=r.getStart();c.getParent(af,function(al){var ak,aj;for(ak=0;ak<ai.length;ak++){aj=ai[ak];if(!ae[aj]&&y(al,aj,ah)){ae[aj]=true;ag.push(aj)}}},c.getRoot());return ag}function z(af){var ah=V(af),ae,ad,ag,ac,ab;if(ah){ae=r.getStart();ad=n(ae);for(ac=ah.length-1;ac>=0;ac--){ab=ah[ac].selector;if(!ab){return C}for(ag=ad.length-1;ag>=0;ag--){if(c.is(ad[ag],ab)){return C}}}}return X}function J(ab,ae,ac){var ad;if(!P){P={};ad={};aa.onNodeChange.addToTop(function(ag,af,ai){var ah=n(ai),aj={};T(P,function(ak,al){T(ah,function(am){if(y(am,al,{},ak.similar)){if(!ad[al]){T(ak,function(an){an(true,{node:am,format:al,parents:ah})});ad[al]=ak}aj[al]=ak;return false}})});T(ad,function(ak,al){if(!aj[al]){delete ad[al];T(ak,function(am){am(false,{node:ai,format:al,parents:ah})})}})})}T(ab.split(","),function(af){if(!P[af]){P[af]=[];P[af].similar=ac}P[af].push(ae)});return this}a.extend(this,{get:V,register:l,apply:Y,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z,formatChanged:J});j();W();function h(ab,ac){if(g(ab,ac.inline)){return C}if(g(ab,ac.block)){return C}if(ac.selector){return c.is(ab,ac.selector)}}function g(ac,ab){ac=ac||"";ab=ab||"";ac=""+(ac.nodeName||ac);ab=""+(ab.nodeName||ab);return ac.toLowerCase()==ab.toLowerCase()}function O(ac,ab){var ad=c.getStyle(ac,ab);if(ab=="color"||ab=="backgroundColor"){ad=c.toHex(ad)}if(ab=="fontWeight"&&ad==700){ad="bold"}return""+ad}function q(ab,ac){if(typeof(ab)!="string"){ab=ab(ac)}else{if(ac){ab=ab.replace(/%(\w+)/g,function(ae,ad){return ac[ad]||ae})}}return ab}function f(ab){return ab&&ab.nodeType===3&&/^([\t \r\n]+|)$/.test(ab.nodeValue)}function S(ad,ac,ab){var ae=c.create(ac,ab);ad.parentNode.insertBefore(ae,ad);ae.appendChild(ad);return ae}function p(ab,am,ae){var ap,an,ah,al,ad=ab.startContainer,ai=ab.startOffset,ar=ab.endContainer,ak=ab.endOffset;function ao(aA){var au,ax,az,aw,av,at;au=ax=aA?ad:ar;av=aA?"previousSibling":"nextSibling";at=c.getRoot();function ay(aB){return aB.nodeName=="BR"&&aB.getAttribute("data-mce-bogus")&&!aB.nextSibling}if(au.nodeType==3&&!f(au)){if(aA?ai>0:ak<au.nodeValue.length){return au}}for(;;){if(!am[0].block_expand&&H(ax)){return ax}for(aw=ax[av];aw;aw=aw[av]){if(!K(aw)&&!f(aw)&&!ay(aw)){return ax}}if(ax.parentNode==at){au=ax;break}ax=ax.parentNode}return au}function ag(at,au){if(au===D){au=at.nodeType===3?at.length:at.childNodes.length}while(at&&at.hasChildNodes()){at=at.childNodes[au];if(at){au=at.nodeType===3?at.length:at.childNodes.length}}return{node:at,offset:au}}if(ad.nodeType==1&&ad.hasChildNodes()){an=ad.childNodes.length-1;ad=ad.childNodes[ai>an?an:ai];if(ad.nodeType==3){ai=0}}if(ar.nodeType==1&&ar.hasChildNodes()){an=ar.childNodes.length-1;ar=ar.childNodes[ak>an?an:ak-1];if(ar.nodeType==3){ak=ar.nodeValue.length}}function aq(au){var at=au;while(at){if(at.nodeType===1&&x(at)){return x(at)==="false"?at:au}at=at.parentNode}return au}function aj(au,ay,aA){var ax,av,az,at;function aw(aC,aE){var aF,aB,aD=aC.nodeValue;if(typeof(aE)=="undefined"){aE=aA?aD.length:0}if(aA){aF=aD.lastIndexOf(" ",aE);aB=aD.lastIndexOf("\u00a0",aE);aF=aF>aB?aF:aB;if(aF!==-1&&!ae){aF++}}else{aF=aD.indexOf(" ",aE);aB=aD.indexOf("\u00a0",aE);aF=aF!==-1&&(aB===-1||aF<aB)?aF:aB}return aF}if(au.nodeType===3){az=aw(au,ay);if(az!==-1){return{container:au,offset:az}}at=au}ax=new t(au,c.getParent(au,H)||aa.getBody());while(av=ax[aA?"prev":"next"]()){if(av.nodeType===3){at=av;az=aw(av);if(az!==-1){return{container:av,offset:az}}}else{if(H(av)){break}}}if(at){if(aA){ay=0}else{ay=at.length}return{container:at,offset:ay}}}function af(au,at){var av,aw,ay,ax;if(au.nodeType==3&&au.nodeValue.length===0&&au[at]){au=au[at]}av=n(au);for(aw=0;aw<av.length;aw++){for(ay=0;ay<am.length;ay++){ax=am[ay];if("collapsed" in ax&&ax.collapsed!==ab.collapsed){continue}if(c.is(av[aw],ax.selector)){return av[aw]}}}return au}function ac(au,at,aw){var av;if(!am[0].wrapper){av=c.getParent(au,am[0].block)}if(!av){av=c.getParent(au.nodeType==3?au.parentNode:au,I)}if(av&&am[0].wrapper){av=n(av,"ul,ol").reverse()[0]||av}if(!av){av=au;while(av[at]&&!H(av[at])){av=av[at];if(g(av,"br")){break}}}return av||au}ad=aq(ad);ar=aq(ar);if(K(ad.parentNode)||K(ad)){ad=K(ad)?ad:ad.parentNode;ad=ad.nextSibling||ad;if(ad.nodeType==3){ai=0}}if(K(ar.parentNode)||K(ar)){ar=K(ar)?ar:ar.parentNode;ar=ar.previousSibling||ar;if(ar.nodeType==3){ak=ar.length}}if(am[0].inline){if(ab.collapsed){al=aj(ad,ai,true);if(al){ad=al.container;ai=al.offset}al=aj(ar,ak);if(al){ar=al.container;ak=al.offset}}ah=ag(ar,ak);if(ah.node){while(ah.node&&ah.offset===0&&ah.node.previousSibling){ah=ag(ah.node.previousSibling)}if(ah.node&&ah.offset>0&&ah.node.nodeType===3&&ah.node.nodeValue.charAt(ah.offset-1)===" "){if(ah.offset>1){ar=ah.node;ar.splitText(ah.offset-1)}}}}if(am[0].inline||am[0].block_expand){if(!am[0].inline||(ad.nodeType!=3||ai===0)){ad=ao(true)}if(!am[0].inline||(ar.nodeType!=3||ak===ar.nodeValue.length)){ar=ao()}}if(am[0].selector&&am[0].expand!==X&&!am[0].inline){ad=af(ad,"previousSibling");ar=af(ar,"nextSibling")}if(am[0].block||am[0].selector){ad=ac(ad,"previousSibling");ar=ac(ar,"nextSibling");if(am[0].block){if(!H(ad)){ad=ao(true)}if(!H(ar)){ar=ao()}}}if(ad.nodeType==1){ai=s(ad);ad=ad.parentNode}if(ar.nodeType==1){ak=s(ar)+1;ar=ar.parentNode}return{startContainer:ad,startOffset:ai,endContainer:ar,endOffset:ak}}function Z(ah,ag,ae,ab){var ad,ac,af;if(!h(ae,ah)){return X}if(ah.remove!="all"){T(ah.styles,function(aj,ai){aj=q(aj,ag);if(typeof(ai)==="number"){ai=aj;ab=0}if(!ab||g(O(ab,ai),aj)){c.setStyle(ae,ai,"")}af=1});if(af&&c.getAttrib(ae,"style")==""){ae.removeAttribute("style");ae.removeAttribute("data-mce-style")}T(ah.attributes,function(ak,ai){var aj;ak=q(ak,ag);if(typeof(ai)==="number"){ai=ak;ab=0}if(!ab||g(c.getAttrib(ab,ai),ak)){if(ai=="class"){ak=c.getAttrib(ae,ai);if(ak){aj="";T(ak.split(/\s+/),function(al){if(/mce\w+/.test(al)){aj+=(aj?" ":"")+al}});if(aj){c.setAttrib(ae,ai,aj);return}}}if(ai=="class"){ae.removeAttribute("className")}if(e.test(ai)){ae.removeAttribute("data-mce-"+ai)}ae.removeAttribute(ai)}});T(ah.classes,function(ai){ai=q(ai,ag);if(!ab||c.hasClass(ab,ai)){c.removeClass(ae,ai)}});ac=c.getAttribs(ae);for(ad=0;ad<ac.length;ad++){if(ac[ad].nodeName.indexOf("_")!==0){return X}}}if(ah.remove!="none"){o(ae,ah);return C}}function o(ad,ae){var ab=ad.parentNode,ac;function af(ah,ag,ai){ah=E(ah,ag,ai);return !ah||(ah.nodeName=="BR"||H(ah))}if(ae.block){if(!m){if(H(ad)&&!H(ab)){if(!af(ad,X)&&!af(ad.firstChild,C,1)){ad.insertBefore(c.create("br"),ad.firstChild)}if(!af(ad,C)&&!af(ad.lastChild,X,1)){ad.appendChild(c.create("br"))}}}else{if(ab==c.getRoot()){if(!ae.list_block||!g(ad,ae.list_block)){T(a.grep(ad.childNodes),function(ag){if(d(m,ag.nodeName.toLowerCase())){if(!ac){ac=S(ag,m)}else{ac.appendChild(ag)}}else{ac=0}})}}}}if(ae.selector&&ae.inline&&!g(ae.inline,ad)){return}c.remove(ad,1)}function E(ac,ab,ad){if(ac){ab=ab?"nextSibling":"previousSibling";for(ac=ad?ac:ac[ab];ac;ac=ac[ab]){if(ac.nodeType==1||!f(ac)){return ac}}}}function K(ab){return ab&&ab.nodeType==1&&ab.getAttribute("data-mce-type")=="bookmark"}function u(af,ae){var ab,ad,ac;function ah(ak,aj){if(ak.nodeName!=aj.nodeName){return X}function ai(am){var an={};T(c.getAttribs(am),function(ao){var ap=ao.nodeName.toLowerCase();if(ap.indexOf("_")!==0&&ap!=="style"){an[ap]=c.getAttrib(am,ap)}});return an}function al(ap,ao){var an,am;for(am in ap){if(ap.hasOwnProperty(am)){an=ao[am];if(an===D){return X}if(ap[am]!=an){return X}delete ao[am]}}for(am in ao){if(ao.hasOwnProperty(am)){return X}}return C}if(!al(ai(ak),ai(aj))){return X}if(!al(c.parseStyle(c.getAttrib(ak,"style")),c.parseStyle(c.getAttrib(aj,"style")))){return X}return C}function ag(aj,ai){for(ad=aj;ad;ad=ad[ai]){if(ad.nodeType==3&&ad.nodeValue.length!==0){return aj}if(ad.nodeType==1&&!K(ad)){return ad}}return aj}if(af&&ae){af=ag(af,"previousSibling");ae=ag(ae,"nextSibling");if(ah(af,ae)){for(ad=af.nextSibling;ad&&ad!=ae;){ac=ad;ad=ad.nextSibling;af.appendChild(ac)}c.remove(ae);T(a.grep(ae.childNodes),function(ai){af.appendChild(ai)});return af}}return ae}function I(ab){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(ab)}function M(ac,ag){var ab,af,ad,ae;ab=ac[ag?"startContainer":"endContainer"];af=ac[ag?"startOffset":"endOffset"];if(ab.nodeType==1){ad=ab.childNodes.length-1;if(!ag&&af){af--}ab=ab.childNodes[af>ad?ad:af]}if(ab.nodeType===3&&ag&&af>=ab.nodeValue.length){ab=new t(ab,aa.getBody()).next()||ab}if(ab.nodeType===3&&!ag&&af===0){ab=new t(ab,aa.getBody()).prev()||ab}return ab}function U(ak,ab,ai){var al="_mce_caret",ac=aa.settings.caret_debug;function ad(ap){var ao=c.create("span",{id:al,"data-mce-bogus":true,style:ac?"color:red":""});if(ap){ao.appendChild(aa.getDoc().createTextNode(G))}return ao}function aj(ap,ao){while(ap){if((ap.nodeType===3&&ap.nodeValue!==G)||ap.childNodes.length>1){return false}if(ao&&ap.nodeType===1){ao.push(ap)}ap=ap.firstChild}return true}function ag(ao){while(ao){if(ao.id===al){return ao}ao=ao.parentNode}}function af(ao){var ap;if(ao){ap=new t(ao,ao);for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType===3){return ao}}}}function ae(aq,ap){var ar,ao;if(!aq){aq=ag(r.getStart());if(!aq){while(aq=c.get(al)){ae(aq,false)}}}else{ao=r.getRng(true);if(aj(aq)){if(ap!==false){ao.setStartBefore(aq);ao.setEndBefore(aq)}c.remove(aq)}else{ar=af(aq);if(ar.nodeValue.charAt(0)===G){ar=ar.deleteData(0,1)}c.remove(aq,1)}r.setRng(ao)}}function ah(){var aq,ao,av,au,ar,ap,at;aq=r.getRng(true);au=aq.startOffset;ap=aq.startContainer;at=ap.nodeValue;ao=ag(r.getStart());if(ao){av=af(ao)}if(at&&au>0&&au<at.length&&/\w/.test(at.charAt(au))&&/\w/.test(at.charAt(au-1))){ar=r.getBookmark();aq.collapse(true);aq=p(aq,V(ab));aq=N.split(aq);Y(ab,ai,aq);r.moveToBookmark(ar)}else{if(!ao||av.nodeValue!==G){ao=ad(true);av=ao.firstChild;aq.insertNode(ao);au=1;Y(ab,ai,ao)}else{Y(ab,ai,ao)}r.setCursorLocation(av,au)}}function am(){var ao=r.getRng(true),ap,ar,av,au,aq,ay,ax=[],at,aw;ap=ao.startContainer;ar=ao.startOffset;aq=ap;if(ap.nodeType==3){if(ar!=ap.nodeValue.length||ap.nodeValue===G){au=true}aq=aq.parentNode}while(aq){if(y(aq,ab,ai)){ay=aq;break}if(aq.nextSibling){au=true}ax.push(aq);aq=aq.parentNode}if(!ay){return}if(au){av=r.getBookmark();ao.collapse(true);ao=p(ao,V(ab),true);ao=N.split(ao);B(ab,ai,ao);r.moveToBookmark(av)}else{aw=ad();aq=aw;for(at=ax.length-1;at>=0;at--){aq.appendChild(c.clone(ax[at],false));aq=aq.firstChild}aq.appendChild(c.doc.createTextNode(G));aq=aq.firstChild;c.insertAfter(aw,ay);r.setCursorLocation(aq,1)}}function an(){var ap,ao,aq;ao=ag(r.getStart());if(ao&&!c.isEmpty(ao)){a.walk(ao,function(ar){if(ar.nodeType==1&&ar.id!==al&&!c.isEmpty(ar)){c.setAttrib(ar,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){aa.onBeforeGetContent.addToTop(function(){var ao=[],ap;if(aj(ag(r.getStart()),ao)){ap=ao.length;while(ap--){c.setAttrib(ao[ap],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ao){aa[ao].addToTop(function(){ae();an()})});aa.onKeyDown.addToTop(function(ao,aq){var ap=aq.keyCode;if(ap==8||ap==37||ap==39){ae(ag(r.getStart()))}an()});r.onSetContent.add(an);self._hasCaretEvents=true}if(ak=="apply"){ah()}else{am()}}function R(ac){var ab=ac.startContainer,ai=ac.startOffset,ae,ah,ag,ad,af;if(ab.nodeType==3&&ai>=ab.nodeValue.length){ai=s(ab);ab=ab.parentNode;ae=true}if(ab.nodeType==1){ad=ab.childNodes;ab=ad[Math.min(ai,ad.length-1)];ah=new t(ab,c.getParent(ab,c.isBlock));if(ai>ad.length-1||ae){ah.next()}for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!f(ag)){af=c.create("a",null,G);ag.parentNode.insertBefore(af,ag);ac.setStart(ag,0);r.setRng(ac);c.remove(af);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(f){var i=f.dom,e=f.selection,d=f.settings,h=f.undoManager,c=f.schema.getNonEmptyElements();function g(A){var v=e.getRng(true),G,j,z,u,p,M,B,o,k,n,t,J,x,C;function E(N){return N&&i.isBlock(N)&&!/^(TD|TH|CAPTION|FORM)$/.test(N.nodeName)&&!/^(fixed|absolute)/i.test(N.style.position)&&i.getContentEditable(N)!=="true"}function F(O){var N;if(b.isIE&&i.isBlock(O)){N=e.getRng();O.appendChild(i.create("span",null,"\u00a0"));e.select(O);O.lastChild.outerHTML="";e.setRng(N)}}function y(P){var O=P,Q=[],N;while(O=O.firstChild){if(i.isBlock(O)){return}if(O.nodeType==1&&!c[O.nodeName.toLowerCase()]){Q.push(O)}}N=Q.length;while(N--){O=Q[N];if(!O.hasChildNodes()||(O.firstChild==O.lastChild&&O.firstChild.nodeValue==="")){i.remove(O)}else{if(O.nodeName=="A"&&(O.innerText||O.textContent)===" "){i.remove(O)}}}}function m(O){var T,R,N,U,S,Q=O,P;N=i.createRng();if(O.hasChildNodes()){T=new a(O,O);while(R=T.current()){if(R.nodeType==3){N.setStart(R,0);N.setEnd(R,0);break}if(c[R.nodeName.toLowerCase()]){N.setStartBefore(R);N.setEndBefore(R);break}Q=R;R=T.next()}if(!R){N.setStart(Q,0);N.setEnd(Q,0)}}else{if(O.nodeName=="BR"){if(O.nextSibling&&i.isBlock(O.nextSibling)){if(!M||M<9){P=i.create("br");O.parentNode.insertBefore(P,O)}N.setStartBefore(O);N.setEndBefore(O)}else{N.setStartAfter(O);N.setEndAfter(O)}}else{N.setStart(O,0);N.setEnd(O,0)}}e.setRng(N);i.remove(P);S=i.getViewPort(f.getWin());U=i.getPos(O).y;if(U<S.y||U+25>S.y+S.h){f.getWin().scrollTo(0,U<S.y?U:U-S.h+25)}}function r(O){var P=z,R,Q,N;R=O||t=="TABLE"?i.create(O||x):p.cloneNode(false);N=R;if(d.keep_styles!==false){do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(P.nodeName)){if(P.id=="_mce_caret"){continue}Q=P.cloneNode(false);i.setAttrib(Q,"id","");if(R.hasChildNodes()){Q.appendChild(R.firstChild);R.appendChild(Q)}else{N=Q;R.appendChild(Q)}}}while(P=P.parentNode)}if(!b.isIE){N.innerHTML='<br data-mce-bogus="1">'}return R}function q(Q){var P,O,N;if(z.nodeType==3&&(Q?u>0:u<z.nodeValue.length)){return false}if(z.parentNode==p&&C&&!Q){return true}if(Q&&z.nodeType==1&&z==p.firstChild){return true}if(z.nodeName==="TABLE"||(z.previousSibling&&z.previousSibling.nodeName=="TABLE")){return(C&&!Q)||(!C&&Q)}P=new a(z,p);if(z.nodeType==3){if(Q&&u==0){P.prev()}else{if(!Q&&u==z.nodeValue.length){P.next()}}}while(O=P.current()){if(O.nodeType===1){if(!O.getAttribute("data-mce-bogus")){N=O.nodeName.toLowerCase();if(c[N]&&N!=="br"){return false}}}else{if(O.nodeType===3&&!/^[ \t\r\n]*$/.test(O.nodeValue)){return false}}if(Q){P.prev()}else{P.next()}}return true}function l(N,T){var U,S,P,R,Q,O=x||"P";S=i.getParent(N,i.isBlock);if(!S||!E(S)){S=S||j;if(!S.hasChildNodes()){U=i.create(O);S.appendChild(U);v.setStart(U,0);v.setEnd(U,0);return U}R=N;while(R.parentNode!=S){R=R.parentNode}while(R&&!i.isBlock(R)){P=R;R=R.previousSibling}if(P){U=i.create(O);P.parentNode.insertBefore(U,P);R=P;while(R&&!i.isBlock(R)){Q=R.nextSibling;U.appendChild(R);R=Q}v.setStart(N,T);v.setEnd(N,T)}}return N}function H(){function N(P){var O=n[P?"firstChild":"lastChild"];while(O){if(O.nodeType==1){break}O=O[P?"nextSibling":"previousSibling"]}return O===p}o=x?r(x):i.create("BR");if(N(true)&&N()){i.replace(o,n)}else{if(N(true)){n.parentNode.insertBefore(o,n)}else{if(N()){i.insertAfter(o,n);F(o)}else{G=v.cloneRange();G.setStartAfter(p);G.setEndAfter(n);k=G.extractContents();i.insertAfter(k,n);i.insertAfter(o,n)}}}i.remove(p);m(o);h.add()}function D(){var O=new a(z,p),N;while(N=O.current()){if(N.nodeName=="BR"){return true}N=O.next()}}function L(){var P,O,N;if(z&&z.nodeType==3&&u>=z.nodeValue.length){if(!b.isIE&&!D()){P=i.create("br");v.insertNode(P);v.setStartAfter(P);v.setEndAfter(P);O=true}}P=i.create("br");v.insertNode(P);if(b.isIE&&t=="PRE"&&(!M||M<8)){P.parentNode.insertBefore(i.doc.createTextNode("\r"),P)}N=i.create("span",{}," ");P.parentNode.insertBefore(N,P);e.scrollIntoView(N);i.remove(N);if(!O){v.setStartAfter(P);v.setEndAfter(P)}else{v.setStartBefore(P);v.setEndBefore(P)}e.setRng(v);h.add()}function s(N){do{if(N.nodeType===3){N.nodeValue=N.nodeValue.replace(/^[\r\n]+/,"")}N=N.firstChild}while(N)}function K(P){var N=i.getRoot(),O,Q;O=P;while(O!==N&&i.getContentEditable(O)!=="false"){if(i.getContentEditable(O)==="true"){Q=O}O=O.parentNode}return O!==N?Q:N}function I(O){var N;if(!b.isIE){O.normalize();N=O.lastChild;if(!N||(/^(left|right)$/gi.test(i.getStyle(N,"float",true)))){i.add(O,"br")}}}if(!v.collapsed){f.execCommand("Delete");return}if(A.isDefaultPrevented()){return}z=v.startContainer;u=v.startOffset;x=(d.force_p_newlines?"p":"")||d.forced_root_block;x=x?x.toUpperCase():"";M=i.doc.documentMode;B=A.shiftKey;if(z.nodeType==1&&z.hasChildNodes()){C=u>z.childNodes.length-1;z=z.childNodes[Math.min(u,z.childNodes.length-1)]||z;if(C&&z.nodeType==3){u=z.nodeValue.length}else{u=0}}j=K(z);if(!j){return}h.beforeChange();if(!i.isBlock(j)&&j!=i.getRoot()){if(!x||B){L()}return}if((x&&!B)||(!x&&B)){z=l(z,u)}p=i.getParent(z,i.isBlock);n=p?i.getParent(p.parentNode,i.isBlock):null;t=p?p.nodeName.toUpperCase():"";J=n?n.nodeName.toUpperCase():"";if(J=="LI"&&!A.ctrlKey){p=n;t=J}if(t=="LI"){if(!x&&B){L();return}if(i.isEmpty(p)){if(/^(UL|OL|LI)$/.test(n.parentNode.nodeName)){return false}H();return}}if(t=="PRE"&&d.br_in_pre!==false){if(!B){L();return}}else{if((!x&&!B&&t!="LI")||(x&&B)){L();return}}x=x||"P";if(q()){if(/^(H[1-6]|PRE)$/.test(t)&&J!="HGROUP"){o=r(x)}else{o=r()}if(d.end_container_on_empty_block&&E(n)&&i.isEmpty(p)){o=i.split(n,p)}else{i.insertAfter(o,p)}m(o)}else{if(q(true)){o=p.parentNode.insertBefore(r(),p);F(o)}else{G=v.cloneRange();G.setEndAfter(p);k=G.extractContents();s(k);o=k.firstChild;i.insertAfter(k,p);y(o);I(p);m(o)}}i.setAttrib(o,"id","");h.add()}f.onKeyDown.add(function(k,j){if(j.keyCode==13){if(g(j)!==false){j.preventDefault()}}})}})(tinymce);
\ No newline at end of file
+++ /dev/null
-
-// Uncomment and change this document.domain value if you are loading the script cross subdomains
-// document.domain = 'moxiecode.com';
-
-var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
\ No newline at end of file
+++ /dev/null
-// FILE IS GENERATED BY COMBINING THE SOURCES IN THE "classes" DIRECTORY SO DON'T MODIFY THIS FILE DIRECTLY\r
-(function(win) {\r
- var whiteSpaceRe = /^\s*|\s*$/g,\r
- undef, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1';\r
-\r
- var tinymce = {\r
- majorVersion : '3',\r
-\r
- minorVersion : '5.8',\r
-\r
- releaseDate : '2012-11-20',\r
-\r
- _init : function() {\r
- var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;\r
-\r
- t.isOpera = win.opera && opera.buildNumber;\r
-\r
- t.isWebKit = /WebKit/.test(ua);\r
-\r
- t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName);\r
-\r
- t.isIE6 = t.isIE && /MSIE [56]/.test(ua);\r
-\r
- t.isIE7 = t.isIE && /MSIE [7]/.test(ua);\r
-\r
- t.isIE8 = t.isIE && /MSIE [8]/.test(ua);\r
-\r
- t.isIE9 = t.isIE && /MSIE [9]/.test(ua);\r
-\r
- t.isGecko = !t.isWebKit && /Gecko/.test(ua);\r
-\r
- t.isMac = ua.indexOf('Mac') != -1;\r
-\r
- t.isAir = /adobeair/i.test(ua);\r
-\r
- t.isIDevice = /(iPad|iPhone)/.test(ua);\r
- \r
- t.isIOS5 = t.isIDevice && ua.match(/AppleWebKit\/(\d*)/)[1]>=534;\r
-\r
- // TinyMCE .NET webcontrol might be setting the values for TinyMCE\r
- if (win.tinyMCEPreInit) {\r
- t.suffix = tinyMCEPreInit.suffix;\r
- t.baseURL = tinyMCEPreInit.base;\r
- t.query = tinyMCEPreInit.query;\r
- return;\r
- }\r
-\r
- // Get suffix and base\r
- t.suffix = '';\r
-\r
- // If base element found, add that infront of baseURL\r
- nl = d.getElementsByTagName('base');\r
- for (i=0; i<nl.length; i++) {\r
- v = nl[i].href;\r
- if (v) {\r
- // Host only value like http://site.com or http://site.com:8008\r
- if (/^https?:\/\/[^\/]+$/.test(v))\r
- v += '/';\r
-\r
- base = v ? v.match(/.*\//)[0] : ''; // Get only directory\r
- }\r
- }\r
-\r
- function getBase(n) {\r
- if (n.src && /tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(n.src)) {\r
- if (/_(src|dev)\.js/g.test(n.src))\r
- t.suffix = '_src';\r
-\r
- if ((p = n.src.indexOf('?')) != -1)\r
- t.query = n.src.substring(p + 1);\r
-\r
- t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));\r
-\r
- // If path to script is relative and a base href was found add that one infront\r
- // the src property will always be an absolute one on non IE browsers and IE 8\r
- // so this logic will basically only be executed on older IE versions\r
- if (base && t.baseURL.indexOf('://') == -1 && t.baseURL.indexOf('/') !== 0)\r
- t.baseURL = base + t.baseURL;\r
-\r
- return t.baseURL;\r
- }\r
-\r
- return null;\r
- };\r
-\r
- // Check document\r
- nl = d.getElementsByTagName('script');\r
- for (i=0; i<nl.length; i++) {\r
- if (getBase(nl[i]))\r
- return;\r
- }\r
-\r
- // Check head\r
- n = d.getElementsByTagName('head')[0];\r
- if (n) {\r
- nl = n.getElementsByTagName('script');\r
- for (i=0; i<nl.length; i++) {\r
- if (getBase(nl[i]))\r
- return;\r
- }\r
- }\r
-\r
- return;\r
- },\r
-\r
- is : function(o, t) {\r
- if (!t)\r
- return o !== undef;\r
-\r
- if (t == 'array' && tinymce.isArray(o))\r
- return true;\r
-\r
- return typeof(o) == t;\r
- },\r
-\r
- isArray: Array.isArray || function(obj) {\r
- return Object.prototype.toString.call(obj) === "[object Array]";\r
- },\r
-\r
- makeMap : function(items, delim, map) {\r
- var i;\r
-\r
- items = items || [];\r
- delim = delim || ',';\r
-\r
- if (typeof(items) == "string")\r
- items = items.split(delim);\r
-\r
- map = map || {};\r
-\r
- i = items.length;\r
- while (i--)\r
- map[items[i]] = {};\r
-\r
- return map;\r
- },\r
-\r
- each : function(o, cb, s) {\r
- var n, l;\r
-\r
- if (!o)\r
- return 0;\r
-\r
- s = s || o;\r
-\r
- if (o.length !== undef) {\r
- // Indexed arrays, needed for Safari\r
- for (n=0, l = o.length; n < l; n++) {\r
- if (cb.call(s, o[n], n, o) === false)\r
- return 0;\r
- }\r
- } else {\r
- // Hashtables\r
- for (n in o) {\r
- if (o.hasOwnProperty(n)) {\r
- if (cb.call(s, o[n], n, o) === false)\r
- return 0;\r
- }\r
- }\r
- }\r
-\r
- return 1;\r
- },\r
-\r
-\r
- map : function(a, f) {\r
- var o = [];\r
-\r
- tinymce.each(a, function(v) {\r
- o.push(f(v));\r
- });\r
-\r
- return o;\r
- },\r
-\r
- grep : function(a, f) {\r
- var o = [];\r
-\r
- tinymce.each(a, function(v) {\r
- if (!f || f(v))\r
- o.push(v);\r
- });\r
-\r
- return o;\r
- },\r
-\r
- inArray : function(a, v) {\r
- var i, l;\r
-\r
- if (a) {\r
- for (i = 0, l = a.length; i < l; i++) {\r
- if (a[i] === v)\r
- return i;\r
- }\r
- }\r
-\r
- return -1;\r
- },\r
-\r
- extend : function(obj, ext) {\r
- var i, l, name, args = arguments, value;\r
-\r
- for (i = 1, l = args.length; i < l; i++) {\r
- ext = args[i];\r
- for (name in ext) {\r
- if (ext.hasOwnProperty(name)) {\r
- value = ext[name];\r
-\r
- if (value !== undef) {\r
- obj[name] = value;\r
- }\r
- }\r
- }\r
- }\r
-\r
- return obj;\r
- },\r
-\r
-\r
- trim : function(s) {\r
- return (s ? '' + s : '').replace(whiteSpaceRe, '');\r
- },\r
-\r
- create : function(s, p, root) {\r
- var t = this, sp, ns, cn, scn, c, de = 0;\r
-\r
- // Parse : <prefix> <class>:<super class>\r
- s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);\r
- cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name\r
-\r
- // Create namespace for new class\r
- ns = t.createNS(s[3].replace(/\.\w+$/, ''), root);\r
-\r
- // Class already exists\r
- if (ns[cn])\r
- return;\r
-\r
- // Make pure static class\r
- if (s[2] == 'static') {\r
- ns[cn] = p;\r
-\r
- if (this.onCreate)\r
- this.onCreate(s[2], s[3], ns[cn]);\r
-\r
- return;\r
- }\r
-\r
- // Create default constructor\r
- if (!p[cn]) {\r
- p[cn] = function() {};\r
- de = 1;\r
- }\r
-\r
- // Add constructor and methods\r
- ns[cn] = p[cn];\r
- t.extend(ns[cn].prototype, p);\r
-\r
- // Extend\r
- if (s[5]) {\r
- sp = t.resolve(s[5]).prototype;\r
- scn = s[5].match(/\.(\w+)$/i)[1]; // Class name\r
-\r
- // Extend constructor\r
- c = ns[cn];\r
- if (de) {\r
- // Add passthrough constructor\r
- ns[cn] = function() {\r
- return sp[scn].apply(this, arguments);\r
- };\r
- } else {\r
- // Add inherit constructor\r
- ns[cn] = function() {\r
- this.parent = sp[scn];\r
- return c.apply(this, arguments);\r
- };\r
- }\r
- ns[cn].prototype[cn] = ns[cn];\r
-\r
- // Add super methods\r
- t.each(sp, function(f, n) {\r
- ns[cn].prototype[n] = sp[n];\r
- });\r
-\r
- // Add overridden methods\r
- t.each(p, function(f, n) {\r
- // Extend methods if needed\r
- if (sp[n]) {\r
- ns[cn].prototype[n] = function() {\r
- this.parent = sp[n];\r
- return f.apply(this, arguments);\r
- };\r
- } else {\r
- if (n != cn)\r
- ns[cn].prototype[n] = f;\r
- }\r
- });\r
- }\r
-\r
- // Add static methods\r
- t.each(p['static'], function(f, n) {\r
- ns[cn][n] = f;\r
- });\r
-\r
- if (this.onCreate)\r
- this.onCreate(s[2], s[3], ns[cn].prototype);\r
- },\r
-\r
- walk : function(o, f, n, s) {\r
- s = s || this;\r
-\r
- if (o) {\r
- if (n)\r
- o = o[n];\r
-\r
- tinymce.each(o, function(o, i) {\r
- if (f.call(s, o, i, n) === false)\r
- return false;\r
-\r
- tinymce.walk(o, f, n, s);\r
- });\r
- }\r
- },\r
-\r
- createNS : function(n, o) {\r
- var i, v;\r
-\r
- o = o || win;\r
-\r
- n = n.split('.');\r
- for (i=0; i<n.length; i++) {\r
- v = n[i];\r
-\r
- if (!o[v])\r
- o[v] = {};\r
-\r
- o = o[v];\r
- }\r
-\r
- return o;\r
- },\r
-\r
- resolve : function(n, o) {\r
- var i, l;\r
-\r
- o = o || win;\r
-\r
- n = n.split('.');\r
- for (i = 0, l = n.length; i < l; i++) {\r
- o = o[n[i]];\r
-\r
- if (!o)\r
- break;\r
- }\r
-\r
- return o;\r
- },\r
-\r
- addUnload : function(f, s) {\r
- var t = this, unload;\r
-\r
- unload = function() {\r
- var li = t.unloads, o, n;\r
-\r
- if (li) {\r
- // Call unload handlers\r
- for (n in li) {\r
- o = li[n];\r
-\r
- if (o && o.func)\r
- o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy\r
- }\r
-\r
- // Detach unload function\r
- if (win.detachEvent) {\r
- win.detachEvent('onbeforeunload', fakeUnload);\r
- win.detachEvent('onunload', unload);\r
- } else if (win.removeEventListener)\r
- win.removeEventListener('unload', unload, false);\r
-\r
- // Destroy references\r
- t.unloads = o = li = w = unload = 0;\r
-\r
- // Run garbarge collector on IE\r
- if (win.CollectGarbage)\r
- CollectGarbage();\r
- }\r
- };\r
-\r
- function fakeUnload() {\r
- var d = document;\r
-\r
- function stop() {\r
- // Prevent memory leak\r
- d.detachEvent('onstop', stop);\r
-\r
- // Call unload handler\r
- if (unload)\r
- unload();\r
-\r
- d = 0;\r
- };\r
-\r
- // Is there things still loading, then do some magic\r
- if (d.readyState == 'interactive') {\r
- // Fire unload when the currently loading page is stopped\r
- if (d)\r
- d.attachEvent('onstop', stop);\r
-\r
- // Remove onstop listener after a while to prevent the unload function\r
- // to execute if the user presses cancel in an onbeforeunload\r
- // confirm dialog and then presses the browser stop button\r
- win.setTimeout(function() {\r
- if (d)\r
- d.detachEvent('onstop', stop);\r
- }, 0);\r
- }\r
- };\r
-\r
- f = {func : f, scope : s || this};\r
-\r
- if (!t.unloads) {\r
- // Attach unload handler\r
- if (win.attachEvent) {\r
- win.attachEvent('onunload', unload);\r
- win.attachEvent('onbeforeunload', fakeUnload);\r
- } else if (win.addEventListener)\r
- win.addEventListener('unload', unload, false);\r
-\r
- // Setup initial unload handler array\r
- t.unloads = [f];\r
- } else\r
- t.unloads.push(f);\r
-\r
- return f;\r
- },\r
-\r
- removeUnload : function(f) {\r
- var u = this.unloads, r = null;\r
-\r
- tinymce.each(u, function(o, i) {\r
- if (o && o.func == f) {\r
- u.splice(i, 1);\r
- r = f;\r
- return false;\r
- }\r
- });\r
-\r
- return r;\r
- },\r
-\r
- explode : function(s, d) {\r
- if (!s || tinymce.is(s, 'array')) {\r
- return s;\r
- }\r
-\r
- return tinymce.map(s.split(d || ','), tinymce.trim);\r
- },\r
-\r
- _addVer : function(u) {\r
- var v;\r
-\r
- if (!this.query)\r
- return u;\r
-\r
- v = (u.indexOf('?') == -1 ? '?' : '&') + this.query;\r
-\r
- if (u.indexOf('#') == -1)\r
- return u + v;\r
-\r
- return u.replace('#', v + '#');\r
- },\r
-\r
- // Fix function for IE 9 where regexps isn't working correctly\r
- // Todo: remove me once MS fixes the bug\r
- _replace : function(find, replace, str) {\r
- // On IE9 we have to fake $x replacement\r
- if (isRegExpBroken) {\r
- return str.replace(find, function() {\r
- var val = replace, args = arguments, i;\r
-\r
- for (i = 0; i < args.length - 2; i++) {\r
- if (args[i] === undef) {\r
- val = val.replace(new RegExp('\\$' + i, 'g'), '');\r
- } else {\r
- val = val.replace(new RegExp('\\$' + i, 'g'), args[i]);\r
- }\r
- }\r
-\r
- return val;\r
- });\r
- }\r
-\r
- return str.replace(find, replace);\r
- }\r
-\r
- };\r
-\r
- // Initialize the API\r
- tinymce._init();\r
-\r
- // Expose tinymce namespace to the global namespace (window)\r
- win.tinymce = win.tinyMCE = tinymce;\r
-\r
- // Describe the different namespaces\r
-\r
- })(window);\r
-\r
-\r
-\r
-tinymce.create('tinymce.util.Dispatcher', {\r
- scope : null,\r
- listeners : null,\r
- inDispatch: false,\r
-\r
- Dispatcher : function(scope) {\r
- this.scope = scope || this;\r
- this.listeners = [];\r
- },\r
-\r
- add : function(callback, scope) {\r
- this.listeners.push({cb : callback, scope : scope || this.scope});\r
-\r
- return callback;\r
- },\r
-\r
- addToTop : function(callback, scope) {\r
- var self = this, listener = {cb : callback, scope : scope || self.scope};\r
-\r
- // Create new listeners if addToTop is executed in a dispatch loop\r
- if (self.inDispatch) {\r
- self.listeners = [listener].concat(self.listeners);\r
- } else {\r
- self.listeners.unshift(listener);\r
- }\r
-\r
- return callback;\r
- },\r
-\r
- remove : function(callback) {\r
- var listeners = this.listeners, output = null;\r
-\r
- tinymce.each(listeners, function(listener, i) {\r
- if (callback == listener.cb) {\r
- output = listener;\r
- listeners.splice(i, 1);\r
- return false;\r
- }\r
- });\r
-\r
- return output;\r
- },\r
-\r
- dispatch : function() {\r
- var self = this, returnValue, args = arguments, i, listeners = self.listeners, listener;\r
-\r
- self.inDispatch = true;\r
- \r
- // Needs to be a real loop since the listener count might change while looping\r
- // And this is also more efficient\r
- for (i = 0; i < listeners.length; i++) {\r
- listener = listeners[i];\r
- returnValue = listener.cb.apply(listener.scope, args.length > 0 ? args : [listener.scope]);\r
-\r
- if (returnValue === false)\r
- break;\r
- }\r
-\r
- self.inDispatch = false;\r
-\r
- return returnValue;\r
- }\r
-\r
- });\r
-\r
-(function() {\r
- var each = tinymce.each;\r
-\r
- tinymce.create('tinymce.util.URI', {\r
- URI : function(u, s) {\r
- var t = this, o, a, b, base_url;\r
-\r
- // Trim whitespace\r
- u = tinymce.trim(u);\r
-\r
- // Default settings\r
- s = t.settings = s || {};\r
-\r
- // Strange app protocol that isn't http/https or local anchor\r
- // For example: mailto,skype,tel etc.\r
- if (/^([\w\-]+):([^\/]{2})/i.test(u) || /^\s*#/.test(u)) {\r
- t.source = u;\r
- return;\r
- }\r
-\r
- // Absolute path with no host, fake host and protocol\r
- if (u.indexOf('/') === 0 && u.indexOf('//') !== 0)\r
- u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u;\r
-\r
- // Relative path http:// or protocol relative //path\r
- if (!/^[\w\-]*:?\/\//.test(u)) {\r
- base_url = s.base_uri ? s.base_uri.path : new tinymce.util.URI(location.href).directory;\r
- u = ((s.base_uri && s.base_uri.protocol) || 'http') + '://mce_host' + t.toAbsPath(base_url, u);\r
- }\r
-\r
- // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)\r
- u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something\r
- u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);\r
- each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) {\r
- var s = u[i];\r
-\r
- // Zope 3 workaround, they use @@something\r
- if (s)\r
- s = s.replace(/\(mce_at\)/g, '@@');\r
-\r
- t[v] = s;\r
- });\r
-\r
- b = s.base_uri;\r
- if (b) {\r
- if (!t.protocol)\r
- t.protocol = b.protocol;\r
-\r
- if (!t.userInfo)\r
- t.userInfo = b.userInfo;\r
-\r
- if (!t.port && t.host === 'mce_host')\r
- t.port = b.port;\r
-\r
- if (!t.host || t.host === 'mce_host')\r
- t.host = b.host;\r
-\r
- t.source = '';\r
- }\r
-\r
- //t.path = t.path || '/';\r
- },\r
-\r
- setPath : function(p) {\r
- var t = this;\r
-\r
- p = /^(.*?)\/?(\w+)?$/.exec(p);\r
-\r
- // Update path parts\r
- t.path = p[0];\r
- t.directory = p[1];\r
- t.file = p[2];\r
-\r
- // Rebuild source\r
- t.source = '';\r
- t.getURI();\r
- },\r
-\r
- toRelative : function(u) {\r
- var t = this, o;\r
-\r
- if (u === "./")\r
- return u;\r
-\r
- u = new tinymce.util.URI(u, {base_uri : t});\r
-\r
- // Not on same domain/port or protocol\r
- if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol)\r
- return u.getURI();\r
-\r
- var tu = t.getURI(), uu = u.getURI();\r
- \r
- // Allow usage of the base_uri when relative_urls = true\r
- if(tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu))\r
- return tu;\r
-\r
- o = t.toRelPath(t.path, u.path);\r
-\r
- // Add query\r
- if (u.query)\r
- o += '?' + u.query;\r
-\r
- // Add anchor\r
- if (u.anchor)\r
- o += '#' + u.anchor;\r
-\r
- return o;\r
- },\r
- \r
- toAbsolute : function(u, nh) {\r
- u = new tinymce.util.URI(u, {base_uri : this});\r
-\r
- return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0);\r
- },\r
-\r
- toRelPath : function(base, path) {\r
- var items, bp = 0, out = '', i, l;\r
-\r
- // Split the paths\r
- base = base.substring(0, base.lastIndexOf('/'));\r
- base = base.split('/');\r
- items = path.split('/');\r
-\r
- if (base.length >= items.length) {\r
- for (i = 0, l = base.length; i < l; i++) {\r
- if (i >= items.length || base[i] != items[i]) {\r
- bp = i + 1;\r
- break;\r
- }\r
- }\r
- }\r
-\r
- if (base.length < items.length) {\r
- for (i = 0, l = items.length; i < l; i++) {\r
- if (i >= base.length || base[i] != items[i]) {\r
- bp = i + 1;\r
- break;\r
- }\r
- }\r
- }\r
-\r
- if (bp === 1)\r
- return path;\r
-\r
- for (i = 0, l = base.length - (bp - 1); i < l; i++)\r
- out += "../";\r
-\r
- for (i = bp - 1, l = items.length; i < l; i++) {\r
- if (i != bp - 1)\r
- out += "/" + items[i];\r
- else\r
- out += items[i];\r
- }\r
-\r
- return out;\r
- },\r
-\r
- toAbsPath : function(base, path) {\r
- var i, nb = 0, o = [], tr, outPath;\r
-\r
- // Split paths\r
- tr = /\/$/.test(path) ? '/' : '';\r
- base = base.split('/');\r
- path = path.split('/');\r
-\r
- // Remove empty chunks\r
- each(base, function(k) {\r
- if (k)\r
- o.push(k);\r
- });\r
-\r
- base = o;\r
-\r
- // Merge relURLParts chunks\r
- for (i = path.length - 1, o = []; i >= 0; i--) {\r
- // Ignore empty or .\r
- if (path[i].length === 0 || path[i] === ".")\r
- continue;\r
-\r
- // Is parent\r
- if (path[i] === '..') {\r
- nb++;\r
- continue;\r
- }\r
-\r
- // Move up\r
- if (nb > 0) {\r
- nb--;\r
- continue;\r
- }\r
-\r
- o.push(path[i]);\r
- }\r
-\r
- i = base.length - nb;\r
-\r
- // If /a/b/c or /\r
- if (i <= 0)\r
- outPath = o.reverse().join('/');\r
- else\r
- outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');\r
-\r
- // Add front / if it's needed\r
- if (outPath.indexOf('/') !== 0)\r
- outPath = '/' + outPath;\r
-\r
- // Add traling / if it's needed\r
- if (tr && outPath.lastIndexOf('/') !== outPath.length - 1)\r
- outPath += tr;\r
-\r
- return outPath;\r
- },\r
-\r
- getURI : function(nh) {\r
- var s, t = this;\r
-\r
- // Rebuild source\r
- if (!t.source || nh) {\r
- s = '';\r
-\r
- if (!nh) {\r
- if (t.protocol)\r
- s += t.protocol + '://';\r
-\r
- if (t.userInfo)\r
- s += t.userInfo + '@';\r
-\r
- if (t.host)\r
- s += t.host;\r
-\r
- if (t.port)\r
- s += ':' + t.port;\r
- }\r
-\r
- if (t.path)\r
- s += t.path;\r
-\r
- if (t.query)\r
- s += '?' + t.query;\r
-\r
- if (t.anchor)\r
- s += '#' + t.anchor;\r
-\r
- t.source = s;\r
- }\r
-\r
- return t.source;\r
- }\r
- });\r
-})();\r
-\r
-(function() {\r
- var each = tinymce.each;\r
-\r
- tinymce.create('static tinymce.util.Cookie', {\r
- getHash : function(n) {\r
- var v = this.get(n), h;\r
-\r
- if (v) {\r
- each(v.split('&'), function(v) {\r
- v = v.split('=');\r
- h = h || {};\r
- h[unescape(v[0])] = unescape(v[1]);\r
- });\r
- }\r
-\r
- return h;\r
- },\r
-\r
- setHash : function(n, v, e, p, d, s) {\r
- var o = '';\r
-\r
- each(v, function(v, k) {\r
- o += (!o ? '' : '&') + escape(k) + '=' + escape(v);\r
- });\r
-\r
- this.set(n, o, e, p, d, s);\r
- },\r
-\r
- get : function(n) {\r
- var c = document.cookie, e, p = n + "=", b;\r
-\r
- // Strict mode\r
- if (!c)\r
- return;\r
-\r
- b = c.indexOf("; " + p);\r
-\r
- if (b == -1) {\r
- b = c.indexOf(p);\r
-\r
- if (b !== 0)\r
- return null;\r
- } else\r
- b += 2;\r
-\r
- e = c.indexOf(";", b);\r
-\r
- if (e == -1)\r
- e = c.length;\r
-\r
- return unescape(c.substring(b + p.length, e));\r
- },\r
-\r
- set : function(n, v, e, p, d, s) {\r
- document.cookie = n + "=" + escape(v) +\r
- ((e) ? "; expires=" + e.toGMTString() : "") +\r
- ((p) ? "; path=" + escape(p) : "") +\r
- ((d) ? "; domain=" + d : "") +\r
- ((s) ? "; secure" : "");\r
- },\r
-\r
- remove : function(name, path, domain) {\r
- var date = new Date();\r
-\r
- date.setTime(date.getTime() - 1000);\r
-\r
- this.set(name, '', date, path, domain);\r
- }\r
- });\r
-})();\r
-\r
-(function() {\r
- function serialize(o, quote) {\r
- var i, v, t, name;\r
-\r
- quote = quote || '"';\r
-\r
- if (o == null)\r
- return 'null';\r
-\r
- t = typeof o;\r
-\r
- if (t == 'string') {\r
- v = '\bb\tt\nn\ff\rr\""\'\'\\\\';\r
-\r
- return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) {\r
- // Make sure single quotes never get encoded inside double quotes for JSON compatibility\r
- if (quote === '"' && a === "'")\r
- return a;\r
-\r
- i = v.indexOf(b);\r
-\r
- if (i + 1)\r
- return '\\' + v.charAt(i + 1);\r
-\r
- a = b.charCodeAt().toString(16);\r
-\r
- return '\\u' + '0000'.substring(a.length) + a;\r
- }) + quote;\r
- }\r
-\r
- if (t == 'object') {\r
- if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {\r
- for (i=0, v = '['; i<o.length; i++)\r
- v += (i > 0 ? ',' : '') + serialize(o[i], quote);\r
-\r
- return v + ']';\r
- }\r
-\r
- v = '{';\r
-\r
- for (name in o) {\r
- if (o.hasOwnProperty(name)) {\r
- v += typeof o[name] != 'function' ? (v.length > 1 ? ',' + quote : quote) + name + quote +':' + serialize(o[name], quote) : '';\r
- }\r
- }\r
-\r
- return v + '}';\r
- }\r
-\r
- return '' + o;\r
- };\r
-\r
- tinymce.util.JSON = {\r
- serialize: serialize,\r
-\r
- parse: function(s) {\r
- try {\r
- return eval('(' + s + ')');\r
- } catch (ex) {\r
- // Ignore\r
- }\r
- }\r
-\r
- };\r
-})();\r
-\r
-tinymce.create('static tinymce.util.XHR', {\r
- send : function(o) {\r
- var x, t, w = window, c = 0;\r
-\r
- function ready() {\r
- if (!o.async || x.readyState == 4 || c++ > 10000) {\r
- if (o.success && c < 10000 && x.status == 200)\r
- o.success.call(o.success_scope, '' + x.responseText, x, o);\r
- else if (o.error)\r
- o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o);\r
-\r
- x = null;\r
- } else\r
- w.setTimeout(ready, 10);\r
- };\r
-\r
- // Default settings\r
- o.scope = o.scope || this;\r
- o.success_scope = o.success_scope || o.scope;\r
- o.error_scope = o.error_scope || o.scope;\r
- o.async = o.async === false ? false : true;\r
- o.data = o.data || '';\r
-\r
- function get(s) {\r
- x = 0;\r
-\r
- try {\r
- x = new ActiveXObject(s);\r
- } catch (ex) {\r
- }\r
-\r
- return x;\r
- };\r
-\r
- x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP');\r
-\r
- if (x) {\r
- if (x.overrideMimeType)\r
- x.overrideMimeType(o.content_type);\r
-\r
- x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async);\r
-\r
- if (o.content_type)\r
- x.setRequestHeader('Content-Type', o.content_type);\r
-\r
- x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\r
-\r
- x.send(o.data);\r
-\r
- // Syncronous request\r
- if (!o.async)\r
- return ready();\r
-\r
- // Wait for response, onReadyStateChange can not be used since it leaks memory in IE\r
- t = w.setTimeout(ready, 10);\r
- }\r
- }\r
-});\r
-\r
-(function() {\r
- var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR;\r
-\r
- tinymce.create('tinymce.util.JSONRequest', {\r
- JSONRequest : function(s) {\r
- this.settings = extend({\r
- }, s);\r
- this.count = 0;\r
- },\r
-\r
- send : function(o) {\r
- var ecb = o.error, scb = o.success;\r
-\r
- o = extend(this.settings, o);\r
-\r
- o.success = function(c, x) {\r
- c = JSON.parse(c);\r
-\r
- if (typeof(c) == 'undefined') {\r
- c = {\r
- error : 'JSON Parse error.'\r
- };\r
- }\r
-\r
- if (c.error)\r
- ecb.call(o.error_scope || o.scope, c.error, x);\r
- else\r
- scb.call(o.success_scope || o.scope, c.result);\r
- };\r
-\r
- o.error = function(ty, x) {\r
- if (ecb)\r
- ecb.call(o.error_scope || o.scope, ty, x);\r
- };\r
-\r
- o.data = JSON.serialize({\r
- id : o.id || 'c' + (this.count++),\r
- method : o.method,\r
- params : o.params\r
- });\r
-\r
- // JSON content type for Ruby on rails. Bug: #1883287\r
- o.content_type = 'application/json';\r
-\r
- XHR.send(o);\r
- },\r
-\r
- 'static' : {\r
- sendRPC : function(o) {\r
- return new tinymce.util.JSONRequest().send(o);\r
- }\r
- }\r
- });\r
-}());\r
-(function(tinymce){\r
- tinymce.VK = {\r
- BACKSPACE: 8,\r
- DELETE: 46,\r
- DOWN: 40,\r
- ENTER: 13,\r
- LEFT: 37,\r
- RIGHT: 39,\r
- SPACEBAR: 32,\r
- TAB: 9,\r
- UP: 38,\r
-\r
- modifierPressed: function (e) {\r
- return e.shiftKey || e.ctrlKey || e.altKey;\r
- },\r
-\r
- metaKeyPressed: function(e) {\r
- // Check if ctrl or meta key is pressed also check if alt is false for Polish users\r
- return tinymce.isMac ? e.metaKey : e.ctrlKey && !e.altKey;\r
- }\r
- };\r
-})(tinymce);\r
-\r
-tinymce.util.Quirks = function(editor) {\r
- var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,\r
- settings = editor.settings, parser = editor.parser, serializer = editor.serializer, each = tinymce.each;\r
-\r
- function setEditorCommandState(cmd, state) {\r
- try {\r
- editor.getDoc().execCommand(cmd, false, state);\r
- } catch (ex) {\r
- // Ignore\r
- }\r
- }\r
-\r
- function getDocumentMode() {\r
- var documentMode = editor.getDoc().documentMode;\r
-\r
- return documentMode ? documentMode : 6;\r
- };\r
-\r
- function isDefaultPrevented(e) {\r
- return e.isDefaultPrevented();\r
- };\r
-\r
- function cleanupStylesWhenDeleting() {\r
- function removeMergedFormatSpans(isDelete) {\r
- var rng, blockElm, node, clonedSpan;\r
-\r
- rng = selection.getRng();\r
-\r
- // Find root block\r
- blockElm = dom.getParent(rng.startContainer, dom.isBlock);\r
-\r
- // On delete clone the root span of the next block element\r
- if (isDelete) {\r
- blockElm = dom.getNext(blockElm, dom.isBlock);\r
- }\r
-\r
- // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace\r
- if (blockElm) {\r
- node = blockElm.firstChild;\r
-\r
- // Ignore empty text nodes\r
- while (node && node.nodeType == 3 && node.nodeValue.length === 0) {\r
- node = node.nextSibling;\r
- }\r
-\r
- if (node && node.nodeName === 'SPAN') {\r
- clonedSpan = node.cloneNode(false);\r
- }\r
- }\r
-\r
- each(dom.select('span', blockElm), function(span) {\r
- span.setAttribute('data-mce-mark', '1');\r
- });\r
-\r
- // Do the backspace/delete action\r
- editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null);\r
-\r
- // Find all odd apple-style-spans\r
- blockElm = dom.getParent(rng.startContainer, dom.isBlock);\r
- each(dom.select('span', blockElm), function(span) {\r
- var bm = selection.getBookmark();\r
-\r
- if (clonedSpan) {\r
- dom.replace(clonedSpan.cloneNode(false), span, true);\r
- } else if (!span.getAttribute('data-mce-mark')) {\r
- dom.remove(span, true);\r
- } else {\r
- span.removeAttribute('data-mce-mark');\r
- }\r
-\r
- // Restore the selection\r
- selection.moveToBookmark(bm);\r
- });\r
- }\r
-\r
- editor.onKeyDown.add(function(editor, e) {\r
- var isDelete;\r
-\r
- isDelete = e.keyCode == DELETE;\r
- if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {\r
- e.preventDefault();\r
- removeMergedFormatSpans(isDelete);\r
- }\r
- });\r
-\r
- editor.addCommand('Delete', function() {removeMergedFormatSpans();});\r
- };\r
- \r
- function emptyEditorWhenDeleting() {\r
- function serializeRng(rng) {\r
- var body = dom.create("body");\r
- var contents = rng.cloneContents();\r
- body.appendChild(contents);\r
- return selection.serializer.serialize(body, {format: 'html'});\r
- }\r
-\r
- function allContentsSelected(rng) {\r
- var selection = serializeRng(rng);\r
-\r
- var allRng = dom.createRng();\r
- allRng.selectNode(editor.getBody());\r
-\r
- var allSelection = serializeRng(allRng);\r
- return selection === allSelection;\r
- }\r
-\r
- editor.onKeyDown.add(function(editor, e) {\r
- var keyCode = e.keyCode, isCollapsed;\r
-\r
- // Empty the editor if it's needed for example backspace at <p><b>|</b></p>\r
- if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {\r
- isCollapsed = editor.selection.isCollapsed();\r
-\r
- // Selection is collapsed but the editor isn't empty\r
- if (isCollapsed && !dom.isEmpty(editor.getBody())) {\r
- return;\r
- }\r
-\r
- // IE deletes all contents correctly when everything is selected\r
- if (tinymce.isIE && !isCollapsed) {\r
- return;\r
- }\r
-\r
- // Selection isn't collapsed but not all the contents is selected\r
- if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {\r
- return;\r
- }\r
-\r
- // Manually empty the editor\r
- editor.setContent('');\r
- editor.selection.setCursorLocation(editor.getBody(), 0);\r
- editor.nodeChanged();\r
- }\r
- });\r
- };\r
-\r
- function selectAll() {\r
- editor.onKeyDown.add(function(editor, e) {\r
- if (!isDefaultPrevented(e) && e.keyCode == 65 && VK.metaKeyPressed(e)) {\r
- e.preventDefault();\r
- editor.execCommand('SelectAll');\r
- }\r
- });\r
- };\r
-\r
- function inputMethodFocus() {\r
- if (!editor.settings.content_editable) {\r
- // Case 1 IME doesn't initialize if you focus the document\r
- dom.bind(editor.getDoc(), 'focusin', function(e) {\r
- selection.setRng(selection.getRng());\r
- });\r
-\r
- // Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event\r
- dom.bind(editor.getDoc(), 'mousedown', function(e) {\r
- if (e.target == editor.getDoc().documentElement) {\r
- editor.getWin().focus();\r
- selection.setRng(selection.getRng());\r
- }\r
- });\r
- }\r
- };\r
-\r
- function removeHrOnBackspace() {\r
- editor.onKeyDown.add(function(editor, e) {\r
- if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {\r
- if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\r
- var node = selection.getNode();\r
- var previousSibling = node.previousSibling;\r
-\r
- if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") {\r
- dom.remove(previousSibling);\r
- tinymce.dom.Event.cancel(e);\r
- }\r
- }\r
- }\r
- })\r
- }\r
-\r
- function focusBody() {\r
- // Fix for a focus bug in FF 3.x where the body element\r
- // wouldn't get proper focus if the user clicked on the HTML element\r
- if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4\r
- editor.onMouseDown.add(function(editor, e) {\r
- if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") {\r
- var body = editor.getBody();\r
-\r
- // Blur the body it's focused but not correctly focused\r
- body.blur();\r
-\r
- // Refocus the body after a little while\r
- setTimeout(function() {\r
- body.focus();\r
- }, 0);\r
- }\r
- });\r
- }\r
- };\r
-\r
- function selectControlElements() {\r
- editor.onClick.add(function(editor, e) {\r
- e = e.target;\r
-\r
- // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\r
- // WebKit can't even do simple things like selecting an image\r
- // Needs tobe the setBaseAndExtend or it will fail to select floated images\r
- if (/^(IMG|HR)$/.test(e.nodeName)) {\r
- selection.getSel().setBaseAndExtent(e, 0, e, 1);\r
- }\r
-\r
- if (e.nodeName == 'A' && dom.hasClass(e, 'mceItemAnchor')) {\r
- selection.select(e);\r
- }\r
-\r
- editor.nodeChanged();\r
- });\r
- };\r
-\r
- function removeStylesWhenDeletingAccrossBlockElements() {\r
- function getAttributeApplyFunction() {\r
- var template = dom.getAttribs(selection.getStart().cloneNode(false));\r
-\r
- return function() {\r
- var target = selection.getStart();\r
-\r
- if (target !== editor.getBody()) {\r
- dom.setAttrib(target, "style", null);\r
-\r
- each(template, function(attr) {\r
- target.setAttributeNode(attr.cloneNode(true));\r
- });\r
- }\r
- };\r
- }\r
-\r
- function isSelectionAcrossElements() {\r
- return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock);\r
- }\r
-\r
- function blockEvent(editor, e) {\r
- e.preventDefault();\r
- return false;\r
- }\r
-\r
- editor.onKeyPress.add(function(editor, e) {\r
- var applyAttributes;\r
-\r
- if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {\r
- applyAttributes = getAttributeApplyFunction();\r
- editor.getDoc().execCommand('delete', false, null);\r
- applyAttributes();\r
- e.preventDefault();\r
- return false;\r
- }\r
- });\r
-\r
- dom.bind(editor.getDoc(), 'cut', function(e) {\r
- var applyAttributes;\r
-\r
- if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {\r
- applyAttributes = getAttributeApplyFunction();\r
- editor.onKeyUp.addToTop(blockEvent);\r
-\r
- setTimeout(function() {\r
- applyAttributes();\r
- editor.onKeyUp.remove(blockEvent);\r
- }, 0);\r
- }\r
- });\r
- }\r
-\r
- function selectionChangeNodeChanged() {\r
- var lastRng, selectionTimer;\r
-\r
- dom.bind(editor.getDoc(), 'selectionchange', function() {\r
- if (selectionTimer) {\r
- clearTimeout(selectionTimer);\r
- selectionTimer = 0;\r
- }\r
-\r
- selectionTimer = window.setTimeout(function() {\r
- var rng = selection.getRng();\r
-\r
- // Compare the ranges to see if it was a real change or not\r
- if (!lastRng || !tinymce.dom.RangeUtils.compareRanges(rng, lastRng)) {\r
- editor.nodeChanged();\r
- lastRng = rng;\r
- }\r
- }, 50);\r
- });\r
- }\r
-\r
- function ensureBodyHasRoleApplication() {\r
- document.body.setAttribute("role", "application");\r
- }\r
-\r
- function disableBackspaceIntoATable() {\r
- editor.onKeyDown.add(function(editor, e) {\r
- if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {\r
- if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\r
- var previousSibling = selection.getNode().previousSibling;\r
- if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {\r
- return tinymce.dom.Event.cancel(e);\r
- }\r
- }\r
- }\r
- })\r
- }\r
-\r
- function addNewLinesBeforeBrInPre() {\r
- // IE8+ rendering mode does the right thing with BR in PRE\r
- if (getDocumentMode() > 7) {\r
- return;\r
- }\r
-\r
- // Enable display: none in area and add a specific class that hides all BR elements in PRE to\r
- // avoid the caret from getting stuck at the BR elements while pressing the right arrow key\r
- setEditorCommandState('RespectVisibilityInDesign', true);\r
- editor.contentStyles.push('.mceHideBrInPre pre br {display: none}');\r
- dom.addClass(editor.getBody(), 'mceHideBrInPre');\r
-\r
- // Adds a \n before all BR elements in PRE to get them visual\r
- parser.addNodeFilter('pre', function(nodes, name) {\r
- var i = nodes.length, brNodes, j, brElm, sibling;\r
-\r
- while (i--) {\r
- brNodes = nodes[i].getAll('br');\r
- j = brNodes.length;\r
- while (j--) {\r
- brElm = brNodes[j];\r
-\r
- // Add \n before BR in PRE elements on older IE:s so the new lines get rendered\r
- sibling = brElm.prev;\r
- if (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\n') {\r
- sibling.value += '\n';\r
- } else {\r
- brElm.parent.insert(new tinymce.html.Node('#text', 3), brElm, true).value = '\n';\r
- }\r
- }\r
- }\r
- });\r
-\r
- // Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible\r
- serializer.addNodeFilter('pre', function(nodes, name) {\r
- var i = nodes.length, brNodes, j, brElm, sibling;\r
-\r
- while (i--) {\r
- brNodes = nodes[i].getAll('br');\r
- j = brNodes.length;\r
- while (j--) {\r
- brElm = brNodes[j];\r
- sibling = brElm.prev;\r
- if (sibling && sibling.type == 3) {\r
- sibling.value = sibling.value.replace(/\r?\n$/, '');\r
- }\r
- }\r
- }\r
- });\r
- }\r
-\r
- function removePreSerializedStylesWhenSelectingControls() {\r
- dom.bind(editor.getBody(), 'mouseup', function(e) {\r
- var value, node = selection.getNode();\r
-\r
- // Moved styles to attributes on IMG eements\r
- if (node.nodeName == 'IMG') {\r
- // Convert style width to width attribute\r
- if (value = dom.getStyle(node, 'width')) {\r
- dom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, ''));\r
- dom.setStyle(node, 'width', '');\r
- }\r
-\r
- // Convert style height to height attribute\r
- if (value = dom.getStyle(node, 'height')) {\r
- dom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, ''));\r
- dom.setStyle(node, 'height', '');\r
- }\r
- }\r
- });\r
- }\r
-\r
- function keepInlineElementOnDeleteBackspace() {\r
- editor.onKeyDown.add(function(editor, e) {\r
- var isDelete, rng, container, offset, brElm, sibling, collapsed;\r
-\r
- isDelete = e.keyCode == DELETE;\r
- if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {\r
- rng = selection.getRng();\r
- container = rng.startContainer;\r
- offset = rng.startOffset;\r
- collapsed = rng.collapsed;\r
-\r
- // Override delete if the start container is a text node and is at the beginning of text or\r
- // just before/after the last character to be deleted in collapsed mode\r
- if (container.nodeType == 3 && container.nodeValue.length > 0 && ((offset === 0 && !collapsed) || (collapsed && offset === (isDelete ? 0 : 1)))) {\r
- nonEmptyElements = editor.schema.getNonEmptyElements();\r
-\r
- // Prevent default logic since it's broken\r
- e.preventDefault();\r
-\r
- // Insert a BR before the text node this will prevent the containing element from being deleted/converted\r
- brElm = dom.create('br', {id: '__tmp'});\r
- container.parentNode.insertBefore(brElm, container);\r
-\r
- // Do the browser delete\r
- editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null);\r
-\r
- // Check if the previous sibling is empty after deleting for example: <p><b></b>|</p>\r
- container = selection.getRng().startContainer;\r
- sibling = container.previousSibling;\r
- if (sibling && sibling.nodeType == 1 && !dom.isBlock(sibling) && dom.isEmpty(sibling) && !nonEmptyElements[sibling.nodeName.toLowerCase()]) {\r
- dom.remove(sibling);\r
- }\r
-\r
- // Remove the temp element we inserted\r
- dom.remove('__tmp');\r
- }\r
- }\r
- });\r
- }\r
-\r
- function removeBlockQuoteOnBackSpace() {\r
- // Add block quote deletion handler\r
- editor.onKeyDown.add(function(editor, e) {\r
- var rng, container, offset, root, parent;\r
-\r
- if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\r
- return;\r
- }\r
-\r
- rng = selection.getRng();\r
- container = rng.startContainer;\r
- offset = rng.startOffset;\r
- root = dom.getRoot();\r
- parent = container;\r
-\r
- if (!rng.collapsed || offset !== 0) {\r
- return;\r
- }\r
-\r
- while (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\r
- parent = parent.parentNode;\r
- }\r
-\r
- // Is the cursor at the beginning of a blockquote?\r
- if (parent.tagName === 'BLOCKQUOTE') {\r
- // Remove the blockquote\r
- editor.formatter.toggle('blockquote', null, parent);\r
-\r
- // Move the caret to the beginning of container\r
- rng = dom.createRng();\r
- rng.setStart(container, 0);\r
- rng.setEnd(container, 0);\r
- selection.setRng(rng);\r
- }\r
- });\r
- };\r
-\r
- function setGeckoEditingOptions() {\r
- function setOpts() {\r
- editor._refreshContentEditable();\r
-\r
- setEditorCommandState("StyleWithCSS", false);\r
- setEditorCommandState("enableInlineTableEditing", false);\r
-\r
- if (!settings.object_resizing) {\r
- setEditorCommandState("enableObjectResizing", false);\r
- }\r
- };\r
-\r
- if (!settings.readonly) {\r
- editor.onBeforeExecCommand.add(setOpts);\r
- editor.onMouseDown.add(setOpts);\r
- }\r
- };\r
-\r
- function addBrAfterLastLinks() {\r
- function fixLinks(editor, o) {\r
- each(dom.select('a'), function(node) {\r
- var parentNode = node.parentNode, root = dom.getRoot();\r
-\r
- if (parentNode.lastChild === node) {\r
- while (parentNode && !dom.isBlock(parentNode)) {\r
- if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {\r
- return;\r
- }\r
-\r
- parentNode = parentNode.parentNode;\r
- }\r
-\r
- dom.add(parentNode, 'br', {'data-mce-bogus' : 1});\r
- }\r
- });\r
- };\r
-\r
- editor.onExecCommand.add(function(editor, cmd) {\r
- if (cmd === 'CreateLink') {\r
- fixLinks(editor);\r
- }\r
- });\r
-\r
- editor.onSetContent.add(selection.onSetContent.add(fixLinks));\r
- };\r
-\r
- function setDefaultBlockType() {\r
- if (settings.forced_root_block) {\r
- editor.onInit.add(function() {\r
- setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block);\r
- });\r
- }\r
- }\r
-\r
- function removeGhostSelection() {\r
- function repaint(sender, args) {\r
- if (!sender || !args.initial) {\r
- editor.execCommand('mceRepaint');\r
- }\r
- };\r
-\r
- editor.onUndo.add(repaint);\r
- editor.onRedo.add(repaint);\r
- editor.onSetContent.add(repaint);\r
- };\r
-\r
- function deleteControlItemOnBackSpace() {\r
- editor.onKeyDown.add(function(editor, e) {\r
- var rng;\r
-\r
- if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {\r
- rng = editor.getDoc().selection.createRange();\r
- if (rng && rng.item) {\r
- e.preventDefault();\r
- editor.undoManager.beforeChange();\r
- dom.remove(rng.item(0));\r
- editor.undoManager.add();\r
- }\r
- }\r
- });\r
- };\r
-\r
- function renderEmptyBlocksFix() {\r
- var emptyBlocksCSS;\r
-\r
- // IE10+\r
- if (getDocumentMode() >= 10) {\r
- emptyBlocksCSS = '';\r
- each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) {\r
- emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty';\r
- });\r
-\r
- editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}');\r
- }\r
- };\r
-\r
- function fakeImageResize() {\r
- var selectedElmX, selectedElmY, selectedElm, selectedElmGhost, selectedHandle, startX, startY, startW, startH, ratio,\r
- resizeHandles, width, height, rootDocument = document, editableDoc = editor.getDoc();\r
-\r
- if (!settings.object_resizing || settings.webkit_fake_resize === false) {\r
- return;\r
- }\r
-\r
- // Try disabling object resizing if WebKit implements resizing in the future\r
- setEditorCommandState("enableObjectResizing", false);\r
-\r
- // Details about each resize handle how to scale etc\r
- resizeHandles = {\r
- // Name: x multiplier, y multiplier, delta size x, delta size y\r
- n: [.5, 0, 0, -1],\r
- e: [1, .5, 1, 0],\r
- s: [.5, 1, 0, 1],\r
- w: [0, .5, -1, 0],\r
- nw: [0, 0, -1, -1],\r
- ne: [1, 0, 1, -1],\r
- se: [1, 1, 1, 1],\r
- sw : [0, 1, -1, 1]\r
- };\r
-\r
- function resizeElement(e) {\r
- var deltaX, deltaY;\r
-\r
- // Calc new width/height\r
- deltaX = e.screenX - startX;\r
- deltaY = e.screenY - startY;\r
-\r
- // Calc new size\r
- width = deltaX * selectedHandle[2] + startW;\r
- height = deltaY * selectedHandle[3] + startH;\r
-\r
- // Never scale down lower than 5 pixels\r
- width = width < 5 ? 5 : width;\r
- height = height < 5 ? 5 : height;\r
-\r
- // Constrain proportions when modifier key is pressed or if the nw, ne, sw, se corners are moved on an image\r
- if (VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0)) {\r
- width = Math.round(height / ratio);\r
- height = Math.round(width * ratio);\r
- }\r
-\r
- // Update ghost size\r
- dom.setStyles(selectedElmGhost, {\r
- width: width,\r
- height: height\r
- });\r
-\r
- // Update ghost X position if needed\r
- if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {\r
- dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));\r
- }\r
-\r
- // Update ghost Y position if needed\r
- if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {\r
- dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));\r
- }\r
- }\r
-\r
- function endResize() {\r
- function setSizeProp(name, value) {\r
- if (value) {\r
- // Resize by using style or attribute\r
- if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) {\r
- dom.setStyle(selectedElm, name, value);\r
- } else {\r
- dom.setAttrib(selectedElm, name, value);\r
- }\r
- }\r
- }\r
-\r
- // Set width/height properties\r
- setSizeProp('width', width);\r
- setSizeProp('height', height);\r
-\r
- dom.unbind(editableDoc, 'mousemove', resizeElement);\r
- dom.unbind(editableDoc, 'mouseup', endResize);\r
-\r
- if (rootDocument != editableDoc) {\r
- dom.unbind(rootDocument, 'mousemove', resizeElement);\r
- dom.unbind(rootDocument, 'mouseup', endResize);\r
- }\r
-\r
- // Remove ghost and update resize handle positions\r
- dom.remove(selectedElmGhost);\r
- showResizeRect(selectedElm);\r
- }\r
-\r
- function showResizeRect(targetElm) {\r
- var position, targetWidth, targetHeight;\r
-\r
- hideResizeRect();\r
-\r
- // Get position and size of target\r
- position = dom.getPos(targetElm);\r
- selectedElmX = position.x;\r
- selectedElmY = position.y;\r
- targetWidth = targetElm.offsetWidth;\r
- targetHeight = targetElm.offsetHeight;\r
-\r
- // Reset width/height if user selects a new image/table\r
- if (selectedElm != targetElm) {\r
- selectedElm = targetElm;\r
- width = height = 0;\r
- }\r
-\r
- each(resizeHandles, function(handle, name) {\r
- var handleElm;\r
-\r
- // Get existing or render resize handle\r
- handleElm = dom.get('mceResizeHandle' + name);\r
- if (!handleElm) {\r
- handleElm = dom.add(editableDoc.documentElement, 'div', {\r
- id: 'mceResizeHandle' + name,\r
- 'class': 'mceResizeHandle',\r
- style: 'cursor:' + name + '-resize; margin:0; padding:0'\r
- });\r
-\r
- dom.bind(handleElm, 'mousedown', function(e) {\r
- e.preventDefault();\r
-\r
- endResize();\r
-\r
- startX = e.screenX;\r
- startY = e.screenY;\r
- startW = selectedElm.clientWidth;\r
- startH = selectedElm.clientHeight;\r
- ratio = startH / startW;\r
- selectedHandle = handle;\r
-\r
- selectedElmGhost = selectedElm.cloneNode(true);\r
- dom.addClass(selectedElmGhost, 'mceClonedResizable');\r
- dom.setStyles(selectedElmGhost, {\r
- left: selectedElmX,\r
- top: selectedElmY,\r
- margin: 0\r
- });\r
-\r
- editableDoc.documentElement.appendChild(selectedElmGhost);\r
-\r
- dom.bind(editableDoc, 'mousemove', resizeElement);\r
- dom.bind(editableDoc, 'mouseup', endResize);\r
-\r
- if (rootDocument != editableDoc) {\r
- dom.bind(rootDocument, 'mousemove', resizeElement);\r
- dom.bind(rootDocument, 'mouseup', endResize);\r
- }\r
- });\r
- } else {\r
- dom.show(handleElm);\r
- }\r
-\r
- // Position element\r
- dom.setStyles(handleElm, {\r
- left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2),\r
- top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2)\r
- });\r
- });\r
-\r
- // Only add resize rectangle on WebKit and only on images\r
- if (!tinymce.isOpera && selectedElm.nodeName == "IMG") {\r
- selectedElm.setAttribute('data-mce-selected', '1');\r
- }\r
- }\r
-\r
- function hideResizeRect() {\r
- if (selectedElm) {\r
- selectedElm.removeAttribute('data-mce-selected');\r
- }\r
-\r
- for (var name in resizeHandles) {\r
- dom.hide('mceResizeHandle' + name);\r
- }\r
- }\r
-\r
- // Add CSS for resize handles, cloned element and selected\r
- editor.contentStyles.push(\r
- '.mceResizeHandle {' +\r
- 'position: absolute;' +\r
- 'border: 1px solid black;' +\r
- 'background: #FFF;' +\r
- 'width: 5px;' +\r
- 'height: 5px;' +\r
- 'z-index: 10000' +\r
- '}' +\r
- '.mceResizeHandle:hover {' +\r
- 'background: #000' +\r
- '}' +\r
- 'img[data-mce-selected] {' +\r
- 'outline: 1px solid black' +\r
- '}' +\r
- 'img.mceClonedResizable, table.mceClonedResizable {' +\r
- 'position: absolute;' +\r
- 'outline: 1px dashed black;' +\r
- 'opacity: .5;' +\r
- 'z-index: 10000' +\r
- '}'\r
- );\r
-\r
- function updateResizeRect() {\r
- var controlElm = dom.getParent(selection.getNode(), 'table,img');\r
-\r
- // Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v\r
- each(dom.select('img[data-mce-selected]'), function(img) {\r
- img.removeAttribute('data-mce-selected');\r
- });\r
-\r
- if (controlElm) {\r
- showResizeRect(controlElm);\r
- } else {\r
- hideResizeRect();\r
- }\r
- }\r
-\r
- // Show/hide resize rect when image is selected\r
- editor.onNodeChange.add(updateResizeRect);\r
-\r
- // Fixes WebKit quirk where it returns IMG on getNode if caret is after last image in container\r
- dom.bind(editableDoc, 'selectionchange', updateResizeRect);\r
-\r
- // Remove the internal attribute when serializing the DOM\r
- editor.serializer.addAttributeFilter('data-mce-selected', function(nodes, name) {\r
- var i = nodes.length;\r
-\r
- while (i--) {\r
- nodes[i].attr(name, null);\r
- }\r
- });\r
- }\r
-\r
- function keepNoScriptContents() {\r
- if (getDocumentMode() < 9) {\r
- parser.addNodeFilter('noscript', function(nodes) {\r
- var i = nodes.length, node, textNode;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- textNode = node.firstChild;\r
-\r
- if (textNode) {\r
- node.attr('data-mce-innertext', textNode.value);\r
- }\r
- }\r
- });\r
-\r
- serializer.addNodeFilter('noscript', function(nodes) {\r
- var i = nodes.length, node, textNode, value;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- textNode = nodes[i].firstChild;\r
-\r
- if (textNode) {\r
- textNode.value = tinymce.html.Entities.decode(textNode.value);\r
- } else {\r
- // Old IE can't retain noscript value so an attribute is used to store it\r
- value = node.attributes.map['data-mce-innertext'];\r
- if (value) {\r
- node.attr('data-mce-innertext', null);\r
- textNode = new tinymce.html.Node('#text', 3);\r
- textNode.value = value;\r
- textNode.raw = true;\r
- node.append(textNode);\r
- }\r
- }\r
- }\r
- });\r
- }\r
- }\r
-\r
- // All browsers\r
- disableBackspaceIntoATable();\r
- removeBlockQuoteOnBackSpace();\r
- emptyEditorWhenDeleting();\r
-\r
- // WebKit\r
- if (tinymce.isWebKit) {\r
- keepInlineElementOnDeleteBackspace();\r
- cleanupStylesWhenDeleting();\r
- inputMethodFocus();\r
- selectControlElements();\r
- setDefaultBlockType();\r
-\r
- // iOS\r
- if (tinymce.isIDevice) {\r
- selectionChangeNodeChanged();\r
- } else {\r
- fakeImageResize();\r
- selectAll();\r
- }\r
- }\r
-\r
- // IE\r
- if (tinymce.isIE) {\r
- removeHrOnBackspace();\r
- ensureBodyHasRoleApplication();\r
- addNewLinesBeforeBrInPre();\r
- removePreSerializedStylesWhenSelectingControls();\r
- deleteControlItemOnBackSpace();\r
- renderEmptyBlocksFix();\r
- keepNoScriptContents();\r
- }\r
-\r
- // Gecko\r
- if (tinymce.isGecko) {\r
- removeHrOnBackspace();\r
- focusBody();\r
- removeStylesWhenDeletingAccrossBlockElements();\r
- setGeckoEditingOptions();\r
- addBrAfterLastLinks();\r
- removeGhostSelection();\r
- }\r
-\r
- // Opera\r
- if (tinymce.isOpera) {\r
- fakeImageResize();\r
- }\r
-};\r
-(function(tinymce) {\r
- var namedEntities, baseEntities, reverseEntities,\r
- attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,\r
- textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,\r
- rawCharsRegExp = /[<>&\"\']/g,\r
- entityRegExp = /&(#x|#)?([\w]+);/g,\r
- asciiMap = {\r
- 128 : "\u20AC", 130 : "\u201A", 131 : "\u0192", 132 : "\u201E", 133 : "\u2026", 134 : "\u2020",\r
- 135 : "\u2021", 136 : "\u02C6", 137 : "\u2030", 138 : "\u0160", 139 : "\u2039", 140 : "\u0152",\r
- 142 : "\u017D", 145 : "\u2018", 146 : "\u2019", 147 : "\u201C", 148 : "\u201D", 149 : "\u2022",\r
- 150 : "\u2013", 151 : "\u2014", 152 : "\u02DC", 153 : "\u2122", 154 : "\u0161", 155 : "\u203A",\r
- 156 : "\u0153", 158 : "\u017E", 159 : "\u0178"\r
- };\r
-\r
- // Raw entities\r
- baseEntities = {\r
- '\"' : '"', // Needs to be escaped since the YUI compressor would otherwise break the code\r
- "'" : ''',\r
- '<' : '<',\r
- '>' : '>',\r
- '&' : '&'\r
- };\r
-\r
- // Reverse lookup table for raw entities\r
- reverseEntities = {\r
- '<' : '<',\r
- '>' : '>',\r
- '&' : '&',\r
- '"' : '"',\r
- ''' : "'"\r
- };\r
-\r
- // Decodes text by using the browser\r
- function nativeDecode(text) {\r
- var elm;\r
-\r
- elm = document.createElement("div");\r
- elm.innerHTML = text;\r
-\r
- return elm.textContent || elm.innerText || text;\r
- };\r
-\r
- // Build a two way lookup table for the entities\r
- function buildEntitiesLookup(items, radix) {\r
- var i, chr, entity, lookup = {};\r
-\r
- if (items) {\r
- items = items.split(',');\r
- radix = radix || 10;\r
-\r
- // Build entities lookup table\r
- for (i = 0; i < items.length; i += 2) {\r
- chr = String.fromCharCode(parseInt(items[i], radix));\r
-\r
- // Only add non base entities\r
- if (!baseEntities[chr]) {\r
- entity = '&' + items[i + 1] + ';';\r
- lookup[chr] = entity;\r
- lookup[entity] = chr;\r
- }\r
- }\r
-\r
- return lookup;\r
- }\r
- };\r
-\r
- // Unpack entities lookup where the numbers are in radix 32 to reduce the size\r
- namedEntities = buildEntitiesLookup(\r
- '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' +\r
- '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' +\r
- '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' +\r
- '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' +\r
- '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' +\r
- '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' +\r
- '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' +\r
- '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' +\r
- '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' +\r
- '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' +\r
- 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' +\r
- 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' +\r
- 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' +\r
- 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' +\r
- 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' +\r
- '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' +\r
- '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' +\r
- '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' +\r
- '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' +\r
- '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' +\r
- 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' +\r
- 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' +\r
- 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' +\r
- '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' +\r
- '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32);\r
-\r
- tinymce.html = tinymce.html || {};\r
-\r
- tinymce.html.Entities = {\r
- encodeRaw : function(text, attr) {\r
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {\r
- return baseEntities[chr] || chr;\r
- });\r
- },\r
-\r
- encodeAllRaw : function(text) {\r
- return ('' + text).replace(rawCharsRegExp, function(chr) {\r
- return baseEntities[chr] || chr;\r
- });\r
- },\r
-\r
- encodeNumeric : function(text, attr) {\r
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {\r
- // Multi byte sequence convert it to a single entity\r
- if (chr.length > 1)\r
- return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';';\r
-\r
- return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';';\r
- });\r
- },\r
-\r
- encodeNamed : function(text, attr, entities) {\r
- entities = entities || namedEntities;\r
-\r
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {\r
- return baseEntities[chr] || entities[chr] || chr;\r
- });\r
- },\r
-\r
- getEncodeFunc : function(name, entities) {\r
- var Entities = tinymce.html.Entities;\r
-\r
- entities = buildEntitiesLookup(entities) || namedEntities;\r
-\r
- function encodeNamedAndNumeric(text, attr) {\r
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {\r
- return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr;\r
- });\r
- };\r
-\r
- function encodeCustomNamed(text, attr) {\r
- return Entities.encodeNamed(text, attr, entities);\r
- };\r
-\r
- // Replace + with , to be compatible with previous TinyMCE versions\r
- name = tinymce.makeMap(name.replace(/\+/g, ','));\r
-\r
- // Named and numeric encoder\r
- if (name.named && name.numeric)\r
- return encodeNamedAndNumeric;\r
-\r
- // Named encoder\r
- if (name.named) {\r
- // Custom names\r
- if (entities)\r
- return encodeCustomNamed;\r
-\r
- return Entities.encodeNamed;\r
- }\r
-\r
- // Numeric\r
- if (name.numeric)\r
- return Entities.encodeNumeric;\r
-\r
- // Raw encoder\r
- return Entities.encodeRaw;\r
- },\r
-\r
- decode : function(text) {\r
- return text.replace(entityRegExp, function(all, numeric, value) {\r
- if (numeric) {\r
- value = parseInt(value, numeric.length === 2 ? 16 : 10);\r
-\r
- // Support upper UTF\r
- if (value > 0xFFFF) {\r
- value -= 0x10000;\r
-\r
- return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF));\r
- } else\r
- return asciiMap[value] || String.fromCharCode(value);\r
- }\r
-\r
- return reverseEntities[all] || namedEntities[all] || nativeDecode(all);\r
- });\r
- }\r
- };\r
-})(tinymce);\r
-\r
-tinymce.html.Styles = function(settings, schema) {\r
- var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,\r
- urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,\r
- styleRegExp = /\s*([^:]+):\s*([^;]+);?/g,\r
- trimRightRegExp = /\s+$/,\r
- urlColorRegExp = /rgb/,\r
- undef, i, encodingLookup = {}, encodingItems;\r
-\r
- settings = settings || {};\r
-\r
- encodingItems = '\\" \\\' \\; \\: ; : \uFEFF'.split(' ');\r
- for (i = 0; i < encodingItems.length; i++) {\r
- encodingLookup[encodingItems[i]] = '\uFEFF' + i;\r
- encodingLookup['\uFEFF' + i] = encodingItems[i];\r
- }\r
-\r
- function toHex(match, r, g, b) {\r
- function hex(val) {\r
- val = parseInt(val).toString(16);\r
-\r
- return val.length > 1 ? val : '0' + val; // 0 -> 00\r
- };\r
-\r
- return '#' + hex(r) + hex(g) + hex(b);\r
- };\r
-\r
- return {\r
- toHex : function(color) {\r
- return color.replace(rgbRegExp, toHex);\r
- },\r
-\r
- parse : function(css) {\r
- var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope || this;\r
-\r
- function compress(prefix, suffix) {\r
- var top, right, bottom, left;\r
-\r
- // Get values and check it it needs compressing\r
- top = styles[prefix + '-top' + suffix];\r
- if (!top)\r
- return;\r
-\r
- right = styles[prefix + '-right' + suffix];\r
- if (top != right)\r
- return;\r
-\r
- bottom = styles[prefix + '-bottom' + suffix];\r
- if (right != bottom)\r
- return;\r
-\r
- left = styles[prefix + '-left' + suffix];\r
- if (bottom != left)\r
- return;\r
-\r
- // Compress\r
- styles[prefix + suffix] = left;\r
- delete styles[prefix + '-top' + suffix];\r
- delete styles[prefix + '-right' + suffix];\r
- delete styles[prefix + '-bottom' + suffix];\r
- delete styles[prefix + '-left' + suffix];\r
- };\r
-\r
- function canCompress(key) {\r
- var value = styles[key], i;\r
-\r
- if (!value || value.indexOf(' ') < 0)\r
- return;\r
-\r
- value = value.split(' ');\r
- i = value.length;\r
- while (i--) {\r
- if (value[i] !== value[0])\r
- return false;\r
- }\r
-\r
- styles[key] = value[0];\r
-\r
- return true;\r
- };\r
-\r
- function compress2(target, a, b, c) {\r
- if (!canCompress(a))\r
- return;\r
-\r
- if (!canCompress(b))\r
- return;\r
-\r
- if (!canCompress(c))\r
- return;\r
-\r
- // Compress\r
- styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];\r
- delete styles[a];\r
- delete styles[b];\r
- delete styles[c];\r
- };\r
-\r
- // Encodes the specified string by replacing all \" \' ; : with _<num>\r
- function encode(str) {\r
- isEncoded = true;\r
-\r
- return encodingLookup[str];\r
- };\r
-\r
- // Decodes the specified string by replacing all _<num> with it's original value \" \' etc\r
- // It will also decode the \" \' if keep_slashes is set to fale or omitted\r
- function decode(str, keep_slashes) {\r
- if (isEncoded) {\r
- str = str.replace(/\uFEFF[0-9]/g, function(str) {\r
- return encodingLookup[str];\r
- });\r
- }\r
-\r
- if (!keep_slashes)\r
- str = str.replace(/\\([\'\";:])/g, "$1");\r
-\r
- return str;\r
- };\r
-\r
- function processUrl(match, url, url2, url3, str, str2) {\r
- str = str || str2;\r
-\r
- if (str) {\r
- str = decode(str);\r
-\r
- // Force strings into single quote format\r
- return "'" + str.replace(/\'/g, "\\'") + "'";\r
- }\r
-\r
- url = decode(url || url2 || url3);\r
-\r
- // Convert the URL to relative/absolute depending on config\r
- if (urlConverter)\r
- url = urlConverter.call(urlConverterScope, url, 'style');\r
-\r
- // Output new URL format\r
- return "url('" + url.replace(/\'/g, "\\'") + "')";\r
- };\r
-\r
- if (css) {\r
- // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing\r
- css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) {\r
- return str.replace(/[;:]/g, encode);\r
- });\r
-\r
- // Parse styles\r
- while (matches = styleRegExp.exec(css)) {\r
- name = matches[1].replace(trimRightRegExp, '').toLowerCase();\r
- value = matches[2].replace(trimRightRegExp, '');\r
-\r
- if (name && value.length > 0) {\r
- // Opera will produce 700 instead of bold in their style values\r
- if (name === 'font-weight' && value === '700')\r
- value = 'bold';\r
- else if (name === 'color' || name === 'background-color') // Lowercase colors like RED\r
- value = value.toLowerCase(); \r
-\r
- // Convert RGB colors to HEX\r
- value = value.replace(rgbRegExp, toHex);\r
-\r
- // Convert URLs and force them into url('value') format\r
- value = value.replace(urlOrStrRegExp, processUrl);\r
- styles[name] = isEncoded ? decode(value, true) : value;\r
- }\r
-\r
- styleRegExp.lastIndex = matches.index + matches[0].length;\r
- }\r
-\r
- // Compress the styles to reduce it's size for example IE will expand styles\r
- compress("border", "");\r
- compress("border", "-width");\r
- compress("border", "-color");\r
- compress("border", "-style");\r
- compress("padding", "");\r
- compress("margin", "");\r
- compress2('border', 'border-width', 'border-style', 'border-color');\r
-\r
- // Remove pointless border, IE produces these\r
- if (styles.border === 'medium none')\r
- delete styles.border;\r
- }\r
-\r
- return styles;\r
- },\r
-\r
- serialize : function(styles, element_name) {\r
- var css = '', name, value;\r
-\r
- function serializeStyles(name) {\r
- var styleList, i, l, value;\r
-\r
- styleList = schema.styles[name];\r
- if (styleList) {\r
- for (i = 0, l = styleList.length; i < l; i++) {\r
- name = styleList[i];\r
- value = styles[name];\r
-\r
- if (value !== undef && value.length > 0)\r
- css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';\r
- }\r
- }\r
- };\r
-\r
- // Serialize styles according to schema\r
- if (element_name && schema && schema.styles) {\r
- // Serialize global styles and element specific styles\r
- serializeStyles('*');\r
- serializeStyles(element_name);\r
- } else {\r
- // Output the styles in the order they are inside the object\r
- for (name in styles) {\r
- value = styles[name];\r
-\r
- if (value !== undef && value.length > 0)\r
- css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';\r
- }\r
- }\r
-\r
- return css;\r
- }\r
- };\r
-};\r
-\r
-(function(tinymce) {\r
- var mapCache = {}, makeMap = tinymce.makeMap, each = tinymce.each;\r
-\r
- function split(str, delim) {\r
- return str.split(delim || ',');\r
- };\r
-\r
- function unpack(lookup, data) {\r
- var key, elements = {};\r
-\r
- function replace(value) {\r
- return value.replace(/[A-Z]+/g, function(key) {\r
- return replace(lookup[key]);\r
- });\r
- };\r
-\r
- // Unpack lookup\r
- for (key in lookup) {\r
- if (lookup.hasOwnProperty(key))\r
- lookup[key] = replace(lookup[key]);\r
- }\r
-\r
- // Unpack and parse data into object map\r
- replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(str, name, attributes, children) {\r
- attributes = split(attributes, '|');\r
-\r
- elements[name] = {\r
- attributes : makeMap(attributes),\r
- attributesOrder : attributes,\r
- children : makeMap(children, '|', {'#comment' : {}})\r
- }\r
- });\r
-\r
- return elements;\r
- };\r
-\r
- function getHTML5() {\r
- var html5 = mapCache.html5;\r
-\r
- if (!html5) {\r
- html5 = mapCache.html5 = unpack({\r
- A : 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup',\r
- B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|' +\r
- 'meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr',\r
- C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|' +\r
- 'figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|' +\r
- 'p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video'\r
- }, 'html[A|manifest][body|head]' +\r
- 'head[A][base|command|link|meta|noscript|script|style|title]' +\r
- 'title[A][#]' +\r
- 'base[A|href|target][]' +\r
- 'link[A|href|rel|media|type|sizes][]' +\r
- 'meta[A|http-equiv|name|content|charset][]' +\r
- 'style[A|type|media|scoped][#]' +\r
- 'script[A|charset|type|src|defer|async][#]' +\r
- 'noscript[A][C]' +\r
- 'body[A][C]' +\r
- 'section[A][C]' +\r
- 'nav[A][C]' +\r
- 'article[A][C]' +\r
- 'aside[A][C]' +\r
- 'h1[A][B]' +\r
- 'h2[A][B]' +\r
- 'h3[A][B]' +\r
- 'h4[A][B]' +\r
- 'h5[A][B]' +\r
- 'h6[A][B]' +\r
- 'hgroup[A][h1|h2|h3|h4|h5|h6]' +\r
- 'header[A][C]' +\r
- 'footer[A][C]' +\r
- 'address[A][C]' +\r
- 'p[A][B]' +\r
- 'br[A][]' +\r
- 'pre[A][B]' +\r
- 'dialog[A][dd|dt]' +\r
- 'blockquote[A|cite][C]' +\r
- 'ol[A|start|reversed][li]' +\r
- 'ul[A][li]' +\r
- 'li[A|value][C]' +\r
- 'dl[A][dd|dt]' +\r
- 'dt[A][B]' +\r
- 'dd[A][C]' +\r
- 'a[A|href|target|ping|rel|media|type][B]' +\r
- 'em[A][B]' +\r
- 'strong[A][B]' +\r
- 'small[A][B]' +\r
- 'cite[A][B]' +\r
- 'q[A|cite][B]' +\r
- 'dfn[A][B]' +\r
- 'abbr[A][B]' +\r
- 'code[A][B]' +\r
- 'var[A][B]' +\r
- 'samp[A][B]' +\r
- 'kbd[A][B]' +\r
- 'sub[A][B]' +\r
- 'sup[A][B]' +\r
- 'i[A][B]' +\r
- 'b[A][B]' +\r
- 'mark[A][B]' +\r
- 'progress[A|value|max][B]' +\r
- 'meter[A|value|min|max|low|high|optimum][B]' +\r
- 'time[A|datetime][B]' +\r
- 'ruby[A][B|rt|rp]' +\r
- 'rt[A][B]' +\r
- 'rp[A][B]' +\r
- 'bdo[A][B]' +\r
- 'span[A][B]' +\r
- 'ins[A|cite|datetime][B]' +\r
- 'del[A|cite|datetime][B]' +\r
- 'figure[A][C|legend|figcaption]' +\r
- 'figcaption[A][C]' +\r
- 'img[A|alt|src|height|width|usemap|ismap][]' +\r
- 'iframe[A|name|src|height|width|sandbox|seamless][]' +\r
- 'embed[A|src|height|width|type][]' +\r
- 'object[A|data|type|height|width|usemap|name|form|classid][param]' +\r
- 'param[A|name|value][]' +\r
- 'details[A|open][C|legend]' +\r
- 'command[A|type|label|icon|disabled|checked|radiogroup][]' +\r
- 'menu[A|type|label][C|li]' +\r
- 'legend[A][C|B]' +\r
- 'div[A][C]' +\r
- 'source[A|src|type|media][]' +\r
- 'audio[A|src|autobuffer|autoplay|loop|controls][source]' +\r
- 'video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]' +\r
- 'hr[A][]' +\r
- 'form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]' +\r
- 'fieldset[A|disabled|form|name][C|legend]' +\r
- 'label[A|form|for][B]' +\r
- 'input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|' +\r
- 'multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]' +\r
- 'button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]' +\r
- 'select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]' +\r
- 'datalist[A][B|option]' +\r
- 'optgroup[A|disabled|label][option]' +\r
- 'option[A|disabled|selected|label|value][]' +\r
- 'textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]' +\r
- 'keygen[A|autofocus|challenge|disabled|form|keytype|name][]' +\r
- 'output[A|for|form|name][B]' +\r
- 'canvas[A|width|height][]' +\r
- 'map[A|name][B|C]' +\r
- 'area[A|shape|coords|href|alt|target|media|rel|ping|type][]' +\r
- 'mathml[A][]' +\r
- 'svg[A][]' +\r
- 'table[A|border][caption|colgroup|thead|tfoot|tbody|tr]' +\r
- 'caption[A][C]' +\r
- 'colgroup[A|span][col]' +\r
- 'col[A|span][]' +\r
- 'thead[A][tr]' +\r
- 'tfoot[A][tr]' +\r
- 'tbody[A][tr]' +\r
- 'tr[A][th|td]' +\r
- 'th[A|headers|rowspan|colspan|scope][B]' +\r
- 'td[A|headers|rowspan|colspan][C]' +\r
- 'wbr[A][]'\r
- );\r
- }\r
-\r
- return html5;\r
- };\r
-\r
- function getHTML4() {\r
- var html4 = mapCache.html4;\r
-\r
- if (!html4) {\r
- // This is the XHTML 1.0 transitional elements with it's attributes and children packed to reduce it's size\r
- html4 = mapCache.html4 = unpack({\r
- Z : 'H|K|N|O|P',\r
- Y : 'X|form|R|Q',\r
- ZG : 'E|span|width|align|char|charoff|valign',\r
- X : 'p|T|div|U|W|isindex|fieldset|table',\r
- ZF : 'E|align|char|charoff|valign',\r
- W : 'pre|hr|blockquote|address|center|noframes',\r
- ZE : 'abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height',\r
- ZD : '[E][S]',\r
- U : 'ul|ol|dl|menu|dir',\r
- ZC : 'p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q',\r
- T : 'h1|h2|h3|h4|h5|h6',\r
- ZB : 'X|S|Q',\r
- S : 'R|P',\r
- ZA : 'a|G|J|M|O|P',\r
- R : 'a|H|K|N|O',\r
- Q : 'noscript|P',\r
- P : 'ins|del|script',\r
- O : 'input|select|textarea|label|button',\r
- N : 'M|L',\r
- M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym',\r
- L : 'sub|sup',\r
- K : 'J|I',\r
- J : 'tt|i|b|u|s|strike',\r
- I : 'big|small|font|basefont',\r
- H : 'G|F',\r
- G : 'br|span|bdo',\r
- F : 'object|applet|img|map|iframe',\r
- E : 'A|B|C',\r
- D : 'accesskey|tabindex|onfocus|onblur',\r
- C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup',\r
- B : 'lang|xml:lang|dir',\r
- A : 'id|class|style|title'\r
- }, 'script[id|charset|type|language|src|defer|xml:space][]' + \r
- 'style[B|id|type|media|title|xml:space][]' + \r
- 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' + \r
- 'param[id|name|value|valuetype|type][]' + \r
- 'p[E|align][#|S]' + \r
- 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' + \r
- 'br[A|clear][]' + \r
- 'span[E][#|S]' + \r
- 'bdo[A|C|B][#|S]' + \r
- 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' + \r
- 'h1[E|align][#|S]' + \r
- 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' + \r
- 'map[B|C|A|name][X|form|Q|area]' + \r
- 'h2[E|align][#|S]' + \r
- 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' + \r
- 'h3[E|align][#|S]' + \r
- 'tt[E][#|S]' + \r
- 'i[E][#|S]' + \r
- 'b[E][#|S]' + \r
- 'u[E][#|S]' + \r
- 's[E][#|S]' + \r
- 'strike[E][#|S]' + \r
- 'big[E][#|S]' + \r
- 'small[E][#|S]' + \r
- 'font[A|B|size|color|face][#|S]' + \r
- 'basefont[id|size|color|face][]' + \r
- 'em[E][#|S]' + \r
- 'strong[E][#|S]' + \r
- 'dfn[E][#|S]' + \r
- 'code[E][#|S]' + \r
- 'q[E|cite][#|S]' + \r
- 'samp[E][#|S]' + \r
- 'kbd[E][#|S]' + \r
- 'var[E][#|S]' + \r
- 'cite[E][#|S]' + \r
- 'abbr[E][#|S]' + \r
- 'acronym[E][#|S]' + \r
- 'sub[E][#|S]' + \r
- 'sup[E][#|S]' + \r
- 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' + \r
- 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' + \r
- 'optgroup[E|disabled|label][option]' + \r
- 'option[E|selected|disabled|label|value][]' + \r
- 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' + \r
- 'label[E|for|accesskey|onfocus|onblur][#|S]' + \r
- 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + \r
- 'h4[E|align][#|S]' + \r
- 'ins[E|cite|datetime][#|Y]' + \r
- 'h5[E|align][#|S]' + \r
- 'del[E|cite|datetime][#|Y]' + \r
- 'h6[E|align][#|S]' + \r
- 'div[E|align][#|Y]' + \r
- 'ul[E|type|compact][li]' + \r
- 'li[E|type|value][#|Y]' + \r
- 'ol[E|type|compact|start][li]' + \r
- 'dl[E|compact][dt|dd]' + \r
- 'dt[E][#|S]' + \r
- 'dd[E][#|Y]' + \r
- 'menu[E|compact][li]' + \r
- 'dir[E|compact][li]' + \r
- 'pre[E|width|xml:space][#|ZA]' + \r
- 'hr[E|align|noshade|size|width][]' + \r
- 'blockquote[E|cite][#|Y]' + \r
- 'address[E][#|S|p]' + \r
- 'center[E][#|Y]' + \r
- 'noframes[E][#|Y]' + \r
- 'isindex[A|B|prompt][]' + \r
- 'fieldset[E][#|legend|Y]' + \r
- 'legend[E|accesskey|align][#|S]' + \r
- 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' + \r
- 'caption[E|align][#|S]' + \r
- 'col[ZG][]' + \r
- 'colgroup[ZG][col]' + \r
- 'thead[ZF][tr]' + \r
- 'tr[ZF|bgcolor][th|td]' + \r
- 'th[E|ZE][#|Y]' + \r
- 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' + \r
- 'noscript[E][#|Y]' + \r
- 'td[E|ZE][#|Y]' + \r
- 'tfoot[ZF][tr]' + \r
- 'tbody[ZF][tr]' + \r
- 'area[E|D|shape|coords|href|nohref|alt|target][]' + \r
- 'base[id|href|target][]' + \r
- 'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]'\r
- );\r
- }\r
-\r
- return html4;\r
- };\r
-\r
- tinymce.html.Schema = function(settings) {\r
- var self = this, elements = {}, children = {}, patternElements = [], validStyles, schemaItems;\r
- var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap, blockElementsMap, nonEmptyElementsMap, customElementsMap = {};\r
-\r
- // Creates an lookup table map object for the specified option or the default value\r
- function createLookupTable(option, default_value, extend) {\r
- var value = settings[option];\r
-\r
- if (!value) {\r
- // Get cached default map or make it if needed\r
- value = mapCache[option];\r
-\r
- if (!value) {\r
- value = makeMap(default_value, ' ', makeMap(default_value.toUpperCase(), ' '));\r
- value = tinymce.extend(value, extend);\r
-\r
- mapCache[option] = value;\r
- }\r
- } else {\r
- // Create custom map\r
- value = makeMap(value, ',', makeMap(value.toUpperCase(), ' '));\r
- }\r
-\r
- return value;\r
- };\r
-\r
- settings = settings || {};\r
- schemaItems = settings.schema == "html5" ? getHTML5() : getHTML4();\r
-\r
- // Allow all elements and attributes if verify_html is set to false\r
- if (settings.verify_html === false)\r
- settings.valid_elements = '*[*]';\r
-\r
- // Build styles list\r
- if (settings.valid_styles) {\r
- validStyles = {};\r
-\r
- // Convert styles into a rule list\r
- each(settings.valid_styles, function(value, key) {\r
- validStyles[key] = tinymce.explode(value);\r
- });\r
- }\r
-\r
- // Setup map objects\r
- whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea');\r
- selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');\r
- shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source wbr');\r
- boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls');\r
- nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap);\r
- textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + \r
- 'blockquote center dir fieldset header footer article section hgroup aside nav figure');\r
- blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + \r
- 'th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup', textBlockElementsMap);\r
-\r
- // Converts a wildcard expression string to a regexp for example *a will become /.*a/.\r
- function patternToRegExp(str) {\r
- return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');\r
- };\r
-\r
- // Parses the specified valid_elements string and adds to the current rules\r
- // This function is a bit hard to read since it's heavily optimized for speed\r
- function addValidElements(valid_elements) {\r
- var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder,\r
- prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value,\r
- elementRuleRegExp = /^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,\r
- attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,\r
- hasPatternsRegExp = /[*?+]/;\r
-\r
- if (valid_elements) {\r
- // Split valid elements into an array with rules\r
- valid_elements = split(valid_elements);\r
-\r
- if (elements['@']) {\r
- globalAttributes = elements['@'].attributes;\r
- globalAttributesOrder = elements['@'].attributesOrder;\r
- }\r
-\r
- // Loop all rules\r
- for (ei = 0, el = valid_elements.length; ei < el; ei++) {\r
- // Parse element rule\r
- matches = elementRuleRegExp.exec(valid_elements[ei]);\r
- if (matches) {\r
- // Setup local names for matches\r
- prefix = matches[1];\r
- elementName = matches[2];\r
- outputName = matches[3];\r
- attrData = matches[4];\r
-\r
- // Create new attributes and attributesOrder\r
- attributes = {};\r
- attributesOrder = [];\r
-\r
- // Create the new element\r
- element = {\r
- attributes : attributes,\r
- attributesOrder : attributesOrder\r
- };\r
-\r
- // Padd empty elements prefix\r
- if (prefix === '#')\r
- element.paddEmpty = true;\r
-\r
- // Remove empty elements prefix\r
- if (prefix === '-')\r
- element.removeEmpty = true;\r
-\r
- // Copy attributes from global rule into current rule\r
- if (globalAttributes) {\r
- for (key in globalAttributes)\r
- attributes[key] = globalAttributes[key];\r
-\r
- attributesOrder.push.apply(attributesOrder, globalAttributesOrder);\r
- }\r
-\r
- // Attributes defined\r
- if (attrData) {\r
- attrData = split(attrData, '|');\r
- for (ai = 0, al = attrData.length; ai < al; ai++) {\r
- matches = attrRuleRegExp.exec(attrData[ai]);\r
- if (matches) {\r
- attr = {};\r
- attrType = matches[1];\r
- attrName = matches[2].replace(/::/g, ':');\r
- prefix = matches[3];\r
- value = matches[4];\r
-\r
- // Required\r
- if (attrType === '!') {\r
- element.attributesRequired = element.attributesRequired || [];\r
- element.attributesRequired.push(attrName);\r
- attr.required = true;\r
- }\r
-\r
- // Denied from global\r
- if (attrType === '-') {\r
- delete attributes[attrName];\r
- attributesOrder.splice(tinymce.inArray(attributesOrder, attrName), 1);\r
- continue;\r
- }\r
-\r
- // Default value\r
- if (prefix) {\r
- // Default value\r
- if (prefix === '=') {\r
- element.attributesDefault = element.attributesDefault || [];\r
- element.attributesDefault.push({name: attrName, value: value});\r
- attr.defaultValue = value;\r
- }\r
-\r
- // Forced value\r
- if (prefix === ':') {\r
- element.attributesForced = element.attributesForced || [];\r
- element.attributesForced.push({name: attrName, value: value});\r
- attr.forcedValue = value;\r
- }\r
-\r
- // Required values\r
- if (prefix === '<')\r
- attr.validValues = makeMap(value, '?');\r
- }\r
-\r
- // Check for attribute patterns\r
- if (hasPatternsRegExp.test(attrName)) {\r
- element.attributePatterns = element.attributePatterns || [];\r
- attr.pattern = patternToRegExp(attrName);\r
- element.attributePatterns.push(attr);\r
- } else {\r
- // Add attribute to order list if it doesn't already exist\r
- if (!attributes[attrName])\r
- attributesOrder.push(attrName);\r
-\r
- attributes[attrName] = attr;\r
- }\r
- }\r
- }\r
- }\r
-\r
- // Global rule, store away these for later usage\r
- if (!globalAttributes && elementName == '@') {\r
- globalAttributes = attributes;\r
- globalAttributesOrder = attributesOrder;\r
- }\r
-\r
- // Handle substitute elements such as b/strong\r
- if (outputName) {\r
- element.outputName = elementName;\r
- elements[outputName] = element;\r
- }\r
-\r
- // Add pattern or exact element\r
- if (hasPatternsRegExp.test(elementName)) {\r
- element.pattern = patternToRegExp(elementName);\r
- patternElements.push(element);\r
- } else\r
- elements[elementName] = element;\r
- }\r
- }\r
- }\r
- };\r
-\r
- function setValidElements(valid_elements) {\r
- elements = {};\r
- patternElements = [];\r
-\r
- addValidElements(valid_elements);\r
-\r
- each(schemaItems, function(element, name) {\r
- children[name] = element.children;\r
- });\r
- };\r
-\r
- // Adds custom non HTML elements to the schema\r
- function addCustomElements(custom_elements) {\r
- var customElementRegExp = /^(~)?(.+)$/;\r
-\r
- if (custom_elements) {\r
- each(split(custom_elements), function(rule) {\r
- var matches = customElementRegExp.exec(rule),\r
- inline = matches[1] === '~',\r
- cloneName = inline ? 'span' : 'div',\r
- name = matches[2];\r
-\r
- children[name] = children[cloneName];\r
- customElementsMap[name] = cloneName;\r
-\r
- // If it's not marked as inline then add it to valid block elements\r
- if (!inline) {\r
- blockElementsMap[name.toUpperCase()] = {};\r
- blockElementsMap[name] = {};\r
- }\r
-\r
- // Add elements clone if needed\r
- if (!elements[name]) {\r
- elements[name] = elements[cloneName];\r
- }\r
-\r
- // Add custom elements at span/div positions\r
- each(children, function(element, child) {\r
- if (element[cloneName])\r
- element[name] = element[cloneName];\r
- });\r
- });\r
- }\r
- };\r
-\r
- // Adds valid children to the schema object\r
- function addValidChildren(valid_children) {\r
- var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;\r
-\r
- if (valid_children) {\r
- each(split(valid_children), function(rule) {\r
- var matches = childRuleRegExp.exec(rule), parent, prefix;\r
-\r
- if (matches) {\r
- prefix = matches[1];\r
-\r
- // Add/remove items from default\r
- if (prefix)\r
- parent = children[matches[2]];\r
- else\r
- parent = children[matches[2]] = {'#comment' : {}};\r
-\r
- parent = children[matches[2]];\r
-\r
- each(split(matches[3], '|'), function(child) {\r
- if (prefix === '-')\r
- delete parent[child];\r
- else\r
- parent[child] = {};\r
- });\r
- }\r
- });\r
- }\r
- };\r
-\r
- function getElementRule(name) {\r
- var element = elements[name], i;\r
-\r
- // Exact match found\r
- if (element)\r
- return element;\r
-\r
- // No exact match then try the patterns\r
- i = patternElements.length;\r
- while (i--) {\r
- element = patternElements[i];\r
-\r
- if (element.pattern.test(name))\r
- return element;\r
- }\r
- };\r
-\r
- if (!settings.valid_elements) {\r
- // No valid elements defined then clone the elements from the schema spec\r
- each(schemaItems, function(element, name) {\r
- elements[name] = {\r
- attributes : element.attributes,\r
- attributesOrder : element.attributesOrder\r
- };\r
-\r
- children[name] = element.children;\r
- });\r
-\r
- // Switch these on HTML4\r
- if (settings.schema != "html5") {\r
- each(split('strong/b,em/i'), function(item) {\r
- item = split(item, '/');\r
- elements[item[1]].outputName = item[0];\r
- });\r
- }\r
-\r
- // Add default alt attribute for images\r
- elements.img.attributesDefault = [{name: 'alt', value: ''}];\r
-\r
- // Remove these if they are empty by default\r
- each(split('ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr,strong,em,b,i'), function(name) {\r
- if (elements[name]) {\r
- elements[name].removeEmpty = true;\r
- }\r
- });\r
-\r
- // Padd these by default\r
- each(split('p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption'), function(name) {\r
- elements[name].paddEmpty = true;\r
- });\r
- } else\r
- setValidElements(settings.valid_elements);\r
-\r
- addCustomElements(settings.custom_elements);\r
- addValidChildren(settings.valid_children);\r
- addValidElements(settings.extended_valid_elements);\r
-\r
- // Todo: Remove this when we fix list handling to be valid\r
- addValidChildren('+ol[ul|ol],+ul[ul|ol]');\r
-\r
- // Delete invalid elements\r
- if (settings.invalid_elements) {\r
- tinymce.each(tinymce.explode(settings.invalid_elements), function(item) {\r
- if (elements[item])\r
- delete elements[item];\r
- });\r
- }\r
-\r
- // If the user didn't allow span only allow internal spans\r
- if (!getElementRule('span'))\r
- addValidElements('span[!data-mce-type|*]');\r
-\r
- self.children = children;\r
-\r
- self.styles = validStyles;\r
-\r
- self.getBoolAttrs = function() {\r
- return boolAttrMap;\r
- };\r
-\r
- self.getBlockElements = function() {\r
- return blockElementsMap;\r
- };\r
-\r
- self.getTextBlockElements = function() {\r
- return textBlockElementsMap;\r
- };\r
-\r
- self.getShortEndedElements = function() {\r
- return shortEndedElementsMap;\r
- };\r
-\r
- self.getSelfClosingElements = function() {\r
- return selfClosingElementsMap;\r
- };\r
-\r
- self.getNonEmptyElements = function() {\r
- return nonEmptyElementsMap;\r
- };\r
-\r
- self.getWhiteSpaceElements = function() {\r
- return whiteSpaceElementsMap;\r
- };\r
-\r
- self.isValidChild = function(name, child) {\r
- var parent = children[name];\r
-\r
- return !!(parent && parent[child]);\r
- };\r
-\r
- self.isValid = function(name, attr) {\r
- var attrPatterns, i, rule = getElementRule(name);\r
-\r
- // Check if it's a valid element\r
- if (rule) {\r
- if (attr) {\r
- // Check if attribute name exists\r
- if (rule.attributes[attr]) {\r
- return true;\r
- }\r
-\r
- // Check if attribute matches a regexp pattern\r
- attrPatterns = rule.attributePatterns;\r
- if (attrPatterns) {\r
- i = attrPatterns.length;\r
- while (i--) {\r
- if (attrPatterns[i].pattern.test(name)) {\r
- return true;\r
- }\r
- }\r
- }\r
- } else {\r
- return true;\r
- }\r
- }\r
-\r
- // No match\r
- return false;\r
- };\r
- \r
- self.getElementRule = getElementRule;\r
-\r
- self.getCustomElements = function() {\r
- return customElementsMap;\r
- };\r
-\r
- self.addValidElements = addValidElements;\r
-\r
- self.setValidElements = setValidElements;\r
-\r
- self.addCustomElements = addCustomElements;\r
-\r
- self.addValidChildren = addValidChildren;\r
-\r
- self.elements = elements;\r
- };\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- tinymce.html.SaxParser = function(settings, schema) {\r
- var self = this, noop = function() {};\r
-\r
- settings = settings || {};\r
- self.schema = schema = schema || new tinymce.html.Schema();\r
-\r
- if (settings.fix_self_closing !== false)\r
- settings.fix_self_closing = true;\r
-\r
- // Add handler functions from settings and setup default handlers\r
- tinymce.each('comment cdata text start end pi doctype'.split(' '), function(name) {\r
- if (name)\r
- self[name] = settings[name] || noop;\r
- });\r
-\r
- self.parse = function(html) {\r
- var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name, isInternalElement, removeInternalElements,\r
- shortEndedElements, fillAttrsMap, isShortEnded, validate, elementRule, isValidElement, attr, attribsValue, invalidPrefixRegExp,\r
- validAttributesMap, validAttributePatterns, attributesRequired, attributesDefault, attributesForced, selfClosing,\r
- tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0, decode = tinymce.html.Entities.decode, fixSelfClosing, isIE;\r
-\r
- function processEndTag(name) {\r
- var pos, i;\r
-\r
- // Find position of parent of the same type\r
- pos = stack.length;\r
- while (pos--) {\r
- if (stack[pos].name === name)\r
- break; \r
- }\r
-\r
- // Found parent\r
- if (pos >= 0) {\r
- // Close all the open elements\r
- for (i = stack.length - 1; i >= pos; i--) {\r
- name = stack[i];\r
-\r
- if (name.valid)\r
- self.end(name.name);\r
- }\r
-\r
- // Remove the open elements from the stack\r
- stack.length = pos;\r
- }\r
- };\r
-\r
- function parseAttribute(match, name, value, val2, val3) {\r
- var attrRule, i;\r
-\r
- name = name.toLowerCase();\r
- value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute\r
-\r
- // Validate name and value\r
- if (validate && !isInternalElement && name.indexOf('data-') !== 0) {\r
- attrRule = validAttributesMap[name];\r
-\r
- // Find rule by pattern matching\r
- if (!attrRule && validAttributePatterns) {\r
- i = validAttributePatterns.length;\r
- while (i--) {\r
- attrRule = validAttributePatterns[i];\r
- if (attrRule.pattern.test(name))\r
- break;\r
- }\r
-\r
- // No rule matched\r
- if (i === -1)\r
- attrRule = null;\r
- }\r
-\r
- // No attribute rule found\r
- if (!attrRule)\r
- return;\r
-\r
- // Validate value\r
- if (attrRule.validValues && !(value in attrRule.validValues))\r
- return;\r
- }\r
-\r
- // Add attribute to list and map\r
- attrList.map[name] = value;\r
- attrList.push({\r
- name: name,\r
- value: value\r
- });\r
- };\r
-\r
- // Precompile RegExps and map objects\r
- tokenRegExp = new RegExp('<(?:' +\r
- '(?:!--([\\w\\W]*?)-->)|' + // Comment\r
- '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA\r
- '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE\r
- '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI\r
- '(?:\\/([^>]+)>)|' + // End element\r
- '(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element\r
- ')', 'g');\r
-\r
- attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;\r
- specialElements = {\r
- 'script' : /<\/script[^>]*>/gi,\r
- 'style' : /<\/style[^>]*>/gi,\r
- 'noscript' : /<\/noscript[^>]*>/gi\r
- };\r
-\r
- // Setup lookup tables for empty elements and boolean attributes\r
- shortEndedElements = schema.getShortEndedElements();\r
- selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();\r
- fillAttrsMap = schema.getBoolAttrs();\r
- validate = settings.validate;\r
- removeInternalElements = settings.remove_internals;\r
- fixSelfClosing = settings.fix_self_closing;\r
- isIE = tinymce.isIE;\r
- invalidPrefixRegExp = /^:/;\r
-\r
- while (matches = tokenRegExp.exec(html)) {\r
- // Text\r
- if (index < matches.index)\r
- self.text(decode(html.substr(index, matches.index - index)));\r
-\r
- if (value = matches[6]) { // End element\r
- value = value.toLowerCase();\r
-\r
- // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements\r
- if (isIE && invalidPrefixRegExp.test(value))\r
- value = value.substr(1);\r
-\r
- processEndTag(value);\r
- } else if (value = matches[7]) { // Start element\r
- value = value.toLowerCase();\r
-\r
- // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements\r
- if (isIE && invalidPrefixRegExp.test(value))\r
- value = value.substr(1);\r
-\r
- isShortEnded = value in shortEndedElements;\r
-\r
- // Is self closing tag for example an <li> after an open <li>\r
- if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value)\r
- processEndTag(value);\r
-\r
- // Validate element\r
- if (!validate || (elementRule = schema.getElementRule(value))) {\r
- isValidElement = true;\r
-\r
- // Grab attributes map and patters when validation is enabled\r
- if (validate) {\r
- validAttributesMap = elementRule.attributes;\r
- validAttributePatterns = elementRule.attributePatterns;\r
- }\r
-\r
- // Parse attributes\r
- if (attribsValue = matches[8]) {\r
- isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element\r
-\r
- // If the element has internal attributes then remove it if we are told to do so\r
- if (isInternalElement && removeInternalElements)\r
- isValidElement = false;\r
-\r
- attrList = [];\r
- attrList.map = {};\r
-\r
- attribsValue.replace(attrRegExp, parseAttribute);\r
- } else {\r
- attrList = [];\r
- attrList.map = {};\r
- }\r
-\r
- // Process attributes if validation is enabled\r
- if (validate && !isInternalElement) {\r
- attributesRequired = elementRule.attributesRequired;\r
- attributesDefault = elementRule.attributesDefault;\r
- attributesForced = elementRule.attributesForced;\r
-\r
- // Handle forced attributes\r
- if (attributesForced) {\r
- i = attributesForced.length;\r
- while (i--) {\r
- attr = attributesForced[i];\r
- name = attr.name;\r
- attrValue = attr.value;\r
-\r
- if (attrValue === '{$uid}')\r
- attrValue = 'mce_' + idCount++;\r
-\r
- attrList.map[name] = attrValue;\r
- attrList.push({name: name, value: attrValue});\r
- }\r
- }\r
-\r
- // Handle default attributes\r
- if (attributesDefault) {\r
- i = attributesDefault.length;\r
- while (i--) {\r
- attr = attributesDefault[i];\r
- name = attr.name;\r
-\r
- if (!(name in attrList.map)) {\r
- attrValue = attr.value;\r
-\r
- if (attrValue === '{$uid}')\r
- attrValue = 'mce_' + idCount++;\r
-\r
- attrList.map[name] = attrValue;\r
- attrList.push({name: name, value: attrValue});\r
- }\r
- }\r
- }\r
-\r
- // Handle required attributes\r
- if (attributesRequired) {\r
- i = attributesRequired.length;\r
- while (i--) {\r
- if (attributesRequired[i] in attrList.map)\r
- break;\r
- }\r
-\r
- // None of the required attributes where found\r
- if (i === -1)\r
- isValidElement = false;\r
- }\r
-\r
- // Invalidate element if it's marked as bogus\r
- if (attrList.map['data-mce-bogus'])\r
- isValidElement = false;\r
- }\r
-\r
- if (isValidElement)\r
- self.start(value, attrList, isShortEnded);\r
- } else\r
- isValidElement = false;\r
-\r
- // Treat script, noscript and style a bit different since they may include code that looks like elements\r
- if (endRegExp = specialElements[value]) {\r
- endRegExp.lastIndex = index = matches.index + matches[0].length;\r
-\r
- if (matches = endRegExp.exec(html)) {\r
- if (isValidElement)\r
- text = html.substr(index, matches.index - index);\r
-\r
- index = matches.index + matches[0].length;\r
- } else {\r
- text = html.substr(index);\r
- index = html.length;\r
- }\r
-\r
- if (isValidElement && text.length > 0)\r
- self.text(text, true);\r
-\r
- if (isValidElement)\r
- self.end(value);\r
-\r
- tokenRegExp.lastIndex = index;\r
- continue;\r
- }\r
-\r
- // Push value on to stack\r
- if (!isShortEnded) {\r
- if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1)\r
- stack.push({name: value, valid: isValidElement});\r
- else if (isValidElement)\r
- self.end(value);\r
- }\r
- } else if (value = matches[1]) { // Comment\r
- self.comment(value);\r
- } else if (value = matches[2]) { // CDATA\r
- self.cdata(value);\r
- } else if (value = matches[3]) { // DOCTYPE\r
- self.doctype(value);\r
- } else if (value = matches[4]) { // PI\r
- self.pi(value, matches[5]);\r
- }\r
-\r
- index = matches.index + matches[0].length;\r
- }\r
-\r
- // Text\r
- if (index < html.length)\r
- self.text(decode(html.substr(index)));\r
-\r
- // Close any open elements\r
- for (i = stack.length - 1; i >= 0; i--) {\r
- value = stack[i];\r
-\r
- if (value.valid)\r
- self.end(value.name);\r
- }\r
- };\r
- }\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = {\r
- '#text' : 3,\r
- '#comment' : 8,\r
- '#cdata' : 4,\r
- '#pi' : 7,\r
- '#doctype' : 10,\r
- '#document-fragment' : 11\r
- };\r
-\r
- // Walks the tree left/right\r
- function walk(node, root_node, prev) {\r
- var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next';\r
-\r
- // Walk into nodes if it has a start\r
- if (node[startName])\r
- return node[startName];\r
-\r
- // Return the sibling if it has one\r
- if (node !== root_node) {\r
- sibling = node[siblingName];\r
-\r
- if (sibling)\r
- return sibling;\r
-\r
- // Walk up the parents to look for siblings\r
- for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) {\r
- sibling = parent[siblingName];\r
-\r
- if (sibling)\r
- return sibling;\r
- }\r
- }\r
- };\r
-\r
- function Node(name, type) {\r
- this.name = name;\r
- this.type = type;\r
-\r
- if (type === 1) {\r
- this.attributes = [];\r
- this.attributes.map = {};\r
- }\r
- }\r
-\r
- tinymce.extend(Node.prototype, {\r
- replace : function(node) {\r
- var self = this;\r
-\r
- if (node.parent)\r
- node.remove();\r
-\r
- self.insert(node, self);\r
- self.remove();\r
-\r
- return self;\r
- },\r
-\r
- attr : function(name, value) {\r
- var self = this, attrs, i, undef;\r
-\r
- if (typeof name !== "string") {\r
- for (i in name)\r
- self.attr(i, name[i]);\r
-\r
- return self;\r
- }\r
-\r
- if (attrs = self.attributes) {\r
- if (value !== undef) {\r
- // Remove attribute\r
- if (value === null) {\r
- if (name in attrs.map) {\r
- delete attrs.map[name];\r
-\r
- i = attrs.length;\r
- while (i--) {\r
- if (attrs[i].name === name) {\r
- attrs = attrs.splice(i, 1);\r
- return self;\r
- }\r
- }\r
- }\r
-\r
- return self;\r
- }\r
-\r
- // Set attribute\r
- if (name in attrs.map) {\r
- // Set attribute\r
- i = attrs.length;\r
- while (i--) {\r
- if (attrs[i].name === name) {\r
- attrs[i].value = value;\r
- break;\r
- }\r
- }\r
- } else\r
- attrs.push({name: name, value: value});\r
-\r
- attrs.map[name] = value;\r
-\r
- return self;\r
- } else {\r
- return attrs.map[name];\r
- }\r
- }\r
- },\r
-\r
- clone : function() {\r
- var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs;\r
-\r
- // Clone element attributes\r
- if (selfAttrs = self.attributes) {\r
- cloneAttrs = [];\r
- cloneAttrs.map = {};\r
-\r
- for (i = 0, l = selfAttrs.length; i < l; i++) {\r
- selfAttr = selfAttrs[i];\r
-\r
- // Clone everything except id\r
- if (selfAttr.name !== 'id') {\r
- cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value};\r
- cloneAttrs.map[selfAttr.name] = selfAttr.value;\r
- }\r
- }\r
-\r
- clone.attributes = cloneAttrs;\r
- }\r
-\r
- clone.value = self.value;\r
- clone.shortEnded = self.shortEnded;\r
-\r
- return clone;\r
- },\r
-\r
- wrap : function(wrapper) {\r
- var self = this;\r
-\r
- self.parent.insert(wrapper, self);\r
- wrapper.append(self);\r
-\r
- return self;\r
- },\r
-\r
- unwrap : function() {\r
- var self = this, node, next;\r
-\r
- for (node = self.firstChild; node; ) {\r
- next = node.next;\r
- self.insert(node, self, true);\r
- node = next;\r
- }\r
-\r
- self.remove();\r
- },\r
-\r
- remove : function() {\r
- var self = this, parent = self.parent, next = self.next, prev = self.prev;\r
-\r
- if (parent) {\r
- if (parent.firstChild === self) {\r
- parent.firstChild = next;\r
-\r
- if (next)\r
- next.prev = null;\r
- } else {\r
- prev.next = next;\r
- }\r
-\r
- if (parent.lastChild === self) {\r
- parent.lastChild = prev;\r
-\r
- if (prev)\r
- prev.next = null;\r
- } else {\r
- next.prev = prev;\r
- }\r
-\r
- self.parent = self.next = self.prev = null;\r
- }\r
-\r
- return self;\r
- },\r
-\r
- append : function(node) {\r
- var self = this, last;\r
-\r
- if (node.parent)\r
- node.remove();\r
-\r
- last = self.lastChild;\r
- if (last) {\r
- last.next = node;\r
- node.prev = last;\r
- self.lastChild = node;\r
- } else\r
- self.lastChild = self.firstChild = node;\r
-\r
- node.parent = self;\r
-\r
- return node;\r
- },\r
-\r
- insert : function(node, ref_node, before) {\r
- var parent;\r
-\r
- if (node.parent)\r
- node.remove();\r
-\r
- parent = ref_node.parent || this;\r
-\r
- if (before) {\r
- if (ref_node === parent.firstChild)\r
- parent.firstChild = node;\r
- else\r
- ref_node.prev.next = node;\r
-\r
- node.prev = ref_node.prev;\r
- node.next = ref_node;\r
- ref_node.prev = node;\r
- } else {\r
- if (ref_node === parent.lastChild)\r
- parent.lastChild = node;\r
- else\r
- ref_node.next.prev = node;\r
-\r
- node.next = ref_node.next;\r
- node.prev = ref_node;\r
- ref_node.next = node;\r
- }\r
-\r
- node.parent = parent;\r
-\r
- return node;\r
- },\r
-\r
- getAll : function(name) {\r
- var self = this, node, collection = [];\r
-\r
- for (node = self.firstChild; node; node = walk(node, self)) {\r
- if (node.name === name)\r
- collection.push(node);\r
- }\r
-\r
- return collection;\r
- },\r
-\r
- empty : function() {\r
- var self = this, nodes, i, node;\r
-\r
- // Remove all children\r
- if (self.firstChild) {\r
- nodes = [];\r
-\r
- // Collect the children\r
- for (node = self.firstChild; node; node = walk(node, self))\r
- nodes.push(node);\r
-\r
- // Remove the children\r
- i = nodes.length;\r
- while (i--) {\r
- node = nodes[i];\r
- node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;\r
- }\r
- }\r
-\r
- self.firstChild = self.lastChild = null;\r
-\r
- return self;\r
- },\r
-\r
- isEmpty : function(elements) {\r
- var self = this, node = self.firstChild, i, name;\r
-\r
- if (node) {\r
- do {\r
- if (node.type === 1) {\r
- // Ignore bogus elements\r
- if (node.attributes.map['data-mce-bogus'])\r
- continue;\r
-\r
- // Keep empty elements like <img />\r
- if (elements[node.name])\r
- return false;\r
-\r
- // Keep elements with data attributes or name attribute like <a name="1"></a>\r
- i = node.attributes.length;\r
- while (i--) {\r
- name = node.attributes[i].name;\r
- if (name === "name" || name.indexOf('data-mce-') === 0)\r
- return false;\r
- }\r
- }\r
-\r
- // Keep comments\r
- if (node.type === 8)\r
- return false;\r
- \r
- // Keep non whitespace text nodes\r
- if ((node.type === 3 && !whiteSpaceRegExp.test(node.value)))\r
- return false;\r
- } while (node = walk(node, self));\r
- }\r
-\r
- return true;\r
- },\r
-\r
- walk : function(prev) {\r
- return walk(this, null, prev);\r
- }\r
- });\r
-\r
- tinymce.extend(Node, {\r
- create : function(name, attrs) {\r
- var node, attrName;\r
-\r
- // Create node\r
- node = new Node(name, typeLookup[name] || 1);\r
-\r
- // Add attributes if needed\r
- if (attrs) {\r
- for (attrName in attrs)\r
- node.attr(attrName, attrs[attrName]);\r
- }\r
-\r
- return node;\r
- }\r
- });\r
-\r
- tinymce.html.Node = Node;\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var Node = tinymce.html.Node;\r
-\r
- tinymce.html.DomParser = function(settings, schema) {\r
- var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {};\r
-\r
- settings = settings || {};\r
- settings.validate = "validate" in settings ? settings.validate : true;\r
- settings.root_name = settings.root_name || 'body';\r
- self.schema = schema = schema || new tinymce.html.Schema();\r
-\r
- function fixInvalidChildren(nodes) {\r
- var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i,\r
- childClone, nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode;\r
-\r
- nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table');\r
- nonEmptyElements = schema.getNonEmptyElements();\r
- textBlockElements = schema.getTextBlockElements();\r
-\r
- for (ni = 0; ni < nodes.length; ni++) {\r
- node = nodes[ni];\r
-\r
- // Already removed or fixed\r
- if (!node.parent || node.fixed)\r
- continue;\r
-\r
- // If the invalid element is a text block and the text block is within a parent LI element\r
- // Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office\r
- if (textBlockElements[node.name] && node.parent.name == 'li') {\r
- // Move sibling text blocks after LI element\r
- sibling = node.next;\r
- while (sibling) {\r
- if (textBlockElements[sibling.name]) {\r
- sibling.name = 'li';\r
- sibling.fixed = true;\r
- node.parent.insert(sibling, node.parent);\r
- } else {\r
- break;\r
- }\r
-\r
- sibling = sibling.next;\r
- }\r
-\r
- // Unwrap current text block\r
- node.unwrap(node);\r
- continue;\r
- }\r
-\r
- // Get list of all parent nodes until we find a valid parent to stick the child into\r
- parents = [node];\r
- for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent)\r
- parents.push(parent);\r
-\r
- // Found a suitable parent\r
- if (parent && parents.length > 1) {\r
- // Reverse the array since it makes looping easier\r
- parents.reverse();\r
-\r
- // Clone the related parent and insert that after the moved node\r
- newParent = currentNode = self.filterNode(parents[0].clone());\r
-\r
- // Start cloning and moving children on the left side of the target node\r
- for (i = 0; i < parents.length - 1; i++) {\r
- if (schema.isValidChild(currentNode.name, parents[i].name)) {\r
- tempNode = self.filterNode(parents[i].clone());\r
- currentNode.append(tempNode);\r
- } else\r
- tempNode = currentNode;\r
-\r
- for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) {\r
- nextNode = childNode.next;\r
- tempNode.append(childNode);\r
- childNode = nextNode;\r
- }\r
-\r
- currentNode = tempNode;\r
- }\r
-\r
- if (!newParent.isEmpty(nonEmptyElements)) {\r
- parent.insert(newParent, parents[0], true);\r
- parent.insert(node, newParent);\r
- } else {\r
- parent.insert(node, parents[0], true);\r
- }\r
-\r
- // Check if the element is empty by looking through it's contents and special treatment for <p><br /></p>\r
- parent = parents[0];\r
- if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') {\r
- parent.empty().remove();\r
- }\r
- } else if (node.parent) {\r
- // If it's an LI try to find a UL/OL for it or wrap it\r
- if (node.name === 'li') {\r
- sibling = node.prev;\r
- if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {\r
- sibling.append(node);\r
- continue;\r
- }\r
-\r
- sibling = node.next;\r
- if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {\r
- sibling.insert(node, sibling.firstChild, true);\r
- continue;\r
- }\r
-\r
- node.wrap(self.filterNode(new Node('ul', 1)));\r
- continue;\r
- }\r
-\r
- // Try wrapping the element in a DIV\r
- if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {\r
- node.wrap(self.filterNode(new Node('div', 1)));\r
- } else {\r
- // We failed wrapping it, then remove or unwrap it\r
- if (node.name === 'style' || node.name === 'script')\r
- node.empty().remove();\r
- else\r
- node.unwrap();\r
- }\r
- }\r
- }\r
- };\r
-\r
- self.filterNode = function(node) {\r
- var i, name, list;\r
-\r
- // Run element filters\r
- if (name in nodeFilters) {\r
- list = matchedNodes[name];\r
-\r
- if (list)\r
- list.push(node);\r
- else\r
- matchedNodes[name] = [node];\r
- }\r
-\r
- // Run attribute filters\r
- i = attributeFilters.length;\r
- while (i--) {\r
- name = attributeFilters[i].name;\r
-\r
- if (name in node.attributes.map) {\r
- list = matchedAttributes[name];\r
-\r
- if (list)\r
- list.push(node);\r
- else\r
- matchedAttributes[name] = [node];\r
- }\r
- }\r
-\r
- return node;\r
- };\r
-\r
- self.addNodeFilter = function(name, callback) {\r
- tinymce.each(tinymce.explode(name), function(name) {\r
- var list = nodeFilters[name];\r
-\r
- if (!list)\r
- nodeFilters[name] = list = [];\r
-\r
- list.push(callback);\r
- });\r
- };\r
-\r
- self.addAttributeFilter = function(name, callback) {\r
- tinymce.each(tinymce.explode(name), function(name) {\r
- var i;\r
-\r
- for (i = 0; i < attributeFilters.length; i++) {\r
- if (attributeFilters[i].name === name) {\r
- attributeFilters[i].callbacks.push(callback);\r
- return;\r
- }\r
- }\r
-\r
- attributeFilters.push({name: name, callbacks: [callback]});\r
- });\r
- };\r
-\r
- self.parse = function(html, args) {\r
- var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate,\r
- blockElements, startWhiteSpaceRegExp, invalidChildren = [], isInWhiteSpacePreservedElement,\r
- endWhiteSpaceRegExp, allWhiteSpaceRegExp, isAllWhiteSpaceRegExp, whiteSpaceElements, children, nonEmptyElements, rootBlockName;\r
-\r
- args = args || {};\r
- matchedNodes = {};\r
- matchedAttributes = {};\r
- blockElements = tinymce.extend(tinymce.makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements());\r
- nonEmptyElements = schema.getNonEmptyElements();\r
- children = schema.children;\r
- validate = settings.validate;\r
- rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block;\r
-\r
- whiteSpaceElements = schema.getWhiteSpaceElements();\r
- startWhiteSpaceRegExp = /^[ \t\r\n]+/;\r
- endWhiteSpaceRegExp = /[ \t\r\n]+$/;\r
- allWhiteSpaceRegExp = /[ \t\r\n]+/g;\r
- isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;\r
-\r
- function addRootBlocks() {\r
- var node = rootNode.firstChild, next, rootBlockNode;\r
-\r
- while (node) {\r
- next = node.next;\r
-\r
- if (node.type == 3 || (node.type == 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type'))) {\r
- if (!rootBlockNode) {\r
- // Create a new root block element\r
- rootBlockNode = createNode(rootBlockName, 1);\r
- rootNode.insert(rootBlockNode, node);\r
- rootBlockNode.append(node);\r
- } else\r
- rootBlockNode.append(node);\r
- } else {\r
- rootBlockNode = null;\r
- }\r
-\r
- node = next;\r
- };\r
- };\r
-\r
- function createNode(name, type) {\r
- var node = new Node(name, type), list;\r
-\r
- if (name in nodeFilters) {\r
- list = matchedNodes[name];\r
-\r
- if (list)\r
- list.push(node);\r
- else\r
- matchedNodes[name] = [node];\r
- }\r
-\r
- return node;\r
- };\r
-\r
- function removeWhitespaceBefore(node) {\r
- var textNode, textVal, sibling;\r
-\r
- for (textNode = node.prev; textNode && textNode.type === 3; ) {\r
- textVal = textNode.value.replace(endWhiteSpaceRegExp, '');\r
-\r
- if (textVal.length > 0) {\r
- textNode.value = textVal;\r
- textNode = textNode.prev;\r
- } else {\r
- sibling = textNode.prev;\r
- textNode.remove();\r
- textNode = sibling;\r
- }\r
- }\r
- };\r
-\r
- function cloneAndExcludeBlocks(input) {\r
- var name, output = {};\r
-\r
- for (name in input) {\r
- if (name !== 'li' && name != 'p') {\r
- output[name] = input[name];\r
- }\r
- }\r
-\r
- return output;\r
- };\r
-\r
- parser = new tinymce.html.SaxParser({\r
- validate : validate,\r
-\r
- // Exclude P and LI from DOM parsing since it's treated better by the DOM parser\r
- self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),\r
-\r
- cdata: function(text) {\r
- node.append(createNode('#cdata', 4)).value = text;\r
- },\r
-\r
- text: function(text, raw) {\r
- var textNode;\r
-\r
- // Trim all redundant whitespace on non white space elements\r
- if (!isInWhiteSpacePreservedElement) {\r
- text = text.replace(allWhiteSpaceRegExp, ' ');\r
-\r
- if (node.lastChild && blockElements[node.lastChild.name])\r
- text = text.replace(startWhiteSpaceRegExp, '');\r
- }\r
-\r
- // Do we need to create the node\r
- if (text.length !== 0) {\r
- textNode = createNode('#text', 3);\r
- textNode.raw = !!raw;\r
- node.append(textNode).value = text;\r
- }\r
- },\r
-\r
- comment: function(text) {\r
- node.append(createNode('#comment', 8)).value = text;\r
- },\r
-\r
- pi: function(name, text) {\r
- node.append(createNode(name, 7)).value = text;\r
- removeWhitespaceBefore(node);\r
- },\r
-\r
- doctype: function(text) {\r
- var newNode;\r
- \r
- newNode = node.append(createNode('#doctype', 10));\r
- newNode.value = text;\r
- removeWhitespaceBefore(node);\r
- },\r
-\r
- start: function(name, attrs, empty) {\r
- var newNode, attrFiltersLen, elementRule, textNode, attrName, text, sibling, parent;\r
-\r
- elementRule = validate ? schema.getElementRule(name) : {};\r
- if (elementRule) {\r
- newNode = createNode(elementRule.outputName || name, 1);\r
- newNode.attributes = attrs;\r
- newNode.shortEnded = empty;\r
-\r
- node.append(newNode);\r
-\r
- // Check if node is valid child of the parent node is the child is\r
- // unknown we don't collect it since it's probably a custom element\r
- parent = children[node.name];\r
- if (parent && children[newNode.name] && !parent[newNode.name])\r
- invalidChildren.push(newNode);\r
-\r
- attrFiltersLen = attributeFilters.length;\r
- while (attrFiltersLen--) {\r
- attrName = attributeFilters[attrFiltersLen].name;\r
-\r
- if (attrName in attrs.map) {\r
- list = matchedAttributes[attrName];\r
-\r
- if (list)\r
- list.push(newNode);\r
- else\r
- matchedAttributes[attrName] = [newNode];\r
- }\r
- }\r
-\r
- // Trim whitespace before block\r
- if (blockElements[name])\r
- removeWhitespaceBefore(newNode);\r
-\r
- // Change current node if the element wasn't empty i.e not <br /> or <img />\r
- if (!empty)\r
- node = newNode;\r
-\r
- // Check if we are inside a whitespace preserved element\r
- if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {\r
- isInWhiteSpacePreservedElement = true;\r
- }\r
- }\r
- },\r
-\r
- end: function(name) {\r
- var textNode, elementRule, text, sibling, tempNode;\r
-\r
- elementRule = validate ? schema.getElementRule(name) : {};\r
- if (elementRule) {\r
- if (blockElements[name]) {\r
- if (!isInWhiteSpacePreservedElement) {\r
- // Trim whitespace of the first node in a block\r
- textNode = node.firstChild;\r
- if (textNode && textNode.type === 3) {\r
- text = textNode.value.replace(startWhiteSpaceRegExp, '');\r
-\r
- // Any characters left after trim or should we remove it\r
- if (text.length > 0) {\r
- textNode.value = text;\r
- textNode = textNode.next;\r
- } else {\r
- sibling = textNode.next;\r
- textNode.remove();\r
- textNode = sibling;\r
- }\r
-\r
- // Remove any pure whitespace siblings\r
- while (textNode && textNode.type === 3) {\r
- text = textNode.value;\r
- sibling = textNode.next;\r
-\r
- if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {\r
- textNode.remove();\r
- textNode = sibling;\r
- }\r
-\r
- textNode = sibling;\r
- }\r
- }\r
-\r
- // Trim whitespace of the last node in a block\r
- textNode = node.lastChild;\r
- if (textNode && textNode.type === 3) {\r
- text = textNode.value.replace(endWhiteSpaceRegExp, '');\r
-\r
- // Any characters left after trim or should we remove it\r
- if (text.length > 0) {\r
- textNode.value = text;\r
- textNode = textNode.prev;\r
- } else {\r
- sibling = textNode.prev;\r
- textNode.remove();\r
- textNode = sibling;\r
- }\r
-\r
- // Remove any pure whitespace siblings\r
- while (textNode && textNode.type === 3) {\r
- text = textNode.value;\r
- sibling = textNode.prev;\r
-\r
- if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {\r
- textNode.remove();\r
- textNode = sibling;\r
- }\r
-\r
- textNode = sibling;\r
- }\r
- }\r
- }\r
-\r
- // Trim start white space\r
- // Removed due to: #5424\r
- /*textNode = node.prev;\r
- if (textNode && textNode.type === 3) {\r
- text = textNode.value.replace(startWhiteSpaceRegExp, '');\r
-\r
- if (text.length > 0)\r
- textNode.value = text;\r
- else\r
- textNode.remove();\r
- }*/\r
- }\r
-\r
- // Check if we exited a whitespace preserved element\r
- if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {\r
- isInWhiteSpacePreservedElement = false;\r
- }\r
-\r
- // Handle empty nodes\r
- if (elementRule.removeEmpty || elementRule.paddEmpty) {\r
- if (node.isEmpty(nonEmptyElements)) {\r
- if (elementRule.paddEmpty)\r
- node.empty().append(new Node('#text', '3')).value = '\u00a0';\r
- else {\r
- // Leave nodes that have a name like <a name="name">\r
- if (!node.attributes.map.name && !node.attributes.map.id) {\r
- tempNode = node.parent;\r
- node.empty().remove();\r
- node = tempNode;\r
- return;\r
- }\r
- }\r
- }\r
- }\r
-\r
- node = node.parent;\r
- }\r
- }\r
- }, schema);\r
-\r
- rootNode = node = new Node(args.context || settings.root_name, 11);\r
-\r
- parser.parse(html);\r
-\r
- // Fix invalid children or report invalid children in a contextual parsing\r
- if (validate && invalidChildren.length) {\r
- if (!args.context)\r
- fixInvalidChildren(invalidChildren);\r
- else\r
- args.invalid = true;\r
- }\r
-\r
- // Wrap nodes in the root into block elements if the root is body\r
- if (rootBlockName && rootNode.name == 'body')\r
- addRootBlocks();\r
-\r
- // Run filters only when the contents is valid\r
- if (!args.invalid) {\r
- // Run node filters\r
- for (name in matchedNodes) {\r
- list = nodeFilters[name];\r
- nodes = matchedNodes[name];\r
-\r
- // Remove already removed children\r
- fi = nodes.length;\r
- while (fi--) {\r
- if (!nodes[fi].parent)\r
- nodes.splice(fi, 1);\r
- }\r
-\r
- for (i = 0, l = list.length; i < l; i++)\r
- list[i](nodes, name, args);\r
- }\r
-\r
- // Run attribute filters\r
- for (i = 0, l = attributeFilters.length; i < l; i++) {\r
- list = attributeFilters[i];\r
-\r
- if (list.name in matchedAttributes) {\r
- nodes = matchedAttributes[list.name];\r
-\r
- // Remove already removed children\r
- fi = nodes.length;\r
- while (fi--) {\r
- if (!nodes[fi].parent)\r
- nodes.splice(fi, 1);\r
- }\r
-\r
- for (fi = 0, fl = list.callbacks.length; fi < fl; fi++)\r
- list.callbacks[fi](nodes, list.name, args);\r
- }\r
- }\r
- }\r
-\r
- return rootNode;\r
- };\r
-\r
- // Remove <br> at end of block elements Gecko and WebKit injects BR elements to\r
- // make it possible to place the caret inside empty blocks. This logic tries to remove\r
- // these elements and keep br elements that where intended to be there intact\r
- if (settings.remove_trailing_brs) {\r
- self.addNodeFilter('br', function(nodes, name) {\r
- var i, l = nodes.length, node, blockElements = tinymce.extend({}, schema.getBlockElements()),\r
- nonEmptyElements = schema.getNonEmptyElements(), parent, lastParent, prev, prevName;\r
-\r
- // Remove brs from body element as well\r
- blockElements.body = 1;\r
-\r
- // Must loop forwards since it will otherwise remove all brs in <p>a<br><br><br></p>\r
- for (i = 0; i < l; i++) {\r
- node = nodes[i];\r
- parent = node.parent;\r
-\r
- if (blockElements[node.parent.name] && node === parent.lastChild) {\r
- // Loop all nodes to the left of the current node and check for other BR elements\r
- // excluding bookmarks since they are invisible\r
- prev = node.prev;\r
- while (prev) {\r
- prevName = prev.name;\r
-\r
- // Ignore bookmarks\r
- if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') {\r
- // Found a non BR element\r
- if (prevName !== "br")\r
- break;\r
- \r
- // Found another br it's a <br><br> structure then don't remove anything\r
- if (prevName === 'br') {\r
- node = null;\r
- break;\r
- }\r
- }\r
-\r
- prev = prev.prev;\r
- }\r
-\r
- if (node) {\r
- node.remove();\r
-\r
- // Is the parent to be considered empty after we removed the BR\r
- if (parent.isEmpty(nonEmptyElements)) {\r
- elementRule = schema.getElementRule(parent.name);\r
-\r
- // Remove or padd the element depending on schema rule\r
- if (elementRule) {\r
- if (elementRule.removeEmpty)\r
- parent.remove();\r
- else if (elementRule.paddEmpty)\r
- parent.empty().append(new tinymce.html.Node('#text', 3)).value = '\u00a0';\r
- }\r
- }\r
- }\r
- } else {\r
- // Replaces BR elements inside inline elements like <p><b><i><br></i></b></p> so they become <p><b><i> </i></b></p> \r
- lastParent = node;\r
- while (parent.firstChild === lastParent && parent.lastChild === lastParent) {\r
- lastParent = parent;\r
-\r
- if (blockElements[parent.name]) {\r
- break;\r
- }\r
-\r
- parent = parent.parent;\r
- }\r
-\r
- if (lastParent === parent) {\r
- textNode = new tinymce.html.Node('#text', 3);\r
- textNode.value = '\u00a0';\r
- node.replace(textNode);\r
- }\r
- }\r
- }\r
- });\r
- }\r
-\r
- // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.\r
- if (!settings.allow_html_in_named_anchor) {\r
- self.addAttributeFilter('id,name', function(nodes, name) {\r
- var i = nodes.length, sibling, prevSibling, parent, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- if (node.name === 'a' && node.firstChild && !node.attr('href')) {\r
- parent = node.parent;\r
-\r
- // Move children after current node\r
- sibling = node.lastChild;\r
- do {\r
- prevSibling = sibling.prev;\r
- parent.insert(sibling, node);\r
- sibling = prevSibling;\r
- } while (sibling);\r
- }\r
- }\r
- });\r
- }\r
- }\r
-})(tinymce);\r
-\r
-tinymce.html.Writer = function(settings) {\r
- var html = [], indent, indentBefore, indentAfter, encode, htmlOutput;\r
-\r
- settings = settings || {};\r
- indent = settings.indent;\r
- indentBefore = tinymce.makeMap(settings.indent_before || '');\r
- indentAfter = tinymce.makeMap(settings.indent_after || '');\r
- encode = tinymce.html.Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);\r
- htmlOutput = settings.element_format == "html";\r
-\r
- return {\r
- start: function(name, attrs, empty) {\r
- var i, l, attr, value;\r
-\r
- if (indent && indentBefore[name] && html.length > 0) {\r
- value = html[html.length - 1];\r
-\r
- if (value.length > 0 && value !== '\n')\r
- html.push('\n');\r
- }\r
-\r
- html.push('<', name);\r
-\r
- if (attrs) {\r
- for (i = 0, l = attrs.length; i < l; i++) {\r
- attr = attrs[i];\r
- html.push(' ', attr.name, '="', encode(attr.value, true), '"');\r
- }\r
- }\r
-\r
- if (!empty || htmlOutput)\r
- html[html.length] = '>';\r
- else\r
- html[html.length] = ' />';\r
-\r
- if (empty && indent && indentAfter[name] && html.length > 0) {\r
- value = html[html.length - 1];\r
-\r
- if (value.length > 0 && value !== '\n')\r
- html.push('\n');\r
- }\r
- },\r
-\r
- end: function(name) {\r
- var value;\r
-\r
- /*if (indent && indentBefore[name] && html.length > 0) {\r
- value = html[html.length - 1];\r
-\r
- if (value.length > 0 && value !== '\n')\r
- html.push('\n');\r
- }*/\r
-\r
- html.push('</', name, '>');\r
-\r
- if (indent && indentAfter[name] && html.length > 0) {\r
- value = html[html.length - 1];\r
-\r
- if (value.length > 0 && value !== '\n')\r
- html.push('\n');\r
- }\r
- },\r
-\r
- text: function(text, raw) {\r
- if (text.length > 0)\r
- html[html.length] = raw ? text : encode(text);\r
- },\r
-\r
- cdata: function(text) {\r
- html.push('<![CDATA[', text, ']]>');\r
- },\r
-\r
- comment: function(text) {\r
- html.push('<!--', text, '-->');\r
- },\r
-\r
- pi: function(name, text) {\r
- if (text)\r
- html.push('<?', name, ' ', text, '?>');\r
- else\r
- html.push('<?', name, '?>');\r
-\r
- if (indent)\r
- html.push('\n');\r
- },\r
-\r
- doctype: function(text) {\r
- html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');\r
- },\r
-\r
- reset: function() {\r
- html.length = 0;\r
- },\r
-\r
- getContent: function() {\r
- return html.join('').replace(/\n$/, '');\r
- }\r
- };\r
-};\r
-\r
-(function(tinymce) {\r
- tinymce.html.Serializer = function(settings, schema) {\r
- var self = this, writer = new tinymce.html.Writer(settings);\r
-\r
- settings = settings || {};\r
- settings.validate = "validate" in settings ? settings.validate : true;\r
-\r
- self.schema = schema = schema || new tinymce.html.Schema();\r
- self.writer = writer;\r
-\r
- self.serialize = function(node) {\r
- var handlers, validate;\r
-\r
- validate = settings.validate;\r
-\r
- handlers = {\r
- // #text\r
- 3: function(node, raw) {\r
- writer.text(node.value, node.raw);\r
- },\r
-\r
- // #comment\r
- 8: function(node) {\r
- writer.comment(node.value);\r
- },\r
-\r
- // Processing instruction\r
- 7: function(node) {\r
- writer.pi(node.name, node.value);\r
- },\r
-\r
- // Doctype\r
- 10: function(node) {\r
- writer.doctype(node.value);\r
- },\r
-\r
- // CDATA\r
- 4: function(node) {\r
- writer.cdata(node.value);\r
- },\r
-\r
- // Document fragment\r
- 11: function(node) {\r
- if ((node = node.firstChild)) {\r
- do {\r
- walk(node);\r
- } while (node = node.next);\r
- }\r
- }\r
- };\r
-\r
- writer.reset();\r
-\r
- function walk(node) {\r
- var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule;\r
-\r
- if (!handler) {\r
- name = node.name;\r
- isEmpty = node.shortEnded;\r
- attrs = node.attributes;\r
-\r
- // Sort attributes\r
- if (validate && attrs && attrs.length > 1) {\r
- sortedAttrs = [];\r
- sortedAttrs.map = {};\r
-\r
- elementRule = schema.getElementRule(node.name);\r
- for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) {\r
- attrName = elementRule.attributesOrder[i];\r
-\r
- if (attrName in attrs.map) {\r
- attrValue = attrs.map[attrName];\r
- sortedAttrs.map[attrName] = attrValue;\r
- sortedAttrs.push({name: attrName, value: attrValue});\r
- }\r
- }\r
-\r
- for (i = 0, l = attrs.length; i < l; i++) {\r
- attrName = attrs[i].name;\r
-\r
- if (!(attrName in sortedAttrs.map)) {\r
- attrValue = attrs.map[attrName];\r
- sortedAttrs.map[attrName] = attrValue;\r
- sortedAttrs.push({name: attrName, value: attrValue});\r
- }\r
- }\r
-\r
- attrs = sortedAttrs;\r
- }\r
-\r
- writer.start(node.name, attrs, isEmpty);\r
-\r
- if (!isEmpty) {\r
- if ((node = node.firstChild)) {\r
- do {\r
- walk(node);\r
- } while (node = node.next);\r
- }\r
-\r
- writer.end(name);\r
- }\r
- } else\r
- handler(node);\r
- }\r
-\r
- // Serialize element and treat all non elements as fragments\r
- if (node.type == 1 && !settings.inner)\r
- walk(node);\r
- else\r
- handlers[11](node);\r
-\r
- return writer.getContent();\r
- };\r
- }\r
-})(tinymce);\r
-\r
-// JSLint defined globals\r
-/*global tinymce:false, window:false */\r
-\r
-tinymce.dom = {};\r
-\r
-(function(namespace, expando) {\r
- var w3cEventModel = !!document.addEventListener;\r
-\r
- function addEvent(target, name, callback, capture) {\r
- if (target.addEventListener) {\r
- target.addEventListener(name, callback, capture || false);\r
- } else if (target.attachEvent) {\r
- target.attachEvent('on' + name, callback);\r
- }\r
- }\r
-\r
- function removeEvent(target, name, callback, capture) {\r
- if (target.removeEventListener) {\r
- target.removeEventListener(name, callback, capture || false);\r
- } else if (target.detachEvent) {\r
- target.detachEvent('on' + name, callback);\r
- }\r
- }\r
-\r
- function fix(original_event, data) {\r
- var name, event = data || {};\r
-\r
- // Dummy function that gets replaced on the delegation state functions\r
- function returnFalse() {\r
- return false;\r
- }\r
-\r
- // Dummy function that gets replaced on the delegation state functions\r
- function returnTrue() {\r
- return true;\r
- }\r
-\r
- // Copy all properties from the original event\r
- for (name in original_event) {\r
- // layerX/layerY is deprecated in Chrome and produces a warning\r
- if (name !== "layerX" && name !== "layerY") {\r
- event[name] = original_event[name];\r
- }\r
- }\r
-\r
- // Normalize target IE uses srcElement\r
- if (!event.target) {\r
- event.target = event.srcElement || document;\r
- }\r
-\r
- // Add preventDefault method\r
- event.preventDefault = function() {\r
- event.isDefaultPrevented = returnTrue;\r
-\r
- // Execute preventDefault on the original event object\r
- if (original_event) {\r
- if (original_event.preventDefault) {\r
- original_event.preventDefault();\r
- } else {\r
- original_event.returnValue = false; // IE\r
- }\r
- }\r
- };\r
-\r
- // Add stopPropagation\r
- event.stopPropagation = function() {\r
- event.isPropagationStopped = returnTrue;\r
-\r
- // Execute stopPropagation on the original event object\r
- if (original_event) {\r
- if (original_event.stopPropagation) {\r
- original_event.stopPropagation();\r
- } else {\r
- original_event.cancelBubble = true; // IE\r
- }\r
- }\r
- };\r
-\r
- // Add stopImmediatePropagation\r
- event.stopImmediatePropagation = function() {\r
- event.isImmediatePropagationStopped = returnTrue;\r
- event.stopPropagation();\r
- };\r
-\r
- // Add event delegation states\r
- if (!event.isDefaultPrevented) {\r
- event.isDefaultPrevented = returnFalse;\r
- event.isPropagationStopped = returnFalse;\r
- event.isImmediatePropagationStopped = returnFalse;\r
- }\r
-\r
- return event;\r
- }\r
-\r
- function bindOnReady(win, callback, event_utils) {\r
- var doc = win.document, event = {type: 'ready'};\r
-\r
- // Gets called when the DOM is ready\r
- function readyHandler() {\r
- if (!event_utils.domLoaded) {\r
- event_utils.domLoaded = true;\r
- callback(event);\r
- }\r
- }\r
-\r
- // Page already loaded then fire it directly\r
- if (doc.readyState == "complete") {\r
- readyHandler();\r
- return;\r
- }\r
-\r
- // Use W3C method\r
- if (w3cEventModel) {\r
- addEvent(win, 'DOMContentLoaded', readyHandler);\r
- } else {\r
- // Use IE method\r
- addEvent(doc, "readystatechange", function() {\r
- if (doc.readyState === "complete") {\r
- removeEvent(doc, "readystatechange", arguments.callee);\r
- readyHandler();\r
- }\r
- });\r
-\r
- // Wait until we can scroll, when we can the DOM is initialized\r
- if (doc.documentElement.doScroll && win === win.top) {\r
- (function() {\r
- try {\r
- // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author.\r
- // http://javascript.nwbox.com/IEContentLoaded/\r
- doc.documentElement.doScroll("left");\r
- } catch (ex) {\r
- setTimeout(arguments.callee, 0);\r
- return;\r
- }\r
-\r
- readyHandler();\r
- })();\r
- }\r
- }\r
-\r
- // Fallback if any of the above methods should fail for some odd reason\r
- addEvent(win, 'load', readyHandler);\r
- }\r
-\r
- function EventUtils(proxy) {\r
- var self = this, events = {}, count, isFocusBlurBound, hasFocusIn, hasMouseEnterLeave, mouseEnterLeave;\r
-\r
- hasMouseEnterLeave = "onmouseenter" in document.documentElement;\r
- hasFocusIn = "onfocusin" in document.documentElement;\r
- mouseEnterLeave = {mouseenter: 'mouseover', mouseleave: 'mouseout'};\r
- count = 1;\r
-\r
- // State if the DOMContentLoaded was executed or not\r
- self.domLoaded = false;\r
- self.events = events;\r
-\r
- function executeHandlers(evt, id) {\r
- var callbackList, i, l, callback;\r
-\r
- callbackList = events[id][evt.type];\r
- if (callbackList) {\r
- for (i = 0, l = callbackList.length; i < l; i++) {\r
- callback = callbackList[i];\r
- \r
- // Check if callback exists might be removed if a unbind is called inside the callback\r
- if (callback && callback.func.call(callback.scope, evt) === false) {\r
- evt.preventDefault();\r
- }\r
-\r
- // Should we stop propagation to immediate listeners\r
- if (evt.isImmediatePropagationStopped()) {\r
- return;\r
- }\r
- }\r
- }\r
- }\r
-\r
- self.bind = function(target, names, callback, scope) {\r
- var id, callbackList, i, name, fakeName, nativeHandler, capture, win = window;\r
-\r
- // Native event handler function patches the event and executes the callbacks for the expando\r
- function defaultNativeHandler(evt) {\r
- executeHandlers(fix(evt || win.event), id);\r
- }\r
-\r
- // Don't bind to text nodes or comments\r
- if (!target || target.nodeType === 3 || target.nodeType === 8) {\r
- return;\r
- }\r
-\r
- // Create or get events id for the target\r
- if (!target[expando]) {\r
- id = count++;\r
- target[expando] = id;\r
- events[id] = {};\r
- } else {\r
- id = target[expando];\r
-\r
- if (!events[id]) {\r
- events[id] = {};\r
- }\r
- }\r
-\r
- // Setup the specified scope or use the target as a default\r
- scope = scope || target;\r
-\r
- // Split names and bind each event, enables you to bind multiple events with one call\r
- names = names.split(' ');\r
- i = names.length;\r
- while (i--) {\r
- name = names[i];\r
- nativeHandler = defaultNativeHandler;\r
- fakeName = capture = false;\r
-\r
- // Use ready instead of DOMContentLoaded\r
- if (name === "DOMContentLoaded") {\r
- name = "ready";\r
- }\r
-\r
- // DOM is already ready\r
- if ((self.domLoaded || target.readyState == 'complete') && name === "ready") {\r
- self.domLoaded = true;\r
- callback.call(scope, fix({type: name}));\r
- continue;\r
- }\r
-\r
- // Handle mouseenter/mouseleaver\r
- if (!hasMouseEnterLeave) {\r
- fakeName = mouseEnterLeave[name];\r
-\r
- if (fakeName) {\r
- nativeHandler = function(evt) {\r
- var current, related;\r
-\r
- current = evt.currentTarget;\r
- related = evt.relatedTarget;\r
-\r
- // Check if related is inside the current target if it's not then the event should be ignored since it's a mouseover/mouseout inside the element\r
- if (related && current.contains) {\r
- // Use contains for performance\r
- related = current.contains(related);\r
- } else {\r
- while (related && related !== current) {\r
- related = related.parentNode;\r
- }\r
- }\r
-\r
- // Fire fake event\r
- if (!related) {\r
- evt = fix(evt || win.event);\r
- evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter';\r
- evt.target = current;\r
- executeHandlers(evt, id);\r
- }\r
- };\r
- }\r
- }\r
-\r
- // Fake bubbeling of focusin/focusout\r
- if (!hasFocusIn && (name === "focusin" || name === "focusout")) {\r
- capture = true;\r
- fakeName = name === "focusin" ? "focus" : "blur";\r
- nativeHandler = function(evt) {\r
- evt = fix(evt || win.event);\r
- evt.type = evt.type === 'focus' ? 'focusin' : 'focusout';\r
- executeHandlers(evt, id);\r
- };\r
- }\r
-\r
- // Setup callback list and bind native event\r
- callbackList = events[id][name];\r
- if (!callbackList) {\r
- events[id][name] = callbackList = [{func: callback, scope: scope}];\r
- callbackList.fakeName = fakeName;\r
- callbackList.capture = capture;\r
-\r
- // Add the nativeHandler to the callback list so that we can later unbind it\r
- callbackList.nativeHandler = nativeHandler;\r
- if (!w3cEventModel) {\r
- callbackList.proxyHandler = proxy(id);\r
- }\r
-\r
- // Check if the target has native events support\r
- if (name === "ready") {\r
- bindOnReady(target, nativeHandler, self);\r
- } else {\r
- addEvent(target, fakeName || name, w3cEventModel ? nativeHandler : callbackList.proxyHandler, capture);\r
- }\r
- } else {\r
- // If it already has an native handler then just push the callback\r
- callbackList.push({func: callback, scope: scope});\r
- }\r
- }\r
-\r
- target = callbackList = 0; // Clean memory for IE\r
-\r
- return callback;\r
- };\r
-\r
- self.unbind = function(target, names, callback) {\r
- var id, callbackList, i, ci, name, eventMap;\r
-\r
- // Don't bind to text nodes or comments\r
- if (!target || target.nodeType === 3 || target.nodeType === 8) {\r
- return self;\r
- }\r
-\r
- // Unbind event or events if the target has the expando\r
- id = target[expando];\r
- if (id) {\r
- eventMap = events[id];\r
-\r
- // Specific callback\r
- if (names) {\r
- names = names.split(' ');\r
- i = names.length;\r
- while (i--) {\r
- name = names[i];\r
- callbackList = eventMap[name];\r
-\r
- // Unbind the event if it exists in the map\r
- if (callbackList) {\r
- // Remove specified callback\r
- if (callback) {\r
- ci = callbackList.length;\r
- while (ci--) {\r
- if (callbackList[ci].func === callback) {\r
- callbackList.splice(ci, 1);\r
- }\r
- }\r
- }\r
-\r
- // Remove all callbacks if there isn't a specified callback or there is no callbacks left\r
- if (!callback || callbackList.length === 0) {\r
- delete eventMap[name];\r
- removeEvent(target, callbackList.fakeName || name, w3cEventModel ? callbackList.nativeHandler : callbackList.proxyHandler, callbackList.capture);\r
- }\r
- }\r
- }\r
- } else {\r
- // All events for a specific element\r
- for (name in eventMap) {\r
- callbackList = eventMap[name];\r
- removeEvent(target, callbackList.fakeName || name, w3cEventModel ? callbackList.nativeHandler : callbackList.proxyHandler, callbackList.capture);\r
- }\r
-\r
- eventMap = {};\r
- }\r
-\r
- // Check if object is empty, if it isn't then we won't remove the expando map\r
- for (name in eventMap) {\r
- return self;\r
- }\r
-\r
- // Delete event object\r
- delete events[id];\r
-\r
- // Remove expando from target\r
- try {\r
- // IE will fail here since it can't delete properties from window\r
- delete target[expando];\r
- } catch (ex) {\r
- // IE will set it to null\r
- target[expando] = null;\r
- }\r
- }\r
-\r
- return self;\r
- };\r
-\r
- self.fire = function(target, name, args) {\r
- var id, event;\r
-\r
- // Don't bind to text nodes or comments\r
- if (!target || target.nodeType === 3 || target.nodeType === 8) {\r
- return self;\r
- }\r
-\r
- // Build event object by patching the args\r
- event = fix(null, args);\r
- event.type = name;\r
-\r
- do {\r
- // Found an expando that means there is listeners to execute\r
- id = target[expando];\r
- if (id) {\r
- executeHandlers(event, id);\r
- }\r
-\r
- // Walk up the DOM\r
- target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow;\r
- } while (target && !event.isPropagationStopped());\r
-\r
- return self;\r
- };\r
-\r
- self.clean = function(target) {\r
- var i, children, unbind = self.unbind;\r
- \r
- // Don't bind to text nodes or comments\r
- if (!target || target.nodeType === 3 || target.nodeType === 8) {\r
- return self;\r
- }\r
-\r
- // Unbind any element on the specificed target\r
- if (target[expando]) {\r
- unbind(target);\r
- }\r
-\r
- // Target doesn't have getElementsByTagName it's probably a window object then use it's document to find the children\r
- if (!target.getElementsByTagName) {\r
- target = target.document;\r
- }\r
-\r
- // Remove events from each child element\r
- if (target && target.getElementsByTagName) {\r
- unbind(target);\r
-\r
- children = target.getElementsByTagName('*');\r
- i = children.length;\r
- while (i--) {\r
- target = children[i];\r
-\r
- if (target[expando]) {\r
- unbind(target);\r
- }\r
- }\r
- }\r
-\r
- return self;\r
- };\r
-\r
- self.callNativeHandler = function(id, evt) {\r
- if (events) {\r
- events[id][evt.type].nativeHandler(evt);\r
- }\r
- };\r
-\r
- self.destory = function() {\r
- events = {};\r
- };\r
-\r
- // Legacy function calls\r
-\r
- self.add = function(target, events, func, scope) {\r
- // Old API supported direct ID assignment\r
- if (typeof(target) === "string") {\r
- target = document.getElementById(target);\r
- }\r
-\r
- // Old API supported multiple targets\r
- if (target && target instanceof Array) {\r
- var i = target.length;\r
-\r
- while (i--) {\r
- self.add(target[i], events, func, scope);\r
- }\r
-\r
- return;\r
- }\r
-\r
- // Old API called ready init\r
- if (events === "init") {\r
- events = "ready";\r
- }\r
-\r
- return self.bind(target, events instanceof Array ? events.join(' ') : events, func, scope);\r
- };\r
-\r
- self.remove = function(target, events, func, scope) {\r
- if (!target) {\r
- return self;\r
- }\r
-\r
- // Old API supported direct ID assignment\r
- if (typeof(target) === "string") {\r
- target = document.getElementById(target);\r
- }\r
-\r
- // Old API supported multiple targets\r
- if (target instanceof Array) {\r
- var i = target.length;\r
-\r
- while (i--) {\r
- self.remove(target[i], events, func, scope);\r
- }\r
-\r
- return self;\r
- }\r
-\r
- return self.unbind(target, events instanceof Array ? events.join(' ') : events, func);\r
- };\r
-\r
- self.clear = function(target) {\r
- // Old API supported direct ID assignment\r
- if (typeof(target) === "string") {\r
- target = document.getElementById(target);\r
- }\r
-\r
- return self.clean(target);\r
- };\r
-\r
- self.cancel = function(e) {\r
- if (e) {\r
- self.prevent(e);\r
- self.stop(e);\r
- }\r
-\r
- return false;\r
- };\r
-\r
- self.prevent = function(e) {\r
- if (!e.preventDefault) {\r
- e = fix(e);\r
- }\r
-\r
- e.preventDefault();\r
-\r
- return false;\r
- };\r
-\r
- self.stop = function(e) {\r
- if (!e.stopPropagation) {\r
- e = fix(e);\r
- }\r
-\r
- e.stopPropagation();\r
-\r
- return false;\r
- };\r
- }\r
-\r
- namespace.EventUtils = EventUtils;\r
-\r
- namespace.Event = new EventUtils(function(id) {\r
- return function(evt) {\r
- tinymce.dom.Event.callNativeHandler(id, evt);\r
- };\r
- });\r
-\r
- // Bind ready event when tinymce script is loaded\r
- namespace.Event.bind(window, 'ready', function() {});\r
-\r
- namespace = 0;\r
-})(tinymce.dom, 'data-mce-expando'); // Namespace and expando\r
-\r
-tinymce.dom.TreeWalker = function(start_node, root_node) {\r
- var node = start_node;\r
-\r
- function findSibling(node, start_name, sibling_name, shallow) {\r
- var sibling, parent;\r
-\r
- if (node) {\r
- // Walk into nodes if it has a start\r
- if (!shallow && node[start_name])\r
- return node[start_name];\r
-\r
- // Return the sibling if it has one\r
- if (node != root_node) {\r
- sibling = node[sibling_name];\r
- if (sibling)\r
- return sibling;\r
-\r
- // Walk up the parents to look for siblings\r
- for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) {\r
- sibling = parent[sibling_name];\r
- if (sibling)\r
- return sibling;\r
- }\r
- }\r
- }\r
- };\r
-\r
- this.current = function() {\r
- return node;\r
- };\r
-\r
- this.next = function(shallow) {\r
- return (node = findSibling(node, 'firstChild', 'nextSibling', shallow));\r
- };\r
-\r
- this.prev = function(shallow) {\r
- return (node = findSibling(node, 'lastChild', 'previousSibling', shallow));\r
- };\r
-};\r
-\r
-(function(tinymce) {\r
- // Shorten names\r
- var each = tinymce.each,\r
- is = tinymce.is,\r
- isWebKit = tinymce.isWebKit,\r
- isIE = tinymce.isIE,\r
- Entities = tinymce.html.Entities,\r
- simpleSelectorRe = /^([a-z0-9],?)+$/i,\r
- whiteSpaceRegExp = /^[ \t\r\n]*$/;\r
-\r
- tinymce.create('tinymce.dom.DOMUtils', {\r
- doc : null,\r
- root : null,\r
- files : null,\r
- pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/,\r
- props : {\r
- "for" : "htmlFor",\r
- "class" : "className",\r
- className : "className",\r
- checked : "checked",\r
- disabled : "disabled",\r
- maxlength : "maxLength",\r
- readonly : "readOnly",\r
- selected : "selected",\r
- value : "value",\r
- id : "id",\r
- name : "name",\r
- type : "type"\r
- },\r
-\r
- DOMUtils : function(d, s) {\r
- var t = this, globalStyle, name, blockElementsMap;\r
-\r
- t.doc = d;\r
- t.win = window;\r
- t.files = {};\r
- t.cssFlicker = false;\r
- t.counter = 0;\r
- t.stdMode = !tinymce.isIE || d.documentMode >= 8;\r
- t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat" || t.stdMode;\r
- t.hasOuterHTML = "outerHTML" in d.createElement("a");\r
-\r
- t.settings = s = tinymce.extend({\r
- keep_values : false,\r
- hex_colors : 1\r
- }, s);\r
- \r
- t.schema = s.schema;\r
- t.styles = new tinymce.html.Styles({\r
- url_converter : s.url_converter,\r
- url_converter_scope : s.url_converter_scope\r
- }, s.schema);\r
-\r
- // Fix IE6SP2 flicker and check it failed for pre SP2\r
- if (tinymce.isIE6) {\r
- try {\r
- d.execCommand('BackgroundImageCache', false, true);\r
- } catch (e) {\r
- t.cssFlicker = true;\r
- }\r
- }\r
-\r
- t.fixDoc(d);\r
- t.events = s.ownEvents ? new tinymce.dom.EventUtils(s.proxy) : tinymce.dom.Event;\r
- tinymce.addUnload(t.destroy, t);\r
- blockElementsMap = s.schema ? s.schema.getBlockElements() : {};\r
-\r
- t.isBlock = function(node) {\r
- // Fix for #5446\r
- if (!node) {\r
- return false;\r
- }\r
-\r
- // This function is called in module pattern style since it might be executed with the wrong this scope\r
- var type = node.nodeType;\r
-\r
- // If it's a node then check the type and use the nodeName\r
- if (type)\r
- return !!(type === 1 && blockElementsMap[node.nodeName]);\r
-\r
- return !!blockElementsMap[node];\r
- };\r
- },\r
-\r
- fixDoc: function(doc) {\r
- var settings = this.settings, name;\r
-\r
- if (isIE && settings.schema) {\r
- // Add missing HTML 4/5 elements to IE\r
- ('abbr article aside audio canvas ' +\r
- 'details figcaption figure footer ' +\r
- 'header hgroup mark menu meter nav ' +\r
- 'output progress section summary ' +\r
- 'time video').replace(/\w+/g, function(name) {\r
- doc.createElement(name);\r
- });\r
-\r
- // Create all custom elements\r
- for (name in settings.schema.getCustomElements()) {\r
- doc.createElement(name);\r
- }\r
- }\r
- },\r
-\r
- clone: function(node, deep) {\r
- var self = this, clone, doc;\r
-\r
- // TODO: Add feature detection here in the future\r
- if (!isIE || node.nodeType !== 1 || deep) {\r
- return node.cloneNode(deep);\r
- }\r
-\r
- doc = self.doc;\r
-\r
- // Make a HTML5 safe shallow copy\r
- if (!deep) {\r
- clone = doc.createElement(node.nodeName);\r
-\r
- // Copy attribs\r
- each(self.getAttribs(node), function(attr) {\r
- self.setAttrib(clone, attr.nodeName, self.getAttrib(node, attr.nodeName));\r
- });\r
-\r
- return clone;\r
- }\r
-/*\r
- // Setup HTML5 patched document fragment\r
- if (!self.frag) {\r
- self.frag = doc.createDocumentFragment();\r
- self.fixDoc(self.frag);\r
- }\r
-\r
- // Make a deep copy by adding it to the document fragment then removing it this removed the :section\r
- clone = doc.createElement('div');\r
- self.frag.appendChild(clone);\r
- clone.innerHTML = node.outerHTML;\r
- self.frag.removeChild(clone);\r
-*/\r
- return clone.firstChild;\r
- },\r
-\r
- getRoot : function() {\r
- var t = this, s = t.settings;\r
-\r
- return (s && t.get(s.root_element)) || t.doc.body;\r
- },\r
-\r
- getViewPort : function(w) {\r
- var d, b;\r
-\r
- w = !w ? this.win : w;\r
- d = w.document;\r
- b = this.boxModel ? d.documentElement : d.body;\r
-\r
- // Returns viewport size excluding scrollbars\r
- return {\r
- x : w.pageXOffset || b.scrollLeft,\r
- y : w.pageYOffset || b.scrollTop,\r
- w : w.innerWidth || b.clientWidth,\r
- h : w.innerHeight || b.clientHeight\r
- };\r
- },\r
-\r
- getRect : function(e) {\r
- var p, t = this, sr;\r
-\r
- e = t.get(e);\r
- p = t.getPos(e);\r
- sr = t.getSize(e);\r
-\r
- return {\r
- x : p.x,\r
- y : p.y,\r
- w : sr.w,\r
- h : sr.h\r
- };\r
- },\r
-\r
- getSize : function(e) {\r
- var t = this, w, h;\r
-\r
- e = t.get(e);\r
- w = t.getStyle(e, 'width');\r
- h = t.getStyle(e, 'height');\r
-\r
- // Non pixel value, then force offset/clientWidth\r
- if (w.indexOf('px') === -1)\r
- w = 0;\r
-\r
- // Non pixel value, then force offset/clientWidth\r
- if (h.indexOf('px') === -1)\r
- h = 0;\r
-\r
- return {\r
- w : parseInt(w, 10) || e.offsetWidth || e.clientWidth,\r
- h : parseInt(h, 10) || e.offsetHeight || e.clientHeight\r
- };\r
- },\r
-\r
- getParent : function(n, f, r) {\r
- return this.getParents(n, f, r, false);\r
- },\r
-\r
- getParents : function(n, f, r, c) {\r
- var t = this, na, se = t.settings, o = [];\r
-\r
- n = t.get(n);\r
- c = c === undefined;\r
-\r
- if (se.strict_root)\r
- r = r || t.getRoot();\r
-\r
- // Wrap node name as func\r
- if (is(f, 'string')) {\r
- na = f;\r
-\r
- if (f === '*') {\r
- f = function(n) {return n.nodeType == 1;};\r
- } else {\r
- f = function(n) {\r
- return t.is(n, na);\r
- };\r
- }\r
- }\r
-\r
- while (n) {\r
- if (n == r || !n.nodeType || n.nodeType === 9)\r
- break;\r
-\r
- if (!f || f(n)) {\r
- if (c)\r
- o.push(n);\r
- else\r
- return n;\r
- }\r
-\r
- n = n.parentNode;\r
- }\r
-\r
- return c ? o : null;\r
- },\r
-\r
- get : function(e) {\r
- var n;\r
-\r
- if (e && this.doc && typeof(e) == 'string') {\r
- n = e;\r
- e = this.doc.getElementById(e);\r
-\r
- // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick\r
- if (e && e.id !== n)\r
- return this.doc.getElementsByName(n)[1];\r
- }\r
-\r
- return e;\r
- },\r
-\r
- getNext : function(node, selector) {\r
- return this._findSib(node, selector, 'nextSibling');\r
- },\r
-\r
- getPrev : function(node, selector) {\r
- return this._findSib(node, selector, 'previousSibling');\r
- },\r
-\r
-\r
- select : function(pa, s) {\r
- var t = this;\r
-\r
- return tinymce.dom.Sizzle(pa, t.get(s) || t.get(t.settings.root_element) || t.doc, []);\r
- },\r
-\r
- is : function(n, selector) {\r
- var i;\r
-\r
- // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance\r
- if (n.length === undefined) {\r
- // Simple all selector\r
- if (selector === '*')\r
- return n.nodeType == 1;\r
-\r
- // Simple selector just elements\r
- if (simpleSelectorRe.test(selector)) {\r
- selector = selector.toLowerCase().split(/,/);\r
- n = n.nodeName.toLowerCase();\r
-\r
- for (i = selector.length - 1; i >= 0; i--) {\r
- if (selector[i] == n)\r
- return true;\r
- }\r
-\r
- return false;\r
- }\r
- }\r
-\r
- return tinymce.dom.Sizzle.matches(selector, n.nodeType ? [n] : n).length > 0;\r
- },\r
-\r
-\r
- add : function(p, n, a, h, c) {\r
- var t = this;\r
-\r
- return this.run(p, function(p) {\r
- var e, k;\r
-\r
- e = is(n, 'string') ? t.doc.createElement(n) : n;\r
- t.setAttribs(e, a);\r
-\r
- if (h) {\r
- if (h.nodeType)\r
- e.appendChild(h);\r
- else\r
- t.setHTML(e, h);\r
- }\r
-\r
- return !c ? p.appendChild(e) : e;\r
- });\r
- },\r
-\r
- create : function(n, a, h) {\r
- return this.add(this.doc.createElement(n), n, a, h, 1);\r
- },\r
-\r
- createHTML : function(n, a, h) {\r
- var o = '', t = this, k;\r
-\r
- o += '<' + n;\r
-\r
- for (k in a) {\r
- if (a.hasOwnProperty(k))\r
- o += ' ' + k + '="' + t.encode(a[k]) + '"';\r
- }\r
-\r
- // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime\r
- if (typeof(h) != "undefined")\r
- return o + '>' + h + '</' + n + '>';\r
-\r
- return o + ' />';\r
- },\r
-\r
- remove : function(node, keep_children) {\r
- return this.run(node, function(node) {\r
- var child, parent = node.parentNode;\r
-\r
- if (!parent)\r
- return null;\r
-\r
- if (keep_children) {\r
- while (child = node.firstChild) {\r
- // IE 8 will crash if you don't remove completely empty text nodes\r
- if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue)\r
- parent.insertBefore(child, node);\r
- else\r
- node.removeChild(child);\r
- }\r
- }\r
-\r
- return parent.removeChild(node);\r
- });\r
- },\r
-\r
- setStyle : function(n, na, v) {\r
- var t = this;\r
-\r
- return t.run(n, function(e) {\r
- var s, i;\r
-\r
- s = e.style;\r
-\r
- // Camelcase it, if needed\r
- na = na.replace(/-(\D)/g, function(a, b){\r
- return b.toUpperCase();\r
- });\r
-\r
- // Default px suffix on these\r
- if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v)))\r
- v += 'px';\r
-\r
- switch (na) {\r
- case 'opacity':\r
- // IE specific opacity\r
- if (isIE) {\r
- s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")";\r
-\r
- if (!n.currentStyle || !n.currentStyle.hasLayout)\r
- s.display = 'inline-block';\r
- }\r
-\r
- // Fix for older browsers\r
- s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || '';\r
- break;\r
-\r
- case 'float':\r
- isIE ? s.styleFloat = v : s.cssFloat = v;\r
- break;\r
- \r
- default:\r
- s[na] = v || '';\r
- }\r
-\r
- // Force update of the style data\r
- if (t.settings.update_styles)\r
- t.setAttrib(e, 'data-mce-style');\r
- });\r
- },\r
-\r
- getStyle : function(n, na, c) {\r
- n = this.get(n);\r
-\r
- if (!n)\r
- return;\r
-\r
- // Gecko\r
- if (this.doc.defaultView && c) {\r
- // Remove camelcase\r
- na = na.replace(/[A-Z]/g, function(a){\r
- return '-' + a;\r
- });\r
-\r
- try {\r
- return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na);\r
- } catch (ex) {\r
- // Old safari might fail\r
- return null;\r
- }\r
- }\r
-\r
- // Camelcase it, if needed\r
- na = na.replace(/-(\D)/g, function(a, b){\r
- return b.toUpperCase();\r
- });\r
-\r
- if (na == 'float')\r
- na = isIE ? 'styleFloat' : 'cssFloat';\r
-\r
- // IE & Opera\r
- if (n.currentStyle && c)\r
- return n.currentStyle[na];\r
-\r
- return n.style ? n.style[na] : undefined;\r
- },\r
-\r
- setStyles : function(e, o) {\r
- var t = this, s = t.settings, ol;\r
-\r
- ol = s.update_styles;\r
- s.update_styles = 0;\r
-\r
- each(o, function(v, n) {\r
- t.setStyle(e, n, v);\r
- });\r
-\r
- // Update style info\r
- s.update_styles = ol;\r
- if (s.update_styles)\r
- t.setAttrib(e, s.cssText);\r
- },\r
-\r
- removeAllAttribs: function(e) {\r
- return this.run(e, function(e) {\r
- var i, attrs = e.attributes;\r
- for (i = attrs.length - 1; i >= 0; i--) {\r
- e.removeAttributeNode(attrs.item(i));\r
- }\r
- });\r
- },\r
-\r
- setAttrib : function(e, n, v) {\r
- var t = this;\r
-\r
- // Whats the point\r
- if (!e || !n)\r
- return;\r
-\r
- // Strict XML mode\r
- if (t.settings.strict)\r
- n = n.toLowerCase();\r
-\r
- return this.run(e, function(e) {\r
- var s = t.settings;\r
- var originalValue = e.getAttribute(n);\r
- if (v !== null) {\r
- switch (n) {\r
- case "style":\r
- if (!is(v, 'string')) {\r
- each(v, function(v, n) {\r
- t.setStyle(e, n, v);\r
- });\r
-\r
- return;\r
- }\r
-\r
- // No mce_style for elements with these since they might get resized by the user\r
- if (s.keep_values) {\r
- if (v && !t._isRes(v))\r
- e.setAttribute('data-mce-style', v, 2);\r
- else\r
- e.removeAttribute('data-mce-style', 2);\r
- }\r
-\r
- e.style.cssText = v;\r
- break;\r
-\r
- case "class":\r
- e.className = v || ''; // Fix IE null bug\r
- break;\r
-\r
- case "src":\r
- case "href":\r
- if (s.keep_values) {\r
- if (s.url_converter)\r
- v = s.url_converter.call(s.url_converter_scope || t, v, n, e);\r
-\r
- t.setAttrib(e, 'data-mce-' + n, v, 2);\r
- }\r
-\r
- break;\r
-\r
- case "shape":\r
- e.setAttribute('data-mce-style', v);\r
- break;\r
- }\r
- }\r
- if (is(v) && v !== null && v.length !== 0)\r
- e.setAttribute(n, '' + v, 2);\r
- else\r
- e.removeAttribute(n, 2);\r
-\r
- // fire onChangeAttrib event for attributes that have changed\r
- if (tinyMCE.activeEditor && originalValue != v) {\r
- var ed = tinyMCE.activeEditor;\r
- ed.onSetAttrib.dispatch(ed, e, n, v);\r
- }\r
- });\r
- },\r
-\r
- setAttribs : function(e, o) {\r
- var t = this;\r
-\r
- return this.run(e, function(e) {\r
- each(o, function(v, n) {\r
- t.setAttrib(e, n, v);\r
- });\r
- });\r
- },\r
-\r
- getAttrib : function(e, n, dv) {\r
- var v, t = this, undef;\r
-\r
- e = t.get(e);\r
-\r
- if (!e || e.nodeType !== 1)\r
- return dv === undef ? false : dv;\r
-\r
- if (!is(dv))\r
- dv = '';\r
-\r
- // Try the mce variant for these\r
- if (/^(src|href|style|coords|shape)$/.test(n)) {\r
- v = e.getAttribute("data-mce-" + n);\r
-\r
- if (v)\r
- return v;\r
- }\r
-\r
- if (isIE && t.props[n]) {\r
- v = e[t.props[n]];\r
- v = v && v.nodeValue ? v.nodeValue : v;\r
- }\r
-\r
- if (!v)\r
- v = e.getAttribute(n, 2);\r
-\r
- // Check boolean attribs\r
- if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) {\r
- if (e[t.props[n]] === true && v === '')\r
- return n;\r
-\r
- return v ? n : '';\r
- }\r
-\r
- // Inner input elements will override attributes on form elements\r
- if (e.nodeName === "FORM" && e.getAttributeNode(n))\r
- return e.getAttributeNode(n).nodeValue;\r
-\r
- if (n === 'style') {\r
- v = v || e.style.cssText;\r
-\r
- if (v) {\r
- v = t.serializeStyle(t.parseStyle(v), e.nodeName);\r
-\r
- if (t.settings.keep_values && !t._isRes(v))\r
- e.setAttribute('data-mce-style', v);\r
- }\r
- }\r
-\r
- // Remove Apple and WebKit stuff\r
- if (isWebKit && n === "class" && v)\r
- v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, '');\r
-\r
- // Handle IE issues\r
- if (isIE) {\r
- switch (n) {\r
- case 'rowspan':\r
- case 'colspan':\r
- // IE returns 1 as default value\r
- if (v === 1)\r
- v = '';\r
-\r
- break;\r
-\r
- case 'size':\r
- // IE returns +0 as default value for size\r
- if (v === '+0' || v === 20 || v === 0)\r
- v = '';\r
-\r
- break;\r
-\r
- case 'width':\r
- case 'height':\r
- case 'vspace':\r
- case 'checked':\r
- case 'disabled':\r
- case 'readonly':\r
- if (v === 0)\r
- v = '';\r
-\r
- break;\r
-\r
- case 'hspace':\r
- // IE returns -1 as default value\r
- if (v === -1)\r
- v = '';\r
-\r
- break;\r
-\r
- case 'maxlength':\r
- case 'tabindex':\r
- // IE returns default value\r
- if (v === 32768 || v === 2147483647 || v === '32768')\r
- v = '';\r
-\r
- break;\r
-\r
- case 'multiple':\r
- case 'compact':\r
- case 'noshade':\r
- case 'nowrap':\r
- if (v === 65535)\r
- return n;\r
-\r
- return dv;\r
-\r
- case 'shape':\r
- v = v.toLowerCase();\r
- break;\r
-\r
- default:\r
- // IE has odd anonymous function for event attributes\r
- if (n.indexOf('on') === 0 && v)\r
- v = tinymce._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1', '' + v);\r
- }\r
- }\r
-\r
- return (v !== undef && v !== null && v !== '') ? '' + v : dv;\r
- },\r
-\r
- getPos : function(n, ro) {\r
- var t = this, x = 0, y = 0, e, d = t.doc, r;\r
-\r
- n = t.get(n);\r
- ro = ro || d.body;\r
-\r
- if (n) {\r
- // Use getBoundingClientRect if it exists since it's faster than looping offset nodes\r
- if (n.getBoundingClientRect) {\r
- n = n.getBoundingClientRect();\r
- e = t.boxModel ? d.documentElement : d.body;\r
-\r
- // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit\r
- // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position\r
- x = n.left + (d.documentElement.scrollLeft || d.body.scrollLeft) - e.clientTop;\r
- y = n.top + (d.documentElement.scrollTop || d.body.scrollTop) - e.clientLeft;\r
-\r
- return {x : x, y : y};\r
- }\r
-\r
- r = n;\r
- while (r && r != ro && r.nodeType) {\r
- x += r.offsetLeft || 0;\r
- y += r.offsetTop || 0;\r
- r = r.offsetParent;\r
- }\r
-\r
- r = n.parentNode;\r
- while (r && r != ro && r.nodeType) {\r
- x -= r.scrollLeft || 0;\r
- y -= r.scrollTop || 0;\r
- r = r.parentNode;\r
- }\r
- }\r
-\r
- return {x : x, y : y};\r
- },\r
-\r
- parseStyle : function(st) {\r
- return this.styles.parse(st);\r
- },\r
-\r
- serializeStyle : function(o, name) {\r
- return this.styles.serialize(o, name);\r
- },\r
-\r
- addStyle: function(cssText) {\r
- var doc = this.doc, head;\r
-\r
- // Create style element if needed\r
- styleElm = doc.getElementById('mceDefaultStyles');\r
- if (!styleElm) {\r
- styleElm = doc.createElement('style'),\r
- styleElm.id = 'mceDefaultStyles';\r
- styleElm.type = 'text/css';\r
-\r
- head = doc.getElementsByTagName('head')[0];\r
- if (head.firstChild) {\r
- head.insertBefore(styleElm, head.firstChild);\r
- } else {\r
- head.appendChild(styleElm);\r
- }\r
- }\r
-\r
- // Append style data to old or new style element\r
- if (styleElm.styleSheet) {\r
- styleElm.styleSheet.cssText += cssText;\r
- } else {\r
- styleElm.appendChild(doc.createTextNode(cssText));\r
- }\r
- },\r
-\r
- loadCSS : function(u) {\r
- var t = this, d = t.doc, head;\r
-\r
- if (!u)\r
- u = '';\r
-\r
- head = d.getElementsByTagName('head')[0];\r
-\r
- each(u.split(','), function(u) {\r
- var link;\r
-\r
- if (t.files[u])\r
- return;\r
-\r
- t.files[u] = true;\r
- link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)});\r
-\r
- // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug\r
- // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading\r
- // It's ugly but it seems to work fine.\r
- if (isIE && d.documentMode && d.recalc) {\r
- link.onload = function() {\r
- if (d.recalc)\r
- d.recalc();\r
-\r
- link.onload = null;\r
- };\r
- }\r
-\r
- head.appendChild(link);\r
- });\r
- },\r
-\r
- addClass : function(e, c) {\r
- return this.run(e, function(e) {\r
- var o;\r
-\r
- if (!c)\r
- return 0;\r
-\r
- if (this.hasClass(e, c))\r
- return e.className;\r
-\r
- o = this.removeClass(e, c);\r
-\r
- return e.className = (o != '' ? (o + ' ') : '') + c;\r
- });\r
- },\r
-\r
- removeClass : function(e, c) {\r
- var t = this, re;\r
-\r
- return t.run(e, function(e) {\r
- var v;\r
-\r
- if (t.hasClass(e, c)) {\r
- if (!re)\r
- re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g");\r
-\r
- v = e.className.replace(re, ' ');\r
- v = tinymce.trim(v != ' ' ? v : '');\r
-\r
- e.className = v;\r
-\r
- // Empty class attr\r
- if (!v) {\r
- e.removeAttribute('class');\r
- e.removeAttribute('className');\r
- }\r
-\r
- return v;\r
- }\r
-\r
- return e.className;\r
- });\r
- },\r
-\r
- hasClass : function(n, c) {\r
- n = this.get(n);\r
-\r
- if (!n || !c)\r
- return false;\r
-\r
- return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1;\r
- },\r
-\r
- show : function(e) {\r
- return this.setStyle(e, 'display', 'block');\r
- },\r
-\r
- hide : function(e) {\r
- return this.setStyle(e, 'display', 'none');\r
- },\r
-\r
- isHidden : function(e) {\r
- e = this.get(e);\r
-\r
- return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none';\r
- },\r
-\r
- uniqueId : function(p) {\r
- return (!p ? 'mce_' : p) + (this.counter++);\r
- },\r
-\r
- setHTML : function(element, html) {\r
- var self = this;\r
-\r
- return self.run(element, function(element) {\r
- if (isIE) {\r
- // Remove all child nodes, IE keeps empty text nodes in DOM\r
- while (element.firstChild)\r
- element.removeChild(element.firstChild);\r
-\r
- try {\r
- // IE will remove comments from the beginning\r
- // unless you padd the contents with something\r
- element.innerHTML = '<br />' + html;\r
- element.removeChild(element.firstChild);\r
- } catch (ex) {\r
- // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p\r
- // This seems to fix this problem\r
-\r
- // Create new div with HTML contents and a BR infront to keep comments\r
- var newElement = self.create('div');\r
- newElement.innerHTML = '<br />' + html;\r
-\r
- // Add all children from div to target\r
- each (tinymce.grep(newElement.childNodes), function(node, i) {\r
- // Skip br element\r
- if (i && element.canHaveHTML)\r
- element.appendChild(node);\r
- });\r
- }\r
- } else\r
- element.innerHTML = html;\r
-\r
- return html;\r
- });\r
- },\r
-\r
- getOuterHTML : function(elm) {\r
- var doc, self = this;\r
-\r
- elm = self.get(elm);\r
-\r
- if (!elm)\r
- return null;\r
-\r
- if (elm.nodeType === 1 && self.hasOuterHTML)\r
- return elm.outerHTML;\r
-\r
- doc = (elm.ownerDocument || self.doc).createElement("body");\r
- doc.appendChild(elm.cloneNode(true));\r
-\r
- return doc.innerHTML;\r
- },\r
-\r
- setOuterHTML : function(e, h, d) {\r
- var t = this;\r
-\r
- function setHTML(e, h, d) {\r
- var n, tp;\r
-\r
- tp = d.createElement("body");\r
- tp.innerHTML = h;\r
-\r
- n = tp.lastChild;\r
- while (n) {\r
- t.insertAfter(n.cloneNode(true), e);\r
- n = n.previousSibling;\r
- }\r
-\r
- t.remove(e);\r
- };\r
-\r
- return this.run(e, function(e) {\r
- e = t.get(e);\r
-\r
- // Only set HTML on elements\r
- if (e.nodeType == 1) {\r
- d = d || e.ownerDocument || t.doc;\r
-\r
- if (isIE) {\r
- try {\r
- // Try outerHTML for IE it sometimes produces an unknown runtime error\r
- if (isIE && e.nodeType == 1)\r
- e.outerHTML = h;\r
- else\r
- setHTML(e, h, d);\r
- } catch (ex) {\r
- // Fix for unknown runtime error\r
- setHTML(e, h, d);\r
- }\r
- } else\r
- setHTML(e, h, d);\r
- }\r
- });\r
- },\r
-\r
- decode : Entities.decode,\r
-\r
- encode : Entities.encodeAllRaw,\r
-\r
- insertAfter : function(node, reference_node) {\r
- reference_node = this.get(reference_node);\r
-\r
- return this.run(node, function(node) {\r
- var parent, nextSibling;\r
-\r
- parent = reference_node.parentNode;\r
- nextSibling = reference_node.nextSibling;\r
-\r
- if (nextSibling)\r
- parent.insertBefore(node, nextSibling);\r
- else\r
- parent.appendChild(node);\r
-\r
- return node;\r
- });\r
- },\r
-\r
- replace : function(n, o, k) {\r
- var t = this;\r
-\r
- if (is(o, 'array'))\r
- n = n.cloneNode(true);\r
-\r
- return t.run(o, function(o) {\r
- if (k) {\r
- each(tinymce.grep(o.childNodes), function(c) {\r
- n.appendChild(c);\r
- });\r
- }\r
-\r
- return o.parentNode.replaceChild(n, o);\r
- });\r
- },\r
-\r
- rename : function(elm, name) {\r
- var t = this, newElm;\r
-\r
- if (elm.nodeName != name.toUpperCase()) {\r
- // Rename block element\r
- newElm = t.create(name);\r
-\r
- // Copy attribs to new block\r
- each(t.getAttribs(elm), function(attr_node) {\r
- t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName));\r
- });\r
-\r
- // Replace block\r
- t.replace(newElm, elm, 1);\r
- }\r
-\r
- return newElm || elm;\r
- },\r
-\r
- findCommonAncestor : function(a, b) {\r
- var ps = a, pe;\r
-\r
- while (ps) {\r
- pe = b;\r
-\r
- while (pe && ps != pe)\r
- pe = pe.parentNode;\r
-\r
- if (ps == pe)\r
- break;\r
-\r
- ps = ps.parentNode;\r
- }\r
-\r
- if (!ps && a.ownerDocument)\r
- return a.ownerDocument.documentElement;\r
-\r
- return ps;\r
- },\r
-\r
- toHex : function(s) {\r
- var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);\r
-\r
- function hex(s) {\r
- s = parseInt(s, 10).toString(16);\r
-\r
- return s.length > 1 ? s : '0' + s; // 0 -> 00\r
- };\r
-\r
- if (c) {\r
- s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]);\r
-\r
- return s;\r
- }\r
-\r
- return s;\r
- },\r
-\r
- getClasses : function() {\r
- var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov;\r
-\r
- if (t.classes)\r
- return t.classes;\r
-\r
- function addClasses(s) {\r
- // IE style imports\r
- each(s.imports, function(r) {\r
- addClasses(r);\r
- });\r
-\r
- each(s.cssRules || s.rules, function(r) {\r
- // Real type or fake it on IE\r
- switch (r.type || 1) {\r
- // Rule\r
- case 1:\r
- if (r.selectorText) {\r
- each(r.selectorText.split(','), function(v) {\r
- v = v.replace(/^\s*|\s*$|^\s\./g, "");\r
-\r
- // Is internal or it doesn't contain a class\r
- if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v))\r
- return;\r
-\r
- // Remove everything but class name\r
- ov = v;\r
- v = tinymce._replace(/.*\.([a-z0-9_\-]+).*/i, '$1', v);\r
-\r
- // Filter classes\r
- if (f && !(v = f(v, ov)))\r
- return;\r
-\r
- if (!lo[v]) {\r
- cl.push({'class' : v});\r
- lo[v] = 1;\r
- }\r
- });\r
- }\r
- break;\r
-\r
- // Import\r
- case 3:\r
- addClasses(r.styleSheet);\r
- break;\r
- }\r
- });\r
- };\r
-\r
- try {\r
- each(t.doc.styleSheets, addClasses);\r
- } catch (ex) {\r
- // Ignore\r
- }\r
-\r
- if (cl.length > 0)\r
- t.classes = cl;\r
-\r
- return cl;\r
- },\r
-\r
- run : function(e, f, s) {\r
- var t = this, o;\r
-\r
- if (t.doc && typeof(e) === 'string')\r
- e = t.get(e);\r
-\r
- if (!e)\r
- return false;\r
-\r
- s = s || this;\r
- if (!e.nodeType && (e.length || e.length === 0)) {\r
- o = [];\r
-\r
- each(e, function(e, i) {\r
- if (e) {\r
- if (typeof(e) == 'string')\r
- e = t.doc.getElementById(e);\r
-\r
- o.push(f.call(s, e, i));\r
- }\r
- });\r
-\r
- return o;\r
- }\r
-\r
- return f.call(s, e);\r
- },\r
-\r
- getAttribs : function(n) {\r
- var o;\r
-\r
- n = this.get(n);\r
-\r
- if (!n)\r
- return [];\r
-\r
- if (isIE) {\r
- o = [];\r
-\r
- // Object will throw exception in IE\r
- if (n.nodeName == 'OBJECT')\r
- return n.attributes;\r
-\r
- // IE doesn't keep the selected attribute if you clone option elements\r
- if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected'))\r
- o.push({specified : 1, nodeName : 'selected'});\r
-\r
- // It's crazy that this is faster in IE but it's because it returns all attributes all the time\r
- n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) {\r
- o.push({specified : 1, nodeName : a});\r
- });\r
-\r
- return o;\r
- }\r
-\r
- return n.attributes;\r
- },\r
-\r
- isEmpty : function(node, elements) {\r
- var self = this, i, attributes, type, walker, name, brCount = 0;\r
-\r
- node = node.firstChild;\r
- if (node) {\r
- walker = new tinymce.dom.TreeWalker(node, node.parentNode);\r
- elements = elements || self.schema ? self.schema.getNonEmptyElements() : null;\r
-\r
- do {\r
- type = node.nodeType;\r
-\r
- if (type === 1) {\r
- // Ignore bogus elements\r
- if (node.getAttribute('data-mce-bogus'))\r
- continue;\r
-\r
- // Keep empty elements like <img />\r
- name = node.nodeName.toLowerCase();\r
- if (elements && elements[name]) {\r
- // Ignore single BR elements in blocks like <p><br /></p> or <p><span><br /></span></p>\r
- if (name === 'br') {\r
- brCount++;\r
- continue;\r
- }\r
-\r
- return false;\r
- }\r
-\r
- // Keep elements with data-bookmark attributes or name attribute like <a name="1"></a>\r
- attributes = self.getAttribs(node);\r
- i = node.attributes.length;\r
- while (i--) {\r
- name = node.attributes[i].nodeName;\r
- if (name === "name" || name === 'data-mce-bookmark')\r
- return false;\r
- }\r
- }\r
-\r
- // Keep comment nodes\r
- if (type == 8)\r
- return false;\r
-\r
- // Keep non whitespace text nodes\r
- if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue)))\r
- return false;\r
- } while (node = walker.next());\r
- }\r
-\r
- return brCount <= 1;\r
- },\r
-\r
- destroy : function(s) {\r
- var t = this;\r
-\r
- t.win = t.doc = t.root = t.events = t.frag = null;\r
-\r
- // Manual destroy then remove unload handler\r
- if (!s)\r
- tinymce.removeUnload(t.destroy);\r
- },\r
-\r
- createRng : function() {\r
- var d = this.doc;\r
-\r
- return d.createRange ? d.createRange() : new tinymce.dom.Range(this);\r
- },\r
-\r
- nodeIndex : function(node, normalized) {\r
- var idx = 0, lastNodeType, lastNode, nodeType;\r
-\r
- if (node) {\r
- for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) {\r
- nodeType = node.nodeType;\r
-\r
- // Normalize text nodes\r
- if (normalized && nodeType == 3) {\r
- if (nodeType == lastNodeType || !node.nodeValue.length)\r
- continue;\r
- }\r
- idx++;\r
- lastNodeType = nodeType;\r
- }\r
- }\r
-\r
- return idx;\r
- },\r
-\r
- split : function(pe, e, re) {\r
- var t = this, r = t.createRng(), bef, aft, pa;\r
-\r
- // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense\r
- // but we don't want that in our code since it serves no purpose for the end user\r
- // For example if this is chopped:\r
- // <p>text 1<span><b>CHOP</b></span>text 2</p>\r
- // would produce:\r
- // <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p>\r
- // this function will then trim of empty edges and produce:\r
- // <p>text 1</p><b>CHOP</b><p>text 2</p>\r
- function trim(node) {\r
- var i, children = node.childNodes, type = node.nodeType;\r
-\r
- function surroundedBySpans(node) {\r
- var previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\r
- var nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\r
- return previousIsSpan && nextIsSpan;\r
- }\r
-\r
- if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark')\r
- return;\r
-\r
- for (i = children.length - 1; i >= 0; i--)\r
- trim(children[i]);\r
-\r
- if (type != 9) {\r
- // Keep non whitespace text nodes\r
- if (type == 3 && node.nodeValue.length > 0) {\r
- // If parent element isn't a block or there isn't any useful contents for example "<p> </p>"\r
- // Also keep text nodes with only spaces if surrounded by spans.\r
- // eg. "<p><span>a</span> <span>b</span></p>" should keep space between a and b\r
- var trimmedLength = tinymce.trim(node.nodeValue).length;\r
- if (!t.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node))\r
- return;\r
- } else if (type == 1) {\r
- // If the only child is a bookmark then move it up\r
- children = node.childNodes;\r
- if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('data-mce-type') == 'bookmark')\r
- node.parentNode.insertBefore(children[0], node);\r
-\r
- // Keep non empty elements or img, hr etc\r
- if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName))\r
- return;\r
- }\r
-\r
- t.remove(node);\r
- }\r
-\r
- return node;\r
- };\r
-\r
- if (pe && e) {\r
- // Get before chunk\r
- r.setStart(pe.parentNode, t.nodeIndex(pe));\r
- r.setEnd(e.parentNode, t.nodeIndex(e));\r
- bef = r.extractContents();\r
-\r
- // Get after chunk\r
- r = t.createRng();\r
- r.setStart(e.parentNode, t.nodeIndex(e) + 1);\r
- r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1);\r
- aft = r.extractContents();\r
-\r
- // Insert before chunk\r
- pa = pe.parentNode;\r
- pa.insertBefore(trim(bef), pe);\r
-\r
- // Insert middle chunk\r
- if (re)\r
- pa.replaceChild(re, e);\r
- else\r
- pa.insertBefore(e, pe);\r
-\r
- // Insert after chunk\r
- pa.insertBefore(trim(aft), pe);\r
- t.remove(pe);\r
-\r
- return re || e;\r
- }\r
- },\r
-\r
- bind : function(target, name, func, scope) {\r
- return this.events.add(target, name, func, scope || this);\r
- },\r
-\r
- unbind : function(target, name, func) {\r
- return this.events.remove(target, name, func);\r
- },\r
-\r
- fire : function(target, name, evt) {\r
- return this.events.fire(target, name, evt);\r
- },\r
-\r
- // Returns the content editable state of a node\r
- getContentEditable: function(node) {\r
- var contentEditable;\r
-\r
- // Check type\r
- if (node.nodeType != 1) {\r
- return null;\r
- }\r
-\r
- // Check for fake content editable\r
- contentEditable = node.getAttribute("data-mce-contenteditable");\r
- if (contentEditable && contentEditable !== "inherit") {\r
- return contentEditable;\r
- }\r
-\r
- // Check for real content editable\r
- return node.contentEditable !== "inherit" ? node.contentEditable : null;\r
- },\r
-\r
-\r
- _findSib : function(node, selector, name) {\r
- var t = this, f = selector;\r
-\r
- if (node) {\r
- // If expression make a function of it using is\r
- if (is(f, 'string')) {\r
- f = function(node) {\r
- return t.is(node, selector);\r
- };\r
- }\r
-\r
- // Loop all siblings\r
- for (node = node[name]; node; node = node[name]) {\r
- if (f(node))\r
- return node;\r
- }\r
- }\r
-\r
- return null;\r
- },\r
-\r
- _isRes : function(c) {\r
- // Is live resizble element\r
- return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c);\r
- }\r
-\r
- /*\r
- walk : function(n, f, s) {\r
- var d = this.doc, w;\r
-\r
- if (d.createTreeWalker) {\r
- w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);\r
-\r
- while ((n = w.nextNode()) != null)\r
- f.call(s || this, n);\r
- } else\r
- tinymce.walk(n, f, 'childNodes', s);\r
- }\r
- */\r
-\r
- /*\r
- toRGB : function(s) {\r
- var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s);\r
-\r
- if (c) {\r
- // #FFF -> #FFFFFF\r
- if (!is(c[3]))\r
- c[3] = c[2] = c[1];\r
-\r
- return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")";\r
- }\r
-\r
- return s;\r
- }\r
- */\r
- });\r
-\r
- tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0});\r
-})(tinymce);\r
-\r
-(function(ns) {\r
- // Range constructor\r
- function Range(dom) {\r
- var t = this,\r
- doc = dom.doc,\r
- EXTRACT = 0,\r
- CLONE = 1,\r
- DELETE = 2,\r
- TRUE = true,\r
- FALSE = false,\r
- START_OFFSET = 'startOffset',\r
- START_CONTAINER = 'startContainer',\r
- END_CONTAINER = 'endContainer',\r
- END_OFFSET = 'endOffset',\r
- extend = tinymce.extend,\r
- nodeIndex = dom.nodeIndex;\r
-\r
- extend(t, {\r
- // Inital states\r
- startContainer : doc,\r
- startOffset : 0,\r
- endContainer : doc,\r
- endOffset : 0,\r
- collapsed : TRUE,\r
- commonAncestorContainer : doc,\r
-\r
- // Range constants\r
- START_TO_START : 0,\r
- START_TO_END : 1,\r
- END_TO_END : 2,\r
- END_TO_START : 3,\r
-\r
- // Public methods\r
- setStart : setStart,\r
- setEnd : setEnd,\r
- setStartBefore : setStartBefore,\r
- setStartAfter : setStartAfter,\r
- setEndBefore : setEndBefore,\r
- setEndAfter : setEndAfter,\r
- collapse : collapse,\r
- selectNode : selectNode,\r
- selectNodeContents : selectNodeContents,\r
- compareBoundaryPoints : compareBoundaryPoints,\r
- deleteContents : deleteContents,\r
- extractContents : extractContents,\r
- cloneContents : cloneContents,\r
- insertNode : insertNode,\r
- surroundContents : surroundContents,\r
- cloneRange : cloneRange,\r
- toStringIE : toStringIE\r
- });\r
-\r
- function createDocumentFragment() {\r
- return doc.createDocumentFragment();\r
- };\r
-\r
- function setStart(n, o) {\r
- _setEndPoint(TRUE, n, o);\r
- };\r
-\r
- function setEnd(n, o) {\r
- _setEndPoint(FALSE, n, o);\r
- };\r
-\r
- function setStartBefore(n) {\r
- setStart(n.parentNode, nodeIndex(n));\r
- };\r
-\r
- function setStartAfter(n) {\r
- setStart(n.parentNode, nodeIndex(n) + 1);\r
- };\r
-\r
- function setEndBefore(n) {\r
- setEnd(n.parentNode, nodeIndex(n));\r
- };\r
-\r
- function setEndAfter(n) {\r
- setEnd(n.parentNode, nodeIndex(n) + 1);\r
- };\r
-\r
- function collapse(ts) {\r
- if (ts) {\r
- t[END_CONTAINER] = t[START_CONTAINER];\r
- t[END_OFFSET] = t[START_OFFSET];\r
- } else {\r
- t[START_CONTAINER] = t[END_CONTAINER];\r
- t[START_OFFSET] = t[END_OFFSET];\r
- }\r
-\r
- t.collapsed = TRUE;\r
- };\r
-\r
- function selectNode(n) {\r
- setStartBefore(n);\r
- setEndAfter(n);\r
- };\r
-\r
- function selectNodeContents(n) {\r
- setStart(n, 0);\r
- setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);\r
- };\r
-\r
- function compareBoundaryPoints(h, r) {\r
- var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET],\r
- rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset;\r
-\r
- // Check START_TO_START\r
- if (h === 0)\r
- return _compareBoundaryPoints(sc, so, rsc, rso);\r
- \r
- // Check START_TO_END\r
- if (h === 1)\r
- return _compareBoundaryPoints(ec, eo, rsc, rso);\r
- \r
- // Check END_TO_END\r
- if (h === 2)\r
- return _compareBoundaryPoints(ec, eo, rec, reo);\r
- \r
- // Check END_TO_START\r
- if (h === 3) \r
- return _compareBoundaryPoints(sc, so, rec, reo);\r
- };\r
-\r
- function deleteContents() {\r
- _traverse(DELETE);\r
- };\r
-\r
- function extractContents() {\r
- return _traverse(EXTRACT);\r
- };\r
-\r
- function cloneContents() {\r
- return _traverse(CLONE);\r
- };\r
-\r
- function insertNode(n) {\r
- var startContainer = this[START_CONTAINER],\r
- startOffset = this[START_OFFSET], nn, o;\r
-\r
- // Node is TEXT_NODE or CDATA\r
- if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) {\r
- if (!startOffset) {\r
- // At the start of text\r
- startContainer.parentNode.insertBefore(n, startContainer);\r
- } else if (startOffset >= startContainer.nodeValue.length) {\r
- // At the end of text\r
- dom.insertAfter(n, startContainer);\r
- } else {\r
- // Middle, need to split\r
- nn = startContainer.splitText(startOffset);\r
- startContainer.parentNode.insertBefore(n, nn);\r
- }\r
- } else {\r
- // Insert element node\r
- if (startContainer.childNodes.length > 0)\r
- o = startContainer.childNodes[startOffset];\r
-\r
- if (o)\r
- startContainer.insertBefore(n, o);\r
- else\r
- startContainer.appendChild(n);\r
- }\r
- };\r
-\r
- function surroundContents(n) {\r
- var f = t.extractContents();\r
-\r
- t.insertNode(n);\r
- n.appendChild(f);\r
- t.selectNode(n);\r
- };\r
-\r
- function cloneRange() {\r
- return extend(new Range(dom), {\r
- startContainer : t[START_CONTAINER],\r
- startOffset : t[START_OFFSET],\r
- endContainer : t[END_CONTAINER],\r
- endOffset : t[END_OFFSET],\r
- collapsed : t.collapsed,\r
- commonAncestorContainer : t.commonAncestorContainer\r
- });\r
- };\r
-\r
- // Private methods\r
-\r
- function _getSelectedNode(container, offset) {\r
- var child;\r
-\r
- if (container.nodeType == 3 /* TEXT_NODE */)\r
- return container;\r
-\r
- if (offset < 0)\r
- return container;\r
-\r
- child = container.firstChild;\r
- while (child && offset > 0) {\r
- --offset;\r
- child = child.nextSibling;\r
- }\r
-\r
- if (child)\r
- return child;\r
-\r
- return container;\r
- };\r
-\r
- function _isCollapsed() {\r
- return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]);\r
- };\r
-\r
- function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {\r
- var c, offsetC, n, cmnRoot, childA, childB;\r
- \r
- // In the first case the boundary-points have the same container. A is before B\r
- // if its offset is less than the offset of B, A is equal to B if its offset is\r
- // equal to the offset of B, and A is after B if its offset is greater than the\r
- // offset of B.\r
- if (containerA == containerB) {\r
- if (offsetA == offsetB)\r
- return 0; // equal\r
-\r
- if (offsetA < offsetB)\r
- return -1; // before\r
-\r
- return 1; // after\r
- }\r
-\r
- // In the second case a child node C of the container of A is an ancestor\r
- // container of B. In this case, A is before B if the offset of A is less than or\r
- // equal to the index of the child node C and A is after B otherwise.\r
- c = containerB;\r
- while (c && c.parentNode != containerA)\r
- c = c.parentNode;\r
-\r
- if (c) {\r
- offsetC = 0;\r
- n = containerA.firstChild;\r
-\r
- while (n != c && offsetC < offsetA) {\r
- offsetC++;\r
- n = n.nextSibling;\r
- }\r
-\r
- if (offsetA <= offsetC)\r
- return -1; // before\r
-\r
- return 1; // after\r
- }\r
-\r
- // In the third case a child node C of the container of B is an ancestor container\r
- // of A. In this case, A is before B if the index of the child node C is less than\r
- // the offset of B and A is after B otherwise.\r
- c = containerA;\r
- while (c && c.parentNode != containerB) {\r
- c = c.parentNode;\r
- }\r
-\r
- if (c) {\r
- offsetC = 0;\r
- n = containerB.firstChild;\r
-\r
- while (n != c && offsetC < offsetB) {\r
- offsetC++;\r
- n = n.nextSibling;\r
- }\r
-\r
- if (offsetC < offsetB)\r
- return -1; // before\r
-\r
- return 1; // after\r
- }\r
-\r
- // In the fourth case, none of three other cases hold: the containers of A and B\r
- // are siblings or descendants of sibling nodes. In this case, A is before B if\r
- // the container of A is before the container of B in a pre-order traversal of the\r
- // Ranges' context tree and A is after B otherwise.\r
- cmnRoot = dom.findCommonAncestor(containerA, containerB);\r
- childA = containerA;\r
-\r
- while (childA && childA.parentNode != cmnRoot)\r
- childA = childA.parentNode;\r
-\r
- if (!childA)\r
- childA = cmnRoot;\r
-\r
- childB = containerB;\r
- while (childB && childB.parentNode != cmnRoot)\r
- childB = childB.parentNode;\r
-\r
- if (!childB)\r
- childB = cmnRoot;\r
-\r
- if (childA == childB)\r
- return 0; // equal\r
-\r
- n = cmnRoot.firstChild;\r
- while (n) {\r
- if (n == childA)\r
- return -1; // before\r
-\r
- if (n == childB)\r
- return 1; // after\r
-\r
- n = n.nextSibling;\r
- }\r
- };\r
-\r
- function _setEndPoint(st, n, o) {\r
- var ec, sc;\r
-\r
- if (st) {\r
- t[START_CONTAINER] = n;\r
- t[START_OFFSET] = o;\r
- } else {\r
- t[END_CONTAINER] = n;\r
- t[END_OFFSET] = o;\r
- }\r
-\r
- // If one boundary-point of a Range is set to have a root container\r
- // other than the current one for the Range, the Range is collapsed to\r
- // the new position. This enforces the restriction that both boundary-\r
- // points of a Range must have the same root container.\r
- ec = t[END_CONTAINER];\r
- while (ec.parentNode)\r
- ec = ec.parentNode;\r
-\r
- sc = t[START_CONTAINER];\r
- while (sc.parentNode)\r
- sc = sc.parentNode;\r
-\r
- if (sc == ec) {\r
- // The start position of a Range is guaranteed to never be after the\r
- // end position. To enforce this restriction, if the start is set to\r
- // be at a position after the end, the Range is collapsed to that\r
- // position.\r
- if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0)\r
- t.collapse(st);\r
- } else\r
- t.collapse(st);\r
-\r
- t.collapsed = _isCollapsed();\r
- t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]);\r
- };\r
-\r
- function _traverse(how) {\r
- var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;\r
-\r
- if (t[START_CONTAINER] == t[END_CONTAINER])\r
- return _traverseSameContainer(how);\r
-\r
- for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {\r
- if (p == t[START_CONTAINER])\r
- return _traverseCommonStartContainer(c, how);\r
-\r
- ++endContainerDepth;\r
- }\r
-\r
- for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {\r
- if (p == t[END_CONTAINER])\r
- return _traverseCommonEndContainer(c, how);\r
-\r
- ++startContainerDepth;\r
- }\r
-\r
- depthDiff = startContainerDepth - endContainerDepth;\r
-\r
- startNode = t[START_CONTAINER];\r
- while (depthDiff > 0) {\r
- startNode = startNode.parentNode;\r
- depthDiff--;\r
- }\r
-\r
- endNode = t[END_CONTAINER];\r
- while (depthDiff < 0) {\r
- endNode = endNode.parentNode;\r
- depthDiff++;\r
- }\r
-\r
- // ascend the ancestor hierarchy until we have a common parent.\r
- for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) {\r
- startNode = sp;\r
- endNode = ep;\r
- }\r
-\r
- return _traverseCommonAncestors(startNode, endNode, how);\r
- };\r
-\r
- function _traverseSameContainer(how) {\r
- var frag, s, sub, n, cnt, sibling, xferNode, start, len;\r
-\r
- if (how != DELETE)\r
- frag = createDocumentFragment();\r
-\r
- // If selection is empty, just return the fragment\r
- if (t[START_OFFSET] == t[END_OFFSET])\r
- return frag;\r
-\r
- // Text node needs special case handling\r
- if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {\r
- // get the substring\r
- s = t[START_CONTAINER].nodeValue;\r
- sub = s.substring(t[START_OFFSET], t[END_OFFSET]);\r
-\r
- // set the original text node to its new value\r
- if (how != CLONE) {\r
- n = t[START_CONTAINER];\r
- start = t[START_OFFSET];\r
- len = t[END_OFFSET] - t[START_OFFSET];\r
-\r
- if (start === 0 && len >= n.nodeValue.length - 1) {\r
- n.parentNode.removeChild(n);\r
- } else {\r
- n.deleteData(start, len);\r
- }\r
-\r
- // Nothing is partially selected, so collapse to start point\r
- t.collapse(TRUE);\r
- }\r
-\r
- if (how == DELETE)\r
- return;\r
-\r
- if (sub.length > 0) {\r
- frag.appendChild(doc.createTextNode(sub));\r
- }\r
-\r
- return frag;\r
- }\r
-\r
- // Copy nodes between the start/end offsets.\r
- n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]);\r
- cnt = t[END_OFFSET] - t[START_OFFSET];\r
-\r
- while (n && cnt > 0) {\r
- sibling = n.nextSibling;\r
- xferNode = _traverseFullySelected(n, how);\r
-\r
- if (frag)\r
- frag.appendChild( xferNode );\r
-\r
- --cnt;\r
- n = sibling;\r
- }\r
-\r
- // Nothing is partially selected, so collapse to start point\r
- if (how != CLONE)\r
- t.collapse(TRUE);\r
-\r
- return frag;\r
- };\r
-\r
- function _traverseCommonStartContainer(endAncestor, how) {\r
- var frag, n, endIdx, cnt, sibling, xferNode;\r
-\r
- if (how != DELETE)\r
- frag = createDocumentFragment();\r
-\r
- n = _traverseRightBoundary(endAncestor, how);\r
-\r
- if (frag)\r
- frag.appendChild(n);\r
-\r
- endIdx = nodeIndex(endAncestor);\r
- cnt = endIdx - t[START_OFFSET];\r
-\r
- if (cnt <= 0) {\r
- // Collapse to just before the endAncestor, which\r
- // is partially selected.\r
- if (how != CLONE) {\r
- t.setEndBefore(endAncestor);\r
- t.collapse(FALSE);\r
- }\r
-\r
- return frag;\r
- }\r
-\r
- n = endAncestor.previousSibling;\r
- while (cnt > 0) {\r
- sibling = n.previousSibling;\r
- xferNode = _traverseFullySelected(n, how);\r
-\r
- if (frag)\r
- frag.insertBefore(xferNode, frag.firstChild);\r
-\r
- --cnt;\r
- n = sibling;\r
- }\r
-\r
- // Collapse to just before the endAncestor, which\r
- // is partially selected.\r
- if (how != CLONE) {\r
- t.setEndBefore(endAncestor);\r
- t.collapse(FALSE);\r
- }\r
-\r
- return frag;\r
- };\r
-\r
- function _traverseCommonEndContainer(startAncestor, how) {\r
- var frag, startIdx, n, cnt, sibling, xferNode;\r
-\r
- if (how != DELETE)\r
- frag = createDocumentFragment();\r
-\r
- n = _traverseLeftBoundary(startAncestor, how);\r
- if (frag)\r
- frag.appendChild(n);\r
-\r
- startIdx = nodeIndex(startAncestor);\r
- ++startIdx; // Because we already traversed it\r
-\r
- cnt = t[END_OFFSET] - startIdx;\r
- n = startAncestor.nextSibling;\r
- while (n && cnt > 0) {\r
- sibling = n.nextSibling;\r
- xferNode = _traverseFullySelected(n, how);\r
-\r
- if (frag)\r
- frag.appendChild(xferNode);\r
-\r
- --cnt;\r
- n = sibling;\r
- }\r
-\r
- if (how != CLONE) {\r
- t.setStartAfter(startAncestor);\r
- t.collapse(TRUE);\r
- }\r
-\r
- return frag;\r
- };\r
-\r
- function _traverseCommonAncestors(startAncestor, endAncestor, how) {\r
- var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling;\r
-\r
- if (how != DELETE)\r
- frag = createDocumentFragment();\r
-\r
- n = _traverseLeftBoundary(startAncestor, how);\r
- if (frag)\r
- frag.appendChild(n);\r
-\r
- commonParent = startAncestor.parentNode;\r
- startOffset = nodeIndex(startAncestor);\r
- endOffset = nodeIndex(endAncestor);\r
- ++startOffset;\r
-\r
- cnt = endOffset - startOffset;\r
- sibling = startAncestor.nextSibling;\r
-\r
- while (cnt > 0) {\r
- nextSibling = sibling.nextSibling;\r
- n = _traverseFullySelected(sibling, how);\r
-\r
- if (frag)\r
- frag.appendChild(n);\r
-\r
- sibling = nextSibling;\r
- --cnt;\r
- }\r
-\r
- n = _traverseRightBoundary(endAncestor, how);\r
-\r
- if (frag)\r
- frag.appendChild(n);\r
-\r
- if (how != CLONE) {\r
- t.setStartAfter(startAncestor);\r
- t.collapse(TRUE);\r
- }\r
-\r
- return frag;\r
- };\r
-\r
- function _traverseRightBoundary(root, how) {\r
- var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER];\r
-\r
- if (next == root)\r
- return _traverseNode(next, isFullySelected, FALSE, how);\r
-\r
- parent = next.parentNode;\r
- clonedParent = _traverseNode(parent, FALSE, FALSE, how);\r
-\r
- while (parent) {\r
- while (next) {\r
- prevSibling = next.previousSibling;\r
- clonedChild = _traverseNode(next, isFullySelected, FALSE, how);\r
-\r
- if (how != DELETE)\r
- clonedParent.insertBefore(clonedChild, clonedParent.firstChild);\r
-\r
- isFullySelected = TRUE;\r
- next = prevSibling;\r
- }\r
-\r
- if (parent == root)\r
- return clonedParent;\r
-\r
- next = parent.previousSibling;\r
- parent = parent.parentNode;\r
-\r
- clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how);\r
-\r
- if (how != DELETE)\r
- clonedGrandParent.appendChild(clonedParent);\r
-\r
- clonedParent = clonedGrandParent;\r
- }\r
- };\r
-\r
- function _traverseLeftBoundary(root, how) {\r
- var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;\r
-\r
- if (next == root)\r
- return _traverseNode(next, isFullySelected, TRUE, how);\r
-\r
- parent = next.parentNode;\r
- clonedParent = _traverseNode(parent, FALSE, TRUE, how);\r
-\r
- while (parent) {\r
- while (next) {\r
- nextSibling = next.nextSibling;\r
- clonedChild = _traverseNode(next, isFullySelected, TRUE, how);\r
-\r
- if (how != DELETE)\r
- clonedParent.appendChild(clonedChild);\r
-\r
- isFullySelected = TRUE;\r
- next = nextSibling;\r
- }\r
-\r
- if (parent == root)\r
- return clonedParent;\r
-\r
- next = parent.nextSibling;\r
- parent = parent.parentNode;\r
-\r
- clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how);\r
-\r
- if (how != DELETE)\r
- clonedGrandParent.appendChild(clonedParent);\r
-\r
- clonedParent = clonedGrandParent;\r
- }\r
- };\r
-\r
- function _traverseNode(n, isFullySelected, isLeft, how) {\r
- var txtValue, newNodeValue, oldNodeValue, offset, newNode;\r
-\r
- if (isFullySelected)\r
- return _traverseFullySelected(n, how);\r
-\r
- if (n.nodeType == 3 /* TEXT_NODE */) {\r
- txtValue = n.nodeValue;\r
-\r
- if (isLeft) {\r
- offset = t[START_OFFSET];\r
- newNodeValue = txtValue.substring(offset);\r
- oldNodeValue = txtValue.substring(0, offset);\r
- } else {\r
- offset = t[END_OFFSET];\r
- newNodeValue = txtValue.substring(0, offset);\r
- oldNodeValue = txtValue.substring(offset);\r
- }\r
-\r
- if (how != CLONE)\r
- n.nodeValue = oldNodeValue;\r
-\r
- if (how == DELETE)\r
- return;\r
-\r
- newNode = dom.clone(n, FALSE);\r
- newNode.nodeValue = newNodeValue;\r
-\r
- return newNode;\r
- }\r
-\r
- if (how == DELETE)\r
- return;\r
-\r
- return dom.clone(n, FALSE);\r
- };\r
-\r
- function _traverseFullySelected(n, how) {\r
- if (how != DELETE)\r
- return how == CLONE ? dom.clone(n, TRUE) : n;\r
-\r
- n.parentNode.removeChild(n);\r
- };\r
-\r
- function toStringIE() {\r
- return dom.create('body', null, cloneContents()).outerText;\r
- }\r
- \r
- return t;\r
- };\r
-\r
- ns.Range = Range;\r
-\r
- // Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype\r
- Range.prototype.toString = function() {\r
- return this.toStringIE();\r
- };\r
-})(tinymce.dom);\r
-\r
-(function() {\r
- function Selection(selection) {\r
- var self = this, dom = selection.dom, TRUE = true, FALSE = false;\r
-\r
- function getPosition(rng, start) {\r
- var checkRng, startIndex = 0, endIndex, inside,\r
- children, child, offset, index, position = -1, parent;\r
-\r
- // Setup test range, collapse it and get the parent\r
- checkRng = rng.duplicate();\r
- checkRng.collapse(start);\r
- parent = checkRng.parentElement();\r
-\r
- // Check if the selection is within the right document\r
- if (parent.ownerDocument !== selection.dom.doc)\r
- return;\r
-\r
- // IE will report non editable elements as it's parent so look for an editable one\r
- while (parent.contentEditable === "false") {\r
- parent = parent.parentNode;\r
- }\r
-\r
- // If parent doesn't have any children then return that we are inside the element\r
- if (!parent.hasChildNodes()) {\r
- return {node : parent, inside : 1};\r
- }\r
-\r
- // Setup node list and endIndex\r
- children = parent.children;\r
- endIndex = children.length - 1;\r
-\r
- // Perform a binary search for the position\r
- while (startIndex <= endIndex) {\r
- index = Math.floor((startIndex + endIndex) / 2);\r
-\r
- // Move selection to node and compare the ranges\r
- child = children[index];\r
- checkRng.moveToElementText(child);\r
- position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng);\r
-\r
- // Before/after or an exact match\r
- if (position > 0) {\r
- endIndex = index - 1;\r
- } else if (position < 0) {\r
- startIndex = index + 1;\r
- } else {\r
- return {node : child};\r
- }\r
- }\r
-\r
- // Check if child position is before or we didn't find a position\r
- if (position < 0) {\r
- // No element child was found use the parent element and the offset inside that\r
- if (!child) {\r
- checkRng.moveToElementText(parent);\r
- checkRng.collapse(true);\r
- child = parent;\r
- inside = true;\r
- } else\r
- checkRng.collapse(false);\r
-\r
- // Walk character by character in text node until we hit the selected range endpoint, hit the end of document or parent isn't the right one\r
- // We need to walk char by char since rng.text or rng.htmlText will trim line endings\r
- offset = 0;\r
- while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {\r
- if (checkRng.move('character', 1) === 0 || parent != checkRng.parentElement()) {\r
- break;\r
- }\r
-\r
- offset++;\r
- }\r
- } else {\r
- // Child position is after the selection endpoint\r
- checkRng.collapse(true);\r
-\r
- // Walk character by character in text node until we hit the selected range endpoint, hit the end of document or parent isn't the right one\r
- offset = 0;\r
- while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {\r
- if (checkRng.move('character', -1) === 0 || parent != checkRng.parentElement()) {\r
- break;\r
- }\r
-\r
- offset++;\r
- }\r
- }\r
-\r
- return {node : child, position : position, offset : offset, inside : inside};\r
- };\r
-\r
- // Returns a W3C DOM compatible range object by using the IE Range API\r
- function getRange() {\r
- var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark, fail;\r
-\r
- // If selection is outside the current document just return an empty range\r
- element = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\r
- if (element.ownerDocument != dom.doc)\r
- return domRange;\r
-\r
- collapsed = selection.isCollapsed();\r
-\r
- // Handle control selection\r
- if (ieRange.item) {\r
- domRange.setStart(element.parentNode, dom.nodeIndex(element));\r
- domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\r
-\r
- return domRange;\r
- }\r
-\r
- function findEndPoint(start) {\r
- var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;\r
-\r
- container = endPoint.node;\r
- offset = endPoint.offset;\r
-\r
- if (endPoint.inside && !container.hasChildNodes()) {\r
- domRange[start ? 'setStart' : 'setEnd'](container, 0);\r
- return;\r
- }\r
-\r
- if (offset === undef) {\r
- domRange[start ? 'setStartBefore' : 'setEndAfter'](container);\r
- return;\r
- }\r
-\r
- if (endPoint.position < 0) {\r
- sibling = endPoint.inside ? container.firstChild : container.nextSibling;\r
-\r
- if (!sibling) {\r
- domRange[start ? 'setStartAfter' : 'setEndAfter'](container);\r
- return;\r
- }\r
-\r
- if (!offset) {\r
- if (sibling.nodeType == 3)\r
- domRange[start ? 'setStart' : 'setEnd'](sibling, 0);\r
- else\r
- domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);\r
-\r
- return;\r
- }\r
-\r
- // Find the text node and offset\r
- while (sibling) {\r
- nodeValue = sibling.nodeValue;\r
- textNodeOffset += nodeValue.length;\r
-\r
- // We are at or passed the position we where looking for\r
- if (textNodeOffset >= offset) {\r
- container = sibling;\r
- textNodeOffset -= offset;\r
- textNodeOffset = nodeValue.length - textNodeOffset;\r
- break;\r
- }\r
-\r
- sibling = sibling.nextSibling;\r
- }\r
- } else {\r
- // Find the text node and offset\r
- sibling = container.previousSibling;\r
-\r
- if (!sibling)\r
- return domRange[start ? 'setStartBefore' : 'setEndBefore'](container);\r
-\r
- // If there isn't any text to loop then use the first position\r
- if (!offset) {\r
- if (container.nodeType == 3)\r
- domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);\r
- else\r
- domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);\r
-\r
- return;\r
- }\r
-\r
- while (sibling) {\r
- textNodeOffset += sibling.nodeValue.length;\r
-\r
- // We are at or passed the position we where looking for\r
- if (textNodeOffset >= offset) {\r
- container = sibling;\r
- textNodeOffset -= offset;\r
- break;\r
- }\r
-\r
- sibling = sibling.previousSibling;\r
- }\r
- }\r
-\r
- domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);\r
- };\r
-\r
- try {\r
- // Find start point\r
- findEndPoint(true);\r
-\r
- // Find end point if needed\r
- if (!collapsed)\r
- findEndPoint();\r
- } catch (ex) {\r
- // IE has a nasty bug where text nodes might throw "invalid argument" when you\r
- // access the nodeValue or other properties of text nodes. This seems to happend when\r
- // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.\r
- if (ex.number == -2147024809) {\r
- // Get the current selection\r
- bookmark = self.getBookmark(2);\r
-\r
- // Get start element\r
- tmpRange = ieRange.duplicate();\r
- tmpRange.collapse(true);\r
- element = tmpRange.parentElement();\r
-\r
- // Get end element\r
- if (!collapsed) {\r
- tmpRange = ieRange.duplicate();\r
- tmpRange.collapse(false);\r
- element2 = tmpRange.parentElement();\r
- element2.innerHTML = element2.innerHTML;\r
- }\r
-\r
- // Remove the broken elements\r
- element.innerHTML = element.innerHTML;\r
-\r
- // Restore the selection\r
- self.moveToBookmark(bookmark);\r
-\r
- // Since the range has moved we need to re-get it\r
- ieRange = selection.getRng();\r
-\r
- // Find start point\r
- findEndPoint(true);\r
-\r
- // Find end point if needed\r
- if (!collapsed)\r
- findEndPoint();\r
- } else\r
- throw ex; // Throw other errors\r
- }\r
-\r
- return domRange;\r
- };\r
-\r
- this.getBookmark = function(type) {\r
- var rng = selection.getRng(), start, end, bookmark = {};\r
-\r
- function getIndexes(node) {\r
- var parent, root, children, i, indexes = [];\r
-\r
- parent = node.parentNode;\r
- root = dom.getRoot().parentNode;\r
-\r
- while (parent != root && parent.nodeType !== 9) {\r
- children = parent.children;\r
-\r
- i = children.length;\r
- while (i--) {\r
- if (node === children[i]) {\r
- indexes.push(i);\r
- break;\r
- }\r
- }\r
-\r
- node = parent;\r
- parent = parent.parentNode;\r
- }\r
-\r
- return indexes;\r
- };\r
-\r
- function getBookmarkEndPoint(start) {\r
- var position;\r
-\r
- position = getPosition(rng, start);\r
- if (position) {\r
- return {\r
- position : position.position,\r
- offset : position.offset,\r
- indexes : getIndexes(position.node),\r
- inside : position.inside\r
- };\r
- }\r
- };\r
-\r
- // Non ubstructive bookmark\r
- if (type === 2) {\r
- // Handle text selection\r
- if (!rng.item) {\r
- bookmark.start = getBookmarkEndPoint(true);\r
-\r
- if (!selection.isCollapsed())\r
- bookmark.end = getBookmarkEndPoint();\r
- } else\r
- bookmark.start = {ctrl : true, indexes : getIndexes(rng.item(0))};\r
- }\r
-\r
- return bookmark;\r
- };\r
-\r
- this.moveToBookmark = function(bookmark) {\r
- var rng, body = dom.doc.body;\r
-\r
- function resolveIndexes(indexes) {\r
- var node, i, idx, children;\r
-\r
- node = dom.getRoot();\r
- for (i = indexes.length - 1; i >= 0; i--) {\r
- children = node.children;\r
- idx = indexes[i];\r
-\r
- if (idx <= children.length - 1) {\r
- node = children[idx];\r
- }\r
- }\r
-\r
- return node;\r
- };\r
- \r
- function setBookmarkEndPoint(start) {\r
- var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef;\r
-\r
- if (endPoint) {\r
- moveLeft = endPoint.position > 0;\r
-\r
- moveRng = body.createTextRange();\r
- moveRng.moveToElementText(resolveIndexes(endPoint.indexes));\r
-\r
- offset = endPoint.offset;\r
- if (offset !== undef) {\r
- moveRng.collapse(endPoint.inside || moveLeft);\r
- moveRng.moveStart('character', moveLeft ? -offset : offset);\r
- } else\r
- moveRng.collapse(start);\r
-\r
- rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng);\r
-\r
- if (start)\r
- rng.collapse(true);\r
- }\r
- };\r
-\r
- if (bookmark.start) {\r
- if (bookmark.start.ctrl) {\r
- rng = body.createControlRange();\r
- rng.addElement(resolveIndexes(bookmark.start.indexes));\r
- rng.select();\r
- } else {\r
- rng = body.createTextRange();\r
- setBookmarkEndPoint(true);\r
- setBookmarkEndPoint();\r
- rng.select();\r
- }\r
- }\r
- };\r
-\r
- this.addRange = function(rng) {\r
- var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling,\r
- doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm;\r
-\r
- function setEndPoint(start) {\r
- var container, offset, marker, tmpRng, nodes;\r
-\r
- marker = dom.create('a');\r
- container = start ? startContainer : endContainer;\r
- offset = start ? startOffset : endOffset;\r
- tmpRng = ieRng.duplicate();\r
-\r
- if (container == doc || container == doc.documentElement) {\r
- container = body;\r
- offset = 0;\r
- }\r
-\r
- if (container.nodeType == 3) {\r
- container.parentNode.insertBefore(marker, container);\r
- tmpRng.moveToElementText(marker);\r
- tmpRng.moveStart('character', offset);\r
- dom.remove(marker);\r
- ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);\r
- } else {\r
- nodes = container.childNodes;\r
-\r
- if (nodes.length) {\r
- if (offset >= nodes.length) {\r
- dom.insertAfter(marker, nodes[nodes.length - 1]);\r
- } else {\r
- container.insertBefore(marker, nodes[offset]);\r
- }\r
-\r
- tmpRng.moveToElementText(marker);\r
- } else if (container.canHaveHTML) {\r
- // Empty node selection for example <div>|</div>\r
- // Setting innerHTML with a span marker then remove that marker seems to keep empty block elements open\r
- container.innerHTML = '<span>\uFEFF</span>';\r
- marker = container.firstChild;\r
- tmpRng.moveToElementText(marker);\r
- tmpRng.collapse(FALSE); // Collapse false works better than true for some odd reason\r
- }\r
-\r
- ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);\r
- dom.remove(marker);\r
- }\r
- }\r
-\r
- // Setup some shorter versions\r
- startContainer = rng.startContainer;\r
- startOffset = rng.startOffset;\r
- endContainer = rng.endContainer;\r
- endOffset = rng.endOffset;\r
- ieRng = body.createTextRange();\r
-\r
- // If single element selection then try making a control selection out of it\r
- if (startContainer == endContainer && startContainer.nodeType == 1) {\r
- // Trick to place the caret inside an empty block element like <p></p>\r
- if (startOffset == endOffset && !startContainer.hasChildNodes()) {\r
- if (startContainer.canHaveHTML) {\r
- // Check if previous sibling is an empty block if it is then we need to render it\r
- // IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236\r
- // Example this: <p></p><p>|</p> would become this: <p>|</p><p></p>\r
- sibling = startContainer.previousSibling;\r
- if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) {\r
- sibling.innerHTML = '\uFEFF';\r
- } else {\r
- sibling = null;\r
- }\r
-\r
- startContainer.innerHTML = '<span>\uFEFF</span><span>\uFEFF</span>';\r
- ieRng.moveToElementText(startContainer.lastChild);\r
- ieRng.select();\r
- dom.doc.selection.clear();\r
- startContainer.innerHTML = '';\r
-\r
- if (sibling) {\r
- sibling.innerHTML = '';\r
- }\r
- return;\r
- } else {\r
- startOffset = dom.nodeIndex(startContainer);\r
- startContainer = startContainer.parentNode;\r
- }\r
- }\r
-\r
- if (startOffset == endOffset - 1) {\r
- try {\r
- ctrlElm = startContainer.childNodes[startOffset];\r
- ctrlRng = body.createControlRange();\r
- ctrlRng.addElement(ctrlElm);\r
- ctrlRng.select();\r
-\r
- // Check if the range produced is on the correct element and is a control range\r
- // On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398\r
- nativeRng = selection.getRng();\r
- if (nativeRng.item && ctrlElm === nativeRng.item(0)) {\r
- return;\r
- }\r
- } catch (ex) {\r
- // Ignore\r
- }\r
- }\r
- }\r
-\r
- // Set start/end point of selection\r
- setEndPoint(true);\r
- setEndPoint();\r
-\r
- // Select the new range and scroll it into view\r
- ieRng.select();\r
- };\r
-\r
- // Expose range method\r
- this.getRangeAt = getRange;\r
- };\r
-\r
- // Expose the selection object\r
- tinymce.dom.TridentSelection = Selection;\r
-})();\r
-\r
-\r
-/*\r
- * Sizzle CSS Selector Engine\r
- * Copyright, The Dojo Foundation\r
- * Released under the MIT, BSD, and GPL Licenses.\r
- * More information: http://sizzlejs.com/\r
- */\r
-(function(){\r
-\r
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,\r
- expando = "sizcache",\r
- done = 0,\r
- toString = Object.prototype.toString,\r
- hasDuplicate = false,\r
- baseHasDuplicate = true,\r
- rBackslash = /\\/g,\r
- rReturn = /\r\n/g,\r
- rNonWord = /\W/;\r
-\r
-// Here we check if the JavaScript engine is using some sort of\r
-// optimization where it does not always call our comparision\r
-// function. If that is the case, discard the hasDuplicate value.\r
-// Thus far that includes Google Chrome.\r
-[0, 0].sort(function() {\r
- baseHasDuplicate = false;\r
- return 0;\r
-});\r
-\r
-var Sizzle = function( selector, context, results, seed ) {\r
- results = results || [];\r
- context = context || document;\r
-\r
- var origContext = context;\r
-\r
- if ( context.nodeType !== 1 && context.nodeType !== 9 ) {\r
- return [];\r
- }\r
-\r
- if ( !selector || typeof selector !== "string" ) {\r
- return results;\r
- }\r
-\r
- var m, set, checkSet, extra, ret, cur, pop, i,\r
- prune = true,\r
- contextXML = Sizzle.isXML( context ),\r
- parts = [],\r
- soFar = selector;\r
-\r
- // Reset the position of the chunker regexp (start from head)\r
- do {\r
- chunker.exec( "" );\r
- m = chunker.exec( soFar );\r
-\r
- if ( m ) {\r
- soFar = m[3];\r
-\r
- parts.push( m[1] );\r
-\r
- if ( m[2] ) {\r
- extra = m[3];\r
- break;\r
- }\r
- }\r
- } while ( m );\r
-\r
- if ( parts.length > 1 && origPOS.exec( selector ) ) {\r
-\r
- if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {\r
- set = posProcess( parts[0] + parts[1], context, seed );\r
-\r
- } else {\r
- set = Expr.relative[ parts[0] ] ?\r
- [ context ] :\r
- Sizzle( parts.shift(), context );\r
-\r
- while ( parts.length ) {\r
- selector = parts.shift();\r
-\r
- if ( Expr.relative[ selector ] ) {\r
- selector += parts.shift();\r
- }\r
-\r
- set = posProcess( selector, set, seed );\r
- }\r
- }\r
-\r
- } else {\r
- // Take a shortcut and set the context if the root selector is an ID\r
- // (but not if it'll be faster if the inner selector is an ID)\r
- if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&\r
- Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {\r
-\r
- ret = Sizzle.find( parts.shift(), context, contextXML );\r
- context = ret.expr ?\r
- Sizzle.filter( ret.expr, ret.set )[0] :\r
- ret.set[0];\r
- }\r
-\r
- if ( context ) {\r
- ret = seed ?\r
- { expr: parts.pop(), set: makeArray(seed) } :\r
- Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );\r
-\r
- set = ret.expr ?\r
- Sizzle.filter( ret.expr, ret.set ) :\r
- ret.set;\r
-\r
- if ( parts.length > 0 ) {\r
- checkSet = makeArray( set );\r
-\r
- } else {\r
- prune = false;\r
- }\r
-\r
- while ( parts.length ) {\r
- cur = parts.pop();\r
- pop = cur;\r
-\r
- if ( !Expr.relative[ cur ] ) {\r
- cur = "";\r
- } else {\r
- pop = parts.pop();\r
- }\r
-\r
- if ( pop == null ) {\r
- pop = context;\r
- }\r
-\r
- Expr.relative[ cur ]( checkSet, pop, contextXML );\r
- }\r
-\r
- } else {\r
- checkSet = parts = [];\r
- }\r
- }\r
-\r
- if ( !checkSet ) {\r
- checkSet = set;\r
- }\r
-\r
- if ( !checkSet ) {\r
- Sizzle.error( cur || selector );\r
- }\r
-\r
- if ( toString.call(checkSet) === "[object Array]" ) {\r
- if ( !prune ) {\r
- results.push.apply( results, checkSet );\r
-\r
- } else if ( context && context.nodeType === 1 ) {\r
- for ( i = 0; checkSet[i] != null; i++ ) {\r
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {\r
- results.push( set[i] );\r
- }\r
- }\r
-\r
- } else {\r
- for ( i = 0; checkSet[i] != null; i++ ) {\r
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {\r
- results.push( set[i] );\r
- }\r
- }\r
- }\r
-\r
- } else {\r
- makeArray( checkSet, results );\r
- }\r
-\r
- if ( extra ) {\r
- Sizzle( extra, origContext, results, seed );\r
- Sizzle.uniqueSort( results );\r
- }\r
-\r
- return results;\r
-};\r
-\r
-Sizzle.uniqueSort = function( results ) {\r
- if ( sortOrder ) {\r
- hasDuplicate = baseHasDuplicate;\r
- results.sort( sortOrder );\r
-\r
- if ( hasDuplicate ) {\r
- for ( var i = 1; i < results.length; i++ ) {\r
- if ( results[i] === results[ i - 1 ] ) {\r
- results.splice( i--, 1 );\r
- }\r
- }\r
- }\r
- }\r
-\r
- return results;\r
-};\r
-\r
-Sizzle.matches = function( expr, set ) {\r
- return Sizzle( expr, null, null, set );\r
-};\r
-\r
-Sizzle.matchesSelector = function( node, expr ) {\r
- return Sizzle( expr, null, null, [node] ).length > 0;\r
-};\r
-\r
-Sizzle.find = function( expr, context, isXML ) {\r
- var set, i, len, match, type, left;\r
-\r
- if ( !expr ) {\r
- return [];\r
- }\r
-\r
- for ( i = 0, len = Expr.order.length; i < len; i++ ) {\r
- type = Expr.order[i];\r
-\r
- if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {\r
- left = match[1];\r
- match.splice( 1, 1 );\r
-\r
- if ( left.substr( left.length - 1 ) !== "\\" ) {\r
- match[1] = (match[1] || "").replace( rBackslash, "" );\r
- set = Expr.find[ type ]( match, context, isXML );\r
-\r
- if ( set != null ) {\r
- expr = expr.replace( Expr.match[ type ], "" );\r
- break;\r
- }\r
- }\r
- }\r
- }\r
-\r
- if ( !set ) {\r
- set = typeof context.getElementsByTagName !== "undefined" ?\r
- context.getElementsByTagName( "*" ) :\r
- [];\r
- }\r
-\r
- return { set: set, expr: expr };\r
-};\r
-\r
-Sizzle.filter = function( expr, set, inplace, not ) {\r
- var match, anyFound,\r
- type, found, item, filter, left,\r
- i, pass,\r
- old = expr,\r
- result = [],\r
- curLoop = set,\r
- isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );\r
-\r
- while ( expr && set.length ) {\r
- for ( type in Expr.filter ) {\r
- if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {\r
- filter = Expr.filter[ type ];\r
- left = match[1];\r
-\r
- anyFound = false;\r
-\r
- match.splice(1,1);\r
-\r
- if ( left.substr( left.length - 1 ) === "\\" ) {\r
- continue;\r
- }\r
-\r
- if ( curLoop === result ) {\r
- result = [];\r
- }\r
-\r
- if ( Expr.preFilter[ type ] ) {\r
- match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );\r
-\r
- if ( !match ) {\r
- anyFound = found = true;\r
-\r
- } else if ( match === true ) {\r
- continue;\r
- }\r
- }\r
-\r
- if ( match ) {\r
- for ( i = 0; (item = curLoop[i]) != null; i++ ) {\r
- if ( item ) {\r
- found = filter( item, match, i, curLoop );\r
- pass = not ^ found;\r
-\r
- if ( inplace && found != null ) {\r
- if ( pass ) {\r
- anyFound = true;\r
-\r
- } else {\r
- curLoop[i] = false;\r
- }\r
-\r
- } else if ( pass ) {\r
- result.push( item );\r
- anyFound = true;\r
- }\r
- }\r
- }\r
- }\r
-\r
- if ( found !== undefined ) {\r
- if ( !inplace ) {\r
- curLoop = result;\r
- }\r
-\r
- expr = expr.replace( Expr.match[ type ], "" );\r
-\r
- if ( !anyFound ) {\r
- return [];\r
- }\r
-\r
- break;\r
- }\r
- }\r
- }\r
-\r
- // Improper expression\r
- if ( expr === old ) {\r
- if ( anyFound == null ) {\r
- Sizzle.error( expr );\r
-\r
- } else {\r
- break;\r
- }\r
- }\r
-\r
- old = expr;\r
- }\r
-\r
- return curLoop;\r
-};\r
-\r
-Sizzle.error = function( msg ) {\r
- throw new Error( "Syntax error, unrecognized expression: " + msg );\r
-};\r
-\r
-var getText = Sizzle.getText = function( elem ) {\r
- var i, node,\r
- nodeType = elem.nodeType,\r
- ret = "";\r
-\r
- if ( nodeType ) {\r
- if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\r
- // Use textContent || innerText for elements\r
- if ( typeof elem.textContent === 'string' ) {\r
- return elem.textContent;\r
- } else if ( typeof elem.innerText === 'string' ) {\r
- // Replace IE's carriage returns\r
- return elem.innerText.replace( rReturn, '' );\r
- } else {\r
- // Traverse it's children\r
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {\r
- ret += getText( elem );\r
- }\r
- }\r
- } else if ( nodeType === 3 || nodeType === 4 ) {\r
- return elem.nodeValue;\r
- }\r
- } else {\r
-\r
- // If no nodeType, this is expected to be an array\r
- for ( i = 0; (node = elem[i]); i++ ) {\r
- // Do not traverse comment nodes\r
- if ( node.nodeType !== 8 ) {\r
- ret += getText( node );\r
- }\r
- }\r
- }\r
- return ret;\r
-};\r
-\r
-var Expr = Sizzle.selectors = {\r
- order: [ "ID", "NAME", "TAG" ],\r
-\r
- match: {\r
- ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,\r
- CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,\r
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,\r
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,\r
- TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,\r
- CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,\r
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,\r
- PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/\r
- },\r
-\r
- leftMatch: {},\r
-\r
- attrMap: {\r
- "class": "className",\r
- "for": "htmlFor"\r
- },\r
-\r
- attrHandle: {\r
- href: function( elem ) {\r
- return elem.getAttribute( "href" );\r
- },\r
- type: function( elem ) {\r
- return elem.getAttribute( "type" );\r
- }\r
- },\r
-\r
- relative: {\r
- "+": function(checkSet, part){\r
- var isPartStr = typeof part === "string",\r
- isTag = isPartStr && !rNonWord.test( part ),\r
- isPartStrNotTag = isPartStr && !isTag;\r
-\r
- if ( isTag ) {\r
- part = part.toLowerCase();\r
- }\r
-\r
- for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {\r
- if ( (elem = checkSet[i]) ) {\r
- while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}\r
-\r
- checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?\r
- elem || false :\r
- elem === part;\r
- }\r
- }\r
-\r
- if ( isPartStrNotTag ) {\r
- Sizzle.filter( part, checkSet, true );\r
- }\r
- },\r
-\r
- ">": function( checkSet, part ) {\r
- var elem,\r
- isPartStr = typeof part === "string",\r
- i = 0,\r
- l = checkSet.length;\r
-\r
- if ( isPartStr && !rNonWord.test( part ) ) {\r
- part = part.toLowerCase();\r
-\r
- for ( ; i < l; i++ ) {\r
- elem = checkSet[i];\r
-\r
- if ( elem ) {\r
- var parent = elem.parentNode;\r
- checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;\r
- }\r
- }\r
-\r
- } else {\r
- for ( ; i < l; i++ ) {\r
- elem = checkSet[i];\r
-\r
- if ( elem ) {\r
- checkSet[i] = isPartStr ?\r
- elem.parentNode :\r
- elem.parentNode === part;\r
- }\r
- }\r
-\r
- if ( isPartStr ) {\r
- Sizzle.filter( part, checkSet, true );\r
- }\r
- }\r
- },\r
-\r
- "": function(checkSet, part, isXML){\r
- var nodeCheck,\r
- doneName = done++,\r
- checkFn = dirCheck;\r
-\r
- if ( typeof part === "string" && !rNonWord.test( part ) ) {\r
- part = part.toLowerCase();\r
- nodeCheck = part;\r
- checkFn = dirNodeCheck;\r
- }\r
-\r
- checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );\r
- },\r
-\r
- "~": function( checkSet, part, isXML ) {\r
- var nodeCheck,\r
- doneName = done++,\r
- checkFn = dirCheck;\r
-\r
- if ( typeof part === "string" && !rNonWord.test( part ) ) {\r
- part = part.toLowerCase();\r
- nodeCheck = part;\r
- checkFn = dirNodeCheck;\r
- }\r
-\r
- checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );\r
- }\r
- },\r
-\r
- find: {\r
- ID: function( match, context, isXML ) {\r
- if ( typeof context.getElementById !== "undefined" && !isXML ) {\r
- var m = context.getElementById(match[1]);\r
- // Check parentNode to catch when Blackberry 4.6 returns\r
- // nodes that are no longer in the document #6963\r
- return m && m.parentNode ? [m] : [];\r
- }\r
- },\r
-\r
- NAME: function( match, context ) {\r
- if ( typeof context.getElementsByName !== "undefined" ) {\r
- var ret = [],\r
- results = context.getElementsByName( match[1] );\r
-\r
- for ( var i = 0, l = results.length; i < l; i++ ) {\r
- if ( results[i].getAttribute("name") === match[1] ) {\r
- ret.push( results[i] );\r
- }\r
- }\r
-\r
- return ret.length === 0 ? null : ret;\r
- }\r
- },\r
-\r
- TAG: function( match, context ) {\r
- if ( typeof context.getElementsByTagName !== "undefined" ) {\r
- return context.getElementsByTagName( match[1] );\r
- }\r
- }\r
- },\r
- preFilter: {\r
- CLASS: function( match, curLoop, inplace, result, not, isXML ) {\r
- match = " " + match[1].replace( rBackslash, "" ) + " ";\r
-\r
- if ( isXML ) {\r
- return match;\r
- }\r
-\r
- for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {\r
- if ( elem ) {\r
- if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {\r
- if ( !inplace ) {\r
- result.push( elem );\r
- }\r
-\r
- } else if ( inplace ) {\r
- curLoop[i] = false;\r
- }\r
- }\r
- }\r
-\r
- return false;\r
- },\r
-\r
- ID: function( match ) {\r
- return match[1].replace( rBackslash, "" );\r
- },\r
-\r
- TAG: function( match, curLoop ) {\r
- return match[1].replace( rBackslash, "" ).toLowerCase();\r
- },\r
-\r
- CHILD: function( match ) {\r
- if ( match[1] === "nth" ) {\r
- if ( !match[2] ) {\r
- Sizzle.error( match[0] );\r
- }\r
-\r
- match[2] = match[2].replace(/^\+|\s*/g, '');\r
-\r
- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'\r
- var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(\r
- match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||\r
- !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);\r
-\r
- // calculate the numbers (first)n+(last) including if they are negative\r
- match[2] = (test[1] + (test[2] || 1)) - 0;\r
- match[3] = test[3] - 0;\r
- }\r
- else if ( match[2] ) {\r
- Sizzle.error( match[0] );\r
- }\r
-\r
- // TODO: Move to normal caching system\r
- match[0] = done++;\r
-\r
- return match;\r
- },\r
-\r
- ATTR: function( match, curLoop, inplace, result, not, isXML ) {\r
- var name = match[1] = match[1].replace( rBackslash, "" );\r
-\r
- if ( !isXML && Expr.attrMap[name] ) {\r
- match[1] = Expr.attrMap[name];\r
- }\r
-\r
- // Handle if an un-quoted value was used\r
- match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );\r
-\r
- if ( match[2] === "~=" ) {\r
- match[4] = " " + match[4] + " ";\r
- }\r
-\r
- return match;\r
- },\r
-\r
- PSEUDO: function( match, curLoop, inplace, result, not ) {\r
- if ( match[1] === "not" ) {\r
- // If we're dealing with a complex expression, or a simple one\r
- if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {\r
- match[3] = Sizzle(match[3], null, null, curLoop);\r
-\r
- } else {\r
- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);\r
-\r
- if ( !inplace ) {\r
- result.push.apply( result, ret );\r
- }\r
-\r
- return false;\r
- }\r
-\r
- } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {\r
- return true;\r
- }\r
-\r
- return match;\r
- },\r
-\r
- POS: function( match ) {\r
- match.unshift( true );\r
-\r
- return match;\r
- }\r
- },\r
-\r
- filters: {\r
- enabled: function( elem ) {\r
- return elem.disabled === false && elem.type !== "hidden";\r
- },\r
-\r
- disabled: function( elem ) {\r
- return elem.disabled === true;\r
- },\r
-\r
- checked: function( elem ) {\r
- return elem.checked === true;\r
- },\r
-\r
- selected: function( elem ) {\r
- // Accessing this property makes selected-by-default\r
- // options in Safari work properly\r
- if ( elem.parentNode ) {\r
- elem.parentNode.selectedIndex;\r
- }\r
-\r
- return elem.selected === true;\r
- },\r
-\r
- parent: function( elem ) {\r
- return !!elem.firstChild;\r
- },\r
-\r
- empty: function( elem ) {\r
- return !elem.firstChild;\r
- },\r
-\r
- has: function( elem, i, match ) {\r
- return !!Sizzle( match[3], elem ).length;\r
- },\r
-\r
- header: function( elem ) {\r
- return (/h\d/i).test( elem.nodeName );\r
- },\r
-\r
- text: function( elem ) {\r
- var attr = elem.getAttribute( "type" ), type = elem.type;\r
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\r
- // use getAttribute instead to test this case\r
- return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );\r
- },\r
-\r
- radio: function( elem ) {\r
- return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;\r
- },\r
-\r
- checkbox: function( elem ) {\r
- return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;\r
- },\r
-\r
- file: function( elem ) {\r
- return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;\r
- },\r
-\r
- password: function( elem ) {\r
- return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;\r
- },\r
-\r
- submit: function( elem ) {\r
- var name = elem.nodeName.toLowerCase();\r
- return (name === "input" || name === "button") && "submit" === elem.type;\r
- },\r
-\r
- image: function( elem ) {\r
- return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;\r
- },\r
-\r
- reset: function( elem ) {\r
- var name = elem.nodeName.toLowerCase();\r
- return (name === "input" || name === "button") && "reset" === elem.type;\r
- },\r
-\r
- button: function( elem ) {\r
- var name = elem.nodeName.toLowerCase();\r
- return name === "input" && "button" === elem.type || name === "button";\r
- },\r
-\r
- input: function( elem ) {\r
- return (/input|select|textarea|button/i).test( elem.nodeName );\r
- },\r
-\r
- focus: function( elem ) {\r
- return elem === elem.ownerDocument.activeElement;\r
- }\r
- },\r
- setFilters: {\r
- first: function( elem, i ) {\r
- return i === 0;\r
- },\r
-\r
- last: function( elem, i, match, array ) {\r
- return i === array.length - 1;\r
- },\r
-\r
- even: function( elem, i ) {\r
- return i % 2 === 0;\r
- },\r
-\r
- odd: function( elem, i ) {\r
- return i % 2 === 1;\r
- },\r
-\r
- lt: function( elem, i, match ) {\r
- return i < match[3] - 0;\r
- },\r
-\r
- gt: function( elem, i, match ) {\r
- return i > match[3] - 0;\r
- },\r
-\r
- nth: function( elem, i, match ) {\r
- return match[3] - 0 === i;\r
- },\r
-\r
- eq: function( elem, i, match ) {\r
- return match[3] - 0 === i;\r
- }\r
- },\r
- filter: {\r
- PSEUDO: function( elem, match, i, array ) {\r
- var name = match[1],\r
- filter = Expr.filters[ name ];\r
-\r
- if ( filter ) {\r
- return filter( elem, i, match, array );\r
-\r
- } else if ( name === "contains" ) {\r
- return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;\r
-\r
- } else if ( name === "not" ) {\r
- var not = match[3];\r
-\r
- for ( var j = 0, l = not.length; j < l; j++ ) {\r
- if ( not[j] === elem ) {\r
- return false;\r
- }\r
- }\r
-\r
- return true;\r
-\r
- } else {\r
- Sizzle.error( name );\r
- }\r
- },\r
-\r
- CHILD: function( elem, match ) {\r
- var first, last,\r
- doneName, parent, cache,\r
- count, diff,\r
- type = match[1],\r
- node = elem;\r
-\r
- switch ( type ) {\r
- case "only":\r
- case "first":\r
- while ( (node = node.previousSibling) ) {\r
- if ( node.nodeType === 1 ) {\r
- return false;\r
- }\r
- }\r
-\r
- if ( type === "first" ) {\r
- return true;\r
- }\r
-\r
- node = elem;\r
-\r
- /* falls through */\r
- case "last":\r
- while ( (node = node.nextSibling) ) {\r
- if ( node.nodeType === 1 ) {\r
- return false;\r
- }\r
- }\r
-\r
- return true;\r
-\r
- case "nth":\r
- first = match[2];\r
- last = match[3];\r
-\r
- if ( first === 1 && last === 0 ) {\r
- return true;\r
- }\r
-\r
- doneName = match[0];\r
- parent = elem.parentNode;\r
-\r
- if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {\r
- count = 0;\r
-\r
- for ( node = parent.firstChild; node; node = node.nextSibling ) {\r
- if ( node.nodeType === 1 ) {\r
- node.nodeIndex = ++count;\r
- }\r
- }\r
-\r
- parent[ expando ] = doneName;\r
- }\r
-\r
- diff = elem.nodeIndex - last;\r
-\r
- if ( first === 0 ) {\r
- return diff === 0;\r
-\r
- } else {\r
- return ( diff % first === 0 && diff / first >= 0 );\r
- }\r
- }\r
- },\r
-\r
- ID: function( elem, match ) {\r
- return elem.nodeType === 1 && elem.getAttribute("id") === match;\r
- },\r
-\r
- TAG: function( elem, match ) {\r
- return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;\r
- },\r
-\r
- CLASS: function( elem, match ) {\r
- return (" " + (elem.className || elem.getAttribute("class")) + " ")\r
- .indexOf( match ) > -1;\r
- },\r
-\r
- ATTR: function( elem, match ) {\r
- var name = match[1],\r
- result = Sizzle.attr ?\r
- Sizzle.attr( elem, name ) :\r
- Expr.attrHandle[ name ] ?\r
- Expr.attrHandle[ name ]( elem ) :\r
- elem[ name ] != null ?\r
- elem[ name ] :\r
- elem.getAttribute( name ),\r
- value = result + "",\r
- type = match[2],\r
- check = match[4];\r
-\r
- return result == null ?\r
- type === "!=" :\r
- !type && Sizzle.attr ?\r
- result != null :\r
- type === "=" ?\r
- value === check :\r
- type === "*=" ?\r
- value.indexOf(check) >= 0 :\r
- type === "~=" ?\r
- (" " + value + " ").indexOf(check) >= 0 :\r
- !check ?\r
- value && result !== false :\r
- type === "!=" ?\r
- value !== check :\r
- type === "^=" ?\r
- value.indexOf(check) === 0 :\r
- type === "$=" ?\r
- value.substr(value.length - check.length) === check :\r
- type === "|=" ?\r
- value === check || value.substr(0, check.length + 1) === check + "-" :\r
- false;\r
- },\r
-\r
- POS: function( elem, match, i, array ) {\r
- var name = match[2],\r
- filter = Expr.setFilters[ name ];\r
-\r
- if ( filter ) {\r
- return filter( elem, i, match, array );\r
- }\r
- }\r
- }\r
-};\r
-\r
-var origPOS = Expr.match.POS,\r
- fescape = function(all, num){\r
- return "\\" + (num - 0 + 1);\r
- };\r
-\r
-for ( var type in Expr.match ) {\r
- Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );\r
- Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );\r
-}\r
-// Expose origPOS\r
-// "global" as in regardless of relation to brackets/parens\r
-Expr.match.globalPOS = origPOS;\r
-\r
-var makeArray = function( array, results ) {\r
- array = Array.prototype.slice.call( array, 0 );\r
-\r
- if ( results ) {\r
- results.push.apply( results, array );\r
- return results;\r
- }\r
-\r
- return array;\r
-};\r
-\r
-// Perform a simple check to determine if the browser is capable of\r
-// converting a NodeList to an array using builtin methods.\r
-// Also verifies that the returned array holds DOM nodes\r
-// (which is not the case in the Blackberry browser)\r
-try {\r
- Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;\r
-\r
-// Provide a fallback method if it does not work\r
-} catch( e ) {\r
- makeArray = function( array, results ) {\r
- var i = 0,\r
- ret = results || [];\r
-\r
- if ( toString.call(array) === "[object Array]" ) {\r
- Array.prototype.push.apply( ret, array );\r
-\r
- } else {\r
- if ( typeof array.length === "number" ) {\r
- for ( var l = array.length; i < l; i++ ) {\r
- ret.push( array[i] );\r
- }\r
-\r
- } else {\r
- for ( ; array[i]; i++ ) {\r
- ret.push( array[i] );\r
- }\r
- }\r
- }\r
-\r
- return ret;\r
- };\r
-}\r
-\r
-var sortOrder, siblingCheck;\r
-\r
-if ( document.documentElement.compareDocumentPosition ) {\r
- sortOrder = function( a, b ) {\r
- if ( a === b ) {\r
- hasDuplicate = true;\r
- return 0;\r
- }\r
-\r
- if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {\r
- return a.compareDocumentPosition ? -1 : 1;\r
- }\r
-\r
- return a.compareDocumentPosition(b) & 4 ? -1 : 1;\r
- };\r
-\r
-} else {\r
- sortOrder = function( a, b ) {\r
- // The nodes are identical, we can exit early\r
- if ( a === b ) {\r
- hasDuplicate = true;\r
- return 0;\r
-\r
- // Fallback to using sourceIndex (in IE) if it's available on both nodes\r
- } else if ( a.sourceIndex && b.sourceIndex ) {\r
- return a.sourceIndex - b.sourceIndex;\r
- }\r
-\r
- var al, bl,\r
- ap = [],\r
- bp = [],\r
- aup = a.parentNode,\r
- bup = b.parentNode,\r
- cur = aup;\r
-\r
- // If the nodes are siblings (or identical) we can do a quick check\r
- if ( aup === bup ) {\r
- return siblingCheck( a, b );\r
-\r
- // If no parents were found then the nodes are disconnected\r
- } else if ( !aup ) {\r
- return -1;\r
-\r
- } else if ( !bup ) {\r
- return 1;\r
- }\r
-\r
- // Otherwise they're somewhere else in the tree so we need\r
- // to build up a full list of the parentNodes for comparison\r
- while ( cur ) {\r
- ap.unshift( cur );\r
- cur = cur.parentNode;\r
- }\r
-\r
- cur = bup;\r
-\r
- while ( cur ) {\r
- bp.unshift( cur );\r
- cur = cur.parentNode;\r
- }\r
-\r
- al = ap.length;\r
- bl = bp.length;\r
-\r
- // Start walking down the tree looking for a discrepancy\r
- for ( var i = 0; i < al && i < bl; i++ ) {\r
- if ( ap[i] !== bp[i] ) {\r
- return siblingCheck( ap[i], bp[i] );\r
- }\r
- }\r
-\r
- // We ended someplace up the tree so do a sibling check\r
- return i === al ?\r
- siblingCheck( a, bp[i], -1 ) :\r
- siblingCheck( ap[i], b, 1 );\r
- };\r
-\r
- siblingCheck = function( a, b, ret ) {\r
- if ( a === b ) {\r
- return ret;\r
- }\r
-\r
- var cur = a.nextSibling;\r
-\r
- while ( cur ) {\r
- if ( cur === b ) {\r
- return -1;\r
- }\r
-\r
- cur = cur.nextSibling;\r
- }\r
-\r
- return 1;\r
- };\r
-}\r
-\r
-// Check to see if the browser returns elements by name when\r
-// querying by getElementById (and provide a workaround)\r
-(function(){\r
- // We're going to inject a fake input element with a specified name\r
- var form = document.createElement("div"),\r
- id = "script" + (new Date()).getTime(),\r
- root = document.documentElement;\r
-\r
- form.innerHTML = "<a name='" + id + "'/>";\r
-\r
- // Inject it into the root element, check its status, and remove it quickly\r
- root.insertBefore( form, root.firstChild );\r
-\r
- // The workaround has to do additional checks after a getElementById\r
- // Which slows things down for other browsers (hence the branching)\r
- if ( document.getElementById( id ) ) {\r
- Expr.find.ID = function( match, context, isXML ) {\r
- if ( typeof context.getElementById !== "undefined" && !isXML ) {\r
- var m = context.getElementById(match[1]);\r
-\r
- return m ?\r
- m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?\r
- [m] :\r
- undefined :\r
- [];\r
- }\r
- };\r
-\r
- Expr.filter.ID = function( elem, match ) {\r
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");\r
-\r
- return elem.nodeType === 1 && node && node.nodeValue === match;\r
- };\r
- }\r
-\r
- root.removeChild( form );\r
-\r
- // release memory in IE\r
- root = form = null;\r
-})();\r
-\r
-(function(){\r
- // Check to see if the browser returns only elements\r
- // when doing getElementsByTagName("*")\r
-\r
- // Create a fake element\r
- var div = document.createElement("div");\r
- div.appendChild( document.createComment("") );\r
-\r
- // Make sure no comments are found\r
- if ( div.getElementsByTagName("*").length > 0 ) {\r
- Expr.find.TAG = function( match, context ) {\r
- var results = context.getElementsByTagName( match[1] );\r
-\r
- // Filter out possible comments\r
- if ( match[1] === "*" ) {\r
- var tmp = [];\r
-\r
- for ( var i = 0; results[i]; i++ ) {\r
- if ( results[i].nodeType === 1 ) {\r
- tmp.push( results[i] );\r
- }\r
- }\r
-\r
- results = tmp;\r
- }\r
-\r
- return results;\r
- };\r
- }\r
-\r
- // Check to see if an attribute returns normalized href attributes\r
- div.innerHTML = "<a href='#'></a>";\r
-\r
- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&\r
- div.firstChild.getAttribute("href") !== "#" ) {\r
-\r
- Expr.attrHandle.href = function( elem ) {\r
- return elem.getAttribute( "href", 2 );\r
- };\r
- }\r
-\r
- // release memory in IE\r
- div = null;\r
-})();\r
-\r
-if ( document.querySelectorAll ) {\r
- (function(){\r
- var oldSizzle = Sizzle,\r
- div = document.createElement("div"),\r
- id = "__sizzle__";\r
-\r
- div.innerHTML = "<p class='TEST'></p>";\r
-\r
- // Safari can't handle uppercase or unicode characters when\r
- // in quirks mode.\r
- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {\r
- return;\r
- }\r
-\r
- Sizzle = function( query, context, extra, seed ) {\r
- context = context || document;\r
-\r
- // Only use querySelectorAll on non-XML documents\r
- // (ID selectors don't work in non-HTML documents)\r
- if ( !seed && !Sizzle.isXML(context) ) {\r
- // See if we find a selector to speed up\r
- var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );\r
-\r
- if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {\r
- // Speed-up: Sizzle("TAG")\r
- if ( match[1] ) {\r
- return makeArray( context.getElementsByTagName( query ), extra );\r
-\r
- // Speed-up: Sizzle(".CLASS")\r
- } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {\r
- return makeArray( context.getElementsByClassName( match[2] ), extra );\r
- }\r
- }\r
-\r
- if ( context.nodeType === 9 ) {\r
- // Speed-up: Sizzle("body")\r
- // The body element only exists once, optimize finding it\r
- if ( query === "body" && context.body ) {\r
- return makeArray( [ context.body ], extra );\r
-\r
- // Speed-up: Sizzle("#ID")\r
- } else if ( match && match[3] ) {\r
- var elem = context.getElementById( match[3] );\r
-\r
- // Check parentNode to catch when Blackberry 4.6 returns\r
- // nodes that are no longer in the document #6963\r
- if ( elem && elem.parentNode ) {\r
- // Handle the case where IE and Opera return items\r
- // by name instead of ID\r
- if ( elem.id === match[3] ) {\r
- return makeArray( [ elem ], extra );\r
- }\r
-\r
- } else {\r
- return makeArray( [], extra );\r
- }\r
- }\r
-\r
- try {\r
- return makeArray( context.querySelectorAll(query), extra );\r
- } catch(qsaError) {}\r
-\r
- // qSA works strangely on Element-rooted queries\r
- // We can work around this by specifying an extra ID on the root\r
- // and working up from there (Thanks to Andrew Dupont for the technique)\r
- // IE 8 doesn't work on object elements\r
- } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {\r
- var oldContext = context,\r
- old = context.getAttribute( "id" ),\r
- nid = old || id,\r
- hasParent = context.parentNode,\r
- relativeHierarchySelector = /^\s*[+~]/.test( query );\r
-\r
- if ( !old ) {\r
- context.setAttribute( "id", nid );\r
- } else {\r
- nid = nid.replace( /'/g, "\\$&" );\r
- }\r
- if ( relativeHierarchySelector && hasParent ) {\r
- context = context.parentNode;\r
- }\r
-\r
- try {\r
- if ( !relativeHierarchySelector || hasParent ) {\r
- return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );\r
- }\r
-\r
- } catch(pseudoError) {\r
- } finally {\r
- if ( !old ) {\r
- oldContext.removeAttribute( "id" );\r
- }\r
- }\r
- }\r
- }\r
-\r
- return oldSizzle(query, context, extra, seed);\r
- };\r
-\r
- for ( var prop in oldSizzle ) {\r
- Sizzle[ prop ] = oldSizzle[ prop ];\r
- }\r
-\r
- // release memory in IE\r
- div = null;\r
- })();\r
-}\r
-\r
-(function(){\r
- var html = document.documentElement,\r
- matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;\r
-\r
- if ( matches ) {\r
- // Check to see if it's possible to do matchesSelector\r
- // on a disconnected node (IE 9 fails this)\r
- var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),\r
- pseudoWorks = false;\r
-\r
- try {\r
- // This should fail with an exception\r
- // Gecko does not error, returns false instead\r
- matches.call( document.documentElement, "[test!='']:sizzle" );\r
-\r
- } catch( pseudoError ) {\r
- pseudoWorks = true;\r
- }\r
-\r
- Sizzle.matchesSelector = function( node, expr ) {\r
- // Make sure that attribute selectors are quoted\r
- expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");\r
-\r
- if ( !Sizzle.isXML( node ) ) {\r
- try {\r
- if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {\r
- var ret = matches.call( node, expr );\r
-\r
- // IE 9's matchesSelector returns false on disconnected nodes\r
- if ( ret || !disconnectedMatch ||\r
- // As well, disconnected nodes are said to be in a document\r
- // fragment in IE 9, so check for that\r
- node.document && node.document.nodeType !== 11 ) {\r
- return ret;\r
- }\r
- }\r
- } catch(e) {}\r
- }\r
-\r
- return Sizzle(expr, null, null, [node]).length > 0;\r
- };\r
- }\r
-})();\r
-\r
-(function(){\r
- var div = document.createElement("div");\r
-\r
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";\r
-\r
- // Opera can't find a second classname (in 9.6)\r
- // Also, make sure that getElementsByClassName actually exists\r
- if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {\r
- return;\r
- }\r
-\r
- // Safari caches class attributes, doesn't catch changes (in 3.2)\r
- div.lastChild.className = "e";\r
-\r
- if ( div.getElementsByClassName("e").length === 1 ) {\r
- return;\r
- }\r
-\r
- Expr.order.splice(1, 0, "CLASS");\r
- Expr.find.CLASS = function( match, context, isXML ) {\r
- if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {\r
- return context.getElementsByClassName(match[1]);\r
- }\r
- };\r
-\r
- // release memory in IE\r
- div = null;\r
-})();\r
-\r
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {\r
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
- var elem = checkSet[i];\r
-\r
- if ( elem ) {\r
- var match = false;\r
-\r
- elem = elem[dir];\r
-\r
- while ( elem ) {\r
- if ( elem[ expando ] === doneName ) {\r
- match = checkSet[elem.sizset];\r
- break;\r
- }\r
-\r
- if ( elem.nodeType === 1 && !isXML ){\r
- elem[ expando ] = doneName;\r
- elem.sizset = i;\r
- }\r
-\r
- if ( elem.nodeName.toLowerCase() === cur ) {\r
- match = elem;\r
- break;\r
- }\r
-\r
- elem = elem[dir];\r
- }\r
-\r
- checkSet[i] = match;\r
- }\r
- }\r
-}\r
-\r
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {\r
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
- var elem = checkSet[i];\r
-\r
- if ( elem ) {\r
- var match = false;\r
-\r
- elem = elem[dir];\r
-\r
- while ( elem ) {\r
- if ( elem[ expando ] === doneName ) {\r
- match = checkSet[elem.sizset];\r
- break;\r
- }\r
-\r
- if ( elem.nodeType === 1 ) {\r
- if ( !isXML ) {\r
- elem[ expando ] = doneName;\r
- elem.sizset = i;\r
- }\r
-\r
- if ( typeof cur !== "string" ) {\r
- if ( elem === cur ) {\r
- match = true;\r
- break;\r
- }\r
-\r
- } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {\r
- match = elem;\r
- break;\r
- }\r
- }\r
-\r
- elem = elem[dir];\r
- }\r
-\r
- checkSet[i] = match;\r
- }\r
- }\r
-}\r
-\r
-if ( document.documentElement.contains ) {\r
- Sizzle.contains = function( a, b ) {\r
- return a !== b && (a.contains ? a.contains(b) : true);\r
- };\r
-\r
-} else if ( document.documentElement.compareDocumentPosition ) {\r
- Sizzle.contains = function( a, b ) {\r
- return !!(a.compareDocumentPosition(b) & 16);\r
- };\r
-\r
-} else {\r
- Sizzle.contains = function() {\r
- return false;\r
- };\r
-}\r
-\r
-Sizzle.isXML = function( elem ) {\r
- // documentElement is verified for cases where it doesn't yet exist\r
- // (such as loading iframes in IE - #4833)\r
- var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;\r
-\r
- return documentElement ? documentElement.nodeName !== "HTML" : false;\r
-};\r
-\r
-var posProcess = function( selector, context, seed ) {\r
- var match,\r
- tmpSet = [],\r
- later = "",\r
- root = context.nodeType ? [context] : context;\r
-\r
- // Position selectors must be done after the filter\r
- // And so must :not(positional) so we move all PSEUDOs to the end\r
- while ( (match = Expr.match.PSEUDO.exec( selector )) ) {\r
- later += match[0];\r
- selector = selector.replace( Expr.match.PSEUDO, "" );\r
- }\r
-\r
- selector = Expr.relative[selector] ? selector + "*" : selector;\r
-\r
- for ( var i = 0, l = root.length; i < l; i++ ) {\r
- Sizzle( selector, root[i], tmpSet, seed );\r
- }\r
-\r
- return Sizzle.filter( later, tmpSet );\r
-};\r
-\r
-// EXPOSE\r
-\r
-window.tinymce.dom.Sizzle = Sizzle;\r
-\r
-})();\r
-\r
-\r
-(function(tinymce) {\r
- tinymce.dom.Element = function(id, settings) {\r
- var t = this, dom, el;\r
-\r
- t.settings = settings = settings || {};\r
- t.id = id;\r
- t.dom = dom = settings.dom || tinymce.DOM;\r
-\r
- // Only IE leaks DOM references, this is a lot faster\r
- if (!tinymce.isIE)\r
- el = dom.get(t.id);\r
-\r
- tinymce.each(\r
- ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + \r
- 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + \r
- 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + \r
- 'isHidden,setHTML,get').split(/,/), function(k) {\r
- t[k] = function() {\r
- var a = [id], i;\r
-\r
- for (i = 0; i < arguments.length; i++)\r
- a.push(arguments[i]);\r
-\r
- a = dom[k].apply(dom, a);\r
- t.update(k);\r
-\r
- return a;\r
- };\r
- }\r
- );\r
-\r
- tinymce.extend(t, {\r
- on : function(n, f, s) {\r
- return tinymce.dom.Event.add(t.id, n, f, s);\r
- },\r
-\r
- getXY : function() {\r
- return {\r
- x : parseInt(t.getStyle('left')),\r
- y : parseInt(t.getStyle('top'))\r
- };\r
- },\r
-\r
- getSize : function() {\r
- var n = dom.get(t.id);\r
-\r
- return {\r
- w : parseInt(t.getStyle('width') || n.clientWidth),\r
- h : parseInt(t.getStyle('height') || n.clientHeight)\r
- };\r
- },\r
-\r
- moveTo : function(x, y) {\r
- t.setStyles({left : x, top : y});\r
- },\r
-\r
- moveBy : function(x, y) {\r
- var p = t.getXY();\r
-\r
- t.moveTo(p.x + x, p.y + y);\r
- },\r
-\r
- resizeTo : function(w, h) {\r
- t.setStyles({width : w, height : h});\r
- },\r
-\r
- resizeBy : function(w, h) {\r
- var s = t.getSize();\r
-\r
- t.resizeTo(s.w + w, s.h + h);\r
- },\r
-\r
- update : function(k) {\r
- var b;\r
-\r
- if (tinymce.isIE6 && settings.blocker) {\r
- k = k || '';\r
-\r
- // Ignore getters\r
- if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0)\r
- return;\r
-\r
- // Remove blocker on remove\r
- if (k == 'remove') {\r
- dom.remove(t.blocker);\r
- return;\r
- }\r
-\r
- if (!t.blocker) {\r
- t.blocker = dom.uniqueId();\r
- b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'});\r
- dom.setStyle(b, 'opacity', 0);\r
- } else\r
- b = dom.get(t.blocker);\r
-\r
- dom.setStyles(b, {\r
- left : t.getStyle('left', 1),\r
- top : t.getStyle('top', 1),\r
- width : t.getStyle('width', 1),\r
- height : t.getStyle('height', 1),\r
- display : t.getStyle('display', 1),\r
- zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1\r
- });\r
- }\r
- }\r
- });\r
- };\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- function trimNl(s) {\r
- return s.replace(/[\n\r]+/g, '');\r
- };\r
-\r
- // Shorten names\r
- var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each, TreeWalker = tinymce.dom.TreeWalker;\r
-\r
- tinymce.create('tinymce.dom.Selection', {\r
- Selection : function(dom, win, serializer, editor) {\r
- var t = this;\r
-\r
- t.dom = dom;\r
- t.win = win;\r
- t.serializer = serializer;\r
- t.editor = editor;\r
-\r
- // Add events\r
- each([\r
- 'onBeforeSetContent',\r
-\r
- 'onBeforeGetContent',\r
-\r
- 'onSetContent',\r
-\r
- 'onGetContent'\r
- ], function(e) {\r
- t[e] = new tinymce.util.Dispatcher(t);\r
- });\r
-\r
- // No W3C Range support\r
- if (!t.win.getSelection)\r
- t.tridentSel = new tinymce.dom.TridentSelection(t);\r
-\r
- if (tinymce.isIE && dom.boxModel)\r
- this._fixIESelection();\r
-\r
- // Prevent leaks\r
- tinymce.addUnload(t.destroy, t);\r
- },\r
-\r
- setCursorLocation: function(node, offset) {\r
- var t = this; var r = t.dom.createRng();\r
- r.setStart(node, offset);\r
- r.setEnd(node, offset);\r
- t.setRng(r);\r
- t.collapse(false);\r
- },\r
- getContent : function(s) {\r
- var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n;\r
-\r
- s = s || {};\r
- wb = wa = '';\r
- s.get = true;\r
- s.format = s.format || 'html';\r
- s.forced_root_block = '';\r
- t.onBeforeGetContent.dispatch(t, s);\r
-\r
- if (s.format == 'text')\r
- return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : ''));\r
-\r
- if (r.cloneContents) {\r
- n = r.cloneContents();\r
-\r
- if (n)\r
- e.appendChild(n);\r
- } else if (is(r.item) || is(r.htmlText)) {\r
- // IE will produce invalid markup if elements are present that\r
- // it doesn't understand like custom elements or HTML5 elements.\r
- // Adding a BR in front of the contents and then remoiving it seems to fix it though.\r
- e.innerHTML = '<br>' + (r.item ? r.item(0).outerHTML : r.htmlText);\r
- e.removeChild(e.firstChild);\r
- } else\r
- e.innerHTML = r.toString();\r
-\r
- // Keep whitespace before and after\r
- if (/^\s/.test(e.innerHTML))\r
- wb = ' ';\r
-\r
- if (/\s+$/.test(e.innerHTML))\r
- wa = ' ';\r
-\r
- s.getInner = true;\r
-\r
- s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa;\r
- t.onGetContent.dispatch(t, s);\r
-\r
- return s.content;\r
- },\r
-\r
- setContent : function(content, args) {\r
- var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp;\r
-\r
- args = args || {format : 'html'};\r
- args.set = true;\r
- content = args.content = content;\r
-\r
- // Dispatch before set content event\r
- if (!args.no_events)\r
- self.onBeforeSetContent.dispatch(self, args);\r
-\r
- content = args.content;\r
-\r
- if (rng.insertNode) {\r
- // Make caret marker since insertNode places the caret in the beginning of text after insert\r
- content += '<span id="__caret">_</span>';\r
-\r
- // Delete and insert new node\r
- if (rng.startContainer == doc && rng.endContainer == doc) {\r
- // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents\r
- doc.body.innerHTML = content;\r
- } else {\r
- rng.deleteContents();\r
-\r
- if (doc.body.childNodes.length === 0) {\r
- doc.body.innerHTML = content;\r
- } else {\r
- // createContextualFragment doesn't exists in IE 9 DOMRanges\r
- if (rng.createContextualFragment) {\r
- rng.insertNode(rng.createContextualFragment(content));\r
- } else {\r
- // Fake createContextualFragment call in IE 9\r
- frag = doc.createDocumentFragment();\r
- temp = doc.createElement('div');\r
-\r
- frag.appendChild(temp);\r
- temp.outerHTML = content;\r
-\r
- rng.insertNode(frag);\r
- }\r
- }\r
- }\r
-\r
- // Move to caret marker\r
- caretNode = self.dom.get('__caret');\r
-\r
- // Make sure we wrap it compleatly, Opera fails with a simple select call\r
- rng = doc.createRange();\r
- rng.setStartBefore(caretNode);\r
- rng.setEndBefore(caretNode);\r
- self.setRng(rng);\r
-\r
- // Remove the caret position\r
- self.dom.remove('__caret');\r
-\r
- try {\r
- self.setRng(rng);\r
- } catch (ex) {\r
- // Might fail on Opera for some odd reason\r
- }\r
- } else {\r
- if (rng.item) {\r
- // Delete content and get caret text selection\r
- doc.execCommand('Delete', false, null);\r
- rng = self.getRng();\r
- }\r
-\r
- // Explorer removes spaces from the beginning of pasted contents\r
- if (/^\s+/.test(content)) {\r
- rng.pasteHTML('<span id="__mce_tmp">_</span>' + content);\r
- self.dom.remove('__mce_tmp');\r
- } else\r
- rng.pasteHTML(content);\r
- }\r
-\r
- // Dispatch set content event\r
- if (!args.no_events)\r
- self.onSetContent.dispatch(self, args);\r
- },\r
-\r
- getStart : function() {\r
- var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node;\r
-\r
- if (rng.duplicate || rng.item) {\r
- // Control selection, return first item\r
- if (rng.item)\r
- return rng.item(0);\r
-\r
- // Get start element\r
- checkRng = rng.duplicate();\r
- checkRng.collapse(1);\r
- startElement = checkRng.parentElement();\r
- if (startElement.ownerDocument !== self.dom.doc) {\r
- startElement = self.dom.getRoot();\r
- }\r
-\r
- // Check if range parent is inside the start element, then return the inner parent element\r
- // This will fix issues when a single element is selected, IE would otherwise return the wrong start element\r
- parentElement = node = rng.parentElement();\r
- while (node = node.parentNode) {\r
- if (node == startElement) {\r
- startElement = parentElement;\r
- break;\r
- }\r
- }\r
-\r
- return startElement;\r
- } else {\r
- startElement = rng.startContainer;\r
-\r
- if (startElement.nodeType == 1 && startElement.hasChildNodes())\r
- startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)];\r
-\r
- if (startElement && startElement.nodeType == 3)\r
- return startElement.parentNode;\r
-\r
- return startElement;\r
- }\r
- },\r
-\r
- getEnd : function() {\r
- var self = this, rng = self.getRng(), endElement, endOffset;\r
-\r
- if (rng.duplicate || rng.item) {\r
- if (rng.item)\r
- return rng.item(0);\r
-\r
- rng = rng.duplicate();\r
- rng.collapse(0);\r
- endElement = rng.parentElement();\r
- if (endElement.ownerDocument !== self.dom.doc) {\r
- endElement = self.dom.getRoot();\r
- }\r
-\r
- if (endElement && endElement.nodeName == 'BODY')\r
- return endElement.lastChild || endElement;\r
-\r
- return endElement;\r
- } else {\r
- endElement = rng.endContainer;\r
- endOffset = rng.endOffset;\r
-\r
- if (endElement.nodeType == 1 && endElement.hasChildNodes())\r
- endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset];\r
-\r
- if (endElement && endElement.nodeType == 3)\r
- return endElement.parentNode;\r
-\r
- return endElement;\r
- }\r
- },\r
-\r
- getBookmark : function(type, normalized) {\r
- var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles;\r
-\r
- function findIndex(name, element) {\r
- var index = 0;\r
-\r
- each(dom.select(name), function(node, i) {\r
- if (node == element)\r
- index = i;\r
- });\r
-\r
- return index;\r
- };\r
-\r
- function normalizeTableCellSelection(rng) {\r
- function moveEndPoint(start) {\r
- var container, offset, childNodes, prefix = start ? 'start' : 'end';\r
-\r
- container = rng[prefix + 'Container'];\r
- offset = rng[prefix + 'Offset'];\r
-\r
- if (container.nodeType == 1 && container.nodeName == "TR") {\r
- childNodes = container.childNodes;\r
- container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];\r
- if (container) {\r
- offset = start ? 0 : container.childNodes.length;\r
- rng['set' + (start ? 'Start' : 'End')](container, offset);\r
- }\r
- }\r
- };\r
-\r
- moveEndPoint(true);\r
- moveEndPoint();\r
-\r
- return rng;\r
- };\r
-\r
- function getLocation() {\r
- var rng = t.getRng(true), root = dom.getRoot(), bookmark = {};\r
-\r
- function getPoint(rng, start) {\r
- var container = rng[start ? 'startContainer' : 'endContainer'],\r
- offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;\r
-\r
- if (container.nodeType == 3) {\r
- if (normalized) {\r
- for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling)\r
- offset += node.nodeValue.length;\r
- }\r
-\r
- point.push(offset);\r
- } else {\r
- childNodes = container.childNodes;\r
-\r
- if (offset >= childNodes.length && childNodes.length) {\r
- after = 1;\r
- offset = Math.max(0, childNodes.length - 1);\r
- }\r
-\r
- point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after);\r
- }\r
-\r
- for (; container && container != root; container = container.parentNode)\r
- point.push(t.dom.nodeIndex(container, normalized));\r
-\r
- return point;\r
- };\r
-\r
- bookmark.start = getPoint(rng, true);\r
-\r
- if (!t.isCollapsed())\r
- bookmark.end = getPoint(rng);\r
-\r
- return bookmark;\r
- };\r
-\r
- if (type == 2) {\r
- if (t.tridentSel)\r
- return t.tridentSel.getBookmark(type);\r
-\r
- return getLocation();\r
- }\r
-\r
- // Handle simple range\r
- if (type)\r
- return {rng : t.getRng()};\r
-\r
- rng = t.getRng();\r
- id = dom.uniqueId();\r
- collapsed = tinyMCE.activeEditor.selection.isCollapsed();\r
- styles = 'overflow:hidden;line-height:0px';\r
-\r
- // Explorer method\r
- if (rng.duplicate || rng.item) {\r
- // Text selection\r
- if (!rng.item) {\r
- rng2 = rng.duplicate();\r
-\r
- try {\r
- // Insert start marker\r
- rng.collapse();\r
- rng.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');\r
-\r
- // Insert end marker\r
- if (!collapsed) {\r
- rng2.collapse(false);\r
-\r
- // Detect the empty space after block elements in IE and move the end back one character <p></p>] becomes <p>]</p>\r
- rng.moveToElementText(rng2.parentElement());\r
- if (rng.compareEndPoints('StartToEnd', rng2) === 0)\r
- rng2.move('character', -1);\r
-\r
- rng2.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');\r
- }\r
- } catch (ex) {\r
- // IE might throw unspecified error so lets ignore it\r
- return null;\r
- }\r
- } else {\r
- // Control selection\r
- element = rng.item(0);\r
- name = element.nodeName;\r
-\r
- return {name : name, index : findIndex(name, element)};\r
- }\r
- } else {\r
- element = t.getNode();\r
- name = element.nodeName;\r
- if (name == 'IMG')\r
- return {name : name, index : findIndex(name, element)};\r
-\r
- // W3C method\r
- rng2 = normalizeTableCellSelection(rng.cloneRange());\r
-\r
- // Insert end marker\r
- if (!collapsed) {\r
- rng2.collapse(false);\r
- rng2.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_end', style : styles}, chr));\r
- }\r
-\r
- rng = normalizeTableCellSelection(rng);\r
- rng.collapse(true);\r
- rng.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_start', style : styles}, chr));\r
- }\r
-\r
- t.moveToBookmark({id : id, keep : 1});\r
-\r
- return {id : id};\r
- },\r
-\r
- moveToBookmark : function(bookmark) {\r
- var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset;\r
-\r
- function setEndPoint(start) {\r
- var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;\r
-\r
- if (point) {\r
- offset = point[0];\r
-\r
- // Find container node\r
- for (node = root, i = point.length - 1; i >= 1; i--) {\r
- children = node.childNodes;\r
-\r
- if (point[i] > children.length - 1)\r
- return;\r
-\r
- node = children[point[i]];\r
- }\r
-\r
- // Move text offset to best suitable location\r
- if (node.nodeType === 3)\r
- offset = Math.min(point[0], node.nodeValue.length);\r
-\r
- // Move element offset to best suitable location\r
- if (node.nodeType === 1)\r
- offset = Math.min(point[0], node.childNodes.length);\r
-\r
- // Set offset within container node\r
- if (start)\r
- rng.setStart(node, offset);\r
- else\r
- rng.setEnd(node, offset);\r
- }\r
-\r
- return true;\r
- };\r
-\r
- function restoreEndPoint(suffix) {\r
- var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;\r
-\r
- if (marker) {\r
- node = marker.parentNode;\r
-\r
- if (suffix == 'start') {\r
- if (!keep) {\r
- idx = dom.nodeIndex(marker);\r
- } else {\r
- node = marker.firstChild;\r
- idx = 1;\r
- }\r
-\r
- startContainer = endContainer = node;\r
- startOffset = endOffset = idx;\r
- } else {\r
- if (!keep) {\r
- idx = dom.nodeIndex(marker);\r
- } else {\r
- node = marker.firstChild;\r
- idx = 1;\r
- }\r
-\r
- endContainer = node;\r
- endOffset = idx;\r
- }\r
-\r
- if (!keep) {\r
- prev = marker.previousSibling;\r
- next = marker.nextSibling;\r
-\r
- // Remove all marker text nodes\r
- each(tinymce.grep(marker.childNodes), function(node) {\r
- if (node.nodeType == 3)\r
- node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');\r
- });\r
-\r
- // Remove marker but keep children if for example contents where inserted into the marker\r
- // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature\r
- while (marker = dom.get(bookmark.id + '_' + suffix))\r
- dom.remove(marker, 1);\r
-\r
- // If siblings are text nodes then merge them unless it's Opera since it some how removes the node\r
- // and we are sniffing since adding a lot of detection code for a browser with 3% of the market isn't worth the effort. Sorry, Opera but it's just a fact\r
- if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !tinymce.isOpera) {\r
- idx = prev.nodeValue.length;\r
- prev.appendData(next.nodeValue);\r
- dom.remove(next);\r
-\r
- if (suffix == 'start') {\r
- startContainer = endContainer = prev;\r
- startOffset = endOffset = idx;\r
- } else {\r
- endContainer = prev;\r
- endOffset = idx;\r
- }\r
- }\r
- }\r
- }\r
- };\r
-\r
- function addBogus(node) {\r
- // Adds a bogus BR element for empty block elements\r
- if (dom.isBlock(node) && !node.innerHTML && !isIE)\r
- node.innerHTML = '<br data-mce-bogus="1" />';\r
-\r
- return node;\r
- };\r
-\r
- if (bookmark) {\r
- if (bookmark.start) {\r
- rng = dom.createRng();\r
- root = dom.getRoot();\r
-\r
- if (t.tridentSel)\r
- return t.tridentSel.moveToBookmark(bookmark);\r
-\r
- if (setEndPoint(true) && setEndPoint()) {\r
- t.setRng(rng);\r
- }\r
- } else if (bookmark.id) {\r
- // Restore start/end points\r
- restoreEndPoint('start');\r
- restoreEndPoint('end');\r
-\r
- if (startContainer) {\r
- rng = dom.createRng();\r
- rng.setStart(addBogus(startContainer), startOffset);\r
- rng.setEnd(addBogus(endContainer), endOffset);\r
- t.setRng(rng);\r
- }\r
- } else if (bookmark.name) {\r
- t.select(dom.select(bookmark.name)[bookmark.index]);\r
- } else if (bookmark.rng)\r
- t.setRng(bookmark.rng);\r
- }\r
- },\r
-\r
- select : function(node, content) {\r
- var t = this, dom = t.dom, rng = dom.createRng(), idx;\r
-\r
- function setPoint(node, start) {\r
- var walker = new TreeWalker(node, node);\r
-\r
- do {\r
- // Text node\r
- if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length !== 0) {\r
- if (start)\r
- rng.setStart(node, 0);\r
- else\r
- rng.setEnd(node, node.nodeValue.length);\r
-\r
- return;\r
- }\r
-\r
- // BR element\r
- if (node.nodeName == 'BR') {\r
- if (start)\r
- rng.setStartBefore(node);\r
- else\r
- rng.setEndBefore(node);\r
-\r
- return;\r
- }\r
- } while (node = (start ? walker.next() : walker.prev()));\r
- };\r
-\r
- if (node) {\r
- idx = dom.nodeIndex(node);\r
- rng.setStart(node.parentNode, idx);\r
- rng.setEnd(node.parentNode, idx + 1);\r
-\r
- // Find first/last text node or BR element\r
- if (content) {\r
- setPoint(node, 1);\r
- setPoint(node);\r
- }\r
-\r
- t.setRng(rng);\r
- }\r
-\r
- return node;\r
- },\r
-\r
- isCollapsed : function() {\r
- var t = this, r = t.getRng(), s = t.getSel();\r
-\r
- if (!r || r.item)\r
- return false;\r
-\r
- if (r.compareEndPoints)\r
- return r.compareEndPoints('StartToEnd', r) === 0;\r
-\r
- return !s || r.collapsed;\r
- },\r
-\r
- collapse : function(to_start) {\r
- var self = this, rng = self.getRng(), node;\r
-\r
- // Control range on IE\r
- if (rng.item) {\r
- node = rng.item(0);\r
- rng = self.win.document.body.createTextRange();\r
- rng.moveToElementText(node);\r
- }\r
-\r
- rng.collapse(!!to_start);\r
- self.setRng(rng);\r
- },\r
-\r
- getSel : function() {\r
- var t = this, w = this.win;\r
-\r
- return w.getSelection ? w.getSelection() : w.document.selection;\r
- },\r
-\r
- getRng : function(w3c) {\r
- var self = this, selection, rng, elm, doc = self.win.document;\r
-\r
- // Found tridentSel object then we need to use that one\r
- if (w3c && self.tridentSel) {\r
- return self.tridentSel.getRangeAt(0);\r
- }\r
-\r
- try {\r
- if (selection = self.getSel()) {\r
- rng = selection.rangeCount > 0 ? selection.getRangeAt(0) : (selection.createRange ? selection.createRange() : doc.createRange());\r
- }\r
- } catch (ex) {\r
- // IE throws unspecified error here if TinyMCE is placed in a frame/iframe\r
- }\r
-\r
- // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet\r
- if (tinymce.isIE && rng && rng.setStart && doc.selection.createRange().item) {\r
- elm = doc.selection.createRange().item(0);\r
- rng = doc.createRange();\r
- rng.setStartBefore(elm);\r
- rng.setEndAfter(elm);\r
- }\r
-\r
- // No range found then create an empty one\r
- // This can occur when the editor is placed in a hidden container element on Gecko\r
- // Or on IE when there was an exception\r
- if (!rng) {\r
- rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();\r
- }\r
-\r
- // If range is at start of document then move it to start of body\r
- if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {\r
- elm = self.dom.getRoot();\r
- rng.setStart(elm, 0);\r
- rng.setEnd(elm, 0);\r
- }\r
-\r
- if (self.selectedRange && self.explicitRange) {\r
- if (rng.compareBoundaryPoints(rng.START_TO_START, self.selectedRange) === 0 && rng.compareBoundaryPoints(rng.END_TO_END, self.selectedRange) === 0) {\r
- // Safari, Opera and Chrome only ever select text which causes the range to change.\r
- // This lets us use the originally set range if the selection hasn't been changed by the user.\r
- rng = self.explicitRange;\r
- } else {\r
- self.selectedRange = null;\r
- self.explicitRange = null;\r
- }\r
- }\r
-\r
- return rng;\r
- },\r
-\r
- setRng : function(r, forward) {\r
- var s, t = this;\r
-\r
- if (!t.tridentSel) {\r
- s = t.getSel();\r
-\r
- if (s) {\r
- t.explicitRange = r;\r
-\r
- try {\r
- s.removeAllRanges();\r
- } catch (ex) {\r
- // IE9 might throw errors here don't know why\r
- }\r
-\r
- s.addRange(r);\r
-\r
- // Forward is set to false and we have an extend function\r
- if (forward === false && s.extend) {\r
- s.collapse(r.endContainer, r.endOffset);\r
- s.extend(r.startContainer, r.startOffset);\r
- }\r
-\r
- // adding range isn't always successful so we need to check range count otherwise an exception can occur\r
- t.selectedRange = s.rangeCount > 0 ? s.getRangeAt(0) : null;\r
- }\r
- } else {\r
- // Is W3C Range\r
- if (r.cloneRange) {\r
- try {\r
- t.tridentSel.addRange(r);\r
- return;\r
- } catch (ex) {\r
- //IE9 throws an error here if called before selection is placed in the editor\r
- }\r
- }\r
-\r
- // Is IE specific range\r
- try {\r
- r.select();\r
- } catch (ex) {\r
- // Needed for some odd IE bug #1843306\r
- }\r
- }\r
- },\r
-\r
- setNode : function(n) {\r
- var t = this;\r
-\r
- t.setContent(t.dom.getOuterHTML(n));\r
-\r
- return n;\r
- },\r
-\r
- getNode : function() {\r
- var t = this, rng = t.getRng(), sel = t.getSel(), elm, start = rng.startContainer, end = rng.endContainer;\r
-\r
- function skipEmptyTextNodes(n, forwards) {\r
- var orig = n;\r
- while (n && n.nodeType === 3 && n.length === 0) {\r
- n = forwards ? n.nextSibling : n.previousSibling;\r
- }\r
- return n || orig;\r
- };\r
-\r
- // Range maybe lost after the editor is made visible again\r
- if (!rng)\r
- return t.dom.getRoot();\r
-\r
- if (rng.setStart) {\r
- elm = rng.commonAncestorContainer;\r
-\r
- // Handle selection a image or other control like element such as anchors\r
- if (!rng.collapsed) {\r
- if (rng.startContainer == rng.endContainer) {\r
- if (rng.endOffset - rng.startOffset < 2) {\r
- if (rng.startContainer.hasChildNodes())\r
- elm = rng.startContainer.childNodes[rng.startOffset];\r
- }\r
- }\r
-\r
- // If the anchor node is a element instead of a text node then return this element\r
- //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1)\r
- // return sel.anchorNode.childNodes[sel.anchorOffset];\r
-\r
- // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent.\r
- // This happens when you double click an underlined word in FireFox.\r
- if (start.nodeType === 3 && end.nodeType === 3) {\r
- if (start.length === rng.startOffset) {\r
- start = skipEmptyTextNodes(start.nextSibling, true);\r
- } else {\r
- start = start.parentNode;\r
- }\r
- if (rng.endOffset === 0) {\r
- end = skipEmptyTextNodes(end.previousSibling, false);\r
- } else {\r
- end = end.parentNode;\r
- }\r
-\r
- if (start && start === end)\r
- return start;\r
- }\r
- }\r
-\r
- if (elm && elm.nodeType == 3)\r
- return elm.parentNode;\r
-\r
- return elm;\r
- }\r
-\r
- return rng.item ? rng.item(0) : rng.parentElement();\r
- },\r
-\r
- getSelectedBlocks : function(st, en) {\r
- var t = this, dom = t.dom, sb, eb, n, bl = [];\r
-\r
- sb = dom.getParent(st || t.getStart(), dom.isBlock);\r
- eb = dom.getParent(en || t.getEnd(), dom.isBlock);\r
-\r
- if (sb)\r
- bl.push(sb);\r
-\r
- if (sb && eb && sb != eb) {\r
- n = sb;\r
-\r
- var walker = new TreeWalker(sb, dom.getRoot());\r
- while ((n = walker.next()) && n != eb) {\r
- if (dom.isBlock(n))\r
- bl.push(n);\r
- }\r
- }\r
-\r
- if (eb && sb != eb)\r
- bl.push(eb);\r
-\r
- return bl;\r
- },\r
-\r
- isForward: function(){\r
- var dom = this.dom, sel = this.getSel(), anchorRange, focusRange;\r
-\r
- // No support for selection direction then always return true\r
- if (!sel || sel.anchorNode == null || sel.focusNode == null) {\r
- return true;\r
- }\r
-\r
- anchorRange = dom.createRng();\r
- anchorRange.setStart(sel.anchorNode, sel.anchorOffset);\r
- anchorRange.collapse(true);\r
-\r
- focusRange = dom.createRng();\r
- focusRange.setStart(sel.focusNode, sel.focusOffset);\r
- focusRange.collapse(true);\r
-\r
- return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;\r
- },\r
-\r
- normalize : function() {\r
- var self = this, rng, normalized, collapsed, node, sibling;\r
-\r
- function normalizeEndPoint(start) {\r
- var container, offset, walker, dom = self.dom, body = dom.getRoot(), node, nonEmptyElementsMap, nodeName;\r
-\r
- function hasBrBeforeAfter(node, left) {\r
- var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body);\r
-\r
- while (node = walker[left ? 'prev' : 'next']()) {\r
- if (node.nodeName === "BR") {\r
- return true;\r
- }\r
- }\r
- };\r
-\r
- // Walks the dom left/right to find a suitable text node to move the endpoint into\r
- // It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG\r
- function findTextNodeRelative(left, startNode) {\r
- var walker, lastInlineElement;\r
-\r
- startNode = startNode || container;\r
- walker = new TreeWalker(startNode, dom.getParent(startNode.parentNode, dom.isBlock) || body);\r
-\r
- // Walk left until we hit a text node we can move to or a block/br/img\r
- while (node = walker[left ? 'prev' : 'next']()) {\r
- // Found text node that has a length\r
- if (node.nodeType === 3 && node.nodeValue.length > 0) {\r
- container = node;\r
- offset = left ? node.nodeValue.length : 0;\r
- normalized = true;\r
- return;\r
- }\r
-\r
- // Break if we find a block or a BR/IMG/INPUT etc\r
- if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {\r
- return;\r
- }\r
-\r
- lastInlineElement = node;\r
- }\r
-\r
- // Only fetch the last inline element when in caret mode for now\r
- if (collapsed && lastInlineElement) {\r
- container = lastInlineElement;\r
- normalized = true;\r
- offset = 0;\r
- }\r
- };\r
-\r
- container = rng[(start ? 'start' : 'end') + 'Container'];\r
- offset = rng[(start ? 'start' : 'end') + 'Offset'];\r
- nonEmptyElementsMap = dom.schema.getNonEmptyElements();\r
-\r
- // If the container is a document move it to the body element\r
- if (container.nodeType === 9) {\r
- container = dom.getRoot();\r
- offset = 0;\r
- }\r
-\r
- // If the container is body try move it into the closest text node or position\r
- if (container === body) {\r
- // If start is before/after a image, table etc\r
- if (start) {\r
- node = container.childNodes[offset > 0 ? offset - 1 : 0];\r
- if (node) {\r
- nodeName = node.nodeName.toLowerCase();\r
- if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") {\r
- return;\r
- }\r
- }\r
- }\r
-\r
- // Resolve the index\r
- if (container.hasChildNodes()) {\r
- container = container.childNodes[Math.min(!start && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1)];\r
- offset = 0;\r
-\r
- // Don't walk into elements that doesn't have any child nodes like a IMG\r
- if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) {\r
- // Walk the DOM to find a text node to place the caret at or a BR\r
- node = container;\r
- walker = new TreeWalker(container, body);\r
-\r
- do {\r
- // Found a text node use that position\r
- if (node.nodeType === 3 && node.nodeValue.length > 0) {\r
- offset = start ? 0 : node.nodeValue.length;\r
- container = node;\r
- normalized = true;\r
- break;\r
- }\r
-\r
- // Found a BR/IMG element that we can place the caret before\r
- if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {\r
- offset = dom.nodeIndex(node);\r
- container = node.parentNode;\r
-\r
- // Put caret after image when moving the end point\r
- if (node.nodeName == "IMG" && !start) {\r
- offset++;\r
- }\r
-\r
- normalized = true;\r
- break;\r
- }\r
- } while (node = (start ? walker.next() : walker.prev()));\r
- }\r
- }\r
- }\r
-\r
- // Lean the caret to the left if possible\r
- if (collapsed) {\r
- // So this: <b>x</b><i>|x</i>\r
- // Becomes: <b>x|</b><i>x</i>\r
- // Seems that only gecko has issues with this\r
- if (container.nodeType === 3 && offset === 0) {\r
- findTextNodeRelative(true);\r
- }\r
-\r
- // Lean left into empty inline elements when the caret is before a BR\r
- // So this: <i><b></b><i>|<br></i>\r
- // Becomes: <i><b>|</b><i><br></i>\r
- // Seems that only gecko has issues with this\r
- if (container.nodeType === 1) {\r
- node = container.childNodes[offset];\r
- if(node && node.nodeName === 'BR' && !hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) {\r
- findTextNodeRelative(true, container.childNodes[offset]);\r
- }\r
- }\r
- }\r
-\r
- // Lean the start of the selection right if possible\r
- // So this: x[<b>x]</b>\r
- // Becomes: x<b>[x]</b>\r
- if (start && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) {\r
- findTextNodeRelative(false);\r
- }\r
-\r
- // Set endpoint if it was normalized\r
- if (normalized)\r
- rng['set' + (start ? 'Start' : 'End')](container, offset);\r
- };\r
-\r
- // Normalize only on non IE browsers for now\r
- if (tinymce.isIE)\r
- return;\r
- \r
- rng = self.getRng();\r
- collapsed = rng.collapsed;\r
-\r
- // Normalize the end points\r
- normalizeEndPoint(true);\r
-\r
- if (!collapsed)\r
- normalizeEndPoint();\r
-\r
- // Set the selection if it was normalized\r
- if (normalized) {\r
- // If it was collapsed then make sure it still is\r
- if (collapsed) {\r
- rng.collapse(true);\r
- }\r
-\r
- //console.log(self.dom.dumpRng(rng));\r
- self.setRng(rng, self.isForward());\r
- }\r
- },\r
-\r
- selectorChanged: function(selector, callback) {\r
- var self = this, currentSelectors;\r
-\r
- if (!self.selectorChangedData) {\r
- self.selectorChangedData = {};\r
- currentSelectors = {};\r
-\r
- self.editor.onNodeChange.addToTop(function(ed, cm, node) {\r
- var dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};\r
-\r
- // Check for new matching selectors\r
- each(self.selectorChangedData, function(callbacks, selector) {\r
- each(parents, function(node) {\r
- if (dom.is(node, selector)) {\r
- if (!currentSelectors[selector]) {\r
- // Execute callbacks\r
- each(callbacks, function(callback) {\r
- callback(true, {node: node, selector: selector, parents: parents});\r
- });\r
-\r
- currentSelectors[selector] = callbacks;\r
- }\r
-\r
- matchedSelectors[selector] = callbacks;\r
- return false;\r
- }\r
- });\r
- });\r
-\r
- // Check if current selectors still match\r
- each(currentSelectors, function(callbacks, selector) {\r
- if (!matchedSelectors[selector]) {\r
- delete currentSelectors[selector];\r
-\r
- each(callbacks, function(callback) {\r
- callback(false, {node: node, selector: selector, parents: parents});\r
- });\r
- }\r
- });\r
- });\r
- }\r
-\r
- // Add selector listeners\r
- if (!self.selectorChangedData[selector]) {\r
- self.selectorChangedData[selector] = [];\r
- }\r
-\r
- self.selectorChangedData[selector].push(callback);\r
-\r
- return self;\r
- },\r
-\r
- scrollIntoView: function(elm) {\r
- var y, viewPort, self = this, dom = self.dom;\r
-\r
- viewPort = dom.getViewPort(self.editor.getWin());\r
- y = dom.getPos(elm).y;\r
- if (y < viewPort.y || y + 25 > viewPort.y + viewPort.h) {\r
- self.editor.getWin().scrollTo(0, y < viewPort.y ? y : y - viewPort.h + 25);\r
- }\r
- },\r
-\r
- destroy : function(manual) {\r
- var self = this;\r
-\r
- self.win = null;\r
-\r
- // Manual destroy then remove unload handler\r
- if (!manual)\r
- tinymce.removeUnload(self.destroy);\r
- },\r
-\r
- // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode\r
- _fixIESelection : function() {\r
- var dom = this.dom, doc = dom.doc, body = doc.body, started, startRng, htmlElm;\r
-\r
- // Return range from point or null if it failed\r
- function rngFromPoint(x, y) {\r
- var rng = body.createTextRange();\r
-\r
- try {\r
- rng.moveToPoint(x, y);\r
- } catch (ex) {\r
- // IE sometimes throws and exception, so lets just ignore it\r
- rng = null;\r
- }\r
-\r
- return rng;\r
- };\r
-\r
- // Fires while the selection is changing\r
- function selectionChange(e) {\r
- var pointRng;\r
-\r
- // Check if the button is down or not\r
- if (e.button) {\r
- // Create range from mouse position\r
- pointRng = rngFromPoint(e.x, e.y);\r
-\r
- if (pointRng) {\r
- // Check if pointRange is before/after selection then change the endPoint\r
- if (pointRng.compareEndPoints('StartToStart', startRng) > 0)\r
- pointRng.setEndPoint('StartToStart', startRng);\r
- else\r
- pointRng.setEndPoint('EndToEnd', startRng);\r
-\r
- pointRng.select();\r
- }\r
- } else\r
- endSelection();\r
- }\r
-\r
- // Removes listeners\r
- function endSelection() {\r
- var rng = doc.selection.createRange();\r
-\r
- // If the range is collapsed then use the last start range\r
- if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0)\r
- startRng.select();\r
-\r
- dom.unbind(doc, 'mouseup', endSelection);\r
- dom.unbind(doc, 'mousemove', selectionChange);\r
- startRng = started = 0;\r
- };\r
-\r
- // Make HTML element unselectable since we are going to handle selection by hand\r
- doc.documentElement.unselectable = true;\r
- \r
- // Detect when user selects outside BODY\r
- dom.bind(doc, ['mousedown', 'contextmenu'], function(e) {\r
- if (e.target.nodeName === 'HTML') {\r
- if (started)\r
- endSelection();\r
-\r
- // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML\r
- htmlElm = doc.documentElement;\r
- if (htmlElm.scrollHeight > htmlElm.clientHeight)\r
- return;\r
-\r
- started = 1;\r
- // Setup start position\r
- startRng = rngFromPoint(e.x, e.y);\r
- if (startRng) {\r
- // Listen for selection change events\r
- dom.bind(doc, 'mouseup', endSelection);\r
- dom.bind(doc, 'mousemove', selectionChange);\r
-\r
- dom.win.focus();\r
- startRng.select();\r
- }\r
- }\r
- });\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- tinymce.dom.Serializer = function(settings, dom, schema) {\r
- var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser;\r
-\r
- // Support the old apply_source_formatting option\r
- if (!settings.apply_source_formatting)\r
- settings.indent = false;\r
-\r
- // Default DOM and Schema if they are undefined\r
- dom = dom || tinymce.DOM;\r
- schema = schema || new tinymce.html.Schema(settings);\r
- settings.entity_encoding = settings.entity_encoding || 'named';\r
- settings.remove_trailing_brs = "remove_trailing_brs" in settings ? settings.remove_trailing_brs : true;\r
-\r
- onPreProcess = new tinymce.util.Dispatcher(self);\r
-\r
- onPostProcess = new tinymce.util.Dispatcher(self);\r
-\r
- htmlParser = new tinymce.html.DomParser(settings, schema);\r
-\r
- // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed\r
- htmlParser.addAttributeFilter('src,href,style', function(nodes, name) {\r
- var i = nodes.length, node, value, internalName = 'data-mce-' + name, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
-\r
- value = node.attributes.map[internalName];\r
- if (value !== undef) {\r
- // Set external name to internal value and remove internal\r
- node.attr(name, value.length > 0 ? value : null);\r
- node.attr(internalName, null);\r
- } else {\r
- // No internal attribute found then convert the value we have in the DOM\r
- value = node.attributes.map[name];\r
-\r
- if (name === "style")\r
- value = dom.serializeStyle(dom.parseStyle(value), node.name);\r
- else if (urlConverter)\r
- value = urlConverter.call(urlConverterScope, value, name, node.name);\r
-\r
- node.attr(name, value.length > 0 ? value : null);\r
- }\r
- }\r
- });\r
-\r
- // Remove internal classes mceItem<..> or mceSelected\r
- htmlParser.addAttributeFilter('class', function(nodes, name) {\r
- var i = nodes.length, node, value;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- value = node.attr('class').replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g, '');\r
- node.attr('class', value.length > 0 ? value : null);\r
- }\r
- });\r
-\r
- // Remove bookmark elements\r
- htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) {\r
- var i = nodes.length, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
-\r
- if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup)\r
- node.remove();\r
- }\r
- });\r
-\r
- // Remove expando attributes\r
- htmlParser.addAttributeFilter('data-mce-expando', function(nodes, name, args) {\r
- var i = nodes.length;\r
-\r
- while (i--) {\r
- nodes[i].attr(name, null);\r
- }\r
- });\r
-\r
- htmlParser.addNodeFilter('noscript', function(nodes) {\r
- var i = nodes.length, node;\r
-\r
- while (i--) {\r
- node = nodes[i].firstChild;\r
-\r
- if (node) {\r
- node.value = tinymce.html.Entities.decode(node.value);\r
- }\r
- }\r
- });\r
-\r
- // Force script into CDATA sections and remove the mce- prefix also add comments around styles\r
- htmlParser.addNodeFilter('script,style', function(nodes, name) {\r
- var i = nodes.length, node, value;\r
-\r
- function trim(value) {\r
- return value.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n')\r
- .replace(/^[\r\n]*|[\r\n]*$/g, '')\r
- .replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi, '')\r
- .replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, '');\r
- };\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- value = node.firstChild ? node.firstChild.value : '';\r
-\r
- if (name === "script") {\r
- // Remove mce- prefix from script elements\r
- node.attr('type', (node.attr('type') || 'text/javascript').replace(/^mce\-/, ''));\r
-\r
- if (value.length > 0)\r
- node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>';\r
- } else {\r
- if (value.length > 0)\r
- node.firstChild.value = '<!--\n' + trim(value) + '\n-->';\r
- }\r
- }\r
- });\r
-\r
- // Convert comments to cdata and handle protected comments\r
- htmlParser.addNodeFilter('#comment', function(nodes, name) {\r
- var i = nodes.length, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
-\r
- if (node.value.indexOf('[CDATA[') === 0) {\r
- node.name = '#cdata';\r
- node.type = 4;\r
- node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, '');\r
- } else if (node.value.indexOf('mce:protected ') === 0) {\r
- node.name = "#text";\r
- node.type = 3;\r
- node.raw = true;\r
- node.value = unescape(node.value).substr(14);\r
- }\r
- }\r
- });\r
-\r
- htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) {\r
- var i = nodes.length, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- if (node.type === 7)\r
- node.remove();\r
- else if (node.type === 1) {\r
- if (name === "input" && !("type" in node.attributes.map))\r
- node.attr('type', 'text');\r
- }\r
- }\r
- });\r
-\r
- // Fix list elements, TODO: Replace this later\r
- if (settings.fix_list_elements) {\r
- htmlParser.addNodeFilter('ul,ol', function(nodes, name) {\r
- var i = nodes.length, node, parentNode;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- parentNode = node.parent;\r
-\r
- if (parentNode.name === 'ul' || parentNode.name === 'ol') {\r
- if (node.prev && node.prev.name === 'li') {\r
- node.prev.append(node);\r
- }\r
- }\r
- }\r
- });\r
- }\r
-\r
- // Remove internal data attributes\r
- htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style', function(nodes, name) {\r
- var i = nodes.length;\r
-\r
- while (i--) {\r
- nodes[i].attr(name, null);\r
- }\r
- });\r
-\r
- // Return public methods\r
- return {\r
- schema : schema,\r
-\r
- addNodeFilter : htmlParser.addNodeFilter,\r
-\r
- addAttributeFilter : htmlParser.addAttributeFilter,\r
-\r
- onPreProcess : onPreProcess,\r
-\r
- onPostProcess : onPostProcess,\r
-\r
- serialize : function(node, args) {\r
- var impl, doc, oldDoc, htmlSerializer, content;\r
-\r
- // Explorer won't clone contents of script and style and the\r
- // selected index of select elements are cleared on a clone operation.\r
- if (isIE && dom.select('script,style,select,map').length > 0) {\r
- content = node.innerHTML;\r
- node = node.cloneNode(false);\r
- dom.setHTML(node, content);\r
- } else\r
- node = node.cloneNode(true);\r
-\r
- // Nodes needs to be attached to something in WebKit/Opera\r
- // Older builds of Opera crashes if you attach the node to an document created dynamically\r
- // and since we can't feature detect a crash we need to sniff the acutal build number\r
- // This fix will make DOM ranges and make Sizzle happy!\r
- impl = node.ownerDocument.implementation;\r
- if (impl.createHTMLDocument) {\r
- // Create an empty HTML document\r
- doc = impl.createHTMLDocument("");\r
-\r
- // Add the element or it's children if it's a body element to the new document\r
- each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) {\r
- doc.body.appendChild(doc.importNode(node, true));\r
- });\r
-\r
- // Grab first child or body element for serialization\r
- if (node.nodeName != 'BODY')\r
- node = doc.body.firstChild;\r
- else\r
- node = doc.body;\r
-\r
- // set the new document in DOMUtils so createElement etc works\r
- oldDoc = dom.doc;\r
- dom.doc = doc;\r
- }\r
-\r
- args = args || {};\r
- args.format = args.format || 'html';\r
-\r
- // Pre process\r
- if (!args.no_events) {\r
- args.node = node;\r
- onPreProcess.dispatch(self, args);\r
- }\r
-\r
- // Setup serializer\r
- htmlSerializer = new tinymce.html.Serializer(settings, schema);\r
-\r
- // Parse and serialize HTML\r
- args.content = htmlSerializer.serialize(\r
- htmlParser.parse(tinymce.trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)), args)\r
- );\r
-\r
- // Replace all BOM characters for now until we can find a better solution\r
- if (!args.cleanup)\r
- args.content = args.content.replace(/\uFEFF/g, '');\r
-\r
- // Post process\r
- if (!args.no_events)\r
- onPostProcess.dispatch(self, args);\r
-\r
- // Restore the old document if it was changed\r
- if (oldDoc)\r
- dom.doc = oldDoc;\r
-\r
- args.node = null;\r
-\r
- return args.content;\r
- },\r
-\r
- addRules : function(rules) {\r
- schema.addValidElements(rules);\r
- },\r
-\r
- setRules : function(rules) {\r
- schema.setValidElements(rules);\r
- }\r
- };\r
- };\r
-})(tinymce);\r
-(function(tinymce) {\r
- tinymce.dom.ScriptLoader = function(settings) {\r
- var QUEUED = 0,\r
- LOADING = 1,\r
- LOADED = 2,\r
- states = {},\r
- queue = [],\r
- scriptLoadedCallbacks = {},\r
- queueLoadedCallbacks = [],\r
- loading = 0,\r
- undef;\r
-\r
- function loadScript(url, callback) {\r
- var t = this, dom = tinymce.DOM, elm, uri, loc, id;\r
-\r
- // Execute callback when script is loaded\r
- function done() {\r
- dom.remove(id);\r
-\r
- if (elm)\r
- elm.onreadystatechange = elm.onload = elm = null;\r
-\r
- callback();\r
- };\r
- \r
- function error() {\r
- // Report the error so it's easier for people to spot loading errors\r
- if (typeof(console) !== "undefined" && console.log)\r
- console.log("Failed to load: " + url);\r
-\r
- // We can't mark it as done if there is a load error since\r
- // A) We don't want to produce 404 errors on the server and\r
- // B) the onerror event won't fire on all browsers.\r
- // done();\r
- };\r
-\r
- id = dom.uniqueId();\r
-\r
- if (tinymce.isIE6) {\r
- uri = new tinymce.util.URI(url);\r
- loc = location;\r
-\r
- // If script is from same domain and we\r
- // use IE 6 then use XHR since it's more reliable\r
- if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol && uri.protocol.toLowerCase() != 'file') {\r
- tinymce.util.XHR.send({\r
- url : tinymce._addVer(uri.getURI()),\r
- success : function(content) {\r
- // Create new temp script element\r
- var script = dom.create('script', {\r
- type : 'text/javascript'\r
- });\r
-\r
- // Evaluate script in global scope\r
- script.text = content;\r
- document.getElementsByTagName('head')[0].appendChild(script);\r
- dom.remove(script);\r
-\r
- done();\r
- },\r
- \r
- error : error\r
- });\r
-\r
- return;\r
- }\r
- }\r
-\r
- // Create new script element\r
- elm = document.createElement('script');\r
- elm.id = id;\r
- elm.type = 'text/javascript';\r
- elm.src = tinymce._addVer(url);\r
-\r
- // Add onload listener for non IE browsers since IE9\r
- // fires onload event before the script is parsed and executed\r
- if (!tinymce.isIE)\r
- elm.onload = done;\r
-\r
- // Add onerror event will get fired on some browsers but not all of them\r
- elm.onerror = error;\r
-\r
- // Opera 9.60 doesn't seem to fire the onreadystate event at correctly\r
- if (!tinymce.isOpera) {\r
- elm.onreadystatechange = function() {\r
- var state = elm.readyState;\r
-\r
- // Loaded state is passed on IE 6 however there\r
- // are known issues with this method but we can't use\r
- // XHR in a cross domain loading\r
- if (state == 'complete' || state == 'loaded')\r
- done();\r
- };\r
- }\r
-\r
- // Most browsers support this feature so we report errors\r
- // for those at least to help users track their missing plugins etc\r
- // todo: Removed since it produced error if the document is unloaded by navigating away, re-add it as an option\r
- /*elm.onerror = function() {\r
- alert('Failed to load: ' + url);\r
- };*/\r
-\r
- // Add script to document\r
- (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);\r
- };\r
-\r
- this.isDone = function(url) {\r
- return states[url] == LOADED;\r
- };\r
-\r
- this.markDone = function(url) {\r
- states[url] = LOADED;\r
- };\r
-\r
- this.add = this.load = function(url, callback, scope) {\r
- var item, state = states[url];\r
-\r
- // Add url to load queue\r
- if (state == undef) {\r
- queue.push(url);\r
- states[url] = QUEUED;\r
- }\r
-\r
- if (callback) {\r
- // Store away callback for later execution\r
- if (!scriptLoadedCallbacks[url])\r
- scriptLoadedCallbacks[url] = [];\r
-\r
- scriptLoadedCallbacks[url].push({\r
- func : callback,\r
- scope : scope || this\r
- });\r
- }\r
- };\r
-\r
- this.loadQueue = function(callback, scope) {\r
- this.loadScripts(queue, callback, scope);\r
- };\r
-\r
- this.loadScripts = function(scripts, callback, scope) {\r
- var loadScripts;\r
-\r
- function execScriptLoadedCallbacks(url) {\r
- // Execute URL callback functions\r
- tinymce.each(scriptLoadedCallbacks[url], function(callback) {\r
- callback.func.call(callback.scope);\r
- });\r
-\r
- scriptLoadedCallbacks[url] = undef;\r
- };\r
-\r
- queueLoadedCallbacks.push({\r
- func : callback,\r
- scope : scope || this\r
- });\r
-\r
- loadScripts = function() {\r
- var loadingScripts = tinymce.grep(scripts);\r
-\r
- // Current scripts has been handled\r
- scripts.length = 0;\r
-\r
- // Load scripts that needs to be loaded\r
- tinymce.each(loadingScripts, function(url) {\r
- // Script is already loaded then execute script callbacks directly\r
- if (states[url] == LOADED) {\r
- execScriptLoadedCallbacks(url);\r
- return;\r
- }\r
-\r
- // Is script not loading then start loading it\r
- if (states[url] != LOADING) {\r
- states[url] = LOADING;\r
- loading++;\r
-\r
- loadScript(url, function() {\r
- states[url] = LOADED;\r
- loading--;\r
-\r
- execScriptLoadedCallbacks(url);\r
-\r
- // Load more scripts if they where added by the recently loaded script\r
- loadScripts();\r
- });\r
- }\r
- });\r
-\r
- // No scripts are currently loading then execute all pending queue loaded callbacks\r
- if (!loading) {\r
- tinymce.each(queueLoadedCallbacks, function(callback) {\r
- callback.func.call(callback.scope);\r
- });\r
-\r
- queueLoadedCallbacks.length = 0;\r
- }\r
- };\r
-\r
- loadScripts();\r
- };\r
- };\r
-\r
- // Global script loader\r
- tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- tinymce.dom.RangeUtils = function(dom) {\r
- var INVISIBLE_CHAR = '\uFEFF';\r
-\r
- this.walk = function(rng, callback) {\r
- var startContainer = rng.startContainer,\r
- startOffset = rng.startOffset,\r
- endContainer = rng.endContainer,\r
- endOffset = rng.endOffset,\r
- ancestor, startPoint,\r
- endPoint, node, parent, siblings, nodes;\r
-\r
- // Handle table cell selection the table plugin enables\r
- // you to fake select table cells and perform formatting actions on them\r
- nodes = dom.select('td.mceSelected,th.mceSelected');\r
- if (nodes.length > 0) {\r
- tinymce.each(nodes, function(node) {\r
- callback([node]);\r
- });\r
-\r
- return;\r
- }\r
-\r
- function exclude(nodes) {\r
- var node;\r
-\r
- // First node is excluded\r
- node = nodes[0];\r
- if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) {\r
- nodes.splice(0, 1);\r
- }\r
-\r
- // Last node is excluded\r
- node = nodes[nodes.length - 1];\r
- if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) {\r
- nodes.splice(nodes.length - 1, 1);\r
- }\r
-\r
- return nodes;\r
- };\r
-\r
- function collectSiblings(node, name, end_node) {\r
- var siblings = [];\r
-\r
- for (; node && node != end_node; node = node[name])\r
- siblings.push(node);\r
-\r
- return siblings;\r
- };\r
-\r
- function findEndPoint(node, root) {\r
- do {\r
- if (node.parentNode == root)\r
- return node;\r
-\r
- node = node.parentNode;\r
- } while(node);\r
- };\r
-\r
- function walkBoundary(start_node, end_node, next) {\r
- var siblingName = next ? 'nextSibling' : 'previousSibling';\r
-\r
- for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) {\r
- parent = node.parentNode;\r
- siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName);\r
-\r
- if (siblings.length) {\r
- if (!next)\r
- siblings.reverse();\r
-\r
- callback(exclude(siblings));\r
- }\r
- }\r
- };\r
-\r
- // If index based start position then resolve it\r
- if (startContainer.nodeType == 1 && startContainer.hasChildNodes())\r
- startContainer = startContainer.childNodes[startOffset];\r
-\r
- // If index based end position then resolve it\r
- if (endContainer.nodeType == 1 && endContainer.hasChildNodes())\r
- endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)];\r
-\r
- // Same container\r
- if (startContainer == endContainer)\r
- return callback(exclude([startContainer]));\r
-\r
- // Find common ancestor and end points\r
- ancestor = dom.findCommonAncestor(startContainer, endContainer);\r
- \r
- // Process left side\r
- for (node = startContainer; node; node = node.parentNode) {\r
- if (node === endContainer)\r
- return walkBoundary(startContainer, ancestor, true);\r
-\r
- if (node === ancestor)\r
- break;\r
- }\r
-\r
- // Process right side\r
- for (node = endContainer; node; node = node.parentNode) {\r
- if (node === startContainer)\r
- return walkBoundary(endContainer, ancestor);\r
-\r
- if (node === ancestor)\r
- break;\r
- }\r
-\r
- // Find start/end point\r
- startPoint = findEndPoint(startContainer, ancestor) || startContainer;\r
- endPoint = findEndPoint(endContainer, ancestor) || endContainer;\r
-\r
- // Walk left leaf\r
- walkBoundary(startContainer, startPoint, true);\r
-\r
- // Walk the middle from start to end point\r
- siblings = collectSiblings(\r
- startPoint == startContainer ? startPoint : startPoint.nextSibling,\r
- 'nextSibling',\r
- endPoint == endContainer ? endPoint.nextSibling : endPoint\r
- );\r
-\r
- if (siblings.length)\r
- callback(exclude(siblings));\r
-\r
- // Walk right leaf\r
- walkBoundary(endContainer, endPoint);\r
- };\r
-\r
- this.split = function(rng) {\r
- var startContainer = rng.startContainer,\r
- startOffset = rng.startOffset,\r
- endContainer = rng.endContainer,\r
- endOffset = rng.endOffset;\r
-\r
- function splitText(node, offset) {\r
- return node.splitText(offset);\r
- };\r
-\r
- // Handle single text node\r
- if (startContainer == endContainer && startContainer.nodeType == 3) {\r
- if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {\r
- endContainer = splitText(startContainer, startOffset);\r
- startContainer = endContainer.previousSibling;\r
-\r
- if (endOffset > startOffset) {\r
- endOffset = endOffset - startOffset;\r
- startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;\r
- endOffset = endContainer.nodeValue.length;\r
- startOffset = 0;\r
- } else {\r
- endOffset = 0;\r
- }\r
- }\r
- } else {\r
- // Split startContainer text node if needed\r
- if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) {\r
- startContainer = splitText(startContainer, startOffset);\r
- startOffset = 0;\r
- }\r
-\r
- // Split endContainer text node if needed\r
- if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) {\r
- endContainer = splitText(endContainer, endOffset).previousSibling;\r
- endOffset = endContainer.nodeValue.length;\r
- }\r
- }\r
-\r
- return {\r
- startContainer : startContainer,\r
- startOffset : startOffset,\r
- endContainer : endContainer,\r
- endOffset : endOffset\r
- };\r
- };\r
-\r
- };\r
-\r
- tinymce.dom.RangeUtils.compareRanges = function(rng1, rng2) {\r
- if (rng1 && rng2) {\r
- // Compare native IE ranges\r
- if (rng1.item || rng1.duplicate) {\r
- // Both are control ranges and the selected element matches\r
- if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0))\r
- return true;\r
-\r
- // Both are text ranges and the range matches\r
- if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1))\r
- return true;\r
- } else {\r
- // Compare w3c ranges\r
- return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset;\r
- }\r
- }\r
-\r
- return false;\r
- };\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var Event = tinymce.dom.Event, each = tinymce.each;\r
-\r
- tinymce.create('tinymce.ui.KeyboardNavigation', {\r
- KeyboardNavigation: function(settings, dom) {\r
- var t = this, root = settings.root, items = settings.items,\r
- enableUpDown = settings.enableUpDown, enableLeftRight = settings.enableLeftRight || !settings.enableUpDown,\r
- excludeFromTabOrder = settings.excludeFromTabOrder,\r
- itemFocussed, itemBlurred, rootKeydown, rootFocussed, focussedId;\r
-\r
- dom = dom || tinymce.DOM;\r
-\r
- itemFocussed = function(evt) {\r
- focussedId = evt.target.id;\r
- };\r
- \r
- itemBlurred = function(evt) {\r
- dom.setAttrib(evt.target.id, 'tabindex', '-1');\r
- };\r
- \r
- rootFocussed = function(evt) {\r
- var item = dom.get(focussedId);\r
- dom.setAttrib(item, 'tabindex', '0');\r
- item.focus();\r
- };\r
- \r
- t.focus = function() {\r
- dom.get(focussedId).focus();\r
- };\r
-\r
- t.destroy = function() {\r
- each(items, function(item) {\r
- var elm = dom.get(item.id);\r
-\r
- dom.unbind(elm, 'focus', itemFocussed);\r
- dom.unbind(elm, 'blur', itemBlurred);\r
- });\r
-\r
- var rootElm = dom.get(root);\r
- dom.unbind(rootElm, 'focus', rootFocussed);\r
- dom.unbind(rootElm, 'keydown', rootKeydown);\r
-\r
- items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null;\r
- t.destroy = function() {};\r
- };\r
- \r
- t.moveFocus = function(dir, evt) {\r
- var idx = -1, controls = t.controls, newFocus;\r
-\r
- if (!focussedId)\r
- return;\r
-\r
- each(items, function(item, index) {\r
- if (item.id === focussedId) {\r
- idx = index;\r
- return false;\r
- }\r
- });\r
-\r
- idx += dir;\r
- if (idx < 0) {\r
- idx = items.length - 1;\r
- } else if (idx >= items.length) {\r
- idx = 0;\r
- }\r
- \r
- newFocus = items[idx];\r
- dom.setAttrib(focussedId, 'tabindex', '-1');\r
- dom.setAttrib(newFocus.id, 'tabindex', '0');\r
- dom.get(newFocus.id).focus();\r
-\r
- if (settings.actOnFocus) {\r
- settings.onAction(newFocus.id);\r
- }\r
-\r
- if (evt)\r
- Event.cancel(evt);\r
- };\r
- \r
- rootKeydown = function(evt) {\r
- var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40, DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32;\r
- \r
- switch (evt.keyCode) {\r
- case DOM_VK_LEFT:\r
- if (enableLeftRight) t.moveFocus(-1);\r
- break;\r
- \r
- case DOM_VK_RIGHT:\r
- if (enableLeftRight) t.moveFocus(1);\r
- break;\r
- \r
- case DOM_VK_UP:\r
- if (enableUpDown) t.moveFocus(-1);\r
- break;\r
-\r
- case DOM_VK_DOWN:\r
- if (enableUpDown) t.moveFocus(1);\r
- break;\r
-\r
- case DOM_VK_ESCAPE:\r
- if (settings.onCancel) {\r
- settings.onCancel();\r
- Event.cancel(evt);\r
- }\r
- break;\r
-\r
- case DOM_VK_ENTER:\r
- case DOM_VK_RETURN:\r
- case DOM_VK_SPACE:\r
- if (settings.onAction) {\r
- settings.onAction(focussedId);\r
- Event.cancel(evt);\r
- }\r
- break;\r
- }\r
- };\r
-\r
- // Set up state and listeners for each item.\r
- each(items, function(item, idx) {\r
- var tabindex, elm;\r
-\r
- if (!item.id) {\r
- item.id = dom.uniqueId('_mce_item_');\r
- }\r
-\r
- elm = dom.get(item.id);\r
-\r
- if (excludeFromTabOrder) {\r
- dom.bind(elm, 'blur', itemBlurred);\r
- tabindex = '-1';\r
- } else {\r
- tabindex = (idx === 0 ? '0' : '-1');\r
- }\r
-\r
- elm.setAttribute('tabindex', tabindex);\r
- dom.bind(elm, 'focus', itemFocussed);\r
- });\r
- \r
- // Setup initial state for root element.\r
- if (items[0]){\r
- focussedId = items[0].id;\r
- }\r
-\r
- dom.setAttrib(root, 'tabindex', '-1');\r
-\r
- // Setup listeners for root element.\r
- var rootElm = dom.get(root);\r
- dom.bind(rootElm, 'focus', rootFocussed);\r
- dom.bind(rootElm, 'keydown', rootKeydown);\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- // Shorten class names\r
- var DOM = tinymce.DOM, is = tinymce.is;\r
-\r
- tinymce.create('tinymce.ui.Control', {\r
- Control : function(id, s, editor) {\r
- this.id = id;\r
- this.settings = s = s || {};\r
- this.rendered = false;\r
- this.onRender = new tinymce.util.Dispatcher(this);\r
- this.classPrefix = '';\r
- this.scope = s.scope || this;\r
- this.disabled = 0;\r
- this.active = 0;\r
- this.editor = editor;\r
- },\r
- \r
- setAriaProperty : function(property, value) {\r
- var element = DOM.get(this.id + '_aria') || DOM.get(this.id);\r
- if (element) {\r
- DOM.setAttrib(element, 'aria-' + property, !!value);\r
- }\r
- },\r
- \r
- focus : function() {\r
- DOM.get(this.id).focus();\r
- },\r
-\r
- setDisabled : function(s) {\r
- if (s != this.disabled) {\r
- this.setAriaProperty('disabled', s);\r
-\r
- this.setState('Disabled', s);\r
- this.setState('Enabled', !s);\r
- this.disabled = s;\r
- }\r
- },\r
-\r
- isDisabled : function() {\r
- return this.disabled;\r
- },\r
-\r
- setActive : function(s) {\r
- if (s != this.active) {\r
- this.setState('Active', s);\r
- this.active = s;\r
- this.setAriaProperty('pressed', s);\r
- }\r
- },\r
-\r
- isActive : function() {\r
- return this.active;\r
- },\r
-\r
- setState : function(c, s) {\r
- var n = DOM.get(this.id);\r
-\r
- c = this.classPrefix + c;\r
-\r
- if (s)\r
- DOM.addClass(n, c);\r
- else\r
- DOM.removeClass(n, c);\r
- },\r
-\r
- isRendered : function() {\r
- return this.rendered;\r
- },\r
-\r
- renderHTML : function() {\r
- },\r
-\r
- renderTo : function(n) {\r
- DOM.setHTML(n, this.renderHTML());\r
- },\r
-\r
- postRender : function() {\r
- var t = this, b;\r
-\r
- // Set pending states\r
- if (is(t.disabled)) {\r
- b = t.disabled;\r
- t.disabled = -1;\r
- t.setDisabled(b);\r
- }\r
-\r
- if (is(t.active)) {\r
- b = t.active;\r
- t.active = -1;\r
- t.setActive(b);\r
- }\r
- },\r
-\r
- remove : function() {\r
- DOM.remove(this.id);\r
- this.destroy();\r
- },\r
-\r
- destroy : function() {\r
- tinymce.dom.Event.clear(this.id);\r
- }\r
- });\r
-})(tinymce);\r
-tinymce.create('tinymce.ui.Container:tinymce.ui.Control', {\r
- Container : function(id, s, editor) {\r
- this.parent(id, s, editor);\r
-\r
- this.controls = [];\r
-\r
- this.lookup = {};\r
- },\r
-\r
- add : function(c) {\r
- this.lookup[c.id] = c;\r
- this.controls.push(c);\r
-\r
- return c;\r
- },\r
-\r
- get : function(n) {\r
- return this.lookup[n];\r
- }\r
-});\r
-\r
-\r
-tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {\r
- Separator : function(id, s) {\r
- this.parent(id, s);\r
- this.classPrefix = 'mceSeparator';\r
- this.setDisabled(true);\r
- },\r
-\r
- renderHTML : function() {\r
- return tinymce.DOM.createHTML('span', {'class' : this.classPrefix, role : 'separator', 'aria-orientation' : 'vertical', tabindex : '-1'});\r
- }\r
-});\r
-\r
-(function(tinymce) {\r
- var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;\r
-\r
- tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', {\r
- MenuItem : function(id, s) {\r
- this.parent(id, s);\r
- this.classPrefix = 'mceMenuItem';\r
- },\r
-\r
- setSelected : function(s) {\r
- this.setState('Selected', s);\r
- this.setAriaProperty('checked', !!s);\r
- this.selected = s;\r
- },\r
-\r
- isSelected : function() {\r
- return this.selected;\r
- },\r
-\r
- postRender : function() {\r
- var t = this;\r
- \r
- t.parent();\r
-\r
- // Set pending state\r
- if (is(t.selected))\r
- t.setSelected(t.selected);\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;\r
-\r
- tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', {\r
- Menu : function(id, s) {\r
- var t = this;\r
-\r
- t.parent(id, s);\r
- t.items = {};\r
- t.collapsed = false;\r
- t.menuCount = 0;\r
- t.onAddItem = new tinymce.util.Dispatcher(this);\r
- },\r
-\r
- expand : function(d) {\r
- var t = this;\r
-\r
- if (d) {\r
- walk(t, function(o) {\r
- if (o.expand)\r
- o.expand();\r
- }, 'items', t);\r
- }\r
-\r
- t.collapsed = false;\r
- },\r
-\r
- collapse : function(d) {\r
- var t = this;\r
-\r
- if (d) {\r
- walk(t, function(o) {\r
- if (o.collapse)\r
- o.collapse();\r
- }, 'items', t);\r
- }\r
-\r
- t.collapsed = true;\r
- },\r
-\r
- isCollapsed : function() {\r
- return this.collapsed;\r
- },\r
-\r
- add : function(o) {\r
- if (!o.settings)\r
- o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o);\r
-\r
- this.onAddItem.dispatch(this, o);\r
-\r
- return this.items[o.id] = o;\r
- },\r
-\r
- addSeparator : function() {\r
- return this.add({separator : true});\r
- },\r
-\r
- addMenu : function(o) {\r
- if (!o.collapse)\r
- o = this.createMenu(o);\r
-\r
- this.menuCount++;\r
-\r
- return this.add(o);\r
- },\r
-\r
- hasMenus : function() {\r
- return this.menuCount !== 0;\r
- },\r
-\r
- remove : function(o) {\r
- delete this.items[o.id];\r
- },\r
-\r
- removeAll : function() {\r
- var t = this;\r
-\r
- walk(t, function(o) {\r
- if (o.removeAll)\r
- o.removeAll();\r
- else\r
- o.remove();\r
-\r
- o.destroy();\r
- }, 'items', t);\r
-\r
- t.items = {};\r
- },\r
-\r
- createMenu : function(o) {\r
- var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o);\r
-\r
- m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem);\r
-\r
- return m;\r
- }\r
- });\r
-})(tinymce);\r
-(function(tinymce) {\r
- var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element;\r
-\r
- tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', {\r
- DropMenu : function(id, s) {\r
- s = s || {};\r
- s.container = s.container || DOM.doc.body;\r
- s.offset_x = s.offset_x || 0;\r
- s.offset_y = s.offset_y || 0;\r
- s.vp_offset_x = s.vp_offset_x || 0;\r
- s.vp_offset_y = s.vp_offset_y || 0;\r
-\r
- if (is(s.icons) && !s.icons)\r
- s['class'] += ' mceNoIcons';\r
-\r
- this.parent(id, s);\r
- this.onShowMenu = new tinymce.util.Dispatcher(this);\r
- this.onHideMenu = new tinymce.util.Dispatcher(this);\r
- this.classPrefix = 'mceMenu';\r
- },\r
-\r
- createMenu : function(s) {\r
- var t = this, cs = t.settings, m;\r
-\r
- s.container = s.container || cs.container;\r
- s.parent = t;\r
- s.constrain = s.constrain || cs.constrain;\r
- s['class'] = s['class'] || cs['class'];\r
- s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x;\r
- s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y;\r
- s.keyboard_focus = cs.keyboard_focus;\r
- m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s);\r
-\r
- m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem);\r
-\r
- return m;\r
- },\r
- \r
- focus : function() {\r
- var t = this;\r
- if (t.keyboardNav) {\r
- t.keyboardNav.focus();\r
- }\r
- },\r
-\r
- update : function() {\r
- var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th;\r
-\r
- tw = s.max_width ? Math.min(tb.offsetWidth, s.max_width) : tb.offsetWidth;\r
- th = s.max_height ? Math.min(tb.offsetHeight, s.max_height) : tb.offsetHeight;\r
-\r
- if (!DOM.boxModel)\r
- t.element.setStyles({width : tw + 2, height : th + 2});\r
- else\r
- t.element.setStyles({width : tw, height : th});\r
-\r
- if (s.max_width)\r
- DOM.setStyle(co, 'width', tw);\r
-\r
- if (s.max_height) {\r
- DOM.setStyle(co, 'height', th);\r
-\r
- if (tb.clientHeight < s.max_height)\r
- DOM.setStyle(co, 'overflow', 'hidden');\r
- }\r
- },\r
-\r
- showMenu : function(x, y, px) {\r
- var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix;\r
-\r
- t.collapse(1);\r
-\r
- if (t.isMenuVisible)\r
- return;\r
-\r
- if (!t.rendered) {\r
- co = DOM.add(t.settings.container, t.renderNode());\r
-\r
- each(t.items, function(o) {\r
- o.postRender();\r
- });\r
-\r
- t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});\r
- } else\r
- co = DOM.get('menu_' + t.id);\r
-\r
- // Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug\r
- if (!tinymce.isOpera)\r
- DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF});\r
-\r
- DOM.show(co);\r
- t.update();\r
-\r
- x += s.offset_x || 0;\r
- y += s.offset_y || 0;\r
- vp.w -= 4;\r
- vp.h -= 4;\r
-\r
- // Move inside viewport if not submenu\r
- if (s.constrain) {\r
- w = co.clientWidth - ot;\r
- h = co.clientHeight - ot;\r
- mx = vp.x + vp.w;\r
- my = vp.y + vp.h;\r
-\r
- if ((x + s.vp_offset_x + w) > mx)\r
- x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w);\r
-\r
- if ((y + s.vp_offset_y + h) > my)\r
- y = Math.max(0, (my - s.vp_offset_y) - h);\r
- }\r
-\r
- DOM.setStyles(co, {left : x , top : y});\r
- t.element.update();\r
-\r
- t.isMenuVisible = 1;\r
- t.mouseClickFunc = Event.add(co, 'click', function(e) {\r
- var m;\r
-\r
- e = e.target;\r
-\r
- if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) {\r
- m = t.items[e.id];\r
-\r
- if (m.isDisabled())\r
- return;\r
-\r
- dm = t;\r
-\r
- while (dm) {\r
- if (dm.hideMenu)\r
- dm.hideMenu();\r
-\r
- dm = dm.settings.parent;\r
- }\r
-\r
- if (m.settings.onclick)\r
- m.settings.onclick(e);\r
-\r
- return false; // Cancel to fix onbeforeunload problem\r
- }\r
- });\r
-\r
- if (t.hasMenus()) {\r
- t.mouseOverFunc = Event.add(co, 'mouseover', function(e) {\r
- var m, r, mi;\r
-\r
- e = e.target;\r
- if (e && (e = DOM.getParent(e, 'tr'))) {\r
- m = t.items[e.id];\r
-\r
- if (t.lastMenu)\r
- t.lastMenu.collapse(1);\r
-\r
- if (m.isDisabled())\r
- return;\r
-\r
- if (e && DOM.hasClass(e, cp + 'ItemSub')) {\r
- //p = DOM.getPos(s.container);\r
- r = DOM.getRect(e);\r
- m.showMenu((r.x + r.w - ot), r.y - ot, r.x);\r
- t.lastMenu = m;\r
- DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive');\r
- }\r
- }\r
- });\r
- }\r
- \r
- Event.add(co, 'keydown', t._keyHandler, t);\r
-\r
- t.onShowMenu.dispatch(t);\r
-\r
- if (s.keyboard_focus) { \r
- t._setupKeyboardNav(); \r
- }\r
- },\r
-\r
- hideMenu : function(c) {\r
- var t = this, co = DOM.get('menu_' + t.id), e;\r
-\r
- if (!t.isMenuVisible)\r
- return;\r
-\r
- if (t.keyboardNav) t.keyboardNav.destroy();\r
- Event.remove(co, 'mouseover', t.mouseOverFunc);\r
- Event.remove(co, 'click', t.mouseClickFunc);\r
- Event.remove(co, 'keydown', t._keyHandler);\r
- DOM.hide(co);\r
- t.isMenuVisible = 0;\r
-\r
- if (!c)\r
- t.collapse(1);\r
-\r
- if (t.element)\r
- t.element.hide();\r
-\r
- if (e = DOM.get(t.id))\r
- DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive');\r
-\r
- t.onHideMenu.dispatch(t);\r
- },\r
-\r
- add : function(o) {\r
- var t = this, co;\r
-\r
- o = t.parent(o);\r
-\r
- if (t.isRendered && (co = DOM.get('menu_' + t.id)))\r
- t._add(DOM.select('tbody', co)[0], o);\r
-\r
- return o;\r
- },\r
-\r
- collapse : function(d) {\r
- this.parent(d);\r
- this.hideMenu(1);\r
- },\r
-\r
- remove : function(o) {\r
- DOM.remove(o.id);\r
- this.destroy();\r
-\r
- return this.parent(o);\r
- },\r
-\r
- destroy : function() {\r
- var t = this, co = DOM.get('menu_' + t.id);\r
-\r
- if (t.keyboardNav) t.keyboardNav.destroy();\r
- Event.remove(co, 'mouseover', t.mouseOverFunc);\r
- Event.remove(DOM.select('a', co), 'focus', t.mouseOverFunc);\r
- Event.remove(co, 'click', t.mouseClickFunc);\r
- Event.remove(co, 'keydown', t._keyHandler);\r
-\r
- if (t.element)\r
- t.element.remove();\r
-\r
- DOM.remove(co);\r
- },\r
-\r
- renderNode : function() {\r
- var t = this, s = t.settings, n, tb, co, w;\r
-\r
- w = DOM.create('div', {role: 'listbox', id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000;outline:0'});\r
- if (t.settings.parent) {\r
- DOM.setAttrib(w, 'aria-parent', 'menu_' + t.settings.parent.id);\r
- }\r
- co = DOM.add(w, 'div', {role: 'presentation', id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')});\r
- t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});\r
-\r
- if (s.menu_line)\r
- DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'});\r
-\r
-// n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'});\r
- n = DOM.add(co, 'table', {role: 'presentation', id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0});\r
- tb = DOM.add(n, 'tbody');\r
-\r
- each(t.items, function(o) {\r
- t._add(tb, o);\r
- });\r
-\r
- t.rendered = true;\r
-\r
- return w;\r
- },\r
-\r
- // Internal functions\r
- _setupKeyboardNav : function(){\r
- var contextMenu, menuItems, t=this; \r
- contextMenu = DOM.get('menu_' + t.id);\r
- menuItems = DOM.select('a[role=option]', 'menu_' + t.id);\r
- menuItems.splice(0,0,contextMenu);\r
- t.keyboardNav = new tinymce.ui.KeyboardNavigation({\r
- root: 'menu_' + t.id,\r
- items: menuItems,\r
- onCancel: function() {\r
- t.hideMenu();\r
- },\r
- enableUpDown: true\r
- });\r
- contextMenu.focus();\r
- },\r
-\r
- _keyHandler : function(evt) {\r
- var t = this, e;\r
- switch (evt.keyCode) {\r
- case 37: // Left\r
- if (t.settings.parent) {\r
- t.hideMenu();\r
- t.settings.parent.focus();\r
- Event.cancel(evt);\r
- }\r
- break;\r
- case 39: // Right\r
- if (t.mouseOverFunc)\r
- t.mouseOverFunc(evt);\r
- break;\r
- }\r
- },\r
-\r
- _add : function(tb, o) {\r
- var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic;\r
-\r
- if (s.separator) {\r
- ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'});\r
- DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'});\r
-\r
- if (n = ro.previousSibling)\r
- DOM.addClass(n, 'mceLast');\r
-\r
- return;\r
- }\r
-\r
- n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'});\r
- n = it = DOM.add(n, s.titleItem ? 'th' : 'td');\r
- n = a = DOM.add(n, 'a', {id: o.id + '_aria', role: s.titleItem ? 'presentation' : 'option', href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'});\r
-\r
- if (s.parent) {\r
- DOM.setAttrib(a, 'aria-haspopup', 'true');\r
- DOM.setAttrib(a, 'aria-owns', 'menu_' + o.id);\r
- }\r
-\r
- DOM.addClass(it, s['class']);\r
-// n = DOM.add(n, 'span', {'class' : 'item'});\r
-\r
- ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')});\r
-\r
- if (s.icon_src)\r
- DOM.add(ic, 'img', {src : s.icon_src});\r
-\r
- n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title);\r
-\r
- if (o.settings.style) {\r
- if (typeof o.settings.style == "function")\r
- o.settings.style = o.settings.style();\r
-\r
- DOM.setAttrib(n, 'style', o.settings.style);\r
- }\r
-\r
- if (tb.childNodes.length == 1)\r
- DOM.addClass(ro, 'mceFirst');\r
-\r
- if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator'))\r
- DOM.addClass(ro, 'mceFirst');\r
-\r
- if (o.collapse)\r
- DOM.addClass(ro, cp + 'ItemSub');\r
-\r
- if (n = ro.previousSibling)\r
- DOM.removeClass(n, 'mceLast');\r
-\r
- DOM.addClass(ro, 'mceLast');\r
- }\r
- });\r
-})(tinymce);\r
-(function(tinymce) {\r
- var DOM = tinymce.DOM;\r
-\r
- tinymce.create('tinymce.ui.Button:tinymce.ui.Control', {\r
- Button : function(id, s, ed) {\r
- this.parent(id, s, ed);\r
- this.classPrefix = 'mceButton';\r
- },\r
-\r
- renderHTML : function() {\r
- var cp = this.classPrefix, s = this.settings, h, l;\r
-\r
- l = DOM.encode(s.label || '');\r
- h = '<a role="button" id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" aria-labelledby="' + this.id + '_voice" title="' + DOM.encode(s.title) + '">';\r
- if (s.image && !(this.editor &&this.editor.forcedHighContrastMode) )\r
- h += '<span class="mceIcon ' + s['class'] + '"><img class="mceIcon" src="' + s.image + '" alt="' + DOM.encode(s.title) + '" /></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '');\r
- else\r
- h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '');\r
-\r
- h += '<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="' + this.id + '_voice">' + s.title + '</span>'; \r
- h += '</a>';\r
- return h;\r
- },\r
-\r
- postRender : function() {\r
- var t = this, s = t.settings, imgBookmark;\r
-\r
- // In IE a large image that occupies the entire editor area will be deselected when a button is clicked, so\r
- // need to keep the selection in case the selection is lost\r
- if (tinymce.isIE && t.editor) {\r
- tinymce.dom.Event.add(t.id, 'mousedown', function(e) {\r
- var nodeName = t.editor.selection.getNode().nodeName;\r
- imgBookmark = nodeName === 'IMG' ? t.editor.selection.getBookmark() : null;\r
- });\r
- }\r
- tinymce.dom.Event.add(t.id, 'click', function(e) {\r
- if (!t.isDisabled()) {\r
- // restore the selection in case the selection is lost in IE\r
- if (tinymce.isIE && t.editor && imgBookmark !== null) {\r
- t.editor.selection.moveToBookmark(imgBookmark);\r
- }\r
- return s.onclick.call(s.scope, e);\r
- }\r
- });\r
- tinymce.dom.Event.add(t.id, 'keyup', function(e) {\r
- if (!t.isDisabled() && e.keyCode==tinymce.VK.SPACEBAR)\r
- return s.onclick.call(s.scope, e);\r
- });\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, undef;\r
-\r
- tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', {\r
- ListBox : function(id, s, ed) {\r
- var t = this;\r
-\r
- t.parent(id, s, ed);\r
-\r
- t.items = [];\r
-\r
- t.onChange = new Dispatcher(t);\r
-\r
- t.onPostRender = new Dispatcher(t);\r
-\r
- t.onAdd = new Dispatcher(t);\r
-\r
- t.onRenderMenu = new tinymce.util.Dispatcher(this);\r
-\r
- t.classPrefix = 'mceListBox';\r
- t.marked = {};\r
- },\r
-\r
- select : function(va) {\r
- var t = this, fv, f;\r
-\r
- t.marked = {};\r
-\r
- if (va == undef)\r
- return t.selectByIndex(-1);\r
-\r
- // Is string or number make function selector\r
- if (va && typeof(va)=="function")\r
- f = va;\r
- else {\r
- f = function(v) {\r
- return v == va;\r
- };\r
- }\r
-\r
- // Do we need to do something?\r
- if (va != t.selectedValue) {\r
- // Find item\r
- each(t.items, function(o, i) {\r
- if (f(o.value)) {\r
- fv = 1;\r
- t.selectByIndex(i);\r
- return false;\r
- }\r
- });\r
-\r
- if (!fv)\r
- t.selectByIndex(-1);\r
- }\r
- },\r
-\r
- selectByIndex : function(idx) {\r
- var t = this, e, o, label;\r
-\r
- t.marked = {};\r
-\r
- if (idx != t.selectedIndex) {\r
- e = DOM.get(t.id + '_text');\r
- label = DOM.get(t.id + '_voiceDesc');\r
- o = t.items[idx];\r
-\r
- if (o) {\r
- t.selectedValue = o.value;\r
- t.selectedIndex = idx;\r
- DOM.setHTML(e, DOM.encode(o.title));\r
- DOM.setHTML(label, t.settings.title + " - " + o.title);\r
- DOM.removeClass(e, 'mceTitle');\r
- DOM.setAttrib(t.id, 'aria-valuenow', o.title);\r
- } else {\r
- DOM.setHTML(e, DOM.encode(t.settings.title));\r
- DOM.setHTML(label, DOM.encode(t.settings.title));\r
- DOM.addClass(e, 'mceTitle');\r
- t.selectedValue = t.selectedIndex = null;\r
- DOM.setAttrib(t.id, 'aria-valuenow', t.settings.title);\r
- }\r
- e = 0;\r
- }\r
- },\r
-\r
- mark : function(value) {\r
- this.marked[value] = true;\r
- },\r
-\r
- add : function(n, v, o) {\r
- var t = this;\r
-\r
- o = o || {};\r
- o = tinymce.extend(o, {\r
- title : n,\r
- value : v\r
- });\r
-\r
- t.items.push(o);\r
- t.onAdd.dispatch(t, o);\r
- },\r
-\r
- getLength : function() {\r
- return this.items.length;\r
- },\r
-\r
- renderHTML : function() {\r
- var h = '', t = this, s = t.settings, cp = t.classPrefix;\r
-\r
- h = '<span role="listbox" aria-haspopup="true" aria-labelledby="' + t.id +'_voiceDesc" aria-describedby="' + t.id + '_voiceDesc"><table role="presentation" tabindex="0" id="' + t.id + '" cellpadding="0" cellspacing="0" class="' + cp + ' ' + cp + 'Enabled' + (s['class'] ? (' ' + s['class']) : '') + '"><tbody><tr>';\r
- h += '<td>' + DOM.createHTML('span', {id: t.id + '_voiceDesc', 'class': 'voiceLabel', style:'display:none;'}, t.settings.title); \r
- h += DOM.createHTML('a', {id : t.id + '_text', tabindex : -1, href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '</td>';\r
- h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>') + '</td>';\r
- h += '</tr></tbody></table></span>';\r
-\r
- return h;\r
- },\r
-\r
- showMenu : function() {\r
- var t = this, p2, e = DOM.get(this.id), m;\r
-\r
- if (t.isDisabled() || t.items.length === 0)\r
- return;\r
-\r
- if (t.menu && t.menu.isMenuVisible)\r
- return t.hideMenu();\r
-\r
- if (!t.isMenuRendered) {\r
- t.renderMenu();\r
- t.isMenuRendered = true;\r
- }\r
-\r
- p2 = DOM.getPos(e);\r
-\r
- m = t.menu;\r
- m.settings.offset_x = p2.x;\r
- m.settings.offset_y = p2.y;\r
- m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus\r
-\r
- // Select in menu\r
- each(t.items, function(o) {\r
- if (m.items[o.id]) {\r
- m.items[o.id].setSelected(0);\r
- }\r
- });\r
-\r
- each(t.items, function(o) {\r
- if (m.items[o.id] && t.marked[o.value]) {\r
- m.items[o.id].setSelected(1);\r
- }\r
-\r
- if (o.value === t.selectedValue) {\r
- m.items[o.id].setSelected(1);\r
- }\r
- });\r
-\r
- m.showMenu(0, e.clientHeight);\r
-\r
- Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
- DOM.addClass(t.id, t.classPrefix + 'Selected');\r
-\r
- //DOM.get(t.id + '_text').focus();\r
- },\r
-\r
- hideMenu : function(e) {\r
- var t = this;\r
-\r
- if (t.menu && t.menu.isMenuVisible) {\r
- DOM.removeClass(t.id, t.classPrefix + 'Selected');\r
-\r
- // Prevent double toogles by canceling the mouse click event to the button\r
- if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open'))\r
- return;\r
-\r
- if (!e || !DOM.getParent(e.target, '.mceMenu')) {\r
- DOM.removeClass(t.id, t.classPrefix + 'Selected');\r
- Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);\r
- t.menu.hideMenu();\r
- }\r
- }\r
- },\r
-\r
- renderMenu : function() {\r
- var t = this, m;\r
-\r
- m = t.settings.control_manager.createDropMenu(t.id + '_menu', {\r
- menu_line : 1,\r
- 'class' : t.classPrefix + 'Menu mceNoIcons',\r
- max_width : 250,\r
- max_height : 150\r
- });\r
-\r
- m.onHideMenu.add(function() {\r
- t.hideMenu();\r
- t.focus();\r
- });\r
-\r
- m.add({\r
- title : t.settings.title,\r
- 'class' : 'mceMenuItemTitle',\r
- onclick : function() {\r
- if (t.settings.onselect('') !== false)\r
- t.select(''); // Must be runned after\r
- }\r
- });\r
-\r
- each(t.items, function(o) {\r
- // No value then treat it as a title\r
- if (o.value === undef) {\r
- m.add({\r
- title : o.title,\r
- role : "option",\r
- 'class' : 'mceMenuItemTitle',\r
- onclick : function() {\r
- if (t.settings.onselect('') !== false)\r
- t.select(''); // Must be runned after\r
- }\r
- });\r
- } else {\r
- o.id = DOM.uniqueId();\r
- o.role= "option";\r
- o.onclick = function() {\r
- if (t.settings.onselect(o.value) !== false)\r
- t.select(o.value); // Must be runned after\r
- };\r
-\r
- m.add(o);\r
- }\r
- });\r
-\r
- t.onRenderMenu.dispatch(t, m);\r
- t.menu = m;\r
- },\r
-\r
- postRender : function() {\r
- var t = this, cp = t.classPrefix;\r
-\r
- Event.add(t.id, 'click', t.showMenu, t);\r
- Event.add(t.id, 'keydown', function(evt) {\r
- if (evt.keyCode == 32) { // Space\r
- t.showMenu(evt);\r
- Event.cancel(evt);\r
- }\r
- });\r
- Event.add(t.id, 'focus', function() {\r
- if (!t._focused) {\r
- t.keyDownHandler = Event.add(t.id, 'keydown', function(e) {\r
- if (e.keyCode == 40) {\r
- t.showMenu();\r
- Event.cancel(e);\r
- }\r
- });\r
- t.keyPressHandler = Event.add(t.id, 'keypress', function(e) {\r
- var v;\r
- if (e.keyCode == 13) {\r
- // Fake select on enter\r
- v = t.selectedValue;\r
- t.selectedValue = null; // Needs to be null to fake change\r
- Event.cancel(e);\r
- t.settings.onselect(v);\r
- }\r
- });\r
- }\r
-\r
- t._focused = 1;\r
- });\r
- Event.add(t.id, 'blur', function() {\r
- Event.remove(t.id, 'keydown', t.keyDownHandler);\r
- Event.remove(t.id, 'keypress', t.keyPressHandler);\r
- t._focused = 0;\r
- });\r
-\r
- // Old IE doesn't have hover on all elements\r
- if (tinymce.isIE6 || !DOM.boxModel) {\r
- Event.add(t.id, 'mouseover', function() {\r
- if (!DOM.hasClass(t.id, cp + 'Disabled'))\r
- DOM.addClass(t.id, cp + 'Hover');\r
- });\r
-\r
- Event.add(t.id, 'mouseout', function() {\r
- if (!DOM.hasClass(t.id, cp + 'Disabled'))\r
- DOM.removeClass(t.id, cp + 'Hover');\r
- });\r
- }\r
-\r
- t.onPostRender.dispatch(t, DOM.get(t.id));\r
- },\r
-\r
- destroy : function() {\r
- this.parent();\r
-\r
- Event.clear(this.id + '_text');\r
- Event.clear(this.id + '_open');\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, undef;\r
-\r
- tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', {\r
- NativeListBox : function(id, s) {\r
- this.parent(id, s);\r
- this.classPrefix = 'mceNativeListBox';\r
- },\r
-\r
- setDisabled : function(s) {\r
- DOM.get(this.id).disabled = s;\r
- this.setAriaProperty('disabled', s);\r
- },\r
-\r
- isDisabled : function() {\r
- return DOM.get(this.id).disabled;\r
- },\r
-\r
- select : function(va) {\r
- var t = this, fv, f;\r
-\r
- if (va == undef)\r
- return t.selectByIndex(-1);\r
-\r
- // Is string or number make function selector\r
- if (va && typeof(va)=="function")\r
- f = va;\r
- else {\r
- f = function(v) {\r
- return v == va;\r
- };\r
- }\r
-\r
- // Do we need to do something?\r
- if (va != t.selectedValue) {\r
- // Find item\r
- each(t.items, function(o, i) {\r
- if (f(o.value)) {\r
- fv = 1;\r
- t.selectByIndex(i);\r
- return false;\r
- }\r
- });\r
-\r
- if (!fv)\r
- t.selectByIndex(-1);\r
- }\r
- },\r
-\r
- selectByIndex : function(idx) {\r
- DOM.get(this.id).selectedIndex = idx + 1;\r
- this.selectedValue = this.items[idx] ? this.items[idx].value : null;\r
- },\r
-\r
- add : function(n, v, a) {\r
- var o, t = this;\r
-\r
- a = a || {};\r
- a.value = v;\r
-\r
- if (t.isRendered())\r
- DOM.add(DOM.get(this.id), 'option', a, n);\r
-\r
- o = {\r
- title : n,\r
- value : v,\r
- attribs : a\r
- };\r
-\r
- t.items.push(o);\r
- t.onAdd.dispatch(t, o);\r
- },\r
-\r
- getLength : function() {\r
- return this.items.length;\r
- },\r
-\r
- renderHTML : function() {\r
- var h, t = this;\r
-\r
- h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --');\r
-\r
- each(t.items, function(it) {\r
- h += DOM.createHTML('option', {value : it.value}, it.title);\r
- });\r
-\r
- h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox', 'aria-labelledby': t.id + '_aria'}, h);\r
- h += DOM.createHTML('span', {id : t.id + '_aria', 'style': 'display: none'}, t.settings.title);\r
- return h;\r
- },\r
-\r
- postRender : function() {\r
- var t = this, ch, changeListenerAdded = true;\r
-\r
- t.rendered = true;\r
-\r
- function onChange(e) {\r
- var v = t.items[e.target.selectedIndex - 1];\r
-\r
- if (v && (v = v.value)) {\r
- t.onChange.dispatch(t, v);\r
-\r
- if (t.settings.onselect)\r
- t.settings.onselect(v);\r
- }\r
- };\r
-\r
- Event.add(t.id, 'change', onChange);\r
-\r
- // Accessibility keyhandler\r
- Event.add(t.id, 'keydown', function(e) {\r
- var bf;\r
-\r
- Event.remove(t.id, 'change', ch);\r
- changeListenerAdded = false;\r
-\r
- bf = Event.add(t.id, 'blur', function() {\r
- if (changeListenerAdded) return;\r
- changeListenerAdded = true;\r
- Event.add(t.id, 'change', onChange);\r
- Event.remove(t.id, 'blur', bf);\r
- });\r
-\r
- //prevent default left and right keys on chrome - so that the keyboard navigation is used.\r
- if (tinymce.isWebKit && (e.keyCode==37 ||e.keyCode==39)) {\r
- return Event.prevent(e);\r
- }\r
- \r
- if (e.keyCode == 13 || e.keyCode == 32) {\r
- onChange(e);\r
- return Event.cancel(e);\r
- }\r
- });\r
-\r
- t.onPostRender.dispatch(t, DOM.get(t.id));\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;\r
-\r
- tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', {\r
- MenuButton : function(id, s, ed) {\r
- this.parent(id, s, ed);\r
-\r
- this.onRenderMenu = new tinymce.util.Dispatcher(this);\r
-\r
- s.menu_container = s.menu_container || DOM.doc.body;\r
- },\r
-\r
- showMenu : function() {\r
- var t = this, p1, p2, e = DOM.get(t.id), m;\r
-\r
- if (t.isDisabled())\r
- return;\r
-\r
- if (!t.isMenuRendered) {\r
- t.renderMenu();\r
- t.isMenuRendered = true;\r
- }\r
-\r
- if (t.isMenuVisible)\r
- return t.hideMenu();\r
-\r
- p1 = DOM.getPos(t.settings.menu_container);\r
- p2 = DOM.getPos(e);\r
-\r
- m = t.menu;\r
- m.settings.offset_x = p2.x;\r
- m.settings.offset_y = p2.y;\r
- m.settings.vp_offset_x = p2.x;\r
- m.settings.vp_offset_y = p2.y;\r
- m.settings.keyboard_focus = t._focused;\r
- m.showMenu(0, e.firstChild.clientHeight);\r
-\r
- Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
- t.setState('Selected', 1);\r
-\r
- t.isMenuVisible = 1;\r
- },\r
-\r
- renderMenu : function() {\r
- var t = this, m;\r
-\r
- m = t.settings.control_manager.createDropMenu(t.id + '_menu', {\r
- menu_line : 1,\r
- 'class' : this.classPrefix + 'Menu',\r
- icons : t.settings.icons\r
- });\r
-\r
- m.onHideMenu.add(function() {\r
- t.hideMenu();\r
- t.focus();\r
- });\r
-\r
- t.onRenderMenu.dispatch(t, m);\r
- t.menu = m;\r
- },\r
-\r
- hideMenu : function(e) {\r
- var t = this;\r
-\r
- // Prevent double toogles by canceling the mouse click event to the button\r
- if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';}))\r
- return;\r
-\r
- if (!e || !DOM.getParent(e.target, '.mceMenu')) {\r
- t.setState('Selected', 0);\r
- Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);\r
- if (t.menu)\r
- t.menu.hideMenu();\r
- }\r
-\r
- t.isMenuVisible = 0;\r
- },\r
-\r
- postRender : function() {\r
- var t = this, s = t.settings;\r
-\r
- Event.add(t.id, 'click', function() {\r
- if (!t.isDisabled()) {\r
- if (s.onclick)\r
- s.onclick(t.value);\r
-\r
- t.showMenu();\r
- }\r
- });\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;\r
-\r
- tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', {\r
- SplitButton : function(id, s, ed) {\r
- this.parent(id, s, ed);\r
- this.classPrefix = 'mceSplitButton';\r
- },\r
-\r
- renderHTML : function() {\r
- var h, t = this, s = t.settings, h1;\r
-\r
- h = '<tbody><tr>';\r
-\r
- if (s.image)\r
- h1 = DOM.createHTML('img ', {src : s.image, role: 'presentation', 'class' : 'mceAction ' + s['class']});\r
- else\r
- h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, '');\r
-\r
- h1 += DOM.createHTML('span', {'class': 'mceVoiceLabel mceIconOnly', id: t.id + '_voice', style: 'display:none;'}, s.title);\r
- h += '<td >' + DOM.createHTML('a', {role: 'button', id : t.id + '_action', tabindex: '-1', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';\r
- \r
- h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}, '<span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>');\r
- h += '<td >' + DOM.createHTML('a', {role: 'button', id : t.id + '_open', tabindex: '-1', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';\r
-\r
- h += '</tr></tbody>';\r
- h = DOM.createHTML('table', { role: 'presentation', 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', title : s.title}, h);\r
- return DOM.createHTML('div', {id : t.id, role: 'button', tabindex: '0', 'aria-labelledby': t.id + '_voice', 'aria-haspopup': 'true'}, h);\r
- },\r
-\r
- postRender : function() {\r
- var t = this, s = t.settings, activate;\r
-\r
- if (s.onclick) {\r
- activate = function(evt) {\r
- if (!t.isDisabled()) {\r
- s.onclick(t.value);\r
- Event.cancel(evt);\r
- }\r
- };\r
- Event.add(t.id + '_action', 'click', activate);\r
- Event.add(t.id, ['click', 'keydown'], function(evt) {\r
- var DOM_VK_SPACE = 32, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_UP = 38, DOM_VK_DOWN = 40;\r
- if ((evt.keyCode === 32 || evt.keyCode === 13 || evt.keyCode === 14) && !evt.altKey && !evt.ctrlKey && !evt.metaKey) {\r
- activate();\r
- Event.cancel(evt);\r
- } else if (evt.type === 'click' || evt.keyCode === DOM_VK_DOWN) {\r
- t.showMenu();\r
- Event.cancel(evt);\r
- }\r
- });\r
- }\r
-\r
- Event.add(t.id + '_open', 'click', function (evt) {\r
- t.showMenu();\r
- Event.cancel(evt);\r
- });\r
- Event.add([t.id, t.id + '_open'], 'focus', function() {t._focused = 1;});\r
- Event.add([t.id, t.id + '_open'], 'blur', function() {t._focused = 0;});\r
-\r
- // Old IE doesn't have hover on all elements\r
- if (tinymce.isIE6 || !DOM.boxModel) {\r
- Event.add(t.id, 'mouseover', function() {\r
- if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))\r
- DOM.addClass(t.id, 'mceSplitButtonHover');\r
- });\r
-\r
- Event.add(t.id, 'mouseout', function() {\r
- if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))\r
- DOM.removeClass(t.id, 'mceSplitButtonHover');\r
- });\r
- }\r
- },\r
-\r
- destroy : function() {\r
- this.parent();\r
-\r
- Event.clear(this.id + '_action');\r
- Event.clear(this.id + '_open');\r
- Event.clear(this.id);\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;\r
-\r
- tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', {\r
- ColorSplitButton : function(id, s, ed) {\r
- var t = this;\r
-\r
- t.parent(id, s, ed);\r
-\r
- t.settings = s = tinymce.extend({\r
- colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',\r
- grid_width : 8,\r
- default_color : '#888888'\r
- }, t.settings);\r
-\r
- t.onShowMenu = new tinymce.util.Dispatcher(t);\r
-\r
- t.onHideMenu = new tinymce.util.Dispatcher(t);\r
-\r
- t.value = s.default_color;\r
- },\r
-\r
- showMenu : function() {\r
- var t = this, r, p, e, p2;\r
-\r
- if (t.isDisabled())\r
- return;\r
-\r
- if (!t.isMenuRendered) {\r
- t.renderMenu();\r
- t.isMenuRendered = true;\r
- }\r
-\r
- if (t.isMenuVisible)\r
- return t.hideMenu();\r
-\r
- e = DOM.get(t.id);\r
- DOM.show(t.id + '_menu');\r
- DOM.addClass(e, 'mceSplitButtonSelected');\r
- p2 = DOM.getPos(e);\r
- DOM.setStyles(t.id + '_menu', {\r
- left : p2.x,\r
- top : p2.y + e.firstChild.clientHeight,\r
- zIndex : 200000\r
- });\r
- e = 0;\r
-\r
- Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
- t.onShowMenu.dispatch(t);\r
-\r
- if (t._focused) {\r
- t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) {\r
- if (e.keyCode == 27)\r
- t.hideMenu();\r
- });\r
-\r
- DOM.select('a', t.id + '_menu')[0].focus(); // Select first link\r
- }\r
-\r
- t.keyboardNav = new tinymce.ui.KeyboardNavigation({\r
- root: t.id + '_menu',\r
- items: DOM.select('a', t.id + '_menu'),\r
- onCancel: function() {\r
- t.hideMenu();\r
- t.focus();\r
- }\r
- });\r
-\r
- t.keyboardNav.focus();\r
- t.isMenuVisible = 1;\r
- },\r
-\r
- hideMenu : function(e) {\r
- var t = this;\r
-\r
- if (t.isMenuVisible) {\r
- // Prevent double toogles by canceling the mouse click event to the button\r
- if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';}))\r
- return;\r
-\r
- if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) {\r
- DOM.removeClass(t.id, 'mceSplitButtonSelected');\r
- Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);\r
- Event.remove(t.id + '_menu', 'keydown', t._keyHandler);\r
- DOM.hide(t.id + '_menu');\r
- }\r
-\r
- t.isMenuVisible = 0;\r
- t.onHideMenu.dispatch();\r
- t.keyboardNav.destroy();\r
- }\r
- },\r
-\r
- renderMenu : function() {\r
- var t = this, m, i = 0, s = t.settings, n, tb, tr, w, context;\r
-\r
- w = DOM.add(s.menu_container, 'div', {role: 'listbox', id : t.id + '_menu', 'class' : s.menu_class + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'});\r
- m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'});\r
- DOM.add(m, 'span', {'class' : 'mceMenuLine'});\r
-\r
- n = DOM.add(m, 'table', {role: 'presentation', 'class' : 'mceColorSplitMenu'});\r
- tb = DOM.add(n, 'tbody');\r
-\r
- // Generate color grid\r
- i = 0;\r
- each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) {\r
- c = c.replace(/^#/, '');\r
-\r
- if (!i--) {\r
- tr = DOM.add(tb, 'tr');\r
- i = s.grid_width - 1;\r
- }\r
-\r
- n = DOM.add(tr, 'td');\r
- var settings = {\r
- href : 'javascript:;',\r
- style : {\r
- backgroundColor : '#' + c\r
- },\r
- 'title': t.editor.getLang('colors.' + c, c),\r
- 'data-mce-color' : '#' + c\r
- };\r
-\r
- // adding a proper ARIA role = button causes JAWS to read things incorrectly on IE.\r
- if (!tinymce.isIE ) {\r
- settings.role = 'option';\r
- }\r
-\r
- n = DOM.add(n, 'a', settings);\r
-\r
- if (t.editor.forcedHighContrastMode) {\r
- n = DOM.add(n, 'canvas', { width: 16, height: 16, 'aria-hidden': 'true' });\r
- if (n.getContext && (context = n.getContext("2d"))) {\r
- context.fillStyle = '#' + c;\r
- context.fillRect(0, 0, 16, 16);\r
- } else {\r
- // No point leaving a canvas element around if it's not supported for drawing on anyway.\r
- DOM.remove(n);\r
- }\r
- }\r
- });\r
-\r
- if (s.more_colors_func) {\r
- n = DOM.add(tb, 'tr');\r
- n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'});\r
- n = DOM.add(n, 'a', {role: 'option', id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title);\r
-\r
- Event.add(n, 'click', function(e) {\r
- s.more_colors_func.call(s.more_colors_scope || this);\r
- return Event.cancel(e); // Cancel to fix onbeforeunload problem\r
- });\r
- }\r
-\r
- DOM.addClass(m, 'mceColorSplitMenu');\r
-\r
- // Prevent IE from scrolling and hindering click to occur #4019\r
- Event.add(t.id + '_menu', 'mousedown', function(e) {return Event.cancel(e);});\r
-\r
- Event.add(t.id + '_menu', 'click', function(e) {\r
- var c;\r
-\r
- e = DOM.getParent(e.target, 'a', tb);\r
-\r
- if (e && e.nodeName.toLowerCase() == 'a' && (c = e.getAttribute('data-mce-color')))\r
- t.setColor(c);\r
-\r
- return false; // Prevent IE auto save warning\r
- });\r
-\r
- return w;\r
- },\r
-\r
- setColor : function(c) {\r
- this.displayColor(c);\r
- this.hideMenu();\r
- this.settings.onselect(c);\r
- },\r
- \r
- displayColor : function(c) {\r
- var t = this;\r
-\r
- DOM.setStyle(t.id + '_preview', 'backgroundColor', c);\r
-\r
- t.value = c;\r
- },\r
-\r
- postRender : function() {\r
- var t = this, id = t.id;\r
-\r
- t.parent();\r
- DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'});\r
- DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value);\r
- },\r
-\r
- destroy : function() {\r
- var self = this;\r
-\r
- self.parent();\r
-\r
- Event.clear(self.id + '_menu');\r
- Event.clear(self.id + '_more');\r
- DOM.remove(self.id + '_menu');\r
-\r
- if (self.keyboardNav) {\r
- self.keyboardNav.destroy();\r
- }\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
-// Shorten class names\r
-var dom = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event;\r
-tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', {\r
- renderHTML : function() {\r
- var t = this, h = [], controls = t.controls, each = tinymce.each, settings = t.settings;\r
-\r
- h.push('<div id="' + t.id + '" role="group" aria-labelledby="' + t.id + '_voice">');\r
- //TODO: ACC test this out - adding a role = application for getting the landmarks working well.\r
- h.push("<span role='application'>");\r
- h.push('<span id="' + t.id + '_voice" class="mceVoiceLabel" style="display:none;">' + dom.encode(settings.name) + '</span>');\r
- each(controls, function(toolbar) {\r
- h.push(toolbar.renderHTML());\r
- });\r
- h.push("</span>");\r
- h.push('</div>');\r
-\r
- return h.join('');\r
- },\r
- \r
- focus : function() {\r
- var t = this;\r
- dom.get(t.id).focus();\r
- },\r
- \r
- postRender : function() {\r
- var t = this, items = [];\r
-\r
- each(t.controls, function(toolbar) {\r
- each (toolbar.controls, function(control) {\r
- if (control.id) {\r
- items.push(control);\r
- }\r
- });\r
- });\r
-\r
- t.keyNav = new tinymce.ui.KeyboardNavigation({\r
- root: t.id,\r
- items: items,\r
- onCancel: function() {\r
- //Move focus if webkit so that navigation back will read the item.\r
- if (tinymce.isWebKit) {\r
- dom.get(t.editor.id+"_ifr").focus();\r
- }\r
- t.editor.focus();\r
- },\r
- excludeFromTabOrder: !t.settings.tab_focus_toolbar\r
- });\r
- },\r
- \r
- destroy : function() {\r
- var self = this;\r
-\r
- self.parent();\r
- self.keyNav.destroy();\r
- Event.clear(self.id);\r
- }\r
-});\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
-// Shorten class names\r
-var dom = tinymce.DOM, each = tinymce.each;\r
-tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {\r
- renderHTML : function() {\r
- var t = this, h = '', c, co, s = t.settings, i, pr, nx, cl;\r
-\r
- cl = t.controls;\r
- for (i=0; i<cl.length; i++) {\r
- // Get current control, prev control, next control and if the control is a list box or not\r
- co = cl[i];\r
- pr = cl[i - 1];\r
- nx = cl[i + 1];\r
-\r
- // Add toolbar start\r
- if (i === 0) {\r
- c = 'mceToolbarStart';\r
-\r
- if (co.Button)\r
- c += ' mceToolbarStartButton';\r
- else if (co.SplitButton)\r
- c += ' mceToolbarStartSplitButton';\r
- else if (co.ListBox)\r
- c += ' mceToolbarStartListBox';\r
-\r
- h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));\r
- }\r
-\r
- // Add toolbar end before list box and after the previous button\r
- // This is to fix the o2k7 editor skins\r
- if (pr && co.ListBox) {\r
- if (pr.Button || pr.SplitButton)\r
- h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '<!-- IE -->'));\r
- }\r
-\r
- // Render control HTML\r
-\r
- // IE 8 quick fix, needed to propertly generate a hit area for anchors\r
- if (dom.stdMode)\r
- h += '<td style="position: relative">' + co.renderHTML() + '</td>';\r
- else\r
- h += '<td>' + co.renderHTML() + '</td>';\r
-\r
- // Add toolbar start after list box and before the next button\r
- // This is to fix the o2k7 editor skins\r
- if (nx && co.ListBox) {\r
- if (nx.Button || nx.SplitButton)\r
- h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '<!-- IE -->'));\r
- }\r
- }\r
-\r
- c = 'mceToolbarEnd';\r
-\r
- if (co.Button)\r
- c += ' mceToolbarEndButton';\r
- else if (co.SplitButton)\r
- c += ' mceToolbarEndSplitButton';\r
- else if (co.ListBox)\r
- c += ' mceToolbarEndListBox';\r
-\r
- h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));\r
-\r
- return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || '', role: 'presentation', tabindex: '-1'}, '<tbody><tr>' + h + '</tr></tbody>');\r
- }\r
-});\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;\r
-\r
- tinymce.create('tinymce.AddOnManager', {\r
- AddOnManager : function() {\r
- var self = this;\r
-\r
- self.items = [];\r
- self.urls = {};\r
- self.lookup = {};\r
- self.onAdd = new Dispatcher(self);\r
- },\r
-\r
- get : function(n) {\r
- if (this.lookup[n]) {\r
- return this.lookup[n].instance;\r
- } else {\r
- return undefined;\r
- }\r
- },\r
-\r
- dependencies : function(n) {\r
- var result;\r
- if (this.lookup[n]) {\r
- result = this.lookup[n].dependencies;\r
- }\r
- return result || [];\r
- },\r
-\r
- requireLangPack : function(n) {\r
- var s = tinymce.settings;\r
-\r
- if (s && s.language && s.language_load !== false)\r
- tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js');\r
- },\r
-\r
- add : function(id, o, dependencies) {\r
- this.items.push(o);\r
- this.lookup[id] = {instance:o, dependencies:dependencies};\r
- this.onAdd.dispatch(this, id, o);\r
-\r
- return o;\r
- },\r
- createUrl: function(baseUrl, dep) {\r
- if (typeof dep === "object") {\r
- return dep\r
- } else {\r
- return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix};\r
- }\r
- },\r
-\r
- addComponents: function(pluginName, scripts) {\r
- var pluginUrl = this.urls[pluginName];\r
- tinymce.each(scripts, function(script){\r
- tinymce.ScriptLoader.add(pluginUrl+"/"+script); \r
- });\r
- },\r
-\r
- load : function(n, u, cb, s) {\r
- var t = this, url = u;\r
-\r
- function loadDependencies() {\r
- var dependencies = t.dependencies(n);\r
- tinymce.each(dependencies, function(dep) {\r
- var newUrl = t.createUrl(u, dep);\r
- t.load(newUrl.resource, newUrl, undefined, undefined);\r
- });\r
- if (cb) {\r
- if (s) {\r
- cb.call(s);\r
- } else {\r
- cb.call(tinymce.ScriptLoader);\r
- }\r
- }\r
- }\r
-\r
- if (t.urls[n])\r
- return;\r
- if (typeof u === "object")\r
- url = u.prefix + u.resource + u.suffix;\r
-\r
- if (url.indexOf('/') !== 0 && url.indexOf('://') == -1)\r
- url = tinymce.baseURL + '/' + url;\r
-\r
- t.urls[n] = url.substring(0, url.lastIndexOf('/'));\r
-\r
- if (t.lookup[n]) {\r
- loadDependencies();\r
- } else {\r
- tinymce.ScriptLoader.add(url, loadDependencies, s);\r
- }\r
- }\r
- });\r
-\r
- // Create plugin and theme managers\r
- tinymce.PluginManager = new tinymce.AddOnManager();\r
- tinymce.ThemeManager = new tinymce.AddOnManager();\r
-}(tinymce));\r
-\r
-(function(tinymce) {\r
- // Shorten names\r
- var each = tinymce.each, extend = tinymce.extend,\r
- DOM = tinymce.DOM, Event = tinymce.dom.Event,\r
- ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,\r
- explode = tinymce.explode,\r
- Dispatcher = tinymce.util.Dispatcher, undef, instanceCounter = 0;\r
-\r
- // Setup some URLs where the editor API is located and where the document is\r
- tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');\r
- if (!/[\/\\]$/.test(tinymce.documentBaseURL))\r
- tinymce.documentBaseURL += '/';\r
-\r
- tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);\r
-\r
- tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL);\r
-\r
- // Add before unload listener\r
- // This was required since IE was leaking memory if you added and removed beforeunload listeners\r
- // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event\r
- tinymce.onBeforeUnload = new Dispatcher(tinymce);\r
-\r
- // Must be on window or IE will leak if the editor is placed in frame or iframe\r
- Event.add(window, 'beforeunload', function(e) {\r
- tinymce.onBeforeUnload.dispatch(tinymce, e);\r
- });\r
-\r
- tinymce.onAddEditor = new Dispatcher(tinymce);\r
-\r
- tinymce.onRemoveEditor = new Dispatcher(tinymce);\r
-\r
- tinymce.EditorManager = extend(tinymce, {\r
- editors : [],\r
-\r
- i18n : {},\r
-\r
- activeEditor : null,\r
-\r
- init : function(s) {\r
- var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed;\r
-\r
- function createId(elm) {\r
- var id = elm.id;\r
- \r
- // Use element id, or unique name or generate a unique id\r
- if (!id) {\r
- id = elm.name;\r
- \r
- if (id && !DOM.get(id)) {\r
- id = elm.name;\r
- } else {\r
- // Generate unique name\r
- id = DOM.uniqueId();\r
- }\r
-\r
- elm.setAttribute('id', id);\r
- }\r
-\r
- return id;\r
- };\r
-\r
- function execCallback(se, n, s) {\r
- var f = se[n];\r
-\r
- if (!f)\r
- return;\r
-\r
- if (tinymce.is(f, 'string')) {\r
- s = f.replace(/\.\w+$/, '');\r
- s = s ? tinymce.resolve(s) : 0;\r
- f = tinymce.resolve(f);\r
- }\r
-\r
- return f.apply(s || this, Array.prototype.slice.call(arguments, 2));\r
- };\r
-\r
- function hasClass(n, c) {\r
- return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);\r
- };\r
-\r
- t.settings = s;\r
-\r
- // Legacy call\r
- Event.bind(window, 'ready', function() {\r
- var l, co;\r
-\r
- execCallback(s, 'onpageload');\r
-\r
- switch (s.mode) {\r
- case "exact":\r
- l = s.elements || '';\r
-\r
- if(l.length > 0) {\r
- each(explode(l), function(v) {\r
- if (DOM.get(v)) {\r
- ed = new tinymce.Editor(v, s);\r
- el.push(ed);\r
- ed.render(1);\r
- } else {\r
- each(document.forms, function(f) {\r
- each(f.elements, function(e) {\r
- if (e.name === v) {\r
- v = 'mce_editor_' + instanceCounter++;\r
- DOM.setAttrib(e, 'id', v);\r
-\r
- ed = new tinymce.Editor(v, s);\r
- el.push(ed);\r
- ed.render(1);\r
- }\r
- });\r
- });\r
- }\r
- });\r
- }\r
- break;\r
-\r
- case "textareas":\r
- case "specific_textareas":\r
- each(DOM.select('textarea'), function(elm) {\r
- if (s.editor_deselector && hasClass(elm, s.editor_deselector))\r
- return;\r
-\r
- if (!s.editor_selector || hasClass(elm, s.editor_selector)) {\r
- ed = new tinymce.Editor(createId(elm), s);\r
- el.push(ed);\r
- ed.render(1);\r
- }\r
- });\r
- break;\r
- \r
- default:\r
- if (s.types) {\r
- // Process type specific selector\r
- each(s.types, function(type) {\r
- each(DOM.select(type.selector), function(elm) {\r
- var editor = new tinymce.Editor(createId(elm), tinymce.extend({}, s, type));\r
- el.push(editor);\r
- editor.render(1);\r
- });\r
- });\r
- } else if (s.selector) {\r
- // Process global selector\r
- each(DOM.select(s.selector), function(elm) {\r
- var editor = new tinymce.Editor(createId(elm), s);\r
- el.push(editor);\r
- editor.render(1);\r
- });\r
- }\r
- }\r
-\r
- // Call onInit when all editors are initialized\r
- if (s.oninit) {\r
- l = co = 0;\r
-\r
- each(el, function(ed) {\r
- co++;\r
-\r
- if (!ed.initialized) {\r
- // Wait for it\r
- ed.onInit.add(function() {\r
- l++;\r
-\r
- // All done\r
- if (l == co)\r
- execCallback(s, 'oninit');\r
- });\r
- } else\r
- l++;\r
-\r
- // All done\r
- if (l == co)\r
- execCallback(s, 'oninit'); \r
- });\r
- }\r
- });\r
- },\r
-\r
- get : function(id) {\r
- if (id === undef)\r
- return this.editors;\r
-\r
- if (!this.editors.hasOwnProperty(id))\r
- return undef;\r
-\r
- return this.editors[id];\r
- },\r
-\r
- getInstanceById : function(id) {\r
- return this.get(id);\r
- },\r
-\r
- add : function(editor) {\r
- var self = this, editors = self.editors;\r
-\r
- // Add named and index editor instance\r
- editors[editor.id] = editor;\r
- editors.push(editor);\r
-\r
- self._setActive(editor);\r
- self.onAddEditor.dispatch(self, editor);\r
-\r
-\r
- return editor;\r
- },\r
-\r
- remove : function(editor) {\r
- var t = this, i, editors = t.editors;\r
-\r
- // Not in the collection\r
- if (!editors[editor.id])\r
- return null;\r
-\r
- delete editors[editor.id];\r
-\r
- for (i = 0; i < editors.length; i++) {\r
- if (editors[i] == editor) {\r
- editors.splice(i, 1);\r
- break;\r
- }\r
- }\r
-\r
- // Select another editor since the active one was removed\r
- if (t.activeEditor == editor)\r
- t._setActive(editors[0]);\r
-\r
- editor.destroy();\r
- t.onRemoveEditor.dispatch(t, editor);\r
-\r
- return editor;\r
- },\r
-\r
- execCommand : function(c, u, v) {\r
- var t = this, ed = t.get(v), w;\r
-\r
- function clr() {\r
- ed.destroy();\r
- w.detachEvent('onunload', clr);\r
- w = w.tinyMCE = w.tinymce = null; // IE leak\r
- };\r
-\r
- // Manager commands\r
- switch (c) {\r
- case "mceFocus":\r
- ed.focus();\r
- return true;\r
-\r
- case "mceAddEditor":\r
- case "mceAddControl":\r
- if (!t.get(v))\r
- new tinymce.Editor(v, t.settings).render();\r
-\r
- return true;\r
-\r
- case "mceAddFrameControl":\r
- w = v.window;\r
-\r
- // Add tinyMCE global instance and tinymce namespace to specified window\r
- w.tinyMCE = tinyMCE;\r
- w.tinymce = tinymce;\r
-\r
- tinymce.DOM.doc = w.document;\r
- tinymce.DOM.win = w;\r
-\r
- ed = new tinymce.Editor(v.element_id, v);\r
- ed.render();\r
-\r
- // Fix IE memory leaks\r
- if (tinymce.isIE) {\r
- w.attachEvent('onunload', clr);\r
- }\r
-\r
- v.page_window = null;\r
-\r
- return true;\r
-\r
- case "mceRemoveEditor":\r
- case "mceRemoveControl":\r
- if (ed)\r
- ed.remove();\r
-\r
- return true;\r
-\r
- case 'mceToggleEditor':\r
- if (!ed) {\r
- t.execCommand('mceAddControl', 0, v);\r
- return true;\r
- }\r
-\r
- if (ed.isHidden())\r
- ed.show();\r
- else\r
- ed.hide();\r
-\r
- return true;\r
- }\r
-\r
- // Run command on active editor\r
- if (t.activeEditor)\r
- return t.activeEditor.execCommand(c, u, v);\r
-\r
- return false;\r
- },\r
-\r
- execInstanceCommand : function(id, c, u, v) {\r
- var ed = this.get(id);\r
-\r
- if (ed)\r
- return ed.execCommand(c, u, v);\r
-\r
- return false;\r
- },\r
-\r
- triggerSave : function() {\r
- each(this.editors, function(e) {\r
- e.save();\r
- });\r
- },\r
-\r
- addI18n : function(p, o) {\r
- var lo, i18n = this.i18n;\r
-\r
- if (!tinymce.is(p, 'string')) {\r
- each(p, function(o, lc) {\r
- each(o, function(o, g) {\r
- each(o, function(o, k) {\r
- if (g === 'common')\r
- i18n[lc + '.' + k] = o;\r
- else\r
- i18n[lc + '.' + g + '.' + k] = o;\r
- });\r
- });\r
- });\r
- } else {\r
- each(o, function(o, k) {\r
- i18n[p + '.' + k] = o;\r
- });\r
- }\r
- },\r
-\r
- // Private methods\r
-\r
- _setActive : function(editor) {\r
- this.selectedInstance = this.activeEditor = editor;\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- // Shorten these names\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend,\r
- each = tinymce.each, isGecko = tinymce.isGecko,\r
- isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is,\r
- ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,\r
- explode = tinymce.explode;\r
-\r
- tinymce.create('tinymce.Editor', {\r
- Editor : function(id, settings) {\r
- var self = this, TRUE = true;\r
-\r
- self.settings = settings = extend({\r
- id : id,\r
- language : 'en',\r
- theme : 'advanced',\r
- skin : 'default',\r
- delta_width : 0,\r
- delta_height : 0,\r
- popup_css : '',\r
- plugins : '',\r
- document_base_url : tinymce.documentBaseURL,\r
- add_form_submit_trigger : TRUE,\r
- submit_patch : TRUE,\r
- add_unload_trigger : TRUE,\r
- convert_urls : TRUE,\r
- relative_urls : TRUE,\r
- remove_script_host : TRUE,\r
- table_inline_editing : false,\r
- object_resizing : TRUE,\r
- accessibility_focus : TRUE,\r
- doctype : tinymce.isIE6 ? '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' : '<!DOCTYPE>', // Use old doctype on IE 6 to avoid horizontal scroll\r
- visual : TRUE,\r
- font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',\r
- font_size_legacy_values : 'xx-small,small,medium,large,x-large,xx-large,300%', // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size\r
- apply_source_formatting : TRUE,\r
- directionality : 'ltr',\r
- forced_root_block : 'p',\r
- hidden_input : TRUE,\r
- padd_empty_editor : TRUE,\r
- render_ui : TRUE,\r
- indentation : '30px',\r
- fix_table_elements : TRUE,\r
- inline_styles : TRUE,\r
- convert_fonts_to_spans : TRUE,\r
- indent : 'simple',\r
- indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',\r
- indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',\r
- validate : TRUE,\r
- entity_encoding : 'named',\r
- url_converter : self.convertURL,\r
- url_converter_scope : self,\r
- ie7_compat : TRUE\r
- }, settings);\r
-\r
- self.id = self.editorId = id;\r
-\r
- self.isNotDirty = false;\r
-\r
- self.plugins = {};\r
-\r
- self.documentBaseURI = new tinymce.util.URI(settings.document_base_url || tinymce.documentBaseURL, {\r
- base_uri : tinyMCE.baseURI\r
- });\r
-\r
- self.baseURI = tinymce.baseURI;\r
-\r
- self.contentCSS = [];\r
-\r
- self.contentStyles = [];\r
-\r
- // Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic\r
- self.setupEvents();\r
-\r
- // Internal command handler objects\r
- self.execCommands = {};\r
- self.queryStateCommands = {};\r
- self.queryValueCommands = {};\r
-\r
- // Call setup\r
- self.execCallback('setup', self);\r
- },\r
-\r
- render : function(nst) {\r
- var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader;\r
-\r
- // Page is not loaded yet, wait for it\r
- if (!Event.domLoaded) {\r
- Event.add(window, 'ready', function() {\r
- t.render();\r
- });\r
- return;\r
- }\r
-\r
- tinyMCE.settings = s;\r
-\r
- // Element not found, then skip initialization\r
- if (!t.getElement())\r
- return;\r
-\r
- // Is a iPad/iPhone and not on iOS5, then skip initialization. We need to sniff \r
- // here since the browser says it has contentEditable support but there is no visible caret.\r
- if (tinymce.isIDevice && !tinymce.isIOS5)\r
- return;\r
-\r
- // Add hidden input for non input elements inside form elements\r
- if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form'))\r
- DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id);\r
-\r
- // Hide target element early to prevent content flashing\r
- if (!s.content_editable) {\r
- t.orgVisibility = t.getElement().style.visibility;\r
- t.getElement().style.visibility = 'hidden';\r
- }\r
-\r
- if (tinymce.WindowManager)\r
- t.windowManager = new tinymce.WindowManager(t);\r
-\r
- if (s.encoding == 'xml') {\r
- t.onGetContent.add(function(ed, o) {\r
- if (o.save)\r
- o.content = DOM.encode(o.content);\r
- });\r
- }\r
-\r
- if (s.add_form_submit_trigger) {\r
- t.onSubmit.addToTop(function() {\r
- if (t.initialized) {\r
- t.save();\r
- t.isNotDirty = 1;\r
- }\r
- });\r
- }\r
-\r
- if (s.add_unload_trigger) {\r
- t._beforeUnload = tinyMCE.onBeforeUnload.add(function() {\r
- if (t.initialized && !t.destroyed && !t.isHidden())\r
- t.save({format : 'raw', no_events : true});\r
- });\r
- }\r
-\r
- tinymce.addUnload(t.destroy, t);\r
-\r
- if (s.submit_patch) {\r
- t.onBeforeRenderUI.add(function() {\r
- var n = t.getElement().form;\r
-\r
- if (!n)\r
- return;\r
-\r
- // Already patched\r
- if (n._mceOldSubmit)\r
- return;\r
-\r
- // Check page uses id="submit" or name="submit" for it's submit button\r
- if (!n.submit.nodeType && !n.submit.length) {\r
- t.formElement = n;\r
- n._mceOldSubmit = n.submit;\r
- n.submit = function() {\r
- // Save all instances\r
- tinymce.triggerSave();\r
- t.isNotDirty = 1;\r
-\r
- return t.formElement._mceOldSubmit(t.formElement);\r
- };\r
- }\r
-\r
- n = null;\r
- });\r
- }\r
-\r
- // Load scripts\r
- function loadScripts() {\r
- if (s.language && s.language_load !== false)\r
- sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');\r
-\r
- if (s.theme && typeof s.theme != "function" && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])\r
- ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');\r
-\r
- each(explode(s.plugins), function(p) {\r
- if (p &&!PluginManager.urls[p]) {\r
- if (p.charAt(0) == '-') {\r
- p = p.substr(1, p.length);\r
- var dependencies = PluginManager.dependencies(p);\r
- each(dependencies, function(dep) {\r
- var defaultSettings = {prefix:'plugins/', resource: dep, suffix:'/editor_plugin' + tinymce.suffix + '.js'};\r
- dep = PluginManager.createUrl(defaultSettings, dep);\r
- PluginManager.load(dep.resource, dep);\r
- });\r
- } else {\r
- // Skip safari plugin, since it is removed as of 3.3b1\r
- if (p == 'safari') {\r
- return;\r
- }\r
- PluginManager.load(p, {prefix:'plugins/', resource: p, suffix:'/editor_plugin' + tinymce.suffix + '.js'});\r
- }\r
- }\r
- });\r
-\r
- // Init when que is loaded\r
- sl.loadQueue(function() {\r
- if (!t.removed)\r
- t.init();\r
- });\r
- };\r
-\r
- loadScripts();\r
- },\r
-\r
- init : function() {\r
- var n, t = this, s = t.settings, w, h, mh, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = [];\r
-\r
- tinymce.add(t);\r
-\r
- s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area'));\r
-\r
- if (s.theme) {\r
- if (typeof s.theme != "function") {\r
- s.theme = s.theme.replace(/-/, '');\r
- o = ThemeManager.get(s.theme);\r
- t.theme = new o();\r
-\r
- if (t.theme.init)\r
- t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));\r
- } else {\r
- t.theme = s.theme;\r
- }\r
- }\r
-\r
- function initPlugin(p) {\r
- var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po;\r
- if (c && tinymce.inArray(initializedPlugins,p) === -1) {\r
- each(PluginManager.dependencies(p), function(dep){\r
- initPlugin(dep);\r
- });\r
- po = new c(t, u);\r
-\r
- t.plugins[p] = po;\r
-\r
- if (po.init) {\r
- po.init(t, u);\r
- initializedPlugins.push(p);\r
- }\r
- }\r
- }\r
- \r
- // Create all plugins\r
- each(explode(s.plugins.replace(/\-/g, '')), initPlugin);\r
-\r
- // Setup popup CSS path(s)\r
- if (s.popup_css !== false) {\r
- if (s.popup_css)\r
- s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css);\r
- else\r
- s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css");\r
- }\r
-\r
- if (s.popup_css_add)\r
- s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add);\r
-\r
- t.controlManager = new tinymce.ControlManager(t);\r
-\r
- // Enables users to override the control factory\r
- t.onBeforeRenderUI.dispatch(t, t.controlManager);\r
-\r
- // Measure box\r
- if (s.render_ui && t.theme) {\r
- t.orgDisplay = e.style.display;\r
-\r
- if (typeof s.theme != "function") {\r
- w = s.width || e.style.width || e.offsetWidth;\r
- h = s.height || e.style.height || e.offsetHeight;\r
- mh = s.min_height || 100;\r
- re = /^[0-9\.]+(|px)$/i;\r
-\r
- if (re.test('' + w))\r
- w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100);\r
-\r
- if (re.test('' + h))\r
- h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), mh);\r
-\r
- // Render UI\r
- o = t.theme.renderUI({\r
- targetNode : e,\r
- width : w,\r
- height : h,\r
- deltaWidth : s.delta_width,\r
- deltaHeight : s.delta_height\r
- });\r
-\r
- // Resize editor\r
- DOM.setStyles(o.sizeContainer || o.editorContainer, {\r
- width : w,\r
- height : h\r
- });\r
-\r
- h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');\r
- if (h < mh)\r
- h = mh;\r
- } else {\r
- o = s.theme(t, e);\r
-\r
- // Convert element type to id:s\r
- if (o.editorContainer.nodeType) {\r
- o.editorContainer = o.editorContainer.id = o.editorContainer.id || t.id + "_parent";\r
- }\r
-\r
- // Convert element type to id:s\r
- if (o.iframeContainer.nodeType) {\r
- o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || t.id + "_iframecontainer";\r
- }\r
-\r
- // Use specified iframe height or the targets offsetHeight\r
- h = o.iframeHeight || e.offsetHeight;\r
-\r
- // Store away the selection when it's changed to it can be restored later with a editor.focus() call\r
- if (isIE) {\r
- t.onInit.add(function(ed) {\r
- ed.dom.bind(ed.getBody(), 'beforedeactivate keydown', function() {\r
- ed.lastIERng = ed.selection.getRng();\r
- });\r
- });\r
- }\r
- }\r
-\r
- t.editorContainer = o.editorContainer;\r
- }\r
-\r
- // Load specified content CSS last\r
- if (s.content_css) {\r
- each(explode(s.content_css), function(u) {\r
- t.contentCSS.push(t.documentBaseURI.toAbsolute(u));\r
- });\r
- }\r
-\r
- // Load specified content CSS last\r
- if (s.content_style) {\r
- t.contentStyles.push(s.content_style);\r
- }\r
-\r
- // Content editable mode ends here\r
- if (s.content_editable) {\r
- e = n = o = null; // Fix IE leak\r
- return t.initContentBody();\r
- }\r
-\r
- // User specified a document.domain value\r
- if (document.domain && location.hostname != document.domain)\r
- tinymce.relaxedDomain = document.domain;\r
-\r
- t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml">';\r
-\r
- // We only need to override paths if we have to\r
- // IE has a bug where it remove site absolute urls to relative ones if this is specified\r
- if (s.document_base_url != tinymce.documentBaseURL)\r
- t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />';\r
-\r
- // IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode.\r
- if (tinymce.isIE8) {\r
- if (s.ie7_compat)\r
- t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';\r
- else\r
- t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=edge" />';\r
- }\r
-\r
- t.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';\r
-\r
- // Load the CSS by injecting them into the HTML this will reduce "flicker"\r
- for (i = 0; i < t.contentCSS.length; i++) {\r
- t.iframeHTML += '<link type="text/css" rel="stylesheet" href="' + t.contentCSS[i] + '" />';\r
- }\r
-\r
- t.contentCSS = [];\r
-\r
- bi = s.body_id || 'tinymce';\r
- if (bi.indexOf('=') != -1) {\r
- bi = t.getParam('body_id', '', 'hash');\r
- bi = bi[t.id] || bi;\r
- }\r
-\r
- bc = s.body_class || '';\r
- if (bc.indexOf('=') != -1) {\r
- bc = t.getParam('body_class', '', 'hash');\r
- bc = bc[t.id] || '';\r
- }\r
-\r
- t.iframeHTML += '</head><body id="' + bi + '" class="mceContentBody ' + bc + '" onload="window.parent.tinyMCE.get(\'' + t.id + '\').onLoad.dispatch();"><br></body></html>';\r
-\r
- // Domain relaxing enabled, then set document domain\r
- if (tinymce.relaxedDomain && (isIE || (tinymce.isOpera && parseFloat(opera.version()) < 11))) {\r
- // We need to write the contents here in IE since multiple writes messes up refresh button and back button\r
- u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()';\r
- }\r
-\r
- // Create iframe\r
- // TODO: ACC add the appropriate description on this.\r
- n = DOM.add(o.iframeContainer, 'iframe', { \r
- id : t.id + "_ifr",\r
- src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7\r
- frameBorder : '0',\r
- allowTransparency : "true",\r
- title : s.aria_label,\r
- style : {\r
- width : '100%',\r
- height : h,\r
- display : 'block' // Important for Gecko to render the iframe correctly\r
- }\r
- });\r
-\r
- t.contentAreaContainer = o.iframeContainer;\r
-\r
- if (o.editorContainer) {\r
- DOM.get(o.editorContainer).style.display = t.orgDisplay;\r
- }\r
-\r
- // Restore visibility on target element\r
- e.style.visibility = t.orgVisibility;\r
-\r
- DOM.get(t.id).style.display = 'none';\r
- DOM.setAttrib(t.id, 'aria-hidden', true);\r
-\r
- if (!tinymce.relaxedDomain || !u)\r
- t.initContentBody();\r
-\r
- e = n = o = null; // Cleanup\r
- },\r
-\r
- initContentBody : function() {\r
- var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), html, body, contentCssText;\r
-\r
- // Setup iframe body\r
- if ((!isIE || !tinymce.relaxedDomain) && !settings.content_editable) {\r
- doc.open();\r
- doc.write(self.iframeHTML);\r
- doc.close();\r
-\r
- if (tinymce.relaxedDomain)\r
- doc.domain = tinymce.relaxedDomain;\r
- }\r
-\r
- if (settings.content_editable) {\r
- DOM.addClass(targetElm, 'mceContentBody');\r
- self.contentDocument = doc = settings.content_document || document;\r
- self.contentWindow = settings.content_window || window;\r
- self.bodyElement = targetElm;\r
-\r
- // Prevent leak in IE\r
- settings.content_document = settings.content_window = null;\r
- }\r
-\r
- // It will not steal focus while setting contentEditable\r
- body = self.getBody();\r
- body.disabled = true;\r
-\r
- if (!settings.readonly)\r
- body.contentEditable = self.getParam('content_editable_state', true);\r
-\r
- body.disabled = false;\r
-\r
- self.schema = new tinymce.html.Schema(settings);\r
-\r
- self.dom = new tinymce.dom.DOMUtils(doc, {\r
- keep_values : true,\r
- url_converter : self.convertURL,\r
- url_converter_scope : self,\r
- hex_colors : settings.force_hex_style_colors,\r
- class_filter : settings.class_filter,\r
- update_styles : true,\r
- root_element : settings.content_editable ? self.id : null,\r
- schema : self.schema\r
- });\r
-\r
- self.parser = new tinymce.html.DomParser(settings, self.schema);\r
-\r
- // Convert src and href into data-mce-src, data-mce-href and data-mce-style\r
- self.parser.addAttributeFilter('src,href,style', function(nodes, name) {\r
- var i = nodes.length, node, dom = self.dom, value, internalName;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- value = node.attr(name);\r
- internalName = 'data-mce-' + name;\r
-\r
- // Add internal attribute if we need to we don't on a refresh of the document\r
- if (!node.attributes.map[internalName]) { \r
- if (name === "style")\r
- node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name));\r
- else\r
- node.attr(internalName, self.convertURL(value, name, node.name));\r
- }\r
- }\r
- });\r
-\r
- // Keep scripts from executing\r
- self.parser.addNodeFilter('script', function(nodes, name) {\r
- var i = nodes.length, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript'));\r
- }\r
- });\r
-\r
- self.parser.addNodeFilter('#cdata', function(nodes, name) {\r
- var i = nodes.length, node;\r
-\r
- while (i--) {\r
- node = nodes[i];\r
- node.type = 8;\r
- node.name = '#comment';\r
- node.value = '[CDATA[' + node.value + ']]';\r
- }\r
- });\r
-\r
- self.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) {\r
- var i = nodes.length, node, nonEmptyElements = self.schema.getNonEmptyElements();\r
-\r
- while (i--) {\r
- node = nodes[i];\r
-\r
- if (node.isEmpty(nonEmptyElements))\r
- node.empty().append(new tinymce.html.Node('br', 1)).shortEnded = true;\r
- }\r
- });\r
-\r
- self.serializer = new tinymce.dom.Serializer(settings, self.dom, self.schema);\r
-\r
- self.selection = new tinymce.dom.Selection(self.dom, self.getWin(), self.serializer, self);\r
-\r
- self.formatter = new tinymce.Formatter(self);\r
-\r
- self.undoManager = new tinymce.UndoManager(self);\r
-\r
- self.forceBlocks = new tinymce.ForceBlocks(self);\r
- self.enterKey = new tinymce.EnterKey(self);\r
- self.editorCommands = new tinymce.EditorCommands(self);\r
-\r
- self.onExecCommand.add(function(editor, command) {\r
- // Don't refresh the select lists until caret move\r
- if (!/^(FontName|FontSize)$/.test(command))\r
- self.nodeChanged();\r
- });\r
-\r
- // Pass through\r
- self.serializer.onPreProcess.add(function(se, o) {\r
- return self.onPreProcess.dispatch(self, o, se);\r
- });\r
-\r
- self.serializer.onPostProcess.add(function(se, o) {\r
- return self.onPostProcess.dispatch(self, o, se);\r
- });\r
-\r
- self.onPreInit.dispatch(self);\r
-\r
- if (!settings.browser_spellcheck && !settings.gecko_spellcheck)\r
- doc.body.spellcheck = false;\r
-\r
- if (!settings.readonly) {\r
- self.bindNativeEvents();\r
- }\r
-\r
- self.controlManager.onPostRender.dispatch(self, self.controlManager);\r
- self.onPostRender.dispatch(self);\r
-\r
- self.quirks = tinymce.util.Quirks(self);\r
-\r
- if (settings.directionality)\r
- body.dir = settings.directionality;\r
-\r
- if (settings.nowrap)\r
- body.style.whiteSpace = "nowrap";\r
-\r
- if (settings.protect) {\r
- self.onBeforeSetContent.add(function(ed, o) {\r
- each(settings.protect, function(pattern) {\r
- o.content = o.content.replace(pattern, function(str) {\r
- return '<!--mce:protected ' + escape(str) + '-->';\r
- });\r
- });\r
- });\r
- }\r
-\r
- // Add visual aids when new contents is added\r
- self.onSetContent.add(function() {\r
- self.addVisual(self.getBody());\r
- });\r
-\r
- // Remove empty contents\r
- if (settings.padd_empty_editor) {\r
- self.onPostProcess.add(function(ed, o) {\r
- o.content = o.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');\r
- });\r
- }\r
-\r
- self.load({initial : true, format : 'html'});\r
- self.startContent = self.getContent({format : 'raw'});\r
-\r
- self.initialized = true;\r
-\r
- self.onInit.dispatch(self);\r
- self.execCallback('setupcontent_callback', self.id, body, doc);\r
- self.execCallback('init_instance_callback', self);\r
- self.focus(true);\r
- self.nodeChanged({initial : true});\r
-\r
- // Add editor specific CSS styles\r
- if (self.contentStyles.length > 0) {\r
- contentCssText = '';\r
-\r
- each(self.contentStyles, function(style) {\r
- contentCssText += style + "\r\n";\r
- });\r
-\r
- self.dom.addStyle(contentCssText);\r
- }\r
-\r
- // Load specified content CSS last\r
- each(self.contentCSS, function(url) {\r
- self.dom.loadCSS(url);\r
- });\r
-\r
- // Handle auto focus\r
- if (settings.auto_focus) {\r
- setTimeout(function () {\r
- var ed = tinymce.get(settings.auto_focus);\r
-\r
- ed.selection.select(ed.getBody(), 1);\r
- ed.selection.collapse(1);\r
- ed.getBody().focus();\r
- ed.getWin().focus();\r
- }, 100);\r
- }\r
-\r
- // Clean up references for IE\r
- targetElm = doc = body = null;\r
- },\r
-\r
- focus : function(skip_focus) {\r
- var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, ieRng, controlElm, doc = self.getDoc(), body;\r
-\r
- if (!skip_focus) {\r
- if (self.lastIERng) {\r
- selection.setRng(self.lastIERng);\r
- }\r
-\r
- // Get selected control element\r
- ieRng = selection.getRng();\r
- if (ieRng.item) {\r
- controlElm = ieRng.item(0);\r
- }\r
-\r
- self._refreshContentEditable();\r
-\r
- // Focus the window iframe\r
- if (!contentEditable) {\r
- self.getWin().focus();\r
- }\r
-\r
- // Focus the body as well since it's contentEditable\r
- if (tinymce.isGecko || contentEditable) {\r
- body = self.getBody();\r
-\r
- // Check for setActive since it doesn't scroll to the element\r
- if (body.setActive) {\r
- body.setActive();\r
- } else {\r
- body.focus();\r
- }\r
-\r
- if (contentEditable) {\r
- selection.normalize();\r
- }\r
- }\r
-\r
- // Restore selected control element\r
- // This is needed when for example an image is selected within a\r
- // layer a call to focus will then remove the control selection\r
- if (controlElm && controlElm.ownerDocument == doc) {\r
- ieRng = doc.body.createControlRange();\r
- ieRng.addElement(controlElm);\r
- ieRng.select();\r
- }\r
- }\r
-\r
- if (tinymce.activeEditor != self) {\r
- if ((oed = tinymce.activeEditor) != null)\r
- oed.onDeactivate.dispatch(oed, self);\r
-\r
- self.onActivate.dispatch(self, oed);\r
- }\r
-\r
- tinymce._setActive(self);\r
- },\r
-\r
- execCallback : function(n) {\r
- var t = this, f = t.settings[n], s;\r
-\r
- if (!f)\r
- return;\r
-\r
- // Look through lookup\r
- if (t.callbackLookup && (s = t.callbackLookup[n])) {\r
- f = s.func;\r
- s = s.scope;\r
- }\r
-\r
- if (is(f, 'string')) {\r
- s = f.replace(/\.\w+$/, '');\r
- s = s ? tinymce.resolve(s) : 0;\r
- f = tinymce.resolve(f);\r
- t.callbackLookup = t.callbackLookup || {};\r
- t.callbackLookup[n] = {func : f, scope : s};\r
- }\r
-\r
- return f.apply(s || t, Array.prototype.slice.call(arguments, 1));\r
- },\r
-\r
- translate : function(s) {\r
- var c = this.settings.language || 'en', i18n = tinymce.i18n;\r
-\r
- if (!s)\r
- return '';\r
-\r
- return i18n[c + '.' + s] || s.replace(/\{\#([^\}]+)\}/g, function(a, b) {\r
- return i18n[c + '.' + b] || '{#' + b + '}';\r
- });\r
- },\r
-\r
- getLang : function(n, dv) {\r
- return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}');\r
- },\r
-\r
- getParam : function(n, dv, ty) {\r
- var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o;\r
-\r
- if (ty === 'hash') {\r
- o = {};\r
-\r
- if (is(v, 'string')) {\r
- each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) {\r
- v = v.split('=');\r
-\r
- if (v.length > 1)\r
- o[tr(v[0])] = tr(v[1]);\r
- else\r
- o[tr(v[0])] = tr(v);\r
- });\r
- } else\r
- o = v;\r
-\r
- return o;\r
- }\r
-\r
- return v;\r
- },\r
-\r
- nodeChanged : function(o) {\r
- var self = this, selection = self.selection, node;\r
-\r
- // Fix for bug #1896577 it seems that this can not be fired while the editor is loading\r
- if (self.initialized) {\r
- o = o || {};\r
-\r
- // Get start node\r
- node = selection.getStart() || self.getBody();\r
- node = isIE && node.ownerDocument != self.getDoc() ? self.getBody() : node; // Fix for IE initial state\r
-\r
- // Get parents and add them to object\r
- o.parents = [];\r
- self.dom.getParent(node, function(node) {\r
- if (node.nodeName == 'BODY')\r
- return true;\r
-\r
- o.parents.push(node);\r
- });\r
-\r
- self.onNodeChange.dispatch(\r
- self,\r
- o ? o.controlManager || self.controlManager : self.controlManager,\r
- node,\r
- selection.isCollapsed(),\r
- o\r
- );\r
- }\r
- },\r
-\r
- addButton : function(name, settings) {\r
- var self = this;\r
-\r
- self.buttons = self.buttons || {};\r
- self.buttons[name] = settings;\r
- },\r
-\r
- addCommand : function(name, callback, scope) {\r
- this.execCommands[name] = {func : callback, scope : scope || this};\r
- },\r
-\r
- addQueryStateHandler : function(name, callback, scope) {\r
- this.queryStateCommands[name] = {func : callback, scope : scope || this};\r
- },\r
-\r
- addQueryValueHandler : function(name, callback, scope) {\r
- this.queryValueCommands[name] = {func : callback, scope : scope || this};\r
- },\r
-\r
- addShortcut : function(pa, desc, cmd_func, sc) {\r
- var t = this, c;\r
-\r
- if (t.settings.custom_shortcuts === false)\r
- return false;\r
-\r
- t.shortcuts = t.shortcuts || {};\r
-\r
- if (is(cmd_func, 'string')) {\r
- c = cmd_func;\r
-\r
- cmd_func = function() {\r
- t.execCommand(c, false, null);\r
- };\r
- }\r
-\r
- if (is(cmd_func, 'object')) {\r
- c = cmd_func;\r
-\r
- cmd_func = function() {\r
- t.execCommand(c[0], c[1], c[2]);\r
- };\r
- }\r
-\r
- each(explode(pa), function(pa) {\r
- var o = {\r
- func : cmd_func,\r
- scope : sc || this,\r
- desc : t.translate(desc),\r
- alt : false,\r
- ctrl : false,\r
- shift : false\r
- };\r
-\r
- each(explode(pa, '+'), function(v) {\r
- switch (v) {\r
- case 'alt':\r
- case 'ctrl':\r
- case 'shift':\r
- o[v] = true;\r
- break;\r
-\r
- default:\r
- o.charCode = v.charCodeAt(0);\r
- o.keyCode = v.toUpperCase().charCodeAt(0);\r
- }\r
- });\r
-\r
- t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o;\r
- });\r
-\r
- return true;\r
- },\r
-\r
- execCommand : function(cmd, ui, val, a) {\r
- var t = this, s = 0, o, st;\r
-\r
- if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus))\r
- t.focus();\r
-\r
- a = extend({}, a);\r
- t.onBeforeExecCommand.dispatch(t, cmd, ui, val, a);\r
- if (a.terminate)\r
- return false;\r
-\r
- // Command callback\r
- if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) {\r
- t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
- return true;\r
- }\r
-\r
- // Registred commands\r
- if (o = t.execCommands[cmd]) {\r
- st = o.func.call(o.scope, ui, val);\r
-\r
- // Fall through on true\r
- if (st !== true) {\r
- t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
- return st;\r
- }\r
- }\r
-\r
- // Plugin commands\r
- each(t.plugins, function(p) {\r
- if (p.execCommand && p.execCommand(cmd, ui, val)) {\r
- t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
- s = 1;\r
- return false;\r
- }\r
- });\r
-\r
- if (s)\r
- return true;\r
-\r
- // Theme commands\r
- if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) {\r
- t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
- return true;\r
- }\r
-\r
- // Editor commands\r
- if (t.editorCommands.execCommand(cmd, ui, val)) {\r
- t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
- return true;\r
- }\r
-\r
- // Browser commands\r
- t.getDoc().execCommand(cmd, ui, val);\r
- t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
- },\r
-\r
- queryCommandState : function(cmd) {\r
- var t = this, o, s;\r
-\r
- // Is hidden then return undefined\r
- if (t._isHidden())\r
- return;\r
-\r
- // Registred commands\r
- if (o = t.queryStateCommands[cmd]) {\r
- s = o.func.call(o.scope);\r
-\r
- // Fall though on true\r
- if (s !== true)\r
- return s;\r
- }\r
-\r
- // Registred commands\r
- o = t.editorCommands.queryCommandState(cmd);\r
- if (o !== -1)\r
- return o;\r
-\r
- // Browser commands\r
- try {\r
- return this.getDoc().queryCommandState(cmd);\r
- } catch (ex) {\r
- // Fails sometimes see bug: 1896577\r
- }\r
- },\r
-\r
- queryCommandValue : function(c) {\r
- var t = this, o, s;\r
-\r
- // Is hidden then return undefined\r
- if (t._isHidden())\r
- return;\r
-\r
- // Registred commands\r
- if (o = t.queryValueCommands[c]) {\r
- s = o.func.call(o.scope);\r
-\r
- // Fall though on true\r
- if (s !== true)\r
- return s;\r
- }\r
-\r
- // Registred commands\r
- o = t.editorCommands.queryCommandValue(c);\r
- if (is(o))\r
- return o;\r
-\r
- // Browser commands\r
- try {\r
- return this.getDoc().queryCommandValue(c);\r
- } catch (ex) {\r
- // Fails sometimes see bug: 1896577\r
- }\r
- },\r
-\r
- show : function() {\r
- var self = this;\r
-\r
- DOM.show(self.getContainer());\r
- DOM.hide(self.id);\r
- self.load();\r
- },\r
-\r
- hide : function() {\r
- var self = this, doc = self.getDoc();\r
-\r
- // Fixed bug where IE has a blinking cursor left from the editor\r
- if (isIE && doc)\r
- doc.execCommand('SelectAll');\r
-\r
- // We must save before we hide so Safari doesn't crash\r
- self.save();\r
-\r
- // defer the call to hide to prevent an IE9 crash #4921\r
- DOM.hide(self.getContainer());\r
- DOM.setStyle(self.id, 'display', self.orgDisplay);\r
- },\r
-\r
- isHidden : function() {\r
- return !DOM.isHidden(this.id);\r
- },\r
-\r
- setProgressState : function(b, ti, o) {\r
- this.onSetProgressState.dispatch(this, b, ti, o);\r
-\r
- return b;\r
- },\r
-\r
- load : function(o) {\r
- var t = this, e = t.getElement(), h;\r
-\r
- if (e) {\r
- o = o || {};\r
- o.load = true;\r
-\r
- // Double encode existing entities in the value\r
- h = t.setContent(is(e.value) ? e.value : e.innerHTML, o);\r
- o.element = e;\r
-\r
- if (!o.no_events)\r
- t.onLoadContent.dispatch(t, o);\r
-\r
- o.element = e = null;\r
-\r
- return h;\r
- }\r
- },\r
-\r
- save : function(o) {\r
- var t = this, e = t.getElement(), h, f;\r
-\r
- if (!e || !t.initialized)\r
- return;\r
-\r
- o = o || {};\r
- o.save = true;\r
-\r
- o.element = e;\r
- h = o.content = t.getContent(o);\r
-\r
- if (!o.no_events)\r
- t.onSaveContent.dispatch(t, o);\r
-\r
- h = o.content;\r
-\r
- if (!/TEXTAREA|INPUT/i.test(e.nodeName)) {\r
- e.innerHTML = h;\r
-\r
- // Update hidden form element\r
- if (f = DOM.getParent(t.id, 'form')) {\r
- each(f.elements, function(e) {\r
- if (e.name == t.id) {\r
- e.value = h;\r
- return false;\r
- }\r
- });\r
- }\r
- } else\r
- e.value = h;\r
-\r
- o.element = e = null;\r
-\r
- return h;\r
- },\r
-\r
- setContent : function(content, args) {\r
- var self = this, rootNode, body = self.getBody(), forcedRootBlockName;\r
-\r
- // Setup args object\r
- args = args || {};\r
- args.format = args.format || 'html';\r
- args.set = true;\r
- args.content = content;\r
-\r
- // Do preprocessing\r
- if (!args.no_events)\r
- self.onBeforeSetContent.dispatch(self, args);\r
-\r
- content = args.content;\r
-\r
- // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content\r
- // It will also be impossible to place the caret in the editor unless there is a BR element present\r
- if (!tinymce.isIE && (content.length === 0 || /^\s+$/.test(content))) {\r
- forcedRootBlockName = self.settings.forced_root_block;\r
- if (forcedRootBlockName)\r
- content = '<' + forcedRootBlockName + '><br data-mce-bogus="1"></' + forcedRootBlockName + '>';\r
- else\r
- content = '<br data-mce-bogus="1">';\r
-\r
- body.innerHTML = content;\r
- self.selection.select(body, true);\r
- self.selection.collapse(true);\r
- return;\r
- }\r
-\r
- // Parse and serialize the html\r
- if (args.format !== 'raw') {\r
- content = new tinymce.html.Serializer({}, self.schema).serialize(\r
- self.parser.parse(content)\r
- );\r
- }\r
-\r
- // Set the new cleaned contents to the editor\r
- args.content = tinymce.trim(content);\r
- self.dom.setHTML(body, args.content);\r
-\r
- // Do post processing\r
- if (!args.no_events)\r
- self.onSetContent.dispatch(self, args);\r
-\r
- // Don't normalize selection if the focused element isn't the body in content editable mode since it will steal focus otherwise\r
- if (!self.settings.content_editable || document.activeElement === self.getBody()) {\r
- self.selection.normalize();\r
- }\r
-\r
- return args.content;\r
- },\r
-\r
- getContent : function(args) {\r
- var self = this, content, body = self.getBody();\r
-\r
- // Setup args object\r
- args = args || {};\r
- args.format = args.format || 'html';\r
- args.get = true;\r
- args.getInner = true;\r
-\r
- // Do preprocessing\r
- if (!args.no_events)\r
- self.onBeforeGetContent.dispatch(self, args);\r
-\r
- // Get raw contents or by default the cleaned contents\r
- if (args.format == 'raw')\r
- content = body.innerHTML;\r
- else if (args.format == 'text')\r
- content = body.innerText || body.textContent;\r
- else\r
- content = self.serializer.serialize(body, args);\r
-\r
- // Trim whitespace in beginning/end of HTML\r
- if (args.format != 'text') {\r
- args.content = tinymce.trim(content);\r
- } else {\r
- args.content = content;\r
- }\r
-\r
- // Do post processing\r
- if (!args.no_events)\r
- self.onGetContent.dispatch(self, args);\r
-\r
- return args.content;\r
- },\r
-\r
- isDirty : function() {\r
- var self = this;\r
-\r
- return tinymce.trim(self.startContent) != tinymce.trim(self.getContent({format : 'raw', no_events : 1})) && !self.isNotDirty;\r
- },\r
-\r
- getContainer : function() {\r
- var self = this;\r
-\r
- if (!self.container)\r
- self.container = DOM.get(self.editorContainer || self.id + '_parent');\r
-\r
- return self.container;\r
- },\r
-\r
- getContentAreaContainer : function() {\r
- return this.contentAreaContainer;\r
- },\r
-\r
- getElement : function() {\r
- return DOM.get(this.settings.content_element || this.id);\r
- },\r
-\r
- getWin : function() {\r
- var self = this, elm;\r
-\r
- if (!self.contentWindow) {\r
- elm = DOM.get(self.id + "_ifr");\r
-\r
- if (elm)\r
- self.contentWindow = elm.contentWindow;\r
- }\r
-\r
- return self.contentWindow;\r
- },\r
-\r
- getDoc : function() {\r
- var self = this, win;\r
-\r
- if (!self.contentDocument) {\r
- win = self.getWin();\r
-\r
- if (win)\r
- self.contentDocument = win.document;\r
- }\r
-\r
- return self.contentDocument;\r
- },\r
-\r
- getBody : function() {\r
- return this.bodyElement || this.getDoc().body;\r
- },\r
-\r
- convertURL : function(url, name, elm) {\r
- var self = this, settings = self.settings;\r
-\r
- // Use callback instead\r
- if (settings.urlconverter_callback)\r
- return self.execCallback('urlconverter_callback', url, elm, true, name);\r
-\r
- // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs\r
- if (!settings.convert_urls || (elm && elm.nodeName == 'LINK') || url.indexOf('file:') === 0)\r
- return url;\r
-\r
- // Convert to relative\r
- if (settings.relative_urls)\r
- return self.documentBaseURI.toRelative(url);\r
-\r
- // Convert to absolute\r
- url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);\r
-\r
- return url;\r
- },\r
-\r
- addVisual : function(elm) {\r
- var self = this, settings = self.settings, dom = self.dom, cls;\r
-\r
- elm = elm || self.getBody();\r
-\r
- if (!is(self.hasVisual))\r
- self.hasVisual = settings.visual;\r
-\r
- each(dom.select('table,a', elm), function(elm) {\r
- var value;\r
-\r
- switch (elm.nodeName) {\r
- case 'TABLE':\r
- cls = settings.visual_table_class || 'mceItemTable';\r
- value = dom.getAttrib(elm, 'border');\r
-\r
- if (!value || value == '0') {\r
- if (self.hasVisual)\r
- dom.addClass(elm, cls);\r
- else\r
- dom.removeClass(elm, cls);\r
- }\r
-\r
- return;\r
-\r
- case 'A':\r
- if (!dom.getAttrib(elm, 'href', false)) {\r
- value = dom.getAttrib(elm, 'name') || elm.id;\r
- cls = 'mceItemAnchor';\r
-\r
- if (value) {\r
- if (self.hasVisual)\r
- dom.addClass(elm, cls);\r
- else\r
- dom.removeClass(elm, cls);\r
- }\r
- }\r
-\r
- return;\r
- }\r
- });\r
-\r
- self.onVisualAid.dispatch(self, elm, self.hasVisual);\r
- },\r
-\r
- remove : function() {\r
- var self = this, elm = self.getContainer(), doc = self.getDoc();\r
-\r
- if (!self.removed) {\r
- self.removed = 1; // Cancels post remove event execution\r
-\r
- // Fixed bug where IE has a blinking cursor left from the editor\r
- if (isIE && doc)\r
- doc.execCommand('SelectAll');\r
-\r
- // We must save before we hide so Safari doesn't crash\r
- self.save();\r
-\r
- DOM.setStyle(self.id, 'display', self.orgDisplay);\r
-\r
- // Don't clear the window or document if content editable\r
- // is enabled since other instances might still be present\r
- if (!self.settings.content_editable) {\r
- Event.unbind(self.getWin());\r
- Event.unbind(self.getDoc());\r
- }\r
-\r
- Event.unbind(self.getBody());\r
- Event.clear(elm);\r
-\r
- self.execCallback('remove_instance_callback', self);\r
- self.onRemove.dispatch(self);\r
-\r
- // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command\r
- self.onExecCommand.listeners = [];\r
-\r
- tinymce.remove(self);\r
- DOM.remove(elm);\r
- }\r
- },\r
-\r
- destroy : function(s) {\r
- var t = this;\r
-\r
- // One time is enough\r
- if (t.destroyed)\r
- return;\r
-\r
- // We must unbind on Gecko since it would otherwise produce the pesky "attempt to run compile-and-go script on a cleared scope" message\r
- if (isGecko) {\r
- Event.unbind(t.getDoc());\r
- Event.unbind(t.getWin());\r
- Event.unbind(t.getBody());\r
- }\r
-\r
- if (!s) {\r
- tinymce.removeUnload(t.destroy);\r
- tinyMCE.onBeforeUnload.remove(t._beforeUnload);\r
-\r
- // Manual destroy\r
- if (t.theme && t.theme.destroy)\r
- t.theme.destroy();\r
-\r
- // Destroy controls, selection and dom\r
- t.controlManager.destroy();\r
- t.selection.destroy();\r
- t.dom.destroy();\r
- }\r
-\r
- if (t.formElement) {\r
- t.formElement.submit = t.formElement._mceOldSubmit;\r
- t.formElement._mceOldSubmit = null;\r
- }\r
-\r
- t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null;\r
-\r
- if (t.selection)\r
- t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null;\r
-\r
- t.destroyed = 1;\r
- },\r
-\r
- // Internal functions\r
-\r
- _refreshContentEditable : function() {\r
- var self = this, body, parent;\r
-\r
- // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again\r
- if (self._isHidden()) {\r
- body = self.getBody();\r
- parent = body.parentNode;\r
-\r
- parent.removeChild(body);\r
- parent.appendChild(body);\r
-\r
- body.focus();\r
- }\r
- },\r
-\r
- _isHidden : function() {\r
- var s;\r
-\r
- if (!isGecko)\r
- return 0;\r
-\r
- // Weird, wheres that cursor selection?\r
- s = this.selection.getSel();\r
- return (!s || !s.rangeCount || s.rangeCount === 0);\r
- }\r
- });\r
-})(tinymce);\r
-(function(tinymce) {\r
- var each = tinymce.each;\r
-\r
- tinymce.Editor.prototype.setupEvents = function() {\r
- var self = this, settings = self.settings;\r
-\r
- // Add events to the editor\r
- each([\r
- 'onPreInit',\r
-\r
- 'onBeforeRenderUI',\r
-\r
- 'onPostRender',\r
-\r
- 'onLoad',\r
-\r
- 'onInit',\r
-\r
- 'onRemove',\r
-\r
- 'onActivate',\r
-\r
- 'onDeactivate',\r
-\r
- 'onClick',\r
-\r
- 'onEvent',\r
-\r
- 'onMouseUp',\r
-\r
- 'onMouseDown',\r
-\r
- 'onDblClick',\r
-\r
- 'onKeyDown',\r
-\r
- 'onKeyUp',\r
-\r
- 'onKeyPress',\r
-\r
- 'onContextMenu',\r
-\r
- 'onSubmit',\r
-\r
- 'onReset',\r
-\r
- 'onPaste',\r
-\r
- 'onPreProcess',\r
-\r
- 'onPostProcess',\r
-\r
- 'onBeforeSetContent',\r
-\r
- 'onBeforeGetContent',\r
-\r
- 'onSetContent',\r
-\r
- 'onGetContent',\r
-\r
- 'onLoadContent',\r
-\r
- 'onSaveContent',\r
-\r
- 'onNodeChange',\r
-\r
- 'onChange',\r
-\r
- 'onBeforeExecCommand',\r
-\r
- 'onExecCommand',\r
-\r
- 'onUndo',\r
-\r
- 'onRedo',\r
-\r
- 'onVisualAid',\r
-\r
- 'onSetProgressState',\r
-\r
- 'onSetAttrib'\r
- ], function(name) {\r
- self[name] = new tinymce.util.Dispatcher(self);\r
- });\r
-\r
- // Handle legacy cleanup_callback option\r
- if (settings.cleanup_callback) {\r
- self.onBeforeSetContent.add(function(ed, o) {\r
- o.content = ed.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
- });\r
-\r
- self.onPreProcess.add(function(ed, o) {\r
- if (o.set)\r
- ed.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o);\r
-\r
- if (o.get)\r
- ed.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o);\r
- });\r
-\r
- self.onPostProcess.add(function(ed, o) {\r
- if (o.set)\r
- o.content = ed.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
-\r
- if (o.get) \r
- o.content = ed.execCallback('cleanup_callback', 'get_from_editor', o.content, o);\r
- });\r
- }\r
-\r
- // Handle legacy save_callback option\r
- if (settings.save_callback) {\r
- self.onGetContent.add(function(ed, o) {\r
- if (o.save)\r
- o.content = ed.execCallback('save_callback', ed.id, o.content, ed.getBody());\r
- });\r
- }\r
-\r
- // Handle legacy handle_event_callback option\r
- if (settings.handle_event_callback) {\r
- self.onEvent.add(function(ed, e, o) {\r
- if (self.execCallback('handle_event_callback', e, ed, o) === false) {\r
- e.preventDefault();\r
- e.stopPropagation();\r
- }\r
- });\r
- }\r
-\r
- // Handle legacy handle_node_change_callback option\r
- if (settings.handle_node_change_callback) {\r
- self.onNodeChange.add(function(ed, cm, n) {\r
- ed.execCallback('handle_node_change_callback', ed.id, n, -1, -1, true, ed.selection.isCollapsed());\r
- });\r
- }\r
-\r
- // Handle legacy save_callback option\r
- if (settings.save_callback) {\r
- self.onSaveContent.add(function(ed, o) {\r
- var h = ed.execCallback('save_callback', ed.id, o.content, ed.getBody());\r
-\r
- if (h)\r
- o.content = h;\r
- });\r
- }\r
-\r
- // Handle legacy onchange_callback option\r
- if (settings.onchange_callback) {\r
- self.onChange.add(function(ed, l) {\r
- ed.execCallback('onchange_callback', ed, l);\r
- });\r
- }\r
- };\r
-\r
- tinymce.Editor.prototype.bindNativeEvents = function() {\r
- // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset\r
- var self = this, i, settings = self.settings, dom = self.dom, nativeToDispatcherMap;\r
-\r
- nativeToDispatcherMap = {\r
- mouseup : 'onMouseUp',\r
- mousedown : 'onMouseDown',\r
- click : 'onClick',\r
- keyup : 'onKeyUp',\r
- keydown : 'onKeyDown',\r
- keypress : 'onKeyPress',\r
- submit : 'onSubmit',\r
- reset : 'onReset',\r
- contextmenu : 'onContextMenu',\r
- dblclick : 'onDblClick',\r
- paste : 'onPaste' // Doesn't work in all browsers yet\r
- };\r
-\r
- // Handler that takes a native event and sends it out to a dispatcher like onKeyDown\r
- function eventHandler(evt, args) {\r
- var type = evt.type;\r
-\r
- // Don't fire events when it's removed\r
- if (self.removed)\r
- return;\r
-\r
- // Sends the native event out to a global dispatcher then to the specific event dispatcher\r
- if (self.onEvent.dispatch(self, evt, args) !== false) {\r
- self[nativeToDispatcherMap[evt.fakeType || evt.type]].dispatch(self, evt, args);\r
- }\r
- };\r
-\r
- // Opera doesn't support focus event for contentEditable elements so we need to fake it\r
- function doOperaFocus(e) {\r
- self.focus(true);\r
- };\r
-\r
- function nodeChanged(ed, e) {\r
- // Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything\r
- if (e.keyCode != 65 || !tinymce.VK.metaKeyPressed(e)) {\r
- self.selection.normalize();\r
- }\r
-\r
- self.nodeChanged();\r
- }\r
-\r
- // Add DOM events\r
- each(nativeToDispatcherMap, function(dispatcherName, nativeName) {\r
- var root = settings.content_editable ? self.getBody() : self.getDoc();\r
-\r
- switch (nativeName) {\r
- case 'contextmenu':\r
- dom.bind(root, nativeName, eventHandler);\r
- break;\r
-\r
- case 'paste':\r
- dom.bind(self.getBody(), nativeName, eventHandler);\r
- break;\r
-\r
- case 'submit':\r
- case 'reset':\r
- dom.bind(self.getElement().form || tinymce.DOM.getParent(self.id, 'form'), nativeName, eventHandler);\r
- break;\r
-\r
- default:\r
- dom.bind(root, nativeName, eventHandler);\r
- }\r
- });\r
-\r
- // Set the editor as active when focused\r
- dom.bind(settings.content_editable ? self.getBody() : (tinymce.isGecko ? self.getDoc() : self.getWin()), 'focus', function(e) {\r
- self.focus(true);\r
- });\r
-\r
- if (settings.content_editable && tinymce.isOpera) {\r
- dom.bind(self.getBody(), 'click', doOperaFocus);\r
- dom.bind(self.getBody(), 'keydown', doOperaFocus);\r
- }\r
-\r
- // Add node change handler\r
- self.onMouseUp.add(nodeChanged);\r
-\r
- self.onKeyUp.add(function(ed, e) {\r
- var keyCode = e.keyCode;\r
-\r
- if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || keyCode == 46 || keyCode == 8 || (tinymce.isMac && (keyCode == 91 || keyCode == 93)) || e.ctrlKey)\r
- nodeChanged(ed, e);\r
- });\r
-\r
- // Add reset handler\r
- self.onReset.add(function() {\r
- self.setContent(self.startContent, {format : 'raw'});\r
- });\r
-\r
- // Add shortcuts\r
- function handleShortcut(e, execute) {\r
- if (e.altKey || e.ctrlKey || e.metaKey) {\r
- each(self.shortcuts, function(shortcut) {\r
- var ctrlState = tinymce.isMac ? e.metaKey : e.ctrlKey;\r
-\r
- if (shortcut.ctrl != ctrlState || shortcut.alt != e.altKey || shortcut.shift != e.shiftKey)\r
- return;\r
-\r
- if (e.keyCode == shortcut.keyCode || (e.charCode && e.charCode == shortcut.charCode)) {\r
- e.preventDefault();\r
-\r
- if (execute) {\r
- shortcut.func.call(shortcut.scope);\r
- }\r
-\r
- return true;\r
- }\r
- });\r
- }\r
- };\r
-\r
- self.onKeyUp.add(function(ed, e) {\r
- handleShortcut(e);\r
- });\r
-\r
- self.onKeyPress.add(function(ed, e) {\r
- handleShortcut(e);\r
- });\r
-\r
- self.onKeyDown.add(function(ed, e) {\r
- handleShortcut(e, true);\r
- });\r
-\r
- if (tinymce.isOpera) {\r
- self.onClick.add(function(ed, e) {\r
- e.preventDefault();\r
- });\r
- }\r
- };\r
-})(tinymce);\r
-(function(tinymce) {\r
- // Added for compression purposes\r
- var each = tinymce.each, undef, TRUE = true, FALSE = false;\r
-\r
- tinymce.EditorCommands = function(editor) {\r
- var dom = editor.dom,\r
- selection = editor.selection,\r
- commands = {state: {}, exec : {}, value : {}},\r
- settings = editor.settings,\r
- formatter = editor.formatter,\r
- bookmark;\r
-\r
- function execCommand(command, ui, value) {\r
- var func;\r
-\r
- command = command.toLowerCase();\r
- if (func = commands.exec[command]) {\r
- func(command, ui, value);\r
- return TRUE;\r
- }\r
-\r
- return FALSE;\r
- };\r
-\r
- function queryCommandState(command) {\r
- var func;\r
-\r
- command = command.toLowerCase();\r
- if (func = commands.state[command])\r
- return func(command);\r
-\r
- return -1;\r
- };\r
-\r
- function queryCommandValue(command) {\r
- var func;\r
-\r
- command = command.toLowerCase();\r
- if (func = commands.value[command])\r
- return func(command);\r
-\r
- return FALSE;\r
- };\r
-\r
- function addCommands(command_list, type) {\r
- type = type || 'exec';\r
-\r
- each(command_list, function(callback, command) {\r
- each(command.toLowerCase().split(','), function(command) {\r
- commands[type][command] = callback;\r
- });\r
- });\r
- };\r
-\r
- // Expose public methods\r
- tinymce.extend(this, {\r
- execCommand : execCommand,\r
- queryCommandState : queryCommandState,\r
- queryCommandValue : queryCommandValue,\r
- addCommands : addCommands\r
- });\r
-\r
- // Private methods\r
-\r
- function execNativeCommand(command, ui, value) {\r
- if (ui === undef)\r
- ui = FALSE;\r
-\r
- if (value === undef)\r
- value = null;\r
-\r
- return editor.getDoc().execCommand(command, ui, value);\r
- };\r
-\r
- function isFormatMatch(name) {\r
- return formatter.match(name);\r
- };\r
-\r
- function toggleFormat(name, value) {\r
- formatter.toggle(name, value ? {value : value} : undef);\r
- };\r
-\r
- function storeSelection(type) {\r
- bookmark = selection.getBookmark(type);\r
- };\r
-\r
- function restoreSelection() {\r
- selection.moveToBookmark(bookmark);\r
- };\r
-\r
- // Add execCommand overrides\r
- addCommands({\r
- // Ignore these, added for compatibility\r
- 'mceResetDesignMode,mceBeginUndoLevel' : function() {},\r
-\r
- // Add undo manager logic\r
- 'mceEndUndoLevel,mceAddUndoLevel' : function() {\r
- editor.undoManager.add();\r
- },\r
-\r
- 'Cut,Copy,Paste' : function(command) {\r
- var doc = editor.getDoc(), failed;\r
-\r
- // Try executing the native command\r
- try {\r
- execNativeCommand(command);\r
- } catch (ex) {\r
- // Command failed\r
- failed = TRUE;\r
- }\r
-\r
- // Present alert message about clipboard access not being available\r
- if (failed || !doc.queryCommandSupported(command)) {\r
- if (tinymce.isGecko) {\r
- editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) {\r
- if (state)\r
- open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank');\r
- });\r
- } else\r
- editor.windowManager.alert(editor.getLang('clipboard_no_support'));\r
- }\r
- },\r
-\r
- // Override unlink command\r
- unlink : function(command) {\r
- if (selection.isCollapsed())\r
- selection.select(selection.getNode());\r
-\r
- execNativeCommand(command);\r
- selection.collapse(FALSE);\r
- },\r
-\r
- // Override justify commands to use the text formatter engine\r
- 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) {\r
- var align = command.substring(7);\r
-\r
- // Remove all other alignments first\r
- each('left,center,right,full'.split(','), function(name) {\r
- if (align != name)\r
- formatter.remove('align' + name);\r
- });\r
-\r
- toggleFormat('align' + align);\r
- execCommand('mceRepaint');\r
- },\r
-\r
- // Override list commands to fix WebKit bug\r
- 'InsertUnorderedList,InsertOrderedList' : function(command) {\r
- var listElm, listParent;\r
-\r
- execNativeCommand(command);\r
-\r
- // WebKit produces lists within block elements so we need to split them\r
- // we will replace the native list creation logic to custom logic later on\r
- // TODO: Remove this when the list creation logic is removed\r
- listElm = dom.getParent(selection.getNode(), 'ol,ul');\r
- if (listElm) {\r
- listParent = listElm.parentNode;\r
-\r
- // If list is within a text block then split that block\r
- if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {\r
- storeSelection();\r
- dom.split(listParent, listElm);\r
- restoreSelection();\r
- }\r
- }\r
- },\r
-\r
- // Override commands to use the text formatter engine\r
- 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) {\r
- toggleFormat(command);\r
- },\r
-\r
- // Override commands to use the text formatter engine\r
- 'ForeColor,HiliteColor,FontName' : function(command, ui, value) {\r
- toggleFormat(command, value);\r
- },\r
-\r
- FontSize : function(command, ui, value) {\r
- var fontClasses, fontSizes;\r
-\r
- // Convert font size 1-7 to styles\r
- if (value >= 1 && value <= 7) {\r
- fontSizes = tinymce.explode(settings.font_size_style_values);\r
- fontClasses = tinymce.explode(settings.font_size_classes);\r
-\r
- if (fontClasses)\r
- value = fontClasses[value - 1] || value;\r
- else\r
- value = fontSizes[value - 1] || value;\r
- }\r
-\r
- toggleFormat(command, value);\r
- },\r
-\r
- RemoveFormat : function(command) {\r
- formatter.remove(command);\r
- },\r
-\r
- mceBlockQuote : function(command) {\r
- toggleFormat('blockquote');\r
- },\r
-\r
- FormatBlock : function(command, ui, value) {\r
- return toggleFormat(value || 'p');\r
- },\r
-\r
- mceCleanup : function() {\r
- var bookmark = selection.getBookmark();\r
-\r
- editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE});\r
-\r
- selection.moveToBookmark(bookmark);\r
- },\r
-\r
- mceRemoveNode : function(command, ui, value) {\r
- var node = value || selection.getNode();\r
-\r
- // Make sure that the body node isn't removed\r
- if (node != editor.getBody()) {\r
- storeSelection();\r
- editor.dom.remove(node, TRUE);\r
- restoreSelection();\r
- }\r
- },\r
-\r
- mceSelectNodeDepth : function(command, ui, value) {\r
- var counter = 0;\r
-\r
- dom.getParent(selection.getNode(), function(node) {\r
- if (node.nodeType == 1 && counter++ == value) {\r
- selection.select(node);\r
- return FALSE;\r
- }\r
- }, editor.getBody());\r
- },\r
-\r
- mceSelectNode : function(command, ui, value) {\r
- selection.select(value);\r
- },\r
-\r
- mceInsertContent : function(command, ui, value) {\r
- var parser, serializer, parentNode, rootNode, fragment, args,\r
- marker, nodeRect, viewPortRect, rng, node, node2, bookmarkHtml, viewportBodyElement;\r
-\r
- //selection.normalize();\r
-\r
- // Setup parser and serializer\r
- parser = editor.parser;\r
- serializer = new tinymce.html.Serializer({}, editor.schema);\r
- bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';\r
-\r
- // Run beforeSetContent handlers on the HTML to be inserted\r
- args = {content: value, format: 'html'};\r
- selection.onBeforeSetContent.dispatch(selection, args);\r
- value = args.content;\r
-\r
- // Add caret at end of contents if it's missing\r
- if (value.indexOf('{$caret}') == -1)\r
- value += '{$caret}';\r
-\r
- // Replace the caret marker with a span bookmark element\r
- value = value.replace(/\{\$caret\}/, bookmarkHtml);\r
-\r
- // Insert node maker where we will insert the new HTML and get it's parent\r
- if (!selection.isCollapsed())\r
- editor.getDoc().execCommand('Delete', false, null);\r
-\r
- parentNode = selection.getNode();\r
-\r
- // Parse the fragment within the context of the parent node\r
- args = {context : parentNode.nodeName.toLowerCase()};\r
- fragment = parser.parse(value, args);\r
-\r
- // Move the caret to a more suitable location\r
- node = fragment.lastChild;\r
- if (node.attr('id') == 'mce_marker') {\r
- marker = node;\r
-\r
- for (node = node.prev; node; node = node.walk(true)) {\r
- if (node.type == 3 || !dom.isBlock(node.name)) {\r
- node.parent.insert(marker, node, node.name === 'br');\r
- break;\r
- }\r
- }\r
- }\r
-\r
- // If parser says valid we can insert the contents into that parent\r
- if (!args.invalid) {\r
- value = serializer.serialize(fragment);\r
-\r
- // Check if parent is empty or only has one BR element then set the innerHTML of that parent\r
- node = parentNode.firstChild;\r
- node2 = parentNode.lastChild;\r
- if (!node || (node === node2 && node.nodeName === 'BR'))\r
- dom.setHTML(parentNode, value);\r
- else\r
- selection.setContent(value);\r
- } else {\r
- // If the fragment was invalid within that context then we need\r
- // to parse and process the parent it's inserted into\r
-\r
- // Insert bookmark node and get the parent\r
- selection.setContent(bookmarkHtml);\r
- parentNode = selection.getNode();\r
- rootNode = editor.getBody();\r
-\r
- // Opera will return the document node when selection is in root\r
- if (parentNode.nodeType == 9)\r
- parentNode = node = rootNode;\r
- else\r
- node = parentNode;\r
-\r
- // Find the ancestor just before the root element\r
- while (node !== rootNode) {\r
- parentNode = node;\r
- node = node.parentNode;\r
- }\r
-\r
- // Get the outer/inner HTML depending on if we are in the root and parser and serialize that\r
- value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);\r
- value = serializer.serialize(\r
- parser.parse(\r
- // Need to replace by using a function since $ in the contents would otherwise be a problem\r
- value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function() {\r
- return serializer.serialize(fragment);\r
- })\r
- )\r
- );\r
-\r
- // Set the inner/outer HTML depending on if we are in the root or not\r
- if (parentNode == rootNode)\r
- dom.setHTML(rootNode, value);\r
- else\r
- dom.setOuterHTML(parentNode, value);\r
- }\r
-\r
- marker = dom.get('mce_marker');\r
-\r
- // Scroll range into view scrollIntoView on element can't be used since it will scroll the main view port as well\r
- nodeRect = dom.getRect(marker);\r
- viewPortRect = dom.getViewPort(editor.getWin());\r
-\r
- // Check if node is out side the viewport if it is then scroll to it\r
- if ((nodeRect.y + nodeRect.h > viewPortRect.y + viewPortRect.h || nodeRect.y < viewPortRect.y) ||\r
- (nodeRect.x > viewPortRect.x + viewPortRect.w || nodeRect.x < viewPortRect.x)) {\r
- viewportBodyElement = tinymce.isIE ? editor.getDoc().documentElement : editor.getBody();\r
- viewportBodyElement.scrollLeft = nodeRect.x;\r
- viewportBodyElement.scrollTop = nodeRect.y - viewPortRect.h + 25;\r
- }\r
-\r
- // Move selection before marker and remove it\r
- rng = dom.createRng();\r
-\r
- // If previous sibling is a text node set the selection to the end of that node\r
- node = marker.previousSibling;\r
- if (node && node.nodeType == 3) {\r
- rng.setStart(node, node.nodeValue.length);\r
- } else {\r
- // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node\r
- rng.setStartBefore(marker);\r
- rng.setEndBefore(marker);\r
- }\r
-\r
- // Remove the marker node and set the new range\r
- dom.remove(marker);\r
- selection.setRng(rng);\r
-\r
- // Dispatch after event and add any visual elements needed\r
- selection.onSetContent.dispatch(selection, args);\r
- editor.addVisual();\r
- },\r
-\r
- mceInsertRawHTML : function(command, ui, value) {\r
- selection.setContent('tiny_mce_marker');\r
- editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value }));\r
- },\r
-\r
- mceToggleFormat : function(command, ui, value) {\r
- toggleFormat(value);\r
- },\r
-\r
- mceSetContent : function(command, ui, value) {\r
- editor.setContent(value);\r
- },\r
-\r
- 'Indent,Outdent' : function(command) {\r
- var intentValue, indentUnit, value;\r
-\r
- // Setup indent level\r
- intentValue = settings.indentation;\r
- indentUnit = /[a-z%]+$/i.exec(intentValue);\r
- intentValue = parseInt(intentValue);\r
-\r
- if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) {\r
- // If forced_root_blocks is set to false we don't have a block to indent so lets create a div\r
- if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) {\r
- formatter.apply('div');\r
- }\r
-\r
- each(selection.getSelectedBlocks(), function(element) {\r
- if (command == 'outdent') {\r
- value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue);\r
- dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : '');\r
- } else\r
- dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit);\r
- });\r
- } else\r
- execNativeCommand(command);\r
- },\r
-\r
- mceRepaint : function() {\r
- var bookmark;\r
-\r
- if (tinymce.isGecko) {\r
- try {\r
- storeSelection(TRUE);\r
-\r
- if (selection.getSel())\r
- selection.getSel().selectAllChildren(editor.getBody());\r
-\r
- selection.collapse(TRUE);\r
- restoreSelection();\r
- } catch (ex) {\r
- // Ignore\r
- }\r
- }\r
- },\r
-\r
- mceToggleFormat : function(command, ui, value) {\r
- formatter.toggle(value);\r
- },\r
-\r
- InsertHorizontalRule : function() {\r
- editor.execCommand('mceInsertContent', false, '<hr />');\r
- },\r
-\r
- mceToggleVisualAid : function() {\r
- editor.hasVisual = !editor.hasVisual;\r
- editor.addVisual();\r
- },\r
-\r
- mceReplaceContent : function(command, ui, value) {\r
- editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'})));\r
- },\r
-\r
- mceInsertLink : function(command, ui, value) {\r
- var anchor;\r
-\r
- if (typeof(value) == 'string')\r
- value = {href : value};\r
-\r
- anchor = dom.getParent(selection.getNode(), 'a');\r
-\r
- // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here.\r
- value.href = value.href.replace(' ', '%20');\r
-\r
- // Remove existing links if there could be child links or that the href isn't specified\r
- if (!anchor || !value.href) {\r
- formatter.remove('link');\r
- } \r
-\r
- // Apply new link to selection\r
- if (value.href) {\r
- formatter.apply('link', value, anchor);\r
- }\r
- },\r
-\r
- selectAll : function() {\r
- var root = dom.getRoot(), rng = dom.createRng();\r
-\r
- // Old IE does a better job with selectall than new versions\r
- if (selection.getRng().setStart) {\r
- rng.setStart(root, 0);\r
- rng.setEnd(root, root.childNodes.length);\r
-\r
- selection.setRng(rng);\r
- } else {\r
- execNativeCommand('SelectAll');\r
- }\r
- }\r
- });\r
-\r
- // Add queryCommandState overrides\r
- addCommands({\r
- // Override justify commands\r
- 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) {\r
- var name = 'align' + command.substring(7);\r
- var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks();\r
- var matches = tinymce.map(nodes, function(node) {\r
- return !!formatter.matchNode(node, name);\r
- });\r
- return tinymce.inArray(matches, TRUE) !== -1;\r
- },\r
-\r
- 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) {\r
- return isFormatMatch(command);\r
- },\r
-\r
- mceBlockQuote : function() {\r
- return isFormatMatch('blockquote');\r
- },\r
-\r
- Outdent : function() {\r
- var node;\r
-\r
- if (settings.inline_styles) {\r
- if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0)\r
- return TRUE;\r
-\r
- if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0)\r
- return TRUE;\r
- }\r
-\r
- return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE'));\r
- },\r
-\r
- 'InsertUnorderedList,InsertOrderedList' : function(command) {\r
- var list = dom.getParent(selection.getNode(), 'ul,ol');\r
- return list && \r
- (command === 'insertunorderedlist' && list.tagName === 'UL'\r
- || command === 'insertorderedlist' && list.tagName === 'OL');\r
- }\r
- }, 'state');\r
-\r
- // Add queryCommandValue overrides\r
- addCommands({\r
- 'FontSize,FontName' : function(command) {\r
- var value = 0, parent;\r
-\r
- if (parent = dom.getParent(selection.getNode(), 'span')) {\r
- if (command == 'fontsize')\r
- value = parent.style.fontSize;\r
- else\r
- value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();\r
- }\r
-\r
- return value;\r
- }\r
- }, 'value');\r
-\r
- // Add undo manager logic\r
- addCommands({\r
- Undo : function() {\r
- editor.undoManager.undo();\r
- },\r
-\r
- Redo : function() {\r
- editor.undoManager.redo();\r
- }\r
- });\r
- };\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var Dispatcher = tinymce.util.Dispatcher;\r
-\r
- tinymce.UndoManager = function(editor) {\r
- var self, index = 0, data = [], beforeBookmark, onAdd, onUndo, onRedo;\r
-\r
- function getContent() {\r
- // Remove whitespace before/after and remove pure bogus nodes\r
- return tinymce.trim(editor.getContent({format : 'raw', no_events : 1}).replace(/<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g, ''));\r
- };\r
-\r
- function addNonTypingUndoLevel() {\r
- self.typing = false;\r
- self.add();\r
- };\r
-\r
- // Create event instances\r
- onBeforeAdd = new Dispatcher(self);\r
- onAdd = new Dispatcher(self);\r
- onUndo = new Dispatcher(self);\r
- onRedo = new Dispatcher(self);\r
-\r
- // Pass though onAdd event from UndoManager to Editor as onChange\r
- onAdd.add(function(undoman, level) {\r
- if (undoman.hasUndo())\r
- return editor.onChange.dispatch(editor, level, undoman);\r
- });\r
-\r
- // Pass though onUndo event from UndoManager to Editor\r
- onUndo.add(function(undoman, level) {\r
- return editor.onUndo.dispatch(editor, level, undoman);\r
- });\r
-\r
- // Pass though onRedo event from UndoManager to Editor\r
- onRedo.add(function(undoman, level) {\r
- return editor.onRedo.dispatch(editor, level, undoman);\r
- });\r
-\r
- // Add initial undo level when the editor is initialized\r
- editor.onInit.add(function() {\r
- self.add();\r
- });\r
-\r
- // Get position before an execCommand is processed\r
- editor.onBeforeExecCommand.add(function(ed, cmd, ui, val, args) {\r
- if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!args || !args.skip_undo)) {\r
- self.beforeChange();\r
- }\r
- });\r
-\r
- // Add undo level after an execCommand call was made\r
- editor.onExecCommand.add(function(ed, cmd, ui, val, args) {\r
- if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!args || !args.skip_undo)) {\r
- self.add();\r
- }\r
- });\r
-\r
- // Add undo level on save contents, drag end and blur/focusout\r
- editor.onSaveContent.add(addNonTypingUndoLevel);\r
- editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel);\r
- editor.dom.bind(editor.getBody(), 'focusout', function(e) {\r
- if (!editor.removed && self.typing) {\r
- addNonTypingUndoLevel();\r
- }\r
- });\r
-\r
- editor.onKeyUp.add(function(editor, e) {\r
- var keyCode = e.keyCode;\r
-\r
- if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45 || keyCode == 13 || e.ctrlKey) {\r
- addNonTypingUndoLevel();\r
- }\r
- });\r
-\r
- editor.onKeyDown.add(function(editor, e) {\r
- var keyCode = e.keyCode;\r
-\r
- // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter\r
- if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) {\r
- if (self.typing) {\r
- addNonTypingUndoLevel();\r
- }\r
-\r
- return;\r
- }\r
-\r
- // If key isn't shift,ctrl,alt,capslock,metakey\r
- if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !self.typing) {\r
- self.beforeChange();\r
- self.typing = true;\r
- self.add();\r
- }\r
- });\r
-\r
- editor.onMouseDown.add(function(editor, e) {\r
- if (self.typing) {\r
- addNonTypingUndoLevel();\r
- }\r
- });\r
-\r
- // Add keyboard shortcuts for undo/redo keys\r
- editor.addShortcut('ctrl+z', 'undo_desc', 'Undo');\r
- editor.addShortcut('ctrl+y', 'redo_desc', 'Redo');\r
-\r
- self = {\r
- // Explose for debugging reasons\r
- data : data,\r
-\r
- typing : false,\r
- \r
- onBeforeAdd: onBeforeAdd,\r
-\r
- onAdd : onAdd,\r
-\r
- onUndo : onUndo,\r
-\r
- onRedo : onRedo,\r
-\r
- beforeChange : function() {\r
- beforeBookmark = editor.selection.getBookmark(2, true);\r
- },\r
-\r
- add : function(level) {\r
- var i, settings = editor.settings, lastLevel;\r
-\r
- level = level || {};\r
- level.content = getContent();\r
- \r
- self.onBeforeAdd.dispatch(self, level);\r
-\r
- // Add undo level if needed\r
- lastLevel = data[index];\r
- if (lastLevel && lastLevel.content == level.content)\r
- return null;\r
-\r
- // Set before bookmark on previous level\r
- if (data[index])\r
- data[index].beforeBookmark = beforeBookmark;\r
-\r
- // Time to compress\r
- if (settings.custom_undo_redo_levels) {\r
- if (data.length > settings.custom_undo_redo_levels) {\r
- for (i = 0; i < data.length - 1; i++)\r
- data[i] = data[i + 1];\r
-\r
- data.length--;\r
- index = data.length;\r
- }\r
- }\r
-\r
- // Get a non intrusive normalized bookmark\r
- level.bookmark = editor.selection.getBookmark(2, true);\r
-\r
- // Crop array if needed\r
- if (index < data.length - 1)\r
- data.length = index + 1;\r
-\r
- data.push(level);\r
- index = data.length - 1;\r
-\r
- self.onAdd.dispatch(self, level);\r
- editor.isNotDirty = 0;\r
-\r
- return level;\r
- },\r
-\r
- undo : function() {\r
- var level, i;\r
-\r
- if (self.typing) {\r
- self.add();\r
- self.typing = false;\r
- }\r
-\r
- if (index > 0) {\r
- level = data[--index];\r
-\r
- editor.setContent(level.content, {format : 'raw'});\r
- editor.selection.moveToBookmark(level.beforeBookmark);\r
-\r
- self.onUndo.dispatch(self, level);\r
- }\r
-\r
- return level;\r
- },\r
-\r
- redo : function() {\r
- var level;\r
-\r
- if (index < data.length - 1) {\r
- level = data[++index];\r
-\r
- editor.setContent(level.content, {format : 'raw'});\r
- editor.selection.moveToBookmark(level.bookmark);\r
-\r
- self.onRedo.dispatch(self, level);\r
- }\r
-\r
- return level;\r
- },\r
-\r
- clear : function() {\r
- data = [];\r
- index = 0;\r
- self.typing = false;\r
- },\r
-\r
- hasUndo : function() {\r
- return index > 0 || this.typing;\r
- },\r
-\r
- hasRedo : function() {\r
- return index < data.length - 1 && !this.typing;\r
- }\r
- };\r
-\r
- return self;\r
- };\r
-})(tinymce);\r
-\r
-tinymce.ForceBlocks = function(editor) {\r
- var settings = editor.settings, dom = editor.dom, selection = editor.selection, blockElements = editor.schema.getBlockElements();\r
-\r
- function addRootBlocks() {\r
- var node = selection.getStart(), rootNode = editor.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF, wrapped, isInEditorDocument;\r
-\r
- if (!node || node.nodeType !== 1 || !settings.forced_root_block)\r
- return;\r
-\r
- // Check if node is wrapped in block\r
- while (node && node != rootNode) {\r
- if (blockElements[node.nodeName])\r
- return;\r
-\r
- node = node.parentNode;\r
- }\r
-\r
- // Get current selection\r
- rng = selection.getRng();\r
- if (rng.setStart) {\r
- startContainer = rng.startContainer;\r
- startOffset = rng.startOffset;\r
- endContainer = rng.endContainer;\r
- endOffset = rng.endOffset;\r
- } else {\r
- // Force control range into text range\r
- if (rng.item) {\r
- node = rng.item(0);\r
- rng = editor.getDoc().body.createTextRange();\r
- rng.moveToElementText(node);\r
- }\r
-\r
- isInEditorDocument = rng.parentElement().ownerDocument === editor.getDoc();\r
- tmpRng = rng.duplicate();\r
- tmpRng.collapse(true);\r
- startOffset = tmpRng.move('character', offset) * -1;\r
-\r
- if (!tmpRng.collapsed) {\r
- tmpRng = rng.duplicate();\r
- tmpRng.collapse(false);\r
- endOffset = (tmpRng.move('character', offset) * -1) - startOffset;\r
- }\r
- }\r
-\r
- // Wrap non block elements and text nodes\r
- node = rootNode.firstChild;\r
- while (node) {\r
- if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) {\r
- // Remove empty text nodes\r
- if (node.nodeType === 3 && node.nodeValue.length == 0) {\r
- tempNode = node;\r
- node = node.nextSibling;\r
- dom.remove(tempNode);\r
- continue;\r
- }\r
-\r
- if (!rootBlockNode) {\r
- rootBlockNode = dom.create(settings.forced_root_block);\r
- node.parentNode.insertBefore(rootBlockNode, node);\r
- wrapped = true;\r
- }\r
-\r
- tempNode = node;\r
- node = node.nextSibling;\r
- rootBlockNode.appendChild(tempNode);\r
- } else {\r
- rootBlockNode = null;\r
- node = node.nextSibling;\r
- }\r
- }\r
-\r
- if (wrapped) {\r
- if (rng.setStart) {\r
- rng.setStart(startContainer, startOffset);\r
- rng.setEnd(endContainer, endOffset);\r
- selection.setRng(rng);\r
- } else {\r
- // Only select if the previous selection was inside the document to prevent auto focus in quirks mode\r
- if (isInEditorDocument) {\r
- try {\r
- rng = editor.getDoc().body.createTextRange();\r
- rng.moveToElementText(rootNode);\r
- rng.collapse(true);\r
- rng.moveStart('character', startOffset);\r
-\r
- if (endOffset > 0)\r
- rng.moveEnd('character', endOffset);\r
-\r
- rng.select();\r
- } catch (ex) {\r
- // Ignore\r
- }\r
- }\r
- }\r
-\r
- editor.nodeChanged();\r
- }\r
- };\r
-\r
- // Force root blocks\r
- if (settings.forced_root_block) {\r
- editor.onKeyUp.add(addRootBlocks);\r
- editor.onNodeChange.add(addRootBlocks);\r
- }\r
-};\r
-\r
-(function(tinymce) {\r
- // Shorten names\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;\r
-\r
- tinymce.create('tinymce.ControlManager', {\r
- ControlManager : function(ed, s) {\r
- var t = this, i;\r
-\r
- s = s || {};\r
- t.editor = ed;\r
- t.controls = {};\r
- t.onAdd = new tinymce.util.Dispatcher(t);\r
- t.onPostRender = new tinymce.util.Dispatcher(t);\r
- t.prefix = s.prefix || ed.id + '_';\r
- t._cls = {};\r
-\r
- t.onPostRender.add(function() {\r
- each(t.controls, function(c) {\r
- c.postRender();\r
- });\r
- });\r
- },\r
-\r
- get : function(id) {\r
- return this.controls[this.prefix + id] || this.controls[id];\r
- },\r
-\r
- setActive : function(id, s) {\r
- var c = null;\r
-\r
- if (c = this.get(id))\r
- c.setActive(s);\r
-\r
- return c;\r
- },\r
-\r
- setDisabled : function(id, s) {\r
- var c = null;\r
-\r
- if (c = this.get(id))\r
- c.setDisabled(s);\r
-\r
- return c;\r
- },\r
-\r
- add : function(c) {\r
- var t = this;\r
-\r
- if (c) {\r
- t.controls[c.id] = c;\r
- t.onAdd.dispatch(c, t);\r
- }\r
-\r
- return c;\r
- },\r
-\r
- createControl : function(name) {\r
- var ctrl, i, l, self = this, editor = self.editor, factories, ctrlName;\r
-\r
- // Build control factory cache\r
- if (!self.controlFactories) {\r
- self.controlFactories = [];\r
- each(editor.plugins, function(plugin) {\r
- if (plugin.createControl) {\r
- self.controlFactories.push(plugin);\r
- }\r
- });\r
- }\r
-\r
- // Create controls by asking cached factories\r
- factories = self.controlFactories;\r
- for (i = 0, l = factories.length; i < l; i++) {\r
- ctrl = factories[i].createControl(name, self);\r
-\r
- if (ctrl) {\r
- return self.add(ctrl);\r
- }\r
- }\r
-\r
- // Create sepearator\r
- if (name === "|" || name === "separator") {\r
- return self.createSeparator();\r
- }\r
-\r
- // Create control from button collection\r
- if (editor.buttons && (ctrl = editor.buttons[name])) {\r
- return self.createButton(name, ctrl);\r
- }\r
-\r
- return self.add(ctrl);\r
- },\r
-\r
- createDropMenu : function(id, s, cc) {\r
- var t = this, ed = t.editor, c, bm, v, cls;\r
-\r
- s = extend({\r
- 'class' : 'mceDropDown',\r
- constrain : ed.settings.constrain_menus\r
- }, s);\r
-\r
- s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin';\r
- if (v = ed.getParam('skin_variant'))\r
- s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1);\r
-\r
- s['class'] += ed.settings.directionality == "rtl" ? ' mceRtl' : '';\r
-\r
- id = t.prefix + id;\r
- cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu;\r
- c = t.controls[id] = new cls(id, s);\r
- c.onAddItem.add(function(c, o) {\r
- var s = o.settings;\r
-\r
- s.title = ed.getLang(s.title, s.title);\r
-\r
- if (!s.onclick) {\r
- s.onclick = function(v) {\r
- if (s.cmd)\r
- ed.execCommand(s.cmd, s.ui || false, s.value);\r
- };\r
- }\r
- });\r
-\r
- ed.onRemove.add(function() {\r
- c.destroy();\r
- });\r
-\r
- // Fix for bug #1897785, #1898007\r
- if (tinymce.isIE) {\r
- c.onShowMenu.add(function() {\r
- // IE 8 needs focus in order to store away a range with the current collapsed caret location\r
- ed.focus();\r
-\r
- bm = ed.selection.getBookmark(1);\r
- });\r
-\r
- c.onHideMenu.add(function() {\r
- if (bm) {\r
- ed.selection.moveToBookmark(bm);\r
- bm = 0;\r
- }\r
- });\r
- }\r
-\r
- return t.add(c);\r
- },\r
-\r
- createListBox : function(id, s, cc) {\r
- var t = this, ed = t.editor, cmd, c, cls;\r
-\r
- if (t.get(id))\r
- return null;\r
-\r
- s.title = ed.translate(s.title);\r
- s.scope = s.scope || ed;\r
-\r
- if (!s.onselect) {\r
- s.onselect = function(v) {\r
- ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
- };\r
- }\r
-\r
- s = extend({\r
- title : s.title,\r
- 'class' : 'mce_' + id,\r
- scope : s.scope,\r
- control_manager : t\r
- }, s);\r
-\r
- id = t.prefix + id;\r
-\r
-\r
- function useNativeListForAccessibility(ed) {\r
- return ed.settings.use_accessible_selects && !tinymce.isGecko\r
- }\r
-\r
- if (ed.settings.use_native_selects || useNativeListForAccessibility(ed))\r
- c = new tinymce.ui.NativeListBox(id, s);\r
- else {\r
- cls = cc || t._cls.listbox || tinymce.ui.ListBox;\r
- c = new cls(id, s, ed);\r
- }\r
-\r
- t.controls[id] = c;\r
-\r
- // Fix focus problem in Safari\r
- if (tinymce.isWebKit) {\r
- c.onPostRender.add(function(c, n) {\r
- // Store bookmark on mousedown\r
- Event.add(n, 'mousedown', function() {\r
- ed.bookmark = ed.selection.getBookmark(1);\r
- });\r
-\r
- // Restore on focus, since it might be lost\r
- Event.add(n, 'focus', function() {\r
- ed.selection.moveToBookmark(ed.bookmark);\r
- ed.bookmark = null;\r
- });\r
- });\r
- }\r
-\r
- if (c.hideMenu)\r
- ed.onMouseDown.add(c.hideMenu, c);\r
-\r
- return t.add(c);\r
- },\r
-\r
- createButton : function(id, s, cc) {\r
- var t = this, ed = t.editor, o, c, cls;\r
-\r
- if (t.get(id))\r
- return null;\r
-\r
- s.title = ed.translate(s.title);\r
- s.label = ed.translate(s.label);\r
- s.scope = s.scope || ed;\r
-\r
- if (!s.onclick && !s.menu_button) {\r
- s.onclick = function() {\r
- ed.execCommand(s.cmd, s.ui || false, s.value);\r
- };\r
- }\r
-\r
- s = extend({\r
- title : s.title,\r
- 'class' : 'mce_' + id,\r
- unavailable_prefix : ed.getLang('unavailable', ''),\r
- scope : s.scope,\r
- control_manager : t\r
- }, s);\r
-\r
- id = t.prefix + id;\r
-\r
- if (s.menu_button) {\r
- cls = cc || t._cls.menubutton || tinymce.ui.MenuButton;\r
- c = new cls(id, s, ed);\r
- ed.onMouseDown.add(c.hideMenu, c);\r
- } else {\r
- cls = t._cls.button || tinymce.ui.Button;\r
- c = new cls(id, s, ed);\r
- }\r
-\r
- return t.add(c);\r
- },\r
-\r
- createMenuButton : function(id, s, cc) {\r
- s = s || {};\r
- s.menu_button = 1;\r
-\r
- return this.createButton(id, s, cc);\r
- },\r
-\r
- createSplitButton : function(id, s, cc) {\r
- var t = this, ed = t.editor, cmd, c, cls;\r
-\r
- if (t.get(id))\r
- return null;\r
-\r
- s.title = ed.translate(s.title);\r
- s.scope = s.scope || ed;\r
-\r
- if (!s.onclick) {\r
- s.onclick = function(v) {\r
- ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
- };\r
- }\r
-\r
- if (!s.onselect) {\r
- s.onselect = function(v) {\r
- ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
- };\r
- }\r
-\r
- s = extend({\r
- title : s.title,\r
- 'class' : 'mce_' + id,\r
- scope : s.scope,\r
- control_manager : t\r
- }, s);\r
-\r
- id = t.prefix + id;\r
- cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton;\r
- c = t.add(new cls(id, s, ed));\r
- ed.onMouseDown.add(c.hideMenu, c);\r
-\r
- return c;\r
- },\r
-\r
- createColorSplitButton : function(id, s, cc) {\r
- var t = this, ed = t.editor, cmd, c, cls, bm;\r
-\r
- if (t.get(id))\r
- return null;\r
-\r
- s.title = ed.translate(s.title);\r
- s.scope = s.scope || ed;\r
-\r
- if (!s.onclick) {\r
- s.onclick = function(v) {\r
- if (tinymce.isIE)\r
- bm = ed.selection.getBookmark(1);\r
-\r
- ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
- };\r
- }\r
-\r
- if (!s.onselect) {\r
- s.onselect = function(v) {\r
- ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
- };\r
- }\r
-\r
- s = extend({\r
- title : s.title,\r
- 'class' : 'mce_' + id,\r
- 'menu_class' : ed.getParam('skin') + 'Skin',\r
- scope : s.scope,\r
- more_colors_title : ed.getLang('more_colors')\r
- }, s);\r
-\r
- id = t.prefix + id;\r
- cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton;\r
- c = new cls(id, s, ed);\r
- ed.onMouseDown.add(c.hideMenu, c);\r
-\r
- // Remove the menu element when the editor is removed\r
- ed.onRemove.add(function() {\r
- c.destroy();\r
- });\r
-\r
- // Fix for bug #1897785, #1898007\r
- if (tinymce.isIE) {\r
- c.onShowMenu.add(function() {\r
- // IE 8 needs focus in order to store away a range with the current collapsed caret location\r
- ed.focus();\r
- bm = ed.selection.getBookmark(1);\r
- });\r
-\r
- c.onHideMenu.add(function() {\r
- if (bm) {\r
- ed.selection.moveToBookmark(bm);\r
- bm = 0;\r
- }\r
- });\r
- }\r
-\r
- return t.add(c);\r
- },\r
-\r
- createToolbar : function(id, s, cc) {\r
- var c, t = this, cls;\r
-\r
- id = t.prefix + id;\r
- cls = cc || t._cls.toolbar || tinymce.ui.Toolbar;\r
- c = new cls(id, s, t.editor);\r
-\r
- if (t.get(id))\r
- return null;\r
-\r
- return t.add(c);\r
- },\r
- \r
- createToolbarGroup : function(id, s, cc) {\r
- var c, t = this, cls;\r
- id = t.prefix + id;\r
- cls = cc || this._cls.toolbarGroup || tinymce.ui.ToolbarGroup;\r
- c = new cls(id, s, t.editor);\r
- \r
- if (t.get(id))\r
- return null;\r
- \r
- return t.add(c);\r
- },\r
-\r
- createSeparator : function(cc) {\r
- var cls = cc || this._cls.separator || tinymce.ui.Separator;\r
-\r
- return new cls();\r
- },\r
-\r
- setControlType : function(n, c) {\r
- return this._cls[n.toLowerCase()] = c;\r
- },\r
- \r
- destroy : function() {\r
- each(this.controls, function(c) {\r
- c.destroy();\r
- });\r
-\r
- this.controls = null;\r
- }\r
- });\r
-})(tinymce);\r
-\r
-(function(tinymce) {\r
- var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera;\r
-\r
- tinymce.create('tinymce.WindowManager', {\r
- WindowManager : function(ed) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
- t.onOpen = new Dispatcher(t);\r
- t.onClose = new Dispatcher(t);\r
- t.params = {};\r
- t.features = {};\r
- },\r
-\r
- open : function(s, p) {\r
- var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u;\r
-\r
- // Default some options\r
- s = s || {};\r
- p = p || {};\r
- sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window\r
- sh = isOpera ? vp.h : screen.height;\r
- s.name = s.name || 'mc_' + new Date().getTime();\r
- s.width = parseInt(s.width || 320);\r
- s.height = parseInt(s.height || 240);\r
- s.resizable = true;\r
- s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0);\r
- s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0);\r
- p.inline = false;\r
- p.mce_width = s.width;\r
- p.mce_height = s.height;\r
- p.mce_auto_focus = s.auto_focus;\r
-\r
- if (mo) {\r
- if (isIE) {\r
- s.center = true;\r
- s.help = false;\r
- s.dialogWidth = s.width + 'px';\r
- s.dialogHeight = s.height + 'px';\r
- s.scroll = s.scrollbars || false;\r
- }\r
- }\r
-\r
- // Build features string\r
- each(s, function(v, k) {\r
- if (tinymce.is(v, 'boolean'))\r
- v = v ? 'yes' : 'no';\r
-\r
- if (!/^(name|url)$/.test(k)) {\r
- if (isIE && mo)\r
- f += (f ? ';' : '') + k + ':' + v;\r
- else\r
- f += (f ? ',' : '') + k + '=' + v;\r
- }\r
- });\r
-\r
- t.features = s;\r
- t.params = p;\r
- t.onOpen.dispatch(t, s, p);\r
-\r
- u = s.url || s.file;\r
- u = tinymce._addVer(u);\r
-\r
- try {\r
- if (isIE && mo) {\r
- w = 1;\r
- window.showModalDialog(u, window, f);\r
- } else\r
- w = window.open(u, s.name, f);\r
- } catch (ex) {\r
- // Ignore\r
- }\r
-\r
- if (!w)\r
- alert(t.editor.getLang('popup_blocked'));\r
- },\r
-\r
- close : function(w) {\r
- w.close();\r
- this.onClose.dispatch(this);\r
- },\r
-\r
- createInstance : function(cl, a, b, c, d, e) {\r
- var f = tinymce.resolve(cl);\r
-\r
- return new f(a, b, c, d, e);\r
- },\r
-\r
- confirm : function(t, cb, s, w) {\r
- w = w || window;\r
-\r
- cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t))));\r
- },\r
-\r
- alert : function(tx, cb, s, w) {\r
- var t = this;\r
-\r
- w = w || window;\r
- w.alert(t._decode(t.editor.getLang(tx, tx)));\r
-\r
- if (cb)\r
- cb.call(s || t);\r
- },\r
-\r
- resizeBy : function(dw, dh, win) {\r
- win.resizeBy(dw, dh);\r
- },\r
-\r
- // Internal functions\r
-\r
- _decode : function(s) {\r
- return tinymce.DOM.decode(s).replace(/\\n/g, '\n');\r
- }\r
- });\r
-}(tinymce));\r
-(function(tinymce) {\r
- tinymce.Formatter = function(ed) {\r
- var formats = {},\r
- each = tinymce.each,\r
- dom = ed.dom,\r
- selection = ed.selection,\r
- TreeWalker = tinymce.dom.TreeWalker,\r
- rangeUtils = new tinymce.dom.RangeUtils(dom),\r
- isValid = ed.schema.isValidChild,\r
- isArray = tinymce.isArray,\r
- isBlock = dom.isBlock,\r
- forcedRootBlock = ed.settings.forced_root_block,\r
- nodeIndex = dom.nodeIndex,\r
- INVISIBLE_CHAR = '\uFEFF',\r
- MCE_ATTR_RE = /^(src|href|style)$/,\r
- FALSE = false,\r
- TRUE = true,\r
- formatChangeData,\r
- undef,\r
- getContentEditable = dom.getContentEditable;\r
-\r
- function isTextBlock(name) {\r
- return !!ed.schema.getTextBlocks()[name.toLowerCase()];\r
- }\r
-\r
- function getParents(node, selector) {\r
- return dom.getParents(node, selector, dom.getRoot());\r
- };\r
-\r
- function isCaretNode(node) {\r
- return node.nodeType === 1 && node.id === '_mce_caret';\r
- };\r
-\r
- function defaultFormats() {\r
- register({\r
- alignleft : [\r
- {selector : 'figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}, defaultBlock: 'div'},\r
- {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}}\r
- ],\r
-\r
- aligncenter : [\r
- {selector : 'figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}, defaultBlock: 'div'},\r
- {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}},\r
- {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}}\r
- ],\r
-\r
- alignright : [\r
- {selector : 'figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}, defaultBlock: 'div'},\r
- {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}}\r
- ],\r
-\r
- alignfull : [\r
- {selector : 'figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}, defaultBlock: 'div'}\r
- ],\r
-\r
- bold : [\r
- {inline : 'strong', remove : 'all'},\r
- {inline : 'span', styles : {fontWeight : 'bold'}},\r
- {inline : 'b', remove : 'all'}\r
- ],\r
-\r
- italic : [\r
- {inline : 'em', remove : 'all'},\r
- {inline : 'span', styles : {fontStyle : 'italic'}},\r
- {inline : 'i', remove : 'all'}\r
- ],\r
-\r
- underline : [\r
- {inline : 'span', styles : {textDecoration : 'underline'}, exact : true},\r
- {inline : 'u', remove : 'all'}\r
- ],\r
-\r
- strikethrough : [\r
- {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true},\r
- {inline : 'strike', remove : 'all'}\r
- ],\r
-\r
- forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false},\r
- hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false},\r
- fontname : {inline : 'span', styles : {fontFamily : '%value'}},\r
- fontsize : {inline : 'span', styles : {fontSize : '%value'}},\r
- fontsize_class : {inline : 'span', attributes : {'class' : '%value'}},\r
- blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'},\r
- subscript : {inline : 'sub'},\r
- superscript : {inline : 'sup'},\r
-\r
- link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true,\r
- onmatch : function(node) {\r
- return true;\r
- },\r
-\r
- onformat : function(elm, fmt, vars) {\r
- each(vars, function(value, key) {\r
- dom.setAttrib(elm, key, value);\r
- });\r
- }\r
- },\r
-\r
- removeformat : [\r
- {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true},\r
- {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true},\r
- {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true}\r
- ]\r
- });\r
-\r
- // Register default block formats\r
- each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) {\r
- register(name, {block : name, remove : 'all'});\r
- });\r
-\r
- // Register user defined formats\r
- register(ed.settings.formats);\r
- };\r
-\r
- function addKeyboardShortcuts() {\r
- // Add some inline shortcuts\r
- ed.addShortcut('ctrl+b', 'bold_desc', 'Bold');\r
- ed.addShortcut('ctrl+i', 'italic_desc', 'Italic');\r
- ed.addShortcut('ctrl+u', 'underline_desc', 'Underline');\r
-\r
- // BlockFormat shortcuts keys\r
- for (var i = 1; i <= 6; i++) {\r
- ed.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]);\r
- }\r
-\r
- ed.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']);\r
- ed.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']);\r
- ed.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']);\r
- };\r
-\r
- // Public functions\r
-\r
- function get(name) {\r
- return name ? formats[name] : formats;\r
- };\r
-\r
- function register(name, format) {\r
- if (name) {\r
- if (typeof(name) !== 'string') {\r
- each(name, function(format, name) {\r
- register(name, format);\r
- });\r
- } else {\r
- // Force format into array and add it to internal collection\r
- format = format.length ? format : [format];\r
-\r
- each(format, function(format) {\r
- // Set deep to false by default on selector formats this to avoid removing\r
- // alignment on images inside paragraphs when alignment is changed on paragraphs\r
- if (format.deep === undef)\r
- format.deep = !format.selector;\r
-\r
- // Default to true\r
- if (format.split === undef)\r
- format.split = !format.selector || format.inline;\r
-\r
- // Default to true\r
- if (format.remove === undef && format.selector && !format.inline)\r
- format.remove = 'none';\r
-\r
- // Mark format as a mixed format inline + block level\r
- if (format.selector && format.inline) {\r
- format.mixed = true;\r
- format.block_expand = true;\r
- }\r
-\r
- // Split classes if needed\r
- if (typeof(format.classes) === 'string')\r
- format.classes = format.classes.split(/\s+/);\r
- });\r
-\r
- formats[name] = format;\r
- }\r
- }\r
- };\r
-\r
- var getTextDecoration = function(node) {\r
- var decoration;\r
-\r
- ed.dom.getParent(node, function(n) {\r
- decoration = ed.dom.getStyle(n, 'text-decoration');\r
- return decoration && decoration !== 'none';\r
- });\r
-\r
- return decoration;\r
- };\r
-\r
- var processUnderlineAndColor = function(node) {\r
- var textDecoration;\r
- if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) {\r
- textDecoration = getTextDecoration(node.parentNode);\r
- if (ed.dom.getStyle(node, 'color') && textDecoration) {\r
- ed.dom.setStyle(node, 'text-decoration', textDecoration);\r
- } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) {\r
- ed.dom.setStyle(node, 'text-decoration', null);\r
- }\r
- }\r
- };\r
-\r
- function apply(name, vars, node) {\r
- var formatList = get(name), format = formatList[0], bookmark, rng, i, isCollapsed = selection.isCollapsed();\r
-\r
- function setElementFormat(elm, fmt) {\r
- fmt = fmt || format;\r
-\r
- if (elm) {\r
- if (fmt.onformat) {\r
- fmt.onformat(elm, fmt, vars, node);\r
- }\r
-\r
- each(fmt.styles, function(value, name) {\r
- dom.setStyle(elm, name, replaceVars(value, vars));\r
- });\r
-\r
- each(fmt.attributes, function(value, name) {\r
- dom.setAttrib(elm, name, replaceVars(value, vars));\r
- });\r
-\r
- each(fmt.classes, function(value) {\r
- value = replaceVars(value, vars);\r
-\r
- if (!dom.hasClass(elm, value))\r
- dom.addClass(elm, value);\r
- });\r
- }\r
- };\r
- function adjustSelectionToVisibleSelection() {\r
- function findSelectionEnd(start, end) {\r
- var walker = new TreeWalker(end);\r
- for (node = walker.current(); node; node = walker.prev()) {\r
- if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {\r
- return node;\r
- }\r
- }\r
- };\r
-\r
- // Adjust selection so that a end container with a end offset of zero is not included in the selection\r
- // as this isn't visible to the user.\r
- var rng = ed.selection.getRng();\r
- var start = rng.startContainer;\r
- var end = rng.endContainer;\r
-\r
- if (start != end && rng.endOffset === 0) {\r
- var newEnd = findSelectionEnd(start, end);\r
- var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length;\r
-\r
- rng.setEnd(newEnd, endOffset);\r
- }\r
-\r
- return rng;\r
- }\r
- \r
- function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){\r
- var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm;\r
- \r
- // find the index of the first child list.\r
- each(node.childNodes, function(n, index) {\r
- if (n.nodeName === "UL" || n.nodeName === "OL") {\r
- listIndex = index;\r
- list = n;\r
- return false;\r
- }\r
- });\r
- \r
- // get the index of the bookmarks\r
- each(node.childNodes, function(n, index) {\r
- if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") {\r
- if (n.id == bookmark.id + "_start") {\r
- startIndex = index;\r
- } else if (n.id == bookmark.id + "_end") {\r
- endIndex = index;\r
- }\r
- }\r
- });\r
- \r
- // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally\r
- if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) {\r
- each(tinymce.grep(node.childNodes), process);\r
- return 0;\r
- } else {\r
- currentWrapElm = dom.clone(wrapElm, FALSE);\r
-\r
- // create a list of the nodes on the same side of the list as the selection\r
- each(tinymce.grep(node.childNodes), function(n, index) {\r
- if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) {\r
- nodes.push(n); \r
- n.parentNode.removeChild(n);\r
- }\r
- });\r
-\r
- // insert the wrapping element either before or after the list.\r
- if (startIndex < listIndex) {\r
- node.insertBefore(currentWrapElm, list);\r
- } else if (startIndex > listIndex) {\r
- node.insertBefore(currentWrapElm, list.nextSibling);\r
- }\r
- \r
- // add the new nodes to the list.\r
- newWrappers.push(currentWrapElm);\r
-\r
- each(nodes, function(node) {\r
- currentWrapElm.appendChild(node);\r
- });\r
-\r
- return currentWrapElm;\r
- }\r
- };\r
-\r
- function applyRngStyle(rng, bookmark, node_specific) {\r
- var newWrappers = [], wrapName, wrapElm, contentEditable = true;\r
-\r
- // Setup wrapper element\r
- wrapName = format.inline || format.block;\r
- wrapElm = dom.create(wrapName);\r
- setElementFormat(wrapElm);\r
-\r
- rangeUtils.walk(rng, function(nodes) {\r
- var currentWrapElm;\r
-\r
- function process(node) {\r
- var nodeName, parentName, found, hasContentEditableState, lastContentEditable;\r
-\r
- lastContentEditable = contentEditable;\r
- nodeName = node.nodeName.toLowerCase();\r
- parentName = node.parentNode.nodeName.toLowerCase();\r
-\r
- // Node has a contentEditable value\r
- if (node.nodeType === 1 && getContentEditable(node)) {\r
- lastContentEditable = contentEditable;\r
- contentEditable = getContentEditable(node) === "true";\r
- hasContentEditableState = true; // We don't want to wrap the container only it's children\r
- }\r
-\r
- // Stop wrapping on br elements\r
- if (isEq(nodeName, 'br')) {\r
- currentWrapElm = 0;\r
-\r
- // Remove any br elements when we wrap things\r
- if (format.block)\r
- dom.remove(node);\r
-\r
- return;\r
- }\r
-\r
- // If node is wrapper type\r
- if (format.wrapper && matchNode(node, name, vars)) {\r
- currentWrapElm = 0;\r
- return;\r
- }\r
-\r
- // Can we rename the block\r
- if (contentEditable && !hasContentEditableState && format.block && !format.wrapper && isTextBlock(nodeName)) {\r
- node = dom.rename(node, wrapName);\r
- setElementFormat(node);\r
- newWrappers.push(node);\r
- currentWrapElm = 0;\r
- return;\r
- }\r
-\r
- // Handle selector patterns\r
- if (format.selector) {\r
- // Look for matching formats\r
- each(formatList, function(format) {\r
- // Check collapsed state if it exists\r
- if ('collapsed' in format && format.collapsed !== isCollapsed) {\r
- return;\r
- }\r
-\r
- if (dom.is(node, format.selector) && !isCaretNode(node)) {\r
- setElementFormat(node, format);\r
- found = true;\r
- }\r
- });\r
-\r
- // Continue processing if a selector match wasn't found and a inline element is defined\r
- if (!format.inline || found) {\r
- currentWrapElm = 0;\r
- return;\r
- }\r
- }\r
-\r
- // Is it valid to wrap this item\r
- if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) &&\r
- !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node)) {\r
- // Start wrapping\r
- if (!currentWrapElm) {\r
- // Wrap the node\r
- currentWrapElm = dom.clone(wrapElm, FALSE);\r
- node.parentNode.insertBefore(currentWrapElm, node);\r
- newWrappers.push(currentWrapElm);\r
- }\r
-\r
- currentWrapElm.appendChild(node);\r
- } else if (nodeName == 'li' && bookmark) {\r
- // Start wrapping - if we are in a list node and have a bookmark, then we will always begin by wrapping in a new element.\r
- currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process);\r
- } else {\r
- // Start a new wrapper for possible children\r
- currentWrapElm = 0;\r
- \r
- each(tinymce.grep(node.childNodes), process);\r
-\r
- if (hasContentEditableState) {\r
- contentEditable = lastContentEditable; // Restore last contentEditable state from stack\r
- }\r
-\r
- // End the last wrapper\r
- currentWrapElm = 0;\r
- }\r
- };\r
-\r
- // Process siblings from range\r
- each(nodes, process);\r
- });\r
-\r
- // Wrap links inside as well, for example color inside a link when the wrapper is around the link\r
- if (format.wrap_links === false) {\r
- each(newWrappers, function(node) {\r
- function process(node) {\r
- var i, currentWrapElm, children;\r
-\r
- if (node.nodeName === 'A') {\r
- currentWrapElm = dom.clone(wrapElm, FALSE);\r
- newWrappers.push(currentWrapElm);\r
-\r
- children = tinymce.grep(node.childNodes);\r
- for (i = 0; i < children.length; i++)\r
- currentWrapElm.appendChild(children[i]);\r
-\r
- node.appendChild(currentWrapElm);\r
- }\r
-\r
- each(tinymce.grep(node.childNodes), process);\r
- };\r
-\r
- process(node);\r
- });\r
- }\r
-\r
- // Cleanup\r
- \r
- each(newWrappers, function(node) {\r
- var childCount;\r
-\r
- function getChildCount(node) {\r
- var count = 0;\r
-\r
- each(node.childNodes, function(node) {\r
- if (!isWhiteSpaceNode(node) && !isBookmarkNode(node))\r
- count++;\r
- });\r
-\r
- return count;\r
- };\r
-\r
- function mergeStyles(node) {\r
- var child, clone;\r
-\r
- each(node.childNodes, function(node) {\r
- if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) {\r
- child = node;\r
- return FALSE; // break loop\r
- }\r
- });\r
-\r
- // If child was found and of the same type as the current node\r
- if (child && matchName(child, format)) {\r
- clone = dom.clone(child, FALSE);\r
- setElementFormat(clone);\r
-\r
- dom.replace(clone, node, TRUE);\r
- dom.remove(child, 1);\r
- }\r
-\r
- return clone || node;\r
- };\r
-\r
- childCount = getChildCount(node);\r
-\r
- // Remove empty nodes but only if there is multiple wrappers and they are not block\r
- // elements so never remove single <h1></h1> since that would remove the currrent empty block element where the caret is at\r
- if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {\r
- dom.remove(node, 1);\r
- return;\r
- }\r
-\r
- if (format.inline || format.wrapper) {\r
- // Merges the current node with it's children of similar type to reduce the number of elements\r
- if (!format.exact && childCount === 1)\r
- node = mergeStyles(node);\r
-\r
- // Remove/merge children\r
- each(formatList, function(format) {\r
- // Merge all children of similar type will move styles from child to parent\r
- // this: <span style="color:red"><b><span style="color:red; font-size:10px">text</span></b></span>\r
- // will become: <span style="color:red"><b><span style="font-size:10px">text</span></b></span>\r
- each(dom.select(format.inline, node), function(child) {\r
- var parent;\r
-\r
- // When wrap_links is set to false we don't want\r
- // to remove the format on children within links\r
- if (format.wrap_links === false) {\r
- parent = child.parentNode;\r
-\r
- do {\r
- if (parent.nodeName === 'A')\r
- return;\r
- } while (parent = parent.parentNode);\r
- }\r
-\r
- removeFormat(format, vars, child, format.exact ? child : null);\r
- });\r
- });\r
-\r
- // Remove child if direct parent is of same type\r
- if (matchNode(node.parentNode, name, vars)) {\r
- dom.remove(node, 1);\r
- node = 0;\r
- return TRUE;\r
- }\r
-\r
- // Look for parent with similar style format\r
- if (format.merge_with_parents) {\r
- dom.getParent(node.parentNode, function(parent) {\r
- if (matchNode(parent, name, vars)) {\r
- dom.remove(node, 1);\r
- node = 0;\r
- return TRUE;\r
- }\r
- });\r
- }\r
-\r
- // Merge next and previous siblings if they are similar <b>text</b><b>text</b> becomes <b>texttext</b>\r
- if (node && format.merge_siblings !== false) {\r
- node = mergeSiblings(getNonWhiteSpaceSibling(node), node);\r
- node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE));\r
- }\r
- }\r
- });\r
- };\r
-\r
- if (format) {\r
- if (node) {\r
- if (node.nodeType) {\r
- rng = dom.createRng();\r
- rng.setStartBefore(node);\r
- rng.setEndAfter(node);\r
- applyRngStyle(expandRng(rng, formatList), null, true);\r
- } else {\r
- applyRngStyle(node, null, true);\r
- }\r
- } else {\r
- if (!isCollapsed || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) {\r
- // Obtain selection node before selection is unselected by applyRngStyle()\r
- var curSelNode = ed.selection.getNode();\r
-\r
- // If the formats have a default block and we can't find a parent block then start wrapping it with a DIV this is for forced_root_blocks: false\r
- // It's kind of a hack but people should be using the default block type P since all desktop editors work that way\r
- if (!forcedRootBlock && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) {\r
- apply(formatList[0].defaultBlock);\r
- }\r
-\r
- // Apply formatting to selection\r
- ed.selection.setRng(adjustSelectionToVisibleSelection());\r
- bookmark = selection.getBookmark();\r
- applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark);\r
-\r
- // Colored nodes should be underlined so that the color of the underline matches the text color.\r
- if (format.styles && (format.styles.color || format.styles.textDecoration)) {\r
- tinymce.walk(curSelNode, processUnderlineAndColor, 'childNodes');\r
- processUnderlineAndColor(curSelNode);\r
- }\r
-\r
- selection.moveToBookmark(bookmark);\r
- moveStart(selection.getRng(TRUE));\r
- ed.nodeChanged();\r
- } else\r
- performCaretAction('apply', name, vars);\r
- }\r
- }\r
- };\r
-\r
- function remove(name, vars, node) {\r
- var formatList = get(name), format = formatList[0], bookmark, i, rng, contentEditable = true;\r
-\r
- // Merges the styles for each node\r
- function process(node) {\r
- var children, i, l, localContentEditable, lastContentEditable, hasContentEditableState;\r
-\r
- // Skip on text nodes as they have neither format to remove nor children\r
- if (node.nodeType === 3) {\r
- return;\r
- }\r
-\r
- // Node has a contentEditable value\r
- if (node.nodeType === 1 && getContentEditable(node)) {\r
- lastContentEditable = contentEditable;\r
- contentEditable = getContentEditable(node) === "true";\r
- hasContentEditableState = true; // We don't want to wrap the container only it's children\r
- }\r
-\r
- // Grab the children first since the nodelist might be changed\r
- children = tinymce.grep(node.childNodes);\r
-\r
- // Process current node\r
- if (contentEditable && !hasContentEditableState) {\r
- for (i = 0, l = formatList.length; i < l; i++) {\r
- if (removeFormat(formatList[i], vars, node, node))\r
- break;\r
- }\r
- }\r
-\r
- // Process the children\r
- if (format.deep) {\r
- if (children.length) { \r
- for (i = 0, l = children.length; i < l; i++)\r
- process(children[i]);\r
-\r
- if (hasContentEditableState) {\r
- contentEditable = lastContentEditable; // Restore last contentEditable state from stack\r
- }\r
- }\r
- }\r
- };\r
-\r
- function findFormatRoot(container) {\r
- var formatRoot;\r
-\r
- // Find format root\r
- each(getParents(container.parentNode).reverse(), function(parent) {\r
- var format;\r
-\r
- // Find format root element\r
- if (!formatRoot && parent.id != '_start' && parent.id != '_end') {\r
- // Is the node matching the format we are looking for\r
- format = matchNode(parent, name, vars);\r
- if (format && format.split !== false)\r
- formatRoot = parent;\r
- }\r
- });\r
-\r
- return formatRoot;\r
- };\r
-\r
- function wrapAndSplit(format_root, container, target, split) {\r
- var parent, clone, lastClone, firstClone, i, formatRootParent;\r
-\r
- // Format root found then clone formats and split it\r
- if (format_root) {\r
- formatRootParent = format_root.parentNode;\r
-\r
- for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) {\r
- clone = dom.clone(parent, FALSE);\r
-\r
- for (i = 0; i < formatList.length; i++) {\r
- if (removeFormat(formatList[i], vars, clone, clone)) {\r
- clone = 0;\r
- break;\r
- }\r
- }\r
-\r
- // Build wrapper node\r
- if (clone) {\r
- if (lastClone)\r
- clone.appendChild(lastClone);\r
-\r
- if (!firstClone)\r
- firstClone = clone;\r
-\r
- lastClone = clone;\r
- }\r
- }\r
-\r
- // Never split block elements if the format is mixed\r
- if (split && (!format.mixed || !isBlock(format_root)))\r
- container = dom.split(format_root, container);\r
-\r
- // Wrap container in cloned formats\r
- if (lastClone) {\r
- target.parentNode.insertBefore(lastClone, target);\r
- firstClone.appendChild(target);\r
- }\r
- }\r
-\r
- return container;\r
- };\r
-\r
- function splitToFormatRoot(container) {\r
- return wrapAndSplit(findFormatRoot(container), container, container, true);\r
- };\r
-\r
- function unwrap(start) {\r
- var node = dom.get(start ? '_start' : '_end'),\r
- out = node[start ? 'firstChild' : 'lastChild'];\r
-\r
- // If the end is placed within the start the result will be removed\r
- // So this checks if the out node is a bookmark node if it is it\r
- // checks for another more suitable node\r
- if (isBookmarkNode(out))\r
- out = out[start ? 'firstChild' : 'lastChild'];\r
-\r
- dom.remove(node, true);\r
-\r
- return out;\r
- };\r
-\r
- function removeRngStyle(rng) {\r
- var startContainer, endContainer, node;\r
-\r
- rng = expandRng(rng, formatList, TRUE);\r
-\r
- if (format.split) {\r
- startContainer = getContainer(rng, TRUE);\r
- endContainer = getContainer(rng);\r
-\r
- if (startContainer != endContainer) {\r
- // WebKit will render the table incorrectly if we wrap a TD in a SPAN so lets see if the can use the first child instead\r
- // This will happen if you tripple click a table cell and use remove formatting\r
- if (/^(TR|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) {\r
- startContainer = (startContainer.nodeName == "TD" ? startContainer.firstChild : startContainer.firstChild.firstChild) || startContainer;\r
- }\r
-\r
- // Wrap start/end nodes in span element since these might be cloned/moved\r
- startContainer = wrap(startContainer, 'span', {id : '_start', 'data-mce-type' : 'bookmark'});\r
- endContainer = wrap(endContainer, 'span', {id : '_end', 'data-mce-type' : 'bookmark'});\r
-\r
- // Split start/end\r
- splitToFormatRoot(startContainer);\r
- splitToFormatRoot(endContainer);\r
-\r
- // Unwrap start/end to get real elements again\r
- startContainer = unwrap(TRUE);\r
- endContainer = unwrap();\r
- } else\r
- startContainer = endContainer = splitToFormatRoot(startContainer);\r
-\r
- // Update range positions since they might have changed after the split operations\r
- rng.startContainer = startContainer.parentNode;\r
- rng.startOffset = nodeIndex(startContainer);\r
- rng.endContainer = endContainer.parentNode;\r
- rng.endOffset = nodeIndex(endContainer) + 1;\r
- }\r
-\r
- // Remove items between start/end\r
- rangeUtils.walk(rng, function(nodes) {\r
- each(nodes, function(node) {\r
- process(node);\r
-\r
- // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined.\r
- if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && getTextDecoration(node.parentNode) === 'underline') {\r
- removeFormat({'deep': false, 'exact': true, 'inline': 'span', 'styles': {'textDecoration' : 'underline'}}, null, node);\r
- }\r
- });\r
- });\r
- };\r
-\r
- // Handle node\r
- if (node) {\r
- if (node.nodeType) {\r
- rng = dom.createRng();\r
- rng.setStartBefore(node);\r
- rng.setEndAfter(node);\r
- removeRngStyle(rng);\r
- } else {\r
- removeRngStyle(node);\r
- }\r
-\r
- return;\r
- }\r
-\r
- if (!selection.isCollapsed() || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) {\r
- bookmark = selection.getBookmark();\r
- removeRngStyle(selection.getRng(TRUE));\r
- selection.moveToBookmark(bookmark);\r
-\r
- // Check if start element still has formatting then we are at: "<b>text|</b>text" and need to move the start into the next text node\r
- if (format.inline && match(name, vars, selection.getStart())) {\r
- moveStart(selection.getRng(true));\r
- }\r
-\r
- ed.nodeChanged();\r
- } else\r
- performCaretAction('remove', name, vars);\r
- };\r
-\r
- function toggle(name, vars, node) {\r
- var fmt = get(name);\r
-\r
- if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle))\r
- remove(name, vars, node);\r
- else\r
- apply(name, vars, node);\r
- };\r
-\r
- function matchNode(node, name, vars, similar) {\r
- var formatList = get(name), format, i, classes;\r
-\r
- function matchItems(node, format, item_name) {\r
- var key, value, items = format[item_name], i;\r
-\r
- // Custom match\r
- if (format.onmatch) {\r
- return format.onmatch(node, format, item_name);\r
- }\r
-\r
- // Check all items\r
- if (items) {\r
- // Non indexed object\r
- if (items.length === undef) {\r
- for (key in items) {\r
- if (items.hasOwnProperty(key)) {\r
- if (item_name === 'attributes')\r
- value = dom.getAttrib(node, key);\r
- else\r
- value = getStyle(node, key);\r
-\r
- if (similar && !value && !format.exact)\r
- return;\r
-\r
- if ((!similar || format.exact) && !isEq(value, replaceVars(items[key], vars)))\r
- return;\r
- }\r
- }\r
- } else {\r
- // Only one match needed for indexed arrays\r
- for (i = 0; i < items.length; i++) {\r
- if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i]))\r
- return format;\r
- }\r
- }\r
- }\r
-\r
- return format;\r
- };\r
-\r
- if (formatList && node) {\r
- // Check each format in list\r
- for (i = 0; i < formatList.length; i++) {\r
- format = formatList[i];\r
-\r
- // Name name, attributes, styles and classes\r
- if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) {\r
- // Match classes\r
- if (classes = format.classes) {\r
- for (i = 0; i < classes.length; i++) {\r
- if (!dom.hasClass(node, classes[i]))\r
- return;\r
- }\r
- }\r
-\r
- return format;\r
- }\r
- }\r
- }\r
- };\r
-\r
- function match(name, vars, node) {\r
- var startNode;\r
-\r
- function matchParents(node) {\r
- // Find first node with similar format settings\r
- node = dom.getParent(node, function(node) {\r
- return !!matchNode(node, name, vars, true);\r
- });\r
-\r
- // Do an exact check on the similar format element\r
- return matchNode(node, name, vars);\r
- };\r
-\r
- // Check specified node\r
- if (node)\r
- return matchParents(node);\r
-\r
- // Check selected node\r
- node = selection.getNode();\r
- if (matchParents(node))\r
- return TRUE;\r
-\r
- // Check start node if it's different\r
- startNode = selection.getStart();\r
- if (startNode != node) {\r
- if (matchParents(startNode))\r
- return TRUE;\r
- }\r
-\r
- return FALSE;\r
- };\r
-\r
- function matchAll(names, vars) {\r
- var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name;\r
-\r
- // Check start of selection for formats\r
- startElement = selection.getStart();\r
- dom.getParent(startElement, function(node) {\r
- var i, name;\r
-\r
- for (i = 0; i < names.length; i++) {\r
- name = names[i];\r
-\r
- if (!checkedMap[name] && matchNode(node, name, vars)) {\r
- checkedMap[name] = true;\r
- matchedFormatNames.push(name);\r
- }\r
- }\r
- }, dom.getRoot());\r
-\r
- return matchedFormatNames;\r
- };\r
-\r
- function canApply(name) {\r
- var formatList = get(name), startNode, parents, i, x, selector;\r
-\r
- if (formatList) {\r
- startNode = selection.getStart();\r
- parents = getParents(startNode);\r
-\r
- for (x = formatList.length - 1; x >= 0; x--) {\r
- selector = formatList[x].selector;\r
-\r
- // Format is not selector based, then always return TRUE\r
- if (!selector)\r
- return TRUE;\r
-\r
- for (i = parents.length - 1; i >= 0; i--) {\r
- if (dom.is(parents[i], selector))\r
- return TRUE;\r
- }\r
- }\r
- }\r
-\r
- return FALSE;\r
- };\r
-\r
- function formatChanged(formats, callback, similar) {\r
- var currentFormats;\r
-\r
- // Setup format node change logic\r
- if (!formatChangeData) {\r
- formatChangeData = {};\r
- currentFormats = {};\r
-\r
- ed.onNodeChange.addToTop(function(ed, cm, node) {\r
- var parents = getParents(node), matchedFormats = {};\r
-\r
- // Check for new formats\r
- each(formatChangeData, function(callbacks, format) {\r
- each(parents, function(node) {\r
- if (matchNode(node, format, {}, callbacks.similar)) {\r
- if (!currentFormats[format]) {\r
- // Execute callbacks\r
- each(callbacks, function(callback) {\r
- callback(true, {node: node, format: format, parents: parents});\r
- });\r
-\r
- currentFormats[format] = callbacks;\r
- }\r
-\r
- matchedFormats[format] = callbacks;\r
- return false;\r
- }\r
- });\r
- });\r
-\r
- // Check if current formats still match\r
- each(currentFormats, function(callbacks, format) {\r
- if (!matchedFormats[format]) {\r
- delete currentFormats[format];\r
-\r
- each(callbacks, function(callback) {\r
- callback(false, {node: node, format: format, parents: parents});\r
- });\r
- }\r
- });\r
- });\r
- }\r
-\r
- // Add format listeners\r
- each(formats.split(','), function(format) {\r
- if (!formatChangeData[format]) {\r
- formatChangeData[format] = [];\r
- formatChangeData[format].similar = similar;\r
- }\r
-\r
- formatChangeData[format].push(callback);\r
- });\r
-\r
- return this;\r
- };\r
-\r
- // Expose to public\r
- tinymce.extend(this, {\r
- get : get,\r
- register : register,\r
- apply : apply,\r
- remove : remove,\r
- toggle : toggle,\r
- match : match,\r
- matchAll : matchAll,\r
- matchNode : matchNode,\r
- canApply : canApply,\r
- formatChanged: formatChanged\r
- });\r
-\r
- // Initialize\r
- defaultFormats();\r
- addKeyboardShortcuts();\r
-\r
- // Private functions\r
-\r
- function matchName(node, format) {\r
- // Check for inline match\r
- if (isEq(node, format.inline))\r
- return TRUE;\r
-\r
- // Check for block match\r
- if (isEq(node, format.block))\r
- return TRUE;\r
-\r
- // Check for selector match\r
- if (format.selector)\r
- return dom.is(node, format.selector);\r
- };\r
-\r
- function isEq(str1, str2) {\r
- str1 = str1 || '';\r
- str2 = str2 || '';\r
-\r
- str1 = '' + (str1.nodeName || str1);\r
- str2 = '' + (str2.nodeName || str2);\r
-\r
- return str1.toLowerCase() == str2.toLowerCase();\r
- };\r
-\r
- function getStyle(node, name) {\r
- var styleVal = dom.getStyle(node, name);\r
-\r
- // Force the format to hex\r
- if (name == 'color' || name == 'backgroundColor')\r
- styleVal = dom.toHex(styleVal);\r
-\r
- // Opera will return bold as 700\r
- if (name == 'fontWeight' && styleVal == 700)\r
- styleVal = 'bold';\r
-\r
- return '' + styleVal;\r
- };\r
-\r
- function replaceVars(value, vars) {\r
- if (typeof(value) != "string")\r
- value = value(vars);\r
- else if (vars) {\r
- value = value.replace(/%(\w+)/g, function(str, name) {\r
- return vars[name] || str;\r
- });\r
- }\r
-\r
- return value;\r
- };\r
-\r
- function isWhiteSpaceNode(node) {\r
- return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue);\r
- };\r
-\r
- function wrap(node, name, attrs) {\r
- var wrapper = dom.create(name, attrs);\r
-\r
- node.parentNode.insertBefore(wrapper, node);\r
- wrapper.appendChild(node);\r
-\r
- return wrapper;\r
- };\r
-\r
- function expandRng(rng, format, remove) {\r
- var sibling, lastIdx, leaf, endPoint,\r
- startContainer = rng.startContainer,\r
- startOffset = rng.startOffset,\r
- endContainer = rng.endContainer,\r
- endOffset = rng.endOffset;\r
-\r
- // This function walks up the tree if there is no siblings before/after the node\r
- function findParentContainer(start) {\r
- var container, parent, child, sibling, siblingName, root;\r
-\r
- container = parent = start ? startContainer : endContainer;\r
- siblingName = start ? 'previousSibling' : 'nextSibling';\r
- root = dom.getRoot();\r
-\r
- function isBogusBr(node) {\r
- return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling;\r
- };\r
-\r
- // If it's a text node and the offset is inside the text\r
- if (container.nodeType == 3 && !isWhiteSpaceNode(container)) {\r
- if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {\r
- return container;\r
- }\r
- }\r
-\r
- for (;;) {\r
- // Stop expanding on block elements\r
- if (!format[0].block_expand && isBlock(parent))\r
- return parent;\r
-\r
- // Walk left/right\r
- for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {\r
- if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {\r
- return parent;\r
- }\r
- }\r
-\r
- // Check if we can move up are we at root level or body level\r
- if (parent.parentNode == root) {\r
- container = parent;\r
- break;\r
- }\r
-\r
- parent = parent.parentNode;\r
- }\r
-\r
- return container;\r
- };\r
-\r
- // This function walks down the tree to find the leaf at the selection.\r
- // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node.\r
- function findLeaf(node, offset) {\r
- if (offset === undef)\r
- offset = node.nodeType === 3 ? node.length : node.childNodes.length;\r
- while (node && node.hasChildNodes()) {\r
- node = node.childNodes[offset];\r
- if (node)\r
- offset = node.nodeType === 3 ? node.length : node.childNodes.length;\r
- }\r
- return { node: node, offset: offset };\r
- }\r
-\r
- // If index based start position then resolve it\r
- if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {\r
- lastIdx = startContainer.childNodes.length - 1;\r
- startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset];\r
-\r
- if (startContainer.nodeType == 3)\r
- startOffset = 0;\r
- }\r
-\r
- // If index based end position then resolve it\r
- if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {\r
- lastIdx = endContainer.childNodes.length - 1;\r
- endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1];\r
-\r
- if (endContainer.nodeType == 3)\r
- endOffset = endContainer.nodeValue.length;\r
- }\r
-\r
- // Expands the node to the closes contentEditable false element if it exists\r
- function findParentContentEditable(node) {\r
- var parent = node;\r
-\r
- while (parent) {\r
- if (parent.nodeType === 1 && getContentEditable(parent)) {\r
- return getContentEditable(parent) === "false" ? parent : node;\r
- }\r
-\r
- parent = parent.parentNode;\r
- }\r
-\r
- return node;\r
- };\r
-\r
- function findWordEndPoint(container, offset, start) {\r
- var walker, node, pos, lastTextNode;\r
-\r
- function findSpace(node, offset) {\r
- var pos, pos2, str = node.nodeValue;\r
-\r
- if (typeof(offset) == "undefined") {\r
- offset = start ? str.length : 0;\r
- }\r
-\r
- if (start) {\r
- pos = str.lastIndexOf(' ', offset);\r
- pos2 = str.lastIndexOf('\u00a0', offset);\r
- pos = pos > pos2 ? pos : pos2;\r
-\r
- // Include the space on remove to avoid tag soup\r
- if (pos !== -1 && !remove) {\r
- pos++;\r
- }\r
- } else {\r
- pos = str.indexOf(' ', offset);\r
- pos2 = str.indexOf('\u00a0', offset);\r
- pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2;\r
- }\r
-\r
- return pos;\r
- };\r
-\r
- if (container.nodeType === 3) {\r
- pos = findSpace(container, offset);\r
-\r
- if (pos !== -1) {\r
- return {container : container, offset : pos};\r
- }\r
-\r
- lastTextNode = container;\r
- }\r
-\r
- // Walk the nodes inside the block\r
- walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody());\r
- while (node = walker[start ? 'prev' : 'next']()) {\r
- if (node.nodeType === 3) {\r
- lastTextNode = node;\r
- pos = findSpace(node);\r
-\r
- if (pos !== -1) {\r
- return {container : node, offset : pos};\r
- }\r
- } else if (isBlock(node)) {\r
- break;\r
- }\r
- }\r
-\r
- if (lastTextNode) {\r
- if (start) {\r
- offset = 0;\r
- } else {\r
- offset = lastTextNode.length;\r
- }\r
-\r
- return {container: lastTextNode, offset: offset};\r
- }\r
- };\r
-\r
- function findSelectorEndPoint(container, sibling_name) {\r
- var parents, i, y, curFormat;\r
-\r
- if (container.nodeType == 3 && container.nodeValue.length === 0 && container[sibling_name])\r
- container = container[sibling_name];\r
-\r
- parents = getParents(container);\r
- for (i = 0; i < parents.length; i++) {\r
- for (y = 0; y < format.length; y++) {\r
- curFormat = format[y];\r
-\r
- // If collapsed state is set then skip formats that doesn't match that\r
- if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed)\r
- continue;\r
-\r
- if (dom.is(parents[i], curFormat.selector))\r
- return parents[i];\r
- }\r
- }\r
-\r
- return container;\r
- };\r
-\r
- function findBlockEndPoint(container, sibling_name, sibling_name2) {\r
- var node;\r
-\r
- // Expand to block of similar type\r
- if (!format[0].wrapper)\r
- node = dom.getParent(container, format[0].block);\r
-\r
- // Expand to first wrappable block element or any block element\r
- if (!node)\r
- node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isTextBlock);\r
-\r
- // Exclude inner lists from wrapping\r
- if (node && format[0].wrapper)\r
- node = getParents(node, 'ul,ol').reverse()[0] || node;\r
-\r
- // Didn't find a block element look for first/last wrappable element\r
- if (!node) {\r
- node = container;\r
-\r
- while (node[sibling_name] && !isBlock(node[sibling_name])) {\r
- node = node[sibling_name];\r
-\r
- // Break on BR but include it will be removed later on\r
- // we can't remove it now since we need to check if it can be wrapped\r
- if (isEq(node, 'br'))\r
- break;\r
- }\r
- }\r
-\r
- return node || container;\r
- };\r
-\r
- // Expand to closest contentEditable element\r
- startContainer = findParentContentEditable(startContainer);\r
- endContainer = findParentContentEditable(endContainer);\r
-\r
- // Exclude bookmark nodes if possible\r
- if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) {\r
- startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode;\r
- startContainer = startContainer.nextSibling || startContainer;\r
-\r
- if (startContainer.nodeType == 3)\r
- startOffset = 0;\r
- }\r
-\r
- if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) {\r
- endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode;\r
- endContainer = endContainer.previousSibling || endContainer;\r
-\r
- if (endContainer.nodeType == 3)\r
- endOffset = endContainer.length;\r
- }\r
-\r
- if (format[0].inline) {\r
- if (rng.collapsed) {\r
- // Expand left to closest word boundery\r
- endPoint = findWordEndPoint(startContainer, startOffset, true);\r
- if (endPoint) {\r
- startContainer = endPoint.container;\r
- startOffset = endPoint.offset;\r
- }\r
-\r
- // Expand right to closest word boundery\r
- endPoint = findWordEndPoint(endContainer, endOffset);\r
- if (endPoint) {\r
- endContainer = endPoint.container;\r
- endOffset = endPoint.offset;\r
- }\r
- }\r
-\r
- // Avoid applying formatting to a trailing space.\r
- leaf = findLeaf(endContainer, endOffset);\r
- if (leaf.node) {\r
- while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling)\r
- leaf = findLeaf(leaf.node.previousSibling);\r
-\r
- if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 &&\r
- leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') {\r
-\r
- if (leaf.offset > 1) {\r
- endContainer = leaf.node;\r
- endContainer.splitText(leaf.offset - 1);\r
- }\r
- }\r
- }\r
- }\r
-\r
- // Move start/end point up the tree if the leaves are sharp and if we are in different containers\r
- // Example * becomes !: !<p><b><i>*text</i><i>text*</i></b></p>!\r
- // This will reduce the number of wrapper elements that needs to be created\r
- // Move start point up the tree\r
- if (format[0].inline || format[0].block_expand) {\r
- if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) {\r
- startContainer = findParentContainer(true);\r
- }\r
-\r
- if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) {\r
- endContainer = findParentContainer();\r
- }\r
- }\r
-\r
- // Expand start/end container to matching selector\r
- if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) {\r
- // Find new startContainer/endContainer if there is better one\r
- startContainer = findSelectorEndPoint(startContainer, 'previousSibling');\r
- endContainer = findSelectorEndPoint(endContainer, 'nextSibling');\r
- }\r
-\r
- // Expand start/end container to matching block element or text node\r
- if (format[0].block || format[0].selector) {\r
- // Find new startContainer/endContainer if there is better one\r
- startContainer = findBlockEndPoint(startContainer, 'previousSibling');\r
- endContainer = findBlockEndPoint(endContainer, 'nextSibling');\r
-\r
- // Non block element then try to expand up the leaf\r
- if (format[0].block) {\r
- if (!isBlock(startContainer))\r
- startContainer = findParentContainer(true);\r
-\r
- if (!isBlock(endContainer))\r
- endContainer = findParentContainer();\r
- }\r
- }\r
-\r
- // Setup index for startContainer\r
- if (startContainer.nodeType == 1) {\r
- startOffset = nodeIndex(startContainer);\r
- startContainer = startContainer.parentNode;\r
- }\r
-\r
- // Setup index for endContainer\r
- if (endContainer.nodeType == 1) {\r
- endOffset = nodeIndex(endContainer) + 1;\r
- endContainer = endContainer.parentNode;\r
- }\r
-\r
- // Return new range like object\r
- return {\r
- startContainer : startContainer,\r
- startOffset : startOffset,\r
- endContainer : endContainer,\r
- endOffset : endOffset\r
- };\r
- }\r
-\r
- function removeFormat(format, vars, node, compare_node) {\r
- var i, attrs, stylesModified;\r
-\r
- // Check if node matches format\r
- if (!matchName(node, format))\r
- return FALSE;\r
-\r
- // Should we compare with format attribs and styles\r
- if (format.remove != 'all') {\r
- // Remove styles\r
- each(format.styles, function(value, name) {\r
- value = replaceVars(value, vars);\r
-\r
- // Indexed array\r
- if (typeof(name) === 'number') {\r
- name = value;\r
- compare_node = 0;\r
- }\r
-\r
- if (!compare_node || isEq(getStyle(compare_node, name), value))\r
- dom.setStyle(node, name, '');\r
-\r
- stylesModified = 1;\r
- });\r
-\r
- // Remove style attribute if it's empty\r
- if (stylesModified && dom.getAttrib(node, 'style') == '') {\r
- node.removeAttribute('style');\r
- node.removeAttribute('data-mce-style');\r
- }\r
-\r
- // Remove attributes\r
- each(format.attributes, function(value, name) {\r
- var valueOut;\r
-\r
- value = replaceVars(value, vars);\r
-\r
- // Indexed array\r
- if (typeof(name) === 'number') {\r
- name = value;\r
- compare_node = 0;\r
- }\r
-\r
- if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) {\r
- // Keep internal classes\r
- if (name == 'class') {\r
- value = dom.getAttrib(node, name);\r
- if (value) {\r
- // Build new class value where everything is removed except the internal prefixed classes\r
- valueOut = '';\r
- each(value.split(/\s+/), function(cls) {\r
- if (/mce\w+/.test(cls))\r
- valueOut += (valueOut ? ' ' : '') + cls;\r
- });\r
-\r
- // We got some internal classes left\r
- if (valueOut) {\r
- dom.setAttrib(node, name, valueOut);\r
- return;\r
- }\r
- }\r
- }\r
-\r
- // IE6 has a bug where the attribute doesn't get removed correctly\r
- if (name == "class")\r
- node.removeAttribute('className');\r
-\r
- // Remove mce prefixed attributes\r
- if (MCE_ATTR_RE.test(name))\r
- node.removeAttribute('data-mce-' + name);\r
-\r
- node.removeAttribute(name);\r
- }\r
- });\r
-\r
- // Remove classes\r
- each(format.classes, function(value) {\r
- value = replaceVars(value, vars);\r
-\r
- if (!compare_node || dom.hasClass(compare_node, value))\r
- dom.removeClass(node, value);\r
- });\r
-\r
- // Check for non internal attributes\r
- attrs = dom.getAttribs(node);\r
- for (i = 0; i < attrs.length; i++) {\r
- if (attrs[i].nodeName.indexOf('_') !== 0)\r
- return FALSE;\r
- }\r
- }\r
-\r
- // Remove the inline child if it's empty for example <b> or <span>\r
- if (format.remove != 'none') {\r
- removeNode(node, format);\r
- return TRUE;\r
- }\r
- };\r
-\r
- function removeNode(node, format) {\r
- var parentNode = node.parentNode, rootBlockElm;\r
-\r
- function find(node, next, inc) {\r
- node = getNonWhiteSpaceSibling(node, next, inc);\r
-\r
- return !node || (node.nodeName == 'BR' || isBlock(node));\r
- };\r
-\r
- if (format.block) {\r
- if (!forcedRootBlock) {\r
- // Append BR elements if needed before we remove the block\r
- if (isBlock(node) && !isBlock(parentNode)) {\r
- if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1))\r
- node.insertBefore(dom.create('br'), node.firstChild);\r
-\r
- if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1))\r
- node.appendChild(dom.create('br'));\r
- }\r
- } else {\r
- // Wrap the block in a forcedRootBlock if we are at the root of document\r
- if (parentNode == dom.getRoot()) {\r
- if (!format.list_block || !isEq(node, format.list_block)) {\r
- each(tinymce.grep(node.childNodes), function(node) {\r
- if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) {\r
- if (!rootBlockElm)\r
- rootBlockElm = wrap(node, forcedRootBlock);\r
- else\r
- rootBlockElm.appendChild(node);\r
- } else\r
- rootBlockElm = 0;\r
- });\r
- }\r
- }\r
- }\r
- }\r
-\r
- // Never remove nodes that isn't the specified inline element if a selector is specified too\r
- if (format.selector && format.inline && !isEq(format.inline, node))\r
- return;\r
-\r
- dom.remove(node, 1);\r
- };\r
-\r
- function getNonWhiteSpaceSibling(node, next, inc) {\r
- if (node) {\r
- next = next ? 'nextSibling' : 'previousSibling';\r
-\r
- for (node = inc ? node : node[next]; node; node = node[next]) {\r
- if (node.nodeType == 1 || !isWhiteSpaceNode(node))\r
- return node;\r
- }\r
- }\r
- };\r
-\r
- function isBookmarkNode(node) {\r
- return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark';\r
- };\r
-\r
- function mergeSiblings(prev, next) {\r
- var marker, sibling, tmpSibling;\r
-\r
- function compareElements(node1, node2) {\r
- // Not the same name\r
- if (node1.nodeName != node2.nodeName)\r
- return FALSE;\r
-\r
- function getAttribs(node) {\r
- var attribs = {};\r
-\r
- each(dom.getAttribs(node), function(attr) {\r
- var name = attr.nodeName.toLowerCase();\r
-\r
- // Don't compare internal attributes or style\r
- if (name.indexOf('_') !== 0 && name !== 'style')\r
- attribs[name] = dom.getAttrib(node, name);\r
- });\r
-\r
- return attribs;\r
- };\r
-\r
- function compareObjects(obj1, obj2) {\r
- var value, name;\r
-\r
- for (name in obj1) {\r
- // Obj1 has item obj2 doesn't have\r
- if (obj1.hasOwnProperty(name)) {\r
- value = obj2[name];\r
-\r
- // Obj2 doesn't have obj1 item\r
- if (value === undef)\r
- return FALSE;\r
-\r
- // Obj2 item has a different value\r
- if (obj1[name] != value)\r
- return FALSE;\r
-\r
- // Delete similar value\r
- delete obj2[name];\r
- }\r
- }\r
-\r
- // Check if obj 2 has something obj 1 doesn't have\r
- for (name in obj2) {\r
- // Obj2 has item obj1 doesn't have\r
- if (obj2.hasOwnProperty(name))\r
- return FALSE;\r
- }\r
-\r
- return TRUE;\r
- };\r
-\r
- // Attribs are not the same\r
- if (!compareObjects(getAttribs(node1), getAttribs(node2)))\r
- return FALSE;\r
-\r
- // Styles are not the same\r
- if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style'))))\r
- return FALSE;\r
-\r
- return TRUE;\r
- };\r
-\r
- function findElementSibling(node, sibling_name) {\r
- for (sibling = node; sibling; sibling = sibling[sibling_name]) {\r
- if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0)\r
- return node;\r
-\r
- if (sibling.nodeType == 1 && !isBookmarkNode(sibling))\r
- return sibling;\r
- }\r
-\r
- return node;\r
- };\r
-\r
- // Check if next/prev exists and that they are elements\r
- if (prev && next) {\r
- // If previous sibling is empty then jump over it\r
- prev = findElementSibling(prev, 'previousSibling');\r
- next = findElementSibling(next, 'nextSibling');\r
-\r
- // Compare next and previous nodes\r
- if (compareElements(prev, next)) {\r
- // Append nodes between\r
- for (sibling = prev.nextSibling; sibling && sibling != next;) {\r
- tmpSibling = sibling;\r
- sibling = sibling.nextSibling;\r
- prev.appendChild(tmpSibling);\r
- }\r
-\r
- // Remove next node\r
- dom.remove(next);\r
-\r
- // Move children into prev node\r
- each(tinymce.grep(next.childNodes), function(node) {\r
- prev.appendChild(node);\r
- });\r
-\r
- return prev;\r
- }\r
- }\r
-\r
- return next;\r
- };\r
-\r
- function isTextBlock(name) {\r
- return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name);\r
- };\r
-\r
- function getContainer(rng, start) {\r
- var container, offset, lastIdx, walker;\r
-\r
- container = rng[start ? 'startContainer' : 'endContainer'];\r
- offset = rng[start ? 'startOffset' : 'endOffset'];\r
-\r
- if (container.nodeType == 1) {\r
- lastIdx = container.childNodes.length - 1;\r
-\r
- if (!start && offset)\r
- offset--;\r
-\r
- container = container.childNodes[offset > lastIdx ? lastIdx : offset];\r
- }\r
-\r
- // If start text node is excluded then walk to the next node\r
- if (container.nodeType === 3 && start && offset >= container.nodeValue.length) {\r
- container = new TreeWalker(container, ed.getBody()).next() || container;\r
- }\r
-\r
- // If end text node is excluded then walk to the previous node\r
- if (container.nodeType === 3 && !start && offset === 0) {\r
- container = new TreeWalker(container, ed.getBody()).prev() || container;\r
- }\r
-\r
- return container;\r
- };\r
-\r
- function performCaretAction(type, name, vars) {\r
- var caretContainerId = '_mce_caret', debug = ed.settings.caret_debug;\r
-\r
- // Creates a caret container bogus element\r
- function createCaretContainer(fill) {\r
- var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});\r
-\r
- if (fill) {\r
- caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));\r
- }\r
-\r
- return caretContainer;\r
- };\r
-\r
- function isCaretContainerEmpty(node, nodes) {\r
- while (node) {\r
- if ((node.nodeType === 3 && node.nodeValue !== INVISIBLE_CHAR) || node.childNodes.length > 1) {\r
- return false;\r
- }\r
-\r
- // Collect nodes\r
- if (nodes && node.nodeType === 1) {\r
- nodes.push(node);\r
- }\r
-\r
- node = node.firstChild;\r
- }\r
-\r
- return true;\r
- };\r
- \r
- // Returns any parent caret container element\r
- function getParentCaretContainer(node) {\r
- while (node) {\r
- if (node.id === caretContainerId) {\r
- return node;\r
- }\r
-\r
- node = node.parentNode;\r
- }\r
- };\r
-\r
- // Finds the first text node in the specified node\r
- function findFirstTextNode(node) {\r
- var walker;\r
-\r
- if (node) {\r
- walker = new TreeWalker(node, node);\r
-\r
- for (node = walker.current(); node; node = walker.next()) {\r
- if (node.nodeType === 3) {\r
- return node;\r
- }\r
- }\r
- }\r
- };\r
-\r
- // Removes the caret container for the specified node or all on the current document\r
- function removeCaretContainer(node, move_caret) {\r
- var child, rng;\r
-\r
- if (!node) {\r
- node = getParentCaretContainer(selection.getStart());\r
-\r
- if (!node) {\r
- while (node = dom.get(caretContainerId)) {\r
- removeCaretContainer(node, false);\r
- }\r
- }\r
- } else {\r
- rng = selection.getRng(true);\r
-\r
- if (isCaretContainerEmpty(node)) {\r
- if (move_caret !== false) {\r
- rng.setStartBefore(node);\r
- rng.setEndBefore(node);\r
- }\r
-\r
- dom.remove(node);\r
- } else {\r
- child = findFirstTextNode(node);\r
-\r
- if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) {\r
- child = child.deleteData(0, 1);\r
- }\r
-\r
- dom.remove(node, 1);\r
- }\r
-\r
- selection.setRng(rng);\r
- }\r
- };\r
- \r
- // Applies formatting to the caret postion\r
- function applyCaretFormat() {\r
- var rng, caretContainer, textNode, offset, bookmark, container, text;\r
-\r
- rng = selection.getRng(true);\r
- offset = rng.startOffset;\r
- container = rng.startContainer;\r
- text = container.nodeValue;\r
-\r
- caretContainer = getParentCaretContainer(selection.getStart());\r
- if (caretContainer) {\r
- textNode = findFirstTextNode(caretContainer);\r
- }\r
-\r
- // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character\r
- if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) {\r
- // Get bookmark of caret position\r
- bookmark = selection.getBookmark();\r
-\r
- // Collapse bookmark range (WebKit)\r
- rng.collapse(true);\r
-\r
- // Expand the range to the closest word and split it at those points\r
- rng = expandRng(rng, get(name));\r
- rng = rangeUtils.split(rng);\r
-\r
- // Apply the format to the range\r
- apply(name, vars, rng);\r
-\r
- // Move selection back to caret position\r
- selection.moveToBookmark(bookmark);\r
- } else {\r
- if (!caretContainer || textNode.nodeValue !== INVISIBLE_CHAR) {\r
- caretContainer = createCaretContainer(true);\r
- textNode = caretContainer.firstChild;\r
-\r
- rng.insertNode(caretContainer);\r
- offset = 1;\r
-\r
- apply(name, vars, caretContainer);\r
- } else {\r
- apply(name, vars, caretContainer);\r
- }\r
-\r
- // Move selection to text node\r
- selection.setCursorLocation(textNode, offset);\r
- }\r
- };\r
-\r
- function removeCaretFormat() {\r
- var rng = selection.getRng(true), container, offset, bookmark,\r
- hasContentAfter, node, formatNode, parents = [], i, caretContainer;\r
-\r
- container = rng.startContainer;\r
- offset = rng.startOffset;\r
- node = container;\r
-\r
- if (container.nodeType == 3) {\r
- if (offset != container.nodeValue.length || container.nodeValue === INVISIBLE_CHAR) {\r
- hasContentAfter = true;\r
- }\r
-\r
- node = node.parentNode;\r
- }\r
-\r
- while (node) {\r
- if (matchNode(node, name, vars)) {\r
- formatNode = node;\r
- break;\r
- }\r
-\r
- if (node.nextSibling) {\r
- hasContentAfter = true;\r
- }\r
-\r
- parents.push(node);\r
- node = node.parentNode;\r
- }\r
-\r
- // Node doesn't have the specified format\r
- if (!formatNode) {\r
- return;\r
- }\r
-\r
- // Is there contents after the caret then remove the format on the element\r
- if (hasContentAfter) {\r
- // Get bookmark of caret position\r
- bookmark = selection.getBookmark();\r
-\r
- // Collapse bookmark range (WebKit)\r
- rng.collapse(true);\r
-\r
- // Expand the range to the closest word and split it at those points\r
- rng = expandRng(rng, get(name), true);\r
- rng = rangeUtils.split(rng);\r
-\r
- // Remove the format from the range\r
- remove(name, vars, rng);\r
-\r
- // Move selection back to caret position\r
- selection.moveToBookmark(bookmark);\r
- } else {\r
- caretContainer = createCaretContainer();\r
-\r
- node = caretContainer;\r
- for (i = parents.length - 1; i >= 0; i--) {\r
- node.appendChild(dom.clone(parents[i], false));\r
- node = node.firstChild;\r
- }\r
-\r
- // Insert invisible character into inner most format element\r
- node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR));\r
- node = node.firstChild;\r
-\r
- // Insert caret container after the formated node\r
- dom.insertAfter(caretContainer, formatNode);\r
-\r
- // Move selection to text node\r
- selection.setCursorLocation(node, 1);\r
- }\r
- };\r
-\r
- // Checks if the parent caret container node isn't empty if that is the case it\r
- // will remove the bogus state on all children that isn't empty\r
- function unmarkBogusCaretParents() {\r
- var i, caretContainer, node;\r
-\r
- caretContainer = getParentCaretContainer(selection.getStart());\r
- if (caretContainer && !dom.isEmpty(caretContainer)) {\r
- tinymce.walk(caretContainer, function(node) {\r
- if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) {\r
- dom.setAttrib(node, 'data-mce-bogus', null);\r
- }\r
- }, 'childNodes');\r
- }\r
- };\r
-\r
- // Only bind the caret events once\r
- if (!self._hasCaretEvents) {\r
- // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements\r
- ed.onBeforeGetContent.addToTop(function() {\r
- var nodes = [], i;\r
-\r
- if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) {\r
- // Mark children\r
- i = nodes.length;\r
- while (i--) {\r
- dom.setAttrib(nodes[i], 'data-mce-bogus', '1');\r
- }\r
- }\r
- });\r
-\r
- // Remove caret container on mouse up and on key up\r
- tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) {\r
- ed[name].addToTop(function() {\r
- removeCaretContainer();\r
- unmarkBogusCaretParents();\r
- });\r
- });\r
-\r
- // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys\r
- ed.onKeyDown.addToTop(function(ed, e) {\r
- var keyCode = e.keyCode;\r
-\r
- if (keyCode == 8 || keyCode == 37 || keyCode == 39) {\r
- removeCaretContainer(getParentCaretContainer(selection.getStart()));\r
- }\r
-\r
- unmarkBogusCaretParents();\r
- });\r
-\r
- // Remove bogus state if they got filled by contents using editor.selection.setContent\r
- selection.onSetContent.add(unmarkBogusCaretParents);\r
-\r
- self._hasCaretEvents = true;\r
- }\r
-\r
- // Do apply or remove caret format\r
- if (type == "apply") {\r
- applyCaretFormat();\r
- } else {\r
- removeCaretFormat();\r
- }\r
- };\r
-\r
- function moveStart(rng) {\r
- var container = rng.startContainer,\r
- offset = rng.startOffset, isAtEndOfText,\r
- walker, node, nodes, tmpNode;\r
-\r
- // Convert text node into index if possible\r
- if (container.nodeType == 3 && offset >= container.nodeValue.length) {\r
- // Get the parent container location and walk from there\r
- offset = nodeIndex(container);\r
- container = container.parentNode;\r
- isAtEndOfText = true;\r
- }\r
-\r
- // Move startContainer/startOffset in to a suitable node\r
- if (container.nodeType == 1) {\r
- nodes = container.childNodes;\r
- container = nodes[Math.min(offset, nodes.length - 1)];\r
- walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));\r
-\r
- // If offset is at end of the parent node walk to the next one\r
- if (offset > nodes.length - 1 || isAtEndOfText)\r
- walker.next();\r
-\r
- for (node = walker.current(); node; node = walker.next()) {\r
- if (node.nodeType == 3 && !isWhiteSpaceNode(node)) {\r
- // IE has a "neat" feature where it moves the start node into the closest element\r
- // we can avoid this by inserting an element before it and then remove it after we set the selection\r
- tmpNode = dom.create('a', null, INVISIBLE_CHAR);\r
- node.parentNode.insertBefore(tmpNode, node);\r
-\r
- // Set selection and remove tmpNode\r
- rng.setStart(node, 0);\r
- selection.setRng(rng);\r
- dom.remove(tmpNode);\r
-\r
- return;\r
- }\r
- }\r
- }\r
- };\r
- };\r
-})(tinymce);\r
-\r
-tinymce.onAddEditor.add(function(tinymce, ed) {\r
- var filters, fontSizes, dom, settings = ed.settings;\r
-\r
- function replaceWithSpan(node, styles) {\r
- tinymce.each(styles, function(value, name) {\r
- if (value)\r
- dom.setStyle(node, name, value);\r
- });\r
-\r
- dom.rename(node, 'span');\r
- };\r
-\r
- function convert(editor, params) {\r
- dom = editor.dom;\r
-\r
- if (settings.convert_fonts_to_spans) {\r
- tinymce.each(dom.select('font,u,strike', params.node), function(node) {\r
- filters[node.nodeName.toLowerCase()](ed.dom, node);\r
- });\r
- }\r
- };\r
-\r
- if (settings.inline_styles) {\r
- fontSizes = tinymce.explode(settings.font_size_legacy_values);\r
-\r
- filters = {\r
- font : function(dom, node) {\r
- replaceWithSpan(node, {\r
- backgroundColor : node.style.backgroundColor,\r
- color : node.color,\r
- fontFamily : node.face,\r
- fontSize : fontSizes[parseInt(node.size, 10) - 1]\r
- });\r
- },\r
-\r
- u : function(dom, node) {\r
- replaceWithSpan(node, {\r
- textDecoration : 'underline'\r
- });\r
- },\r
-\r
- strike : function(dom, node) {\r
- replaceWithSpan(node, {\r
- textDecoration : 'line-through'\r
- });\r
- }\r
- };\r
-\r
- ed.onPreProcess.add(convert);\r
- ed.onSetContent.add(convert);\r
-\r
- ed.onInit.add(function() {\r
- ed.selection.onSetContent.add(convert);\r
- });\r
- }\r
-});\r
-\r
-(function(tinymce) {\r
- var TreeWalker = tinymce.dom.TreeWalker;\r
-\r
- tinymce.EnterKey = function(editor) {\r
- var dom = editor.dom, selection = editor.selection, settings = editor.settings, undoManager = editor.undoManager, nonEmptyElementsMap = editor.schema.getNonEmptyElements();\r
-\r
- function handleEnterKey(evt) {\r
- var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,\r
- newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;\r
-\r
- // Returns true if the block can be split into two blocks or not\r
- function canSplitBlock(node) {\r
- return node &&\r
- dom.isBlock(node) &&\r
- !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) &&\r
- !/^(fixed|absolute)/i.test(node.style.position) && \r
- dom.getContentEditable(node) !== "true";\r
- };\r
-\r
- // Renders empty block on IE\r
- function renderBlockOnIE(block) {\r
- var oldRng;\r
-\r
- if (tinymce.isIE && dom.isBlock(block)) {\r
- oldRng = selection.getRng();\r
- block.appendChild(dom.create('span', null, '\u00a0'));\r
- selection.select(block);\r
- block.lastChild.outerHTML = '';\r
- selection.setRng(oldRng);\r
- }\r
- };\r
-\r
- // Remove the first empty inline element of the block so this: <p><b><em></em></b>x</p> becomes this: <p>x</p>\r
- function trimInlineElementsOnLeftSideOfBlock(block) {\r
- var node = block, firstChilds = [], i;\r
-\r
- // Find inner most first child ex: <p><i><b>*</b></i></p>\r
- while (node = node.firstChild) {\r
- if (dom.isBlock(node)) {\r
- return;\r
- }\r
-\r
- if (node.nodeType == 1 && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {\r
- firstChilds.push(node);\r
- }\r
- }\r
-\r
- i = firstChilds.length;\r
- while (i--) {\r
- node = firstChilds[i];\r
- if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) {\r
- dom.remove(node);\r
- } else {\r
- // Remove <a> </a> see #5381\r
- if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') {\r
- dom.remove(node);\r
- }\r
- }\r
- }\r
- };\r
- \r
- // Moves the caret to a suitable position within the root for example in the first non pure whitespace text node or before an image\r
- function moveToCaretPosition(root) {\r
- var walker, node, rng, y, viewPort, lastNode = root, tempElm;\r
-\r
- rng = dom.createRng();\r
-\r
- if (root.hasChildNodes()) {\r
- walker = new TreeWalker(root, root);\r
-\r
- while (node = walker.current()) {\r
- if (node.nodeType == 3) {\r
- rng.setStart(node, 0);\r
- rng.setEnd(node, 0);\r
- break;\r
- }\r
-\r
- if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {\r
- rng.setStartBefore(node);\r
- rng.setEndBefore(node);\r
- break;\r
- }\r
-\r
- lastNode = node;\r
- node = walker.next();\r
- }\r
-\r
- if (!node) {\r
- rng.setStart(lastNode, 0);\r
- rng.setEnd(lastNode, 0);\r
- }\r
- } else {\r
- if (root.nodeName == 'BR') {\r
- if (root.nextSibling && dom.isBlock(root.nextSibling)) {\r
- // Trick on older IE versions to render the caret before the BR between two lists\r
- if (!documentMode || documentMode < 9) {\r
- tempElm = dom.create('br');\r
- root.parentNode.insertBefore(tempElm, root);\r
- }\r
-\r
- rng.setStartBefore(root);\r
- rng.setEndBefore(root);\r
- } else {\r
- rng.setStartAfter(root);\r
- rng.setEndAfter(root);\r
- }\r
- } else {\r
- rng.setStart(root, 0);\r
- rng.setEnd(root, 0);\r
- }\r
- }\r
-\r
- selection.setRng(rng);\r
-\r
- // Remove tempElm created for old IE:s\r
- dom.remove(tempElm);\r
-\r
- viewPort = dom.getViewPort(editor.getWin());\r
-\r
- // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs\r
- y = dom.getPos(root).y;\r
- if (y < viewPort.y || y + 25 > viewPort.y + viewPort.h) {\r
- editor.getWin().scrollTo(0, y < viewPort.y ? y : y - viewPort.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks\r
- }\r
- };\r
-\r
- // Creates a new block element by cloning the current one or creating a new one if the name is specified\r
- // This function will also copy any text formatting from the parent block and add it to the new one\r
- function createNewBlock(name) {\r
- var node = container, block, clonedNode, caretNode;\r
-\r
- block = name || parentBlockName == "TABLE" ? dom.create(name || newBlockName) : parentBlock.cloneNode(false);\r
- caretNode = block;\r
-\r
- // Clone any parent styles\r
- if (settings.keep_styles !== false) {\r
- do {\r
- if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {\r
- // Never clone a caret containers\r
- if (node.id == '_mce_caret') {\r
- continue;\r
- }\r
-\r
- clonedNode = node.cloneNode(false);\r
- dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique\r
-\r
- if (block.hasChildNodes()) {\r
- clonedNode.appendChild(block.firstChild);\r
- block.appendChild(clonedNode);\r
- } else {\r
- caretNode = clonedNode;\r
- block.appendChild(clonedNode);\r
- }\r
- }\r
- } while (node = node.parentNode);\r
- }\r
-\r
- // BR is needed in empty blocks on non IE browsers\r
- if (!tinymce.isIE) {\r
- caretNode.innerHTML = '<br data-mce-bogus="1">';\r
- }\r
-\r
- return block;\r
- };\r
-\r
- // Returns true/false if the caret is at the start/end of the parent block element\r
- function isCaretAtStartOrEndOfBlock(start) {\r
- var walker, node, name;\r
-\r
- // Caret is in the middle of a text node like "a|b"\r
- if (container.nodeType == 3 && (start ? offset > 0 : offset < container.nodeValue.length)) {\r
- return false;\r
- }\r
-\r
- // If after the last element in block node edge case for #5091\r
- if (container.parentNode == parentBlock && isAfterLastNodeInContainer && !start) {\r
- return true;\r
- }\r
-\r
- // If the caret if before the first element in parentBlock\r
- if (start && container.nodeType == 1 && container == parentBlock.firstChild) {\r
- return true;\r
- }\r
-\r
- // Caret can be before/after a table\r
- if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) {\r
- return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start);\r
- }\r
-\r
- // Walk the DOM and look for text nodes or non empty elements\r
- walker = new TreeWalker(container, parentBlock);\r
- \r
- // If caret is in beginning or end of a text block then jump to the next/previous node\r
- if (container.nodeType == 3) {\r
- if (start && offset == 0) {\r
- walker.prev();\r
- } else if (!start && offset == container.nodeValue.length) {\r
- walker.next();\r
- }\r
- }\r
-\r
- while (node = walker.current()) {\r
- if (node.nodeType === 1) {\r
- // Ignore bogus elements\r
- if (!node.getAttribute('data-mce-bogus')) {\r
- // Keep empty elements like <img /> <input /> but not trailing br:s like <p>text|<br></p>\r
- name = node.nodeName.toLowerCase();\r
- if (nonEmptyElementsMap[name] && name !== 'br') {\r
- return false;\r
- }\r
- }\r
- } else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) {\r
- return false;\r
- }\r
-\r
- if (start) {\r
- walker.prev();\r
- } else {\r
- walker.next();\r
- }\r
- }\r
-\r
- return true;\r
- };\r
-\r
- // Wraps any text nodes or inline elements in the specified forced root block name\r
- function wrapSelfAndSiblingsInDefaultBlock(container, offset) {\r
- var newBlock, parentBlock, startNode, node, next, blockName = newBlockName || 'P';\r
-\r
- // Not in a block element or in a table cell or caption\r
- parentBlock = dom.getParent(container, dom.isBlock);\r
- if (!parentBlock || !canSplitBlock(parentBlock)) {\r
- parentBlock = parentBlock || editableRoot;\r
-\r
- if (!parentBlock.hasChildNodes()) {\r
- newBlock = dom.create(blockName);\r
- parentBlock.appendChild(newBlock);\r
- rng.setStart(newBlock, 0);\r
- rng.setEnd(newBlock, 0);\r
- return newBlock;\r
- }\r
-\r
- // Find parent that is the first child of parentBlock\r
- node = container;\r
- while (node.parentNode != parentBlock) {\r
- node = node.parentNode;\r
- }\r
-\r
- // Loop left to find start node start wrapping at\r
- while (node && !dom.isBlock(node)) {\r
- startNode = node;\r
- node = node.previousSibling;\r
- }\r
-\r
- if (startNode) {\r
- newBlock = dom.create(blockName);\r
- startNode.parentNode.insertBefore(newBlock, startNode);\r
-\r
- // Start wrapping until we hit a block\r
- node = startNode;\r
- while (node && !dom.isBlock(node)) {\r
- next = node.nextSibling;\r
- newBlock.appendChild(node);\r
- node = next;\r
- }\r
-\r
- // Restore range to it's past location\r
- rng.setStart(container, offset);\r
- rng.setEnd(container, offset);\r
- }\r
- }\r
-\r
- return container;\r
- };\r
-\r
- // Inserts a block or br before/after or in the middle of a split list of the LI is empty\r
- function handleEmptyListItem() {\r
- function isFirstOrLastLi(first) {\r
- var node = containerBlock[first ? 'firstChild' : 'lastChild'];\r
-\r
- // Find first/last element since there might be whitespace there\r
- while (node) {\r
- if (node.nodeType == 1) {\r
- break;\r
- }\r
-\r
- node = node[first ? 'nextSibling' : 'previousSibling'];\r
- }\r
-\r
- return node === parentBlock;\r
- };\r
-\r
- newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR');\r
-\r
- if (isFirstOrLastLi(true) && isFirstOrLastLi()) {\r
- // Is first and last list item then replace the OL/UL with a text block\r
- dom.replace(newBlock, containerBlock);\r
- } else if (isFirstOrLastLi(true)) {\r
- // First LI in list then remove LI and add text block before list\r
- containerBlock.parentNode.insertBefore(newBlock, containerBlock);\r
- } else if (isFirstOrLastLi()) {\r
- // Last LI in list then temove LI and add text block after list\r
- dom.insertAfter(newBlock, containerBlock);\r
- renderBlockOnIE(newBlock);\r
- } else {\r
- // Middle LI in list the split the list and insert a text block in the middle\r
- // Extract after fragment and insert it after the current block\r
- tmpRng = rng.cloneRange();\r
- tmpRng.setStartAfter(parentBlock);\r
- tmpRng.setEndAfter(containerBlock);\r
- fragment = tmpRng.extractContents();\r
- dom.insertAfter(fragment, containerBlock);\r
- dom.insertAfter(newBlock, containerBlock);\r
- }\r
-\r
- dom.remove(parentBlock);\r
- moveToCaretPosition(newBlock);\r
- undoManager.add();\r
- };\r
-\r
- // Walks the parent block to the right and look for BR elements\r
- function hasRightSideBr() {\r
- var walker = new TreeWalker(container, parentBlock), node;\r
-\r
- while (node = walker.current()) {\r
- if (node.nodeName == 'BR') {\r
- return true;\r
- }\r
-\r
- node = walker.next();\r
- }\r
- }\r
- \r
- // Inserts a BR element if the forced_root_block option is set to false or empty string\r
- function insertBr() {\r
- var brElm, extraBr, marker;\r
-\r
- if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {\r
- // Insert extra BR element at the end block elements\r
- if (!tinymce.isIE && !hasRightSideBr()) {\r
- brElm = dom.create('br');\r
- rng.insertNode(brElm);\r
- rng.setStartAfter(brElm);\r
- rng.setEndAfter(brElm);\r
- extraBr = true;\r
- }\r
- }\r
-\r
- brElm = dom.create('br');\r
- rng.insertNode(brElm);\r
-\r
- // Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it\r
- if (tinymce.isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {\r
- brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);\r
- }\r
-\r
- // Insert temp marker and scroll to that\r
- marker = dom.create('span', {}, ' ');\r
- brElm.parentNode.insertBefore(marker, brElm);\r
- selection.scrollIntoView(marker);\r
- dom.remove(marker);\r
-\r
- if (!extraBr) {\r
- rng.setStartAfter(brElm);\r
- rng.setEndAfter(brElm);\r
- } else {\r
- rng.setStartBefore(brElm);\r
- rng.setEndBefore(brElm);\r
- }\r
-\r
- selection.setRng(rng);\r
- undoManager.add();\r
- };\r
-\r
- // Trims any linebreaks at the beginning of node user for example when pressing enter in a PRE element\r
- function trimLeadingLineBreaks(node) {\r
- do {\r
- if (node.nodeType === 3) {\r
- node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');\r
- }\r
-\r
- node = node.firstChild;\r
- } while (node);\r
- };\r
-\r
- function getEditableRoot(node) {\r
- var root = dom.getRoot(), parent, editableRoot;\r
-\r
- // Get all parents until we hit a non editable parent or the root\r
- parent = node;\r
- while (parent !== root && dom.getContentEditable(parent) !== "false") {\r
- if (dom.getContentEditable(parent) === "true") {\r
- editableRoot = parent;\r
- }\r
-\r
- parent = parent.parentNode;\r
- }\r
- \r
- return parent !== root ? editableRoot : root;\r
- };\r
-\r
- // Adds a BR at the end of blocks that only contains an IMG or INPUT since these might be floated and then they won't expand the block\r
- function addBrToBlockIfNeeded(block) {\r
- var lastChild;\r
-\r
- // IE will render the blocks correctly other browsers needs a BR\r
- if (!tinymce.isIE) {\r
- block.normalize(); // Remove empty text nodes that got left behind by the extract\r
-\r
- // Check if the block is empty or contains a floated last child\r
- lastChild = block.lastChild;\r
- if (!lastChild || (/^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true)))) {\r
- dom.add(block, 'br');\r
- }\r
- }\r
- };\r
-\r
- // Delete any selected contents\r
- if (!rng.collapsed) {\r
- editor.execCommand('Delete');\r
- return;\r
- }\r
-\r
- // Event is blocked by some other handler for example the lists plugin\r
- if (evt.isDefaultPrevented()) {\r
- return;\r
- }\r
-\r
- // Setup range items and newBlockName\r
- container = rng.startContainer;\r
- offset = rng.startOffset;\r
- newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block;\r
- newBlockName = newBlockName ? newBlockName.toUpperCase() : '';\r
- documentMode = dom.doc.documentMode;\r
- shiftKey = evt.shiftKey;\r
-\r
- // Resolve node index\r
- if (container.nodeType == 1 && container.hasChildNodes()) {\r
- isAfterLastNodeInContainer = offset > container.childNodes.length - 1;\r
- container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;\r
- if (isAfterLastNodeInContainer && container.nodeType == 3) {\r
- offset = container.nodeValue.length;\r
- } else {\r
- offset = 0;\r
- }\r
- }\r
-\r
- // Get editable root node normaly the body element but sometimes a div or span\r
- editableRoot = getEditableRoot(container);\r
-\r
- // If there is no editable root then enter is done inside a contentEditable false element\r
- if (!editableRoot) {\r
- return;\r
- }\r
-\r
- undoManager.beforeChange();\r
-\r
- // If editable root isn't block nor the root of the editor\r
- if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) {\r
- if (!newBlockName || shiftKey) {\r
- insertBr();\r
- }\r
-\r
- return;\r
- }\r
-\r
- // Wrap the current node and it's sibling in a default block if it's needed.\r
- // for example this <td>text|<b>text2</b></td> will become this <td><p>text|<b>text2</p></b></td>\r
- // This won't happen if root blocks are disabled or the shiftKey is pressed\r
- if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) {\r
- container = wrapSelfAndSiblingsInDefaultBlock(container, offset);\r
- }\r
-\r
- // Find parent block and setup empty block paddings\r
- parentBlock = dom.getParent(container, dom.isBlock);\r
- containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;\r
-\r
- // Setup block names\r
- parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5\r
- containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5\r
-\r
- // Enter inside block contained within a LI then split or insert before/after LI\r
- if (containerBlockName == 'LI' && !evt.ctrlKey) {\r
- parentBlock = containerBlock;\r
- parentBlockName = containerBlockName;\r
- }\r
-\r
- // Handle enter in LI\r
- if (parentBlockName == 'LI') {\r
- if (!newBlockName && shiftKey) {\r
- insertBr();\r
- return;\r
- }\r
-\r
- // Handle enter inside an empty list item\r
- if (dom.isEmpty(parentBlock)) {\r
- // Let the list plugin or browser handle nested lists for now\r
- if (/^(UL|OL|LI)$/.test(containerBlock.parentNode.nodeName)) {\r
- return false;\r
- }\r
-\r
- handleEmptyListItem();\r
- return;\r
- }\r
- }\r
-\r
- // Don't split PRE tags but insert a BR instead easier when writing code samples etc\r
- if (parentBlockName == 'PRE' && settings.br_in_pre !== false) {\r
- if (!shiftKey) {\r
- insertBr();\r
- return;\r
- }\r
- } else {\r
- // If no root block is configured then insert a BR by default or if the shiftKey is pressed\r
- if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) {\r
- insertBr();\r
- return;\r
- }\r
- }\r
-\r
- // Default block name if it's not configured\r
- newBlockName = newBlockName || 'P';\r
-\r
- // Insert new block before/after the parent block depending on caret location\r
- if (isCaretAtStartOrEndOfBlock()) {\r
- // If the caret is at the end of a header we produce a P tag after it similar to Word unless we are in a hgroup\r
- if (/^(H[1-6]|PRE)$/.test(parentBlockName) && containerBlockName != 'HGROUP') {\r
- newBlock = createNewBlock(newBlockName);\r
- } else {\r
- newBlock = createNewBlock();\r
- }\r
-\r
- // Split the current container block element if enter is pressed inside an empty inner block element\r
- if (settings.end_container_on_empty_block && canSplitBlock(containerBlock) && dom.isEmpty(parentBlock)) {\r
- // Split container block for example a BLOCKQUOTE at the current blockParent location for example a P\r
- newBlock = dom.split(containerBlock, parentBlock);\r
- } else {\r
- dom.insertAfter(newBlock, parentBlock);\r
- }\r
-\r
- moveToCaretPosition(newBlock);\r
- } else if (isCaretAtStartOrEndOfBlock(true)) {\r
- // Insert new block before\r
- newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);\r
- renderBlockOnIE(newBlock);\r
- } else {\r
- // Extract after fragment and insert it after the current block\r
- tmpRng = rng.cloneRange();\r
- tmpRng.setEndAfter(parentBlock);\r
- fragment = tmpRng.extractContents();\r
- trimLeadingLineBreaks(fragment);\r
- newBlock = fragment.firstChild;\r
- dom.insertAfter(fragment, parentBlock);\r
- trimInlineElementsOnLeftSideOfBlock(newBlock);\r
- addBrToBlockIfNeeded(parentBlock);\r
- moveToCaretPosition(newBlock);\r
- }\r
-\r
- dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique\r
- undoManager.add();\r
- }\r
-\r
- editor.onKeyDown.add(function(ed, evt) {\r
- if (evt.keyCode == 13) {\r
- if (handleEnterKey(evt) !== false) {\r
- evt.preventDefault();\r
- }\r
- }\r
- });\r
- };\r
-})(tinymce);\r
-\r
+++ /dev/null
-/**\r
- * editable_selects.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-var TinyMCE_EditableSelects = {\r
- editSelectElm : null,\r
-\r
- init : function() {\r
- var nl = document.getElementsByTagName("select"), i, d = document, o;\r
-\r
- for (i=0; i<nl.length; i++) {\r
- if (nl[i].className.indexOf('mceEditableSelect') != -1) {\r
- o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');\r
-\r
- o.className = 'mceAddSelectValue';\r
-\r
- nl[i].options[nl[i].options.length] = o;\r
- nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;\r
- }\r
- }\r
- },\r
-\r
- onChangeEditableSelect : function(e) {\r
- var d = document, ne, se = window.event ? window.event.srcElement : e.target;\r
-\r
- if (se.options[se.selectedIndex].value == '__mce_add_custom__') {\r
- ne = d.createElement("input");\r
- ne.id = se.id + "_custom";\r
- ne.name = se.name + "_custom";\r
- ne.type = "text";\r
-\r
- ne.style.width = se.offsetWidth + 'px';\r
- se.parentNode.insertBefore(ne, se);\r
- se.style.display = 'none';\r
- ne.focus();\r
- ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;\r
- ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;\r
- TinyMCE_EditableSelects.editSelectElm = se;\r
- }\r
- },\r
-\r
- onBlurEditableSelectInput : function() {\r
- var se = TinyMCE_EditableSelects.editSelectElm;\r
-\r
- if (se) {\r
- if (se.previousSibling.value != '') {\r
- addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);\r
- selectByValue(document.forms[0], se.id, se.previousSibling.value);\r
- } else\r
- selectByValue(document.forms[0], se.id, '');\r
-\r
- se.style.display = 'inline';\r
- se.parentNode.removeChild(se.previousSibling);\r
- TinyMCE_EditableSelects.editSelectElm = null;\r
- }\r
- },\r
-\r
- onKeyDown : function(e) {\r
- e = e || window.event;\r
-\r
- if (e.keyCode == 13)\r
- TinyMCE_EditableSelects.onBlurEditableSelectInput();\r
- }\r
-};\r
+++ /dev/null
-/**\r
- * form_utils.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));\r
-\r
-function getColorPickerHTML(id, target_form_element) {\r
- var h = "", dom = tinyMCEPopup.dom;\r
-\r
- if (label = dom.select('label[for=' + target_form_element + ']')[0]) {\r
- label.id = label.id || dom.uniqueId();\r
- }\r
-\r
- h += '<a role="button" aria-labelledby="' + id + '_label" id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';\r
- h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"> <span id="' + id + '_label" class="mceVoiceLabel mceIconOnly" style="display:none;">' + tinyMCEPopup.getLang('browse') + '</span></span></a>';\r
-\r
- return h;\r
-}\r
-\r
-function updateColor(img_id, form_element_id) {\r
- document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;\r
-}\r
-\r
-function setBrowserDisabled(id, state) {\r
- var img = document.getElementById(id);\r
- var lnk = document.getElementById(id + "_link");\r
-\r
- if (lnk) {\r
- if (state) {\r
- lnk.setAttribute("realhref", lnk.getAttribute("href"));\r
- lnk.removeAttribute("href");\r
- tinyMCEPopup.dom.addClass(img, 'disabled');\r
- } else {\r
- if (lnk.getAttribute("realhref"))\r
- lnk.setAttribute("href", lnk.getAttribute("realhref"));\r
-\r
- tinyMCEPopup.dom.removeClass(img, 'disabled');\r
- }\r
- }\r
-}\r
-\r
-function getBrowserHTML(id, target_form_element, type, prefix) {\r
- var option = prefix + "_" + type + "_browser_callback", cb, html;\r
-\r
- cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));\r
-\r
- if (!cb)\r
- return "";\r
-\r
- html = "";\r
- html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';\r
- html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"> </span></a>';\r
-\r
- return html;\r
-}\r
-\r
-function openBrowser(img_id, target_form_element, type, option) {\r
- var img = document.getElementById(img_id);\r
-\r
- if (img.className != "mceButtonDisabled")\r
- tinyMCEPopup.openBrowser(target_form_element, type, option);\r
-}\r
-\r
-function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {\r
- if (!form_obj || !form_obj.elements[field_name])\r
- return;\r
-\r
- if (!value)\r
- value = "";\r
-\r
- var sel = form_obj.elements[field_name];\r
-\r
- var found = false;\r
- for (var i=0; i<sel.options.length; i++) {\r
- var option = sel.options[i];\r
-\r
- if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {\r
- option.selected = true;\r
- found = true;\r
- } else\r
- option.selected = false;\r
- }\r
-\r
- if (!found && add_custom && value != '') {\r
- var option = new Option(value, value);\r
- option.selected = true;\r
- sel.options[sel.options.length] = option;\r
- sel.selectedIndex = sel.options.length - 1;\r
- }\r
-\r
- return found;\r
-}\r
-\r
-function getSelectValue(form_obj, field_name) {\r
- var elm = form_obj.elements[field_name];\r
-\r
- if (elm == null || elm.options == null || elm.selectedIndex === -1)\r
- return "";\r
-\r
- return elm.options[elm.selectedIndex].value;\r
-}\r
-\r
-function addSelectValue(form_obj, field_name, name, value) {\r
- var s = form_obj.elements[field_name];\r
- var o = new Option(name, value);\r
- s.options[s.options.length] = o;\r
-}\r
-\r
-function addClassesToList(list_id, specific_option) {\r
- // Setup class droplist\r
- var styleSelectElm = document.getElementById(list_id);\r
- var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);\r
- styles = tinyMCEPopup.getParam(specific_option, styles);\r
-\r
- if (styles) {\r
- var stylesAr = styles.split(';');\r
-\r
- for (var i=0; i<stylesAr.length; i++) {\r
- if (stylesAr != "") {\r
- var key, value;\r
-\r
- key = stylesAr[i].split('=')[0];\r
- value = stylesAr[i].split('=')[1];\r
-\r
- styleSelectElm.options[styleSelectElm.length] = new Option(key, value);\r
- }\r
- }\r
- } else {\r
- tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {\r
- styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);\r
- });\r
- }\r
-}\r
-\r
-function isVisible(element_id) {\r
- var elm = document.getElementById(element_id);\r
-\r
- return elm && elm.style.display != "none";\r
-}\r
-\r
-function convertRGBToHex(col) {\r
- var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");\r
-\r
- var rgb = col.replace(re, "$1,$2,$3").split(',');\r
- if (rgb.length == 3) {\r
- r = parseInt(rgb[0]).toString(16);\r
- g = parseInt(rgb[1]).toString(16);\r
- b = parseInt(rgb[2]).toString(16);\r
-\r
- r = r.length == 1 ? '0' + r : r;\r
- g = g.length == 1 ? '0' + g : g;\r
- b = b.length == 1 ? '0' + b : b;\r
-\r
- return "#" + r + g + b;\r
- }\r
-\r
- return col;\r
-}\r
-\r
-function convertHexToRGB(col) {\r
- if (col.indexOf('#') != -1) {\r
- col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');\r
-\r
- r = parseInt(col.substring(0, 2), 16);\r
- g = parseInt(col.substring(2, 4), 16);\r
- b = parseInt(col.substring(4, 6), 16);\r
-\r
- return "rgb(" + r + "," + g + "," + b + ")";\r
- }\r
-\r
- return col;\r
-}\r
-\r
-function trimSize(size) {\r
- return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');\r
-}\r
-\r
-function getCSSSize(size) {\r
- size = trimSize(size);\r
-\r
- if (size == "")\r
- return "";\r
-\r
- // Add px\r
- if (/^[0-9]+$/.test(size))\r
- size += 'px';\r
- // Sanity check, IE doesn't like broken values\r
- else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size)))\r
- return "";\r
-\r
- return size;\r
-}\r
-\r
-function getStyle(elm, attrib, style) {\r
- var val = tinyMCEPopup.dom.getAttrib(elm, attrib);\r
-\r
- if (val != '')\r
- return '' + val;\r
-\r
- if (typeof(style) == 'undefined')\r
- style = attrib;\r
-\r
- return tinyMCEPopup.dom.getStyle(elm, style);\r
-}\r
+++ /dev/null
-/**\r
- * mctabs.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-function MCTabs() {\r
- this.settings = [];\r
- this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');\r
-};\r
-\r
-MCTabs.prototype.init = function(settings) {\r
- this.settings = settings;\r
-};\r
-\r
-MCTabs.prototype.getParam = function(name, default_value) {\r
- var value = null;\r
-\r
- value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];\r
-\r
- // Fix bool values\r
- if (value == "true" || value == "false")\r
- return (value == "true");\r
-\r
- return value;\r
-};\r
-\r
-MCTabs.prototype.showTab =function(tab){\r
- tab.className = 'current';\r
- tab.setAttribute("aria-selected", true);\r
- tab.setAttribute("aria-expanded", true);\r
- tab.tabIndex = 0;\r
-};\r
-\r
-MCTabs.prototype.hideTab =function(tab){\r
- var t=this;\r
-\r
- tab.className = '';\r
- tab.setAttribute("aria-selected", false);\r
- tab.setAttribute("aria-expanded", false);\r
- tab.tabIndex = -1;\r
-};\r
-\r
-MCTabs.prototype.showPanel = function(panel) {\r
- panel.className = 'current'; \r
- panel.setAttribute("aria-hidden", false);\r
-};\r
-\r
-MCTabs.prototype.hidePanel = function(panel) {\r
- panel.className = 'panel';\r
- panel.setAttribute("aria-hidden", true);\r
-}; \r
-\r
-MCTabs.prototype.getPanelForTab = function(tabElm) {\r
- return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls");\r
-};\r
-\r
-MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) {\r
- var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;\r
-\r
- tabElm = document.getElementById(tab_id);\r
-\r
- if (panel_id === undefined) {\r
- panel_id = t.getPanelForTab(tabElm);\r
- }\r
-\r
- panelElm= document.getElementById(panel_id);\r
- panelContainerElm = panelElm ? panelElm.parentNode : null;\r
- tabContainerElm = tabElm ? tabElm.parentNode : null;\r
- selectionClass = t.getParam('selection_class', 'current');\r
-\r
- if (tabElm && tabContainerElm) {\r
- nodes = tabContainerElm.childNodes;\r
-\r
- // Hide all other tabs\r
- for (i = 0; i < nodes.length; i++) {\r
- if (nodes[i].nodeName == "LI") {\r
- t.hideTab(nodes[i]);\r
- }\r
- }\r
-\r
- // Show selected tab\r
- t.showTab(tabElm);\r
- }\r
-\r
- if (panelElm && panelContainerElm) {\r
- nodes = panelContainerElm.childNodes;\r
-\r
- // Hide all other panels\r
- for (i = 0; i < nodes.length; i++) {\r
- if (nodes[i].nodeName == "DIV")\r
- t.hidePanel(nodes[i]);\r
- }\r
-\r
- if (!avoid_focus) { \r
- tabElm.focus();\r
- }\r
-\r
- // Show selected panel\r
- t.showPanel(panelElm);\r
- }\r
-};\r
-\r
-MCTabs.prototype.getAnchor = function() {\r
- var pos, url = document.location.href;\r
-\r
- if ((pos = url.lastIndexOf('#')) != -1)\r
- return url.substring(pos + 1);\r
-\r
- return "";\r
-};\r
-\r
-\r
-//Global instance\r
-var mcTabs = new MCTabs();\r
-\r
-tinyMCEPopup.onInit.add(function() {\r
- var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;\r
-\r
- each(dom.select('div.tabs'), function(tabContainerElm) {\r
- var keyNav;\r
-\r
- dom.setAttrib(tabContainerElm, "role", "tablist"); \r
-\r
- var items = tinyMCEPopup.dom.select('li', tabContainerElm);\r
- var action = function(id) {\r
- mcTabs.displayTab(id, mcTabs.getPanelForTab(id));\r
- mcTabs.onChange.dispatch(id);\r
- };\r
-\r
- each(items, function(item) {\r
- dom.setAttrib(item, 'role', 'tab');\r
- dom.bind(item, 'click', function(evt) {\r
- action(item.id);\r
- });\r
- });\r
-\r
- dom.bind(dom.getRoot(), 'keydown', function(evt) {\r
- if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab\r
- keyNav.moveFocus(evt.shiftKey ? -1 : 1);\r
- tinymce.dom.Event.cancel(evt);\r
- }\r
- });\r
-\r
- each(dom.select('a', tabContainerElm), function(a) {\r
- dom.setAttrib(a, 'tabindex', '-1');\r
- });\r
-\r
- keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {\r
- root: tabContainerElm,\r
- items: items,\r
- onAction: action,\r
- actOnFocus: true,\r
- enableLeftRight: true,\r
- enableUpDown: true\r
- }, tinyMCEPopup.dom);\r
- });\r
-});
\ No newline at end of file
+++ /dev/null
-/**\r
- * validate.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-/**\r
- // String validation:\r
-\r
- if (!Validator.isEmail('myemail'))\r
- alert('Invalid email.');\r
-\r
- // Form validation:\r
-\r
- var f = document.forms['myform'];\r
-\r
- if (!Validator.isEmail(f.myemail))\r
- alert('Invalid email.');\r
-*/\r
-\r
-var Validator = {\r
- isEmail : function(s) {\r
- return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');\r
- },\r
-\r
- isAbsUrl : function(s) {\r
- return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');\r
- },\r
-\r
- isSize : function(s) {\r
- return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');\r
- },\r
-\r
- isId : function(s) {\r
- return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');\r
- },\r
-\r
- isEmpty : function(s) {\r
- var nl, i;\r
-\r
- if (s.nodeName == 'SELECT' && s.selectedIndex < 1)\r
- return true;\r
-\r
- if (s.type == 'checkbox' && !s.checked)\r
- return true;\r
-\r
- if (s.type == 'radio') {\r
- for (i=0, nl = s.form.elements; i<nl.length; i++) {\r
- if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)\r
- return false;\r
- }\r
-\r
- return true;\r
- }\r
-\r
- return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);\r
- },\r
-\r
- isNumber : function(s, d) {\r
- return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));\r
- },\r
-\r
- test : function(s, p) {\r
- s = s.nodeType == 1 ? s.value : s;\r
-\r
- return s == '' || new RegExp(p).test(s);\r
- }\r
-};\r
-\r
-var AutoValidator = {\r
- settings : {\r
- id_cls : 'id',\r
- int_cls : 'int',\r
- url_cls : 'url',\r
- number_cls : 'number',\r
- email_cls : 'email',\r
- size_cls : 'size',\r
- required_cls : 'required',\r
- invalid_cls : 'invalid',\r
- min_cls : 'min',\r
- max_cls : 'max'\r
- },\r
-\r
- init : function(s) {\r
- var n;\r
-\r
- for (n in s)\r
- this.settings[n] = s[n];\r
- },\r
-\r
- validate : function(f) {\r
- var i, nl, s = this.settings, c = 0;\r
-\r
- nl = this.tags(f, 'label');\r
- for (i=0; i<nl.length; i++) {\r
- this.removeClass(nl[i], s.invalid_cls);\r
- nl[i].setAttribute('aria-invalid', false);\r
- }\r
-\r
- c += this.validateElms(f, 'input');\r
- c += this.validateElms(f, 'select');\r
- c += this.validateElms(f, 'textarea');\r
-\r
- return c == 3;\r
- },\r
-\r
- invalidate : function(n) {\r
- this.mark(n.form, n);\r
- },\r
- \r
- getErrorMessages : function(f) {\r
- var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;\r
- nl = this.tags(f, "label");\r
- for (i=0; i<nl.length; i++) {\r
- if (this.hasClass(nl[i], s.invalid_cls)) {\r
- field = document.getElementById(nl[i].getAttribute("for"));\r
- values = { field: nl[i].textContent };\r
- if (this.hasClass(field, s.min_cls, true)) {\r
- message = ed.getLang('invalid_data_min');\r
- values.min = this.getNum(field, s.min_cls);\r
- } else if (this.hasClass(field, s.number_cls)) {\r
- message = ed.getLang('invalid_data_number');\r
- } else if (this.hasClass(field, s.size_cls)) {\r
- message = ed.getLang('invalid_data_size');\r
- } else {\r
- message = ed.getLang('invalid_data');\r
- }\r
- \r
- message = message.replace(/{\#([^}]+)\}/g, function(a, b) {\r
- return values[b] || '{#' + b + '}';\r
- });\r
- messages.push(message);\r
- }\r
- }\r
- return messages;\r
- },\r
-\r
- reset : function(e) {\r
- var t = ['label', 'input', 'select', 'textarea'];\r
- var i, j, nl, s = this.settings;\r
-\r
- if (e == null)\r
- return;\r
-\r
- for (i=0; i<t.length; i++) {\r
- nl = this.tags(e.form ? e.form : e, t[i]);\r
- for (j=0; j<nl.length; j++) {\r
- this.removeClass(nl[j], s.invalid_cls);\r
- nl[j].setAttribute('aria-invalid', false);\r
- }\r
- }\r
- },\r
-\r
- validateElms : function(f, e) {\r
- var nl, i, n, s = this.settings, st = true, va = Validator, v;\r
-\r
- nl = this.tags(f, e);\r
- for (i=0; i<nl.length; i++) {\r
- n = nl[i];\r
-\r
- this.removeClass(n, s.invalid_cls);\r
-\r
- if (this.hasClass(n, s.required_cls) && va.isEmpty(n))\r
- st = this.mark(f, n);\r
-\r
- if (this.hasClass(n, s.number_cls) && !va.isNumber(n))\r
- st = this.mark(f, n);\r
-\r
- if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))\r
- st = this.mark(f, n);\r
-\r
- if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))\r
- st = this.mark(f, n);\r
-\r
- if (this.hasClass(n, s.email_cls) && !va.isEmail(n))\r
- st = this.mark(f, n);\r
-\r
- if (this.hasClass(n, s.size_cls) && !va.isSize(n))\r
- st = this.mark(f, n);\r
-\r
- if (this.hasClass(n, s.id_cls) && !va.isId(n))\r
- st = this.mark(f, n);\r
-\r
- if (this.hasClass(n, s.min_cls, true)) {\r
- v = this.getNum(n, s.min_cls);\r
-\r
- if (isNaN(v) || parseInt(n.value) < parseInt(v))\r
- st = this.mark(f, n);\r
- }\r
-\r
- if (this.hasClass(n, s.max_cls, true)) {\r
- v = this.getNum(n, s.max_cls);\r
-\r
- if (isNaN(v) || parseInt(n.value) > parseInt(v))\r
- st = this.mark(f, n);\r
- }\r
- }\r
-\r
- return st;\r
- },\r
-\r
- hasClass : function(n, c, d) {\r
- return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);\r
- },\r
-\r
- getNum : function(n, c) {\r
- c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];\r
- c = c.replace(/[^0-9]/g, '');\r
-\r
- return c;\r
- },\r
-\r
- addClass : function(n, c, b) {\r
- var o = this.removeClass(n, c);\r
- n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;\r
- },\r
-\r
- removeClass : function(n, c) {\r
- c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');\r
- return n.className = c != ' ' ? c : '';\r
- },\r
-\r
- tags : function(f, s) {\r
- return f.getElementsByTagName(s);\r
- },\r
-\r
- mark : function(f, n) {\r
- var s = this.settings;\r
-\r
- this.addClass(n, s.invalid_cls);\r
- n.setAttribute('aria-invalid', 'true');\r
- this.markLabels(f, n, s.invalid_cls);\r
-\r
- return false;\r
- },\r
-\r
- markLabels : function(f, n, ic) {\r
- var nl, i;\r
-\r
- nl = this.tags(f, "label");\r
- for (i=0; i<nl.length; i++) {\r
- if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)\r
- this.addClass(nl[i], ic);\r
- }\r
-\r
- return null;\r
- }\r
-};\r