From ae0973c16bbb99b56654fe67b0b75c57ebae2d51 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 5 Feb 2019 17:20:24 +0100 Subject: [PATCH] #9702 fixed --- .eslintrc.yml | 5 ++++- debian/changelog | 2 +- js/vn/hash.js | 37 +++++++++++++------------------------ package-lock.json | 2 +- package.json | 2 +- 5 files changed, 20 insertions(+), 28 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index dd8a09cc..110dcd0b 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -8,4 +8,7 @@ rules: no-mixed-spaces-and-tabs: 0 no-console: 0 no-cond-assign: 0 - no-unexpected-multiline: 0 \ No newline at end of file + no-unexpected-multiline: 0 + brace-style: [error, 1tbs] + space-before-function-paren: [error, never] + padded-blocks: [error, never] \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index 8d32d9c3..7354f4d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.406.26) stable; urgency=low +hedera-web (1.406.27) stable; urgency=low * Initial Release. diff --git a/js/vn/hash.js b/js/vn/hash.js index e5c5c4d4..f638019e 100644 --- a/js/vn/hash.js +++ b/js/vn/hash.js @@ -10,8 +10,7 @@ module.exports = ,_hashMap: {} ,_listener: null - ,initialize: function () - { + ,initialize: function() { this._listener = new HashListener (); this._hashChangedHandler = this._hashChanged.bind (this); @@ -19,13 +18,11 @@ module.exports = this._hashChanged (); } - ,destroy: function () - { + ,destroy: function() { window.removeEventListener ('hashchange', this._hashChangedHandler); } - ,getListener: function () - { + ,getListener: function() { return this._listener; } @@ -34,8 +31,7 @@ module.exports = * * @param {string} key The variable name **/ - ,get: function (key) - { + ,get: function(key) { return this._hashMap[key]; } @@ -44,8 +40,7 @@ module.exports = * * @param {Object} map A key-value map **/ - ,add: function (map) - { + ,add: function(map) { var newMap = this._hashMap; for (var key in map) @@ -59,8 +54,7 @@ module.exports = * * @param {Object} map A key-value map **/ - ,set: function (map) - { + ,set: function(map) { if (map) for (var key in map) if (map[key] === null || map[key] === undefined) @@ -71,8 +65,7 @@ module.exports = if (!map) map = {}; - if (newHash !== this._hash) - { + if (newHash !== this._hash) { this._hashMap = map; this._hash = newHash; @@ -91,8 +84,7 @@ module.exports = * @param {boolean} add %true to combine with the current map, %false otherwise * @return {String} The URL **/ - ,make: function (map, add) - { + ,make: function(map, add) { var hash = '#!'; if (add && map) @@ -100,19 +92,17 @@ module.exports = if (!map[key]) map[key] = this._hashMap[key]; - for (var key in map) - { + for (var key in map) { if (hash.length > 2) hash += '&'; - hash += key +'='+ map[key]; + hash += encodeURIComponent(key) +'='+ encodeURIComponent(map[key]); } return hash; } - ,_hashChanged: function () - { + ,_hashChanged: function() { var newHash = location.hash; if (this._blockChanged || newHash === this._hash) @@ -121,12 +111,11 @@ module.exports = var newMap = hashMap = {}; var kvPairs = newHash.substr(2).split ('&'); - for (var i = 0; i < kvPairs.length; i++) - { + for (var i = 0; i < kvPairs.length; i++) { var kvPair = kvPairs[i].split ('=', 2); if (kvPair[0]) - newMap[kvPair[0]] = kvPair[1]; + newMap[decodeURIComponent(kvPair[0])] = decodeURIComponent(kvPair[1]); } this._hashMap = newMap; diff --git a/package-lock.json b/package-lock.json index a7d2b66d..18f46d86 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.406.24", + "version": "1.406.27", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ff4e594b..feb35c0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.406.26", + "version": "1.406.27", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": {