Oníṣe:T Cells/citations.js

Lát'ọwọ́ Wikipedia, ìwé ìmọ̀ ọ̀fẹ́

Àkíyèsí: Lẹ́yìn ìmúpamọ́, ó ṣe é ṣe kó jẹ́ pé ẹ gbọ́dọ̀ fo cache agbétàkùn yín láti rí àwọn àtúnṣe.

  • Firefox / Safari: Ẹ di Shift mú bí ẹ ṣe ún tẹ Reload, tàbí kí ẹ tẹ Ctrl-F5 tàbí Ctrl-R (⌘-R lórí Mac)
  • Google Chrome: Ẹ tẹ Ctrl-Shift-R (⌘-Shift-R lórí Mac)
  • Internet Explorer: Ẹ di Ctrl mú bí ẹ ṣe ún tẹ Refresh, tàbí kí ẹ tẹ Ctrl-F5
  • Opera: Ẹ lọ sí Menu→Settings (Opera → Preferences lórí Mac) lẹ́yìn náà ẹ lọ sí Privacy & security → Clear browsing data → Cached images and files
// @Version 1.0 - Adds a "Citation bot" link to the toolbox, and a button beneath edit fields.

function addCBToToolbox() {
  if (mw.config.get('wgCanonicalNamespace') !== "Special") {
   var pTb = document.getElementById("p-tb");
   if( !pTb ) return;
   var escPageName = encodeURIComponent(mw.config.get('wgPageName'));

   mw.util.addPortletLink("p-tb", "//tools.wmflabs.org/citations/process_page.php?edit=Smith609&slow=1&user="+encodeURIComponent(mw.config.get('wgUserName'))+"&page="+escPageName, 'Expand citations', '', "Expand citations and fix common formatting errors");
    }
}

// Add a citation bot button
function addCitationBot() {
	if (document.getElementById('wpDiff')){
	 var diff = document.getElementById('wpDiff');
	 var cbButton = document.createElement("input");
	 cbButton.value="Citations";
	 cbButton.type="submit";
	 originalAction=document.getElementById('editform').getAttribute('action');
	 cbButton.setAttribute("onmousedown", " document.getElementById('editform').setAttribute('action', 'http://tools.wmflabs.org/citations/text.php')");
	 cbButton.setAttribute("onkeydown", " document.getElementById('editform').setAttribute('action', 'http://tools.wmflabs.org/citations/text.php')");
	 diff.setAttribute("onmousedown", originalAction);
	 diff.setAttribute("onkeydown", originalAction);
	 document.getElementById('wpPreview').setAttribute("onmousedown", originalAction);
	 document.getElementById('wpPreview').setAttribute("onkeydown", originalAction);
	 document.getElementById('wpSave').setAttribute("onmousedown", originalAction);
	 document.getElementById('wpSave').setAttribute("onkeydown", originalAction);
	 diff.parentNode.insertBefore(cbButton, diff.nextSibling);
	}

}
$( addCitationBot );
if( $.inArray( mw.config.get('skin'), ["myskin" , "simple" , "monobook" , "modern", "chick" , "vector" ] ) !== -1 ) {
  $( addCBToToolbox );
}