From 17e2e2545f2fd3607a14238ecee25eb7a605ce84 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 10 Jun 2011 20:26:04 +0200 Subject: Moved behavioural functions into it's own object and file JavaScript functions adding behaviours based on IDs or class names where moved to their own object into behaviour.js and where jQueryized. --- lib/scripts/script.js | 82 --------------------------------------------------- 1 file changed, 82 deletions(-) (limited to 'lib/scripts/script.js') diff --git a/lib/scripts/script.js b/lib/scripts/script.js index 20e475190..9b9ca600c 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -471,34 +471,6 @@ function closePopups(){ } } -/** - * Looks for an element with the ID scroll__here at scrolls to it - */ -function scrollToMarker(){ - var obj = $('scroll__here'); - if(obj) obj.scrollIntoView(); -} - -/** - * Looks for an element with the ID focus__this at sets focus to it - */ -function focusMarker(){ - var obj = $('focus__this'); - if(obj) obj.focus(); -} - -/** - * Remove messages - */ -function cleanMsgArea(){ - var elems = getElementsByClass('(success|info|error)',document,'div'); - if(elems){ - for(var i=0; i tag has the class "quickselect", this script will - * automatically submit its parent form when the select value changes. - * It also hides the submit button of the form. - * - * @author Andreas Gohr - */ -addInitEvent(function(){ - var selects = getElementsByClass('quickselect',document,'select'); - for(var i=0; i - */ -function checkWindowsShares() { - if(!LANG['nosmblinks']) return true; - if(document.all != null) return true; - - var elems = getElementsByClass('windows',document,'a'); - if(elems){ - for(var i=0; i - */ -addInitEvent(function(){ - checkWindowsShares(); -}); /** * Highlight the section when hovering over the appropriate section edit button -- cgit v1.2.3 From d7ead0093374b7233de1dc1df47aa10ac39facfb Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 16 Jun 2011 18:43:49 +0200 Subject: fix console check in Internet Explorer --- lib/scripts/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/scripts/script.js') diff --git a/lib/scripts/script.js b/lib/scripts/script.js index 9b9ca600c..a673cdc02 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -13,7 +13,7 @@ if ('function' === typeof jQuery && 'function' === typeof jQuery.noConflict) { * @param msg optional message to print */ function DEPRECATED(msg){ - if(!console) return; + if(!window.console) return; if(!arguments.callee) return; var func = arguments.callee.caller.name; -- cgit v1.2.3 From c949174a2e8c324e3e463a9d10e9e6dc07b0ba9e Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Wed, 22 Jun 2011 21:05:17 +0200 Subject: Fix and refactor ajax.js * Move file to qsearch.js * Rename object to dw_qsearch * Remove unnecessary usage of Delay * Use $ prefix for jQuery objects * Fix result list hiding on click * Fix namespace shorting --- lib/scripts/script.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/scripts/script.js') diff --git a/lib/scripts/script.js b/lib/scripts/script.js index a673cdc02..8adba829c 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -28,6 +28,21 @@ function DEPRECATED(msg){ if(console.trace) console.trace(); } +/** + * Construct a wrapper function for deprecated function names + * + * This function returns a wrapper function which just calls DEPRECATED + * and the new function. + * + * @param func The new function + * @param context Optional; The context (`this`) of the call + */ +function DEPRECATED_WRAP(func, context) { + return function () { + DEPRECATED(); + return func.apply(context || this, arguments); + } +} /** * Some of these scripts were taken from wikipedia.org and were modified for DokuWiki -- cgit v1.2.3