Index: trunk/extensions/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -16,6 +16,7 @@ |
17 | 17 | |
18 | 18 | 'contentCollector' => array( |
19 | 19 | 'scripts' => 'extensions/WikiEditor/modules/contentCollector.js', |
| 20 | + 'group' => 'ext.wikiEditor', |
20 | 21 | ), |
21 | 22 | |
22 | 23 | /* WikiEditor jQuery plugin Resources */ |
— | — | @@ -33,6 +34,7 @@ |
34 | 35 | 'wikieditor-wikitext-tab', |
35 | 36 | 'wikieditor-loading', |
36 | 37 | ), |
| 38 | + 'group' => 'ext.wikiEditor', |
37 | 39 | ), |
38 | 40 | 'jquery.wikiEditor.dialogs' => array( |
39 | 41 | 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js', |
— | — | @@ -45,15 +47,18 @@ |
46 | 48 | 'jquery.ui.resizable', |
47 | 49 | 'jquery.tabIndex', |
48 | 50 | ), |
| 51 | + 'group' => 'ext.wikiEditor', |
49 | 52 | ), |
50 | 53 | 'jquery.wikiEditor.highlight' => array( |
51 | 54 | 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js', |
52 | 55 | 'dependencies' => 'jquery.wikiEditor', |
| 56 | + 'group' => 'ext.wikiEditor', |
53 | 57 | ), |
54 | 58 | 'jquery.wikiEditor.preview' => array( |
55 | 59 | 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.preview.js', |
56 | 60 | 'styles' => 'extensions/WikiEditor/modules/jquery.wikiEditor.preview.css', |
57 | 61 | 'dependencies' => 'jquery.wikiEditor', |
| 62 | + 'group' => 'ext.wikiEditor', |
58 | 63 | ), |
59 | 64 | 'jquery.wikiEditor.previewDialog' => array( |
60 | 65 | 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js', |
— | — | @@ -62,6 +67,7 @@ |
63 | 68 | 'jquery.wikiEditor', |
64 | 69 | 'jquery.wikiEditor.dialogs', |
65 | 70 | ), |
| 71 | + 'group' => 'ext.wikiEditor', |
66 | 72 | ), |
67 | 73 | 'jquery.wikiEditor.publish' => array( |
68 | 74 | 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.publish.js', |
— | — | @@ -69,6 +75,7 @@ |
70 | 76 | 'jquery.wikiEditor', |
71 | 77 | 'jquery.wikiEditor.dialogs', |
72 | 78 | ), |
| 79 | + 'group' => 'ext.wikiEditor', |
73 | 80 | ), |
74 | 81 | 'jquery.wikiEditor.templateEditor' => array( |
75 | 82 | 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js', |
— | — | @@ -76,10 +83,12 @@ |
77 | 84 | 'jquery.wikiEditor', |
78 | 85 | 'jquery.wikiEditor.dialogs', |
79 | 86 | ), |
| 87 | + 'group' => 'ext.wikiEditor', |
80 | 88 | ), |
81 | 89 | 'jquery.wikiEditor.templates' => array( |
82 | 90 | 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.templates.js', |
83 | 91 | 'dependencies' => 'jquery.wikiEditor', |
| 92 | + 'group' => 'ext.wikiEditor', |
84 | 93 | ), |
85 | 94 | 'jquery.wikiEditor.toc' => array( |
86 | 95 | 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.toc.js', |
— | — | @@ -91,11 +100,13 @@ |
92 | 101 | 'jquery.autoEllipsis', |
93 | 102 | 'jquery.color', |
94 | 103 | ), |
| 104 | + 'group' => 'ext.wikiEditor', |
95 | 105 | ), |
96 | 106 | 'jquery.wikiEditor.toolbar' => array( |
97 | 107 | 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js', |
98 | 108 | 'styles' => 'extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.css', |
99 | 109 | 'dependencies' => 'jquery.wikiEditor', |
| 110 | + 'group' => 'ext.wikiEditor', |
100 | 111 | ), |
101 | 112 | |
102 | 113 | /* WikiEditor Resources */ |
— | — | @@ -104,6 +115,7 @@ |
105 | 116 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.js', |
106 | 117 | 'styles' => 'extensions/WikiEditor/modules/ext.wikiEditor.css', |
107 | 118 | 'dependencies' => 'jquery.wikiEditor', |
| 119 | + 'group' => 'ext.wikiEditor', |
108 | 120 | ), |
109 | 121 | 'ext.wikiEditor.dialogs' => array( |
110 | 122 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js', |
— | — | @@ -113,6 +125,7 @@ |
114 | 126 | 'jquery.wikiEditor.dialogs', |
115 | 127 | 'jquery.suggestions', |
116 | 128 | ), |
| 129 | + 'group' => 'ext.wikiEditor', |
117 | 130 | ), |
118 | 131 | 'ext.wikiEditor.highlight' => array( |
119 | 132 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.highlight.js', |
— | — | @@ -120,6 +133,7 @@ |
121 | 134 | 'ext.wikiEditor', |
122 | 135 | 'jquery.wikiEditor.highlight', |
123 | 136 | ), |
| 137 | + 'group' => 'ext.wikiEditor', |
124 | 138 | ), |
125 | 139 | 'ext.wikiEditor.preview' => array( |
126 | 140 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.preview.js', |
— | — | @@ -132,6 +146,7 @@ |
133 | 147 | 'wikieditor-preview-changes-tab', |
134 | 148 | 'wikieditor-preview-loading', |
135 | 149 | ), |
| 150 | + 'group' => 'ext.wikiEditor', |
136 | 151 | ), |
137 | 152 | 'ext.wikiEditor.previewDialog' => array( |
138 | 153 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js', |
— | — | @@ -144,6 +159,7 @@ |
145 | 160 | 'wikieditor-previewDialog-tab', |
146 | 161 | 'wikieditor-previewDialog-loading', |
147 | 162 | ), |
| 163 | + 'group' => 'ext.wikiEditor', |
148 | 164 | ), |
149 | 165 | 'ext.wikiEditor.publish' => array( |
150 | 166 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.publish.js', |
— | — | @@ -161,6 +177,7 @@ |
162 | 178 | 'wikieditor-publish-dialog-publish', |
163 | 179 | 'wikieditor-publish-dialog-goback', |
164 | 180 | ), |
| 181 | + 'group' => 'ext.wikiEditor', |
165 | 182 | ), |
166 | 183 | 'ext.wikiEditor.templateEditor' => array( |
167 | 184 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js', |
— | — | @@ -173,6 +190,7 @@ |
174 | 191 | 'wikieditor-template-editor-dialog-submit', |
175 | 192 | 'wikieditor-template-editor-dialog-cancel', |
176 | 193 | ), |
| 194 | + 'group' => 'ext.wikiEditor', |
177 | 195 | ), |
178 | 196 | 'ext.wikiEditor.templates' => array( |
179 | 197 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.templates.js', |
— | — | @@ -180,6 +198,7 @@ |
181 | 199 | 'ext.wikiEditor', |
182 | 200 | 'jquery.wikiEditor.templates', |
183 | 201 | ), |
| 202 | + 'group' => 'ext.wikiEditor', |
184 | 203 | ), |
185 | 204 | 'ext.wikiEditor.toc' => array( |
186 | 205 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.toc.js', |
— | — | @@ -191,10 +210,12 @@ |
192 | 211 | 'wikieditor-toc-show', |
193 | 212 | 'wikieditor-toc-hide', |
194 | 213 | ), |
| 214 | + 'group' => 'ext.wikiEditor', |
195 | 215 | ), |
196 | | - 'ext.wikiEditor.toolbar.tests' => array( |
197 | | - 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.toolbar.tests.js', |
| 216 | + 'ext.wikiEditor.tests.toolbar' => array( |
| 217 | + 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js', |
198 | 218 | 'dependencies' => 'ext.wikiEditor.toolbar', |
| 219 | + 'group' => 'ext.wikiEditor.tests', |
199 | 220 | ), |
200 | 221 | 'ext.wikiEditor.toolbar' => array( |
201 | 222 | 'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js', |
— | — | @@ -400,6 +421,7 @@ |
401 | 422 | 'wikieditor-toolbar-help-content-indent-syntax', |
402 | 423 | 'wikieditor-toolbar-help-content-indent-result', |
403 | 424 | ), |
| 425 | + 'group' => 'ext.wikiEditor', |
404 | 426 | ), |
405 | 427 | ); |
406 | 428 | |
Index: trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.tests.js |
— | — | @@ -1,246 +0,0 @@ |
2 | | -/** |
3 | | - * Test set for the edit toolbar |
4 | | - */ |
5 | | -var textareaId = '#wpTextbox1'; |
6 | | -var wikiEditorTests = { |
7 | | - // Add emoticons section |
8 | | - 'add_sections_toolbar': { |
9 | | - 'call': 'addToToolbar', |
10 | | - 'data': { |
11 | | - 'sections': { |
12 | | - 'emoticons': { |
13 | | - 'type': 'toolbar', |
14 | | - 'label': 'Emoticons' |
15 | | - } |
16 | | - } |
17 | | - }, |
18 | | - 'test': '*[rel=emoticons].section', |
19 | | - 'pre': 0, |
20 | | - 'post': 1 |
21 | | - }, |
22 | | - // Add faces group to emoticons section |
23 | | - 'add_groups': { |
24 | | - 'call': 'addToToolbar', |
25 | | - 'data': { |
26 | | - 'section': 'emoticons', |
27 | | - 'groups': { |
28 | | - 'faces': { |
29 | | - 'label': 'Faces' |
30 | | - } |
31 | | - } |
32 | | - }, |
33 | | - 'test': '*[rel=emoticons].section *[rel=faces].group', |
34 | | - 'pre': 0, |
35 | | - 'post': 1 |
36 | | - }, |
37 | | - // Add smile tool to faces group of emoticons section |
38 | | - 'add_tools': { |
39 | | - 'call': 'addToToolbar', |
40 | | - 'data': { |
41 | | - 'section': 'emoticons', |
42 | | - 'group': 'faces', |
43 | | - 'tools': { |
44 | | - 'smile': { |
45 | | - label: 'Smile!', |
46 | | - type: 'button', |
47 | | - icon: 'http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png', |
48 | | - action: { |
49 | | - type: 'encapsulate', |
50 | | - options: { |
51 | | - pre: ":)" |
52 | | - } |
53 | | - } |
54 | | - } |
55 | | - } |
56 | | - }, |
57 | | - 'test': '*[rel=emoticons].section *[rel=faces].group *[rel=smile].tool', |
58 | | - 'pre': 0, |
59 | | - 'post': 1 |
60 | | - }, |
61 | | - // Add info section |
62 | | - 'add_sections_booklet': { |
63 | | - 'call': 'addToToolbar', |
64 | | - 'data': { |
65 | | - 'sections': { |
66 | | - 'info': { |
67 | | - 'type': 'booklet', |
68 | | - 'label': 'Info' |
69 | | - } |
70 | | - } |
71 | | - }, |
72 | | - 'test': '*[rel=info].section', |
73 | | - 'pre': 0, |
74 | | - 'post': 1 |
75 | | - }, |
76 | | - // Add info section |
77 | | - 'add_pages_table': { |
78 | | - 'call': 'addToToolbar', |
79 | | - 'data': { |
80 | | - 'section': 'info', |
81 | | - 'pages': { |
82 | | - 'colors': { |
83 | | - 'layout': 'table', |
84 | | - 'label': 'Colors', |
85 | | - 'headings': [ |
86 | | - { text: 'Name' }, |
87 | | - { text: 'Temperature' }, |
88 | | - { text: 'Swatch' } |
89 | | - ] |
90 | | - } |
91 | | - } |
92 | | - }, |
93 | | - 'test': '*[rel=info].section *[rel=colors].page', |
94 | | - 'pre': 0, |
95 | | - 'post': 1 |
96 | | - }, |
97 | | - // Add colors rows |
98 | | - 'add_rows': { |
99 | | - 'call': 'addToToolbar', |
100 | | - 'data': { |
101 | | - 'section': 'info', |
102 | | - 'page': 'colors', |
103 | | - 'rows': [ |
104 | | - { |
105 | | - 'name': { text: 'Red' }, |
106 | | - 'temp': { text: 'Warm' }, |
107 | | - 'swatch': { html: '<div style="width:10px;height:10px;background-color:red;">' } |
108 | | - }, |
109 | | - { |
110 | | - 'name': { text: 'Blue' }, |
111 | | - 'temp': { text: 'Cold' }, |
112 | | - 'swatch': { html: '<div style="width:10px;height:10px;background-color:blue;">' } |
113 | | - }, |
114 | | - { |
115 | | - 'name': { text: 'Silver' }, |
116 | | - 'temp': { text: 'Neutral' }, |
117 | | - 'swatch': { html: '<div style="width:10px;height:10px;background-color:silver;">' } |
118 | | - } |
119 | | - ] |
120 | | - }, |
121 | | - 'test': '*[rel=info].section *[rel=colors].page tr td', |
122 | | - 'pre': 0, |
123 | | - 'post': 9 |
124 | | - }, |
125 | | - // Add |
126 | | - 'add_pages_characters': { |
127 | | - 'call': 'addToToolbar', |
128 | | - 'data': { |
129 | | - 'section': 'info', |
130 | | - 'pages': { |
131 | | - 'emoticons': { |
132 | | - 'layout': 'characters', |
133 | | - 'label': 'Emoticons' |
134 | | - }, |
135 | | - 'removeme': { |
136 | | - 'layout': 'characters', |
137 | | - 'label': 'Remove Me!' |
138 | | - } |
139 | | - } |
140 | | - }, |
141 | | - 'test': '*[rel=info].section *[rel=emoticons].page', |
142 | | - 'pre': 0, |
143 | | - 'post': 1 |
144 | | - }, |
145 | | - // Add |
146 | | - 'add_characters': { |
147 | | - 'call': 'addToToolbar', |
148 | | - 'data': { |
149 | | - 'section': 'info', |
150 | | - 'page': 'emoticons', |
151 | | - 'characters': [ ':)', ':))', ':(', '<3', ';)' ] |
152 | | - }, |
153 | | - 'test': '*[rel=info].section *[rel=emoticons].page *[rel=":)"]', |
154 | | - 'pre': 0, |
155 | | - 'post': 1 |
156 | | - }, |
157 | | - // Remove page |
158 | | - 'remove_page': { |
159 | | - 'call': 'removeFromToolbar', |
160 | | - 'data': { |
161 | | - 'section': 'info', |
162 | | - 'page': 'removeme' |
163 | | - }, |
164 | | - 'test': '*[rel=info].section *[rel=removeme].page', |
165 | | - 'pre': 1, |
166 | | - 'post': 0 |
167 | | - }, |
168 | | - // Remove :)) from emoticon characters |
169 | | - 'remove_character': { |
170 | | - 'call': 'removeFromToolbar', |
171 | | - 'data': { |
172 | | - 'section': 'info', |
173 | | - 'page': 'emoticons', |
174 | | - 'character': ':))' |
175 | | - }, |
176 | | - 'test': '*[rel=info].section *[rel=emoticons].page *[rel=":))"]', |
177 | | - 'pre': 1, |
178 | | - 'post': 0 |
179 | | - }, |
180 | | - // Remove row from colors table of info section |
181 | | - 'remove_row': { |
182 | | - 'call': 'removeFromToolbar', |
183 | | - 'data': { |
184 | | - 'section': 'info', |
185 | | - 'page': 'colors', |
186 | | - 'row': 0 |
187 | | - }, |
188 | | - 'test': '*[rel=info].section *[rel=colors].page tr td', |
189 | | - 'pre': 9, |
190 | | - 'post': 6 |
191 | | - } |
192 | | -}; |
193 | | -$(document).ready( function() { |
194 | | - var button = $( '<button>Run wikiEditor Tests!</button>' ) |
195 | | - .css( { |
196 | | - 'position': 'fixed', |
197 | | - 'bottom': 0, |
198 | | - 'right': 0, |
199 | | - 'width': '100%', |
200 | | - 'backgroundColor': '#333333', |
201 | | - 'opacity': 0.75, |
202 | | - 'color': '#DDDDDD', |
203 | | - 'padding': '0.5em', |
204 | | - 'border': 'none', |
205 | | - 'display': 'none' |
206 | | - } ) |
207 | | - .click( function() { |
208 | | - if ( $(this).attr( 'enabled' ) == 'false' ) { |
209 | | - $(this).slideUp( 'fast' ); |
210 | | - return false; |
211 | | - } |
212 | | - var messages = [ 'Running tests for wikiEditor API' ]; |
213 | | - var $target = $( textareaId ); |
214 | | - var $ui = $target.data( 'wikiEditor-context' ).$ui; |
215 | | - var passes = 0; |
216 | | - var tests = 0; |
217 | | - for ( test in wikiEditorTests ) { |
218 | | - var pre = $ui.find( wikiEditorTests[test].test ).size() == |
219 | | - wikiEditorTests[test].pre; |
220 | | - messages.push ( test + '-pre: ' + ( pre ? 'PASS' : 'FAIL' ) ); |
221 | | - $target.wikiEditor( |
222 | | - wikiEditorTests[test].call, |
223 | | - wikiEditorTests[test].data |
224 | | - ); |
225 | | - var post = $ui.find( wikiEditorTests[test].test ).size() == |
226 | | - wikiEditorTests[test].post; |
227 | | - messages.push ( test + '-post: ' + ( post ? 'PASS' : 'FAIL' ) ); |
228 | | - if ( pre && post ) { |
229 | | - passes++; |
230 | | - } |
231 | | - tests++; |
232 | | - } |
233 | | - if ( window.console !== undefined ) { |
234 | | - for ( message in messages ) { |
235 | | - console.log( messages[message] ); |
236 | | - } |
237 | | - } |
238 | | - $(this) |
239 | | - .attr( 'title', messages.join( " | " ) ) |
240 | | - .text( passes + ' / ' + tests + ' were successful' ) |
241 | | - .css( 'backgroundColor', passes < tests ? 'red' : 'green' ) |
242 | | - .attr( 'enabled', 'false' ) |
243 | | - .blur(); |
244 | | - } ) |
245 | | - .appendTo( $( 'body' ) ); |
246 | | - setTimeout( function() { button.slideDown( 'fast' ) }, 2000 ); |
247 | | -} ); |
Index: trunk/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js |
— | — | @@ -0,0 +1,246 @@ |
| 2 | +/** |
| 3 | + * Test set for the edit toolbar |
| 4 | + */ |
| 5 | +var textareaId = '#wpTextbox1'; |
| 6 | +var wikiEditorTests = { |
| 7 | + // Add emoticons section |
| 8 | + 'add_sections_toolbar': { |
| 9 | + 'call': 'addToToolbar', |
| 10 | + 'data': { |
| 11 | + 'sections': { |
| 12 | + 'emoticons': { |
| 13 | + 'type': 'toolbar', |
| 14 | + 'label': 'Emoticons' |
| 15 | + } |
| 16 | + } |
| 17 | + }, |
| 18 | + 'test': '*[rel=emoticons].section', |
| 19 | + 'pre': 0, |
| 20 | + 'post': 1 |
| 21 | + }, |
| 22 | + // Add faces group to emoticons section |
| 23 | + 'add_groups': { |
| 24 | + 'call': 'addToToolbar', |
| 25 | + 'data': { |
| 26 | + 'section': 'emoticons', |
| 27 | + 'groups': { |
| 28 | + 'faces': { |
| 29 | + 'label': 'Faces' |
| 30 | + } |
| 31 | + } |
| 32 | + }, |
| 33 | + 'test': '*[rel=emoticons].section *[rel=faces].group', |
| 34 | + 'pre': 0, |
| 35 | + 'post': 1 |
| 36 | + }, |
| 37 | + // Add smile tool to faces group of emoticons section |
| 38 | + 'add_tools': { |
| 39 | + 'call': 'addToToolbar', |
| 40 | + 'data': { |
| 41 | + 'section': 'emoticons', |
| 42 | + 'group': 'faces', |
| 43 | + 'tools': { |
| 44 | + 'smile': { |
| 45 | + label: 'Smile!', |
| 46 | + type: 'button', |
| 47 | + icon: 'http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png', |
| 48 | + action: { |
| 49 | + type: 'encapsulate', |
| 50 | + options: { |
| 51 | + pre: ":)" |
| 52 | + } |
| 53 | + } |
| 54 | + } |
| 55 | + } |
| 56 | + }, |
| 57 | + 'test': '*[rel=emoticons].section *[rel=faces].group *[rel=smile].tool', |
| 58 | + 'pre': 0, |
| 59 | + 'post': 1 |
| 60 | + }, |
| 61 | + // Add info section |
| 62 | + 'add_sections_booklet': { |
| 63 | + 'call': 'addToToolbar', |
| 64 | + 'data': { |
| 65 | + 'sections': { |
| 66 | + 'info': { |
| 67 | + 'type': 'booklet', |
| 68 | + 'label': 'Info' |
| 69 | + } |
| 70 | + } |
| 71 | + }, |
| 72 | + 'test': '*[rel=info].section', |
| 73 | + 'pre': 0, |
| 74 | + 'post': 1 |
| 75 | + }, |
| 76 | + // Add info section |
| 77 | + 'add_pages_table': { |
| 78 | + 'call': 'addToToolbar', |
| 79 | + 'data': { |
| 80 | + 'section': 'info', |
| 81 | + 'pages': { |
| 82 | + 'colors': { |
| 83 | + 'layout': 'table', |
| 84 | + 'label': 'Colors', |
| 85 | + 'headings': [ |
| 86 | + { text: 'Name' }, |
| 87 | + { text: 'Temperature' }, |
| 88 | + { text: 'Swatch' } |
| 89 | + ] |
| 90 | + } |
| 91 | + } |
| 92 | + }, |
| 93 | + 'test': '*[rel=info].section *[rel=colors].page', |
| 94 | + 'pre': 0, |
| 95 | + 'post': 1 |
| 96 | + }, |
| 97 | + // Add colors rows |
| 98 | + 'add_rows': { |
| 99 | + 'call': 'addToToolbar', |
| 100 | + 'data': { |
| 101 | + 'section': 'info', |
| 102 | + 'page': 'colors', |
| 103 | + 'rows': [ |
| 104 | + { |
| 105 | + 'name': { text: 'Red' }, |
| 106 | + 'temp': { text: 'Warm' }, |
| 107 | + 'swatch': { html: '<div style="width:10px;height:10px;background-color:red;">' } |
| 108 | + }, |
| 109 | + { |
| 110 | + 'name': { text: 'Blue' }, |
| 111 | + 'temp': { text: 'Cold' }, |
| 112 | + 'swatch': { html: '<div style="width:10px;height:10px;background-color:blue;">' } |
| 113 | + }, |
| 114 | + { |
| 115 | + 'name': { text: 'Silver' }, |
| 116 | + 'temp': { text: 'Neutral' }, |
| 117 | + 'swatch': { html: '<div style="width:10px;height:10px;background-color:silver;">' } |
| 118 | + } |
| 119 | + ] |
| 120 | + }, |
| 121 | + 'test': '*[rel=info].section *[rel=colors].page tr td', |
| 122 | + 'pre': 0, |
| 123 | + 'post': 9 |
| 124 | + }, |
| 125 | + // Add |
| 126 | + 'add_pages_characters': { |
| 127 | + 'call': 'addToToolbar', |
| 128 | + 'data': { |
| 129 | + 'section': 'info', |
| 130 | + 'pages': { |
| 131 | + 'emoticons': { |
| 132 | + 'layout': 'characters', |
| 133 | + 'label': 'Emoticons' |
| 134 | + }, |
| 135 | + 'removeme': { |
| 136 | + 'layout': 'characters', |
| 137 | + 'label': 'Remove Me!' |
| 138 | + } |
| 139 | + } |
| 140 | + }, |
| 141 | + 'test': '*[rel=info].section *[rel=emoticons].page', |
| 142 | + 'pre': 0, |
| 143 | + 'post': 1 |
| 144 | + }, |
| 145 | + // Add |
| 146 | + 'add_characters': { |
| 147 | + 'call': 'addToToolbar', |
| 148 | + 'data': { |
| 149 | + 'section': 'info', |
| 150 | + 'page': 'emoticons', |
| 151 | + 'characters': [ ':)', ':))', ':(', '<3', ';)' ] |
| 152 | + }, |
| 153 | + 'test': '*[rel=info].section *[rel=emoticons].page *[rel=":)"]', |
| 154 | + 'pre': 0, |
| 155 | + 'post': 1 |
| 156 | + }, |
| 157 | + // Remove page |
| 158 | + 'remove_page': { |
| 159 | + 'call': 'removeFromToolbar', |
| 160 | + 'data': { |
| 161 | + 'section': 'info', |
| 162 | + 'page': 'removeme' |
| 163 | + }, |
| 164 | + 'test': '*[rel=info].section *[rel=removeme].page', |
| 165 | + 'pre': 1, |
| 166 | + 'post': 0 |
| 167 | + }, |
| 168 | + // Remove :)) from emoticon characters |
| 169 | + 'remove_character': { |
| 170 | + 'call': 'removeFromToolbar', |
| 171 | + 'data': { |
| 172 | + 'section': 'info', |
| 173 | + 'page': 'emoticons', |
| 174 | + 'character': ':))' |
| 175 | + }, |
| 176 | + 'test': '*[rel=info].section *[rel=emoticons].page *[rel=":))"]', |
| 177 | + 'pre': 1, |
| 178 | + 'post': 0 |
| 179 | + }, |
| 180 | + // Remove row from colors table of info section |
| 181 | + 'remove_row': { |
| 182 | + 'call': 'removeFromToolbar', |
| 183 | + 'data': { |
| 184 | + 'section': 'info', |
| 185 | + 'page': 'colors', |
| 186 | + 'row': 0 |
| 187 | + }, |
| 188 | + 'test': '*[rel=info].section *[rel=colors].page tr td', |
| 189 | + 'pre': 9, |
| 190 | + 'post': 6 |
| 191 | + } |
| 192 | +}; |
| 193 | +$(document).ready( function() { |
| 194 | + var button = $( '<button>Run wikiEditor Tests!</button>' ) |
| 195 | + .css( { |
| 196 | + 'position': 'fixed', |
| 197 | + 'bottom': 0, |
| 198 | + 'right': 0, |
| 199 | + 'width': '100%', |
| 200 | + 'backgroundColor': '#333333', |
| 201 | + 'opacity': 0.75, |
| 202 | + 'color': '#DDDDDD', |
| 203 | + 'padding': '0.5em', |
| 204 | + 'border': 'none', |
| 205 | + 'display': 'none' |
| 206 | + } ) |
| 207 | + .click( function() { |
| 208 | + if ( $(this).attr( 'enabled' ) == 'false' ) { |
| 209 | + $(this).slideUp( 'fast' ); |
| 210 | + return false; |
| 211 | + } |
| 212 | + var messages = [ 'Running tests for wikiEditor API' ]; |
| 213 | + var $target = $( textareaId ); |
| 214 | + var $ui = $target.data( 'wikiEditor-context' ).$ui; |
| 215 | + var passes = 0; |
| 216 | + var tests = 0; |
| 217 | + for ( test in wikiEditorTests ) { |
| 218 | + var pre = $ui.find( wikiEditorTests[test].test ).size() == |
| 219 | + wikiEditorTests[test].pre; |
| 220 | + messages.push ( test + '-pre: ' + ( pre ? 'PASS' : 'FAIL' ) ); |
| 221 | + $target.wikiEditor( |
| 222 | + wikiEditorTests[test].call, |
| 223 | + wikiEditorTests[test].data |
| 224 | + ); |
| 225 | + var post = $ui.find( wikiEditorTests[test].test ).size() == |
| 226 | + wikiEditorTests[test].post; |
| 227 | + messages.push ( test + '-post: ' + ( post ? 'PASS' : 'FAIL' ) ); |
| 228 | + if ( pre && post ) { |
| 229 | + passes++; |
| 230 | + } |
| 231 | + tests++; |
| 232 | + } |
| 233 | + if ( window.console !== undefined ) { |
| 234 | + for ( message in messages ) { |
| 235 | + console.log( messages[message] ); |
| 236 | + } |
| 237 | + } |
| 238 | + $(this) |
| 239 | + .attr( 'title', messages.join( " | " ) ) |
| 240 | + .text( passes + ' / ' + tests + ' were successful' ) |
| 241 | + .css( 'backgroundColor', passes < tests ? 'red' : 'green' ) |
| 242 | + .attr( 'enabled', 'false' ) |
| 243 | + .blur(); |
| 244 | + } ) |
| 245 | + .appendTo( $( 'body' ) ); |
| 246 | + setTimeout( function() { button.slideDown( 'fast' ) }, 2000 ); |
| 247 | +} ); |
Property changes on: trunk/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 248 | + native |
Index: trunk/extensions/Vector/Vector.hooks.php |
— | — | @@ -22,6 +22,7 @@ |
23 | 23 | 'jquery.cookie', |
24 | 24 | 'jquery.tabIndex', |
25 | 25 | ), |
| 26 | + 'group' => 'ext.vector', |
26 | 27 | ), |
27 | 28 | 'ext.vector.collapsibleTabs' => array( |
28 | 29 | 'scripts' => 'extensions/Vector/modules/ext.vector.collapsibleTabs.js', |
— | — | @@ -29,12 +30,14 @@ |
30 | 31 | 'jquery.collapsibleTabs', |
31 | 32 | 'jquery.delayedBind', |
32 | 33 | ), |
| 34 | + 'group' => 'ext.vector', |
33 | 35 | ), |
34 | 36 | 'ext.vector.editWarning' => array( |
35 | 37 | 'scripts' => 'extensions/Vector/modules/ext.vector.editWarning.js', |
36 | 38 | 'messages' => array( |
37 | 39 | 'vector-editwarning-warning', |
38 | 40 | ), |
| 41 | + 'group' => 'ext.vector', |
39 | 42 | ), |
40 | 43 | 'ext.vector.expandableSearch' => array( |
41 | 44 | 'scripts' => 'extensions/Vector/modules/ext.vector.expandableSearch.js', |
— | — | @@ -44,10 +47,12 @@ |
45 | 48 | 'jquery.expandableField', |
46 | 49 | 'jquery.delayedBind', |
47 | 50 | ), |
| 51 | + 'group' => 'ext.vector', |
48 | 52 | ), |
49 | 53 | 'ext.vector.footerCleanup' => array( |
50 | 54 | 'scripts' => 'extensions/Vector/modules/ext.vector.footerCleanup.js', |
51 | 55 | 'styles' => 'extensions/Vector/modules/ext.vector.footerCleanup.css', |
| 56 | + 'group' => 'ext.vector', |
52 | 57 | ), |
53 | 58 | 'ext.vector.simpleSearch' => array( |
54 | 59 | 'scripts' => 'extensions/Vector/modules/ext.vector.simpleSearch.js', |
— | — | @@ -60,6 +65,7 @@ |
61 | 66 | 'jquery.suggestions', |
62 | 67 | 'jquery.autoEllipsis', |
63 | 68 | ), |
| 69 | + 'group' => 'ext.vector', |
64 | 70 | ), |
65 | 71 | ); |
66 | 72 | |