http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73423

Revision: 73423
Author:   tparscal
Date:     2010-09-20 23:31:56 +0000 (Mon, 20 Sep 2010)

Log Message:
-----------
Using new group feature of ResourceLoaderFileModule objects.

Modified Paths:
--------------
    trunk/extensions/Vector/Vector.hooks.php
    trunk/extensions/WikiEditor/WikiEditor.hooks.php

Added Paths:
-----------
    trunk/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js

Removed Paths:
-------------
    trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.tests.js

Modified: trunk/extensions/Vector/Vector.hooks.php
===================================================================
--- trunk/extensions/Vector/Vector.hooks.php    2010-09-20 23:23:25 UTC (rev 
73422)
+++ trunk/extensions/Vector/Vector.hooks.php    2010-09-20 23:31:56 UTC (rev 
73423)
@@ -22,6 +22,7 @@
                                'jquery.cookie',
                                'jquery.tabIndex',
                        ),
+                       'group' => 'ext.vector',
                ),
                'ext.vector.collapsibleTabs' => array(
                        'scripts' => 
'extensions/Vector/modules/ext.vector.collapsibleTabs.js',
@@ -29,12 +30,14 @@
                                'jquery.collapsibleTabs',
                                'jquery.delayedBind',
                        ),
+                       'group' => 'ext.vector',
                ),
                'ext.vector.editWarning' => array(
                        'scripts' => 
'extensions/Vector/modules/ext.vector.editWarning.js',
                        'messages' => array(
                                'vector-editwarning-warning',
                        ),
+                       'group' => 'ext.vector',
                ),
                'ext.vector.expandableSearch' => array(
                        'scripts' => 
'extensions/Vector/modules/ext.vector.expandableSearch.js',
@@ -44,10 +47,12 @@
                                'jquery.expandableField',
                                'jquery.delayedBind',
                        ),
+                       'group' => 'ext.vector',
                ),
                'ext.vector.footerCleanup' => array(
                        'scripts' => 
'extensions/Vector/modules/ext.vector.footerCleanup.js',
                        'styles' => 
'extensions/Vector/modules/ext.vector.footerCleanup.css',
+                       'group' => 'ext.vector',
                ),
                'ext.vector.simpleSearch' => array(
                        'scripts' => 
'extensions/Vector/modules/ext.vector.simpleSearch.js',
@@ -60,6 +65,7 @@
                                'jquery.suggestions',
                                'jquery.autoEllipsis',
                        ),
+                       'group' => 'ext.vector',
                ),
        );
        

Modified: trunk/extensions/WikiEditor/WikiEditor.hooks.php
===================================================================
--- trunk/extensions/WikiEditor/WikiEditor.hooks.php    2010-09-20 23:23:25 UTC 
(rev 73422)
+++ trunk/extensions/WikiEditor/WikiEditor.hooks.php    2010-09-20 23:31:56 UTC 
(rev 73423)
@@ -16,6 +16,7 @@
                
                'contentCollector' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/contentCollector.js',
+                       'group' => 'ext.wikiEditor',
                ),
                
                /* WikiEditor jQuery plugin Resources */
@@ -33,6 +34,7 @@
                                'wikieditor-wikitext-tab',
                                'wikieditor-loading',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'jquery.wikiEditor.dialogs' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js',
@@ -45,15 +47,18 @@
                                'jquery.ui.resizable',
                                'jquery.tabIndex',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'jquery.wikiEditor.highlight' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js',
                        'dependencies' => 'jquery.wikiEditor',
+                       'group' => 'ext.wikiEditor',
                ),
                'jquery.wikiEditor.preview' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.preview.js',
                        'styles' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.preview.css',
                        'dependencies' => 'jquery.wikiEditor',
+                       'group' => 'ext.wikiEditor',
                ),
                'jquery.wikiEditor.previewDialog' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js',
@@ -62,6 +67,7 @@
                                'jquery.wikiEditor',
                                'jquery.wikiEditor.dialogs',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'jquery.wikiEditor.publish' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.publish.js',
@@ -69,6 +75,7 @@
                                'jquery.wikiEditor',
                                'jquery.wikiEditor.dialogs',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'jquery.wikiEditor.templateEditor' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js',
@@ -76,10 +83,12 @@
                                'jquery.wikiEditor',
                                'jquery.wikiEditor.dialogs', 
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'jquery.wikiEditor.templates' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.templates.js',
                        'dependencies' => 'jquery.wikiEditor',
+                       'group' => 'ext.wikiEditor',
                ),
                'jquery.wikiEditor.toc' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.toc.js',
@@ -91,11 +100,13 @@
                                'jquery.autoEllipsis',
                                'jquery.color',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'jquery.wikiEditor.toolbar' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js',
                        'styles' => 
'extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.css',
                        'dependencies' => 'jquery.wikiEditor',
+                       'group' => 'ext.wikiEditor',
                ),
                
                /* WikiEditor Resources */
@@ -104,6 +115,7 @@
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.js',
                        'styles' => 
'extensions/WikiEditor/modules/ext.wikiEditor.css',
                        'dependencies' => 'jquery.wikiEditor',
+                       'group' => 'ext.wikiEditor',
                ),
                'ext.wikiEditor.dialogs' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js',
@@ -113,6 +125,7 @@
                                'jquery.wikiEditor.dialogs',
                                'jquery.suggestions',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'ext.wikiEditor.highlight' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.highlight.js',
@@ -120,6 +133,7 @@
                                'ext.wikiEditor',
                                'jquery.wikiEditor.highlight',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'ext.wikiEditor.preview' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.preview.js',
@@ -132,6 +146,7 @@
                                'wikieditor-preview-changes-tab',
                                'wikieditor-preview-loading',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'ext.wikiEditor.previewDialog' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js',
@@ -144,6 +159,7 @@
                                'wikieditor-previewDialog-tab',
                                'wikieditor-previewDialog-loading',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'ext.wikiEditor.publish' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.publish.js',
@@ -161,6 +177,7 @@
                                'wikieditor-publish-dialog-publish',
                                'wikieditor-publish-dialog-goback',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'ext.wikiEditor.templateEditor' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js',
@@ -173,6 +190,7 @@
                                'wikieditor-template-editor-dialog-submit',
                                'wikieditor-template-editor-dialog-cancel',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'ext.wikiEditor.templates' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.templates.js',
@@ -180,6 +198,7 @@
                                'ext.wikiEditor',
                                'jquery.wikiEditor.templates',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
                'ext.wikiEditor.toc' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.toc.js',
@@ -191,10 +210,12 @@
                                'wikieditor-toc-show',
                                'wikieditor-toc-hide',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
-               'ext.wikiEditor.toolbar.tests' => array(
-                       'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.toolbar.tests.js',
+               'ext.wikiEditor.tests.toolbar' => array(
+                       'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js',
                        'dependencies' => 'ext.wikiEditor.toolbar',
+                       'group' => 'ext.wikiEditor.tests',
                ),
                'ext.wikiEditor.toolbar' => array(
                        'scripts' => 
'extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js',
@@ -400,6 +421,7 @@
                                'wikieditor-toolbar-help-content-indent-syntax',
                                'wikieditor-toolbar-help-content-indent-result',
                        ),
+                       'group' => 'ext.wikiEditor',
                ),
        );
        

Copied: trunk/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js 
(from rev 73422, 
trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.tests.js)
===================================================================
--- trunk/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js         
                (rev 0)
+++ trunk/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js 
2010-09-20 23:31:56 UTC (rev 73423)
@@ -0,0 +1,246 @@
+/**
+ * Test set for the edit toolbar
+ */
+var textareaId = '#wpTextbox1';
+var wikiEditorTests = {
+       // Add emoticons section
+       'add_sections_toolbar': {
+               'call': 'addToToolbar',
+               'data': {
+                       'sections': {
+                               'emoticons': {
+                                       'type': 'toolbar',
+                                       'label': 'Emoticons'
+                               }
+                       }
+               },
+               'test': '*[rel=emoticons].section',
+               'pre': 0,
+               'post': 1
+       },
+       // Add faces group to emoticons section
+       'add_groups': {
+               'call': 'addToToolbar',
+               'data': {
+                       'section': 'emoticons',
+                       'groups': {
+                               'faces': {
+                                       'label': 'Faces'
+                               }
+                       }
+               },
+               'test': '*[rel=emoticons].section *[rel=faces].group',
+               'pre': 0,
+               'post': 1
+       },
+       // Add smile tool to faces group of emoticons section
+       'add_tools': {
+               'call': 'addToToolbar',
+               'data': {
+                       'section': 'emoticons',
+                       'group': 'faces',
+                       'tools': {
+                               'smile': {
+                                       label: 'Smile!',
+                                       type: 'button',
+                                       icon: 
'http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
+                                       action: {
+                                               type: 'encapsulate',
+                                               options: {
+                                                       pre: ":)"
+                                               }
+                                       }
+                               }
+                       }
+               },
+               'test': '*[rel=emoticons].section *[rel=faces].group 
*[rel=smile].tool',
+               'pre': 0,
+               'post': 1
+       },
+       // Add info section
+       'add_sections_booklet': {
+               'call': 'addToToolbar',
+               'data': {
+                       'sections': {
+                               'info': {
+                                       'type': 'booklet',
+                                       'label': 'Info'
+                               }
+                       }
+               },
+               'test': '*[rel=info].section',
+               'pre': 0,
+               'post': 1
+       },
+       // Add info section
+       'add_pages_table': {
+               'call': 'addToToolbar',
+               'data': {
+                       'section': 'info',
+                       'pages': {
+                               'colors': {
+                                       'layout': 'table',
+                                       'label': 'Colors',
+                                       'headings': [
+                                               { text: 'Name' },
+                                               { text: 'Temperature' },
+                                               { text: 'Swatch' }
+                                       ]
+                               }
+                       }
+               },
+               'test': '*[rel=info].section *[rel=colors].page',
+               'pre': 0,
+               'post': 1
+       },
+       // Add colors rows
+       'add_rows': {
+               'call': 'addToToolbar',
+               'data': {
+                       'section': 'info',
+                       'page': 'colors',
+                               'rows': [
+                                       {
+                                               'name': { text: 'Red' },
+                                               'temp': { text: 'Warm' },
+                                               'swatch': { html: '<div 
style="width:10px;height:10px;background-color:red;">' }
+                                       },
+                                       {
+                                               'name': { text: 'Blue' },
+                                               'temp': { text: 'Cold' },
+                                               'swatch': { html: '<div 
style="width:10px;height:10px;background-color:blue;">' }
+                                       },
+                                       {
+                                               'name': { text: 'Silver' },
+                                               'temp': { text: 'Neutral' },
+                                               'swatch': { html: '<div 
style="width:10px;height:10px;background-color:silver;">' }
+                                       }
+                               ]
+               },
+               'test': '*[rel=info].section *[rel=colors].page tr td',
+               'pre': 0,
+               'post': 9
+       },
+       // Add 
+       'add_pages_characters': {
+               'call': 'addToToolbar',
+               'data': {
+                       'section': 'info',
+                       'pages': {
+                               'emoticons': {
+                                       'layout': 'characters',
+                                       'label': 'Emoticons'
+                               },
+                               'removeme': {
+                                       'layout': 'characters',
+                                       'label': 'Remove Me!'
+                               }
+                       }
+               },
+               'test': '*[rel=info].section *[rel=emoticons].page',
+               'pre': 0,
+               'post': 1
+       },
+       // Add 
+       'add_characters': {
+               'call': 'addToToolbar',
+               'data': {
+                       'section': 'info',
+                       'page': 'emoticons',
+                       'characters': [ ':)', ':))', ':(', '<3', ';)' ]
+               },
+               'test': '*[rel=info].section *[rel=emoticons].page *[rel=":)"]',
+               'pre': 0,
+               'post': 1
+       },
+       // Remove page
+       'remove_page': {
+               'call': 'removeFromToolbar',
+               'data': {
+                       'section': 'info',
+                       'page': 'removeme'
+           },
+           'test': '*[rel=info].section *[rel=removeme].page',
+               'pre': 1,
+               'post': 0
+       },
+       // Remove :)) from emoticon characters
+       'remove_character': {
+               'call': 'removeFromToolbar',
+               'data': {
+                       'section': 'info',
+                       'page': 'emoticons',
+                       'character': ':))'
+           },
+           'test': '*[rel=info].section *[rel=emoticons].page *[rel=":))"]',
+               'pre': 1,
+               'post': 0
+       },
+       // Remove row from colors table of info section
+       'remove_row': {
+               'call': 'removeFromToolbar',
+               'data': {
+                       'section': 'info',
+                       'page': 'colors',
+                       'row': 0
+               },
+               'test': '*[rel=info].section *[rel=colors].page tr td',
+               'pre': 9,
+               'post': 6
+       }
+};
+$(document).ready( function() {
+       var button = $( '<button>Run wikiEditor Tests!</button>' )
+               .css( {
+                       'position': 'fixed',
+                       'bottom': 0,
+                       'right': 0,
+                       'width': '100%',
+                       'backgroundColor': '#333333',
+                       'opacity': 0.75,
+                       'color': '#DDDDDD',
+                       'padding': '0.5em',
+                       'border': 'none',
+                       'display': 'none'
+               } )
+               .click( function() {
+                       if ( $(this).attr( 'enabled' ) == 'false' ) {
+                               $(this).slideUp( 'fast' );
+                               return false;
+                       }
+                       var messages = [ 'Running tests for wikiEditor API' ];
+                       var $target = $( textareaId );
+                       var $ui = $target.data( 'wikiEditor-context' ).$ui;
+                       var passes = 0;
+                       var tests = 0;
+                       for ( test in wikiEditorTests ) {
+                               var pre = $ui.find( wikiEditorTests[test].test 
).size() ==
+                                       wikiEditorTests[test].pre;
+                               messages.push ( test + '-pre: ' + ( pre ? 
'PASS' : 'FAIL' ) );
+                               $target.wikiEditor(
+                                       wikiEditorTests[test].call,
+                                       wikiEditorTests[test].data
+                               );
+                               var post = $ui.find( wikiEditorTests[test].test 
).size() ==
+                                       wikiEditorTests[test].post;
+                               messages.push ( test + '-post: ' + ( post ? 
'PASS' : 'FAIL' ) );
+                               if ( pre && post ) {
+                                       passes++;
+                               }
+                               tests++;
+                       }
+                       if ( window.console !== undefined ) {
+                               for ( message in messages ) {
+                                       console.log( messages[message] );
+                               }
+                       }
+                       $(this)
+                               .attr( 'title', messages.join( " | " ) )
+                               .text( passes + ' / ' + tests + ' were 
successful' )
+                               .css( 'backgroundColor', passes < tests ? 'red' 
: 'green' )
+                               .attr( 'enabled', 'false' )
+                               .blur();
+               } )
+               .appendTo( $( 'body' ) );
+       setTimeout( function() { button.slideDown( 'fast' ) }, 2000 );
+} );

Deleted: trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.tests.js
===================================================================
--- trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.tests.js 
2010-09-20 23:23:25 UTC (rev 73422)
+++ trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.tests.js 
2010-09-20 23:31:56 UTC (rev 73423)
@@ -1,246 +0,0 @@
-/**
- * Test set for the edit toolbar
- */
-var textareaId = '#wpTextbox1';
-var wikiEditorTests = {
-       // Add emoticons section
-       'add_sections_toolbar': {
-               'call': 'addToToolbar',
-               'data': {
-                       'sections': {
-                               'emoticons': {
-                                       'type': 'toolbar',
-                                       'label': 'Emoticons'
-                               }
-                       }
-               },
-               'test': '*[rel=emoticons].section',
-               'pre': 0,
-               'post': 1
-       },
-       // Add faces group to emoticons section
-       'add_groups': {
-               'call': 'addToToolbar',
-               'data': {
-                       'section': 'emoticons',
-                       'groups': {
-                               'faces': {
-                                       'label': 'Faces'
-                               }
-                       }
-               },
-               'test': '*[rel=emoticons].section *[rel=faces].group',
-               'pre': 0,
-               'post': 1
-       },
-       // Add smile tool to faces group of emoticons section
-       'add_tools': {
-               'call': 'addToToolbar',
-               'data': {
-                       'section': 'emoticons',
-                       'group': 'faces',
-                       'tools': {
-                               'smile': {
-                                       label: 'Smile!',
-                                       type: 'button',
-                                       icon: 
'http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
-                                       action: {
-                                               type: 'encapsulate',
-                                               options: {
-                                                       pre: ":)"
-                                               }
-                                       }
-                               }
-                       }
-               },
-               'test': '*[rel=emoticons].section *[rel=faces].group 
*[rel=smile].tool',
-               'pre': 0,
-               'post': 1
-       },
-       // Add info section
-       'add_sections_booklet': {
-               'call': 'addToToolbar',
-               'data': {
-                       'sections': {
-                               'info': {
-                                       'type': 'booklet',
-                                       'label': 'Info'
-                               }
-                       }
-               },
-               'test': '*[rel=info].section',
-               'pre': 0,
-               'post': 1
-       },
-       // Add info section
-       'add_pages_table': {
-               'call': 'addToToolbar',
-               'data': {
-                       'section': 'info',
-                       'pages': {
-                               'colors': {
-                                       'layout': 'table',
-                                       'label': 'Colors',
-                                       'headings': [
-                                               { text: 'Name' },
-                                               { text: 'Temperature' },
-                                               { text: 'Swatch' }
-                                       ]
-                               }
-                       }
-               },
-               'test': '*[rel=info].section *[rel=colors].page',
-               'pre': 0,
-               'post': 1
-       },
-       // Add colors rows
-       'add_rows': {
-               'call': 'addToToolbar',
-               'data': {
-                       'section': 'info',
-                       'page': 'colors',
-                               'rows': [
-                                       {
-                                               'name': { text: 'Red' },
-                                               'temp': { text: 'Warm' },
-                                               'swatch': { html: '<div 
style="width:10px;height:10px;background-color:red;">' }
-                                       },
-                                       {
-                                               'name': { text: 'Blue' },
-                                               'temp': { text: 'Cold' },
-                                               'swatch': { html: '<div 
style="width:10px;height:10px;background-color:blue;">' }
-                                       },
-                                       {
-                                               'name': { text: 'Silver' },
-                                               'temp': { text: 'Neutral' },
-                                               'swatch': { html: '<div 
style="width:10px;height:10px;background-color:silver;">' }
-                                       }
-                               ]
-               },
-               'test': '*[rel=info].section *[rel=colors].page tr td',
-               'pre': 0,
-               'post': 9
-       },
-       // Add 
-       'add_pages_characters': {
-               'call': 'addToToolbar',
-               'data': {
-                       'section': 'info',
-                       'pages': {
-                               'emoticons': {
-                                       'layout': 'characters',
-                                       'label': 'Emoticons'
-                               },
-                               'removeme': {
-                                       'layout': 'characters',
-                                       'label': 'Remove Me!'
-                               }
-                       }
-               },
-               'test': '*[rel=info].section *[rel=emoticons].page',
-               'pre': 0,
-               'post': 1
-       },
-       // Add 
-       'add_characters': {
-               'call': 'addToToolbar',
-               'data': {
-                       'section': 'info',
-                       'page': 'emoticons',
-                       'characters': [ ':)', ':))', ':(', '<3', ';)' ]
-               },
-               'test': '*[rel=info].section *[rel=emoticons].page *[rel=":)"]',
-               'pre': 0,
-               'post': 1
-       },
-       // Remove page
-       'remove_page': {
-               'call': 'removeFromToolbar',
-               'data': {
-                       'section': 'info',
-                       'page': 'removeme'
-           },
-           'test': '*[rel=info].section *[rel=removeme].page',
-               'pre': 1,
-               'post': 0
-       },
-       // Remove :)) from emoticon characters
-       'remove_character': {
-               'call': 'removeFromToolbar',
-               'data': {
-                       'section': 'info',
-                       'page': 'emoticons',
-                       'character': ':))'
-           },
-           'test': '*[rel=info].section *[rel=emoticons].page *[rel=":))"]',
-               'pre': 1,
-               'post': 0
-       },
-       // Remove row from colors table of info section
-       'remove_row': {
-               'call': 'removeFromToolbar',
-               'data': {
-                       'section': 'info',
-                       'page': 'colors',
-                       'row': 0
-               },
-               'test': '*[rel=info].section *[rel=colors].page tr td',
-               'pre': 9,
-               'post': 6
-       }
-};
-$(document).ready( function() {
-       var button = $( '<button>Run wikiEditor Tests!</button>' )
-               .css( {
-                       'position': 'fixed',
-                       'bottom': 0,
-                       'right': 0,
-                       'width': '100%',
-                       'backgroundColor': '#333333',
-                       'opacity': 0.75,
-                       'color': '#DDDDDD',
-                       'padding': '0.5em',
-                       'border': 'none',
-                       'display': 'none'
-               } )
-               .click( function() {
-                       if ( $(this).attr( 'enabled' ) == 'false' ) {
-                               $(this).slideUp( 'fast' );
-                               return false;
-                       }
-                       var messages = [ 'Running tests for wikiEditor API' ];
-                       var $target = $( textareaId );
-                       var $ui = $target.data( 'wikiEditor-context' ).$ui;
-                       var passes = 0;
-                       var tests = 0;
-                       for ( test in wikiEditorTests ) {
-                               var pre = $ui.find( wikiEditorTests[test].test 
).size() ==
-                                       wikiEditorTests[test].pre;
-                               messages.push ( test + '-pre: ' + ( pre ? 
'PASS' : 'FAIL' ) );
-                               $target.wikiEditor(
-                                       wikiEditorTests[test].call,
-                                       wikiEditorTests[test].data
-                               );
-                               var post = $ui.find( wikiEditorTests[test].test 
).size() ==
-                                       wikiEditorTests[test].post;
-                               messages.push ( test + '-post: ' + ( post ? 
'PASS' : 'FAIL' ) );
-                               if ( pre && post ) {
-                                       passes++;
-                               }
-                               tests++;
-                       }
-                       if ( window.console !== undefined ) {
-                               for ( message in messages ) {
-                                       console.log( messages[message] );
-                               }
-                       }
-                       $(this)
-                               .attr( 'title', messages.join( " | " ) )
-                               .text( passes + ' / ' + tests + ' were 
successful' )
-                               .css( 'backgroundColor', passes < tests ? 'red' 
: 'green' )
-                               .attr( 'enabled', 'false' )
-                               .blur();
-               } )
-               .appendTo( $( 'body' ) );
-       setTimeout( function() { button.slideDown( 'fast' ) }, 2000 );
-} );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to