This commit is contained in:
James Cole
2020-10-26 06:10:10 +01:00
parent f6ce49b586
commit 276de8a470
6 changed files with 54 additions and 14 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -144,6 +144,11 @@ function listLengthInitial() {
$('.listLengthTrigger').unbind('click').click(triggerList)
}
/**
*
* @param e
* @returns {boolean}
*/
function triggerList(e) {
"use strict";
var link = $(e.target);
@@ -153,12 +158,13 @@ function triggerList(e) {
table.find('.overListLength').hide();
table.attr('data-hidden', 'yes');
link.text(showFullList);
return false;
}
// show all, return false
table.find('.overListLength').show();
table.attr('data-hidden', 'no');
link.text(showOnlyTop);
if (table.attr('data-hidden') !== 'no') {
// show all, return false
table.find('.overListLength').show();
table.attr('data-hidden', 'no');
link.text(showOnlyTop);
}
return false;
}

View File

@@ -124,10 +124,6 @@ export default {
types = this.defaultAccountTypeFilters.join(',');
}
this.updateACURI(types);
},
name() {
// console.log('Watch: name()');
// console.log(this.name);
}
},
methods:
@@ -141,7 +137,7 @@ export default {
for (const key in res.data) {
if (res.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
current = res.data[key];
current.description = this.escapeHtml(res.data[key].description)
current.name_with_balance = this.escapeHtml(res.data[key].name_with_balance)
escapedData.push(current);
}
}
@@ -151,6 +147,25 @@ export default {
// any error handler
})
},
escapeHtml: function (string) {
let entityMap = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
'/': '&#x2F;',
'`': '&#x60;',
'=': '&#x3D;'
};
return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
return entityMap[s];
});
},
updateACURI: function (types) {
this.accountAutoCompleteURI =
document.getElementsByTagName('base')[0].href +

View File

@@ -100,7 +100,7 @@ export default {
for (const key in res.data) {
if (res.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
current = res.data[key];
current.description = this.escapeHtml(res.data[key].description)
current.name = this.escapeHtml(res.data[key].name)
escapedData.push(current);
}
}
@@ -110,6 +110,25 @@ export default {
// any error handler
})
},
escapeHtml: function (string) {
let entityMap = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
'/': '&#x2F;',
'`': '&#x60;',
'=': '&#x3D;'
};
return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
return entityMap[s];
});
},
handleInput(e) {
if (typeof this.$refs.input.value === 'string') {
this.$emit('input', this.$refs.input.value);