2 * JS2-style replacement for MediaWiki edit.js
3 * @todo port the rest of it to here
6 // Setup configuration vars
7 if( !mwAddMediaConfig
)
8 var mwAddMediaConfig
= {
9 'profile': 'mediawiki_edit',
10 'target_textbox': '#wpTextbox1',
11 // Note: selections in the textbox will take over the default query
12 'default_query': wgTitle
,
13 'target_title': wgPageName
,
14 // Here we can setup the content provider overrides
16 // The local wiki API URL:
17 'local_wiki_api_url': wgServer
+ wgScriptPath
+ '/api.php'
21 js2AddOnloadHook( function() {
22 mwEditPageHelper
.init();
24 var mwEditPageHelper
= {
27 //@@todo check for a new version of the toolbar and via toolbar API
29 // Kind of tricky, it would be nice to use a "loader" call here to avoid concurrency issues.
30 if( typeof $j
.wikiEditor
!= 'undefined' ) {
31 setTimeout( function() {
32 $j( '.wikiEditor-ui [rel=file]' ).unbind().addMediaWiz(
37 // Add the add-media-wizard button for old toolbar:
38 $j( '#toolbar' ).append( '<img style="cursor:pointer" id="btn-add-media-wiz" src="' +
39 mv_skin_img_path
+ 'Button_add_media.png">' );
40 $j( '#btn-add-media-wiz' ).addMediaWiz(
45 // Add to new toolbar (need to use api)
46 /*$j( '[rel=insert] tool-file' ).addMediaWiz(