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,210 +0,0 @@
1
- /**
2
- * form_utils.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 themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
12
-
13
- function getColorPickerHTML(id, target_form_element) {
14
- var h = "", dom = tinyMCEPopup.dom;
15
-
16
- if (label = dom.select('label[for=' + target_form_element + ']')[0]) {
17
- label.id = label.id || dom.uniqueId();
18
- }
19
-
20
- h += '<a role="button" aria-labelledby="' + id + '_label" id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
21
- h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;<span id="' + id + '_label" class="mceVoiceLabel mceIconOnly" style="display:none;">' + tinyMCEPopup.getLang('browse') + '</span></span></a>';
22
-
23
- return h;
24
- }
25
-
26
- function updateColor(img_id, form_element_id) {
27
- document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
28
- }
29
-
30
- function setBrowserDisabled(id, state) {
31
- var img = document.getElementById(id);
32
- var lnk = document.getElementById(id + "_link");
33
-
34
- if (lnk) {
35
- if (state) {
36
- lnk.setAttribute("realhref", lnk.getAttribute("href"));
37
- lnk.removeAttribute("href");
38
- tinyMCEPopup.dom.addClass(img, 'disabled');
39
- } else {
40
- if (lnk.getAttribute("realhref"))
41
- lnk.setAttribute("href", lnk.getAttribute("realhref"));
42
-
43
- tinyMCEPopup.dom.removeClass(img, 'disabled');
44
- }
45
- }
46
- }
47
-
48
- function getBrowserHTML(id, target_form_element, type, prefix) {
49
- var option = prefix + "_" + type + "_browser_callback", cb, html;
50
-
51
- cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
52
-
53
- if (!cb)
54
- return "";
55
-
56
- html = "";
57
- html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
58
- html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';
59
-
60
- return html;
61
- }
62
-
63
- function openBrowser(img_id, target_form_element, type, option) {
64
- var img = document.getElementById(img_id);
65
-
66
- if (img.className != "mceButtonDisabled")
67
- tinyMCEPopup.openBrowser(target_form_element, type, option);
68
- }
69
-
70
- function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
71
- if (!form_obj || !form_obj.elements[field_name])
72
- return;
73
-
74
- if (!value)
75
- value = "";
76
-
77
- var sel = form_obj.elements[field_name];
78
-
79
- var found = false;
80
- for (var i=0; i<sel.options.length; i++) {
81
- var option = sel.options[i];
82
-
83
- if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
84
- option.selected = true;
85
- found = true;
86
- } else
87
- option.selected = false;
88
- }
89
-
90
- if (!found && add_custom && value != '') {
91
- var option = new Option(value, value);
92
- option.selected = true;
93
- sel.options[sel.options.length] = option;
94
- sel.selectedIndex = sel.options.length - 1;
95
- }
96
-
97
- return found;
98
- }
99
-
100
- function getSelectValue(form_obj, field_name) {
101
- var elm = form_obj.elements[field_name];
102
-
103
- if (elm == null || elm.options == null || elm.selectedIndex === -1)
104
- return "";
105
-
106
- return elm.options[elm.selectedIndex].value;
107
- }
108
-
109
- function addSelectValue(form_obj, field_name, name, value) {
110
- var s = form_obj.elements[field_name];
111
- var o = new Option(name, value);
112
- s.options[s.options.length] = o;
113
- }
114
-
115
- function addClassesToList(list_id, specific_option) {
116
- // Setup class droplist
117
- var styleSelectElm = document.getElementById(list_id);
118
- var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
119
- styles = tinyMCEPopup.getParam(specific_option, styles);
120
-
121
- if (styles) {
122
- var stylesAr = styles.split(';');
123
-
124
- for (var i=0; i<stylesAr.length; i++) {
125
- if (stylesAr != "") {
126
- var key, value;
127
-
128
- key = stylesAr[i].split('=')[0];
129
- value = stylesAr[i].split('=')[1];
130
-
131
- styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
132
- }
133
- }
134
- } else {
135
- /*tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
136
- styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
137
- });*/
138
- }
139
- }
140
-
141
- function isVisible(element_id) {
142
- var elm = document.getElementById(element_id);
143
-
144
- return elm && elm.style.display != "none";
145
- }
146
-
147
- function convertRGBToHex(col) {
148
- var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
149
-
150
- var rgb = col.replace(re, "$1,$2,$3").split(',');
151
- if (rgb.length == 3) {
152
- r = parseInt(rgb[0]).toString(16);
153
- g = parseInt(rgb[1]).toString(16);
154
- b = parseInt(rgb[2]).toString(16);
155
-
156
- r = r.length == 1 ? '0' + r : r;
157
- g = g.length == 1 ? '0' + g : g;
158
- b = b.length == 1 ? '0' + b : b;
159
-
160
- return "#" + r + g + b;
161
- }
162
-
163
- return col;
164
- }
165
-
166
- function convertHexToRGB(col) {
167
- if (col.indexOf('#') != -1) {
168
- col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
169
-
170
- r = parseInt(col.substring(0, 2), 16);
171
- g = parseInt(col.substring(2, 4), 16);
172
- b = parseInt(col.substring(4, 6), 16);
173
-
174
- return "rgb(" + r + "," + g + "," + b + ")";
175
- }
176
-
177
- return col;
178
- }
179
-
180
- function trimSize(size) {
181
- return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');
182
- }
183
-
184
- function getCSSSize(size) {
185
- size = trimSize(size);
186
-
187
- if (size == "")
188
- return "";
189
-
190
- // Add px
191
- if (/^[0-9]+$/.test(size))
192
- size += 'px';
193
- // Sanity check, IE doesn't like broken values
194
- else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size)))
195
- return "";
196
-
197
- return size;
198
- }
199
-
200
- function getStyle(elm, attrib, style) {
201
- var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
202
-
203
- if (val != '')
204
- return '' + val;
205
-
206
- if (typeof(style) == 'undefined')
207
- style = attrib;
208
-
209
- return tinyMCEPopup.dom.getStyle(elm, style);
210
- }
@@ -1,164 +0,0 @@
1
- /**
2
- * mctabs.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
- /*jshint globals: tinyMCEPopup */
12
-
13
- function MCTabs() {
14
- this.settings = [];
15
- this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');
16
- };
17
-
18
- MCTabs.prototype.init = function(settings) {
19
- this.settings = settings;
20
- };
21
-
22
- MCTabs.prototype.getParam = function(name, default_value) {
23
- var value = null;
24
-
25
- value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
26
-
27
- // Fix bool values
28
- if (value == "true" || value == "false")
29
- return (value == "true");
30
-
31
- return value;
32
- };
33
-
34
- MCTabs.prototype.showTab =function(tab){
35
- tab.className = 'current';
36
- tab.setAttribute("aria-selected", true);
37
- tab.setAttribute("aria-expanded", true);
38
- tab.tabIndex = 0;
39
- };
40
-
41
- MCTabs.prototype.hideTab =function(tab){
42
- var t=this;
43
-
44
- tab.className = '';
45
- tab.setAttribute("aria-selected", false);
46
- tab.setAttribute("aria-expanded", false);
47
- tab.tabIndex = -1;
48
- };
49
-
50
- MCTabs.prototype.showPanel = function(panel) {
51
- panel.className = 'current';
52
- panel.setAttribute("aria-hidden", false);
53
- };
54
-
55
- MCTabs.prototype.hidePanel = function(panel) {
56
- panel.className = 'panel';
57
- panel.setAttribute("aria-hidden", true);
58
- };
59
-
60
- MCTabs.prototype.getPanelForTab = function(tabElm) {
61
- return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls");
62
- };
63
-
64
- MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) {
65
- var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;
66
-
67
- tabElm = document.getElementById(tab_id);
68
-
69
- if (panel_id === undefined) {
70
- panel_id = t.getPanelForTab(tabElm);
71
- }
72
-
73
- panelElm= document.getElementById(panel_id);
74
- panelContainerElm = panelElm ? panelElm.parentNode : null;
75
- tabContainerElm = tabElm ? tabElm.parentNode : null;
76
- selectionClass = t.getParam('selection_class', 'current');
77
-
78
- if (tabElm && tabContainerElm) {
79
- nodes = tabContainerElm.childNodes;
80
-
81
- // Hide all other tabs
82
- for (i = 0; i < nodes.length; i++) {
83
- if (nodes[i].nodeName == "LI") {
84
- t.hideTab(nodes[i]);
85
- }
86
- }
87
-
88
- // Show selected tab
89
- t.showTab(tabElm);
90
- }
91
-
92
- if (panelElm && panelContainerElm) {
93
- nodes = panelContainerElm.childNodes;
94
-
95
- // Hide all other panels
96
- for (i = 0; i < nodes.length; i++) {
97
- if (nodes[i].nodeName == "DIV")
98
- t.hidePanel(nodes[i]);
99
- }
100
-
101
- if (!avoid_focus) {
102
- tabElm.focus();
103
- }
104
-
105
- // Show selected panel
106
- t.showPanel(panelElm);
107
- }
108
- };
109
-
110
- MCTabs.prototype.getAnchor = function() {
111
- var pos, url = document.location.href;
112
-
113
- if ((pos = url.lastIndexOf('#')) != -1)
114
- return url.substring(pos + 1);
115
-
116
- return "";
117
- };
118
-
119
-
120
- //Global instance
121
- var mcTabs = new MCTabs();
122
-
123
- tinyMCEPopup.onInit.add(function() {
124
- var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;
125
-
126
- each(dom.select('div.tabs'), function(tabContainerElm) {
127
- //var keyNav;
128
-
129
- dom.setAttrib(tabContainerElm, "role", "tablist");
130
-
131
- var items = tinyMCEPopup.dom.select('li', tabContainerElm);
132
- var action = function(id) {
133
- mcTabs.displayTab(id, mcTabs.getPanelForTab(id));
134
- mcTabs.onChange.dispatch(id);
135
- };
136
-
137
- each(items, function(item) {
138
- dom.setAttrib(item, 'role', 'tab');
139
- dom.bind(item, 'click', function(evt) {
140
- action(item.id);
141
- });
142
- });
143
-
144
- dom.bind(dom.getRoot(), 'keydown', function(evt) {
145
- if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab
146
- //keyNav.moveFocus(evt.shiftKey ? -1 : 1);
147
- tinymce.dom.Event.cancel(evt);
148
- }
149
- });
150
-
151
- each(dom.select('a', tabContainerElm), function(a) {
152
- dom.setAttrib(a, 'tabindex', '-1');
153
- });
154
-
155
- /*keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
156
- root: tabContainerElm,
157
- items: items,
158
- onAction: action,
159
- actOnFocus: true,
160
- enableLeftRight: true,
161
- enableUpDown: true
162
- }, tinyMCEPopup.dom);*/
163
- });
164
- });
@@ -1,252 +0,0 @@
1
- /**
2
- * validate.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
- /**
12
- // String validation:
13
-
14
- if (!Validator.isEmail('myemail'))
15
- alert('Invalid email.');
16
-
17
- // Form validation:
18
-
19
- var f = document.forms['myform'];
20
-
21
- if (!Validator.isEmail(f.myemail))
22
- alert('Invalid email.');
23
- */
24
-
25
- var Validator = {
26
- isEmail : function(s) {
27
- return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
28
- },
29
-
30
- isAbsUrl : function(s) {
31
- return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
32
- },
33
-
34
- isSize : function(s) {
35
- return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
36
- },
37
-
38
- isId : function(s) {
39
- return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
40
- },
41
-
42
- isEmpty : function(s) {
43
- var nl, i;
44
-
45
- if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
46
- return true;
47
-
48
- if (s.type == 'checkbox' && !s.checked)
49
- return true;
50
-
51
- if (s.type == 'radio') {
52
- for (i=0, nl = s.form.elements; i<nl.length; i++) {
53
- if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
54
- return false;
55
- }
56
-
57
- return true;
58
- }
59
-
60
- return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
61
- },
62
-
63
- isNumber : function(s, d) {
64
- return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
65
- },
66
-
67
- test : function(s, p) {
68
- s = s.nodeType == 1 ? s.value : s;
69
-
70
- return s == '' || new RegExp(p).test(s);
71
- }
72
- };
73
-
74
- var AutoValidator = {
75
- settings : {
76
- id_cls : 'id',
77
- int_cls : 'int',
78
- url_cls : 'url',
79
- number_cls : 'number',
80
- email_cls : 'email',
81
- size_cls : 'size',
82
- required_cls : 'required',
83
- invalid_cls : 'invalid',
84
- min_cls : 'min',
85
- max_cls : 'max'
86
- },
87
-
88
- init : function(s) {
89
- var n;
90
-
91
- for (n in s)
92
- this.settings[n] = s[n];
93
- },
94
-
95
- validate : function(f) {
96
- var i, nl, s = this.settings, c = 0;
97
-
98
- nl = this.tags(f, 'label');
99
- for (i=0; i<nl.length; i++) {
100
- this.removeClass(nl[i], s.invalid_cls);
101
- nl[i].setAttribute('aria-invalid', false);
102
- }
103
-
104
- c += this.validateElms(f, 'input');
105
- c += this.validateElms(f, 'select');
106
- c += this.validateElms(f, 'textarea');
107
-
108
- return c == 3;
109
- },
110
-
111
- invalidate : function(n) {
112
- this.mark(n.form, n);
113
- },
114
-
115
- getErrorMessages : function(f) {
116
- var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;
117
- nl = this.tags(f, "label");
118
- for (i=0; i<nl.length; i++) {
119
- if (this.hasClass(nl[i], s.invalid_cls)) {
120
- field = document.getElementById(nl[i].getAttribute("for"));
121
- values = { field: nl[i].textContent };
122
- if (this.hasClass(field, s.min_cls, true)) {
123
- message = ed.getLang('invalid_data_min');
124
- values.min = this.getNum(field, s.min_cls);
125
- } else if (this.hasClass(field, s.number_cls)) {
126
- message = ed.getLang('invalid_data_number');
127
- } else if (this.hasClass(field, s.size_cls)) {
128
- message = ed.getLang('invalid_data_size');
129
- } else {
130
- message = ed.getLang('invalid_data');
131
- }
132
-
133
- message = message.replace(/{\#([^}]+)\}/g, function(a, b) {
134
- return values[b] || '{#' + b + '}';
135
- });
136
- messages.push(message);
137
- }
138
- }
139
- return messages;
140
- },
141
-
142
- reset : function(e) {
143
- var t = ['label', 'input', 'select', 'textarea'];
144
- var i, j, nl, s = this.settings;
145
-
146
- if (e == null)
147
- return;
148
-
149
- for (i=0; i<t.length; i++) {
150
- nl = this.tags(e.form ? e.form : e, t[i]);
151
- for (j=0; j<nl.length; j++) {
152
- this.removeClass(nl[j], s.invalid_cls);
153
- nl[j].setAttribute('aria-invalid', false);
154
- }
155
- }
156
- },
157
-
158
- validateElms : function(f, e) {
159
- var nl, i, n, s = this.settings, st = true, va = Validator, v;
160
-
161
- nl = this.tags(f, e);
162
- for (i=0; i<nl.length; i++) {
163
- n = nl[i];
164
-
165
- this.removeClass(n, s.invalid_cls);
166
-
167
- if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
168
- st = this.mark(f, n);
169
-
170
- if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
171
- st = this.mark(f, n);
172
-
173
- if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
174
- st = this.mark(f, n);
175
-
176
- if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
177
- st = this.mark(f, n);
178
-
179
- if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
180
- st = this.mark(f, n);
181
-
182
- if (this.hasClass(n, s.size_cls) && !va.isSize(n))
183
- st = this.mark(f, n);
184
-
185
- if (this.hasClass(n, s.id_cls) && !va.isId(n))
186
- st = this.mark(f, n);
187
-
188
- if (this.hasClass(n, s.min_cls, true)) {
189
- v = this.getNum(n, s.min_cls);
190
-
191
- if (isNaN(v) || parseInt(n.value) < parseInt(v))
192
- st = this.mark(f, n);
193
- }
194
-
195
- if (this.hasClass(n, s.max_cls, true)) {
196
- v = this.getNum(n, s.max_cls);
197
-
198
- if (isNaN(v) || parseInt(n.value) > parseInt(v))
199
- st = this.mark(f, n);
200
- }
201
- }
202
-
203
- return st;
204
- },
205
-
206
- hasClass : function(n, c, d) {
207
- return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
208
- },
209
-
210
- getNum : function(n, c) {
211
- c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
212
- c = c.replace(/[^0-9]/g, '');
213
-
214
- return c;
215
- },
216
-
217
- addClass : function(n, c, b) {
218
- var o = this.removeClass(n, c);
219
- n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
220
- },
221
-
222
- removeClass : function(n, c) {
223
- c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
224
- return n.className = c != ' ' ? c : '';
225
- },
226
-
227
- tags : function(f, s) {
228
- return f.getElementsByTagName(s);
229
- },
230
-
231
- mark : function(f, n) {
232
- var s = this.settings;
233
-
234
- this.addClass(n, s.invalid_cls);
235
- n.setAttribute('aria-invalid', 'true');
236
- this.markLabels(f, n, s.invalid_cls);
237
-
238
- return false;
239
- },
240
-
241
- markLabels : function(f, n, ic) {
242
- var nl, i;
243
-
244
- nl = this.tags(f, "label");
245
- for (i=0; i<nl.length; i++) {
246
- if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
247
- this.addClass(nl[i], ic);
248
- }
249
-
250
- return null;
251
- }
252
- };
@@ -1,87 +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('contextmenu', function(editor) {
14
- var menu, contextmenuNeverUseNative = editor.settings.contextmenu_never_use_native;
15
-
16
- editor.on('contextmenu', function(e) {
17
- var contextmenu, doc = editor.getDoc();
18
-
19
- // Block TinyMCE menu on ctrlKey
20
- if (e.ctrlKey && !contextmenuNeverUseNative) {
21
- return;
22
- }
23
-
24
- e.preventDefault();
25
-
26
- /**
27
- * WebKit/Blink on Mac has the odd behavior of selecting the target word or line this causes
28
- * issues when for example inserting images see: #7022
29
- */
30
- if (tinymce.Env.mac && tinymce.Env.webkit) {
31
- if (e.button == 2 && doc.caretRangeFromPoint) {
32
- editor.selection.setRng(doc.caretRangeFromPoint(e.x, e.y));
33
- }
34
- }
35
-
36
- contextmenu = editor.settings.contextmenu || 'link image inserttable | cell row column deletetable';
37
-
38
- // Render menu
39
- if (!menu) {
40
- var items = [];
41
-
42
- tinymce.each(contextmenu.split(/[ ,]/), function(name) {
43
- var item = editor.menuItems[name];
44
-
45
- if (name == '|') {
46
- item = {text: name};
47
- }
48
-
49
- if (item) {
50
- item.shortcut = ''; // Hide shortcuts
51
- items.push(item);
52
- }
53
- });
54
-
55
- for (var i = 0; i < items.length; i++) {
56
- if (items[i].text == '|') {
57
- if (i === 0 || i == items.length - 1) {
58
- items.splice(i, 1);
59
- }
60
- }
61
- }
62
-
63
- menu = new tinymce.ui.Menu({
64
- items: items,
65
- context: 'contextmenu'
66
- }).addClass('contextmenu').renderTo();
67
-
68
- editor.on('remove', function() {
69
- menu.remove();
70
- menu = null;
71
- });
72
- } else {
73
- menu.show();
74
- }
75
-
76
- // Position menu
77
- var pos = {x: e.pageX, y: e.pageY};
78
-
79
- if (!editor.inline) {
80
- pos = tinymce.DOM.getPos(editor.getContentAreaContainer());
81
- pos.x += e.clientX;
82
- pos.y += e.clientY;
83
- }
84
-
85
- menu.moveTo(pos.x, pos.y);
86
- });
87
- });
@@ -1 +0,0 @@
1
- tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h<g.length;h++)"|"==g[h].text&&(0===h||h==g.length-1)&&g.splice(h,1);b=new tinymce.ui.Menu({items:g,context:"contextmenu"}).addClass("contextmenu").renderTo(),a.on("remove",function(){b.remove(),b=null})}var i={x:d.pageX,y:d.pageY};a.inline||(i=tinymce.DOM.getPos(a.getContentAreaContainer()),i.x+=d.clientX,i.y+=d.clientY),b.moveTo(i.x,i.y)}})});