Warning: Undefined array key "HTTPS" in /data03/virt23978/domeenid/www.est.ee/htdocs/admin/define.php on line 9
Warning: Undefined array key "HTTPS" in /data03/virt23978/domeenid/www.est.ee/htdocs/admin/define.php on line 125
Warning: Cannot modify header information - headers already sent by (output started at /data03/virt23978/domeenid/www.est.ee/htdocs/admin/define.php:9) in /data03/virt23978/domeenid/www.est.ee/htdocs/admin/template/js/translations.php on line 6
Warning: Undefined array key "lng1506767656" in /data03/virt23978/domeenid/www.est.ee/htdocs/admin/template/js/translations.php on line 22
var translation_strings_object={};function translate(string){
if(translation_strings_object[string] == undefined || translation_strings_object[string] == "--EMPTY--"){
translation_strings_object[string] = "";
return "";
}else{
return translation_strings_object[string];
}
}
function setNewTranslation(word_name,callback,data){
Request('load_save_translation_row',{'name':word_name},function(r){
r = $.trim(r);
if(r){
$('body').append(''+r+'
');
$( "#tabs_edit_lang_"+word_name ).tabs();
$( "#dialog-confirm" ).dialog({
resizable: true,
modal: true,
maxWidth:1024,
width:595,
buttons: [{
text: "Salvesta tõlge",
click: function() {
var d = $(this);
Request('save_translation_row',$('#dialog-confirm').find('form').serialize(),function(new_word){
if($.isFunction(callback)){
data['new_word'] = new_word;
callback.call(this,data);
}
d.dialog("close");
});
}
}, {
text: "Katkesta",
click: function() {
$(this).dialog("close");
}
}]
});
$( "#dialog-confirm" ).bind( "dialogclose", function(event, ui) {
$("#dialog-confirm").remove();
});
}
});
}
$(function(){
$(document).on('click','.add_translation_link',function(){
var class_name = '';
var word_name = '';
$.each($(this).attr('class').split(' '),function(i,e){
if(/translation-id-class-/.test(e)){
class_name = e;
word_name = e.split('translation-id-class-')[1];
}
});
setNewTranslation(word_name,function(data){
$('.'+data.class_name).replaceWith($.trim(data.new_word));
},{'class_name':class_name});
});
});