From: Michael Dale Date: Fri, 2 Oct 2009 05:47:19 +0000 (+0000) Subject: * moved remote oggHandler code to remoteMwEmbed.js X-Git-Tag: 1.31.0-rc.0~39418 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=2bbdfbfba380b533cebb613cdf84af252d0f8ad2;p=lhc%2Fweb%2Fwiklou.git * moved remote oggHandler code to remoteMwEmbed.js * refactored skin system should soon be possible to have two player skins in a single page. * stubs to restore k-skin functionality * restored some broken pieces of mwEmbedRemote --- diff --git a/js2/editPage.js b/js2/editPage.js index 1c87a922cc..b3e3995655 100644 --- a/js2/editPage.js +++ b/js2/editPage.js @@ -1,51 +1,51 @@ /* * JS2-style replacement for MediaWiki edit.js - * @todo port the rest of it to here + * (right now it just supports the toolbar) */ -// Setup configuration vars -if( !mwAddMediaConfig ) { - var mwAddMediaConfig = { +// Setup configuration vars (if not set already) +if( !mwAddMediaConfig ) + var mwAddMediaConfig = {}; + +//The default editPage AMW config +var defaultAddMediaConfig = { 'profile': 'mediawiki_edit', 'target_textbox': '#wpTextbox1', // Note: selections in the textbox will take over the default query 'default_query': wgTitle, 'target_title': wgPageName, // Here we can setup the content provider overrides - 'enabled_cps':['wiki_commons'], + 'enabled_cps':['wiki_commons'], // The local wiki API URL: 'local_wiki_api_url': wgServer + wgScriptPath + '/api.php' - }; -} - +}; js2AddOnloadHook( function() { - mwEditPageHelper.init(); + mwEditPageHelper.init( + $j.extend( true, defaultAddMediaConfig, mwAddMediaConfig ) + ); }); var mwEditPageHelper = { - init: function() { - var _this = this; - //@@todo check for a new version of the toolbar and via toolbar API - - // Kind of tricky, it would be nice to use a "loader" call here to avoid concurrency issues. + init: function( amwConf ) { + var _this = this; + // kind of tricky, it would be nice to use run on ready "loader" call here if( typeof $j.wikiEditor != 'undefined' ) { setTimeout( function() { $j( '.wikiEditor-ui [rel=file]' ).unbind().addMediaWiz( - mwAddMediaConfig + amwConf ); - }, - 100 ); + }, 100 ); } else { // Add the add-media-wizard button for old toolbar: $j( '#toolbar' ).append( '' ); + mv_skin_img_path + 'Button_add_media.png">' ); $j( '#btn-add-media-wiz' ).addMediaWiz( - mwAddMediaConfig + amwConf ); } // Add to new toolbar (need to use api) /*$j( '[rel=insert] tool-file' ).addMediaWiz( - mwAddMediaConfig + mwAddMediaConfig );*/ } } diff --git a/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html b/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html index 4eb0dd0ff8..d40c9cbc9b 100644 --- a/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html +++ b/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html @@ -2,8 +2,8 @@ Firefogg - Make Ogg Video in your Browser - - + +