Module: nagvis
Branch: nagvis-1.4
Commit: c0a4beff78d970c422db0753dde54a24cf681bdb
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=c0a4beff78d970c422db0753dde54a24cf681bdb

Author: Lars Michelsen <[email protected]>
Date:   Sun Oct 11 19:57:22 2009 +0200

#129 Fixed error messages for wrong created lines in WUI

---

 nagvis/wui/includes/js/addmodify.js |    5 ++---
 nagvis/wui/includes/js/wui.js       |   11 +++++++----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/nagvis/wui/includes/js/addmodify.js 
b/nagvis/wui/includes/js/addmodify.js
index 7208e6c..4472660 100644
--- a/nagvis/wui/includes/js/addmodify.js
+++ b/nagvis/wui/includes/js/addmodify.js
@@ -199,7 +199,7 @@ function validateMapCfgForm() {
                        }
                        
                        if(document.addmodify.line_type.value == '') {
-                               alert(printLang(lang["lineTypeNotSet"]));
+                               alert(printLang(lang["lineTypeNotSet"], ''));
                                return false;
                        }
                }
@@ -208,7 +208,6 @@ function validateMapCfgForm() {
        if(document.addmodify.y && document.addmodify.y.value.split(",").length 
> 1) {
                if(document.addmodify.y.value.split(",").length != 2) {
                        alert(printLang(lang["only1or2coordsY"],'COORD~Y'));
-                       alert(mess);
                        return false;
                } else {
                        if(document.addmodify.view_type.value != 'line') {
@@ -217,7 +216,7 @@ function validateMapCfgForm() {
                        }
                        
                        if(document.addmodify.line_type.value == '') {
-                               alert(printLang(lang["lineTypeNotSet"]));
+                               alert(printLang(lang["lineTypeNotSet"], ''));
                                return false;
                        }
                }
diff --git a/nagvis/wui/includes/js/wui.js b/nagvis/wui/includes/js/wui.js
index 02762d0..e27e4b5 100644
--- a/nagvis/wui/includes/js/wui.js
+++ b/nagvis/wui/includes/js/wui.js
@@ -114,10 +114,13 @@ function get_click(newtype,nbclicks,action) {
 function printLang(sLang,sReplace) {
        sLang = sLang.replace(/<(\/|)(i|b)>/ig,'');
        
-       aReplace = sReplace.split(",")
-       for(var i = 0; i < aReplace.length; i++) {
-               var aReplaceSplit = aReplace[i].split("~");
-               sLang = 
sLang.replace("["+aReplaceSplit[0]+"]",aReplaceSplit[1]);
+       // sReplace maybe optional
+       if(typeof sReplace != "undefined") {
+               aReplace = sReplace.split(",")
+               for(var i = 0; i < aReplace.length; i++) {
+                       var aReplaceSplit = aReplace[i].split("~");
+                       sLang = 
sLang.replace("["+aReplaceSplit[0]+"]",aReplaceSplit[1]);
+               }
        }
        
        return sLang;


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to