use mustache to abstract out html logic in javascript

This commit is contained in:
2012-11-26 17:46:33 +01:00
parent 88489804db
commit ecdac7e8c4
15 changed files with 785 additions and 83 deletions
+13 -1
View File
@@ -27,6 +27,7 @@
//= require twitter/bootstrap/bootstrap-typeahead
//= require twitter/bootstrap/bootstrap-affix
//= require qwaiter
//= require mustache
//= require_directory .
//= require_self
var path_mapping = {
@@ -176,9 +177,20 @@ $(function(){
container.show();
}
$('[data-t]').each(function(){$(this).text(t($(this).attr('data-t')))})
setTranslations();
});
function setLocale(locale){
QMobile.setLocale(locale);
$locale = locale;
$('[data-t]').each(function(){$(this).text(t($(this).attr('data-t')))})
setTranslations();
}
function Qupdate(selector){
setTranslations(selector);
}
function setTranslations(selector){
if(selector){
$(selector).find('[data-t]').each(function(){$(this).text(t($(this).attr('data-t')))})
}else{
$('[data-t]').each(function(){$(this).text(t($(this).attr('data-t')))})
}
}