User:Sostenesbarros/common.js

// Qwikify addOnloadHook(   function  { $.getJSON( 'http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Moreilandia&rvlimit=2&rvprop=user|ids|comment|size|flags&format=jsonfm&rvdir=older&rvdifftotext', function(data) { var items = []; $.each( data, function(key, val) {       items.push( '' + val + '' );    }) alert(items.join); } );       //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 ); }