1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
|
function fix_colums(e){var t=$(".breadcrumb").width()+e;$(".uploader").css("width",t);if($("#view").val()>0){if($("#view").val()==1)$("ul.grid li, ul.grid figure").css("width","100%");else{var n=Math.floor(t/380);if(n==0){n=1;$("h4").css("font-size",12)}t=Math.floor(t/n-3);$("ul.grid li, ul.grid figure").css("width",t)}$("#help").hide()}else Modernizr.touch&&$("#help").show()}function swipe_reaction(e,t,n,r,i){var s=$(this);if($("#view").val()==0)if(s.attr("toggle")==1){s.attr("toggle",0);s.animate({top:"0px"},{queue:!1,duration:300})}else{s.attr("toggle",1);s.animate({top:"-30px"},{queue:!1,duration:300})}}function apply(e,t){if($("#popup").val()==1)var n=window.opener;else var n=window.parent;var r=$("#cur_dir").val(),i=$("#base_url").val(),s=e.substr(0,e.lastIndexOf(".")),o=e.split(".").pop();o=o.toLowerCase();var u="",a=new Array("ogg","mp3","wav"),f=new Array("mp4","ogg","webm");if($.inArray(o,ext_img)>-1)u='<img src="'+i+r+e+'" alt="'+s+'" />';else if($.inArray(o,f)>-1)u='<video controls source src="'+i+r+e+'" type="video/'+o+'">'+s+"</video>";else if($.inArray(o,a)>-1){o=="mp3"&&(o="mpeg");u='<audio controls src="'+i+r+e+'" type="audio/'+o+'">'+s+"</audio>"}else u='<a href="'+i+r+e+'" title="'+s+'">'+s+"</a>";parent.tinymce.activeEditor.insertContent(u);parent.tinymce.activeEditor.windowManager.close()}function apply_link(e,t){if($("#popup").val()==1)var n=window.opener;else var n=window.parent;var r=$("#cur_dir").val();r=r.replace("\\","/");var i=$("#base_url").val();if(t!=""){var s=$("#"+t,n.document);$(s).val(i+r+e);$(s).trigger("change");close_window()}else apply_any(i+r,e)}function apply_img(e,t){if($("#popup").val()==1)var n=window.opener;else var n=window.parent;var r=$("#cur_dir").val();r=r.replace("\\","/");var i=$("#base_url").val();if(t!=""){var s=$("#"+t,n.document);$(s).val(i+r+e);$(s).trigger("change");close_window()}else apply_any(i+r,e)}function apply_video(e,t){if($("#popup").val()==1)var n=window.opener;else var n=window.parent;var r=$("#cur_dir").val();r=r.replace("\\","/");var i=$("#base_url").val();if(t!=""){var s=$("#"+t,n.document);$(s).val(i+r+e);$(s).trigger("change");close_window()}else apply_any(r,e)}function apply_none(e,t){var n=$('li[data-name="'+e+'"]').find(".preview");if(n.html()!=""&&n.html()!==undefined){$("#full-img").attr("src",decodeURIComponent(n.attr("data-url")));if(n.hasClass("disabled")==0){show_animation();$("#previewLightbox").lightbox()}}else{var n=$('li[data-name="'+e+'"]').find(".modalAV");$("#previewAV").removeData("modal");$("#previewAV").modal({backdrop:"static",keyboard:!1});n.hasClass("audio")?$(".body-preview").css("height","80px"):$(".body-preview").css("height","345px");$.ajax({url:decodeURIComponent(n.attr("data-url")),success:function(e){$(".body-preview").html(e)}})}return}function apply_any(e,t){e=e.replace("\\","/");parent.tinymce.activeEditor.windowManager.getParams().setUrl(e+t);parent.tinymce.activeEditor.windowManager.close();return!1}function close_window(){$("#popup").val()==1?window.close():typeof parent.jQuery!="undefined"&&parent.jQuery?parent.jQuery.fancybox.close():parent.$.fancybox.close()}function apply_file_duplicate(e,t){var n=e.parent().parent().parent().parent();n.after("<li class='"+n.attr("class")+"' data-name='"+n.attr("data-name")+"'>"+n.html()+"</li>");var r=n.next();apply_file_rename(r.find("figure"),t);var i=r.find(".download-form"),s="form"+(new Date).getTime();i.attr("id",s);i.find(".tip-right").attr("onclick","$('#"+s+"').submit();")}function apply_file_rename(e,t){e.attr("data-name",t);e.parent().attr("data-name",t);e.find("h4").find("a").text(t);var n=e.find("a.link"),r=n.attr("data-file"),i=r.substring(r.lastIndexOf("/")+1),s=r.substring(r.lastIndexOf(".")+1);n.each(function(){$(this).attr("data-file",encodeURIComponent(t+"."+s))});e.find("img").each(function(){var e=$(this).attr("src");$(this).attr("src",e.replace(i,t+"."+s));$(this).attr("alt",t+" thumbnails")});var o=e.find("a.preview"),r=o.attr("data-url");typeof r!="undefined"&&r&&o.attr("data-url",r.replace(encodeURIComponent(i),encodeURIComponent(t+"."+s)));e.parent(
|