mirador_rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +13 -0
  7. data/README.md +97 -0
  8. data/Rakefile +6 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/lib/mirador_rails.rb +16 -0
  12. data/lib/mirador_rails/version.rb +3 -0
  13. data/lib/mirador_rails/view_helpers.rb +30 -0
  14. data/mirador_rails.gemspec +30 -0
  15. data/vendor/assets/images/border_type_1.png +0 -0
  16. data/vendor/assets/images/border_type_2.png +0 -0
  17. data/vendor/assets/images/border_type_3.png +0 -0
  18. data/vendor/assets/images/debut_dark.png +0 -0
  19. data/vendor/assets/javascripts/mirador.js +1 -0
  20. data/vendor/assets/javascripts/mirador.min.js +88 -0
  21. data/vendor/assets/javascripts/mirador.min.js.map +1 -0
  22. data/vendor/assets/locales/ar/translation.json +42 -0
  23. data/vendor/assets/locales/de/translation.json +77 -0
  24. data/vendor/assets/locales/en/translation.json +82 -0
  25. data/vendor/assets/locales/es/translation.json +35 -0
  26. data/vendor/assets/locales/fr/translation.json +77 -0
  27. data/vendor/assets/locales/ga/translation.json +39 -0
  28. data/vendor/assets/locales/ja/translation.json +82 -0
  29. data/vendor/assets/locales/ko/translation.json +74 -0
  30. data/vendor/assets/locales/nl/translation.json +39 -0
  31. data/vendor/assets/locales/zh-CN/translation.json +74 -0
  32. data/vendor/assets/locales/zh-TW/translation.json +74 -0
  33. data/vendor/assets/locales/zh/translation.json +74 -0
  34. data/vendor/assets/plugins/plugins/advlist/plugin.js +97 -0
  35. data/vendor/assets/plugins/plugins/advlist/plugin.min.js +1 -0
  36. data/vendor/assets/plugins/plugins/anchor/plugin.js +45 -0
  37. data/vendor/assets/plugins/plugins/anchor/plugin.min.js +1 -0
  38. data/vendor/assets/plugins/plugins/autolink/plugin.js +194 -0
  39. data/vendor/assets/plugins/plugins/autolink/plugin.min.js +1 -0
  40. data/vendor/assets/plugins/plugins/autoresize/plugin.js +152 -0
  41. data/vendor/assets/plugins/plugins/autoresize/plugin.min.js +1 -0
  42. data/vendor/assets/plugins/plugins/autosave/plugin.js +165 -0
  43. data/vendor/assets/plugins/plugins/autosave/plugin.min.js +1 -0
  44. data/vendor/assets/plugins/plugins/bbcode/plugin.js +123 -0
  45. data/vendor/assets/plugins/plugins/bbcode/plugin.min.js +1 -0
  46. data/vendor/assets/plugins/plugins/charmap/plugin.js +370 -0
  47. data/vendor/assets/plugins/plugins/charmap/plugin.min.js +1 -0
  48. data/vendor/assets/plugins/plugins/code/plugin.js +60 -0
  49. data/vendor/assets/plugins/plugins/code/plugin.min.js +1 -0
  50. data/vendor/assets/plugins/plugins/colorpicker/plugin.js +112 -0
  51. data/vendor/assets/plugins/plugins/colorpicker/plugin.min.js +1 -0
  52. data/vendor/assets/plugins/plugins/compat3x/css/dialog.css +118 -0
  53. data/vendor/assets/plugins/plugins/compat3x/img/buttons.png +0 -0
  54. data/vendor/assets/plugins/plugins/compat3x/img/icons.gif +0 -0
  55. data/vendor/assets/plugins/plugins/compat3x/img/items.gif +0 -0
  56. data/vendor/assets/plugins/plugins/compat3x/img/menu_arrow.gif +0 -0
  57. data/vendor/assets/plugins/plugins/compat3x/img/menu_check.gif +0 -0
  58. data/vendor/assets/plugins/plugins/compat3x/img/progress.gif +0 -0
  59. data/vendor/assets/plugins/plugins/compat3x/img/tabs.gif +0 -0
  60. data/vendor/assets/plugins/plugins/compat3x/plugin.js +297 -0
  61. data/vendor/assets/plugins/plugins/compat3x/plugin.min.js +1 -0
  62. data/vendor/assets/plugins/plugins/compat3x/tiny_mce_popup.js +542 -0
  63. data/vendor/assets/plugins/plugins/compat3x/utils/editable_selects.js +70 -0
  64. data/vendor/assets/plugins/plugins/compat3x/utils/form_utils.js +210 -0
  65. data/vendor/assets/plugins/plugins/compat3x/utils/mctabs.js +164 -0
  66. data/vendor/assets/plugins/plugins/compat3x/utils/validate.js +252 -0
  67. data/vendor/assets/plugins/plugins/contextmenu/plugin.js +87 -0
  68. data/vendor/assets/plugins/plugins/contextmenu/plugin.min.js +1 -0
  69. data/vendor/assets/plugins/plugins/directionality/plugin.js +64 -0
  70. data/vendor/assets/plugins/plugins/directionality/plugin.min.js +1 -0
  71. data/vendor/assets/plugins/plugins/emoticons/img/smiley-cool.gif +0 -0
  72. data/vendor/assets/plugins/plugins/emoticons/img/smiley-cry.gif +0 -0
  73. data/vendor/assets/plugins/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  74. data/vendor/assets/plugins/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  75. data/vendor/assets/plugins/plugins/emoticons/img/smiley-frown.gif +0 -0
  76. data/vendor/assets/plugins/plugins/emoticons/img/smiley-innocent.gif +0 -0
  77. data/vendor/assets/plugins/plugins/emoticons/img/smiley-kiss.gif +0 -0
  78. data/vendor/assets/plugins/plugins/emoticons/img/smiley-laughing.gif +0 -0
  79. data/vendor/assets/plugins/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  80. data/vendor/assets/plugins/plugins/emoticons/img/smiley-sealed.gif +0 -0
  81. data/vendor/assets/plugins/plugins/emoticons/img/smiley-smile.gif +0 -0
  82. data/vendor/assets/plugins/plugins/emoticons/img/smiley-surprised.gif +0 -0
  83. data/vendor/assets/plugins/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  84. data/vendor/assets/plugins/plugins/emoticons/img/smiley-undecided.gif +0 -0
  85. data/vendor/assets/plugins/plugins/emoticons/img/smiley-wink.gif +0 -0
  86. data/vendor/assets/plugins/plugins/emoticons/img/smiley-yell.gif +0 -0
  87. data/vendor/assets/plugins/plugins/emoticons/plugin.js +65 -0
  88. data/vendor/assets/plugins/plugins/emoticons/plugin.min.js +1 -0
  89. data/vendor/assets/plugins/plugins/example/dialog.html +8 -0
  90. data/vendor/assets/plugins/plugins/example/plugin.js +68 -0
  91. data/vendor/assets/plugins/plugins/example/plugin.min.js +1 -0
  92. data/vendor/assets/plugins/plugins/example_dependency/plugin.js +22 -0
  93. data/vendor/assets/plugins/plugins/example_dependency/plugin.min.js +1 -0
  94. data/vendor/assets/plugins/plugins/fullpage/plugin.js +490 -0
  95. data/vendor/assets/plugins/plugins/fullpage/plugin.min.js +1 -0
  96. data/vendor/assets/plugins/plugins/fullscreen/plugin.js +136 -0
  97. data/vendor/assets/plugins/plugins/fullscreen/plugin.min.js +1 -0
  98. data/vendor/assets/plugins/plugins/hr/plugin.js +30 -0
  99. data/vendor/assets/plugins/plugins/hr/plugin.min.js +1 -0
  100. data/vendor/assets/plugins/plugins/image/plugin.js +439 -0
  101. data/vendor/assets/plugins/plugins/image/plugin.min.js +1 -0
  102. data/vendor/assets/plugins/plugins/importcss/plugin.js +195 -0
  103. data/vendor/assets/plugins/plugins/importcss/plugin.min.js +1 -0
  104. data/vendor/assets/plugins/plugins/insertdatetime/plugin.js +121 -0
  105. data/vendor/assets/plugins/plugins/insertdatetime/plugin.min.js +1 -0
  106. data/vendor/assets/plugins/plugins/layer/plugin.js +225 -0
  107. data/vendor/assets/plugins/plugins/layer/plugin.min.js +1 -0
  108. data/vendor/assets/plugins/plugins/legacyoutput/plugin.js +211 -0
  109. data/vendor/assets/plugins/plugins/legacyoutput/plugin.min.js +1 -0
  110. data/vendor/assets/plugins/plugins/link/plugin.js +400 -0
  111. data/vendor/assets/plugins/plugins/link/plugin.min.js +1 -0
  112. data/vendor/assets/plugins/plugins/lists/plugin.js +791 -0
  113. data/vendor/assets/plugins/plugins/lists/plugin.min.js +1 -0
  114. data/vendor/assets/plugins/plugins/media/moxieplayer.swf +0 -0
  115. data/vendor/assets/plugins/plugins/media/plugin.js +774 -0
  116. data/vendor/assets/plugins/plugins/media/plugin.min.js +1 -0
  117. data/vendor/assets/plugins/plugins/nonbreaking/plugin.js +53 -0
  118. data/vendor/assets/plugins/plugins/nonbreaking/plugin.min.js +1 -0
  119. data/vendor/assets/plugins/plugins/noneditable/plugin.js +540 -0
  120. data/vendor/assets/plugins/plugins/noneditable/plugin.min.js +1 -0
  121. data/vendor/assets/plugins/plugins/pagebreak/plugin.js +88 -0
  122. data/vendor/assets/plugins/plugins/pagebreak/plugin.min.js +1 -0
  123. data/vendor/assets/plugins/plugins/paste/classes/Clipboard.js +634 -0
  124. data/vendor/assets/plugins/plugins/paste/classes/Plugin.js +110 -0
  125. data/vendor/assets/plugins/plugins/paste/classes/Quirks.js +159 -0
  126. data/vendor/assets/plugins/plugins/paste/classes/Utils.js +130 -0
  127. data/vendor/assets/plugins/plugins/paste/classes/WordFilter.js +493 -0
  128. data/vendor/assets/plugins/plugins/paste/plugin.dev.js +120 -0
  129. data/vendor/assets/plugins/plugins/paste/plugin.js +1625 -0
  130. data/vendor/assets/plugins/plugins/paste/plugin.min.js +1 -0
  131. data/vendor/assets/plugins/plugins/preview/plugin.js +88 -0
  132. data/vendor/assets/plugins/plugins/preview/plugin.min.js +1 -0
  133. data/vendor/assets/plugins/plugins/print/plugin.js +32 -0
  134. data/vendor/assets/plugins/plugins/print/plugin.min.js +1 -0
  135. data/vendor/assets/plugins/plugins/save/plugin.js +94 -0
  136. data/vendor/assets/plugins/plugins/save/plugin.min.js +1 -0
  137. data/vendor/assets/plugins/plugins/searchreplace/plugin.js +594 -0
  138. data/vendor/assets/plugins/plugins/searchreplace/plugin.min.js +1 -0
  139. data/vendor/assets/plugins/plugins/spellchecker/classes/DomTextMatcher.js +470 -0
  140. data/vendor/assets/plugins/plugins/spellchecker/classes/Plugin.js +436 -0
  141. data/vendor/assets/plugins/plugins/spellchecker/plugin.dev.js +117 -0
  142. data/vendor/assets/plugins/plugins/spellchecker/plugin.js +996 -0
  143. data/vendor/assets/plugins/plugins/spellchecker/plugin.min.js +1 -0
  144. data/vendor/assets/plugins/plugins/tabfocus/plugin.js +120 -0
  145. data/vendor/assets/plugins/plugins/tabfocus/plugin.min.js +1 -0
  146. data/vendor/assets/plugins/plugins/table/classes/CellSelection.js +176 -0
  147. data/vendor/assets/plugins/plugins/table/classes/Dialogs.js +749 -0
  148. data/vendor/assets/plugins/plugins/table/classes/Plugin.js +422 -0
  149. data/vendor/assets/plugins/plugins/table/classes/Quirks.js +372 -0
  150. data/vendor/assets/plugins/plugins/table/classes/TableGrid.js +864 -0
  151. data/vendor/assets/plugins/plugins/table/plugin.dev.js +118 -0
  152. data/vendor/assets/plugins/plugins/table/plugin.js +2680 -0
  153. data/vendor/assets/plugins/plugins/table/plugin.min.js +1 -0
  154. data/vendor/assets/plugins/plugins/template/plugin.js +262 -0
  155. data/vendor/assets/plugins/plugins/template/plugin.min.js +1 -0
  156. data/vendor/assets/plugins/plugins/textcolor/plugin.js +272 -0
  157. data/vendor/assets/plugins/plugins/textcolor/plugin.min.js +1 -0
  158. data/vendor/assets/plugins/plugins/textpattern/plugin.js +268 -0
  159. data/vendor/assets/plugins/plugins/textpattern/plugin.min.js +1 -0
  160. data/vendor/assets/plugins/plugins/visualblocks/css/visualblocks.css +135 -0
  161. data/vendor/assets/plugins/plugins/visualblocks/img/address.gif +0 -0
  162. data/vendor/assets/plugins/plugins/visualblocks/img/article.gif +0 -0
  163. data/vendor/assets/plugins/plugins/visualblocks/img/aside.gif +0 -0
  164. data/vendor/assets/plugins/plugins/visualblocks/img/blockquote.gif +0 -0
  165. data/vendor/assets/plugins/plugins/visualblocks/img/div.gif +0 -0
  166. data/vendor/assets/plugins/plugins/visualblocks/img/dl.gif +0 -0
  167. data/vendor/assets/plugins/plugins/visualblocks/img/figure.gif +0 -0
  168. data/vendor/assets/plugins/plugins/visualblocks/img/h1.gif +0 -0
  169. data/vendor/assets/plugins/plugins/visualblocks/img/h2.gif +0 -0
  170. data/vendor/assets/plugins/plugins/visualblocks/img/h3.gif +0 -0
  171. data/vendor/assets/plugins/plugins/visualblocks/img/h4.gif +0 -0
  172. data/vendor/assets/plugins/plugins/visualblocks/img/h5.gif +0 -0
  173. data/vendor/assets/plugins/plugins/visualblocks/img/h6.gif +0 -0
  174. data/vendor/assets/plugins/plugins/visualblocks/img/hgroup.gif +0 -0
  175. data/vendor/assets/plugins/plugins/visualblocks/img/ol.gif +0 -0
  176. data/vendor/assets/plugins/plugins/visualblocks/img/p.gif +0 -0
  177. data/vendor/assets/plugins/plugins/visualblocks/img/pre.gif +0 -0
  178. data/vendor/assets/plugins/plugins/visualblocks/img/section.gif +0 -0
  179. data/vendor/assets/plugins/plugins/visualblocks/img/ul.gif +0 -0
  180. data/vendor/assets/plugins/plugins/visualblocks/plugin.js +86 -0
  181. data/vendor/assets/plugins/plugins/visualblocks/plugin.min.js +1 -0
  182. data/vendor/assets/plugins/plugins/visualchars/plugin.js +88 -0
  183. data/vendor/assets/plugins/plugins/visualchars/plugin.min.js +1 -0
  184. data/vendor/assets/plugins/plugins/wordcount/plugin.js +69 -0
  185. data/vendor/assets/plugins/plugins/wordcount/plugin.min.js +1 -0
  186. data/vendor/assets/skins/skins/lightgray/content.inline.min.css +1 -0
  187. data/vendor/assets/skins/skins/lightgray/content.min.css +1 -0
  188. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.eot +0 -0
  189. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.svg +62 -0
  190. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  191. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.woff +0 -0
  192. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.eot +0 -0
  193. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.svg +63 -0
  194. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.ttf +0 -0
  195. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.woff +0 -0
  196. data/vendor/assets/skins/skins/lightgray/img/anchor.gif +0 -0
  197. data/vendor/assets/skins/skins/lightgray/img/loader.gif +0 -0
  198. data/vendor/assets/skins/skins/lightgray/img/object.gif +0 -0
  199. data/vendor/assets/skins/skins/lightgray/img/trans.gif +0 -0
  200. data/vendor/assets/skins/skins/lightgray/skin.ie7.min.css +1 -0
  201. data/vendor/assets/skins/skins/lightgray/skin.min.css +1 -0
  202. data/vendor/assets/stylesheets/mirador-combined.css +3969 -0
  203. data/vendor/assets/stylesheets/mirador.css +11 -0
  204. data/vendor/assets/themes/themes/modern/theme.js +617 -0
  205. data/vendor/assets/themes/themes/modern/theme.min.js +1 -0
  206. metadata +318 -0
@@ -0,0 +1 @@
1
+ tinymce.PluginManager.add("colorpicker",function(a){function b(b,c){function d(a){var b=new tinymce.util.Color(a),c=b.toRgb();f.fromJSON({r:c.r,g:c.g,b:c.b,hex:b.toHex().substr(1)}),e(b.toHex())}function e(a){f.find("#preview")[0].getEl().style.background=a}var f=a.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:c,onchange:function(){var a=this.rgb();f&&(f.find("#r").value(a.r),f.find("#g").value(a.g),f.find("#b").value(a.b),f.find("#hex").value(this.value().substr(1)),e(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var a,b,c=f.find("colorpicker")[0];return a=this.name(),b=this.value(),"hex"==a?(b="#"+b,d(b),void c.value(b)):(b={r:f.find("#r").value(),g:f.find("#g").value(),b:f.find("#b").value()},c.value(b),void d(b))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){b("#"+this.toJSON().hex)}});d(c)}a.settings.color_picker_callback||(a.settings.color_picker_callback=b)});
@@ -0,0 +1,118 @@
1
+ /* Generic */
2
+ body {
3
+ font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
4
+ scrollbar-3dlight-color:#F0F0EE;
5
+ scrollbar-arrow-color:#676662;
6
+ scrollbar-base-color:#F0F0EE;
7
+ scrollbar-darkshadow-color:#DDDDDD;
8
+ scrollbar-face-color:#E0E0DD;
9
+ scrollbar-highlight-color:#F0F0EE;
10
+ scrollbar-shadow-color:#F0F0EE;
11
+ scrollbar-track-color:#F5F5F5;
12
+ background:#F0F0EE;
13
+ padding:0;
14
+ margin:8px 8px 0 8px;
15
+ }
16
+
17
+ html {background:#F0F0EE;}
18
+ td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
19
+ textarea {resize:none;outline:none;}
20
+ a:link, a:visited {color:black;}
21
+ a:hover {color:#2B6FB6;}
22
+ .nowrap {white-space: nowrap}
23
+
24
+ /* Forms */
25
+ fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
26
+ legend {color:#2B6FB6; font-weight:bold;}
27
+ label.msg {display:none;}
28
+ label.invalid {color:#EE0000; display:inline;}
29
+ input.invalid {border:1px solid #EE0000;}
30
+ input {background:#FFF; border:1px solid #CCC;}
31
+ input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
32
+ input, select, textarea {border:1px solid #808080;}
33
+ input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
34
+ input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
35
+ .input_noborder {border:0;}
36
+
37
+ /* Buttons */
38
+ #insert, #cancel, input.button, .updateButton {
39
+ border:0; margin:0; padding:0;
40
+ font-weight:bold;
41
+ width:94px; height:26px;
42
+ background:url(../img/buttons.png) 0 -26px;
43
+ cursor:pointer;
44
+ padding-bottom:2px;
45
+ float:left;
46
+ }
47
+
48
+ #insert {background:url(../img/buttons.png) 0 -52px}
49
+ #cancel {background:url(../img/buttons.png) 0 0; float:right}
50
+
51
+ /* Browse */
52
+ a.pickcolor, a.browse {text-decoration:none}
53
+ a.browse span {display:block; width:20px; height:18px; background:url(../img/icons.gif) -20px 0 no-repeat; border:1px solid #FFF; margin-left:1px;}
54
+ .mceOldBoxModel a.browse span {width:22px; height:20px;}
55
+ a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
56
+ a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
57
+ a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
58
+ a.pickcolor span {display:block; width:20px; height:16px; background:url(../img/icons.gif) -840px 0; margin-left:2px;}
59
+ .mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
60
+ a.pickcolor:hover span {background-color:#B2BBD0;}
61
+ a.pickcolor:hover span.disabled {}
62
+
63
+ /* Charmap */
64
+ table.charmap {border:1px solid #AAA; text-align:center}
65
+ 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;}
66
+ #charmap a {display:block; color:#000; text-decoration:none; border:0}
67
+ #charmap a:hover {background:#CCC;color:#2B6FB6}
68
+ #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
69
+ #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
70
+
71
+ /* Source */
72
+ .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
73
+ .mceActionPanel {margin-top:5px;}
74
+
75
+ /* Tabs classes */
76
+ .tabs {width:100%; height:18px; line-height:normal; background:url(../img/tabs.gif) repeat-x 0 -72px;}
77
+ .tabs ul {margin:0; padding:0; list-style:none;}
78
+ .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;}
79
+ .tabs li.current {background:url(../img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
80
+ .tabs span {float:left; display:block; background:url(../img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
81
+ .tabs .current span {background:url(../img/tabs.gif) no-repeat right -54px;}
82
+ .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
83
+ .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
84
+
85
+ /* Panels */
86
+ .panel_wrapper div.panel {display:none;}
87
+ .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
88
+ .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
89
+
90
+ /* Columns */
91
+ .column {float:left;}
92
+ .properties {width:100%;}
93
+ .properties .column1 {}
94
+ .properties .column2 {text-align:left;}
95
+
96
+ /* Titles */
97
+ h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
98
+ h3 {font-size:14px;}
99
+ .title {font-size:12px; font-weight:bold; color:#2B6FB6;}
100
+
101
+ /* Dialog specific */
102
+ #link .panel_wrapper, #link div.current {height:125px;}
103
+ #image .panel_wrapper, #image div.current {height:200px;}
104
+ #plugintable thead {font-weight:bold; background:#DDD;}
105
+ #plugintable, #about #plugintable td {border:1px solid #919B9C;}
106
+ #plugintable {width:96%; margin-top:10px;}
107
+ #pluginscontainer {height:290px; overflow:auto;}
108
+ #colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}
109
+ #colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}
110
+ #colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}
111
+ #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
112
+ #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
113
+ #colorpicker #light div {overflow:hidden;}
114
+ #colorpicker .panel_wrapper div.current {height:175px;}
115
+ #colorpicker #namedcolors {width:150px;}
116
+ #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
117
+ #colorpicker #colornamecontainer {margin-top:5px;}
118
+ #colorpicker #picker_panel fieldset {margin:auto;width:325px;}
@@ -0,0 +1,297 @@
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, console:true */
12
+ /*eslint no-console:0, new-cap:0 */
13
+
14
+ /**
15
+ * This plugin adds missing events form the 4.x API back. Not every event is
16
+ * properly supported but most things should work.
17
+ *
18
+ * Unsupported things:
19
+ * - No editor.onEvent
20
+ * - Can't cancel execCommands with beforeExecCommand
21
+ */
22
+ (function(tinymce) {
23
+ var reported;
24
+
25
+ function noop() {
26
+ }
27
+
28
+ function log(apiCall) {
29
+ if (!reported && window && window.console) {
30
+ reported = true;
31
+ console.log("Deprecated TinyMCE API call: " + apiCall);
32
+ }
33
+ }
34
+
35
+ function Dispatcher(target, newEventName, argsMap, defaultScope) {
36
+ target = target || this;
37
+
38
+ if (!newEventName) {
39
+ this.add = this.addToTop = this.remove = this.dispatch = noop;
40
+ return;
41
+ }
42
+
43
+ this.add = function(callback, scope, prepend) {
44
+ log('<target>.on' + newEventName + ".add(..)");
45
+
46
+ // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
47
+ function patchedEventCallback(e) {
48
+ var callbackArgs = [];
49
+
50
+ if (typeof argsMap == "string") {
51
+ argsMap = argsMap.split(" ");
52
+ }
53
+
54
+ if (argsMap && typeof argsMap != "function") {
55
+ for (var i = 0; i < argsMap.length; i++) {
56
+ callbackArgs.push(e[argsMap[i]]);
57
+ }
58
+ }
59
+
60
+ if (typeof argsMap == "function") {
61
+ callbackArgs = argsMap(newEventName, e, target);
62
+ if (!callbackArgs) {
63
+ return;
64
+ }
65
+ }
66
+
67
+ if (!argsMap) {
68
+ callbackArgs = [e];
69
+ }
70
+
71
+ callbackArgs.unshift(defaultScope || target);
72
+
73
+ if (callback.apply(scope || defaultScope || target, callbackArgs) === false) {
74
+ e.stopImmediatePropagation();
75
+ }
76
+ }
77
+
78
+ target.on(newEventName, patchedEventCallback, prepend);
79
+
80
+ return patchedEventCallback;
81
+ };
82
+
83
+ this.addToTop = function(callback, scope) {
84
+ this.add(callback, scope, true);
85
+ };
86
+
87
+ this.remove = function(callback) {
88
+ return target.off(newEventName, callback);
89
+ };
90
+
91
+ this.dispatch = function() {
92
+ target.fire(newEventName);
93
+
94
+ return true;
95
+ };
96
+ }
97
+
98
+ tinymce.util.Dispatcher = Dispatcher;
99
+ tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload");
100
+ tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor");
101
+ tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor");
102
+
103
+ tinymce.util.Cookie = {
104
+ get: noop, getHash: noop, remove: noop, set: noop, setHash: noop
105
+ };
106
+
107
+ function patchEditor(editor) {
108
+ function patchEditorEvents(oldEventNames, argsMap) {
109
+ tinymce.each(oldEventNames.split(" "), function(oldName) {
110
+ editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
111
+ });
112
+ }
113
+
114
+ function convertUndoEventArgs(type, event, target) {
115
+ return [
116
+ event.level,
117
+ target
118
+ ];
119
+ }
120
+
121
+ function filterSelectionEvents(needsSelection) {
122
+ return function(type, e) {
123
+ if ((!e.selection && !needsSelection) || e.selection == needsSelection) {
124
+ return [e];
125
+ }
126
+ };
127
+ }
128
+
129
+ if (editor.controlManager) {
130
+ return;
131
+ }
132
+
133
+ function cmNoop() {
134
+ var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' +
135
+ 'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' +
136
+ 'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' +
137
+ 'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update';
138
+
139
+ log('editor.controlManager.*');
140
+
141
+ function _noop() {
142
+ return cmNoop();
143
+ }
144
+
145
+ tinymce.each(methods.split(' '), function(method) {
146
+ obj[method] = _noop;
147
+ });
148
+
149
+ return obj;
150
+ }
151
+
152
+ editor.controlManager = {
153
+ buttons: {},
154
+
155
+ setDisabled: function(name, state) {
156
+ log("controlManager.setDisabled(..)");
157
+
158
+ if (this.buttons[name]) {
159
+ this.buttons[name].disabled(state);
160
+ }
161
+ },
162
+
163
+ setActive: function(name, state) {
164
+ log("controlManager.setActive(..)");
165
+
166
+ if (this.buttons[name]) {
167
+ this.buttons[name].active(state);
168
+ }
169
+ },
170
+
171
+ onAdd: new Dispatcher(),
172
+ onPostRender: new Dispatcher(),
173
+
174
+ add: function(obj) {
175
+ return obj;
176
+ },
177
+ createButton: cmNoop,
178
+ createColorSplitButton: cmNoop,
179
+ createControl: cmNoop,
180
+ createDropMenu: cmNoop,
181
+ createListBox: cmNoop,
182
+ createMenuButton: cmNoop,
183
+ createSeparator: cmNoop,
184
+ createSplitButton: cmNoop,
185
+ createToolbar: cmNoop,
186
+ createToolbarGroup: cmNoop,
187
+ destroy: noop,
188
+ get: noop,
189
+ setControlType: cmNoop
190
+ };
191
+
192
+ patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor");
193
+ patchEditorEvents("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset");
194
+ patchEditorEvents("BeforeExecCommand ExecCommand", "command ui value args"); // args.terminate not supported
195
+ patchEditorEvents("PreProcess PostProcess LoadContent SaveContent Change");
196
+ patchEditorEvents("BeforeSetContent BeforeGetContent SetContent GetContent", filterSelectionEvents(false));
197
+ patchEditorEvents("SetProgressState", "state time");
198
+ patchEditorEvents("VisualAid", "element hasVisual");
199
+ patchEditorEvents("Undo Redo", convertUndoEventArgs);
200
+
201
+ patchEditorEvents("NodeChange", function(type, e) {
202
+ return [
203
+ editor.controlManager,
204
+ e.element,
205
+ editor.selection.isCollapsed(),
206
+ e
207
+ ];
208
+ });
209
+
210
+ var originalAddButton = editor.addButton;
211
+ editor.addButton = function(name, settings) {
212
+ var originalOnPostRender;
213
+
214
+ function patchedPostRender() {
215
+ editor.controlManager.buttons[name] = this;
216
+
217
+ if (originalOnPostRender) {
218
+ return originalOnPostRender.call(this);
219
+ }
220
+ }
221
+
222
+ for (var key in settings) {
223
+ if (key.toLowerCase() === "onpostrender") {
224
+ originalOnPostRender = settings[key];
225
+ settings.onPostRender = patchedPostRender;
226
+ }
227
+ }
228
+
229
+ if (!originalOnPostRender) {
230
+ settings.onPostRender = patchedPostRender;
231
+ }
232
+
233
+ if (settings.title) {
234
+ settings.title = tinymce.i18n.translate((editor.settings.language || "en") + "." + settings.title);
235
+ }
236
+
237
+ return originalAddButton.call(this, name, settings);
238
+ };
239
+
240
+ editor.on('init', function() {
241
+ var undoManager = editor.undoManager, selection = editor.selection;
242
+
243
+ undoManager.onUndo = new Dispatcher(editor, "Undo", convertUndoEventArgs, null, undoManager);
244
+ undoManager.onRedo = new Dispatcher(editor, "Redo", convertUndoEventArgs, null, undoManager);
245
+ undoManager.onBeforeAdd = new Dispatcher(editor, "BeforeAddUndo", null, undoManager);
246
+ undoManager.onAdd = new Dispatcher(editor, "AddUndo", null, undoManager);
247
+
248
+ selection.onBeforeGetContent = new Dispatcher(editor, "BeforeGetContent", filterSelectionEvents(true), selection);
249
+ selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection);
250
+ selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection);
251
+ selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection);
252
+ });
253
+
254
+ editor.on('BeforeRenderUI', function() {
255
+ var windowManager = editor.windowManager;
256
+
257
+ windowManager.onOpen = new Dispatcher();
258
+ windowManager.onClose = new Dispatcher();
259
+ windowManager.createInstance = function(className, a, b, c, d, e) {
260
+ log("windowManager.createInstance(..)");
261
+
262
+ var constr = tinymce.resolve(className);
263
+ return new constr(a, b, c, d, e);
264
+ };
265
+ });
266
+ }
267
+
268
+ tinymce.on('SetupEditor', patchEditor);
269
+ tinymce.PluginManager.add("compat3x", patchEditor);
270
+
271
+ tinymce.addI18n = function(prefix, o) {
272
+ var I18n = tinymce.util.I18n, each = tinymce.each;
273
+
274
+ if (typeof(prefix) == "string" && prefix.indexOf('.') === -1) {
275
+ I18n.add(prefix, o);
276
+ return;
277
+ }
278
+
279
+ if (!tinymce.is(prefix, 'string')) {
280
+ each(prefix, function(o, lc) {
281
+ each(o, function(o, g) {
282
+ each(o, function(o, k) {
283
+ if (g === 'common') {
284
+ I18n.data[lc + '.' + k] = o;
285
+ } else {
286
+ I18n.data[lc + '.' + g + '.' + k] = o;
287
+ }
288
+ });
289
+ });
290
+ });
291
+ } else {
292
+ each(o, function(o, k) {
293
+ I18n.data[prefix + '.' + k] = o;
294
+ });
295
+ }
296
+ };
297
+ })(tinymce);
@@ -0,0 +1 @@
1
+ !function(a){function b(){}function c(a){!f&&window&&window.console&&(f=!0,console.log("Deprecated TinyMCE API call: "+a))}function d(a,d,e,f){return a=a||this,d?(this.add=function(b,g,h){function i(c){var h=[];if("string"==typeof e&&(e=e.split(" ")),e&&"function"!=typeof e)for(var i=0;i<e.length;i++)h.push(c[e[i]]);("function"!=typeof e||(h=e(d,c,a)))&&(e||(h=[c]),h.unshift(f||a),b.apply(g||f||a,h)===!1&&c.stopImmediatePropagation())}return c("<target>.on"+d+".add(..)"),a.on(d,i,h),i},this.addToTop=function(a,b){this.add(a,b,!0)},this.remove=function(b){return a.off(d,b)},void(this.dispatch=function(){return a.fire(d),!0})):void(this.add=this.addToTop=this.remove=this.dispatch=b)}function e(e){function f(b,c){a.each(b.split(" "),function(a){e["on"+a]=new d(e,a,c)})}function g(a,b,c){return[b.level,c]}function h(a){return function(b,c){return!c.selection&&!a||c.selection==a?[c]:void 0}}function i(){function b(){return i()}var d={},e="add addMenu addSeparator collapse createMenu destroy displayColor expand focus getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex setActive setAriaProperty setColor setDisabled setSelected setState showMenu update";return c("editor.controlManager.*"),a.each(e.split(" "),function(a){d[a]=b}),d}if(!e.controlManager){e.controlManager={buttons:{},setDisabled:function(a,b){c("controlManager.setDisabled(..)"),this.buttons[a]&&this.buttons[a].disabled(b)},setActive:function(a,b){c("controlManager.setActive(..)"),this.buttons[a]&&this.buttons[a].active(b)},onAdd:new d,onPostRender:new d,add:function(a){return a},createButton:i,createColorSplitButton:i,createControl:i,createDropMenu:i,createListBox:i,createMenuButton:i,createSeparator:i,createSplitButton:i,createToolbar:i,createToolbarGroup:i,destroy:b,get:b,setControlType:i},f("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor"),f("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"),f("BeforeExecCommand ExecCommand","command ui value args"),f("PreProcess PostProcess LoadContent SaveContent Change"),f("BeforeSetContent BeforeGetContent SetContent GetContent",h(!1)),f("SetProgressState","state time"),f("VisualAid","element hasVisual"),f("Undo Redo",g),f("NodeChange",function(a,b){return[e.controlManager,b.element,e.selection.isCollapsed(),b]});var j=e.addButton;e.addButton=function(b,c){function d(){return e.controlManager.buttons[b]=this,f?f.call(this):void 0}var f;for(var g in c)"onpostrender"===g.toLowerCase()&&(f=c[g],c.onPostRender=d);return f||(c.onPostRender=d),c.title&&(c.title=a.i18n.translate((e.settings.language||"en")+"."+c.title)),j.call(this,b,c)},e.on("init",function(){var a=e.undoManager,b=e.selection;a.onUndo=new d(e,"Undo",g,null,a),a.onRedo=new d(e,"Redo",g,null,a),a.onBeforeAdd=new d(e,"BeforeAddUndo",null,a),a.onAdd=new d(e,"AddUndo",null,a),b.onBeforeGetContent=new d(e,"BeforeGetContent",h(!0),b),b.onGetContent=new d(e,"GetContent",h(!0),b),b.onBeforeSetContent=new d(e,"BeforeSetContent",h(!0),b),b.onSetContent=new d(e,"SetContent",h(!0),b)}),e.on("BeforeRenderUI",function(){var b=e.windowManager;b.onOpen=new d,b.onClose=new d,b.createInstance=function(b,d,e,f,g,h){c("windowManager.createInstance(..)");var i=a.resolve(b);return new i(d,e,f,g,h)}})}}var f;a.util.Dispatcher=d,a.onBeforeUnload=new d(a,"BeforeUnload"),a.onAddEditor=new d(a,"AddEditor","editor"),a.onRemoveEditor=new d(a,"RemoveEditor","editor"),a.util.Cookie={get:b,getHash:b,remove:b,set:b,setHash:b},a.on("SetupEditor",e),a.PluginManager.add("compat3x",e),a.addI18n=function(b,c){var d=a.util.I18n,e=a.each;return"string"==typeof b&&-1===b.indexOf(".")?void d.add(b,c):void(a.is(b,"string")?e(c,function(a,c){d.data[b+"."+c]=a}):e(b,function(a,b){e(a,function(a,c){e(a,function(a,e){"common"===c?d.data[b+"."+e]=a:d.data[b+"."+c+"."+e]=a})})}))}}(tinymce);
@@ -0,0 +1,542 @@
1
+ /**
2
+ * Popup.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
+ var tinymce, tinyMCE;
12
+
13
+ /**
14
+ * TinyMCE popup/dialog helper class. This gives you easy access to the
15
+ * parent editor instance and a bunch of other things. It's higly recommended
16
+ * that you load this script into your dialogs.
17
+ *
18
+ * @static
19
+ * @class tinyMCEPopup
20
+ */
21
+ var tinyMCEPopup = {
22
+ /**
23
+ * Initializes the popup this will be called automatically.
24
+ *
25
+ * @method init
26
+ */
27
+ init: function() {
28
+ var self = this, parentWin, settings, uiWindow;
29
+
30
+ // Find window & API
31
+ parentWin = self.getWin();
32
+ tinymce = tinyMCE = parentWin.tinymce;
33
+ self.editor = tinymce.EditorManager.activeEditor;
34
+ self.params = self.editor.windowManager.getParams();
35
+
36
+ uiWindow = self.editor.windowManager.windows[self.editor.windowManager.windows.length - 1];
37
+ self.features = uiWindow.features;
38
+ self.uiWindow = uiWindow;
39
+
40
+ settings = self.editor.settings;
41
+
42
+ // Setup popup CSS path(s)
43
+ if (settings.popup_css !== false) {
44
+ if (settings.popup_css) {
45
+ settings.popup_css = self.editor.documentBaseURI.toAbsolute(settings.popup_css);
46
+ } else {
47
+ settings.popup_css = self.editor.baseURI.toAbsolute("plugins/compat3x/css/dialog.css");
48
+ }
49
+ }
50
+
51
+ if (settings.popup_css_add) {
52
+ settings.popup_css += ',' + self.editor.documentBaseURI.toAbsolute(settings.popup_css_add);
53
+ }
54
+
55
+ // Setup local DOM
56
+ self.dom = self.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document, {
57
+ ownEvents: true,
58
+ proxy: tinyMCEPopup._eventProxy
59
+ });
60
+
61
+ self.dom.bind(window, 'ready', self._onDOMLoaded, self);
62
+
63
+ // Enables you to skip loading the default css
64
+ if (self.features.popup_css !== false) {
65
+ self.dom.loadCSS(self.features.popup_css || self.editor.settings.popup_css);
66
+ }
67
+
68
+ // Setup on init listeners
69
+ self.listeners = [];
70
+
71
+ /**
72
+ * Fires when the popup is initialized.
73
+ *
74
+ * @event onInit
75
+ * @param {tinymce.Editor} editor Editor instance.
76
+ * @example
77
+ * // Alerts the selected contents when the dialog is loaded
78
+ * tinyMCEPopup.onInit.add(function(ed) {
79
+ * alert(ed.selection.getContent());
80
+ * });
81
+ *
82
+ * // Executes the init method on page load in some object using the SomeObject scope
83
+ * tinyMCEPopup.onInit.add(SomeObject.init, SomeObject);
84
+ */
85
+ self.onInit = {
86
+ add: function(func, scope) {
87
+ self.listeners.push({func : func, scope : scope});
88
+ }
89
+ };
90
+
91
+ self.isWindow = !self.getWindowArg('mce_inline');
92
+ self.id = self.getWindowArg('mce_window_id');
93
+ },
94
+
95
+ /**
96
+ * Returns the reference to the parent window that opened the dialog.
97
+ *
98
+ * @method getWin
99
+ * @return {Window} Reference to the parent window that opened the dialog.
100
+ */
101
+ getWin: function() {
102
+ // Added frameElement check to fix bug: #2817583
103
+ return (!window.frameElement && window.dialogArguments) || opener || parent || top;
104
+ },
105
+
106
+ /**
107
+ * Returns a window argument/parameter by name.
108
+ *
109
+ * @method getWindowArg
110
+ * @param {String} name Name of the window argument to retrive.
111
+ * @param {String} defaultValue Optional default value to return.
112
+ * @return {String} Argument value or default value if it wasn't found.
113
+ */
114
+ getWindowArg : function(name, defaultValue) {
115
+ var value = this.params[name];
116
+
117
+ return tinymce.is(value) ? value : defaultValue;
118
+ },
119
+
120
+ /**
121
+ * Returns a editor parameter/config option value.
122
+ *
123
+ * @method getParam
124
+ * @param {String} name Name of the editor config option to retrive.
125
+ * @param {String} defaultValue Optional default value to return.
126
+ * @return {String} Parameter value or default value if it wasn't found.
127
+ */
128
+ getParam : function(name, defaultValue) {
129
+ return this.editor.getParam(name, defaultValue);
130
+ },
131
+
132
+ /**
133
+ * Returns a language item by key.
134
+ *
135
+ * @method getLang
136
+ * @param {String} name Language item like mydialog.something.
137
+ * @param {String} defaultValue Optional default value to return.
138
+ * @return {String} Language value for the item like "my string" or the default value if it wasn't found.
139
+ */
140
+ getLang : function(name, defaultValue) {
141
+ return this.editor.getLang(name, defaultValue);
142
+ },
143
+
144
+ /**
145
+ * Executed a command on editor that opened the dialog/popup.
146
+ *
147
+ * @method execCommand
148
+ * @param {String} cmd Command to execute.
149
+ * @param {Boolean} ui Optional boolean value if the UI for the command should be presented or not.
150
+ * @param {Object} val Optional value to pass with the comman like an URL.
151
+ * @param {Object} a Optional arguments object.
152
+ */
153
+ execCommand : function(cmd, ui, val, args) {
154
+ args = args || {};
155
+ args.skip_focus = 1;
156
+
157
+ this.restoreSelection();
158
+ return this.editor.execCommand(cmd, ui, val, args);
159
+ },
160
+
161
+ /**
162
+ * Resizes the dialog to the inner size of the window. This is needed since various browsers
163
+ * have different border sizes on windows.
164
+ *
165
+ * @method resizeToInnerSize
166
+ */
167
+ resizeToInnerSize : function() {
168
+ /*var self = this;
169
+
170
+ // Detach it to workaround a Chrome specific bug
171
+ // https://sourceforge.net/tracker/?func=detail&atid=635682&aid=2926339&group_id=103281
172
+ setTimeout(function() {
173
+ var vp = self.dom.getViewPort(window);
174
+
175
+ self.editor.windowManager.resizeBy(
176
+ self.getWindowArg('mce_width') - vp.w,
177
+ self.getWindowArg('mce_height') - vp.h,
178
+ self.id || window
179
+ );
180
+ }, 10);*/
181
+ },
182
+
183
+ /**
184
+ * Will executed the specified string when the page has been loaded. This function
185
+ * was added for compatibility with the 2.x branch.
186
+ *
187
+ * @method executeOnLoad
188
+ * @param {String} evil String to evalutate on init.
189
+ */
190
+ executeOnLoad : function(evil) {
191
+ this.onInit.add(function() {
192
+ eval(evil);
193
+ });
194
+ },
195
+
196
+ /**
197
+ * Stores the current editor selection for later restoration. This can be useful since some browsers
198
+ * looses it's selection if a control element is selected/focused inside the dialogs.
199
+ *
200
+ * @method storeSelection
201
+ */
202
+ storeSelection : function() {
203
+ this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark(1);
204
+ },
205
+
206
+ /**
207
+ * Restores any stored selection. This can be useful since some browsers
208
+ * looses it's selection if a control element is selected/focused inside the dialogs.
209
+ *
210
+ * @method restoreSelection
211
+ */
212
+ restoreSelection : function() {
213
+ var self = tinyMCEPopup;
214
+
215
+ if (!self.isWindow && tinymce.isIE) {
216
+ self.editor.selection.moveToBookmark(self.editor.windowManager.bookmark);
217
+ }
218
+ },
219
+
220
+ /**
221
+ * Loads a specific dialog language pack. If you pass in plugin_url as a argument
222
+ * when you open the window it will load the <plugin url>/langs/<code>_dlg.js lang pack file.
223
+ *
224
+ * @method requireLangPack
225
+ */
226
+ requireLangPack : function() {
227
+ var self = this, url = self.getWindowArg('plugin_url') || self.getWindowArg('theme_url'), settings = self.editor.settings, lang;
228
+
229
+ if (settings.language !== false) {
230
+ lang = settings.language || "en";
231
+ }
232
+
233
+ if (url && lang && self.features.translate_i18n !== false && settings.language_load !== false) {
234
+ url += '/langs/' + lang + '_dlg.js';
235
+
236
+ if (!tinymce.ScriptLoader.isDone(url)) {
237
+ document.write('<script type="text/javascript" src="' + url + '"></script>');
238
+ tinymce.ScriptLoader.markDone(url);
239
+ }
240
+ }
241
+ },
242
+
243
+ /**
244
+ * Executes a color picker on the specified element id. When the user
245
+ * then selects a color it will be set as the value of the specified element.
246
+ *
247
+ * @method pickColor
248
+ * @param {DOMEvent} e DOM event object.
249
+ * @param {string} element_id Element id to be filled with the color value from the picker.
250
+ */
251
+ pickColor : function(e, element_id) {
252
+ var el = document.getElementById(element_id), colorPickerCallback = this.editor.settings.color_picker_callback;
253
+ if (colorPickerCallback) {
254
+ colorPickerCallback.call(
255
+ this.editor,
256
+ function (value) {
257
+ el.value = value;
258
+ try {
259
+ el.onchange();
260
+ } catch (ex) {
261
+ // Try fire event, ignore errors
262
+ }
263
+ },
264
+ el.value
265
+ );
266
+ }
267
+ },
268
+
269
+ /**
270
+ * Opens a filebrowser/imagebrowser this will set the output value from
271
+ * the browser as a value on the specified element.
272
+ *
273
+ * @method openBrowser
274
+ * @param {string} element_id Id of the element to set value in.
275
+ * @param {string} type Type of browser to open image/file/flash.
276
+ * @param {string} option Option name to get the file_broswer_callback function name from.
277
+ */
278
+ openBrowser : function(element_id, type) {
279
+ tinyMCEPopup.restoreSelection();
280
+ this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
281
+ },
282
+
283
+ /**
284
+ * Creates a confirm dialog. Please don't use the blocking behavior of this
285
+ * native version use the callback method instead then it can be extended.
286
+ *
287
+ * @method confirm
288
+ * @param {String} t Title for the new confirm dialog.
289
+ * @param {function} cb Callback function to be executed after the user has selected ok or cancel.
290
+ * @param {Object} s Optional scope to execute the callback in.
291
+ */
292
+ confirm : function(t, cb, s) {
293
+ this.editor.windowManager.confirm(t, cb, s, window);
294
+ },
295
+
296
+ /**
297
+ * Creates a alert dialog. Please don't use the blocking behavior of this
298
+ * native version use the callback method instead then it can be extended.
299
+ *
300
+ * @method alert
301
+ * @param {String} tx Title for the new alert dialog.
302
+ * @param {function} cb Callback function to be executed after the user has selected ok.
303
+ * @param {Object} s Optional scope to execute the callback in.
304
+ */
305
+ alert : function(tx, cb, s) {
306
+ this.editor.windowManager.alert(tx, cb, s, window);
307
+ },
308
+
309
+ /**
310
+ * Closes the current window.
311
+ *
312
+ * @method close
313
+ */
314
+ close : function() {
315
+ var t = this;
316
+
317
+ // To avoid domain relaxing issue in Opera
318
+ function close() {
319
+ t.editor.windowManager.close(window);
320
+ tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
321
+ }
322
+
323
+ if (tinymce.isOpera) {
324
+ t.getWin().setTimeout(close, 0);
325
+ } else {
326
+ close();
327
+ }
328
+ },
329
+
330
+ // Internal functions
331
+
332
+ _restoreSelection : function() {
333
+ var e = window.event.srcElement;
334
+
335
+ if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) {
336
+ tinyMCEPopup.restoreSelection();
337
+ }
338
+ },
339
+
340
+ /* _restoreSelection : function() {
341
+ var e = window.event.srcElement;
342
+
343
+ // If user focus a non text input or textarea
344
+ if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
345
+ tinyMCEPopup.restoreSelection();
346
+ },*/
347
+
348
+ _onDOMLoaded : function() {
349
+ var t = tinyMCEPopup, ti = document.title, h, nv;
350
+
351
+ // Translate page
352
+ if (t.features.translate_i18n !== false) {
353
+ var map = {
354
+ "update": "Ok",
355
+ "insert": "Ok",
356
+ "cancel": "Cancel",
357
+ "not_set": "--",
358
+ "class_name": "Class name",
359
+ "browse": "Browse"
360
+ };
361
+
362
+ var langCode = tinymce.settings.language || 'en';
363
+ for (var key in map) {
364
+ tinymce.i18n.data[langCode + "." + key] = tinymce.i18n.translate(map[key]);
365
+ }
366
+
367
+ h = document.body.innerHTML;
368
+
369
+ // Replace a=x with a="x" in IE
370
+ if (tinymce.isIE) {
371
+ h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"');
372
+ }
373
+
374
+ document.dir = t.editor.getParam('directionality','');
375
+
376
+ if ((nv = t.editor.translate(h)) && nv != h) {
377
+ document.body.innerHTML = nv;
378
+ }
379
+
380
+ if ((nv = t.editor.translate(ti)) && nv != ti) {
381
+ document.title = ti = nv;
382
+ }
383
+ }
384
+
385
+ if (!t.editor.getParam('browser_preferred_colors', false) || !t.isWindow) {
386
+ t.dom.addClass(document.body, 'forceColors');
387
+ }
388
+
389
+ document.body.style.display = '';
390
+
391
+ // Restore selection in IE when focus is placed on a non textarea or input element of the type text
392
+ if (tinymce.Env.ie) {
393
+ if (tinymce.Env.ie < 11) {
394
+ document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
395
+
396
+ // Add base target element for it since it would fail with modal dialogs
397
+ t.dom.add(t.dom.select('head')[0], 'base', {target: '_self'});
398
+ } else {
399
+ document.addEventListener('mouseup', tinyMCEPopup._restoreSelection, false);
400
+ }
401
+ }
402
+
403
+ t.restoreSelection();
404
+ t.resizeToInnerSize();
405
+
406
+ // Set inline title
407
+ if (!t.isWindow) {
408
+ t.editor.windowManager.setTitle(window, ti);
409
+ } else {
410
+ window.focus();
411
+ }
412
+
413
+ if (!tinymce.isIE && !t.isWindow) {
414
+ t.dom.bind(document, 'focus', function() {
415
+ t.editor.windowManager.focus(t.id);
416
+ });
417
+ }
418
+
419
+ // Patch for accessibility
420
+ tinymce.each(t.dom.select('select'), function(e) {
421
+ e.onkeydown = tinyMCEPopup._accessHandler;
422
+ });
423
+
424
+ // Call onInit
425
+ // Init must be called before focus so the selection won't get lost by the focus call
426
+ tinymce.each(t.listeners, function(o) {
427
+ o.func.call(o.scope, t.editor);
428
+ });
429
+
430
+ // Move focus to window
431
+ if (t.getWindowArg('mce_auto_focus', true)) {
432
+ window.focus();
433
+
434
+ // Focus element with mceFocus class
435
+ tinymce.each(document.forms, function(f) {
436
+ tinymce.each(f.elements, function(e) {
437
+ if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) {
438
+ e.focus();
439
+ return false; // Break loop
440
+ }
441
+ });
442
+ });
443
+ }
444
+
445
+ document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
446
+
447
+ if ('textContent' in document) {
448
+ t.uiWindow.getEl('head').firstChild.textContent = document.title;
449
+ } else {
450
+ t.uiWindow.getEl('head').firstChild.innerText = document.title;
451
+ }
452
+ },
453
+
454
+ _accessHandler : function(e) {
455
+ e = e || window.event;
456
+
457
+ if (e.keyCode == 13 || e.keyCode == 32) {
458
+ var elm = e.target || e.srcElement;
459
+
460
+ if (elm.onchange) {
461
+ elm.onchange();
462
+ }
463
+
464
+ return tinymce.dom.Event.cancel(e);
465
+ }
466
+ },
467
+
468
+ _closeWinKeyHandler : function(e) {
469
+ e = e || window.event;
470
+
471
+ if (e.keyCode == 27) {
472
+ tinyMCEPopup.close();
473
+ }
474
+ },
475
+
476
+ _eventProxy: function(id) {
477
+ return function(evt) {
478
+ tinyMCEPopup.dom.events.callNativeHandler(id, evt);
479
+ };
480
+ }
481
+ };
482
+
483
+ tinyMCEPopup.init();
484
+
485
+ tinymce.util.Dispatcher = function(scope) {
486
+ this.scope = scope || this;
487
+ this.listeners = [];
488
+
489
+ this.add = function(callback, scope) {
490
+ this.listeners.push({cb : callback, scope : scope || this.scope});
491
+
492
+ return callback;
493
+ };
494
+
495
+ this.addToTop = function(callback, scope) {
496
+ var self = this, listener = {cb : callback, scope : scope || self.scope};
497
+
498
+ // Create new listeners if addToTop is executed in a dispatch loop
499
+ if (self.inDispatch) {
500
+ self.listeners = [listener].concat(self.listeners);
501
+ } else {
502
+ self.listeners.unshift(listener);
503
+ }
504
+
505
+ return callback;
506
+ };
507
+
508
+ this.remove = function(callback) {
509
+ var listeners = this.listeners, output = null;
510
+
511
+ tinymce.each(listeners, function(listener, i) {
512
+ if (callback == listener.cb) {
513
+ output = listener;
514
+ listeners.splice(i, 1);
515
+ return false;
516
+ }
517
+ });
518
+
519
+ return output;
520
+ };
521
+
522
+ this.dispatch = function() {
523
+ var self = this, returnValue, args = arguments, i, listeners = self.listeners, listener;
524
+
525
+ self.inDispatch = true;
526
+
527
+ // Needs to be a real loop since the listener count might change while looping
528
+ // And this is also more efficient
529
+ for (i = 0; i < listeners.length; i++) {
530
+ listener = listeners[i];
531
+ returnValue = listener.cb.apply(listener.scope, args.length > 0 ? args : [listener.scope]);
532
+
533
+ if (returnValue === false) {
534
+ break;
535
+ }
536
+ }
537
+
538
+ self.inDispatch = false;
539
+
540
+ return returnValue;
541
+ };
542
+ };