/branches/v3.01-serpe/widget/modules/saisie/squelettes/js/tb-geoloc/js/lib/parse-to-bool.js |
---|
New file |
0,0 → 1,3 |
export const parseDatasetValToBool = val => { |
return "boolean" === typeof val ? val : ['true', 1, "1"].includes(val); |
}; |
/branches/v3.01-serpe/widget/modules/saisie/squelettes/js/tb-geoloc/js/lib/debounce.js |
---|
New file |
0,0 → 1,11 |
export function debounce (callback, delay) { |
let timer; |
return function(){ |
const args = arguments; |
const context = this; |
clearTimeout(timer); |
timer = setTimeout(function(){ |
callback.apply(context, args); |
}, delay) |
} |
} |
/branches/v3.01-serpe/widget/modules/saisie/squelettes/js/tb-geoloc/js/lib/html-entities-decode.js |
---|
New file |
0,0 → 1,12 |
// Decode html entities |
String.prototype.htmlEntitiesWidgets = function () { |
const temp = document.createElement("div"); |
temp.innerHTML = this; |
const result = temp.childNodes[0].nodeValue; |
temp.removeChild(temp.firstChild); |
return result; |
}; |