26 lines
595 B
JavaScript
26 lines
595 B
JavaScript
|
define(function() {
|
||
|
"use strict";
|
||
|
|
||
|
var config = {
|
||
|
"css": true,
|
||
|
"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;
|
||
|
|
||
|
});
|