User:Cenarium/protect-icon.js

/*

// function to create html elements function create(htmlStr) { var frag = document.createDocumentFragment, temp = document.createElement('div'); temp.innerHTML = htmlStr; while (temp.firstChild) { frag.appendChild(temp.firstChild); }   return frag; }

// protected icon html var fragment = create('  ');

// insert if ( $.inArray( 'Wikipedia protected pages', mw.config.get('wgCategories') ) !== -1 ) { document.getElementById("bodyContent").insertBefore(fragment, document.getElementById("bodyContent").childNodes[0]); }