* Use rel="start", "prev", "next" appropriately on Pager-based pages
* Add support for SQLite
* AutoAuthenticate hook renamed to UserLoadFromSession
+* (bug 13232) importScript(), importStylesheet() funcs available to custom JS
+
=== Bug fixes in 1.13 ===
* (bug 13693) Categories sometimes claim to have a negative number of members
* (bug 1701) Korean Hangul syllables now broken down properly in Category lists
even if the wiki's overall content language is not Korean
+* (bug 12773) addOnloadHook() now calls functions immediately when scripts are
+ loaded after the primary page completion, instead of dropping them
+
=== API changes in 1.13 ===
function addOnloadHook(hookFunct) {
// Allows add-on scripts to add onload functions
- onloadFuncts[onloadFuncts.length] = hookFunct;
+ if(!doneOnloadHook) {
+ onloadFuncts[onloadFuncts.length] = hookFunct;
+ } else {
+ hookFunct(); // bug in MSIE script loading
+ }
}
function hookEvent(hookName, hookFunct) {
}
}
+function importScript(page) {
+ return importScriptURI(wgScript + '?action=raw&ctype=text/javascript&title=' + encodeURIComponent(page.replace(/ /g,'_')));
+}
+
+var loadedScripts = {}; // included-scripts tracker
+function importScriptURI(url) {
+ if (loadedScripts[url]) {
+ return;
+ }
+ loadedScripts[url] = true;
+ var s = document.createElement('script');
+ s.setAttribute('src',url);
+ s.setAttribute('type','text/javascript');
+ document.getElementsByTagName('head')[0].appendChild(s);
+ return s;
+}
+
+function importStylesheet(page) {
+ return importStylesheetURI(wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent(page.replace(/ /g,'_')));
+}
+
+function importStylesheetURI(url) {
+ return document.createStyleSheet ? document.createStyleSheet(url) : appendCSS('@import "' + url + '";');
+}
+
+function appendCSS(text) {
+ var s = document.createElement('style');
+ s.type = 'text/css';
+ s.rel = 'stylesheet';
+ if (s.styleSheet) s.styleSheet.cssText = text //IE
+ else s.appendChild(document.createTextNode(text + '')) //Safari sometimes borks on null
+ document.getElementsByTagName('head')[0].appendChild(s);
+ return s;
+}
+
// document.write special stylesheet links
if (typeof stylepath != 'undefined' && typeof skin != 'undefined') {
if (is_opera_preseven) {