[Mapbender-commits] r8657 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Jun 14 01:59:26 PDT 2013
Author: schaef
Date: 2013-06-14 01:59:26 -0700 (Fri, 14 Jun 2013)
New Revision: 8657
Modified:
trunk/mapbender/http/javascripts/mod_key.php
Log:
removed commit error
Modified: trunk/mapbender/http/javascripts/mod_key.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_key.php 2013-06-14 08:48:22 UTC (rev 8656)
+++ trunk/mapbender/http/javascripts/mod_key.php 2013-06-14 08:59:26 UTC (rev 8657)
@@ -26,23 +26,23 @@
$res = db_prep_query($sql, $v, $t);
$cnt = 0;
while($row = db_fetch_array($res)){
- $ids[$cnt] = $row["e_id"];
- $elements[$cnt] = $row["e_element"];
- $cnt++;
+ $ids[$cnt] = $row["e_id"];
+ $elements[$cnt] = $row["e_element"];
+ $cnt++;
}
echo "var mb_key_elements = new Array(";
for($i=0; $i < count($elements); $i++){
- if($i > 0){
- echo ",";
- }
- echo "'".$elements[$i]."'";
+ if($i > 0){
+ echo ",";
+ }
+ echo "'".$elements[$i]."'";
}
echo ");";
echo "var mb_key_ids = new Array(";
for($i=0; $i < count($ids); $i++){
- if($i > 0){ echo ",";}
- echo "'".$ids[$i]."'";
+ if($i > 0){ echo ",";}
+ echo "'".$ids[$i]."'";
}
echo ");";
?>
@@ -50,55 +50,55 @@
mb_registerInitFunctions('mod_key_init()');
//}
function mod_key_init(){
- for(var i=0; i<mb_key_elements.length; i++){
- if(mb_key_elements[i] == "body"){
- $('body').focus();
- $(document).bind('keydown', function(e) {
- var tag = e.target.tagName.toLowerCase();
- if (tag != 'input' && tag != 'textarea') {
- mod_key_Keyhandler(e);
- }
- });
- }
- else {
- $(document.getElementById(mb_key_ids[i]).contentWindow.document).keydown(function(e) {
- var currentKeyId = mb_key_ids[i];
- var tag = e.target.tagName.toLowerCase();
- if (tag != 'input' && tag != 'textarea') {
- mod_key_Keyhandler(e, currentKeyId);
- }
- });
- }
- }
+ for(var i=0; i<mb_key_elements.length; i++){
+ if(mb_key_elements[i] == "body"){
+ $('body').focus();
+ $(document).bind('keydown', function(e) {
+ var tag = e.target.tagName.toLowerCase();
+ if (tag != 'input' && tag != 'textarea') {
+ mod_key_Keyhandler(e);
+ }
+ });
+ }
+ else {
+ $(document.getElementById(mb_key_ids[i]).contentWindow.document).keydown(function(e) {
+ var currentKeyId = mb_key_ids[i];
+ var tag = e.target.tagName.toLowerCase();
+ if (tag != 'input' && tag != 'textarea') {
+ mod_key_Keyhandler(e, currentKeyId);
+ }
+ });
+ }
+ }
}
function mod_key_Keyhandler(event, frameName){
- if(frameName){
- var code = eval("window.frames['"+frameName+"'].event.keyCode");
- focus();
- }
- else{
- var code = event.keyCode;
- }
- //console.log(code);
- if(code == 187 || code == 107 || code == 171){
- zoom(mod_key_map,true, '2.0');
- }
- if(code == 189 || code == 109 || code == 173){
- zoom(mod_key_map,false, '2.0');
- }
- if(code == 32 || code == 13){
- setMapRequest(mod_key_map);
- }
- if(code == 37){
- mb_panMap(mod_key_map,"W");
- }
- if(code == 38){
- mb_panMap(mod_key_map,"N");
- }
- if(code == 39){
- mb_panMap(mod_key_map,"E");
- }
- if(code == 40){
- mb_panMap(mod_key_map,"S");
- }
+ if(frameName){
+ var code = eval("window.frames['"+frameName+"'].event.keyCode");
+ focus();
+ }
+ else{
+ var code = event.keyCode;
+ }
+ //console.log(code);
+ if(code == 187 || code == 107 || code == 171){
+ zoom(mod_key_map,true, '2.0');
+ }
+ if(code == 189 || code == 109 || code == 173){
+ zoom(mod_key_map,false, '2.0');
+ }
+ if(code == 32 || code == 13){
+ setMapRequest(mod_key_map);
+ }
+ if(code == 37){
+ mb_panMap(mod_key_map,"W");
+ }
+ if(code == 38){
+ mb_panMap(mod_key_map,"N");
+ }
+ if(code == 39){
+ mb_panMap(mod_key_map,"E");
+ }
+ if(code == 40){
+ mb_panMap(mod_key_map,"S");
+ }
}
More information about the Mapbender_commits
mailing list