r61240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61239‎ | r61240 | r61241 >
Date:04:50, 19 January 2010
Author:dale
Status:deferred
Tags:
Comment:
fixes to preview and improved loader abstraction
Modified paths:
  • /branches/js2-work/phase3/includes/AutoLoader.php (modified) (history)
  • /branches/js2-work/phase3/includes/OutputPage.php (modified) (history)
  • /branches/js2-work/phase3/js/loader.js (added) (history)
  • /branches/js2-work/phase3/js/mwEmbed/includes/jsClassLoader.php (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/loader.js (added) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/archiveOrgSearch.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/baseRemoteSearch.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/flickrSearch.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/kalturaSearch.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/mediaWikiSearch.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/metavidSearch.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/ClipEdit/mw.ClipEdit.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/mwEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Add_Media_Wizard.html (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/includes/OutputPage.php
@@ -184,7 +184,6 @@
185185 // @todo We should deprecate wikibits in favor of some mwEmbed pieces and jQuery
186186 $coreClasses = array( 'window.jQuery', 'mwEmbed', 'wikibits' );
187187
188 -
189188 //make sure scripts are on top:
190189 $postScripts = $this->mScripts;
191190 $this->mScripts = '';
Index: branches/js2-work/phase3/includes/AutoLoader.php
@@ -632,7 +632,7 @@
633633 'upload' => 'skins/common/upload.js',
634634 'wikibits' => 'skins/common/wikibits.js',
635635
636 - // phase 2 javascript:
 636+ // phase 2 javascript @@todo could be loaded from "loader.js" in $IP/js/loader.js
637637 'uploadPage' => 'js/uploadPage.js',
638638 'editPage' => 'js/editPage.js',
639639 'ajaxCategories' => 'js/ajaxcategories.js',
Index: branches/js2-work/phase3/js/mwEmbed/loader.js
@@ -0,0 +1,97 @@
 2+/**
 3+*
 4+* Core "loader.js" for mwEmbed
 5+*
 6+* This loader along with all the enabled module loaders is combined with mwEmbed.js
 7+* via the script-loader.
 8+*
 9+*/
 10+
 11+/**
 12+* The set of modules that you want enable.
 13+*
 14+* Each enabledModules array value should be a name
 15+* of a folder in mwEmbed/modules
 16+*
 17+* Modules must define a loader.js file in the root
 18+* of the module folder.
 19+*
 20+* The loader file should be short and only include:
 21+* Class paths of the module classes
 22+* Sytle sheets of the module
 23+* Loader function(s) that load module classes
 24+*
 25+* When using the scriptLoader the enabledModules loader code
 26+* is transcluded into base mwEmbed class include.
 27+*/
 28+var mwEnabledModuleList = [
 29+ 'AddMedia',
 30+ 'ClipEdit',
 31+ 'EmbedPlayer',
 32+ 'ApiProxy',
 33+ 'Sequencer',
 34+ 'TimedText'
 35+];
 36+
 37+mw.setConfig( 'enabledModules', mwEnabledModuleList );
 38+
 39+/**
 40+* -- Load Class Paths --
 41+*
 42+* PHP AutoLoader reads this loader.js file along with
 43+* all the "loader.js" files to determin script-loader
 44+* class paths
 45+*
 46+*/
 47+
 48+// Set the loaderContext for the classFiles paths call:
 49+mw.setConfig('loaderContext', '' );
 50+
 51+mw.addClassFilePaths( {
 52+ "mwEmbed" : "mwEmbed.js",
 53+ "window.jQuery" : "jquery/jquery-1.3.2.js",
 54+
 55+ "ctrlBuilder" : "skins/ctrlBuilder.js",
 56+ "kskinConfig" : "skins/kskin/kskinConfig.js",
 57+ "mvpcfConfig" : "skins/mvpcf/mvpcfConfig.js",
 58+
 59+ "$j.fn.pngFix" : "jquery/plugins/jquery.pngFix.js",
 60+ "$j.fn.autocomplete": "jquery/plugins/jquery.autocomplete.js",
 61+ "$j.fn.hoverIntent" : "jquery/plugins/jquery.hoverIntent.js",
 62+ "$j.fn.datePicker" : "jquery/plugins/jquery.datePicker.js",
 63+ "$j.ui" : "jquery/jquery.ui/ui/ui.core.js",
 64+
 65+ "mw.testLang" : "tests/testLang.js",
 66+
 67+ "$j.cookie" : "jquery/plugins/jquery.cookie.js",
 68+ "$j.contextMenu" : "jquery/plugins/jquery.contextMenu.js",
 69+ "$j.fn.suggestions" : "jquery/plugins/jquery.suggestions.js",
 70+ "$j.fn.textSelection" : "jquery/plugins/jquery.textSelection.js",
 71+ "$j.browserTest" : "jquery/plugins/jquery.browserTest.js",
 72+
 73+ "$j.effects.blind" : "jquery/jquery.ui/ui/effects.blind.js",
 74+ "$j.effects.drop" : "jquery/jquery.ui/ui/effects.drop.js",
 75+ "$j.effects.pulsate" : "jquery/jquery.ui/ui/effects.pulsate.js",
 76+ "$j.effects.transfer" : "jquery/jquery.ui/ui/effects.transfer.js",
 77+ "$j.ui.droppable" : "jquery/jquery.ui/ui/ui.droppable.js",
 78+ "$j.ui.slider" : "jquery/jquery.ui/ui/ui.slider.js",
 79+ "$j.effects.bounce" : "jquery/jquery.ui/ui/effects.bounce.js",
 80+ "$j.effects.explode" : "jquery/jquery.ui/ui/effects.explode.js",
 81+ "$j.effects.scale" : "jquery/jquery.ui/ui/effects.scale.js",
 82+ "$j.ui.datepicker" : "jquery/jquery.ui/ui/ui.datepicker.js",
 83+ "$j.ui.progressbar" : "jquery/jquery.ui/ui/ui.progressbar.js",
 84+ "$j.ui.sortable" : "jquery/jquery.ui/ui/ui.sortable.js",
 85+ "$j.effects.clip" : "jquery/jquery.ui/ui/effects.clip.js",
 86+ "$j.effects.fold" : "jquery/jquery.ui/ui/effects.fold.js",
 87+ "$j.effects.shake" : "jquery/jquery.ui/ui/effects.shake.js",
 88+ "$j.ui.dialog" : "jquery/jquery.ui/ui/ui.dialog.js",
 89+ "$j.ui.resizable" : "jquery/jquery.ui/ui/ui.resizable.js",
 90+ "$j.ui.tabs" : "jquery/jquery.ui/ui/ui.tabs.js",
 91+ "$j.effects.core" : "jquery/jquery.ui/ui/effects.core.js",
 92+ "$j.effects.highlight" : "jquery/jquery.ui/ui/effects.highlight.js",
 93+ "$j.effects.slide" : "jquery/jquery.ui/ui/effects.slide.js",
 94+ "$j.ui.accordion" : "jquery/jquery.ui/ui/ui.accordion.js",
 95+ "$j.ui.draggable" : "jquery/jquery.ui/ui/ui.draggable.js",
 96+ "$j.ui.selectable" : "jquery/jquery.ui/ui/ui.selectable.js"
 97+
 98+} );
\ No newline at end of file
Index: branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html
@@ -3,13 +3,14 @@
44 <html>
55 <head>
66 <title>Sample Themed Player</title>
7 - <!-- Pre-loading demo ( stuff ) likely needed for video display
8 - <script type="text/javascript" src="../jsScriptLoader.php?class=window.jQuery,mwEmbed,$j.ui,mw.EmbedPlayer,nativeEmbed,ctrlBuilder,mvpcfConfig,kskinConfig,$j.fn.menu,$j.cookie,$j.ui.slider,mw.TimedText&debug=true"></script>
 7+ <!-- Pre-loading demo ( stuff ) likely needed for video display -->
 8+ <script type="text/javascript" src="../jsScriptLoader.php?class=mwEmbed,$j.ui,mw.EmbedPlayer,nativeEmbed,ctrlBuilder,mvpcfConfig,kskinConfig,$j.fn.menu,$j.cookie,$j.ui.slider,mw.TimedText"></script>
99 <link rel="stylesheet" href="../skins/styles.css" type="text/css" media="screen" />
1010 <link rel="stylesheet" href="../skins/mvpcf/playerSkin.css" type="text/css" media="screen" />
1111 <link rel="stylesheet" href="../skins/kskin/playerSkin.css" type="text/css" media="screen" />
12 - -->
 12+ <!--
1313 <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
 14+ -->
1415 </head>
1516 <script type="text/javascript">
1617 </script>
Index: branches/js2-work/phase3/js/mwEmbed/tests/Add_Media_Wizard.html
@@ -11,11 +11,16 @@
1212 border:medium none;
1313 }
1414 </style>
15 - <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
 15+ <!--
 16+ <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
 17+ -->
 18+
1619 <script type="text/javascript" src="../jsScriptLoader.php?class=window.jQuery,mwEmbed,mw.RemoteSearchDriver,$j.ui,$j.ui.resizable,$j.ui.draggable,$j.ui.dialog,$j.ui.tabs,$j.ui.sortable,$j.cookie,baseRemoteSearch&urid=1257728132531&debug=true&uselang=en"></script>
 20+
1721 <script type="text/javascript">
18 - mw.ready(function(){
 22+ mw.ready( function(){
1923 mw.load( 'AddMedia.addMediaWizard', function(){
 24+
2025 $j('#add_media_link').addMediaWizard( {
2126 'profile' : 'html_edit',
2227 'target_textbox' : '#wpTextbox1',
Index: branches/js2-work/phase3/js/mwEmbed/includes/jsClassLoader.php
@@ -32,16 +32,13 @@
3333 throw new MWException( "mwEmbed.js missing check \$wgMwEmbedDirectory path\n" );
3434 return false;
3535 }
 36+ // Read the mwEmbed loader file:
3637
37 - // Read the file:
38 - $fileContent = file_get_contents( $wgMwEmbedDirectory . 'mwEmbed.js' );
 38+ $fileContent = file_get_contents( $wgMwEmbedDirectory . 'loader.js' );
 39+
3940 // Get class paths from mwEmbed.js
4041 self::$directoryContext = $wgMwEmbedDirectory;
41 - preg_replace_callback(
42 - self::$classReplaceExp,
43 - 'jsClassLoader::preg_classPathLoader',
44 - $fileContent
45 - );
 42+ self::proccessLoaderContent( $fileContent );
4643
4744 // Get the list of enabled modules into $wgJSModuleList
4845 preg_replace_callback(
@@ -52,28 +49,38 @@
5350
5451 // Get all the classes from the loader files:
5552 foreach( self::$moduleList as $na => $moduleName){
56 - // Setup the directory context:
 53+ // Setup the directory context for mwEmbed modules:
5754 self::$directoryContext = $wgMwEmbedDirectory;
 55+
5856 self::proccessLoaderPath( $wgMwEmbedDirectory .
5957 'modules/' . $moduleName . '/loader.js' );
60 -
6158 }
6259
6360 // Get all the extension loader paths registered mwEmbed modules
6461 foreach( $wgExtensionJavascriptLoader as $na => $loaderPath){
65 - // Setup the directory context:
 62+ // Setup the directory context for extensions
6663 self::$directoryContext = 'extensions/' .str_replace('loader.js', '' , $loaderPath);
6764 self::proccessLoaderPath( $IP . '/extensions/' . $loaderPath );
6865 }
6966 }
7067 /**
71 - * Process a loader path
 68+ * Process a loader path, passes off to proccessLoaderContent
7269 *
7370 * @param String $path
7471 */
7572 private static function proccessLoaderPath( $path ){
 73+ // Get the loader content
7674 $fileContent = file_get_contents( $path );
77 -
 75+ self::proccessLoaderContent( $fileContent );
 76+ }
 77+ /**
 78+ * Process loader content
 79+ *
 80+ * parses the loader files and adds
 81+ *
 82+ * @param String $fileContent content of loader.js file
 83+ */
 84+ private static function proccessLoaderContent( & $fileContent ){
7885 // Add the mwEmbed loader js to its global collector:
7986 self::$combinedLoadersJs .= $fileContent;
8087
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js
@@ -255,7 +255,7 @@
256256 this.textSources = [ ];
257257 // Get local reference to all timed text sources: ( text/xml, text/x-srt etc )
258258 var inlineSources = this.embedPlayer.mediaElement.getSources( 'text' );
259 - //add all the sources to textSources
 259+ // Add all the sources to textSources
260260 for( var i = 0 ; i < inlineSources.length ; i++ ){
261261 // make a new textSource:
262262 var source = new TextSource( inlineSources[i] );
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/kalturaSearch.js
@@ -33,21 +33,18 @@
3434 * Runs an api call then calls addResults with the resulting data
3535 * @param {String} search_query Text search string
3636 */
37 - getSearchResults:function( search_query ) {
 37+ getProviderResults: function( search_query, callback ) {
3838 var _this = this;
3939
40 - // call parent for common initialisation:
41 - this.parent_getSearchResults();
42 -
4340 // setup the flickr request:
4441 var request = {
4542 's': search_query,
4643 'page': this.provider.offset/this.provider.limit + 1
4744 }
48 - mw.log( "Kaltura::getSearchResults query: " + request['s'] + " page: " + request['page']);
 45+ mw.log( "Kaltura::getProviderResults query: " + request['s'] + " page: " + request['page']);
4946 $j.getJSON( this.provider.api_url + '?callback=?', request, function( data ) {
5047 _this.addResults( data );
51 - _this.loading = false;
 48+ callback( 'ok' );
5249 } );
5350 },
5451
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/mediaWikiSearch.js
@@ -122,13 +122,11 @@
123123 *
124124 * @param {String} search_query Text search string
125125 */
126 - getSearchResults: function( search_query ) {
127 - // call parent for common initialisation:
128 - this.parent_getSearchResults();
 126+ getProviderResults: function( search_query, callback ) {
129127 // Set local ref:
130128 var _this = this;
131129
132 - mw.log( 'f:getSearchResults for:' + search_query );
 130+ mw.log( 'metavid: getProviderResults for:' + search_query );
133131
134132 // Build the image request
135133 var request = {
@@ -149,7 +147,7 @@
150148 mw.getJSON( this.provider.api_url, request, function( data ) {
151149 // Add result data:
152150 _this.addResults( data );
153 - _this.loading = false;
 151+ callback();
154152 } );
155153 },
156154
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/baseRemoteSearch.js
@@ -72,7 +72,7 @@
7373 * Does some common initialisation for search results
7474 * @param {String} search_query Text search string
7575 */
76 - getSearchResults: function( search_query ) {
 76+ getSearchResults: function( search_query , callback ) {
7777 // Empty out the current results before issuing a request
7878 this.resultsObj = { };
7979
@@ -80,11 +80,19 @@
8181 this.last_query = search_query;
8282 this.last_offset = this.provider.offset;
8383
84 - // Set the loading flag:
85 - this.loading = true;
 84+ // Get the provider specifc results
 85+ this.getProviderResults( search_query , callback);
8686 },
8787
8888 /**
 89+ * getProviderResults abstract method
 90+ */
 91+ getProviderResults: function( searchQuery , calback){
 92+ mw.log( 'Error: getProviderResults not set by provider' );
 93+ callback( 'error-provider' );
 94+ },
 95+
 96+ /**
8997 * Clears Results
9098 */
9199 clearResults:function() {
@@ -429,7 +437,7 @@
430438 */
431439 updateTargetResourceTitle:function( resource ) {
432440 if( resource.titleKey ){
433 - resource.target_resource_title = resource.titleKey.replace( /^(File:|Image:)/ , '' );
 441+ resource.target_resource_title = resource.titleKey.replace( /^(File:|Image:)/ , '' ).replace(':', '');
434442 resource.target_resource_title = this.provider.resource_prefix + resource.target_resource_title;
435443 }
436444 },
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/archiveOrgSearch.js
@@ -35,13 +35,10 @@
3636 *
3737 * @param {String} search_query Text search string
3838 */
39 - getSearchResults: function( search_query ) {
40 -
41 - // call parent for common initialization:
42 - this.parent_getSearchResults();
 39+ getProviderResults: function( search_query, callback ) {
4340
4441 var _this = this;
45 - mw.log( 'archive_org:getSearchResults for:' + search_query + ' from: ' + this.provider.api_url );
 42+ mw.log( 'archive_org:getProviderResults for:' + search_query + ' from: ' + this.provider.api_url );
4643
4744
4845 // For now force (Ogg video) & url based license
@@ -60,7 +57,7 @@
6158 }
6259 mw.getJSON( this.provider.api_url + '?json.wrf=?', request, function( data ) {
6360 _this.addResults( data );
64 - _this.loading = false;
 61+ callback( 'ok' );
6562 } );
6663 },
6764 /**
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/metavidSearch.js
@@ -30,15 +30,11 @@
3131 *
3232 * @param {String} search_query Text search string
3333 */
34 - getSearchResults: function( search_query ) {
35 -
36 - // Call parent for common initialisation:
37 - this.parent_getSearchResults();
38 -
 34+ getProviderResults: function( search_query, callback ) {
3935 // Set local ref:
4036 var _this = this;
4137
42 - mw.log( 'metavidSearch::getSearchResults()' );
 38+ mw.log( 'metavidSearch::getProviderResults()' );
4339
4440 // Process all options
4541 var url = this.provider.api_url;
@@ -90,7 +86,7 @@
9187 resource['license_template_tag'] = 'PD-USGov';
9288 }
9389 // done loading:
94 - _this.loading = 0;
 90+ callback( 'ok' );
9591 } );
9692 },
9793
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/flickrSearch.js
@@ -51,13 +51,11 @@
5252 * Runs an api call then calls addResults with the resulting data
5353 * @param {String} search_query Text search string
5454 */
55 - getSearchResults:function( search_query ) {
 55+ getProviderResults: function( search_query, callback ) {
5656 var _this = this;
57 - mw.log( "flickr::getSearchResults" );
 57+ mw.log( "flickr::getProviderResults" );
 58+
5859
59 - // call parent for common initialisation:
60 - this.parent_getSearchResults();
61 -
6260 // setup the flickr request:
6361 var request = {
6462 'method':'flickr.photos.search',
@@ -71,7 +69,7 @@
7270 }
7371 $j.getJSON( this.provider.api_url + '?jsoncallback=?', request, function( data ) {
7472 _this.addResults( data );
75 - _this.loading = false;
 73+ callback( 'ok' );
7674 } );
7775 },
7876 /**
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -161,8 +161,6 @@
162162 }
163163
164164 } )( jQuery );
165 -
166 -
167165 /**
168166 * Set the mediaWiki globals if unset
169167 */
@@ -1037,38 +1035,33 @@
10381036
10391037 // Else do showSearchTab
10401038 var provider = this.content_providers[ providerName ];
1041 -
 1039+
10421040 // Check if we need to update:
10431041 if ( typeof provider.sObj != 'undefined' ) {
10441042 if ( provider.sObj.last_query == $j( '#rsd_q' ).val()
1045 - && provider.sObj.last_offset == provider.offset )
1046 - {
 1043+ && provider.sObj.last_offset == provider.offset ) {
 1044+
10471045 mw.log( 'last query is: ' + provider.sObj.last_query +
1048 - ' matches: ' + $j( '#rsd_q' ).val() );
1049 - } else {
1050 - mw.log( 'last query is: ' + provider.sObj.last_query +
1051 - ' not match: ' + $j( '#rsd_q' ).val() );
1052 - draw_direct_flag = false;
 1046+ ' matches: ' + $j( '#rsd_q' ).val() + ' no search needed');
 1047+
 1048+ // Show search results directly
 1049+ this.showResults();
10531050 }
1054 - } else {
1055 - draw_direct_flag = false;
10561051 }
1057 -
1058 - if ( !draw_direct_flag ) {
1059 - // See if we should reset the paging
1060 - if ( resetPaging ) {
1061 - provider.offset = 0;
1062 - if (provider.sObj && provider.sObj.offset) {
1063 - provider.sObj.offset = 0;
1064 - }
 1052+
 1053+ // See if we should reset the paging
 1054+ if ( resetPaging ) {
 1055+ provider.offset = 0;
 1056+ if (provider.sObj && provider.sObj.offset) {
 1057+ provider.sObj.offset = 0;
10651058 }
1066 -
1067 - // Set the content to loading while we do the search:
1068 - $j( '#rsd_results_container' ).html( mw.loading_spinner() );
1069 -
1070 - // Make sure the search library is loaded and issue the search request
1071 - this.getLibSearchResults( provider );
10721059 }
 1060+
 1061+ // Set the content to loading while we do the search:
 1062+ $j( '#rsd_results_container' ).html( mw.loading_spinner() );
 1063+
 1064+ // Make sure the search library is loaded and issue the search request
 1065+ this.getProviderResults( provider );
10731066 },
10741067
10751068 /*
@@ -1171,15 +1164,15 @@
11721165 *
11731166 * @param {Object} provider the provider to be searched.
11741167 */
1175 - getLibSearchResults: function( provider ) {
 1168+ getProviderResults: function( provider ) {
11761169 var _this = this;
1177 - mw.log('f: getLibSearchResults ' );
 1170+ mw.log('f: getProviderResults ' );
11781171 // First check if we should even run the search at all (can we import / insert
11791172 // into the page? )
11801173 if ( !this.isProviderLocal( provider ) && this.import_url_mode == 'autodetect' ) {
11811174 // provider is not local check if we can support the import mode:
11821175 this.checkForCopyURLSupport( function() {
1183 - _this.getLibSearchResults( provider );
 1176+ _this.getProviderResults( provider );
11841177 } );
11851178 return false;
11861179 } else if ( !this.isProviderLocal( provider ) && this.import_url_mode == 'none' ) {
@@ -1188,23 +1181,29 @@
11891182 provider.sObj.loading = false;
11901183 } else {
11911184 $j( '#rsd_results_container' ).html(
1192 - '<div style="padding:10px">' +
1193 - gM( 'mwe-no_import_by_url' ) +
1194 - '</div>' );
 1185+ gM( 'mwe-no_import_by_url' )
 1186+ )
11951187 }
11961188 return false;
11971189 }
 1190+
11981191 _this.loadSearchLib( provider, function( provider ) {
1199 - // Do the search:
1200 - provider.sObj.getSearchResults( $j( '#rsd_q' ).val() );
1201 -
1202 - _this.waitForResults( function( resultStatus ) {
1203 - if( resultStatus == 'ok' ){
 1192+ var d = new Date();
 1193+ var searchTime = d.getMilliseconds();
 1194+ // Do the search:
 1195+ provider.sObj.getSearchResults( $j( '#rsd_q' ).val() , function( resultStatus ){
 1196+ //if( resultStatus == 'ok' ){
12041197 _this.showResults();
1205 - }else{
1206 - _this.showFailure( resultStatus )
1207 - }
1208 - } );
 1198+ //}else{
 1199+ // _this.showFailure( resultStatus )
 1200+ //}
 1201+ });
 1202+
 1203+ // Set a timeout of 20 seconds
 1204+ setTimeout(function(){
 1205+
 1206+ }, 20 * 1000 );
 1207+
12091208 } );
12101209 },
12111210
@@ -1242,49 +1241,6 @@
12431242 callback( provider );
12441243 } );
12451244 },
1246 -
1247 - /**
1248 - * Waits for all results to be finished then calls the callback
1249 - *
1250 - * @param {Function} callback called once loading is done. calls callback with:
1251 - * 'ok' search results retrived
1252 - * 'error_key' search results not retrived
1253 - * @param {Null} _callNumber Used internally to keep track of wait time
1254 - */
1255 - waitForResults: function( callback, _callNumber ) {
1256 - // mw.log('rsd:waitForResults');
1257 - var _this = this;
1258 - var loading_done = true;
1259 -
1260 - if( !_callNumber )
1261 - _callNumber = 1;
1262 -
1263 - for ( var cp_id in this.content_providers ) {
1264 - var cp = this.content_providers[ cp_id ];
1265 - if ( typeof cp['sObj'] != 'undefined' ) {
1266 - if ( cp.sObj.loading )
1267 - loading_done = false;
1268 - }
1269 - }
1270 - if( this.search_provider_timeout &&
1271 - (50/1000 * _callNumber) > this.search_provider_timeout ){
1272 - callback( 'timeout' )
1273 - return ;
1274 - }
1275 -
1276 - if ( loading_done ) {
1277 - callback( 'ok' );
1278 - return ;
1279 - }
1280 -
1281 - setTimeout(
1282 - function() {
1283 - _callNumber++;
1284 - _this.waitForResults( callback, _callNumber );
1285 - },
1286 - 50
1287 - );
1288 - },
12891245
12901246 /**
12911247 * Get a resource object from a resource id
@@ -1502,10 +1458,9 @@
15031459 /**
15041460 * Add Resource edit layout and display a loader.
15051461 */
1506 - addResourceEditLoader: function( maxWidth, overflowStyle ) {
 1462+ addResourceEditLoader: function( maxWidth ) {
15071463 var _this = this;
15081464 if ( !maxWidth ) maxWidth = 400;
1509 - if ( !overflowStyle ) overflowStyle = 'overflow:auto;';
15101465 // Remove any old instance:
15111466 $j( _this.target_container ).find( '#rsd_resource_edit' ).remove();
15121467
@@ -1513,24 +1468,53 @@
15141469 $j( '#rsd_results_container' ).hide();
15151470
15161471 var pt = $j( _this.target_container ).html();
 1472+
 1473+ // Set up the interface compoents:
 1474+ var $clipEditControl = $j('<div />')
 1475+ .attr( 'id', 'clip_edit_ctrl' )
 1476+ .addClass('ui-widget ui-widget-content ui-corner-all')
 1477+ .css( {
 1478+ 'position' : 'absolute',
 1479+ 'left' : '2px',
 1480+ 'top' : '5px',
 1481+ 'bottom' : '10px',
 1482+ 'width' : ( maxWidth + 5 ) + 'px',
 1483+ 'overflow' : 'auto',
 1484+ 'padding' : '5px'
 1485+ } )
 1486+ .loadingSpinner();
 1487+
 1488+ var $clipEditDisplay = $j('<div />')
 1489+ .attr( 'id', 'clip_edit_disp' )
 1490+ .addClass( 'ui-widget ui-widget-content ui-corner-all' )
 1491+ .css({
 1492+ 'position' : 'absolute',
 1493+ 'overflow' : 'auto;',
 1494+ 'left' : ( maxWidth + 25 ) + 'px',
 1495+ 'right' :'0px',
 1496+ 'top' : '5px',
 1497+ 'bottom' : '10px',
 1498+ 'padding' : '5px'
 1499+ })
 1500+ .loadingSpinner();
 1501+
 1502+
15171503 // Add the edit layout window with loading place holders
15181504 $j( _this.target_container ).append(
1519 - '<div id="rsd_resource_edit" ' +
1520 - 'style="position:absolute;top:0px;left:0px;' +
1521 - 'bottom:0px;right:4px;background-color:#FFF;"> ' +
1522 - '<div id="clip_edit_ctrl" ' +
1523 - 'class="ui-widget ui-widget-content ui-corner-all" ' +
1524 - 'style="position:absolute;left:2px;top:5px;bottom:10px;' +
1525 - 'width:' + ( maxWidth + 5 ) + 'px;overflow:auto;padding:5px;" >' +
1526 - '</div>' +
1527 - '<div id="clip_edit_disp" ' +
1528 - 'class="ui-widget ui-widget-content ui-corner-all"' +
1529 - 'style="position:absolute;' + overflowStyle + ';' +
1530 - 'left:' + ( maxWidth + 20 ) + 'px;right:0px;top:5px;bottom:10px;' +
1531 - 'padding:5px;" >' +
1532 - mw.loading_spinner( 'position:absolute;top:30px;left:30px' ) +
1533 - '</div>' +
1534 - '</div>' );
 1505+ $j('<div />')
 1506+ .attr( 'id', 'rsd_resource_edit' )
 1507+ .css( {
 1508+ 'position' : 'absolute',
 1509+ 'top' : '0px',
 1510+ 'left' : '0px',
 1511+ 'bottom' : '0px',
 1512+ 'right' : '4px',
 1513+ 'background-color' : '#FFF'
 1514+ } ).append(
 1515+ $clipEditControl,
 1516+ $clipEditDisplay
 1517+ )
 1518+ );
15351519 },
15361520
15371521 /**
@@ -1586,10 +1570,8 @@
15871571 var mediaType = _this.getMediaType( resource );
15881572 var maxWidth = _this.getMaxEditWidth( resource );
15891573
1590 - // So that transcripts show on top
1591 - var overflow_style = ( mediaType == 'video' ) ? '' : 'overflow:auto;';
15921574 // Append to the top level of model window:
1593 - _this.addResourceEditLoader( maxWidth, overflow_style );
 1575+ _this.addResourceEditLoader( maxWidth );
15941576 // update add media wizard title:
15951577 var dialogTitle = gM( 'mwe-add_media_wizard' ) + ': ' +
15961578 gM( 'rsd_resource_edit', resource.title );
@@ -2047,10 +2029,10 @@
20482030 'left:50%;bottom:0px;top:30px;right:0px;overflow:auto;">' +
20492031 '<strong>' + gM( 'mwe-local_resource_title' ) + '</strong>' +
20502032 '<br/>' +
2051 - '<input type="text" size="30" value="' + resource.target_resource_title + '" />' +
 2033+ '<input id="rsd_filename" type="text" size="30" value="' + resource.target_resource_title + '" />' +
20522034 '<br/>' +
20532035 '<strong>' + gM( 'mwe-edit_resource_desc' ) + '</strong>' +
2054 - '<textarea id="rsd_import_ta" ' +
 2036+ '<textarea id="rsd_import_text" ' +
20552037 'style="width:90%;" rows="8" cols="50">' +
20562038 desc +
20572039 '</textarea>' +
@@ -2095,7 +2077,7 @@
20962078 $j( '#rsd_import_desc' ).html( mw.loading_spinner() );
20972079 // load the preview text:
20982080 _this.parse(
2099 - $j( '#rsd_import_ta' ).val(),
 2081+ $j( '#rsd_import_text' ).val(),
21002082 _this.canonicalFileNS + ':' + resource.target_resource_title,
21012083 function( o ) {
21022084 mw.log( 'got updated preview: ' );
@@ -2110,13 +2092,7 @@
21112093 mw.log( "do import asset:" + _this.import_url_mode );
21122094 // check import mode:
21132095 if ( _this.import_url_mode == 'api' ) {
2114 - if ( _this.upload_api_target == 'proxy' ) {
2115 - _this.setupProxy( function() {
2116 - _this.doApiImport( resource, callback );
2117 - } );
2118 - } else {
2119 - _this.doApiImport( resource, callback );
2120 - }
 2096+ _this.doApiImport( resource, callback );
21212097 } else {
21222098 mw.log( "Error: import mode is not form or API (can not copy asset)" );
21232099 }
@@ -2243,9 +2219,9 @@
22442220 // Close the loader now that we are ready to present the progress dialog::
22452221 mw.closeLoaderDialog();
22462222 uploader.doHttpUpload( {
2247 - 'url': resource.src,
2248 - 'filename': resource.target_resource_title,
2249 - 'comment': $j( '#rsd_import_ta' ).val()
 2223+ 'url' : resource.src,
 2224+ 'filename' : $j( '#rsd_filename' ).val(),
 2225+ 'comment' : $j( '#rsd_import_text' ).val()
22502226 } );
22512227 } );
22522228 }
@@ -2305,7 +2281,7 @@
23062282 'right' : '0px',
23072283 'left' : '0px',
23082284 'background-color' : '#FFF'
2309 - })
 2285+ }).loadingSpinner()
23102286 )
23112287
23122288 var buttonPaneSelector = _this.target_container + '~ .ui-dialog-buttonpane';
@@ -2338,9 +2314,12 @@
23392315
23402316 // Get the preview wikitext
23412317 var embed_code = _this.getEmbedCode( resource );
2342 - $j( _this.target_textbox ).textSelection( 'encapsulateSelection', { 'post' : embed_code } );
 2318+ //var pos = $j( _this.target_textbox ).getCaretPosition();
 2319+ var pos = 0;
 2320+ var editWikiText = $j( _this.target_textbox ).val();
 2321+ var parseText = editWikiText.substr(0, pos) + embed_code + editWikiText.substr( pos );
23432322 _this.parse(
2344 - $j( _this.target_textbox ).val(),
 2323+ parseText,
23452324 _this.target_title,
23462325 function( phtml ) {
23472326 $j( '#rsd_preview_display' ).html( phtml );
Index: branches/js2-work/phase3/js/mwEmbed/modules/ClipEdit/mw.ClipEdit.js
@@ -641,7 +641,7 @@
642642 .buttonHover()
643643 .click( function() {
644644 _this.applyEdit();
645 - _this.controlActionsCallback['insert_seq']( _this.resource );
 645+ _this.controlActionsCallback[ 'insert_seq' ]( _this.resource );
646646 } );
647647 break;
648648 case 'insert':
@@ -659,7 +659,7 @@
660660 .buttonHover()
661661 .click( function() {
662662 _this.applyEdit();
663 - _this.controlActionsCallback['preview']( _this.resource );
 663+ _this.controlActionsCallback[ 'preview' ]( _this.resource );
664664 } ).show( 'slow' );
665665 break;
666666 case 'cancel':
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js
@@ -31,39 +31,11 @@
3232 var MW_EMBED_VERSION = '1.0';
3333
3434 /**
35 -* The set of modules that you want enable.
36 -*
37 -* Each enabledModules array value should be a name
38 -* of a folder in mwEmbed/modules
39 -*
40 -* Modules must define a loader.js file in the root
41 -* of the module folder.
42 -*
43 -* The loader file should be short and only include:
44 -* Class paths of the module classes
45 -* Sytle sheets of the module
46 -* Loader function(s) that load module classes
47 -*
48 -* When using the scriptLoader the enabledModules loader code
49 -* is transcluded into base mwEmbed class include.
50 -*/
51 -var mwEnabledModuleList = [
52 - 'AddMedia',
53 - 'ClipEdit',
54 - 'EmbedPlayer',
55 - 'ApiProxy',
56 - 'Sequencer',
57 - 'TimedText'
58 -];
59 -
60 -/**
6135 * Default global config values. Configuration values are set via mw.setConfig
6236 * Configuration values should generally be set prior to dom-ready
6337 */
6438 var mwDefaultConf = {
6539
66 - 'enabledModules' : mwEnabledModuleList,
67 -
6840 // Default skin name
6941 'skinName' : 'mvpcf',
7042
@@ -930,7 +902,7 @@
931903 mw.log( 'Empty load request: ' + loadRequest );
932904 callback( loadRequest );
933905 return ;
934 - }
 906+ }
935907
936908 // Check if its a multi-part request:
937909 if( typeof loadRequest == 'object' ){
@@ -941,9 +913,7 @@
942914 // If an array of length 1 set as first element
943915 loadRequest = loadRequest[0];
944916 }
945 - }
946 - //Add the string loadRequest callback ( for script-loader onDone callback )
947 - mwLoadDoneCB[ loadRequest ] = callback;
 917+ }
948918
949919 // Check for the module name loader function
950920 if( this.moduleLoaders[ loadRequest ] &&
@@ -1026,9 +996,8 @@
1027997 loadDone = false;
1028998 }
1029999 // Run the parent scope callback for "loadMany"
1030 - if( loadDone && callback && mwLoadDoneCB[ loadName ] != 'done' ){
1031 - callback( loadName );
1032 - mwLoadDoneCB[ loadName ] = 'done';
 1000+ if( loadDone ){
 1001+ callback( loadName );
10331002 }
10341003 } );
10351004 }
@@ -1172,23 +1141,25 @@
11731142 }
11741143
11751144 // Include class defined check for older browsers
1176 - var classDone = false;
 1145+ var classDone = false;
11771146
 1147+ // Set the top level load done to the callback
 1148+ mw.setLoadDoneCB( className, callback );
 1149+
11781150 // Issue the request to load the class (include class name in result callback:
1179 - mw.getScript( scriptRequest, function( scriptRequest ) {
1180 - if(! mw.isset( className ) && callback){
 1151+ mw.getScript( scriptRequest, function( scriptRequest ) {
 1152+ // Debug output
 1153+ if(! mw.isset( className )
 1154+ && mwLoadDoneCB[ className ] != 'done' ){
11811155 mw.log( 'Possible Error: ' + className +' not set in time, or not defined in:' + "\n" + _this.getClassPath( className ) );
11821156 }
1183 - // make sure callback is set and mwLoadDoneCB has not been called
1184 - if( callback ){
1185 - callback( className );
1186 - }
1187 - callback = null;
 1157+ // Call load done (incase the script did not include a loadDone callback )
 1158+ mw.loadDone( className );
11881159 } );
11891160 //mw.log( 'done with running getScript request ' );
11901161
11911162 /*
1192 - * If scriptLoader is not enabled
 1163+ * ( If scriptLoader is not enabled )
11931164 *
11941165 * Check if the class is ready:
11951166 * ( not all browsers support onLoad script attribute )
@@ -1196,11 +1167,9 @@
11971168 */
11981169 if( !mw.getScriptLoaderPath() ){
11991170 setTimeout( function(){
1200 - mw.waitForObject( className, function( className ){
1201 - if( callback ){
1202 - callback( className );
1203 - callback = null;
1204 - }
 1171+ mw.waitForObject( className, function( className ){
 1172+ // Once object is ready run loadDone
 1173+ mw.loadDone( className );
12051174 } );
12061175 }, 25 );
12071176 }
@@ -1277,13 +1246,21 @@
12781247 * Load done callback for script loader
12791248 * this way webkit browsers don't have to check if variables are "ready"
12801249 */
1281 - mw.loadDone = function( requestName ) {
1282 - mw.log( "LoadDone: " + requestName );
 1250+ mw.loadDone = function( requestName ) {
12831251 if( mwLoadDoneCB[ requestName ] && mwLoadDoneCB[ requestName ] != 'done'){
 1252+ mw.log( "LoadDone: " + requestName + ' run callback ');
12841253 mwLoadDoneCB[ requestName ]( requestName );
12851254 mwLoadDoneCB[ requestName ] = 'done';
12861255 }
12871256 },
 1257+ /**
 1258+ * Set a load done callback
 1259+ * @param {String} requestName Name of class or request set
 1260+ * @param {Function} callback Function called once requestName is ready
 1261+ */
 1262+ mw.setLoadDoneCB = function( requestName, callback ){
 1263+ mwLoadDoneCB[ requestName ] = callback;
 1264+ }
12881265
12891266 /**
12901267 * Add module entry point: Adds a module to the mwLoader object
@@ -1371,7 +1348,7 @@
13721349 if( !data['format'] )
13731350 data['format'] = 'json';
13741351
1375 - mw.log("run getJSON: " + url + ' data: ' + data['action'] );
 1352+ mw.log("run getJSON: " + mw.replaceUrlParams(url, data ) );
13761353
13771354 // Check if we need to setup proxy or do the request as a "post"
13781355 if( $j.inArray( data['action'], mw.getConfig( 'apiPostActions' ) ) != -1 ){
@@ -1490,6 +1467,13 @@
14911468 mw.addDialog( msg_txt, msg_txt + '<br>' + mw.loading_spinner() );
14921469 }
14931470
 1471+ /*mw.status = function( status )
 1472+
 1473+
 1474+ var Status = function(){
 1475+
 1476+ }*/
 1477+
14941478 /**
14951479 * Add a dialog window:
14961480 * @param {String} title Title string for the dialog
@@ -1590,7 +1574,7 @@
15911575 callback( false );
15921576 return ;
15931577 }
1594 -
 1578+ // If the object is defined ( or we are done loading from a callback )
15951579 if ( mw.isset( objectName ) || mwLoadDoneCB[ objectName ] == 'done' ){
15961580 callback( objectName )
15971581 }else{
@@ -2242,42 +2226,37 @@
22432227
22442228 mw.log( 'mw:setupMwEmbed :: ' + mw.getMwEmbedSrc() );
22452229
2246 - // Make sure jQuery is loaded
2247 - mw.load( 'window.jQuery', function(){
2248 -
2249 - if ( !window['$j'] ) {
2250 - window['$j'] = jQuery.noConflict();
2251 - }
2252 -
2253 - mw.log(" loadded all ~loaders~ " );
2254 -
2255 - mw.setConfig( 'jquery_skin_path', mw.getMwEmbedPath() + 'jquery/jquery.ui/themes/' + mw.getConfig( 'jui_skin' ) + '/' );
2256 -
2257 - // Only load jquery ui theme sheet if ui-widget does not exist.
2258 - if( ! mw.styleRuleExists( 'ui-widget' ) ){
2259 - mw.getStyleSheet( mw.getConfig( 'jquery_skin_path' ) + 'jquery-ui-1.7.1.custom.css' );
2260 - }
2261 -
2262 - mw.setConfig( 'skin_img_path', mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/images/' );
2263 - mw.setConfig( 'default_video_thumb', mw.getConfig( 'skin_img_path' ) + 'vid_default_thumb.jpg' );
2264 -
2265 - // Make Core skin/style sheets are always available:
2266 - mw.getStyleSheet( mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/styles.css' );
2267 -
2268 - // Set up AJAX to not send dynamic URLs for loading scripts
2269 - $j.ajaxSetup( {
2270 - cache: true
2271 - } );
2272 -
2273 - //Update the magic keywords
2274 - mw.lang.magicSetup();
2275 -
2276 - // Set up mvEmbed utility jQuery bindings
2277 - mwDojQueryBindings();
2278 -
2279 - //Make sure we have all the module loaders
2280 - mw.moduleLoaderCheck( function(){
2281 -
 2230+ // Make sure we have all the module loaders
 2231+ mw.moduleLoaderCheck( function(){
 2232+ // Make sure we have jQuery:
 2233+ mw.load( 'window.jQuery', function(){
 2234+ if ( !window['$j'] ) {
 2235+ window['$j'] = jQuery.noConflict();
 2236+ }
 2237+ mw.setConfig( 'jquery_skin_path', mw.getMwEmbedPath() + 'jquery/jquery.ui/themes/' + mw.getConfig( 'jui_skin' ) + '/' );
 2238+
 2239+ // Only load jquery ui theme sheet if ui-widget does not exist.
 2240+ if( ! mw.styleRuleExists( 'ui-widget' ) ){
 2241+ mw.getStyleSheet( mw.getConfig( 'jquery_skin_path' ) + 'jquery-ui-1.7.1.custom.css' );
 2242+ }
 2243+
 2244+ mw.setConfig( 'skin_img_path', mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/images/' );
 2245+ mw.setConfig( 'default_video_thumb', mw.getConfig( 'skin_img_path' ) + 'vid_default_thumb.jpg' );
 2246+
 2247+ // Make Core skin/style sheets are always available:
 2248+ mw.getStyleSheet( mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/styles.css' );
 2249+
 2250+ // Set up AJAX to not send dynamic URLs for loading scripts
 2251+ $j.ajaxSetup( {
 2252+ cache: true
 2253+ } );
 2254+
 2255+ //Update the magic keywords
 2256+ mw.lang.magicSetup();
 2257+
 2258+ // Set up mvEmbed utility jQuery bindings
 2259+ mwDojQueryBindings();
 2260+
22822261 // Check DOM for tag-rewrites
22832262 if( mw.documentHasPlayerTags() ){
22842263 // Load the embedPlayer module ( then run queued hooks )
@@ -2297,7 +2276,9 @@
22982277
22992278 /**
23002279 * Check for module loaders
2301 - * loads module loaders if we are not using a scriptLoader entry point
 2280+ * loads module loaders.
 2281+ *
 2282+ * Note if using a scriptLoader all the loaders are included automatically.
23022283 */
23032284 mw.moduleLoaderCheck = function( callback ){
23042285 mw.log( 'doLoaderCheck::' );
@@ -2306,17 +2287,19 @@
23072288 callback();
23082289 return ;
23092290 }
2310 -
2311 - // Load all the "loaders" of the enabled modules:
2312 - var loaderRequest = [];
2313 - var enabledModules = mw.getConfig( 'enabledModules' );
2314 - $j.each( enabledModules, function( na, module_name ){
2315 - loaderRequest.push( 'modules/' + module_name + '/loader.js' );
2316 - })
2317 - mw.setConfig('loaderContext', '' );
2318 - mw.load( loaderRequest, function(){
2319 - callback();
2320 - } );
 2291+ // Add the Core loader to the request
 2292+ mw.load( 'loader.js', function(){
 2293+ // Load all the "loaders" of the enabled modules:
 2294+ var loaderRequest = [];
 2295+ var enabledModules = mw.getConfig( 'enabledModules' );
 2296+ for(var i=0; i < enabledModules.length; i++ ){
 2297+ loaderRequest.push( 'modules/' + enabledModules[ i ] + '/loader.js' );
 2298+ };
 2299+ mw.setConfig('loaderContext', '' );
 2300+ mw.load( loaderRequest, function(){
 2301+ callback();
 2302+ } );
 2303+ } );
23212304 }
23222305
23232306 /**
@@ -2404,66 +2387,7 @@
24052388 // Setup legacy global shortcuts:
24062389 var loadRS = mw.lang.loadRS;
24072390
2408 -/**
2409 -* -- Load Class Paths --
2410 -*
2411 -* PHP AutoLoader reads this mwEmbed.js file along with
2412 -* all the "loader.js" files to determin script-loader
2413 -* class paths
2414 -*
2415 -*/
2416 -mw.setConfig('loaderContext', '' );
24172391
2418 -mw.addClassFilePaths( {
2419 - "mwEmbed" : "mwEmbed.js",
2420 - "window.jQuery" : "jquery/jquery-1.3.2.js",
2421 -
2422 - "ctrlBuilder" : "skins/ctrlBuilder.js",
2423 - "kskinConfig" : "skins/kskin/kskinConfig.js",
2424 - "mvpcfConfig" : "skins/mvpcf/mvpcfConfig.js",
2425 -
2426 - "$j.fn.pngFix" : "jquery/plugins/jquery.pngFix.js",
2427 - "$j.fn.autocomplete": "jquery/plugins/jquery.autocomplete.js",
2428 - "$j.fn.hoverIntent" : "jquery/plugins/jquery.hoverIntent.js",
2429 - "$j.fn.datePicker" : "jquery/plugins/jquery.datePicker.js",
2430 - "$j.ui" : "jquery/jquery.ui/ui/ui.core.js",
2431 -
2432 - "mw.testLang" : "tests/testLang.js",
2433 -
2434 - "$j.cookie" : "jquery/plugins/jquery.cookie.js",
2435 - "$j.contextMenu" : "jquery/plugins/jquery.contextMenu.js",
2436 - "$j.fn.suggestions" : "jquery/plugins/jquery.suggestions.js",
2437 - "$j.fn.textSelection" : "jquery/plugins/jquery.textSelection.js",
2438 - "$j.browserTest" : "jquery/plugins/jquery.browserTest.js",
2439 -
2440 - "$j.effects.blind" : "jquery/jquery.ui/ui/effects.blind.js",
2441 - "$j.effects.drop" : "jquery/jquery.ui/ui/effects.drop.js",
2442 - "$j.effects.pulsate" : "jquery/jquery.ui/ui/effects.pulsate.js",
2443 - "$j.effects.transfer" : "jquery/jquery.ui/ui/effects.transfer.js",
2444 - "$j.ui.droppable" : "jquery/jquery.ui/ui/ui.droppable.js",
2445 - "$j.ui.slider" : "jquery/jquery.ui/ui/ui.slider.js",
2446 - "$j.effects.bounce" : "jquery/jquery.ui/ui/effects.bounce.js",
2447 - "$j.effects.explode" : "jquery/jquery.ui/ui/effects.explode.js",
2448 - "$j.effects.scale" : "jquery/jquery.ui/ui/effects.scale.js",
2449 - "$j.ui.datepicker" : "jquery/jquery.ui/ui/ui.datepicker.js",
2450 - "$j.ui.progressbar" : "jquery/jquery.ui/ui/ui.progressbar.js",
2451 - "$j.ui.sortable" : "jquery/jquery.ui/ui/ui.sortable.js",
2452 - "$j.effects.clip" : "jquery/jquery.ui/ui/effects.clip.js",
2453 - "$j.effects.fold" : "jquery/jquery.ui/ui/effects.fold.js",
2454 - "$j.effects.shake" : "jquery/jquery.ui/ui/effects.shake.js",
2455 - "$j.ui.dialog" : "jquery/jquery.ui/ui/ui.dialog.js",
2456 - "$j.ui.resizable" : "jquery/jquery.ui/ui/ui.resizable.js",
2457 - "$j.ui.tabs" : "jquery/jquery.ui/ui/ui.tabs.js",
2458 - "$j.effects.core" : "jquery/jquery.ui/ui/effects.core.js",
2459 - "$j.effects.highlight" : "jquery/jquery.ui/ui/effects.highlight.js",
2460 - "$j.effects.slide" : "jquery/jquery.ui/ui/effects.slide.js",
2461 - "$j.ui.accordion" : "jquery/jquery.ui/ui/ui.accordion.js",
2462 - "$j.ui.draggable" : "jquery/jquery.ui/ui/ui.draggable.js",
2463 - "$j.ui.selectable" : "jquery/jquery.ui/ui/ui.selectable.js"
2464 -
2465 -} );
2466 -
2467 -
24682392 /**
24692393 * Add the core mvEmbed Messages ( will be localized by script server )
24702394 */
Index: branches/js2-work/phase3/js/loader.js
@@ -0,0 +1,12 @@
 2+/**
 3+* Loader to support dynamic loading of mediaWiki js pages
 4+*/
 5+
 6+mw.setConfig('loaderContext', wgScriptPath + '/js/');
 7+
 8+mw.addClassFilePaths( {
 9+ 'uploadPage' => 'js/uploadPage.js',
 10+ 'editPage' => 'js/editPage.js',
 11+ 'ajaxCategories' => 'js/ajaxcategories.js',
 12+ 'apiProxyPage' => 'js/apiProxyPage.js'
 13+} );
\ No newline at end of file

Status & tagging log