here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge...
[lhc/web/wiklou.git] / js2 / editPage.js
1 /*
2 * js2 style replacement for mediaWiki edit.js
3 */
4 //setup configuration vars:
5 if(!mwAddMediaConfig)
6 var mwAddMediaConfig = {
7 'profile':'mediawiki_edit',
8 'target_textbox': '#wpTextbox1',
9 //note selections in the textbox will take over the default query
10 'default_query': wgTitle,
11 'target_title':wgPageName,
12 //here we can setup the conten provider overides
13 'cpconfig': {},
14
15 //the local wiki api url:
16 'local_wiki_api_url': wgServer + wgScriptPath + '/api.php'
17 };
18
19
20 mwAddOnloadHook( function(){
21 mwEditPageHelper.init();
22 });
23 var mwEditPageHelper = {
24 init:function(){
25 var _this = this;
26 //@@todo check for new version of toolbar and add properly:
27 if(typeof $j.fn.toolbar == 'undefined'){
28 //add the add-media-wizard button for old toolbar:
29 $j('#toolbar').append('<img style="cursor:pointer" id="btn-add-media-wiz" src="' + mv_skin_img_path + 'Button_add_media.png">');
30 $j('#btn-add-media-wiz').addMediaWiz(
31 mwAddMediaConfig
32 );
33 }
34 }
35 }