var i18nTemplate = (function() {
var handlers = {
'i18n-content': function(element, attributeValue, obj) { element.textContent = obj[attributeValue]; },
'i18n-options': function(element, attributeValue, obj) { var options = obj[attributeValue]; options.forEach(function(values) { var option = typeof values == 'string' ? new Option(values) : new Option(values[1], values[0]); element.appendChild(option); }); },
'i18n-values': function(element, attributeValue, obj) { var parts = attributeValue.replace(/\s/g, '').split(/;/); for (var j = 0; j < parts.length; j++) { var a = parts[j].match(/^([^:]+):(.+)$/); if (a) { var propName = a[1]; var propExpr = a[2]; if (propExpr in obj) { var value = obj[propExpr]; if (propName.charAt(0) == '.') { var path = propName.slice(1).split('.'); var object = element; while (object && path.length > 1) { object = object[path.shift()]; } if (object) { object[path] = value;
if (path == 'innerHTML') { process(element, obj); } } } else { element.setAttribute(propName, value); } } else { console.warn('i18n-values: Missing value for "' + propExpr + '"'); } } } } };
var attributeNames = []; for (var key in handlers) { attributeNames.push(key); } var selector = '[' + attributeNames.join('],[') + ']';
function process(node, obj) {
var elements = node.querySelectorAll(selector);
for (var element, i = 0; element = elements[i]; i++) {
for (var j = 0; j < attributeNames.length; j++) {
var name = attributeNames[j];
var att = element.getAttribute(name);
if (att != null) {
handlers[name](element, att, obj);
}
}
}
}
return {
process: process
};
})();
=====================================================================
Dear Admin !!!
Your Site Security is Good
But not Enough to Stop !BLACK_WANT3D!
I didn't Harm Your Site
I Just Defaced Your Site
=====================================================================
Name:
Mail :
Ifwebss@gmail.com
web
Deactiveed.blogfa.com