summaryrefslogtreecommitdiff
path: root/lib/scripts/script.js
diff options
context:
space:
mode:
authorKate Arzamastseva <pshns@ukr.net>2011-06-24 11:32:51 +0300
committerKate Arzamastseva <pshns@ukr.net>2011-06-24 11:32:51 +0300
commita2dc299eb0593f35454deb21a2cb5d51a235e80a (patch)
tree5b14bf906bbd13495826ebbe86d3af1c8fd88f71 /lib/scripts/script.js
parent70c3cc9a17d47d8986cba0805d943c1a68af1740 (diff)
parentc949174a2e8c324e3e463a9d10e9e6dc07b0ba9e (diff)
downloadrpg-a2dc299eb0593f35454deb21a2cb5d51a235e80a.tar.gz
rpg-a2dc299eb0593f35454deb21a2cb5d51a235e80a.tar.bz2
Merge branch 'master' of git://github.com/splitbrain/dokuwiki into media-revisions
Diffstat (limited to 'lib/scripts/script.js')
-rw-r--r--lib/scripts/script.js99
1 files changed, 16 insertions, 83 deletions
diff --git a/lib/scripts/script.js b/lib/scripts/script.js
index 20e475190..8adba829c 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;
@@ -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
@@ -472,34 +487,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<elems.length; i++){
- elems[i].style.display = 'none';
- }
- }
-}
-
-/**
* disable multiple revisions checkboxes if two are checked
*
* @author Anika Henke <anika@selfthinker.org>
@@ -528,60 +515,6 @@ addInitEvent(function(){
}
});
-/**
- * Autosubmit quick select forms
- *
- * When a <select> 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 <andi@splitbrain.org>
- */
-addInitEvent(function(){
- var selects = getElementsByClass('quickselect',document,'select');
- for(var i=0; i<selects.length; i++){
- // auto submit on change
- addEvent(selects[i],'change',function(e){
- this.form.submit();
- });
- // hide submit buttons
- var btns = selects[i].form.getElementsByTagName('input');
- for(var j=0; j<btns.length; j++){
- if(btns[j].type == 'submit'){
- btns[j].style.display = 'none';
- }
- }
- }
-});
-
-/**
- * Display error for Windows Shares on browsers other than IE
- *
- * @author Michael Klier <chi@chimeric.de>
- */
-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<elems.length; i++){
- var share = elems[i];
- addEvent(share,'click',function(){
- alert(LANG['nosmblinks']);
- });
- }
- }
-}
-
-/**
- * Add the event handler for the Windows Shares check
- *
- * @author Michael Klier <chi@chimeric.de>
- */
-addInitEvent(function(){
- checkWindowsShares();
-});
/**
* Highlight the section when hovering over the appropriate section edit button