virt2/api/soft/tinymce/4.3.12/plugins/image2/js/include.min.js

1 line
28 KiB
JavaScript
Raw Normal View History

function create_text_file(){$("#textfile_create_area").parent().parent().remove();var e=$("#lang_filename").val()+': <input type="text" id="create_text_file_name" style="min-height:30px"><br><hr><textarea id="textfile_create_area" style="width:100%;height:150px;"></textarea>';bootbox.dialog(e,[{label:$("#cancel").val(),"class":"btn"},{label:$("#ok").val(),"class":"btn-inverse",callback:function(){var e=$("#create_text_file_name").val(),a=$("#textfile_create_area").val();if(null!==e){e=fix_filename(e);var t=$("#sub_folder").val()+$("#fldr_value").val()+e,i=$("#cur_dir_thumb").val()+e;$.ajax({type:"POST",url:"execute.php?action=create_file",data:{path:t,path_thumb:i,name:e,new_content:a}}).done(function(e){""!=e&&bootbox.alert(e,function(e){setTimeout(function(){window.location.href=$("#refresh").attr("href")+"&"+(new Date).getTime()},500)})})}}}],{header:$("#lang_new_file").val()})}function edit_text_file(e){$("#textfile_edit_area").parent().parent().remove();var a=e.find(".rename-file").attr("data-thumb"),t=e.find(".rename-file").attr("data-path");$.ajax({type:"POST",url:"ajax_calls.php?action=get_file&sub_action=edit",data:{path:t}}).done(function(i){bootbox.dialog(i,[{label:$("#cancel").val(),"class":"btn"},{label:$("#ok").val(),"class":"btn-inverse",callback:function(){var e=$("#textfile_edit_area").val();$.ajax({type:"POST",url:"execute.php?action=save_text_file",data:{path:t,path_thumb:a,new_content:e}}).done(function(e){""!=e&&bootbox.alert(e)})}}],{header:e.find(".name_download").val()})})}function change_lang(){$.ajax({type:"POST",url:"ajax_calls.php?action=get_lang",data:{}}).done(function(e){bootbox.dialog(e,[{label:$("#cancel").val(),"class":"btn"},{label:$("#ok").val(),"class":"btn-inverse",callback:function(){var e=$("#new_lang_select option:selected").val();$.ajax({type:"POST",url:"ajax_calls.php?action=change_lang",data:{choosen_lang:e}}).done(function(e){""!=e?bootbox.alert(e):setTimeout(function(){window.location.href=$("#refresh").attr("href")+"&"+(new Date).getTime()},500)})}}],{header:$("#lang_lang_change").val()})})}function chmod(e){if($("#files_permission_start").parent().parent().remove(),e.hasClass("directory"))var a=e.find(".rename-folder").attr("data-thumb"),t=e.find(".rename-folder").attr("data-path");else var a=e.find(".rename-file").attr("data-thumb"),t=e.find(".rename-file").attr("data-path");$.ajax({type:"POST",url:"ajax_calls.php?action=chmod",data:{path:t,path_thumb:a}}).done(function(e){bootbox.dialog(e,[{label:$("#cancel").val(),"class":"btn"},{label:$("#ok").val(),"class":"btn-inverse",callback:function(){var e=$("#chmod_form #chmod_value").val();if(""!=e&&"undefined"!=typeof e){var i=$("#chmod_form input[name=apply_recursive]:checked").val();(""==i||"undefined"==typeof i)&&(i="none"),$.ajax({type:"POST",url:"execute.php?action=chmod",data:{path:t,path_thumb:a,new_mode:e,is_recursive:i}}).done(function(e){""!=e&&bootbox.alert(e)})}}}],{header:$("#lang_file_permission").val()})})}function chmod_logic(e){var a=[];if(a.user=0,a.group=0,a.all=0,"undefined"!=typeof e&&1==e){var t=$("#chmod_form #chmod_value").val();a.user=t.substr(0,1),a.group=t.substr(1,1),a.all=t.substr(2,1),$.each(a,function(e){(""==a[e]||0==$.isNumeric(a[e])||parseInt(a[e])<0||parseInt(a[e])>7)&&(a[e]="0")}),$("#chmod_form input:checkbox").each(function(){var e=$(this).attr("data-group"),t=$(this).attr("data-value");chmod_logic_helper(a[e],t)?$(this).prop("checked",!0):$(this).prop("checked",!1)})}else $("#chmod_form input:checkbox:checked").each(function(){var e=$(this).attr("data-group"),t=$(this).attr("data-value");a[e]=parseInt(a[e])+parseInt(t)}),$("#chmod_form #chmod_value").val(a.user.toString()+a.group.toString()+a.all.toString())}function chmod_logic_helper(e,a){var t=[];return t[1]=[1,3,5,7],t[2]=[2,3,6,7],t[4]=[4,5,6,7],e=parseInt(e),a=parseInt(a),-1!=$.inArray(e,t[a])?!0:!1}function clear_clipboard(){bootbox.confirm($("#lang_clear_clipboard_confirm").val(),$("#cancel").val(),$("#ok").val(),function(e){1==e&&$.ajax({type:"POST",url:"ajax_calls.php?action=clear_clipboard",data:{}}).done(function(e){""!=e?boo