Improved www.ttss.krakow.pl
Jacek Kowalski
2016-12-06 b50208f82ee22f8d158b7a6f9bb3c867ddd68d05
Decode non-latin characters in stop names autocompletion
1 files modified
8 ■■■■ changed files
index.js 8 ●●●● patch | view | raw | blame | history
index.js
@@ -264,6 +264,12 @@
    }, interval);
}
var decodeEntitiesTextArea = document.createElement('textarea');
function decodeEntities(text) {
    decodeEntitiesTextArea.innerHTML = text;
    return decodeEntitiesTextArea.value;
}
function init() {
    if(!window.jQuery) {
        fail('Required JavaScript jQuery library failed to load. You may try refreshing the page.');
@@ -287,7 +293,7 @@
            for(var i = 1, il = data.length; i < il; i++) {
                var opt = document.createElement('option');
                opt.value = data[i].id;
                opt.appendChild(document.createTextNode(data[i].name));
                setText(opt, decodeEntities(data[i].name));
                stop_name_autocomplete.appendChild(opt);
            }