|
|
@ -1,5 +1,5 @@
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
/*global templates, translator, ajaxify, utils, bootbox, overrides, socket, config, Visibility*/
|
|
|
|
/*global templates, ajaxify, utils, bootbox, overrides, socket, config, Visibility*/
|
|
|
|
|
|
|
|
|
|
|
|
var app = app || {};
|
|
|
|
var app = app || {};
|
|
|
|
|
|
|
|
|
|
|
@ -519,19 +519,21 @@ app.cacheBuster = null;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
app.parseAndTranslate = function(template, blockName, data, callback) {
|
|
|
|
app.parseAndTranslate = function(template, blockName, data, callback) {
|
|
|
|
if (typeof blockName === 'string') {
|
|
|
|
require(['translator'], function(translator) {
|
|
|
|
templates.parse(template, blockName, data, function(html) {
|
|
|
|
if (typeof blockName === 'string') {
|
|
|
|
translator.translate(html, function(translatedHTML) {
|
|
|
|
templates.parse(template, blockName, data, function(html) {
|
|
|
|
callback($(translatedHTML));
|
|
|
|
translator.translate(html, function(translatedHTML) {
|
|
|
|
|
|
|
|
callback($(translatedHTML));
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
callback = data, data = blockName;
|
|
|
|
callback = data, data = blockName;
|
|
|
|
templates.parse(template, data, function(html) {
|
|
|
|
templates.parse(template, data, function(html) {
|
|
|
|
translator.translate(html, function(translatedHTML) {
|
|
|
|
translator.translate(html, function(translatedHTML) {
|
|
|
|
callback($(translatedHTML));
|
|
|
|
callback($(translatedHTML));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}());
|
|
|
|
}());
|
|
|
|