0
1
Fork 0
This commit is contained in:
Juan Ferrer 2019-02-05 17:20:24 +01:00
parent c744e9286e
commit ae0973c16b
5 changed files with 20 additions and 28 deletions

View File

@ -9,3 +9,6 @@ rules:
no-console: 0 no-console: 0
no-cond-assign: 0 no-cond-assign: 0
no-unexpected-multiline: 0 no-unexpected-multiline: 0
brace-style: [error, 1tbs]
space-before-function-paren: [error, never]
padded-blocks: [error, never]

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.406.26) stable; urgency=low hedera-web (1.406.27) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -10,8 +10,7 @@ module.exports =
,_hashMap: {} ,_hashMap: {}
,_listener: null ,_listener: null
,initialize: function () ,initialize: function() {
{
this._listener = new HashListener (); this._listener = new HashListener ();
this._hashChangedHandler = this._hashChanged.bind (this); this._hashChangedHandler = this._hashChanged.bind (this);
@ -19,13 +18,11 @@ module.exports =
this._hashChanged (); this._hashChanged ();
} }
,destroy: function () ,destroy: function() {
{
window.removeEventListener ('hashchange', this._hashChangedHandler); window.removeEventListener ('hashchange', this._hashChangedHandler);
} }
,getListener: function () ,getListener: function() {
{
return this._listener; return this._listener;
} }
@ -34,8 +31,7 @@ module.exports =
* *
* @param {string} key The variable name * @param {string} key The variable name
**/ **/
,get: function (key) ,get: function(key) {
{
return this._hashMap[key]; return this._hashMap[key];
} }
@ -44,8 +40,7 @@ module.exports =
* *
* @param {Object} map A key-value map * @param {Object} map A key-value map
**/ **/
,add: function (map) ,add: function(map) {
{
var newMap = this._hashMap; var newMap = this._hashMap;
for (var key in map) for (var key in map)
@ -59,8 +54,7 @@ module.exports =
* *
* @param {Object} map A key-value map * @param {Object} map A key-value map
**/ **/
,set: function (map) ,set: function(map) {
{
if (map) if (map)
for (var key in map) for (var key in map)
if (map[key] === null || map[key] === undefined) if (map[key] === null || map[key] === undefined)
@ -71,8 +65,7 @@ module.exports =
if (!map) if (!map)
map = {}; map = {};
if (newHash !== this._hash) if (newHash !== this._hash) {
{
this._hashMap = map; this._hashMap = map;
this._hash = newHash; this._hash = newHash;
@ -91,8 +84,7 @@ module.exports =
* @param {boolean} add %true to combine with the current map, %false otherwise * @param {boolean} add %true to combine with the current map, %false otherwise
* @return {String} The URL * @return {String} The URL
**/ **/
,make: function (map, add) ,make: function(map, add) {
{
var hash = '#!'; var hash = '#!';
if (add && map) if (add && map)
@ -100,19 +92,17 @@ module.exports =
if (!map[key]) if (!map[key])
map[key] = this._hashMap[key]; map[key] = this._hashMap[key];
for (var key in map) for (var key in map) {
{
if (hash.length > 2) if (hash.length > 2)
hash += '&'; hash += '&';
hash += key +'='+ map[key]; hash += encodeURIComponent(key) +'='+ encodeURIComponent(map[key]);
} }
return hash; return hash;
} }
,_hashChanged: function () ,_hashChanged: function() {
{
var newHash = location.hash; var newHash = location.hash;
if (this._blockChanged || newHash === this._hash) if (this._blockChanged || newHash === this._hash)
@ -121,12 +111,11 @@ module.exports =
var newMap = hashMap = {}; var newMap = hashMap = {};
var kvPairs = newHash.substr(2).split ('&'); 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); var kvPair = kvPairs[i].split ('=', 2);
if (kvPair[0]) if (kvPair[0])
newMap[kvPair[0]] = kvPair[1]; newMap[decodeURIComponent(kvPair[0])] = decodeURIComponent(kvPair[1]);
} }
this._hashMap = newMap; this._hashMap = newMap;

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "1.406.24", "version": "1.406.27",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "1.406.26", "version": "1.406.27",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {