|
|
|
@ -235,15 +235,27 @@
|
|
|
|
|
function parse_template() {
|
|
|
|
|
if (!templates[tpl_url] || !template_data) return;
|
|
|
|
|
|
|
|
|
|
if (typeof global !== "undefined")
|
|
|
|
|
if (typeof global !== "undefined") {
|
|
|
|
|
template_data['relative_path'] = nconf.get('relative_path');
|
|
|
|
|
else
|
|
|
|
|
} else {
|
|
|
|
|
template_data['relative_path'] = RELATIVE_PATH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
translator.translate(templates[tpl_url].parse(template_data), function (translatedTemplate) {
|
|
|
|
|
var template = templates[tpl_url].parse(template_data)
|
|
|
|
|
|
|
|
|
|
translator.translate(template, function (translatedTemplate) {
|
|
|
|
|
$('#content').html(translatedTemplate);
|
|
|
|
|
|
|
|
|
|
templates.parseTemplateVariables();
|
|
|
|
|
|
|
|
|
|
if (callback) {
|
|
|
|
|
callback(true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
templates.parseTemplateVariables = function() {
|
|
|
|
|
$('#content [template-variable]').each(function (index, element) {
|
|
|
|
|
var value = null;
|
|
|
|
|
|
|
|
|
@ -259,16 +271,9 @@
|
|
|
|
|
value = $(element).val();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log($(element).attr('template-variable'), value);
|
|
|
|
|
templates.set($(element).attr('template-variable'), value);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (callback) {
|
|
|
|
|
callback(true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
templates.cancelRequest = function() {
|
|
|
|
|