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,617 +0,0 @@
1
- /**
2
- * theme.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.ThemeManager.add('modern', function(editor) {
14
- var self = this, settings = editor.settings, Factory = tinymce.ui.Factory, each = tinymce.each, DOM = tinymce.DOM;
15
-
16
- // Default menus
17
- var defaultMenus = {
18
- file: {title: 'File', items: 'newdocument'},
19
- edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall'},
20
- insert: {title: 'Insert', items: '|'},
21
- view: {title: 'View', items: 'visualaid |'},
22
- format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
23
- table: {title: 'Table'},
24
- tools: {title: 'Tools'}
25
- };
26
-
27
- var defaultToolbar = "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | " +
28
- "bullist numlist outdent indent | link image";
29
-
30
- /**
31
- * Creates the toolbars from config and returns a toolbar array.
32
- *
33
- * @return {Array} Array with toolbars.
34
- */
35
- function createToolbars() {
36
- var toolbars = [];
37
-
38
- function addToolbar(items) {
39
- var toolbarItems = [], buttonGroup;
40
-
41
- if (!items) {
42
- return;
43
- }
44
-
45
- each(items.split(/[ ,]/), function(item) {
46
- var itemName;
47
-
48
- function bindSelectorChanged() {
49
- var selection = editor.selection;
50
-
51
- if (itemName == "bullist") {
52
- selection.selectorChanged('ul > li', function(state, args) {
53
- var nodeName, i = args.parents.length;
54
-
55
- while (i--) {
56
- nodeName = args.parents[i].nodeName;
57
- if (nodeName == "OL" || nodeName == "UL") {
58
- break;
59
- }
60
- }
61
-
62
- item.active(state && nodeName == "UL");
63
- });
64
- }
65
-
66
- if (itemName == "numlist") {
67
- selection.selectorChanged('ol > li', function(state, args) {
68
- var nodeName, i = args.parents.length;
69
-
70
- while (i--) {
71
- nodeName = args.parents[i].nodeName;
72
- if (nodeName == "OL" || nodeName == "UL") {
73
- break;
74
- }
75
- }
76
-
77
- item.active(state && nodeName == "OL");
78
- });
79
- }
80
-
81
- if (item.settings.stateSelector) {
82
- selection.selectorChanged(item.settings.stateSelector, function(state) {
83
- item.active(state);
84
- }, true);
85
- }
86
-
87
- if (item.settings.disabledStateSelector) {
88
- selection.selectorChanged(item.settings.disabledStateSelector, function(state) {
89
- item.disabled(state);
90
- });
91
- }
92
- }
93
-
94
- if (item == "|") {
95
- buttonGroup = null;
96
- } else {
97
- if (Factory.has(item)) {
98
- item = {type: item};
99
-
100
- if (settings.toolbar_items_size) {
101
- item.size = settings.toolbar_items_size;
102
- }
103
-
104
- toolbarItems.push(item);
105
- buttonGroup = null;
106
- } else {
107
- if (!buttonGroup) {
108
- buttonGroup = {type: 'buttongroup', items: []};
109
- toolbarItems.push(buttonGroup);
110
- }
111
-
112
- if (editor.buttons[item]) {
113
- // TODO: Move control creation to some UI class
114
- itemName = item;
115
- item = editor.buttons[itemName];
116
-
117
- if (typeof(item) == "function") {
118
- item = item();
119
- }
120
-
121
- item.type = item.type || 'button';
122
-
123
- if (settings.toolbar_items_size) {
124
- item.size = settings.toolbar_items_size;
125
- }
126
-
127
- item = Factory.create(item);
128
- buttonGroup.items.push(item);
129
-
130
- if (editor.initialized) {
131
- bindSelectorChanged();
132
- } else {
133
- editor.on('init', bindSelectorChanged);
134
- }
135
- }
136
- }
137
- }
138
- });
139
-
140
- toolbars.push({type: 'toolbar', layout: 'flow', items: toolbarItems});
141
-
142
- return true;
143
- }
144
-
145
- // Convert toolbar array to multiple options
146
- if (tinymce.isArray(settings.toolbar)) {
147
- // Empty toolbar array is the same as a disabled toolbar
148
- if (settings.toolbar.length === 0) {
149
- return;
150
- }
151
-
152
- tinymce.each(settings.toolbar, function(toolbar, i) {
153
- settings["toolbar" + (i + 1)] = toolbar;
154
- });
155
-
156
- delete settings.toolbar;
157
- }
158
-
159
- // Generate toolbar<n>
160
- for (var i = 1; i < 10; i++) {
161
- if (!addToolbar(settings["toolbar" + i])) {
162
- break;
163
- }
164
- }
165
-
166
- // Generate toolbar or default toolbar unless it's disabled
167
- if (!toolbars.length && settings.toolbar !== false) {
168
- addToolbar(settings.toolbar || defaultToolbar);
169
- }
170
-
171
- if (toolbars.length) {
172
- return {
173
- type: 'panel',
174
- layout: 'stack',
175
- classes: "toolbar-grp",
176
- ariaRoot: true,
177
- ariaRemember: true,
178
- items: toolbars
179
- };
180
- }
181
- }
182
-
183
- /**
184
- * Creates the menu buttons based on config.
185
- *
186
- * @return {Array} Menu buttons array.
187
- */
188
- function createMenuButtons() {
189
- var name, menuButtons = [];
190
-
191
- function createMenuItem(name) {
192
- var menuItem;
193
-
194
- if (name == '|') {
195
- return {text: '|'};
196
- }
197
-
198
- menuItem = editor.menuItems[name];
199
-
200
- return menuItem;
201
- }
202
-
203
- function createMenu(context) {
204
- var menuButton, menu, menuItems, isUserDefined, removedMenuItems;
205
-
206
- removedMenuItems = tinymce.makeMap((settings.removed_menuitems || '').split(/[ ,]/));
207
-
208
- // User defined menu
209
- if (settings.menu) {
210
- menu = settings.menu[context];
211
- isUserDefined = true;
212
- } else {
213
- menu = defaultMenus[context];
214
- }
215
-
216
- if (menu) {
217
- menuButton = {text: menu.title};
218
- menuItems = [];
219
-
220
- // Default/user defined items
221
- each((menu.items || '').split(/[ ,]/), function(item) {
222
- var menuItem = createMenuItem(item);
223
-
224
- if (menuItem && !removedMenuItems[item]) {
225
- menuItems.push(createMenuItem(item));
226
- }
227
- });
228
-
229
- // Added though context
230
- if (!isUserDefined) {
231
- each(editor.menuItems, function(menuItem) {
232
- if (menuItem.context == context) {
233
- if (menuItem.separator == 'before') {
234
- menuItems.push({text: '|'});
235
- }
236
-
237
- if (menuItem.prependToContext) {
238
- menuItems.unshift(menuItem);
239
- } else {
240
- menuItems.push(menuItem);
241
- }
242
-
243
- if (menuItem.separator == 'after') {
244
- menuItems.push({text: '|'});
245
- }
246
- }
247
- });
248
- }
249
-
250
- for (var i = 0; i < menuItems.length; i++) {
251
- if (menuItems[i].text == '|') {
252
- if (i === 0 || i == menuItems.length - 1) {
253
- menuItems.splice(i, 1);
254
- }
255
- }
256
- }
257
-
258
- menuButton.menu = menuItems;
259
-
260
- if (!menuButton.menu.length) {
261
- return null;
262
- }
263
- }
264
-
265
- return menuButton;
266
- }
267
-
268
- var defaultMenuBar = [];
269
- if (settings.menu) {
270
- for (name in settings.menu) {
271
- defaultMenuBar.push(name);
272
- }
273
- } else {
274
- for (name in defaultMenus) {
275
- defaultMenuBar.push(name);
276
- }
277
- }
278
-
279
- var enabledMenuNames = typeof(settings.menubar) == "string" ? settings.menubar.split(/[ ,]/) : defaultMenuBar;
280
- for (var i = 0; i < enabledMenuNames.length; i++) {
281
- var menu = enabledMenuNames[i];
282
- menu = createMenu(menu);
283
-
284
- if (menu) {
285
- menuButtons.push(menu);
286
- }
287
- }
288
-
289
- return menuButtons;
290
- }
291
-
292
- /**
293
- * Adds accessibility shortcut keys to panel.
294
- *
295
- * @param {tinymce.ui.Panel} panel Panel to add focus to.
296
- */
297
- function addAccessibilityKeys(panel) {
298
- function focus(type) {
299
- var item = panel.find(type)[0];
300
-
301
- if (item) {
302
- item.focus(true);
303
- }
304
- }
305
-
306
- editor.shortcuts.add('Alt+F9', '', function() {
307
- focus('menubar');
308
- });
309
-
310
- editor.shortcuts.add('Alt+F10', '', function() {
311
- focus('toolbar');
312
- });
313
-
314
- editor.shortcuts.add('Alt+F11', '', function() {
315
- focus('elementpath');
316
- });
317
-
318
- panel.on('cancel', function() {
319
- editor.focus();
320
- });
321
- }
322
-
323
- /**
324
- * Resizes the editor to the specified width, height.
325
- */
326
- function resizeTo(width, height) {
327
- var containerElm, iframeElm, containerSize, iframeSize;
328
-
329
- function getSize(elm) {
330
- return {
331
- width: elm.clientWidth,
332
- height: elm.clientHeight
333
- };
334
- }
335
-
336
- containerElm = editor.getContainer();
337
- iframeElm = editor.getContentAreaContainer().firstChild;
338
- containerSize = getSize(containerElm);
339
- iframeSize = getSize(iframeElm);
340
-
341
- if (width !== null) {
342
- width = Math.max(settings.min_width || 100, width);
343
- width = Math.min(settings.max_width || 0xFFFF, width);
344
-
345
- DOM.setStyle(containerElm, 'width', width + (containerSize.width - iframeSize.width));
346
- DOM.setStyle(iframeElm, 'width', width);
347
- }
348
-
349
- height = Math.max(settings.min_height || 100, height);
350
- height = Math.min(settings.max_height || 0xFFFF, height);
351
- DOM.setStyle(iframeElm, 'height', height);
352
-
353
- editor.fire('ResizeEditor');
354
- }
355
-
356
- function resizeBy(dw, dh) {
357
- var elm = editor.getContentAreaContainer();
358
- self.resizeTo(elm.clientWidth + dw, elm.clientHeight + dh);
359
- }
360
-
361
- /**
362
- * Renders the inline editor UI.
363
- *
364
- * @return {Object} Name/value object with theme data.
365
- */
366
- function renderInlineUI(args) {
367
- var panel, inlineToolbarContainer;
368
-
369
- if (settings.fixed_toolbar_container) {
370
- inlineToolbarContainer = DOM.select(settings.fixed_toolbar_container)[0];
371
- }
372
-
373
- function reposition() {
374
- if (panel && panel.moveRel && panel.visible() && !panel._fixed) {
375
- // TODO: This is kind of ugly and doesn't handle multiple scrollable elements
376
- var scrollContainer = editor.selection.getScrollContainer(), body = editor.getBody();
377
- var deltaX = 0, deltaY = 0;
378
-
379
- if (scrollContainer) {
380
- var bodyPos = DOM.getPos(body), scrollContainerPos = DOM.getPos(scrollContainer);
381
-
382
- deltaX = Math.max(0, scrollContainerPos.x - bodyPos.x);
383
- deltaY = Math.max(0, scrollContainerPos.y - bodyPos.y);
384
- }
385
-
386
- panel.fixed(false).moveRel(body, editor.rtl ? ['tr-br', 'br-tr'] : ['tl-bl', 'bl-tl', 'tr-br']).moveBy(deltaX, deltaY);
387
- }
388
- }
389
-
390
- function show() {
391
- if (panel) {
392
- panel.show();
393
- reposition();
394
- DOM.addClass(editor.getBody(), 'mce-edit-focus');
395
- }
396
- }
397
-
398
- function hide() {
399
- if (panel) {
400
- panel.hide();
401
- DOM.removeClass(editor.getBody(), 'mce-edit-focus');
402
- }
403
- }
404
-
405
- function render() {
406
- if (panel) {
407
- if (!panel.visible()) {
408
- show();
409
- }
410
-
411
- return;
412
- }
413
-
414
- // Render a plain panel inside the inlineToolbarContainer if it's defined
415
- panel = self.panel = Factory.create({
416
- type: inlineToolbarContainer ? 'panel' : 'floatpanel',
417
- role: 'application',
418
- classes: 'tinymce tinymce-inline',
419
- layout: 'flex',
420
- direction: 'column',
421
- align: 'stretch',
422
- autohide: false,
423
- autofix: true,
424
- fixed: !!inlineToolbarContainer,
425
- border: 1,
426
- items: [
427
- settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
428
- createToolbars()
429
- ]
430
- });
431
-
432
- // Add statusbar
433
- /*if (settings.statusbar !== false) {
434
- panel.add({type: 'panel', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', items: [
435
- {type: 'elementpath'}
436
- ]});
437
- }*/
438
-
439
- editor.fire('BeforeRenderUI');
440
- panel.renderTo(inlineToolbarContainer || document.body).reflow();
441
-
442
- addAccessibilityKeys(panel);
443
- show();
444
-
445
- editor.on('nodeChange', reposition);
446
- editor.on('activate', show);
447
- editor.on('deactivate', hide);
448
-
449
- editor.nodeChanged();
450
- }
451
-
452
- settings.content_editable = true;
453
-
454
- editor.on('focus', function() {
455
- // Render only when the CSS file has been loaded
456
- if (args.skinUiCss) {
457
- tinymce.DOM.styleSheetLoader.load(args.skinUiCss, render, render);
458
- } else {
459
- render();
460
- }
461
- });
462
-
463
- editor.on('blur hide', hide);
464
-
465
- // Remove the panel when the editor is removed
466
- editor.on('remove', function() {
467
- if (panel) {
468
- panel.remove();
469
- panel = null;
470
- }
471
- });
472
-
473
- // Preload skin css
474
- if (args.skinUiCss) {
475
- tinymce.DOM.styleSheetLoader.load(args.skinUiCss);
476
- }
477
-
478
- return {};
479
- }
480
-
481
- /**
482
- * Renders the iframe editor UI.
483
- *
484
- * @param {Object} args Details about target element etc.
485
- * @return {Object} Name/value object with theme data.
486
- */
487
- function renderIframeUI(args) {
488
- var panel, resizeHandleCtrl, startSize;
489
-
490
- if (args.skinUiCss) {
491
- tinymce.DOM.loadCSS(args.skinUiCss);
492
- }
493
-
494
- // Basic UI layout
495
- panel = self.panel = Factory.create({
496
- type: 'panel',
497
- role: 'application',
498
- classes: 'tinymce',
499
- style: 'visibility: hidden',
500
- layout: 'stack',
501
- border: 1,
502
- items: [
503
- settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
504
- createToolbars(),
505
- {type: 'panel', name: 'iframe', layout: 'stack', classes: 'edit-area', html: '', border: '1 0 0 0'}
506
- ]
507
- });
508
-
509
- if (settings.resize !== false) {
510
- resizeHandleCtrl = {
511
- type: 'resizehandle',
512
- direction: settings.resize,
513
-
514
- onResizeStart: function() {
515
- var elm = editor.getContentAreaContainer().firstChild;
516
-
517
- startSize = {
518
- width: elm.clientWidth,
519
- height: elm.clientHeight
520
- };
521
- },
522
-
523
- onResize: function(e) {
524
- if (settings.resize == 'both') {
525
- resizeTo(startSize.width + e.deltaX, startSize.height + e.deltaY);
526
- } else {
527
- resizeTo(null, startSize.height + e.deltaY);
528
- }
529
- }
530
- };
531
- }
532
-
533
- // Add statusbar if needed
534
- if (settings.statusbar !== false) {
535
- panel.add({type: 'panel', name: 'statusbar', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', ariaRoot: true, items: [
536
- {type: 'elementpath'},
537
- resizeHandleCtrl
538
- ]});
539
- }
540
-
541
- if (settings.readonly) {
542
- panel.find('*').disabled(true);
543
- }
544
-
545
- editor.fire('BeforeRenderUI');
546
- panel.renderBefore(args.targetNode).reflow();
547
-
548
- if (settings.width) {
549
- tinymce.DOM.setStyle(panel.getEl(), 'width', settings.width);
550
- }
551
-
552
- // Remove the panel when the editor is removed
553
- editor.on('remove', function() {
554
- panel.remove();
555
- panel = null;
556
- });
557
-
558
- // Add accesibility shortkuts
559
- addAccessibilityKeys(panel);
560
-
561
- return {
562
- iframeContainer: panel.find('#iframe')[0].getEl(),
563
- editorContainer: panel.getEl()
564
- };
565
- }
566
-
567
- /**
568
- * Renders the UI for the theme. This gets called by the editor.
569
- *
570
- * @param {Object} args Details about target element etc.
571
- * @return {Object} Theme UI data items.
572
- */
573
- self.renderUI = function(args) {
574
- var skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
575
-
576
- if (skin) {
577
- var skinUrl = settings.skin_url;
578
-
579
- if (skinUrl) {
580
- skinUrl = editor.documentBaseURI.toAbsolute(skinUrl);
581
- } else {
582
- skinUrl = tinymce.baseURL + '/skins/' + skin;
583
- }
584
-
585
- // Load special skin for IE7
586
- // TODO: Remove this when we drop IE7 support
587
- if (tinymce.Env.documentMode <= 7) {
588
- args.skinUiCss = skinUrl + '/skin.ie7.min.css';
589
- } else {
590
- args.skinUiCss = skinUrl + '/skin.min.css';
591
- }
592
-
593
- // Load content.min.css or content.inline.min.css
594
- editor.contentCSS.push(skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css');
595
- }
596
-
597
- // Handle editor setProgressState change
598
- editor.on('ProgressState', function(e) {
599
- self.throbber = self.throbber || new tinymce.ui.Throbber(self.panel.getEl('body'));
600
-
601
- if (e.state) {
602
- self.throbber.show(e.time);
603
- } else {
604
- self.throbber.hide();
605
- }
606
- });
607
-
608
- if (settings.inline) {
609
- return renderInlineUI(args);
610
- }
611
-
612
- return renderIframeUI(args);
613
- };
614
-
615
- self.resizeTo = resizeTo;
616
- self.resizeBy = resizeBy;
617
- });
@@ -1 +0,0 @@
1
- tinymce.ThemeManager.add("modern",function(a){function b(){function b(b){var d,e=[];if(b)return l(b.split(/[ ,]/),function(b){function c(){var c=a.selection;"bullist"==f&&c.selectorChanged("ul > li",function(a,c){for(var d,e=c.parents.length;e--&&(d=c.parents[e].nodeName,"OL"!=d&&"UL"!=d););b.active(a&&"UL"==d)}),"numlist"==f&&c.selectorChanged("ol > li",function(a,c){for(var d,e=c.parents.length;e--&&(d=c.parents[e].nodeName,"OL"!=d&&"UL"!=d););b.active(a&&"OL"==d)}),b.settings.stateSelector&&c.selectorChanged(b.settings.stateSelector,function(a){b.active(a)},!0),b.settings.disabledStateSelector&&c.selectorChanged(b.settings.disabledStateSelector,function(a){b.disabled(a)})}var f;"|"==b?d=null:k.has(b)?(b={type:b},j.toolbar_items_size&&(b.size=j.toolbar_items_size),e.push(b),d=null):(d||(d={type:"buttongroup",items:[]},e.push(d)),a.buttons[b]&&(f=b,b=a.buttons[f],"function"==typeof b&&(b=b()),b.type=b.type||"button",j.toolbar_items_size&&(b.size=j.toolbar_items_size),b=k.create(b),d.items.push(b),a.initialized?c():a.on("init",c)))}),c.push({type:"toolbar",layout:"flow",items:e}),!0}var c=[];if(tinymce.isArray(j.toolbar)){if(0===j.toolbar.length)return;tinymce.each(j.toolbar,function(a,b){j["toolbar"+(b+1)]=a}),delete j.toolbar}for(var d=1;10>d&&b(j["toolbar"+d]);d++);return c.length||j.toolbar===!1||b(j.toolbar||o),c.length?{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:c}:void 0}function c(){function b(b){var c;return"|"==b?{text:"|"}:c=a.menuItems[b]}function c(c){var d,e,f,g,h;if(h=tinymce.makeMap((j.removed_menuitems||"").split(/[ ,]/)),j.menu?(e=j.menu[c],g=!0):e=n[c],e){d={text:e.title},f=[],l((e.items||"").split(/[ ,]/),function(a){var c=b(a);c&&!h[a]&&f.push(b(a))}),g||l(a.menuItems,function(a){a.context==c&&("before"==a.separator&&f.push({text:"|"}),a.prependToContext?f.unshift(a):f.push(a),"after"==a.separator&&f.push({text:"|"}))});for(var i=0;i<f.length;i++)"|"==f[i].text&&(0===i||i==f.length-1)&&f.splice(i,1);if(d.menu=f,!d.menu.length)return null}return d}var d,e=[],f=[];if(j.menu)for(d in j.menu)f.push(d);else for(d in n)f.push(d);for(var g="string"==typeof j.menubar?j.menubar.split(/[ ,]/):f,h=0;h<g.length;h++){var i=g[h];i=c(i),i&&e.push(i)}return e}function d(b){function c(a){var c=b.find(a)[0];c&&c.focus(!0)}a.shortcuts.add("Alt+F9","",function(){c("menubar")}),a.shortcuts.add("Alt+F10","",function(){c("toolbar")}),a.shortcuts.add("Alt+F11","",function(){c("elementpath")}),b.on("cancel",function(){a.focus()})}function e(b,c){function d(a){return{width:a.clientWidth,height:a.clientHeight}}var e,f,g,h;e=a.getContainer(),f=a.getContentAreaContainer().firstChild,g=d(e),h=d(f),null!==b&&(b=Math.max(j.min_width||100,b),b=Math.min(j.max_width||65535,b),m.setStyle(e,"width",b+(g.width-h.width)),m.setStyle(f,"width",b)),c=Math.max(j.min_height||100,c),c=Math.min(j.max_height||65535,c),m.setStyle(f,"height",c),a.fire("ResizeEditor")}function f(b,c){var d=a.getContentAreaContainer();i.resizeTo(d.clientWidth+b,d.clientHeight+c)}function g(e){function f(){if(n&&n.moveRel&&n.visible()&&!n._fixed){var b=a.selection.getScrollContainer(),c=a.getBody(),d=0,e=0;if(b){var f=m.getPos(c),g=m.getPos(b);d=Math.max(0,g.x-f.x),e=Math.max(0,g.y-f.y)}n.fixed(!1).moveRel(c,a.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(d,e)}}function g(){n&&(n.show(),f(),m.addClass(a.getBody(),"mce-edit-focus"))}function h(){n&&(n.hide(),m.removeClass(a.getBody(),"mce-edit-focus"))}function l(){return n?void(n.visible()||g()):(n=i.panel=k.create({type:o?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!!o,border:1,items:[j.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:c()},b()]}),a.fire("BeforeRenderUI"),n.renderTo(o||document.body).reflow(),d(n),g(),a.on("nodeChange",f),a.on("activate",g),a.on("deactivate",h),void a.nodeChanged())}var n,o;return j.fixed_toolbar_container&&(o=m.select(j.fixed_toolbar_container)[0]),j.content_editable=!0,a.on("focus",function(){e.skinUiCss?tinymce.DOM.styleSheetLoader.load(e.skinUiCss,l,l):l()}),a.on("blur hide",h),a.on("remove",function(){n&&(n.remove(),n=null)}),e.skinUiCss&&tinymce.DOM.styleSheetLoader.load(e.skinUiCss),{}}function h(f){var g,h,l;return f.skinUiCss&&tinymce.DOM.loadCSS(f.skinUiCss),g=i.panel=k.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[j.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:c()},b(),{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]}),j.resize!==!1&&(h={type:"resizehandle",direction:j.resize,onResizeStart:function(){var b=a.getContentAreaContainer().firstChild;l={width:b.clientWidth,height:b.clientHeight}},onResize:function(a){"both"==j.resize?e(l.width+a.deltaX,l.height+a.deltaY):e(null,l.height+a.deltaY)}}),j.statusbar!==!1&&g.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath"},h]}),j.readonly&&g.find("*").disabled(!0),a.fire("BeforeRenderUI"),g.renderBefore(f.targetNode).reflow(),j.width&&tinymce.DOM.setStyle(g.getEl(),"width",j.width),a.on("remove",function(){g.remove(),g=null}),d(g),{iframeContainer:g.find("#iframe")[0].getEl(),editorContainer:g.getEl()}}var i=this,j=a.settings,k=tinymce.ui.Factory,l=tinymce.each,m=tinymce.DOM,n={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},insert:{title:"Insert",items:"|"},view:{title:"View",items:"visualaid |"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript | formats | removeformat"},table:{title:"Table"},tools:{title:"Tools"}},o="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";i.renderUI=function(b){var c=j.skin!==!1?j.skin||"lightgray":!1;if(c){var d=j.skin_url;d=d?a.documentBaseURI.toAbsolute(d):tinymce.baseURL+"/skins/"+c,b.skinUiCss=tinymce.Env.documentMode<=7?d+"/skin.ie7.min.css":d+"/skin.min.css",a.contentCSS.push(d+"/content"+(a.inline?".inline":"")+".min.css")}return a.on("ProgressState",function(a){i.throbber=i.throbber||new tinymce.ui.Throbber(i.panel.getEl("body")),a.state?i.throbber.show(a.time):i.throbber.hide()}),j.inline?g(b):h(b)},i.resizeTo=e,i.resizeBy=f});