The Demopaedia team will be present at the next International Population Conference in Busan.
If you attend the conference, please, come to our oral communication which will be held on Tuesday August 27, from 15:30 to 17:00 (Bexco, room 213). The new Korean dictionary will also be presented in a side meeting organized by the Planned Population Federation of Korea (PPFK) on "Population Issues & Official development assistance" (open to all) at 19:00 (Bexco, room 110).

Difference between revisions of "MediaWiki:Gadget-citations.js"

From Demopædia
Jump to: navigation, search
m (Back to org.)
m
 
Line 31: Line 31:
 
cbButton.type="submit";
 
cbButton.type="submit";
 
originalAction=document.getElementById('editform').getAttribute('action');
 
originalAction=document.getElementById('editform').getAttribute('action');
cbButton.setAttribute("onmousedown", " document.getElementById('editform').setAttribute('action', 'http://tools.demopaedia.eu/~brouard/Bot/citation-bot/text.php')");
+
cbButton.setAttribute("onmousedown", " document.getElementById('editform').setAttribute('action', 'http://tools.demopaedia.org/~brouard/Bot/citation-bot/text.php')");
cbButton.setAttribute("onkeydown", " document.getElementById('editform').setAttribute('action', 'http://tools.demopaedia.eu/~brouard/Bot/citation-bot/text.php')");
+
cbButton.setAttribute("onkeydown", " document.getElementById('editform').setAttribute('action', 'http://tools.demopaedia.org/~brouard/Bot/citation-bot/text.php')");
 
diff.setAttribute("onmousedown", originalAction);
 
diff.setAttribute("onmousedown", originalAction);
 
diff.setAttribute("onkeydown", originalAction);
 
diff.setAttribute("onkeydown", originalAction);

Latest revision as of 17:23, 1 October 2012

/*  _____________________________________________________________________________
 * |                                                                             |
 * |                    === WARNING: GLOBAL GADGET FILE ===                      |
 * |                  Changes to this page affect many users.                    |
 * | Please discuss changes on the talk page or on [[WT:Gadget]] before editing. |
 * |_____________________________________________________________________________|
 *
 * Imported from version 1.0 as of 17:18, 9 April 2011 (UTC) from [[User:Smith609/citations.js]]
 * Adds a "Citation bot" link to the toolbox, and a button beneath edit fields, see [[User:Smith609/citations]]
 * Ported to demopaedia
 */

// @Version 1.0 - Adds an "Expand citations" link to the toolbox, and a button beneath edit fields.

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

   addPortletLink("p-tb", "http://tools.demopaedia.org/~brouard/Bot/citation-bot/doibot.php?edit=toolbar&slow=1&user="+encodeURIComponent(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.demopaedia.org/~brouard/Bot/citation-bot/text.php')");
	 cbButton.setAttribute("onkeydown", " document.getElementById('editform').setAttribute('action', 'http://tools.demopaedia.org/~brouard/Bot/citation-bot/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);
	}

}
addOnloadHook(addCitationBot);
if( skin == "myskin" || skin == "simple" || skin == "monobook" || skin == "modern" || skin == "chick" || skin == "vector") {
  addOnloadHook(addCBToToolbox);
}