isso/isso/js/app/config.js

27 lines
673 B
JavaScript
Raw Normal View History

define(function() {
"use strict";
var config = {
"css": true,
"lang": (navigator.language || navigator.userLanguage).split("-")[0],
"reply-to-self": false
};
var js = document.getElementsByTagName("script");
for (var i = 0; i < js.length; i++) {
[].forEach.call(js[i].attributes, function(attr) {
if (/^data-isso-/.test(attr.name)) {
try {
config[attr.name.substring(10)] = JSON.parse(attr.value);
} catch (ex) {
config[attr.name.substring(10)] = attr.value;
}
}
});
}
return config;
});