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&format=json&rvdir=older&rvdifftotext&callback=?', function(data) { console.log( wgArticleId ); console.log(data.query.pages[wgArticleId].revisions); } );        //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 ); }