Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js |
— | — | @@ -1308,7 +1308,7 @@ |
1309 | 1309 | if( !data['format'] ) |
1310 | 1310 | data['format'] = 'json'; |
1311 | 1311 | |
1312 | | - mw.log("run getJSON: " + url + ' data: ' + data['action'] + ' apiPost: ' +mw.getConfig( 'apiPostActions' ) ); |
| 1312 | + mw.log("run getJSON: " + url + ' data: ' + data['action'] ); |
1313 | 1313 | |
1314 | 1314 | if( $j.inArray( data['action'], mw.getConfig( 'apiPostActions' ) ) != -1 ){ |
1315 | 1315 | if( ! mw.isLocalDomain( url ) ){ |
— | — | @@ -1421,17 +1421,21 @@ |
1422 | 1422 | } |
1423 | 1423 | |
1424 | 1424 | /** |
1425 | | - * add a dialog window: |
| 1425 | + * Add a dialog window: |
| 1426 | + * @param {String} title Title string for the dialog |
| 1427 | + * @param {String} msg_txt String to be inserted in msg box |
| 1428 | + * @param {Mixed} buttons A button object for the dialog |
| 1429 | + * Can be 'ok' for oky button. |
1426 | 1430 | */ |
1427 | | - mw.addDialog = function ( title, msg_txt, btn ) { |
| 1431 | + mw.addDialog = function ( title, msg_txt, buttons ) { |
1428 | 1432 | $j( '#mwe_tmp_loader' ).remove(); |
1429 | | - // append the style free loader ontop: |
| 1433 | + // Append the style free loader ontop: |
1430 | 1434 | $j( 'body' ).append( '<div id="mwe_tmp_loader" style="display:none" title="' + title + '" >' + |
1431 | 1435 | msg_txt + |
1432 | 1436 | '</div>' ); |
1433 | 1437 | // special btn == ok gives empty give a single "oky" -> "close" |
1434 | | - if ( btn == 'ok' ) { |
1435 | | - btn[ gM( 'mwe-ok' ) ] = function() { |
| 1438 | + if ( buttons == 'ok' ) { |
| 1439 | + buttons[ gM( 'mwe-ok' ) ] = function() { |
1436 | 1440 | $j( '#mwe_tmp_loader' ).close(); |
1437 | 1441 | } |
1438 | 1442 | } |
— | — | @@ -1445,12 +1449,12 @@ |
1446 | 1450 | ] |
1447 | 1451 | ], function() { |
1448 | 1452 | $j( '#mwe_tmp_loader' ).dialog( { |
1449 | | - bgiframe: true, |
1450 | | - draggable: false, |
1451 | | - resizable: false, |
1452 | | - modal: true, |
1453 | | - width:400, |
1454 | | - buttons: btn |
| 1453 | + 'bgiframe': true, |
| 1454 | + 'draggable': false, |
| 1455 | + 'resizable': false, |
| 1456 | + 'modal': true, |
| 1457 | + 'width':400, |
| 1458 | + 'buttons': buttons |
1455 | 1459 | } ); |
1456 | 1460 | } ); |
1457 | 1461 | } |