$(document).on('click', '.return_false', function(e) { e.preventDefault(); return false; }); $(document).on('click', '.ajaxcontent', function(e) { e.preventDefault(); $this = $(e.currentTarget); window.location.hash = $this.attr('href'); return false; }); $(document).on('click', '.btn_grid_edit', function(e) { e.preventDefault(); var res = $(this).parent().parent().attr('id').split("_"); var id = res[1]; var url = $(this).attr('href'); self.location.href = url + '/id/' + id; // window.location.hash = url + '/id/' + id; // loadURL (url + '/id/' + id, $('#grid_edit_area')); // $('body').animate({scrollTop:1200}, '1000'); return false; }); $(document).on('click', '.refresh', function(e) { e.preventDefault(); location.reload(true); return false; }); $(document).on('click', '.btn_add_trans', function(e){ e.preventDefault(); var link = this; var iWidth = 850; var iHeight = 600; window.open( link, '_blank', ' status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight ) ; return false; }); $(document).on('click','.clickpic',function(){ var link = $(this).attr('src'); window.open( link, '_blank', ' status=yes,menubar=yes,scrollbars=yes,resizable=yes ') ; return false; }); $(document).on('click','.windowopen',function(){ var link = $(this).attr('href'); window.open( link, '_blank', ' status=yes,menubar=yes,scrollbars=yes,resizable=yes ') ; return false; }); $(document).on('click', '.modal_image', function(e) { e.preventDefault(); var id = $(this).attr('data-target'); //include # var url = $(this).attr('href'); if($('#' + id).html()){ $('#' + id).modal('show'); }else{ jQuery.ajax({ type: 'POST', dataType: 'html', url: url, success: function(data){ $("body").append(data); $('#' + id).modal('show'); return false; }, error: function(data){ return false; } }); } return false; }); $(document).on('click', '.btn_check_use_image', function(e) { e.preventDefault(); var target = $(this).parent().parent().parent(); // $(target).children('.check_use').hide(); $(target).children('.check_use').children('.btn_check_use').click(); }); $(document).on('click', '.btn_check_use', function(e) { e.preventDefault(); var target = $(this).attr('data-id-target'); //include # var id = $(this).attr('data-id'); var unique = $(this).attr('data-unique'); var unique_modal = $(this).attr('data-target-modal'); $('#' + target).val(id); $(this).parent().parent().children('.well').children('.hide').removeClass('hide'); if(unique_modal){ $('#' + unique_modal + ' .btn_check_use').removeClass('btn-primary').addClass('btn-default'); }else{ $('#' + unique + ' .btn_check_use').removeClass('btn-primary').addClass('btn-default'); } $(this).addClass('btn-primary').removeClass('btn-default'); ; return false; }); $(document).on('click', '.btn_select_file', function(e) { e.preventDefault(); var modalid = $(this).attr('data-modalid'); //include # var target_field = $(this).attr('data-target-field'); //include # var recent = $(this).attr('data-unique'); //include # var url = $(this).attr('href'); if($('#' + modalid).html()){ $('#' + modalid).modal('show'); }else{ jQuery.ajax({ type: 'GET', dataType: 'html', url: url, data: {'target_field':target_field, 'recent':recent, 'modalid':modalid}, success: function(data){ $("body").append(data); $('#' + modalid).modal('show'); return false; }, error: function(data){ return false; } }); } return false; }); $(document).on('click', '.btn_language_jsoneditor', function(e) { e.preventDefault(); var content = $(this).parent().parent().children('.form-control').val(); var url = $(this).attr('href') + encodeURI(content); var iWidth = 850; var iHeight = 600; window.open( url, '_blank', ' status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight ) ; return false; }); $(document).on('click', '.btn_add_translations', function(e) { e.preventDefault(); var url = $(this).attr('href'); var iWidth = 850; var iHeight = 600; // window.open( url, '_blank', ' status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight ) ; window.open( url, '_blank') ; return false; }); $(document).on('click', '.btn_delete_recent_file', function(e) { e.preventDefault(); var url = $(this).attr('href'); var target = $(this); var target_file = $(this).parent().parent().parent().parent().children('.input_form_hint').children('.class_file'); jQuery.ajax({ type: 'POST', dataType: 'text', url: url, success: function(data){ // if(data=='OK'){ // if( $(target_file).val() == $(this).attr('data-id') ) $(target_file).val(''); // $(target).parent().parent().fadeOut().remove(); // } if( $(target_file).val() == $(target).attr('data-id') ){ $(target_file).val(''); } $(target).parent().parent().fadeOut().remove(); return false; }, error: function(data){ alert('error'); return false; } }); return false; }); $(document).on('input','.select_file_seach',function(){ var modalid = $(this).attr('data-modalid'); var type = $(this).attr('data-type'); var target_field = $(this).attr('data-target-field'); var recent = $(this).attr('data-recent'); var keyword = $(this).val(); var url = $(this).attr('data-url'); // if(keyword.length > 1){ if(true){ jQuery.ajax({ type: 'GET', dataType: 'html', url: url, data: {'keyword':keyword, 'modalid':modalid, 'type':type, 'target_field':target_field, 'recent':recent }, success: function(data){ $('#'+modalid + ' .file_listview').html(data); }, error: function(data){ alert('error'); return false; } }); } }); $(document).on('click', '.btn_form_hint', function(e) { e.preventDefault(); return false; }); $(document).ready(function() { var menu1 = $('aside > nav > ul > .open > a .menu-item-parent').html(); if(menu1){ $('.breadcrumb > li').first().after('