From ce54d7a756b8d36302186958e8fd66f372999dff Mon Sep 17 00:00:00 2001 From: "m4gn3to@gmail.com" Date: Mon, 9 Jun 2025 13:54:42 +0200 Subject: [PATCH] =?UTF-8?q?a=C3=B1ado=20js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/alertify.js | 467 + js/bloques_tarisan.js | 65 + js/cambio_clave.jsp | 192 + js/dhtmlgoodies_calendar.js | 1506 +++ js/entorno_grafico.jsp | 193 + js/error.jsp | 151 + js/errorIguala.jsp | 142 + js/funciones.js | 276 + js/hora.jsp | 51 + js/imprimir.js | 35 + js/inicio_tarisan.js | 160 + js/jquery-1.11.3.js | 10351 +++++++++++++++++++++ js/jquery-ui.js | 16617 ++++++++++++++++++++++++++++++++++ js/jquery-ui.min.js | 13 + js/jquery.modal.min.js | 8 + js/listado_session.jsp | 154 + js/menu_adm.js | 278 + js/menu_med.js | 297 + js/menu_pac.js | 306 + js/menu_pac_iguala.js | 276 + js/resultado_analitica.jsp | 195 + js/test_log.jsp | 51 + js/test_persistencia.jsp | 172 + js/ventana_intralab.jsp | 46 + 24 files changed, 32002 insertions(+) create mode 100644 js/alertify.js create mode 100644 js/bloques_tarisan.js create mode 100644 js/cambio_clave.jsp create mode 100644 js/dhtmlgoodies_calendar.js create mode 100644 js/entorno_grafico.jsp create mode 100644 js/error.jsp create mode 100644 js/errorIguala.jsp create mode 100644 js/funciones.js create mode 100644 js/hora.jsp create mode 100644 js/imprimir.js create mode 100644 js/inicio_tarisan.js create mode 100644 js/jquery-1.11.3.js create mode 100644 js/jquery-ui.js create mode 100644 js/jquery-ui.min.js create mode 100644 js/jquery.modal.min.js create mode 100644 js/listado_session.jsp create mode 100644 js/menu_adm.js create mode 100644 js/menu_med.js create mode 100644 js/menu_pac.js create mode 100644 js/menu_pac_iguala.js create mode 100644 js/resultado_analitica.jsp create mode 100644 js/test_log.jsp create mode 100644 js/test_persistencia.jsp create mode 100644 js/ventana_intralab.jsp diff --git a/js/alertify.js b/js/alertify.js new file mode 100644 index 0000000..762d388 --- /dev/null +++ b/js/alertify.js @@ -0,0 +1,467 @@ +/** + * alertify + * An unobtrusive customizable JavaScript notification system + * + * @author Fabien Doiron + * @copyright Fabien Doiron 2012 + * @license MIT + * @link http://www.github.com/fabien-d + * @module alertify + * @version 0.2.12 + */ + +/*global define*/ +(function (global, undefined) { + "use strict"; + + var document = global.document, + Alertify; + + Alertify = function () { + + var _alertify = {}, + dialogs = {}, + isopen = false, + keys = { ENTER: 13, ESC: 27, SPACE: 32 }, + queue = [], + $, elCallee, elCover, elDialog, elLog; + + /** + * Markup pieces + * @type {Object} + */ + dialogs = { + buttons : { + holder : "", + submit : "", + ok : "{{ok}}", + cancel : "{{cancel}}" + }, + input : "", + message : "

{{message}}

", + log : "
{{message}}
" + }; + + /** + * Shorthand for document.getElementById() + * + * @param {String} id A specific element ID + * @return {Object} HTML element + */ + $ = function (id) { + return document.getElementById(id); + }; + + /** + * Alertify private object + * @type {Object} + */ + _alertify = { + + /** + * Labels object + * @type {Object} + */ + labels : { + ok : "Aceptar", + cancel : "Cancelar" + }, + + /** + * Delay number + * @type {Number} + */ + delay : 5000, + + /** + * Set the proper button click events + * + * @param {Function} fn [Optional] Callback function + * + * @return {undefined} + */ + addListeners : function (fn) { + var btnReset = $("alertify-resetFocus"), + btnOK = $("alertify-ok") || undefined, + btnCancel = $("alertify-cancel") || undefined, + input = $("alertify-text") || undefined, + form = $("alertify-form") || undefined, + hasOK = (typeof btnOK !== "undefined"), + hasCancel = (typeof btnCancel !== "undefined"), + hasInput = (typeof input !== "undefined"), + val = "", + self = this, + ok, cancel, common, key, reset; + + // ok event handler + ok = function (event) { + if (typeof event.preventDefault !== "undefined") event.preventDefault(); + common(event); + if (typeof input !== "undefined") val = input.value; + if (typeof fn === "function") fn(true, val); + }; + + // cancel event handler + cancel = function (event) { + if (typeof event.preventDefault !== "undefined") event.preventDefault(); + common(event); + if (typeof fn === "function") fn(false); + }; + + // common event handler (keyup, ok and cancel) + common = function (event) { + self.hide(); + self.unbind(document.body, "keyup", key); + self.unbind(btnReset, "focus", reset); + if (hasInput) self.unbind(form, "submit", ok); + if (hasOK) self.unbind(btnOK, "click", ok); + if (hasCancel) self.unbind(btnCancel, "click", cancel); + }; + + // keyup handler + key = function (event) { + var keyCode = event.keyCode; + if (keyCode === keys.SPACE && !hasInput) ok(event); + if (keyCode === keys.ESC && hasCancel) cancel(event); + }; + + // reset focus to first item in the dialog + reset = function (event) { + if (hasInput) input.focus(); + else if (hasCancel) btnCancel.focus(); + else btnOK.focus(); + }; + + // handle reset focus link + // this ensures that the keyboard focus does not + // ever leave the dialog box until an action has + // been taken + this.bind(btnReset, "focus", reset); + // handle OK click + if (hasOK) this.bind(btnOK, "click", ok); + // handle Cancel click + if (hasCancel) this.bind(btnCancel, "click", cancel); + // listen for keys, Cancel => ESC + this.bind(document.body, "keyup", key); + // bind form submit + if (hasInput) this.bind(form, "submit", ok); + // set focus on OK button or the input text + global.setTimeout(function () { + if (input) { + input.focus(); + input.select(); + } + else btnOK.focus(); + }, 50); + }, + + /** + * Bind events to elements + * + * @param {Object} el HTML Object + * @param {Event} event Event to attach to element + * @param {Function} fn Callback function + * + * @return {undefined} + */ + bind : function (el, event, fn) { + if (typeof el.addEventListener === "function") { + el.addEventListener(event, fn, false); + } else if (el.attachEvent) { + el.attachEvent("on" + event, fn); + } + }, + + /** + * Build the proper message box + * + * @param {Object} item Current object in the queue + * + * @return {String} An HTML string of the message box + */ + build : function (item) { + var html = "", + type = item.type, + message = item.message; + + html += "
"; + + if (type === "prompt") html += "
"; + + html += "
"; + html += dialogs.message.replace("{{message}}", message); + + if (type === "prompt") html += dialogs.input; + + html += dialogs.buttons.holder; + html += "
"; + + if (type === "prompt") html += "
"; + + html += "Reset Focus"; + html += "
"; + + switch (type) { + case "confirm": + html = html.replace("{{buttons}}", dialogs.buttons.ok + dialogs.buttons.cancel); + html = html.replace("{{ok}}", this.labels.ok).replace("{{cancel}}", this.labels.cancel); + break; + case "prompt": + html = html.replace("{{buttons}}", dialogs.buttons.submit + dialogs.buttons.cancel); + html = html.replace("{{ok}}", this.labels.ok).replace("{{cancel}}", this.labels.cancel); + break; + case "alert": + html = html.replace("{{buttons}}", dialogs.buttons.ok); + html = html.replace("{{ok}}", this.labels.ok); + break; + default: + break; + } + + elDialog.className = "alertify alertify-show alertify-" + type; + elCover.className = "alertify-cover"; + return html; + }, + + /** + * Close the log messages + * + * @param {Object} elem HTML Element of log message to close + * @param {Number} wait [optional] Time (in ms) to wait before automatically hiding the message + * + * @return {undefined} + */ + close : function (elem, wait) { + var timer = (wait && !isNaN(wait)) ? +wait : this.delay; // Unary Plus: +"2" === 2 + this.bind(elem, "click", function () { + elLog.removeChild(elem); + }); + setTimeout(function () { + if (typeof elem !== "undefined" && elem.parentNode === elLog) elLog.removeChild(elem); + }, timer); + }, + + /** + * Create a dialog box + * + * @param {String} message The message passed from the callee + * @param {String} type Type of dialog to create + * @param {Function} fn [Optional] Callback function + * @param {String} placeholder [Optional] Default value for prompt input field + * + * @return {Object} + */ + dialog : function (message, type, fn, placeholder) { + // set the current active element + // this allows the keyboard focus to be resetted + // after the dialog box is closed + elCallee = document.activeElement; + // check to ensure the alertify dialog element + // has been successfully created + var check = function () { + if (elDialog && elDialog.scrollTop !== null) return; + else check(); + }; + // error catching + if (typeof message !== "string") throw new Error("message must be a string"); + if (typeof type !== "string") throw new Error("type must be a string"); + if (typeof fn !== "undefined" && typeof fn !== "function") throw new Error("fn must be a function"); + // initialize alertify if it hasn't already been done + if (typeof this.init === "function") { + this.init(); + check(); + } + + queue.push({ type: type, message: message, callback: fn, placeholder: placeholder }); + if (!isopen) this.setup(); + + return this; + }, + + /** + * Extend the log method to create custom methods + * + * @param {String} type Custom method name + * + * @return {Function} + */ + extend : function (type) { + return function (message, wait) { this.log(message, type, wait); }; + }, + + /** + * Hide the dialog and rest to defaults + * + * @return {undefined} + */ + hide : function () { + // remove reference from queue + queue.splice(0,1); + // if items remaining in the queue + if (queue.length > 0) this.setup(); + else { + isopen = false; + elDialog.className = "alertify alertify-hide alertify-hidden"; + elCover.className = "alertify-cover alertify-hidden"; + // set focus to the last element or body + // after the dialog is closed + elCallee.focus(); + } + }, + + /** + * Initialize Alertify + * Create the 2 main elements + * + * @return {undefined} + */ + init : function () { + // ensure legacy browsers support html5 tags + document.createElement("nav"); + document.createElement("article"); + document.createElement("section"); + // cover + elCover = document.createElement("div"); + elCover.setAttribute("id", "alertify-cover"); + elCover.className = "alertify-cover alertify-hidden"; + document.body.appendChild(elCover); + // main element + elDialog = document.createElement("section"); + elDialog.setAttribute("id", "alertify"); + elDialog.className = "alertify alertify-hidden"; + document.body.appendChild(elDialog); + // log element + elLog = document.createElement("section"); + elLog.setAttribute("id", "alertify-logs"); + elLog.className = "alertify-logs"; + document.body.appendChild(elLog); + // set tabindex attribute on body element + // this allows script to give it focus + // after the dialog is closed + document.body.setAttribute("tabindex", "0"); + // clean up init method + delete this.init; + }, + + /** + * Show a new log message box + * + * @param {String} message The message passed from the callee + * @param {String} type [Optional] Optional type of log message + * @param {Number} wait [Optional] Time (in ms) to wait before auto-hiding the log + * + * @return {Object} + */ + log : function (message, type, wait) { + // check to ensure the alertify dialog element + // has been successfully created + var check = function () { + if (elLog && elLog.scrollTop !== null) return; + else check(); + }; + // initialize alertify if it hasn't already been done + if (typeof this.init === "function") { + this.init(); + check(); + } + this.notify(message, type, wait); + return this; + }, + + /** + * Add new log message + * If a type is passed, a class name "alertify-log-{type}" will get added. + * This allows for custom look and feel for various types of notifications. + * + * @param {String} message The message passed from the callee + * @param {String} type [Optional] Type of log message + * @param {Number} wait [Optional] Time (in ms) to wait before auto-hiding + * + * @return {undefined} + */ + notify : function (message, type, wait) { + var log = document.createElement("article"); + log.className = "alertify-log" + ((typeof type === "string" && type !== "") ? " alertify-log-" + type : ""); + log.innerHTML = message; + // prepend child + elLog.insertBefore(log, elLog.firstChild); + // triggers the CSS animation + setTimeout(function() { log.className = log.className + " alertify-log-show"; }, 50); + this.close(log, wait); + }, + + /** + * Set properties + * + * @param {Object} args Passing parameters + * + * @return {undefined} + */ + set : function (args) { + var k; + // error catching + if (typeof args !== "object" && args instanceof Array) throw new Error("args must be an object"); + // set parameters + for (k in args) { + if (args.hasOwnProperty(k)) { + this[k] = args[k]; + } + } + }, + + /** + * Initiate all the required pieces for the dialog box + * + * @return {undefined} + */ + setup : function () { + var item = queue[0]; + + isopen = true; + elDialog.innerHTML = this.build(item); + if (typeof item.placeholder === "string") $("alertify-text").value = item.placeholder; + this.addListeners(item.callback); + }, + + /** + * Unbind events to elements + * + * @param {Object} el HTML Object + * @param {Event} event Event to detach to element + * @param {Function} fn Callback function + * + * @return {undefined} + */ + unbind : function (el, event, fn) { + if (typeof el.removeEventListener === "function") { + el.removeEventListener(event, fn, false); + } else if (el.detachEvent) { + el.detachEvent("on" + event, fn); + } + } + }; + + return { + alert : function (message, fn) { _alertify.dialog(message, "alert", fn); return this; }, + confirm : function (message, fn) { _alertify.dialog(message, "confirm", fn); return this; }, + extend : _alertify.extend, + init : _alertify.init, + log : function (message, type, wait) { _alertify.log(message, type, wait); return this; }, + prompt : function (message, fn, placeholder) { _alertify.dialog(message, "prompt", fn, placeholder); return this; }, + success : function (message, wait) { _alertify.log(message, "success", wait); return this; }, + error : function (message, wait) { _alertify.log(message, "error", wait); return this; }, + set : function (args) { _alertify.set(args); }, + labels : _alertify.labels + }; + }; + + // AMD and window support + if (typeof define === "function") { + define([], function () { return new Alertify(); }); + } else { + if (typeof global.alertify === "undefined") { + global.alertify = new Alertify(); + } + } + +}(this)); \ No newline at end of file diff --git a/js/bloques_tarisan.js b/js/bloques_tarisan.js new file mode 100644 index 0000000..f99d9d2 --- /dev/null +++ b/js/bloques_tarisan.js @@ -0,0 +1,65 @@ +function bloques() +{ + +var color="#C02331"; +var deshabilitado="#FFAAAA"; + +stCaja = ''; +//stCaja += ' \n'; +stCaja += '
\n'; +/*stCaja += ' \n'; +stCaja += ' \n'; +stCaja += ' \n'; +stCaja += ' \n'; +stCaja += ' \n';*/ +stCaja += ' \n'; +//stCaja += ' \n'; +stCaja += ' '; +//stCaja += ' \n'; +stCaja += ' \n'; +/*stCaja += ' \n'; +stCaja += ' \n'; +stCaja += ' \n';*/ +stCaja += '
\n'; +//stCaja += ' \n'; +stCaja += '
\n'; +stCaja += ' \n'; + +//Enlaces de secciones +//var mostrarSeccion = seccionesAMostrar( pNG ); +var seccionSeleccionada = getSeccion(); +if(seccionSeleccionada == SECCION_MEDICOS) +{ +// stCaja += ' '; +// stCaja += ' '; + stCaja += ' '; + stCaja += ' '; +} +else if(seccionSeleccionada == SECCION_PACIENTES) +{ +// stCaja += ' '; +// stCaja += ' '; + stCaja += ' '; + stCaja += ' '; + +} +else if(seccionSeleccionada == SECCION_ADMINISTRADOR) +{ +// stCaja += ' '; + stCaja += ' '; +} + +//stCaja += ' \n'; +stCaja += ' \n'; +stCaja += '
Gestión de MédicosGestión de PacientesGestión de MédicosGestión de PacientesGestión de MédicosGestión de PacientesGestión de MédicosGestión de PacientesAdministración de UsuariosAdministraciónSalir'; +stCaja += ' Salir'; +stCaja += '
\n'; +stCaja += '
\n'; + + +var rutaPagHTML = window.location.href; +//si la pagina que incluye este js es path.html.... no dibuja el bloque. +//if ( rutaPagHTML.indexOf("path.html")<0 ) + document.write(stCaja); + +} diff --git a/js/cambio_clave.jsp b/js/cambio_clave.jsp new file mode 100644 index 0000000..55106cf --- /dev/null +++ b/js/cambio_clave.jsp @@ -0,0 +1,192 @@ +<%@ page import="com.tarisan.control.*" %> +<%@ page import="com.tarisan.data.*" %> +<%@ page import="com.tarisan.excepcion.*" %> +<%@ page import="com.tarisan.log.*" %> +<%@ page import="com.tarisan.util.Utilidades" %> +<%@ page import="java.sql.*" %> +<%@ page import="java.util.Vector" %> + +<% + LogTarisan.logger.log(NivelLog.INFO, "Inicio página de cambio de clave (cambio_clave.jsp)"); + + response.setHeader("Expires", "0"); + response.setHeader("Pragma", "no-cache"); + response.setHeader("Cache-Control", "no-cache"); + HttpSession sesion = request.getSession(true); + + Tamensaje tamensaje = new Tamensaje(); + PersistenciaTamensaje pertamensaje = new PersistenciaTamensaje(); + + if(sesion.isNew() || (sesion.getAttribute("USUARIO") == null)) + { + LogTarisan.logger.log(NivelLog.INFO, "Sesión invalidada"); + response.sendRedirect("../html/login.html"); + } + else + { + try + { + +%> + + + +Cambio de clave + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
<%= sesion.getAttribute("USUARIO") %>
+ +
+ + + + + + + + +
+ + + + + + + + + +
+ + + + + +
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + +
 
<%=pertamensaje.obtenerMensaje(36).getMensaje() %>
 
+ + + + + + + + + + + + + +
<%=pertamensaje.obtenerMensaje(34).getMensaje() %>
<%=pertamensaje.obtenerMensaje(35).getMensaje() %>
<%=pertamensaje.obtenerMensaje(33).getMensaje() %>   Aceptar   <%=pertamensaje.obtenerMensaje(30).getMensaje() %>
+
+
+
+ + + + +<% + } + catch(Exception ex) + { + LogTarisan.logger.log(NivelLog.ERROR, "Exception: " + ex); + sesion.setAttribute("ERROR", "Error en la presentación de la página al usuario."); + response.sendRedirect("./error.jsp"); + } + catch(ExcepcionTarisan eT) + { + LogTarisan.logger.log(NivelLog.ERROR, "Excepcion: " + eT); + sesion.setAttribute("ERROR", "Error en la presentación de la página al usuario."); + response.sendRedirect("./error.jsp"); + } + } + LogTarisan.logger.log(NivelLog.INFO, "Final página de cambio de clave (cambio_clave.jsp)"); +%> diff --git a/js/dhtmlgoodies_calendar.js b/js/dhtmlgoodies_calendar.js new file mode 100644 index 0000000..013e74c --- /dev/null +++ b/js/dhtmlgoodies_calendar.js @@ -0,0 +1,1506 @@ +/************************************************************************************************************ +JS Calendar +Copyright (C) September 2006 DTHMLGoodies.com, Alf Magne Kalleland + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Dhtmlgoodies.com., hereby disclaims all copyright interest in this script +written by Alf Magne Kalleland. + +Alf Magne Kalleland, 2006 +Owner of DHTMLgoodies.com + +************************************************************************************************************/ + +/* Update log: +(C) www.dhtmlgoodies.com, September 2005 + +Version 1.2, November 8th - 2005 - Added