From e01639e44c30b6eff315bf0933aab8b0eb6085a9 Mon Sep 17 00:00:00 2001 From: mumana Date: Fri, 22 Jun 2018 14:31:15 +0000 Subject: [PATCH] git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C100 --- .../AYA.SlnSynor/AYA.SlnSinort.csproj | 1 + .../AYA.SlnSynor/App_Start/BundleConfig.cs | 1 + .../AYA.SlnSynor/Scripts/_references.js | Bin 587908 -> 588012 bytes .../DetallePropuestaNormativa.js | 4 +- .../Sinort-Scripts/ProyectoNormativo.js | 2 +- .../AYA.SlnSynor/Sinort-Scripts/ROTn.js | 55 ++++++++++++++++++ 6 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ROTn.js diff --git a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj index 60c159cd4..43b5c68c7 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj +++ b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj @@ -7683,6 +7683,7 @@ + diff --git a/AYA.SlnSynor/AYA.SlnSynor/App_Start/BundleConfig.cs b/AYA.SlnSynor/AYA.SlnSynor/App_Start/BundleConfig.cs index e73cd9457..fe9e13bb7 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/App_Start/BundleConfig.cs +++ b/AYA.SlnSynor/AYA.SlnSynor/App_Start/BundleConfig.cs @@ -48,6 +48,7 @@ namespace AYA.SlnSinort .Include("~/Content/DataTables-1.10.0/css/jquery.dataTables.css")); bundles.Add(new ScriptBundle("~/Script-Global") + .Include("~/Sinort-Scripts/ROTn.js") .Include("~/Sinort-Scripts/Global.js")); bundles.Add(new StyleBundle("~/Content/timepicki").Include("~/Content/timepicki.css")); diff --git a/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js b/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js index c09327923572bb03e244a850f69e118d43c3d352..0887a2749dec1ed7c5383cbc97eb6e564e439b79 100644 GIT binary patch delta 38 ucmZqqsQl)mazhJa3sVbo3rh=Y3tJ2O7LJx5lP8E9O#kqeLuvA)0x<{9 diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js index 7fb2802be..12534ff87 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js @@ -13,7 +13,7 @@ jQuery(document).ready(function () { $("#formDetallePropuesta").EnableValidationToolTip(); model.ProyectoNormativo = { - IdProyectoNormativo: IDPropuesta + IdProyectoNormativo: ROT47(IDPropuesta.toString()) }; getDataModel(); @@ -124,7 +124,7 @@ this.CargarFormulario = function (data) { [participanteConfirmado, item.UsuarioSistema, item.Usuario.NombreUsuario, - item.FechaCreacion, + DateFormatNoTime(item.FechaCreacion), option]) .draw(); }); diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ProyectoNormativo.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ProyectoNormativo.js index 0463eb982..38f45d137 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ProyectoNormativo.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ProyectoNormativo.js @@ -42,7 +42,7 @@ $('#tableSitios').on('click', 'button', function () { url = $("#hiddenHref").val(); url = url.replace("View", "DetallePropuesta"); url = url.replace("Controller", "PropuestaNormativa"); - url = url.replace("[$ID]", data.IdProyectoNormativo); + url = url.replace("[$ID]", ROT47(data.IdProyectoNormativo.toString())); document.location.href = url; diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ROTn.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ROTn.js new file mode 100644 index 000000000..78b7c8eac --- /dev/null +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ROTn.js @@ -0,0 +1,55 @@ +// +// ROTn.js -- ROT13 and ROT14 +// +// JavaScript-code implementing ROT13 and ROT47. Useful to obscure +// email-adresses and telephone numbers from inquisitorial site crawlers. +// +// Usage: +// +// +// Resources: +// http://de.wikipedia.org/wiki/ROT13 +// http://www.drweb.de/magazin/codieren-und-verschlusseln-mit-javascript/ +// +//////////////////////////////////////////////// +// (C) 2010 Andreas Spindler. Permission to use, copy, modify, and distribute +// this software and its documentation for any purpose with or without fee is +// hereby granted. Redistributions of source code must retain the above +// copyright notice and the following disclaimer. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// +// $Writestamp: 2010-06-09 13:07:07$ +// $Maintained at: www.visualco.de$ + +function ROTn(text, map) { + // Generic ROT-n algorithm for keycodes in MAP. + var R = new String() + var i, j, c, len = map.length + for (i = 0; i < text.length; i++) { + c = text.charAt(i) + j = map.indexOf(c) + if (j >= 0) { + c = map.charAt((j + len / 2) % len) + } + R = R + c + } + return R; +} + +function ROT47(text) { + // Hides all ASCII-characters from 33 ("!") to 126 ("~"). Hence can be used + // to obfuscate virtually any text, including URLs and emails. + var R = new String() + R = ROTn(text, + "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~") + return R; +} \ No newline at end of file