diff options
author | Kate Arzamastseva <pshns@ukr.net> | 2011-06-04 18:59:05 +0300 |
---|---|---|
committer | Kate Arzamastseva <pshns@ukr.net> | 2011-06-04 18:59:05 +0300 |
commit | 8d56551e75f273694893a29a06d8164d3d60ae17 (patch) | |
tree | 80c181cbb7b4df28fe7691a2dd48fd6761dbe785 /lib/scripts/script.js | |
parent | e4f389ef1728a0f86164a0e4b88626be9860dabb (diff) | |
parent | 0f80b0bcd4ca247f7bc4c3830946741546ad6e88 (diff) | |
download | rpg-8d56551e75f273694893a29a06d8164d3d60ae17.tar.gz rpg-8d56551e75f273694893a29a06d8164d3d60ae17.tar.bz2 |
Merge remote-tracking branch 'upstream/master' into media-revisions
Diffstat (limited to 'lib/scripts/script.js')
-rw-r--r-- | lib/scripts/script.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/scripts/script.js b/lib/scripts/script.js index 2cc1246f9..20e475190 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -1,3 +1,34 @@ +// if jQuery was loaded, let's make it noConflict here. +if ('function' === typeof jQuery && 'function' === typeof jQuery.noConflict) { + jQuery.noConflict(); +} + +/** + * Mark a JavaScript function as deprecated + * + * This will print a warning to the JavaScript console (if available) in + * Firebug and Chrome and a stack trace (if available) to easily locate the + * problematic function call. + * + * @param msg optional message to print + */ +function DEPRECATED(msg){ + if(!console) return; + if(!arguments.callee) return; + + var func = arguments.callee.caller.name; + var line = 'DEPRECATED function call '+func+'(). '+msg; + + if(console.warn){ + console.warn(line); + }else{ + console.log(line); + } + + if(console.trace) console.trace(); +} + + /** * Some of these scripts were taken from wikipedia.org and were modified for DokuWiki */ @@ -25,6 +56,8 @@ if (clientPC.indexOf('opera')!=-1) { * @link http://prototype.conio.net/ */ function $() { + DEPRECATED('Please use the JQuery() function instead.'); + var elements = new Array(); for (var i = 0; i < arguments.length; i++) { |