var ALERT_TYPE_OK="OK"; var ALERT_TYPE_ERROR="ERROR"; var ALERT_TYPE_WARN="WARN"; var ALERT_TYPE_INFO="INFO"; // Longitud por defecto del fragmento var maxlong = 80; // separadores validos para romper la cadena var separadores = new Array(3); separadores[0]=' '; separadores[1]='.'; separadores[2]=','; /** * function separador(caracter) * Indica si el caracter pasado como parametro es un caracter separador (true) o no (false) **/ function separador2(caracter){ var esSeparador = false; for (i=0;i=maxlong+pos) pos++; else break; } return maxlong+pos; } function fncAlert(strMensaje, tipoMensaje, funcionContinuar) { // Si el strMensaje no es demasiado grande no es necesario fragmentarlo if (strMensaje.lengthmaxlong){ var posCorte = buscarSeparador(mensajeTmp); // Formamos el mensaje final inlucyendo un salto de linea mensajeFinal += '
'+mensajeTmp.substring(0,posCorte); mensajeTmp = mensajeTmp.substring(posCorte,mensajeTmp.length); } // Insertamos elfragmento final mensajeFinal += '\n'+mensajeTmp; fncAlertPx(mensajeFinal,180,550, tipoMensaje,funcionContinuar); } } // FIN #36927 // FIN #36927 function fncAlertGrande(idioma,strMensaje, tipoMensaje) { fncAlertPx(idioma,strMensaje,180,400, tipoMensaje); } function fncAlertPx(strMensaje,pxHeight,pxWidth, tipoMensaje, funcionContinuar) { try{ var tituloMensaje = ""; if (tipoMensaje === ALERT_TYPE_ERROR) { tituloMensaje = obtenerMensajeError(); } if (tipoMensaje === ALERT_TYPE_INFO) { tituloMensaje = obtenerMensajeInfo(); } if (tipoMensaje === ALERT_TYPE_WARN) { tituloMensaje = obtenerMensajeWarn(); } if (tipoMensaje === ALERT_TYPE_OK) { tituloMensaje = obtenerMensajeOk(); } jAlert(strMensaje,tituloMensaje, tipoMensaje,funcionContinuar); } catch(e){ console.log(e); alert(strMensaje); } } function fncConfirmPx(idioma,strMensaje,pxHeight,pxWidth) { var mdLeft = (screen.width/2)-(pxWidth/2); var mdTop = (screen.height/2)-(pxHeight/2); return window.showModalDialog("commons/intranetConfirmCancelAlerts.jsp",strMensaje,"dialogLeft:"+mdLeft+";dialogTop:"+mdTop+";dialogHeight:"+pxHeight+"px;dialogWidth:"+pxWidth+"px;status:no;help:no;center:yes"); } function fncConfirm(idioma,strMensaje) { // Si el strMensaje no es demasiado grande no es necesario fragmentarlo if (strMensaje.lengthmaxlong){ var posCorte = buscarSeparador(mensajeTmp); // Formamos el mensaje final inlucyendo un salto de linea mensajeFinal += '
'+mensajeTmp.substring(0,posCorte); mensajeTmp = mensajeTmp.substring(posCorte,mensajeTmp.length); } // Insertamos elfragmento final mensajeFinal += '\n'+mensajeTmp; return fncConfirmPx(idioma,mensajeFinal,180,600); } } function fncConfirmPx(idioma,strMensaje,pxHeight,pxWidth) { var mdLeft = (screen.width/2)-(pxWidth/2); var mdTop = (screen.height/2)-(pxHeight/2); return window.showModalDialog("commons/intranetOkPrintAlerts.jsp",strMensaje,"dialogLeft:"+mdLeft+";dialogTop:"+mdTop+";dialogHeight:"+pxHeight+"px;dialogWidth:"+pxWidth+"px;status:no;help:no;center:yes"); }