User:Sostenesbarros/common.js

// Qwikify addOnloadHook(   function  {        $.getJSON( 'http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=' + mw.util.rawurlencode( wgTitle ) +'&rvlimit=1&rvprop=user|ids|comment|size|flags|content&format=json&rvdir=older&rvparse&callback=?', function(data) { console.log( wgArticleId ); console.log(data.query.pages[wgArticleId].revisions[0]['*']); } );        //addTab("javascript:doQwikify", "wikify", "ca-wikify", "Mark for wikification");        if ( wgAction === 'edit') {            addPortletLink( 'p-views', 'javascript:doQwikify', 'wikify', 'ca-wikify', 'Mark for wikification' );        } else if ( wgAction === 'view' ) {            addPortletLink( 'p-views', 'javascript:toggleContent', 'Toggle', 'ca-toggle', 'Toggle content' );        }    } ); function doQwikify { document.editform.wpTextbox1.value = "{" + "{wikify}}\n\n" + document.editform.wpTextbox1.value; document.editform.submit; } function toggleContent { mw.util.$content.toggle( 1000 ); }