Module: nagvis Branch: master Commit: 7c5e8d2aabb71287479cb417a813338e5803cb0c URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=7c5e8d2aabb71287479cb417a813338e5803cb0c
Author: Lars Michelsen <[email protected]> Date: Sun Oct 11 19:57:22 2009 +0200 #129 Fixed error messages for wrong created lines in WUI --- share/frontend/wui/includes/js/addmodify.js | 5 ++--- share/frontend/wui/includes/js/wui.js | 11 +++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/share/frontend/wui/includes/js/addmodify.js b/share/frontend/wui/includes/js/addmodify.js index 7208e6c..4472660 100644 --- a/share/frontend/wui/includes/js/addmodify.js +++ b/share/frontend/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/share/frontend/wui/includes/js/wui.js b/share/frontend/wui/includes/js/wui.js index 02762d0..e27e4b5 100644 --- a/share/frontend/wui/includes/js/wui.js +++ b/share/frontend/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
