summaryrefslogtreecommitdiff
path: root/lib/scripts/behaviour.js
diff options
context:
space:
mode:
authorAdrian Lang <mail@adrianlang.de>2011-06-21 16:19:14 +0200
committerAdrian Lang <mail@adrianlang.de>2011-06-21 16:19:14 +0200
commitea62f4ffebfd23e0e697adc135da0b414d851926 (patch)
treeba363bb1eb7ec30c992b3bcf8c2967fcbdb8bb2b /lib/scripts/behaviour.js
parent2e5fe8c36b4c40fa6c96a09e234ce922182a761d (diff)
downloadrpg-ea62f4ffebfd23e0e697adc135da0b414d851926.tar.gz
rpg-ea62f4ffebfd23e0e697adc135da0b414d851926.tar.bz2
Cleanup behaviour.js
* Add var statement for dw_behaviour * Use live instead of click for smb share warnings
Diffstat (limited to 'lib/scripts/behaviour.js')
-rw-r--r--lib/scripts/behaviour.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js
index 31b82050e..62c20eb0f 100644
--- a/lib/scripts/behaviour.js
+++ b/lib/scripts/behaviour.js
@@ -1,3 +1,6 @@
+/*jslint sloppy: true */
+/*global jQuery, LANG, document, alert */
+
/**
* Automatic behaviours
*
@@ -6,7 +9,7 @@
* class was found
*/
-dw_behaviour = {
+var dw_behaviour = {
init: function(){
dw_behaviour.focusMarker();
@@ -22,15 +25,16 @@ dw_behaviour = {
*/
scrollToMarker: function(){
var obj = jQuery('#scroll__here');
- if(obj.length) obj[0].scrollIntoView();
+ if(obj.length) {
+ obj[0].scrollIntoView();
+ }
},
/**
* Looks for an element with the ID focus__this at sets focus to it
*/
focusMarker: function(){
- var obj = jQuery('#focus__this');
- if(obj.length) obj[0].focus();
+ jQuery('#focus__this').focus();
},
/**
@@ -78,11 +82,13 @@ dw_behaviour = {
* @author Michael Klier <chi@chimeric.de>
*/
checkWindowsShares: function() {
- if(!LANG['nosmblinks']) return true;
- if(document.all != null) return true;
+ if(!LANG.nosmblinks || document.all !== null) {
+ // No warning requested or none necessary
+ return;
+ }
- jQuery('a.windows').click(function(){
- alert(LANG['nosmblinks']);
+ jQuery('a.windows').live('click', function(){
+ alert(LANG.nosmblinks);
});
}