PageSourceSearch

https://www.rostik.cz/design/frontend/libs/getfile/js/jquery.getfile.min.js

js rostik.cz collected 2026-10-05 18:08:30 UTC 16,629 bytes, 7 lines download raw bytes

1/*
2 *	GetFile v4.3 - 2015-09-23
3 *	jQuery Upload Plugin
4 *	(c) 2015 Syscover S.L. - http://www.syscover.com/
5 *	All rights reserved
6 */
7"use strict";!function(e){var t={options:{urlPlugin:".",folder:null,tmpFolder:null,srcFolder:null,srcFile:null,encryption:!1,filename:null,outputExtension:null,quality:100,multiple:!1,maxFileSize:!1,maxFilesSizes:!1,activateTmpDelete:!0,spinner:!0,mimesAccept:["image/*","video/*","audio/*","text/plain","application/pdf","application/msword","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],crop:{active:!1,width:null,height:null,quality:100,overwrite:!1,aspectRatio:null,setData:null},resize:{active:!1,width:null,height:null,quality:75,constrainProportions:!0},copies:[{width:null,height:null,quality:75,constrainProportions:!0,prefix:null,folder:null,outputExtension:null}],lang:{cropWindowTitle:"Crop image",previewTitle:"Preview",cropButtonText:"Crop",cancelButtonText:"Cancel"},selectorItems:{container:"#cropper-modal",cropButton:"#gfCropButton",cancelButton:"#gfCancelButton",crop:".img-container",image:".img-original",preview:".img-preview"}},items:{container:null,cropButton:null,cancelButton:null,crop:null,image:null,preview:null},properties:{files:null,coords:null,tmpDelete:345600,tmpName:"",oldName:null,extension:null,mime:null,size:null,isImage:null,width:null,height:null,pixelRatio:null,src:null,response:null},callback:null,init:function(t,i,o){var s=this;this.setOptions(t);var p={};if(p.urlPlugin=t.urlPlugin,e.ajax({cache:!1,dataType:"html",type:"POST",url:this.options.urlPlugin+"/getfile/views/popup.php",data:p,success:function(t){s.options.crop.active&&0==e(s.options.selectorItems.container).length&&e("body").append(t),s.items={container:e(s.options.selectorItems.container),cropButton:e(s.options.selectorItems.cropButton),cancelButton:e(s.options.selectorItems.cancelButton),crop:e(s.options.selectorItems.crop),image:e(s.options.selectorItems.image),preview:e(s.options.selectorItems.preview)},s.items.cancelButton.on("click",function(){e("#cropper-modal").modal("hide")}),null!=s.options.srcFolder&&s.loadSrc()},error:function(e){var e={success:!1,error:12,message:"The path: "+s.url+" in the ajax request is not correct, please check the ajax function data"};i(e)}}),t.mimesAccept&&(this.options.mimesAccept=t.mimesAccept),this.callback=i,this.element=e(o),null==this.options.srcFolder){if(this.options.multiple)var n={multiple:!0,logging:!1};else var n={logging:!1};if(0==this.options.mimesAccept||"[object Array]"===Object.prototype.toString.call(this.options.mimesAccept))window.fd.logging=!1,fd.jQuery(),e(this.element).filedrop(n).filedrop().event("send",function(e){s.upload(e)});else{var r={success:!1,error:11,message:"The mimesAccept setting must be an array or false. Setting it to false might be dangerous, since it means accepting all file types"};null!=this.callback&&this.callback(r)}}return this},setOptions:function(t){var i=this;void 0==t.copies?this.options.copies=[]:e.each(t.copies,function(o,s){t.copies[o]=e.extend({},i.options.copies[0],s||{})}),void 0!=t.crop&&(t.crop=e.extend({},this.options.crop,t.crop||{})),this.options=e.extend({},this.options,t||{})},setLangPopup:function(){e("#gfCropWindowTitle").html(this.options.lang.cropWindowTitle),e("#gfPreviewTitle").html(this.options.lang.previewTitle),e("#gfCropButton").html(this.options.lang.cropButtonText),e("#gfCancelButton").html(this.options.lang.cancelButtonText)},upload:function(t){var i=this;this.options.spinner&&e.cssLoader.show({urlPlugin:this.options.urlPlugin+"/getfile/libs",useLayer:!1,theme:"carousel"});var o=new FormData;if(this.options.multiple){var s=0;if(t.each(function(e){s+=e.size}),null!=this.options.maxFilesSizes&&0!=this.options.maxFilesSizes&&s>this.options.maxFilesSizes){this.options.spinner&&e.cssLoader.hide();var p=s/1048576,n=this.options.maxFilesSizes/1048576,r={success:!1,error:16,message:"The files whith weighing "+p.toFixed(2)+" Mb they does not been uploaded to the server, to exceed the maximum files sizes allowed of "+n.toFixed(2)+" Mb"};return this.callback(r),!1}var l=0,r=[];if(t.each(function(e){if(null!=i.options.maxFileSize&&0!=i.options.maxFileSize&&e.size>i.options.maxFileSize){var t=e.size/1048576,s=i.options.maxFileSize/1048576;r.push({success:!1,error:15,message:"The file "+e.name+" weighing "+t.toFixed(2)+" Mb has not been uploaded to the server, to exceed the maximum file size allowed of "+s.toFixed(2)+" Mb"})}else o.append("file"+l,e.nativeFile),l++}),!(l>0))return this.options.spinner&&e.cssLoader.hide(),r={success:!1,multiple:!0,files:r},this.callback(r),!1;r.length>0&&(this.properties.response=r),o.append("nFiles",l)}else{var a=t.first();if(null!=this.options.maxFileSize&&0!=this.options.maxFileSize&&a.size>this.options.maxFileSize||null!=this.options.maxFilesSizes&&0!=this.options.maxFilesSizes&&a.size>this.options.maxFilesSizes){this.options.spinner&&e.cssLoader.hide();var p=event.target.files[0].size/1048576,n=this.options.maxFileSize/1048576,r={success:!1,error:15,message:"The file "+event.target.files[0].name+" weighing "+p.toFixed(2)+" Mb has not been uploaded to the server, to exceed the maximum file size allowed of "+n.toFixed(2)+" Mb"};return this.callback(r),!1}o.append("file",a.nativeFile)}o.append("multiple",this.options.multiple),o.append("action","upload"),o.append("folder",this.options.folder),o.append("tmpFolder",this.options.tmpFolder),o.append("cropActive",this.options.crop.active),o.append("cropOverwrite",this.options.crop.overwrite),o.append("resizeActive",this.options.resize.active),o.append("outputExtension",this.options.outputExtension),o.append("encryption",this.options.encryption),o.append("filename",this.options.filename),o.append("mimesAccept",this.options.mimesAccept),o.append("activateTmpDelete",this.options.activateTmpDelete),o.append("tmpDelete",this.properties.tmpDelete),e.ajax({url:this.options.urlPlugin+"/getfile/php/Controllers/server.php",data:o,type:"POST",dataType:"json",cache:!1,contentType:!1,processData:!1,xhr:function(){var e=new window.XMLHttpRequest;return e.upload.addEventListener("progress",function(e){if(e.lengthComputable&&null!=i.callback){var t=e.loaded/e.total*100|0,o={success:!0,action:"loading",total:e.total,loaded:e.loaded,percentage:t};i.callback(o)}},!1),e}
7,error:function(o){if(i.options.spinner&&e.cssLoader.hide(),i.options.multiple){var s=[];e.each(t,function(e,t){var p=t.size/1048576,n={success:!1,error:13,message:"The file "+t.name+" weighing "+p.toFixed(2)+" Mb has not been uploaded to the server, to exceed the maximum file size allowed to server: "+i.phpIni.postMaxSize,exception:o};s.push(n)}),i.callback(s)}else{var p=t.first(),n=p.size/1048576,s={success:!1,error:13,message:"The file "+p.name+" weighing "+n.toFixed(2)+" Mb has not been uploaded to the server, to exceed the maximum file size allowed to server:"+i.phpIni.postMaxSize,exception:o};i.callback(s)}},success:function(t){if(i.element.trigger("getfile:uploaded",{success:!0,data:t}),i.options.multiple?i.properties.files=t.files:(i.properties.tmpName=t.name,i.properties.size=t.size,i.properties.oldName=t.oldName,i.properties.extension=t.extension,i.properties.mime=t.mime,i.properties.isImage=t.isImage),i.options.crop.active&&t.isImage&&0==i.options.multiple)i.element.one("getfile:throwcrop",function(o){o.isDefaultPrevented()||(i.properties.width=t.width,i.properties.height=t.height,i.properties.pixelRatio=window.devicePixelRatio,e("#cropper-modal").off("shown.bs.modal").on("shown.bs.modal",function(){i.crop(i.options.tmpFolder+"/"+t.name)}).off("hidden.bs.modal").on("hidden.bs.modal",function(){e(i.items.image).prop("src",""),e(i.items.image).cropper("destroy")}),i.items.cropButton.off("click").on("click",function(){i.executeCrop()}),i.setLangPopup(),e("#cropper-modal").modal("show"))}),i.element.trigger("getfile:throwcrop",{success:!0,data:t});else if(i.options.resize.active&&t.isImage||i.options.resize.active&&1==i.options.multiple)i.element.one("getfile:throwresize",function(o){if(!o.isDefaultPrevented())if(i.options.multiple){var s=!1;e.each(i.properties.files,function(e,t){return 1==t.isImage?(s=!0,i.executeResize(),!1):void 0}),s||null==i.callback||i.callback(t)}else i.executeResize()}),i.element.trigger("getfile:throwresize",{success:!0,data:t});else if(null!=i.options.outputExtension&&t.isImage||null!=i.options.outputExtension&&1==i.options.multiple)if(i.options.multiple){var o=!1;e.each(i.properties.files,function(e,t){return 1==t.isImage?(o=!0,i.executeChangeExtension(),!1):void 0}),o||null==i.callback||i.callback(t)}else i.executeChangeExtension();else if(i.options.copies.length>0&&t.isImage||i.options.copies.length>0&&1==i.options.multiple)if(i.options.multiple){var o=!1;e.each(i.properties.files,function(e,s){return 1==s.isImage?(o=!0,i.executeCopies(t),!1):void 0}),o||null==i.callback||i.callback(t)}else i.executeCopies(t);else null!=i.callback&&(i.options.multiple&&e.merge(t.files,r),i.callback(t));i.options.spinner&&e.cssLoader.hide()}})},loadSrc:function(){var t=this;this.options.tmpFolder=this.options.srcFolder,this.properties.src=this.options.tmpFolder+"/"+this.options.srcFile,e("#cropper-modal").off("shown.bs.modal").on("shown.bs.modal",function(){t.crop(t.properties.src)}).off("hidden.bs.modal").on("hidden.bs.modal",function(){e(t.items.image).prop("src",""),e(t.items.image).cropper("destroy")}),e.ajax({url:this.options.urlPlugin+"/getfile/php/Controllers/server.php",data:{action:"getinfosrc",src:t.properties.src},type:"POST",dataType:"json",cache:!1,success:function(i){t.element.one("getfile:throwcrop",function(o){o.isDefaultPrevented()||(t.properties.tmpName=i.oldName,t.properties.size=i.size,t.properties.oldName=i.oldName,t.properties.extension=i.extension,t.properties.mime=i.mime,t.properties.isImage=i.isImage,t.properties.width=i.width,t.properties.height=i.height,t.properties.pixelRatio=window.devicePixelRatio,t.items.cropButton.off("click").on("click",function(){t.executeCrop()}),t.setLangPopup(),e("#cropper-modal").modal("show"))}),t.element.trigger("getfile:throwcrop",{success:!0,data:i})}})},crop:function(t){var i=this;if(!e.fn.cropper){var o={success:!1,error:3,message:"Cropper library not loaded"};null!=this.callback&&this.callback(o)}if(this.options.crop.height&&this.options.crop.width)this.options.crop.aspectRatio=this.options.crop.width/this.options.crop.height;else if(isNaN(this.options.crop.aspectRatio)){var o={success:!1,error:4,message:"Width and Height or Ratio must be defined"};null!=this.callback&&this.callback(o)}e(this.items.image).prop("src",t),e(this.items.image).cropper({aspectRatio:this.options.crop.aspectRatio,preview:".img-preview",strict:!0,built:function(){null!=i.options.crop.setData&&e(this).cropper("setData",i.options.crop.setData)},crop:function(e){i.properties.coords={x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),rotate:Math.round(e.rotate)}}});var s=!!navigator.userAgent.match(/Trident.*rv[ :]*11\./);s&&(this.properties.tmpNameIE11=this.properties.tmpName,this.properties.sizeIE11=this.properties.size,this.properties.oldNameIE11=this.properties.oldName,this.properties.extensionIE11=this.properties.extension,this.properties.mimeIE11=this.properties.mime,this.properties.isImageIE11=this.properties.isImage)},executeCrop:function(){var t=this;e.ajax({url:this.options.urlPlugin+"/getfile/php/Controllers/server.php",type:"POST",dataType:"json",cache:!1,data:{action:"crop",tmpName:void 0==this.properties.tmpName?this.properties.tmpNameIE11:this.properties.tmpName,size:void 0==this.properties.size?this.properties.sizeIE11:this.properties.size,oldName:void 0==this.properties.oldName?this.properties.oldNameIE11:this.properties.oldName,extension:void 0==this.properties.extension?this.properties.extensionIE11:this.properties.extension,mime:void 0==this.properties.mime?this.properties.mimeIE11:this.properties.mime,isImage:void 0==this.properties.isImage?this.properties.isImageIE11:this.properties.isImage,coords:this.properties.coords,cropWidth:this.options.crop.width,cropHeight:this.options.crop.height,quality:this.options.crop.quality,overwrite:this.options.crop.overwrite,aspectRatio:this.options.crop.aspectRatio,tmpFolder:this.options.tmpFolder,folder:this.options.folder,outputExtension:this.options.outputExtension,copies:this.options.copies},success:function(i){e("#cropper-modal").modal("hide"),null!=t.callback&&t.callback(i)},error:function(e){null!=t.callback&&t.callback(e.responseJSON)}})},showCropWindow:function(){var t=this;t.element.one("getfile:throwcrop",function(i){i.isDefaultPrevented()||(t.items.cropButton.off("click").on("click",function(){t.executeCrop()}),t.setLangPopup(),e("#cropper-modal").modal("show"))}),t.element.trigger("getfile:throwcrop",{success:!0,data:t.properties})},executeResize:function(){var t=this;if(this.options.multiple)var i={action:"resize",multiple:!0,files:this.properties.files,tmpFolder:this.options.tmpFolder,folder:this.options.folder,quality:this.options.resize.quality,width:this.options.resize.width,height:this.options.resize.height,constrainProportions:this.options.resize.constrainProportions,outputExtension:this.options.outputExtension,copies:this.options.copies};else var i={action:"resize",multiple:!1,tmpName:this.properties.tmpName,size:this.properties.size,oldName:this.properties.oldName,extension:this.properties.extension,mime:this.properties.mime,isImage:this.properties.isImage,tmpFolder:this.options.tmpFolder,folder:this.options.folder,quality:this.options.resize.quality,width:this.options.resize.width,height:this.options.resize.height,constrainProportions:this.options.resize.constrainProportions,outputExtension:this.options.outputExtension,copies:this.options.copies};e.ajax({url:this.options.urlPlugin+"/getfile/php/Controllers/server.php",type:"POST",dataType:"json",cache:!1,data:i,success:function(i){null!=t.callback&&(t.options.multiple&&null!=t.properties.response&&e.merge(i.files,t.properties.response),t.callback(i))},error:function(e){null!=t.callback&&t.callback(e.responseJSON)}})},executeChangeExtension:function(){var t=this;if(this.options.multiple)var i={action:"change",multiple:!0,files:this.properties.files,tmpFolder:this.options.tmpFolder,folder:this.options.folder,outputExtension:this.options.outputExtension,quality:this.options.quality,copies:this.options.copies};else var i={action:"change",multiple:!1,tmpName:this.properties.tmpName,size:this.properties.size,oldName:this.properties.oldName,extension:this.properties.extension,mime:this.properties.mime,isImage:this.properties.isImage,tmpFolder:this.options.tmpFolder,folder:this.options.folder,outputExtension:this.options.outputExtension,quality:this.options.quality,copies:this.options.copies};e.ajax({url:this.options.urlPlugin+"/getfile/php/Controllers/server.php",type:"POST",dataType:"json",cache:!1,data:i,success:function(i){null!=t.callback&&(t.options.multiple&&null!=t.properties.response&&e.merge(i.files,t.properties.response),t.callback(i))},error:function(e){null!=t.callback&&t.callback(e.responseJSON)}})},executeCopies:function(t){var i=this;t.action="copies",t.folder=this.options.folder,t.copies=this.options.copies,this.options.multiple?(t.multiple=!0,t.files=this.properties.files):t.multiple=!1,e.ajax({url:this.options.urlPlugin+"/getfile/php/Controllers/server.php",type:"POST",dataType:"json",cache:!1,data:t,success:function(t){null!=i.callback&&(i.options.multiple&&null!=i.properties.response&&e.merge(t.files,i.properties.response),i.callback(t))},error:function(e){null!=i.callback&&i.callback(e.responseJSON)}})},"delete":function(t,i){e.ajax({url:this.options.urlPlugin+"/getfile/php/Controllers/server.php",type:"POST",dataType:"json",cache:!1,data:{action:"delete",filenames:t},success:function(e){null!=i&&i(e)}})}};"function"!=typeof Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),e.fn.getFile=function(i,o){return t.hasOwnProperty("phpIni")||e.ajax({url:i.urlPlugin+"/getfile/php/Controllers/server.php",type:"POST",dataType:"json",cache:!1,data:{action:"getvars"},success:function(e){t.phpIni=e}}),this.data("getFile")?this.data("getFile"):this.data("getFile",Object.create(t).init(i,o,this))},e.getFile=function(i,o){return t.hasOwnProperty("phpIni")||e.ajax({url:i.urlPlugin+"/getfile/php/Controllers/server.php",type:"POST",dataType:"json",cache:!1,data:{action:"getvars"},success:function(e){t.phpIni=e}}),e.data(document,"getFile",Object.create(t).init(i,o,document)),e(document)}}(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.