Utilizador:Bawolff/common.js: diferenças entre revisões
Aspeto
Conteúdo apagado Conteúdo adicionado
Sem resumo de edição |
Sem resumo de edição |
||
Linha 1: | Linha 1: | ||
if (!window.console) window.console = { log: jsMsg } |
if (!window.console) window.console = { log: jsMsg } |
||
function |
function addButton2() { |
||
console.log('The code inside of addButton() was executed.'); |
console.log('The code inside of addButton() was executed.'); |
||
} |
} |
||
Linha 8: | Linha 8: | ||
mw.loader.using( 'ext.wikiEditor.toolbar', function () { |
mw.loader.using( 'ext.wikiEditor.toolbar', function () { |
||
console.log('"$( addButton )" was executed inside of mw.loader.using( \'ext.wikiEditor.toolbar\'...'); |
console.log('"$( addButton )" was executed inside of mw.loader.using( \'ext.wikiEditor.toolbar\'...'); |
||
⚫ | |||
console.log( "addButton: " + addButton.toString() ); |
|||
⚫ | |||
} ); |
} ); |
||
} |
} |
||
if( mw.config.get( 'wgAction' ) === 'edit' ) { |
if( mw.config.get( 'wgAction' ) === 'edit' ) { |
||
console.log( "mw.util.wikiScript('api')=" + mw.util.wikiScript('api') ); |
|||
$.getJSON( |
$.getJSON( |
||
mw.util.wikiScript('api'), |
mw.util.wikiScript('api'), |
||
'format=json&action=query&prop=revisions&rvprop=content&rvlimit=1&indexpageids=1&titles=Teste', |
'format=json&action=query&prop=revisions&rvprop=content&rvlimit=1&indexpageids=1&titles=Teste', |
||
function ( data ) { |
function ( data ) { |
||
console.log( 'Data to process: ' + data.query.pages[ data.query.pageids[0] ].revisions[0]['*'] ); |
|||
processText( data.query.pages[ data.query.pageids[0] ].revisions[0]['*'] ); |
processText( data.query.pages[ data.query.pageids[0] ].revisions[0]['*'] ); |
||
} |
} |
Revisão das 03h25min de 17 de março de 2012
if (!window.console) window.console = { log: jsMsg }
function addButton2() {
console.log('The code inside of addButton() was executed.');
}
function processText( text ) {
mw.loader.using( 'ext.wikiEditor.toolbar', function () {
console.log('"$( addButton )" was executed inside of mw.loader.using( \'ext.wikiEditor.toolbar\'...');
$( addButton2 );
} );
}
if( mw.config.get( 'wgAction' ) === 'edit' ) {
$.getJSON(
mw.util.wikiScript('api'),
'format=json&action=query&prop=revisions&rvprop=content&rvlimit=1&indexpageids=1&titles=Teste',
function ( data ) {
processText( data.query.pages[ data.query.pageids[0] ].revisions[0]['*'] );
}
);
}