1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="css/ubw-help.css">
<script src="/usr/share/javascript/modernizr/modernizr.min.js" type="text/javascript"></script>
<script src="/usr/share/javascript/jquery/jquery.min.js" type="text/javascript"></script>
<script src="/usr/share/javascript/mustache/mustache.min.js type="text/javascript"></script>
</head>
<body>
<div id="core">
<div class="wrapper">
<div>
<script>
function loadFile(filename, locale) {
var toload = filename;
var nextlocale = undefined;
if(locale.length >= 5) {
toload += '_' + locale.substring(0, 5) +'-template.js';
nextlocale = locale.substring(0, 2);
}
else if(locale.length >= 2){
toload += '_' + locale.substring(0, 2) +'-template.js';
nextlocale = '';
}
else
toload += '-template.js';
$.ajax({
url: toload,
async: false,
contentType:'text/plain;charset=UTF-8',
dataType: 'text',
success: function(data, status) {
$("#core>.wrapper>div").html(Mustache.render(data, window));
}
})
.fail(function() {
if(nextlocale !== undefined)
loadFile(filename, nextlocale);
});
}
$(document).ready(function(){
var locale = window.parent.sankore ? window.parent.sankore.lang : "";
loadFile("js/help", locale);
});
</script>
</div>
</div>
</div>
</body>
</html>
|