mirador_rails 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/app/controllers/mirador_rails/locales_controller.rb +10 -0
  4. data/config/routes.rb +7 -0
  5. data/lib/mirador_rails/exceptions.rb +6 -0
  6. data/lib/mirador_rails/locale.rb +24 -0
  7. data/lib/mirador_rails/version.rb +1 -1
  8. data/lib/mirador_rails.rb +9 -2
  9. data/mirador_rails.gemspec +3 -0
  10. data/tasks/mirador_rails.rake +44 -10
  11. data/vendor/assets/images/border_type_4.png +0 -0
  12. data/vendor/assets/images/border_type_5.png +0 -0
  13. data/vendor/assets/javascripts/mirador/mirador.js.erb +20105 -0
  14. data/vendor/assets/javascripts/mirador.js +4 -1
  15. data/vendor/assets/locales/de/translation.json +3 -0
  16. data/vendor/assets/locales/en/translation.json +11 -7
  17. data/vendor/assets/locales/ko/translation.json +18 -9
  18. data/vendor/assets/stylesheets/enhancements.scss +36 -0
  19. data/vendor/assets/stylesheets/mirador-combined.css +1488 -1642
  20. data/vendor/assets/stylesheets/mirador.css +1 -0
  21. metadata +52 -174
  22. data/vendor/assets/javascripts/mirador.min.js +0 -89
  23. data/vendor/assets/javascripts/mirador.min.js.map +0 -1
  24. data/vendor/assets/plugins/plugins/advlist/plugin.js +0 -97
  25. data/vendor/assets/plugins/plugins/advlist/plugin.min.js +0 -1
  26. data/vendor/assets/plugins/plugins/anchor/plugin.js +0 -45
  27. data/vendor/assets/plugins/plugins/anchor/plugin.min.js +0 -1
  28. data/vendor/assets/plugins/plugins/autolink/plugin.js +0 -194
  29. data/vendor/assets/plugins/plugins/autolink/plugin.min.js +0 -1
  30. data/vendor/assets/plugins/plugins/autoresize/plugin.js +0 -152
  31. data/vendor/assets/plugins/plugins/autoresize/plugin.min.js +0 -1
  32. data/vendor/assets/plugins/plugins/autosave/plugin.js +0 -165
  33. data/vendor/assets/plugins/plugins/autosave/plugin.min.js +0 -1
  34. data/vendor/assets/plugins/plugins/bbcode/plugin.js +0 -123
  35. data/vendor/assets/plugins/plugins/bbcode/plugin.min.js +0 -1
  36. data/vendor/assets/plugins/plugins/charmap/plugin.js +0 -370
  37. data/vendor/assets/plugins/plugins/charmap/plugin.min.js +0 -1
  38. data/vendor/assets/plugins/plugins/code/plugin.js +0 -60
  39. data/vendor/assets/plugins/plugins/code/plugin.min.js +0 -1
  40. data/vendor/assets/plugins/plugins/colorpicker/plugin.js +0 -112
  41. data/vendor/assets/plugins/plugins/colorpicker/plugin.min.js +0 -1
  42. data/vendor/assets/plugins/plugins/compat3x/css/dialog.css +0 -118
  43. data/vendor/assets/plugins/plugins/compat3x/img/buttons.png +0 -0
  44. data/vendor/assets/plugins/plugins/compat3x/img/icons.gif +0 -0
  45. data/vendor/assets/plugins/plugins/compat3x/img/items.gif +0 -0
  46. data/vendor/assets/plugins/plugins/compat3x/img/menu_arrow.gif +0 -0
  47. data/vendor/assets/plugins/plugins/compat3x/img/menu_check.gif +0 -0
  48. data/vendor/assets/plugins/plugins/compat3x/img/progress.gif +0 -0
  49. data/vendor/assets/plugins/plugins/compat3x/img/tabs.gif +0 -0
  50. data/vendor/assets/plugins/plugins/compat3x/plugin.js +0 -297
  51. data/vendor/assets/plugins/plugins/compat3x/plugin.min.js +0 -1
  52. data/vendor/assets/plugins/plugins/compat3x/tiny_mce_popup.js +0 -542
  53. data/vendor/assets/plugins/plugins/compat3x/utils/editable_selects.js +0 -70
  54. data/vendor/assets/plugins/plugins/compat3x/utils/form_utils.js +0 -210
  55. data/vendor/assets/plugins/plugins/compat3x/utils/mctabs.js +0 -164
  56. data/vendor/assets/plugins/plugins/compat3x/utils/validate.js +0 -252
  57. data/vendor/assets/plugins/plugins/contextmenu/plugin.js +0 -87
  58. data/vendor/assets/plugins/plugins/contextmenu/plugin.min.js +0 -1
  59. data/vendor/assets/plugins/plugins/directionality/plugin.js +0 -64
  60. data/vendor/assets/plugins/plugins/directionality/plugin.min.js +0 -1
  61. data/vendor/assets/plugins/plugins/emoticons/img/smiley-cool.gif +0 -0
  62. data/vendor/assets/plugins/plugins/emoticons/img/smiley-cry.gif +0 -0
  63. data/vendor/assets/plugins/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  64. data/vendor/assets/plugins/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  65. data/vendor/assets/plugins/plugins/emoticons/img/smiley-frown.gif +0 -0
  66. data/vendor/assets/plugins/plugins/emoticons/img/smiley-innocent.gif +0 -0
  67. data/vendor/assets/plugins/plugins/emoticons/img/smiley-kiss.gif +0 -0
  68. data/vendor/assets/plugins/plugins/emoticons/img/smiley-laughing.gif +0 -0
  69. data/vendor/assets/plugins/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  70. data/vendor/assets/plugins/plugins/emoticons/img/smiley-sealed.gif +0 -0
  71. data/vendor/assets/plugins/plugins/emoticons/img/smiley-smile.gif +0 -0
  72. data/vendor/assets/plugins/plugins/emoticons/img/smiley-surprised.gif +0 -0
  73. data/vendor/assets/plugins/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  74. data/vendor/assets/plugins/plugins/emoticons/img/smiley-undecided.gif +0 -0
  75. data/vendor/assets/plugins/plugins/emoticons/img/smiley-wink.gif +0 -0
  76. data/vendor/assets/plugins/plugins/emoticons/img/smiley-yell.gif +0 -0
  77. data/vendor/assets/plugins/plugins/emoticons/plugin.js +0 -65
  78. data/vendor/assets/plugins/plugins/emoticons/plugin.min.js +0 -1
  79. data/vendor/assets/plugins/plugins/example/dialog.html +0 -8
  80. data/vendor/assets/plugins/plugins/example/plugin.js +0 -68
  81. data/vendor/assets/plugins/plugins/example/plugin.min.js +0 -1
  82. data/vendor/assets/plugins/plugins/example_dependency/plugin.js +0 -22
  83. data/vendor/assets/plugins/plugins/example_dependency/plugin.min.js +0 -1
  84. data/vendor/assets/plugins/plugins/fullpage/plugin.js +0 -490
  85. data/vendor/assets/plugins/plugins/fullpage/plugin.min.js +0 -1
  86. data/vendor/assets/plugins/plugins/fullscreen/plugin.js +0 -136
  87. data/vendor/assets/plugins/plugins/fullscreen/plugin.min.js +0 -1
  88. data/vendor/assets/plugins/plugins/hr/plugin.js +0 -30
  89. data/vendor/assets/plugins/plugins/hr/plugin.min.js +0 -1
  90. data/vendor/assets/plugins/plugins/image/plugin.js +0 -439
  91. data/vendor/assets/plugins/plugins/image/plugin.min.js +0 -1
  92. data/vendor/assets/plugins/plugins/importcss/plugin.js +0 -195
  93. data/vendor/assets/plugins/plugins/importcss/plugin.min.js +0 -1
  94. data/vendor/assets/plugins/plugins/insertdatetime/plugin.js +0 -121
  95. data/vendor/assets/plugins/plugins/insertdatetime/plugin.min.js +0 -1
  96. data/vendor/assets/plugins/plugins/layer/plugin.js +0 -225
  97. data/vendor/assets/plugins/plugins/layer/plugin.min.js +0 -1
  98. data/vendor/assets/plugins/plugins/legacyoutput/plugin.js +0 -211
  99. data/vendor/assets/plugins/plugins/legacyoutput/plugin.min.js +0 -1
  100. data/vendor/assets/plugins/plugins/link/plugin.js +0 -400
  101. data/vendor/assets/plugins/plugins/link/plugin.min.js +0 -1
  102. data/vendor/assets/plugins/plugins/lists/plugin.js +0 -791
  103. data/vendor/assets/plugins/plugins/lists/plugin.min.js +0 -1
  104. data/vendor/assets/plugins/plugins/media/moxieplayer.swf +0 -0
  105. data/vendor/assets/plugins/plugins/media/plugin.js +0 -774
  106. data/vendor/assets/plugins/plugins/media/plugin.min.js +0 -1
  107. data/vendor/assets/plugins/plugins/nonbreaking/plugin.js +0 -53
  108. data/vendor/assets/plugins/plugins/nonbreaking/plugin.min.js +0 -1
  109. data/vendor/assets/plugins/plugins/noneditable/plugin.js +0 -540
  110. data/vendor/assets/plugins/plugins/noneditable/plugin.min.js +0 -1
  111. data/vendor/assets/plugins/plugins/pagebreak/plugin.js +0 -88
  112. data/vendor/assets/plugins/plugins/pagebreak/plugin.min.js +0 -1
  113. data/vendor/assets/plugins/plugins/paste/classes/Clipboard.js +0 -634
  114. data/vendor/assets/plugins/plugins/paste/classes/Plugin.js +0 -110
  115. data/vendor/assets/plugins/plugins/paste/classes/Quirks.js +0 -159
  116. data/vendor/assets/plugins/plugins/paste/classes/Utils.js +0 -130
  117. data/vendor/assets/plugins/plugins/paste/classes/WordFilter.js +0 -493
  118. data/vendor/assets/plugins/plugins/paste/plugin.dev.js +0 -120
  119. data/vendor/assets/plugins/plugins/paste/plugin.js +0 -1625
  120. data/vendor/assets/plugins/plugins/paste/plugin.min.js +0 -1
  121. data/vendor/assets/plugins/plugins/preview/plugin.js +0 -88
  122. data/vendor/assets/plugins/plugins/preview/plugin.min.js +0 -1
  123. data/vendor/assets/plugins/plugins/print/plugin.js +0 -32
  124. data/vendor/assets/plugins/plugins/print/plugin.min.js +0 -1
  125. data/vendor/assets/plugins/plugins/save/plugin.js +0 -94
  126. data/vendor/assets/plugins/plugins/save/plugin.min.js +0 -1
  127. data/vendor/assets/plugins/plugins/searchreplace/plugin.js +0 -594
  128. data/vendor/assets/plugins/plugins/searchreplace/plugin.min.js +0 -1
  129. data/vendor/assets/plugins/plugins/spellchecker/classes/DomTextMatcher.js +0 -470
  130. data/vendor/assets/plugins/plugins/spellchecker/classes/Plugin.js +0 -436
  131. data/vendor/assets/plugins/plugins/spellchecker/plugin.dev.js +0 -117
  132. data/vendor/assets/plugins/plugins/spellchecker/plugin.js +0 -996
  133. data/vendor/assets/plugins/plugins/spellchecker/plugin.min.js +0 -1
  134. data/vendor/assets/plugins/plugins/tabfocus/plugin.js +0 -120
  135. data/vendor/assets/plugins/plugins/tabfocus/plugin.min.js +0 -1
  136. data/vendor/assets/plugins/plugins/table/classes/CellSelection.js +0 -176
  137. data/vendor/assets/plugins/plugins/table/classes/Dialogs.js +0 -749
  138. data/vendor/assets/plugins/plugins/table/classes/Plugin.js +0 -422
  139. data/vendor/assets/plugins/plugins/table/classes/Quirks.js +0 -372
  140. data/vendor/assets/plugins/plugins/table/classes/TableGrid.js +0 -864
  141. data/vendor/assets/plugins/plugins/table/plugin.dev.js +0 -118
  142. data/vendor/assets/plugins/plugins/table/plugin.js +0 -2680
  143. data/vendor/assets/plugins/plugins/table/plugin.min.js +0 -1
  144. data/vendor/assets/plugins/plugins/template/plugin.js +0 -262
  145. data/vendor/assets/plugins/plugins/template/plugin.min.js +0 -1
  146. data/vendor/assets/plugins/plugins/textcolor/plugin.js +0 -272
  147. data/vendor/assets/plugins/plugins/textcolor/plugin.min.js +0 -1
  148. data/vendor/assets/plugins/plugins/textpattern/plugin.js +0 -268
  149. data/vendor/assets/plugins/plugins/textpattern/plugin.min.js +0 -1
  150. data/vendor/assets/plugins/plugins/visualblocks/css/visualblocks.css +0 -135
  151. data/vendor/assets/plugins/plugins/visualblocks/img/address.gif +0 -0
  152. data/vendor/assets/plugins/plugins/visualblocks/img/article.gif +0 -0
  153. data/vendor/assets/plugins/plugins/visualblocks/img/aside.gif +0 -0
  154. data/vendor/assets/plugins/plugins/visualblocks/img/blockquote.gif +0 -0
  155. data/vendor/assets/plugins/plugins/visualblocks/img/div.gif +0 -0
  156. data/vendor/assets/plugins/plugins/visualblocks/img/dl.gif +0 -0
  157. data/vendor/assets/plugins/plugins/visualblocks/img/figure.gif +0 -0
  158. data/vendor/assets/plugins/plugins/visualblocks/img/h1.gif +0 -0
  159. data/vendor/assets/plugins/plugins/visualblocks/img/h2.gif +0 -0
  160. data/vendor/assets/plugins/plugins/visualblocks/img/h3.gif +0 -0
  161. data/vendor/assets/plugins/plugins/visualblocks/img/h4.gif +0 -0
  162. data/vendor/assets/plugins/plugins/visualblocks/img/h5.gif +0 -0
  163. data/vendor/assets/plugins/plugins/visualblocks/img/h6.gif +0 -0
  164. data/vendor/assets/plugins/plugins/visualblocks/img/hgroup.gif +0 -0
  165. data/vendor/assets/plugins/plugins/visualblocks/img/ol.gif +0 -0
  166. data/vendor/assets/plugins/plugins/visualblocks/img/p.gif +0 -0
  167. data/vendor/assets/plugins/plugins/visualblocks/img/pre.gif +0 -0
  168. data/vendor/assets/plugins/plugins/visualblocks/img/section.gif +0 -0
  169. data/vendor/assets/plugins/plugins/visualblocks/img/ul.gif +0 -0
  170. data/vendor/assets/plugins/plugins/visualblocks/plugin.js +0 -86
  171. data/vendor/assets/plugins/plugins/visualblocks/plugin.min.js +0 -1
  172. data/vendor/assets/plugins/plugins/visualchars/plugin.js +0 -88
  173. data/vendor/assets/plugins/plugins/visualchars/plugin.min.js +0 -1
  174. data/vendor/assets/plugins/plugins/wordcount/plugin.js +0 -69
  175. data/vendor/assets/plugins/plugins/wordcount/plugin.min.js +0 -1
  176. data/vendor/assets/skins/skins/lightgray/content.inline.min.css +0 -1
  177. data/vendor/assets/skins/skins/lightgray/content.min.css +0 -1
  178. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.eot +0 -0
  179. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.svg +0 -62
  180. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  181. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.woff +0 -0
  182. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.eot +0 -0
  183. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.svg +0 -63
  184. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.ttf +0 -0
  185. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.woff +0 -0
  186. data/vendor/assets/skins/skins/lightgray/img/anchor.gif +0 -0
  187. data/vendor/assets/skins/skins/lightgray/img/loader.gif +0 -0
  188. data/vendor/assets/skins/skins/lightgray/img/object.gif +0 -0
  189. data/vendor/assets/skins/skins/lightgray/img/trans.gif +0 -0
  190. data/vendor/assets/skins/skins/lightgray/skin.ie7.min.css +0 -1
  191. data/vendor/assets/skins/skins/lightgray/skin.min.css +0 -1
  192. data/vendor/assets/themes/themes/modern/theme.js +0 -617
  193. data/vendor/assets/themes/themes/modern/theme.min.js +0 -1
@@ -1 +0,0 @@
1
- !function(a,b){"use strict";function c(a,b){for(var c,d=[],g=0;g<a.length;++g){if(c=f[a[g]]||e(a[g]),!c)throw"module definition dependecy not found: "+a[g];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){f[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}var f={};d("tinymce/tableplugin/TableGrid",["tinymce/util/Tools","tinymce/Env"],function(a,c){function d(a,b){return parseInt(a.getAttribute(b)||1,10)}var e=a.each;return function(f,g){function h(){var a=0;F=[],G=0,e(["thead","tbody","tfoot"],function(b){var c=L.select("> "+b+" tr",g);e(c,function(c,f){f+=a,e(L.select("> td, > th",c),function(a,c){var e,g,h,i;if(F[f])for(;F[f][c];)c++;for(h=d(a,"rowspan"),i=d(a,"colspan"),g=f;f+h>g;g++)for(F[g]||(F[g]=[]),e=c;c+i>e;e++)F[g][e]={part:b,real:g==f&&e==c,elm:a,rowspan:h,colspan:i};G=Math.max(G,c+1)})}),a+=c.length})}function i(a,b){return a=a.cloneNode(b),a.removeAttribute("id"),a}function j(a,b){var c;return c=F[b],c?c[a]:void 0}function k(a,b,c){a&&(c=parseInt(c,10),1===c?a.removeAttribute(b,1):a.setAttribute(b,c,1))}function l(a){return a&&(L.hasClass(a.elm,"mce-item-selected")||a==J)}function m(){var a=[];return e(g.rows,function(b){e(b.cells,function(c){return L.hasClass(c,"mce-item-selected")||J&&c==J.elm?(a.push(b),!1):void 0})}),a}function n(){var a=L.createRng();a.setStartAfter(g),a.setEndAfter(g),K.setRng(a),L.remove(g)}function o(b){var d,g={};return f.settings.table_clone_elements!==!1&&(g=a.makeMap((f.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),a.walk(b,function(a){var f;return 3==a.nodeType?(e(L.getParents(a.parentNode,null,b).reverse(),function(a){g[a.nodeName]&&(a=i(a,!1),d?f&&f.appendChild(a):d=f=a,f=a)}),f&&(f.innerHTML=c.ie?"&nbsp;":'<br data-mce-bogus="1" />'),!1):void 0},"childNodes"),b=i(b,!1),k(b,"rowSpan",1),k(b,"colSpan",1),d?b.appendChild(d):(!c.ie||c.ie>10)&&(b.innerHTML='<br data-mce-bogus="1" />'),b}function p(){var a,b=L.createRng();return e(L.select("tr",g),function(a){0===a.cells.length&&L.remove(a)}),0===L.select("tr",g).length?(b.setStartBefore(g),b.setEndBefore(g),K.setRng(b),void L.remove(g)):(e(L.select("thead,tbody,tfoot",g),function(a){0===a.rows.length&&L.remove(a)}),h(),void(H&&(a=F[Math.min(F.length-1,H.y)],a&&(K.select(a[Math.min(a.length-1,H.x)].elm,!0),K.collapse(!0)))))}function q(a,b,c,d){var e,f,g,h,i;for(e=F[b][a].elm.parentNode,g=1;c>=g;g++)if(e=L.getNext(e,"tr")){for(f=a;f>=0;f--)if(i=F[b+g][f].elm,i.parentNode==e){for(h=1;d>=h;h++)L.insertAfter(o(i),i);break}if(-1==f)for(h=1;d>=h;h++)e.insertBefore(o(e.cells[0]),e.cells[0])}}function r(){e(F,function(a,b){e(a,function(a,c){var e,f,g;if(l(a)&&(a=a.elm,e=d(a,"colspan"),f=d(a,"rowspan"),e>1||f>1)){for(k(a,"rowSpan",1),k(a,"colSpan",1),g=0;e-1>g;g++)L.insertAfter(o(a),a);q(c,b,f-1,e)}})})}function s(b,c,d){var f,g,i,m,n,o,q,s,t,u,v;if(b?(f=A(b),g=f.x,i=f.y,m=g+(c-1),n=i+(d-1)):(H=I=null,e(F,function(a,b){e(a,function(a,c){l(a)&&(H||(H={x:c,y:b}),I={x:c,y:b})})}),H&&(g=H.x,i=H.y,m=I.x,n=I.y)),s=j(g,i),t=j(m,n),s&&t&&s.part==t.part){for(r(),h(),s=j(g,i).elm,k(s,"colSpan",m-g+1),k(s,"rowSpan",n-i+1),q=i;n>=q;q++)for(o=g;m>=o;o++)F[q]&&F[q][o]&&(b=F[q][o].elm,b!=s&&(u=a.grep(b.childNodes),e(u,function(a){s.appendChild(a)}),u.length&&(u=a.grep(s.childNodes),v=0,e(u,function(a){"BR"==a.nodeName&&L.getAttrib(a,"data-mce-bogus")&&v++<u.length-1&&s.removeChild(a)})),L.remove(b)));p()}}function t(a){var c,f,g,h,j,m,n,p,q;if(e(F,function(b,d){return e(b,function(b){return l(b)&&(b=b.elm,j=b.parentNode,m=i(j,!1),c=d,a)?!1:void 0}),a?!c:void 0}),c!==b){for(h=0;h<F[0].length;h++)if(F[c][h]&&(f=F[c][h].elm,f!=g)){if(a){if(c>0&&F[c-1][h]&&(p=F[c-1][h].elm,q=d(p,"rowSpan"),q>1)){k(p,"rowSpan",q+1);continue}}else if(q=d(f,"rowspan"),q>1){k(f,"rowSpan",q+1);continue}n=o(f),k(n,"colSpan",f.colSpan),m.appendChild(n),g=f}m.hasChildNodes()&&(a?j.parentNode.insertBefore(m,j):L.insertAfter(m,j))}}function u(a){var b,c;e(F,function(c){return e(c,function(c,d){return l(c)&&(b=d,a)?!1:void 0}),a?!b:void 0}),e(F,function(e,f){var g,h,i;e[b]&&(g=e[b].elm,g!=c&&(i=d(g,"colspan"),h=d(g,"rowspan"),1==i?a?(g.parentNode.insertBefore(o(g),g),q(b,f,h-1,i)):(L.insertAfter(o(g),g),q(b,f,h-1,i)):k(g,"colSpan",g.colSpan+1),c=g))})}function v(){var b=[];e(F,function(c){e(c,function(c,f){l(c)&&-1===a.inArray(b,f)&&(e(F,function(a){var b,c=a[f].elm;b=d(c,"colSpan"),b>1?k(c,"colSpan",b-1):L.remove(c)}),b.push(f))})}),p()}function w(){function a(a){var b,c;e(a.cells,function(a){var c=d(a,"rowSpan");c>1&&(k(a,"rowSpan",c-1),b=A(a),q(b.x,b.y,1,1))}),b=A(a.cells[0]),e(F[b.y],function(a){var b;a=a.elm,a!=c&&(b=d(a,"rowSpan"),1>=b?L.remove(a):k(a,"rowSpan",b-1),c=a)})}var b;b=m(),e(b.reverse(),function(b){a(b)}),p()}function x(){var a=m();return L.remove(a),p(),a}function y(){var a=m();return e(a,function(b,c){a[c]=i(b,!0)}),a}function z(a,b){var c=m(),d=c[b?0:c.length-1],f=d.cells.length;a&&(e(F,function(a){var b;return f=0,e(a,function(a){a.real&&(f+=a.colspan),a.elm.parentNode==d&&(b=1)}),b?!1:void 0}),b||a.reverse(),e(a,function(a){var c,e,g=a.cells.length;for(c=0;g>c;c++)e=a.cells[c],k(e,"colSpan",1),k(e,"rowSpan",1);for(c=g;f>c;c++)a.appendChild(o(a.cells[g-1]));for(c=f;g>c;c++)L.remove(a.cells[c]);b?d.parentNode.insertBefore(a,d):L.insertAfter(a,d)}),L.removeClass(L.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function A(a){var b;return e(F,function(c,d){return e(c,function(c,e){return c.elm==a?(b={x:e,y:d},!1):void 0}),!b}),b}function B(a){H=A(a)}function C(){var a,b;return a=b=0,e(F,function(c,d){e(c,function(c,e){var f,g;l(c)&&(c=F[d][e],e>a&&(a=e),d>b&&(b=d),c.real&&(f=c.colspan-1,g=c.rowspan-1,f&&e+f>a&&(a=e+f),g&&d+g>b&&(b=d+g)))})}),{x:a,y:b}}function D(a){var b,c,d,e,f,g,h,i,j,k;if(I=A(a),H&&I){for(b=Math.min(H.x,I.x),c=Math.min(H.y,I.y),d=Math.max(H.x,I.x),e=Math.max(H.y,I.y),f=d,g=e,k=c;g>=k;k++)a=F[k][b],a.real||b-(a.colspan-1)<b&&(b-=a.colspan-1);for(j=b;f>=j;j++)a=F[c][j],a.real||c-(a.rowspan-1)<c&&(c-=a.rowspan-1);for(k=c;e>=k;k++)for(j=b;d>=j;j++)a=F[k][j],a.real&&(h=a.colspan-1,i=a.rowspan-1,h&&j+h>f&&(f=j+h),i&&k+i>g&&(g=k+i));for(L.removeClass(L.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),k=c;g>=k;k++)for(j=b;f>=j;j++)F[k][j]&&L.addClass(F[k][j].elm,"mce-item-selected")}}function E(a,b){var c,d,e;c=A(a),d=c.y*G+c.x;do{if(d+=b,e=j(d%G,Math.floor(d/G)),!e)break;if(e.elm!=a)return K.select(e.elm,!0),L.isEmpty(e.elm)&&K.collapse(!0),!0}while(e.elm==a);return!1}var F,G,H,I,J,K=f.selection,L=K.dom;g=g||L.getParent(K.getStart(),"table"),h(),J=L.getParent(K.getStart(),"th,td"),J&&(H=A(J),I=C(),J=j(H.x,H.y)),a.extend(this,{deleteTable:n,split:r,merge:s,insertRow:t,insertCol:u,deleteCols:v,deleteRows:w,cutRows:x,copyRows:y,pasteRows:z,getPos:A,setStartCell:B,setEndCell:D,moveRelIdx:E,refresh:h})}}),d("tinymce/tableplugin/Quirks",["tinymce/util/VK","tinymce/Env","tinymce/util/Tools"],function(a,b,c){function d(a,b){return parseInt(a.getAttribute(b)||1,10)}var e=c.each;return function(c){function f(){function b(b){function f(a,d){var e=a?"previousSibling":"nextSibling",f=c.dom.getParent(d,"tr"),h=f[e];if(h)return q(c,d,h,a),b.preventDefault(),!0;var k=c.dom.getParent(f,"table"),l=f.parentNode,m=l.nodeName.toLowerCase();if("tbody"===m||m===(a?"tfoot":"thead")){var n=g(a,k,l,"tbody");if(null!==n)return i(a,n,d)}return j(a,f,e,k)}function g(a,b,d,e){var f=c.dom.select(">"+e,b),g=f.indexOf(d);if(a&&0===g||!a&&g===f.length-1)return h(a,b);if(-1===g){var i="thead"===d.tagName.toLowerCase()?0:f.length-1;return f[i]}return f[g+(a?-1:1)]}function h(a,b){var d=a?"thead":"tfoot",e=c.dom.select(">"+d,b);return 0!==e.length?e[0]:null}function i(a,d,e){var f=k(d,a);return f&&q(c,e,f,a),b.preventDefault(),!0}function j(a,d,e,g){var h=g[e];if(h)return l(h),!0;var i=c.dom.getParent(g,"td,th");if(i)return f(a,i,b);var j=k(d,!a);return l(j),b.preventDefault(),!1}function k(a,b){var d=a&&a[b?"lastChild":"firstChild"];return d&&"BR"===d.nodeName?c.dom.getParent(d,"td,th"):d}function l(a){c.selection.setCursorLocation(a,0)}function m(){return t==a.UP||t==a.DOWN}function n(a){var b=a.selection.getNode(),c=a.dom.getParent(b,"tr");return null!==c}function o(a){for(var b=0,c=a;c.previousSibling;)c=c.previousSibling,b+=d(c,"colspan");return b}function p(a,b){var c=0,f=0;return e(a.children,function(a,e){return c+=d(a,"colspan"),f=e,c>b?!1:void 0}),f}function q(a,b,d,e){var f=o(c.dom.getParent(b,"td,th")),g=p(d,f),h=d.childNodes[g],i=k(h,e);l(i||h)}function r(a){var b=c.selection.getNode(),d=c.dom.getParent(b,"td,th"),e=c.dom.getParent(a,"td,th");return d&&d!==e&&s(d,e)}function s(a,b){return c.dom.getParent(a,"TABLE")===c.dom.getParent(b,"TABLE")}var t=b.keyCode;if(m()&&n(c)){var u=c.selection.getNode();setTimeout(function(){r(u)&&f(!b.shiftKey&&t===a.UP,u,b)},0)}}c.on("KeyDown",function(a){b(a)})}function g(){function a(a,b){var c,d=b.ownerDocument,e=d.createRange();return e.setStartBefore(b),e.setEnd(a.endContainer,a.endOffset),c=d.createElement("body"),c.appendChild(e.cloneContents()),0===c.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}c.on("KeyDown",function(b){var d,e,f=c.dom;(37==b.keyCode||38==b.keyCode)&&(d=c.selection.getRng(),e=f.getParent(d.startContainer,"table"),e&&c.getBody().firstChild==e&&a(d,e)&&(d=f.createRng(),d.setStartBefore(e),d.setEndBefore(e),c.selection.setRng(d),b.preventDefault()))})}function h(){c.on("KeyDown SetContent VisualAid",function(){var a;for(a=c.getBody().lastChild;a;a=a.previousSibling)if(3==a.nodeType){if(a.nodeValue.length>0)break}else if(1==a.nodeType&&("BR"==a.tagName||!a.getAttribute("data-mce-bogus")))break;a&&"TABLE"==a.nodeName&&(c.settings.forced_root_block?c.dom.add(c.getBody(),c.settings.forced_root_block,c.settings.forced_root_block_attrs,b.ie&&b.ie<11?"&nbsp;":'<br data-mce-bogus="1" />'):c.dom.add(c.getBody(),"br",{"data-mce-bogus":"1"}))}),c.on("PreProcess",function(a){var b=a.node.lastChild;b&&("BR"==b.nodeName||1==b.childNodes.length&&("BR"==b.firstChild.nodeName||"\xa0"==b.firstChild.nodeValue))&&b.previousSibling&&"TABLE"==b.previousSibling.nodeName&&c.dom.remove(b)})}function i(){function a(a,b,c,d){var e,f,g,h=3,i=a.dom.getParent(b.startContainer,"TABLE");return i&&(e=i.parentNode),f=b.startContainer.nodeType==h&&0===b.startOffset&&0===b.endOffset&&d&&("TR"==c.nodeName||c==e),g=("TD"==c.nodeName||"TH"==c.nodeName)&&!d,f||g}function b(){var b=c.selection.getRng(),d=c.selection.getNode(),e=c.dom.getParent(b.startContainer,"TD,TH");if(a(c,b,d,e)){e||(e=d);for(var f=e.lastChild;f.lastChild;)f=f.lastChild;3==f.nodeType&&(b.setEnd(f,f.data.length),c.selection.setRng(b))}}c.on("KeyDown",function(){b()}),c.on("MouseDown",function(a){2!=a.button&&b()})}function j(){c.on("keydown",function(b){if((b.keyCode==a.DELETE||b.keyCode==a.BACKSPACE)&&!b.isDefaultPrevented()){var d=c.dom.getParent(c.selection.getStart(),"table");if(d){for(var e=c.dom.select("td,th",d),f=e.length;f--;)if(!c.dom.hasClass(e[f],"mce-item-selected"))return;b.preventDefault(),c.execCommand("mceTableDelete")}}})}j(),b.webkit&&(f(),i()),b.gecko&&(g(),h()),b.ie>10&&(g(),h())}}),d("tinymce/tableplugin/CellSelection",["tinymce/tableplugin/TableGrid","tinymce/dom/TreeWalker","tinymce/util/Tools"],function(a,b,c){return function(d){function e(a){d.getBody().style.webkitUserSelect="",(a||l)&&(d.dom.removeClass(d.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),l=!1)}function f(b){var c,e,f=b.target;if(!j&&h&&(g||f!=h)&&("TD"==f.nodeName||"TH"==f.nodeName)){e=k.getParent(f,"table"),e==i&&(g||(g=new a(d,e),g.setStartCell(h),d.getBody().style.webkitUserSelect="none"),g.setEndCell(f),l=!0),c=d.selection.getSel();try{c.removeAllRanges?c.removeAllRanges():c.empty()}catch(m){}b.preventDefault()}}var g,h,i,j,k=d.dom,l=!0;return d.on("MouseDown",function(a){2==a.button||j||(e(),h=k.getParent(a.target,"td,th"),i=k.getParent(h,"table"))}),d.on("mouseover",f),d.on("remove",function(){k.unbind(d.getDoc(),"mouseover",f)}),d.on("MouseUp",function(){function a(a,d){var f=new b(a,a);do{if(3==a.nodeType&&0!==c.trim(a.nodeValue).length)return void(d?e.setStart(a,0):e.setEnd(a,a.nodeValue.length));if("BR"==a.nodeName)return void(d?e.setStartBefore(a):e.setEndBefore(a))}while(a=d?f.next():f.prev())}var e,f,j,l,m,n=d.selection;if(h){if(g&&(d.getBody().style.webkitUserSelect=""),f=k.select("td.mce-item-selected,th.mce-item-selected"),f.length>0){e=k.createRng(),l=f[0],e.setStartBefore(l),e.setEndAfter(l),a(l,1),j=new b(l,k.getParent(f[0],"table"));do if("TD"==l.nodeName||"TH"==l.nodeName){if(!k.hasClass(l,"mce-item-selected"))break;m=l}while(l=j.next());a(m),n.setRng(e)}d.nodeChanged(),h=g=i=null}}),d.on("KeyUp Drop SetContent",function(a){e("setcontent"==a.type),h=g=i=null,j=!1}),d.on("ObjectResizeStart ObjectResized",function(a){j="objectresized"!=a.type}),{clear:e}}}),d("tinymce/tableplugin/Dialogs",["tinymce/util/Tools","tinymce/Env"],function(a,b){var c=a.each;return function(d){function e(){var a=d.settings.color_picker_callback;return a?function(){var b=this;a.call(d,function(a){b.value(a).fire("change")},b.value())}:void 0}function f(a){return{title:"Advanced",type:"form",defaults:{onchange:function(){l(a,this.parents().reverse()[0],"style"==this.name())}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}}function g(a){return a?a.replace(/px$/,""):""}function h(a){return/^[0-9]+$/.test(a)&&(a+="px"),a}function i(a){c("left center right".split(" "),function(b){d.formatter.remove("align"+b,{},a)})}function j(a){c("top middle bottom".split(" "),function(b){d.formatter.remove("valign"+b,{},a)})}function k(b,c,d){function e(b,d){return d=d||[],a.each(b,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c&&c(b)),d.push(b)}),d}return e(b,d||[])}function l(a,b,c){var d=b.toJSON(),e=a.parseStyle(d.style);c?(b.find("#borderColor").value(e["border-color"]||"")[0].fire("change"),b.find("#backgroundColor").value(e["background-color"]||"")[0].fire("change")):(e["border-color"]=d.borderColor,e["background-color"]=d.backgroundColor),b.find("#style").value(a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}function m(a,b,c){var d=a.parseStyle(a.getAttrib(c,"style"));d["border-color"]&&(b.borderColor=d["border-color"]),d["background-color"]&&(b.backgroundColor=d["background-color"]),b.style=a.serializeStyle(d)}var n=this;n.tableProps=function(){n.table(!0)},n.table=function(e){function j(){var c;l(s,this),t=a.extend(t,this.toJSON()),a.each("backgroundColor borderColor".split(" "),function(a){delete t[a]}),t["class"]===!1&&delete t["class"],d.undoManager.transact(function(){n||(n=d.plugins.table.insertTable(t.cols||1,t.rows||1)),d.dom.setAttribs(n,{cellspacing:t.cellspacing,cellpadding:t.cellpadding,border:t.border,style:t.style,"class":t["class"]}),s.getAttrib(n,"width")?s.setAttrib(n,"width",g(t.width)):s.setStyle(n,"width",h(t.width)),s.setStyle(n,"height",h(t.height)),c=s.select("caption",n)[0],c&&!t.caption&&s.remove(c),!c&&t.caption&&(c=s.create("caption"),c.innerHTML=b.ie?"\xa0":'<br data-mce-bogus="1"/>',n.insertBefore(c,n.firstChild)),i(n),t.align&&d.formatter.apply("align"+t.align,{},n),d.focus(),d.addVisual()})}var n,o,p,q,r,s=d.dom,t={};e===!0?(n=s.getParent(d.selection.getStart(),"table"),n&&(t={width:g(s.getStyle(n,"width")||s.getAttrib(n,"width")),height:g(s.getStyle(n,"height")||s.getAttrib(n,"height")),cellspacing:n?s.getAttrib(n,"cellspacing"):"",cellpadding:n?s.getAttrib(n,"cellpadding"):"",border:n?s.getAttrib(n,"border"):"",caption:!!s.select("caption",n)[0],"class":s.getAttrib(n,"class")},c("left center right".split(" "),function(a){d.formatter.matchNode(n,"align"+a)&&(t.align=a)}))):(o={label:"Cols",name:"cols"},p={label:"Rows",name:"rows"}),d.settings.table_class_list&&(t["class"]&&(t["class"]=t["class"].replace(/\s*mce\-item\-table\s*/g,"")),q={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"table",classes:[a.value]})})})}),r={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[o,p,{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},q]},d.settings.table_advtab!==!1?(m(s,t,n),d.windowManager.open({title:"Table properties",data:t,bodyType:"tabpanel",body:[{title:"General",type:"form",items:r},f(s)],onsubmit:j})):d.windowManager.open({title:"Table properties",data:t,body:r,onsubmit:j})},n.merge=function(a,b){d.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",value:"1",size:10},{label:"Rows",name:"rows",type:"textbox",value:"1",size:10}],onsubmit:function(){var c=this.toJSON();d.undoManager.transact(function(){a.merge(b,c.cols,c.rows)})}})},n.cell=function(){function b(){l(p,this),n=a.extend(n,this.toJSON()),d.undoManager.transact(function(){c(q,function(a){d.dom.setAttribs(a,{scope:n.scope,style:n.style,"class":n["class"]}),d.dom.setStyles(a,{width:h(n.width),height:h(n.height)}),n.type&&a.nodeName.toLowerCase()!=n.type&&(a=p.rename(a,n.type)),i(a),n.align&&d.formatter.apply("align"+n.align,{},a),j(a),n.valign&&d.formatter.apply("valign"+n.valign,{},a)}),d.focus()})}var e,n,o,p=d.dom,q=[];if(q=d.dom.select("td.mce-item-selected,th.mce-item-selected"),e=d.dom.getParent(d.selection.getStart(),"td,th"),!q.length&&e&&q.push(e),e=e||q[0]){n={width:g(p.getStyle(e,"width")||p.getAttrib(e,"width")),height:g(p.getStyle(e,"height")||p.getAttrib(e,"height")),scope:p.getAttrib(e,"scope"),"class":p.getAttrib(e,"class")},n.type=e.nodeName.toLowerCase(),c("left center right".split(" "),function(a){d.formatter.matchNode(e,"align"+a)&&(n.align=a)}),c("top middle bottom".split(" "),function(a){d.formatter.matchNode(e,"valign"+a)&&(n.valign=a)}),d.settings.table_cell_class_list&&(o={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_cell_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"td",classes:[a.value]})})})});var r={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},o]};d.settings.table_cell_advtab!==!1?(m(p,n,e),d.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:r},f(p)],onsubmit:b})):d.windowManager.open({title:"Cell properties",data:n,body:r,onsubmit:b})}},n.row=function(){function b(){var b,e,f;l(r,this),p=a.extend(p,this.toJSON()),d.undoManager.transact(function(){var a=p.type;c(s,function(c){d.dom.setAttribs(c,{scope:p.scope,style:p.style,"class":p["class"]}),d.dom.setStyles(c,{height:h(p.height)}),a!=c.parentNode.nodeName.toLowerCase()&&(b=r.getParent(c,"table"),e=c.parentNode,f=r.select(a,b)[0],f||(f=r.create(a),b.firstChild?b.insertBefore(f,b.firstChild):b.appendChild(f)),f.appendChild(c),e.hasChildNodes()||r.remove(e)),i(c),p.align&&d.formatter.apply("align"+p.align,{},c)}),d.focus()})}var e,j,n,o,p,q,r=d.dom,s=[];e=d.dom.getParent(d.selection.getStart(),"table"),j=d.dom.getParent(d.selection.getStart(),"td,th"),c(e.rows,function(a){c(a.cells,function(b){return r.hasClass(b,"mce-item-selected")||b==j?(s.push(a),!1):void 0})}),n=s[0],n&&(p={height:g(r.getStyle(n,"height")||r.getAttrib(n,"height")),scope:r.getAttrib(n,"scope"),"class":r.getAttrib(n,"class")},p.type=n.parentNode.nodeName.toLowerCase(),c("left center right".split(" "),function(a){d.formatter.matchNode(n,"align"+a)&&(p.align=a)}),d.settings.table_row_class_list&&(o={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_row_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"tr",classes:[a.value]})})})}),q={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},d.settings.table_row_advtab!==!1?(m(r,p,n),d.windowManager.open({title:"Row properties",data:p,bodyType:"tabpanel",body:[{title:"General",type:"form",items:q},f(r)],onsubmit:b})):d.windowManager.open({title:"Row properties",data:p,body:q,onsubmit:b}))}}}),d("tinymce/tableplugin/Plugin",["tinymce/tableplugin/TableGrid","tinymce/tableplugin/Quirks","tinymce/tableplugin/CellSelection","tinymce/tableplugin/Dialogs","tinymce/util/Tools","tinymce/dom/TreeWalker","tinymce/Env","tinymce/PluginManager"],function(a,b,c,d,e,f,g,h){function i(e){function f(a){return function(){e.execCommand(a)}}function h(a,b){var c,d,f,h;for(f='<table id="__mce"><tbody>',c=0;b>c;c++){for(f+="<tr>",d=0;a>d;d++)f+="<td>"+(g.ie?" ":"<br>")+"</td>";f+="</tr>"}return f+="</tbody></table>",e.undoManager.transact(function(){e.insertContent(f),h=e.dom.get("__mce"),e.dom.setAttrib(h,"id",null),e.dom.setAttribs(h,e.settings.table_default_attributes||{}),e.dom.setStyles(h,e.settings.table_default_styles||{})}),h}function i(a,b){function c(){a.disabled(!e.dom.getParent(e.selection.getStart(),b)),e.selection.selectorChanged(b,function(b){a.disabled(!b)})}e.initialized?c():e.on("init",c)}function k(){i(this,"table")}function l(){i(this,"td,th")}function m(){var a="";a='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var b=0;10>b;b++){a+="<tr>";for(var c=0;10>c;c++)a+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*b+c)+'" href="#" data-mce-x="'+c+'" data-mce-y="'+b+'"></a></td>';a+="</tr>"}return a+="</table>",a+='<div class="mce-text-center" role="presentation">1 x 1</div>'}function n(a,b,c){var d,f,g,h,i,j=c.getEl().getElementsByTagName("table")[0],k=c.isRtl()||"tl-tr"==c.parent().rel;for(j.nextSibling.innerHTML=a+1+" x "+(b+1),k&&(a=9-a),f=0;10>f;f++)for(d=0;10>d;d++)h=j.rows[f].childNodes[d].firstChild,i=(k?d>=a:a>=d)&&b>=f,e.dom.toggleClass(h,"mce-active",i),i&&(g=h);return g.parentNode}var o,p=this,q=new d(e);e.settings.table_grid===!1?e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:q.table}):e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(a){a.aria&&(this.parent().hideAll(),a.stopImmediatePropagation(),q.table())},onshow:function(){n(0,0,this.menu.items()[0])},onhide:function(){var a=this.menu.items()[0].getEl().getElementsByTagName("a");e.dom.removeClass(a,"mce-active"),e.dom.addClass(a[0],"mce-active")},menu:[{type:"container",html:m(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(a){var b,c,d=a.target;"A"==d.tagName.toUpperCase()&&(b=parseInt(d.getAttribute("data-mce-x"),10),c=parseInt(d.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(b=9-b),(b!==this.lastX||c!==this.lastY)&&(n(b,c,a.control),this.lastX=b,this.lastY=c))},onclick:function(a){var b=this;"A"==a.target.tagName.toUpperCase()&&(a.preventDefault(),a.stopPropagation(),b.parent().cancel(),e.undoManager.transact(function(){h(b.lastX+1,b.lastY+1)}),e.addVisual())}}]}),e.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:k,onclick:q.tableProps}),e.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:k,cmd:"mceTableDelete"}),e.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:f("mceTableCellProps"),onPostRender:l},{text:"Merge cells",onclick:f("mceTableMergeCells"),onPostRender:l},{text:"Split cell",onclick:f("mceTableSplitCells"),onPostRender:l}]}),e.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:f("mceTableInsertRowBefore"),onPostRender:l},{text:"Insert row after",onclick:f("mceTableInsertRowAfter"),onPostRender:l},{text:"Delete row",onclick:f("mceTableDeleteRow"),onPostRender:l},{text:"Row properties",onclick:f("mceTableRowProps"),onPostRender:l},{text:"-"},{text:"Cut row",onclick:f("mceTableCutRow"),onPostRender:l},{text:"Copy row",onclick:f("mceTableCopyRow"),onPostRender:l},{text:"Paste row before",onclick:f("mceTablePasteRowBefore"),onPostRender:l},{text:"Paste row after",onclick:f("mceTablePasteRowAfter"),onPostRender:l}]}),e.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:f("mceTableInsertColBefore"),onPostRender:l},{text:"Insert column after",onclick:f("mceTableInsertColAfter"),onPostRender:l},{text:"Delete column",onclick:f("mceTableDeleteCol"),onPostRender:l}]});var r=[];j("inserttable tableprops deletetable | cell row column".split(" "),function(a){r.push("|"==a?{text:"-"}:e.menuItems[a])}),e.addButton("table",{type:"menubutton",title:"Table",menu:r}),g.isIE||e.on("click",function(a){a=a.target,"TABLE"===a.nodeName&&(e.selection.select(a),e.nodeChanged())}),p.quirks=new b(e),e.on("Init",function(){p.cellSelection=new c(e)}),j({mceTableSplitCells:function(a){a.split()},mceTableMergeCells:function(a){var b;b=e.dom.getParent(e.selection.getStart(),"th,td"),e.dom.select("td.mce-item-selected,th.mce-item-selected").length?a.merge():q.merge(a,b)},mceTableInsertRowBefore:function(a){a.insertRow(!0)},mceTableInsertRowAfter:function(a){a.insertRow()},mceTableInsertColBefore:function(a){a.insertCol(!0)},mceTableInsertColAfter:function(a){a.insertCol()},mceTableDeleteCol:function(a){a.deleteCols()},mceTableDeleteRow:function(a){a.deleteRows()},mceTableCutRow:function(a){o=a.cutRows()},mceTableCopyRow:function(a){o=a.copyRows()},mceTablePasteRowBefore:function(a){a.pasteRows(o,!0)},mceTablePasteRowAfter:function(a){a.pasteRows(o)},mceTableDelete:function(a){a.deleteTable()}},function(b,c){e.addCommand(c,function(){var c=new a(e);c&&(b(c),e.execCommand("mceRepaint"),p.cellSelection.clear())})}),j({mceInsertTable:q.table,mceTableProps:function(){q.table(!0)},mceTableRowProps:q.row,mceTableCellProps:q.cell},function(a,b){e.addCommand(b,function(b,c){a(c)})}),e.settings.table_tab_navigation!==!1&&e.on("keydown",function(b){var c,d,f;9==b.keyCode&&(c=e.dom.getParent(e.selection.getStart(),"th,td"),c&&(b.preventDefault(),d=new a(e),f=b.shiftKey?-1:1,e.undoManager.transact(function(){!d.moveRelIdx(c,f)&&f>0&&(d.insertRow(),d.refresh(),d.moveRelIdx(c,f))})))}),p.insertTable=h}var j=e.each;h.add("table",i)})}(this);
@@ -1,262 +0,0 @@
1
- /**
2
- * plugin.js
3
- *
4
- * Copyright, Moxiecode Systems AB
5
- * Released under LGPL License.
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- /*global tinymce:true */
12
-
13
- tinymce.PluginManager.add('template', function(editor) {
14
- var each = tinymce.each;
15
-
16
- function createTemplateList(callback) {
17
- return function() {
18
- var templateList = editor.settings.templates;
19
-
20
- if (typeof(templateList) == "string") {
21
- tinymce.util.XHR.send({
22
- url: templateList,
23
- success: function(text) {
24
- callback(tinymce.util.JSON.parse(text));
25
- }
26
- });
27
- } else {
28
- callback(templateList);
29
- }
30
- };
31
- }
32
-
33
- function showDialog(templateList) {
34
- var win, values = [], templateHtml;
35
-
36
- if (!templateList || templateList.length === 0) {
37
- editor.windowManager.alert('No templates defined');
38
- return;
39
- }
40
-
41
- tinymce.each(templateList, function(template) {
42
- values.push({
43
- selected: !values.length,
44
- text: template.title,
45
- value: {
46
- url: template.url,
47
- content: template.content,
48
- description: template.description
49
- }
50
- });
51
- });
52
-
53
- function onSelectTemplate(e) {
54
- var value = e.control.value();
55
-
56
- function insertIframeHtml(html) {
57
- if (html.indexOf('<html>') == -1) {
58
- var contentCssLinks = '';
59
-
60
- tinymce.each(editor.contentCSS, function(url) {
61
- contentCssLinks += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '">';
62
- });
63
-
64
- html = (
65
- '<!DOCTYPE html>' +
66
- '<html>' +
67
- '<head>' +
68
- contentCssLinks +
69
- '</head>' +
70
- '<body>' +
71
- html +
72
- '</body>' +
73
- '</html>'
74
- );
75
- }
76
-
77
- html = replaceTemplateValues(html, 'template_preview_replace_values');
78
-
79
- var doc = win.find('iframe')[0].getEl().contentWindow.document;
80
- doc.open();
81
- doc.write(html);
82
- doc.close();
83
- }
84
-
85
- if (value.url) {
86
- tinymce.util.XHR.send({
87
- url: value.url,
88
- success: function(html) {
89
- templateHtml = html;
90
- insertIframeHtml(templateHtml);
91
- }
92
- });
93
- } else {
94
- templateHtml = value.content;
95
- insertIframeHtml(templateHtml);
96
- }
97
-
98
- win.find('#description')[0].text(e.control.value().description);
99
- }
100
-
101
- win = editor.windowManager.open({
102
- title: 'Insert template',
103
- layout: 'flex',
104
- direction: 'column',
105
- align: 'stretch',
106
- padding: 15,
107
- spacing: 10,
108
-
109
- items: [
110
- {type: 'form', flex: 0, padding: 0, items: [
111
- {type: 'container', label: 'Templates', items: {
112
- type: 'listbox', label: 'Templates', name: 'template', values: values, onselect: onSelectTemplate
113
- }}
114
- ]},
115
- {type: 'label', name: 'description', label: 'Description', text: '\u00a0'},
116
- {type: 'iframe', flex: 1, border: 1}
117
- ],
118
-
119
- onsubmit: function() {
120
- insertTemplate(false, templateHtml);
121
- },
122
-
123
- width: editor.getParam('template_popup_width', 600),
124
- height: editor.getParam('template_popup_height', 500)
125
- });
126
-
127
- win.find('listbox')[0].fire('select');
128
- }
129
-
130
- function getDateTime(fmt, date) {
131
- var daysShort = "Sun Mon Tue Wed Thu Fri Sat Sun".split(' ');
132
- var daysLong = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(' ');
133
- var monthsShort = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(' ');
134
- var monthsLong = "January February March April May June July August September October November December".split(' ');
135
-
136
- function addZeros(value, len) {
137
- value = "" + value;
138
-
139
- if (value.length < len) {
140
- for (var i = 0; i < (len - value.length); i++) {
141
- value = "0" + value;
142
- }
143
- }
144
-
145
- return value;
146
- }
147
-
148
- date = date || new Date();
149
-
150
- fmt = fmt.replace("%D", "%m/%d/%Y");
151
- fmt = fmt.replace("%r", "%I:%M:%S %p");
152
- fmt = fmt.replace("%Y", "" + date.getFullYear());
153
- fmt = fmt.replace("%y", "" + date.getYear());
154
- fmt = fmt.replace("%m", addZeros(date.getMonth() + 1, 2));
155
- fmt = fmt.replace("%d", addZeros(date.getDate(), 2));
156
- fmt = fmt.replace("%H", "" + addZeros(date.getHours(), 2));
157
- fmt = fmt.replace("%M", "" + addZeros(date.getMinutes(), 2));
158
- fmt = fmt.replace("%S", "" + addZeros(date.getSeconds(), 2));
159
- fmt = fmt.replace("%I", "" + ((date.getHours() + 11) % 12 + 1));
160
- fmt = fmt.replace("%p", "" + (date.getHours() < 12 ? "AM" : "PM"));
161
- fmt = fmt.replace("%B", "" + editor.translate(monthsLong[date.getMonth()]));
162
- fmt = fmt.replace("%b", "" + editor.translate(monthsShort[date.getMonth()]));
163
- fmt = fmt.replace("%A", "" + editor.translate(daysLong[date.getDay()]));
164
- fmt = fmt.replace("%a", "" + editor.translate(daysShort[date.getDay()]));
165
- fmt = fmt.replace("%%", "%");
166
-
167
- return fmt;
168
- }
169
-
170
- function replaceVals(e) {
171
- var dom = editor.dom, vl = editor.getParam('template_replace_values');
172
-
173
- each(dom.select('*', e), function(e) {
174
- each(vl, function(v, k) {
175
- if (dom.hasClass(e, k)) {
176
- if (typeof(vl[k]) == 'function') {
177
- vl[k](e);
178
- }
179
- }
180
- });
181
- });
182
- }
183
-
184
- function replaceTemplateValues(html, templateValuesOptionName) {
185
- each(editor.getParam(templateValuesOptionName), function(v, k) {
186
- if (typeof(v) != 'function') {
187
- html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);
188
- }
189
- });
190
-
191
- return html;
192
- }
193
-
194
- function insertTemplate(ui, html) {
195
- var el, n, dom = editor.dom, sel = editor.selection.getContent();
196
-
197
- html = replaceTemplateValues(html, 'template_replace_values');
198
- el = dom.create('div', null, html);
199
-
200
- // Find template element within div
201
- n = dom.select('.mceTmpl', el);
202
- if (n && n.length > 0) {
203
- el = dom.create('div', null);
204
- el.appendChild(n[0].cloneNode(true));
205
- }
206
-
207
- function hasClass(n, c) {
208
- return new RegExp('\\b' + c + '\\b', 'g').test(n.className);
209
- }
210
-
211
- each(dom.select('*', el), function(n) {
212
- // Replace cdate
213
- if (hasClass(n, editor.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) {
214
- n.innerHTML = getDateTime(editor.getParam("template_cdate_format", editor.getLang("template.cdate_format")));
215
- }
216
-
217
- // Replace mdate
218
- if (hasClass(n, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) {
219
- n.innerHTML = getDateTime(editor.getParam("template_mdate_format", editor.getLang("template.mdate_format")));
220
- }
221
-
222
- // Replace selection
223
- if (hasClass(n, editor.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) {
224
- n.innerHTML = sel;
225
- }
226
- });
227
-
228
- replaceVals(el);
229
-
230
- editor.execCommand('mceInsertContent', false, el.innerHTML);
231
- editor.addVisual();
232
- }
233
-
234
- editor.addCommand('mceInsertTemplate', insertTemplate);
235
-
236
- editor.addButton('template', {
237
- title: 'Insert template',
238
- onclick: createTemplateList(showDialog)
239
- });
240
-
241
- editor.addMenuItem('template', {
242
- text: 'Insert template',
243
- onclick: createTemplateList(showDialog),
244
- context: 'insert'
245
- });
246
-
247
- editor.on('PreProcess', function(o) {
248
- var dom = editor.dom;
249
-
250
- each(dom.select('div', o.node), function(e) {
251
- if (dom.hasClass(e, 'mceTmpl')) {
252
- each(dom.select('*', e), function(e) {
253
- if (dom.hasClass(e, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) {
254
- e.innerHTML = getDateTime(editor.getParam("template_mdate_format", editor.getLang("template.mdate_format")));
255
- }
256
- });
257
-
258
- replaceVals(e);
259
- }
260
- });
261
- });
262
- });
@@ -1 +0,0 @@
1
- tinymce.PluginManager.add("template",function(a){function b(b){return function(){var c=a.settings.templates;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):b(c)}}function c(b){function c(b){function c(b){if(-1==b.indexOf("<html>")){var c="";tinymce.each(a.contentCSS,function(b){c+='<link type="text/css" rel="stylesheet" href="'+a.documentBaseURI.toAbsolute(b)+'">'}),b="<!DOCTYPE html><html><head>"+c+"</head><body>"+b+"</body></html>"}b=f(b,"template_preview_replace_values");var e=d.find("iframe")[0].getEl().contentWindow.document;e.open(),e.write(b),e.close()}var g=b.control.value();g.url?tinymce.util.XHR.send({url:g.url,success:function(a){e=a,c(e)}}):(e=g.content,c(e)),d.find("#description")[0].text(b.control.value().description)}var d,e,h=[];return b&&0!==b.length?(tinymce.each(b,function(a){h.push({selected:!h.length,text:a.title,value:{url:a.url,content:a.content,description:a.description}})}),d=a.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:h,onselect:c}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){g(!1,e)},width:a.getParam("template_popup_width",600),height:a.getParam("template_popup_height",500)}),void d.find("listbox")[0].fire("select")):void a.windowManager.alert("No templates defined")}function d(b,c){function d(a,b){if(a=""+a,a.length<b)for(var c=0;c<b-a.length;c++)a="0"+a;return a}var e="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),g="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),h="January February March April May June July August September October November December".split(" ");return c=c||new Date,b=b.replace("%D","%m/%d/%Y"),b=b.replace("%r","%I:%M:%S %p"),b=b.replace("%Y",""+c.getFullYear()),b=b.replace("%y",""+c.getYear()),b=b.replace("%m",d(c.getMonth()+1,2)),b=b.replace("%d",d(c.getDate(),2)),b=b.replace("%H",""+d(c.getHours(),2)),b=b.replace("%M",""+d(c.getMinutes(),2)),b=b.replace("%S",""+d(c.getSeconds(),2)),b=b.replace("%I",""+((c.getHours()+11)%12+1)),b=b.replace("%p",""+(c.getHours()<12?"AM":"PM")),b=b.replace("%B",""+a.translate(h[c.getMonth()])),b=b.replace("%b",""+a.translate(g[c.getMonth()])),b=b.replace("%A",""+a.translate(f[c.getDay()])),b=b.replace("%a",""+a.translate(e[c.getDay()])),b=b.replace("%%","%")}function e(b){var c=a.dom,d=a.getParam("template_replace_values");h(c.select("*",b),function(a){h(d,function(b,e){c.hasClass(a,e)&&"function"==typeof d[e]&&d[e](a)})})}function f(b,c){return h(a.getParam(c),function(a,c){"function"!=typeof a&&(b=b.replace(new RegExp("\\{\\$"+c+"\\}","g"),a))}),b}function g(b,c){function g(a,b){return new RegExp("\\b"+b+"\\b","g").test(a.className)}var i,j,k=a.dom,l=a.selection.getContent();c=f(c,"template_replace_values"),i=k.create("div",null,c),j=k.select(".mceTmpl",i),j&&j.length>0&&(i=k.create("div",null),i.appendChild(j[0].cloneNode(!0))),h(k.select("*",i),function(b){g(b,a.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_cdate_format",a.getLang("template.cdate_format")))),g(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format")))),g(b,a.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(b.innerHTML=l)}),e(i),a.execCommand("mceInsertContent",!1,i.innerHTML),a.addVisual()}var h=tinymce.each;a.addCommand("mceInsertTemplate",g),a.addButton("template",{title:"Insert template",onclick:b(c)}),a.addMenuItem("template",{text:"Insert template",onclick:b(c),context:"insert"}),a.on("PreProcess",function(b){var c=a.dom;h(c.select("div",b.node),function(b){c.hasClass(b,"mceTmpl")&&(h(c.select("*",b),function(b){c.hasClass(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format"))))}),e(b))})})});
@@ -1,272 +0,0 @@
1
- /**
2
- * plugin.js
3
- *
4
- * Copyright, Moxiecode Systems AB
5
- * Released under LGPL License.
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- /*global tinymce:true */
12
- /*eslint consistent-this:0 */
13
-
14
- tinymce.PluginManager.add('textcolor', function(editor) {
15
- var cols, rows;
16
-
17
- rows = editor.settings.textcolor_rows || 5;
18
- cols = editor.settings.textcolor_cols || 8;
19
-
20
- function getCurrentColor(format) {
21
- var color;
22
-
23
- editor.dom.getParents(editor.selection.getStart(), function(elm) {
24
- var value;
25
-
26
- if ((value = elm.style[format == 'forecolor' ? 'color' : 'background-color'])) {
27
- color = value;
28
- }
29
- });
30
-
31
- return color;
32
- }
33
-
34
- function mapColors() {
35
- var i, colors = [], colorMap;
36
-
37
- colorMap = editor.settings.textcolor_map || [
38
- "000000", "Black",
39
- "993300", "Burnt orange",
40
- "333300", "Dark olive",
41
- "003300", "Dark green",
42
- "003366", "Dark azure",
43
- "000080", "Navy Blue",
44
- "333399", "Indigo",
45
- "333333", "Very dark gray",
46
- "800000", "Maroon",
47
- "FF6600", "Orange",
48
- "808000", "Olive",
49
- "008000", "Green",
50
- "008080", "Teal",
51
- "0000FF", "Blue",
52
- "666699", "Grayish blue",
53
- "808080", "Gray",
54
- "FF0000", "Red",
55
- "FF9900", "Amber",
56
- "99CC00", "Yellow green",
57
- "339966", "Sea green",
58
- "33CCCC", "Turquoise",
59
- "3366FF", "Royal blue",
60
- "800080", "Purple",
61
- "999999", "Medium gray",
62
- "FF00FF", "Magenta",
63
- "FFCC00", "Gold",
64
- "FFFF00", "Yellow",
65
- "00FF00", "Lime",
66
- "00FFFF", "Aqua",
67
- "00CCFF", "Sky blue",
68
- "993366", "Red violet",
69
- "FFFFFF", "White",
70
- "FF99CC", "Pink",
71
- "FFCC99", "Peach",
72
- "FFFF99", "Light yellow",
73
- "CCFFCC", "Pale green",
74
- "CCFFFF", "Pale cyan",
75
- "99CCFF", "Light sky blue",
76
- "CC99FF", "Plum"
77
- ];
78
-
79
- for (i = 0; i < colorMap.length; i += 2) {
80
- colors.push({
81
- text: colorMap[i + 1],
82
- color: '#' + colorMap[i]
83
- });
84
- }
85
-
86
- return colors;
87
- }
88
-
89
- function renderColorPicker() {
90
- var ctrl = this, colors, color, html, last, x, y, i, id = ctrl._id, count = 0;
91
-
92
- function getColorCellHtml(color, title) {
93
- var isNoColor = color == 'transparent';
94
-
95
- return (
96
- '<td class="mce-grid-cell' + (isNoColor ? ' mce-colorbtn-trans' : '') + '">' +
97
- '<div id="' + id + '-' + (count++) + '"' +
98
- ' data-mce-color="' + (color ? color : '') + '"' +
99
- ' role="option"' +
100
- ' tabIndex="-1"' +
101
- ' style="' + (color ? 'background-color: ' + color : '') + '"' +
102
- ' title="' + tinymce.translate(title) + '">' +
103
- (isNoColor ? '&#215;' : '') +
104
- '</div>' +
105
- '</td>'
106
- );
107
- }
108
-
109
- colors = mapColors();
110
- colors.push({
111
- text: tinymce.translate("No color"),
112
- color: "transparent"
113
- });
114
-
115
- html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';
116
- last = colors.length - 1;
117
-
118
- for (y = 0; y < rows; y++) {
119
- html += '<tr>';
120
-
121
- for (x = 0; x < cols; x++) {
122
- i = y * cols + x;
123
-
124
- if (i > last) {
125
- html += '<td></td>';
126
- } else {
127
- color = colors[i];
128
- html += getColorCellHtml(color.color, color.text);
129
- }
130
- }
131
-
132
- html += '</tr>';
133
- }
134
-
135
- if (editor.settings.color_picker_callback) {
136
- html += (
137
- '<tr>' +
138
- '<td colspan="' + cols + '" class="mce-custom-color-btn">' +
139
- '<div id="' + id + '-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" ' +
140
- 'role="button" tabindex="-1" aria-labelledby="' + id + '-c" style="width: 100%">' +
141
- '<button type="button" role="presentation" tabindex="-1">' + tinymce.translate('Custom...') + '</button>' +
142
- '</div>' +
143
- '</td>' +
144
- '</tr>'
145
- );
146
-
147
- html += '<tr>';
148
-
149
- for (x = 0; x < cols; x++) {
150
- html += getColorCellHtml('', 'Custom color');
151
- }
152
-
153
- html += '</tr>';
154
- }
155
-
156
- html += '</tbody></table>';
157
-
158
- return html;
159
- }
160
-
161
- function applyFormat(format, value) {
162
- editor.focus();
163
- editor.formatter.apply(format, {value: value});
164
- editor.nodeChanged();
165
- }
166
-
167
- function removeFormat(format) {
168
- editor.focus();
169
- editor.formatter.remove(format, {value: null}, null, true);
170
- editor.nodeChanged();
171
- }
172
-
173
- function onPanelClick(e) {
174
- var buttonCtrl = this.parent(), value;
175
-
176
- function selectColor(value) {
177
- buttonCtrl.hidePanel();
178
- buttonCtrl.color(value);
179
- applyFormat(buttonCtrl.settings.format, value);
180
- }
181
-
182
- function setDivColor(div, value) {
183
- div.style.background = value;
184
- div.setAttribute('data-mce-color', value);
185
- }
186
-
187
- if (tinymce.DOM.getParent(e.target, '.mce-custom-color-btn')) {
188
- buttonCtrl.hidePanel();
189
-
190
- editor.settings.color_picker_callback.call(editor, function(value) {
191
- var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0];
192
- var customColorCells, div, i;
193
-
194
- customColorCells = tinymce.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function(elm) {
195
- return elm.firstChild;
196
- });
197
-
198
- for (i = 0; i < customColorCells.length; i++) {
199
- div = customColorCells[i];
200
- if (!div.getAttribute('data-mce-color')) {
201
- break;
202
- }
203
- }
204
-
205
- // Shift colors to the right
206
- // TODO: Might need to be the left on RTL
207
- if (i == cols) {
208
- for (i = 0; i < cols - 1; i++) {
209
- setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
210
- }
211
- }
212
-
213
- setDivColor(div, value);
214
- selectColor(value);
215
- }, getCurrentColor(buttonCtrl.settings.format));
216
- }
217
-
218
- value = e.target.getAttribute('data-mce-color');
219
- if (value) {
220
- if (this.lastId) {
221
- document.getElementById(this.lastId).setAttribute('aria-selected', false);
222
- }
223
-
224
- e.target.setAttribute('aria-selected', true);
225
- this.lastId = e.target.id;
226
-
227
- if (value == 'transparent') {
228
- removeFormat(buttonCtrl.settings.format);
229
- buttonCtrl.hidePanel();
230
- return;
231
- }
232
-
233
- selectColor(value);
234
- } else if (value !== null) {
235
- buttonCtrl.hidePanel();
236
- }
237
- }
238
-
239
- function onButtonClick() {
240
- var self = this;
241
-
242
- if (self._color) {
243
- applyFormat(self.settings.format, self._color);
244
- }
245
- }
246
-
247
- editor.addButton('forecolor', {
248
- type: 'colorbutton',
249
- tooltip: 'Text color',
250
- format: 'forecolor',
251
- panel: {
252
- role: 'application',
253
- ariaRemember: true,
254
- html: renderColorPicker,
255
- onclick: onPanelClick
256
- },
257
- onclick: onButtonClick
258
- });
259
-
260
- editor.addButton('backcolor', {
261
- type: 'colorbutton',
262
- tooltip: 'Background color',
263
- format: 'hilitecolor',
264
- panel: {
265
- role: 'application',
266
- ariaRemember: true,
267
- html: renderColorPicker,
268
- onclick: onPanelClick
269
- },
270
- onclick: onButtonClick
271
- });
272
- });
@@ -1 +0,0 @@
1
- tinymce.PluginManager.add("textcolor",function(a){function b(b){var c;return a.dom.getParents(a.selection.getStart(),function(a){var d;(d=a.style["forecolor"==b?"color":"background-color"])&&(c=d)}),c}function c(){var b,c,d=[];for(c=a.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","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","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],b=0;b<c.length;b+=2)d.push({text:c[b+1],color:"#"+c[b]});return d}function d(){function b(a,b){var c="transparent"==a;return'<td class="mce-grid-cell'+(c?" mce-colorbtn-trans":"")+'"><div id="'+n+"-"+o++ +'" data-mce-color="'+(a?a:"")+'" role="option" tabIndex="-1" style="'+(a?"background-color: "+a:"")+'" title="'+tinymce.translate(b)+'">'+(c?"&#215;":"")+"</div></td>"}var d,e,f,g,h,k,l,m=this,n=m._id,o=0;for(d=c(),d.push({text:tinymce.translate("No color"),color:"transparent"}),f='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',g=d.length-1,k=0;j>k;k++){for(f+="<tr>",h=0;i>h;h++)l=k*i+h,l>g?f+="<td></td>":(e=d[l],f+=b(e.color,e.text));f+="</tr>"}if(a.settings.color_picker_callback){for(f+='<tr><td colspan="'+i+'" class="mce-custom-color-btn"><div id="'+n+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+n+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+tinymce.translate("Custom...")+"</button></div></td></tr>",f+="<tr>",h=0;i>h;h++)f+=b("","Custom color");f+="</tr>"}return f+="</tbody></table>"}function e(b,c){a.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()}function f(b){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()}function g(c){function d(a){j.hidePanel(),j.color(a),e(j.settings.format,a)}function g(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var h,j=this.parent();if(tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(j.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=j.panel.getEl().getElementsByTagName("table")[0];for(b=tinymce.map(f.rows[f.rows.length-1].childNodes,function(a){return a.firstChild}),e=0;e<b.length&&(c=b[e],c.getAttribute("data-mce-color"));e++);if(e==i)for(e=0;i-1>e;e++)g(b[e],b[e+1].getAttribute("data-mce-color"));g(c,a),d(a)},b(j.settings.format))),h=c.target.getAttribute("data-mce-color")){if(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==h)return f(j.settings.format),void j.hidePanel();d(h)}else null!==h&&j.hidePanel()}function h(){var a=this;a._color&&e(a.settings.format,a._color)}var i,j;j=a.settings.textcolor_rows||5,i=a.settings.textcolor_cols||8,a.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h}),a.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h})});