Hi, How to perform cross-wiki script importing?
I tried with *importScript('w:Mediawiki:rules.js');* on ml.wikibooks, but not working.
Thank you.
Am 31.10.2010 05:35, schrieb Junaid P V:
Hi, How to perform cross-wiki script importing?
I tried with *importScript('w:Mediawiki:rules.js');* on ml.wikibooks, but not working.
Thank you.
Try something like
importScriptURI('http://ml.wikipedia.org/w/index.php?title=Mediawiki:rules.js%E2%80%8E&ac...');
Raymond.
On 31 October 2010 12:36, Raimond Spekking raimond.spekking@gmail.comwrote:
Am 31.10.2010 05:35, schrieb Junaid P V:
Hi, How to perform cross-wiki script importing?
I tried with *importScript('w:Mediawiki:rules.js');* on ml.wikibooks,
but
not working.
Thank you.
Try something like
importScriptURI(' http://ml.wikipedia.org/w/index.php?title=Mediawiki:rules.js &action=raw&ctype=text/javascript');
It helped to accomplish the task.
Thank you Raimond Spekking.
Raimond Spekking <raimond.spekking <at> gmail.com> writes:
Try something like
importScriptURI('http://ml.wikipedia.org/w/index.php?title=Mediawiki:rules.js%E2%80%8E&ac...');
That will break HTTPS security though. I use this script on my home wiki:
function importScriptIw(page, lang, project) { if (lang in ['commons', 'meta']) { project = 'wikimedia'; } else { project = project || 'wikipedia'; } if (window.location.protocol == 'https:') { var scriptPath = 'https://secure.wikimedia.org/' + project + '/' + lang + '/w/index.php'; } else { var scriptPath = 'http://' + lang + '.' + project + '.org/w/index.php'; } var uri = scriptPath + ("?title=" + encodeURIComponent(page.replace(/ /g, "_")).replace(/%2F/gi, "/").replace(/%3A/gi, ":") + "&action=raw&ctype=text/javascript"); return importScriptURI(uri); }
importScriptIw('Mediawiki:rules.js', 'ml');
On 11/01/2010 09:29 AM, Tisza Gergő wrote:
Raimond Spekking<raimond.spekking<at> gmail.com> writes:
Try something like importScriptURI('http://ml.wikipedia.org/w/index.php?title=Mediawiki:rules.js%E2%80%8E&ac...');
That will break HTTPS security though. I use this script on my home wiki:
Here's another one from http://commons.wikimedia.org/wiki/User:Ilmari_Karonen/monobook.js:
/** * Load a script from another Wikimedia wiki. Based on importScript() in wikibits.js. * Does the right thing also when used via the secure server. * * Usage example: importScriptFromWiki("User:Ilmari Karonen/replace.js", "en", "wikipedia"); * * Leave the third parameter empty for wikis like meta or commons that have ".wikimedia.org" * host names but belong internally to the "wikipedia" group for historical reasons! */ function importScriptFromWiki(page, lang, domain) { if (wgServer == 'https://secure.wikimedia.org') { if (!domain) domain = 'wikipedia'; var prefix = '/' + domain + '/' + lang; } else { if (!domain) domain = 'wikimedia'; var prefix = 'http://' + lang + '.' + domain + '.org'; if (prefix == wgServer) prefix = ""; } var uri = prefix + '/w/index.php?title=' + encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') + '&action=raw&ctype=text/javascript'; return importScriptURI(uri); }
wikitech-l@lists.wikimedia.org