diff --git a/Classes/FileUpload/UploadManager.php b/Classes/FileUpload/UploadManager.php index a984461..aa8a13a 100644 --- a/Classes/FileUpload/UploadManager.php +++ b/Classes/FileUpload/UploadManager.php @@ -18,7 +18,6 @@ use TYPO3\CMS\Core\Resource\File; use TYPO3\CMS\Core\Resource\Security\FileNameValidator; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; -use TYPO3\CMS\Core\Utility\File\BasicFileUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; /** diff --git a/Classes/Service/UploadFileService.php b/Classes/Service/UploadFileService.php index 3964ece..e427e5e 100644 --- a/Classes/Service/UploadFileService.php +++ b/Classes/Service/UploadFileService.php @@ -26,7 +26,7 @@ class UploadFileService */ public function getUploadedFileList($property = '') { - $parameters = GeneralUtility::_GPmerged('tx_mediaupload_pi1'); + $parameters = GeneralUtility::_GPmerged('tx_mediaupload_upload'); return empty($parameters['uploadedFiles'][$property]) ? '' : $parameters['uploadedFiles'][$property]; } diff --git a/Classes/ViewHelpers/Widget/ShowUploadedViewHelper.php b/Classes/ViewHelpers/Widget/ShowUploadedViewHelper.php index 4145d48..fcb423c 100644 --- a/Classes/ViewHelpers/Widget/ShowUploadedViewHelper.php +++ b/Classes/ViewHelpers/Widget/ShowUploadedViewHelper.php @@ -32,26 +32,26 @@ public function initializeArguments() '', ); } - public function render(): string - { - $uploadFileService = GeneralUtility::makeInstance( - UploadFileService::class, - ); - - return static::renderStatic( - [ - 'property' => $this->arguments['property'], - 'uploadedFileList' => $uploadFileService->getUploadedFileList( - $this->arguments['property'], - ), - 'uploadedFiles' => $uploadFileService->getUploadedFiles( - $this->arguments['property'], - ), - ], - $this->buildRenderChildrenClosure(), - $this->renderingContext, - ); - } + #public function render(): string + #{ + # $uploadFileService = GeneralUtility::makeInstance( + # UploadFileService::class, + # ); + # + # return static::renderStatic( + # [ + # 'property' => $this->arguments['property'], + # 'uploadedFileList' => $uploadFileService->getUploadedFileList( + # $this->arguments['property'], + # ), + # 'uploadedFiles' => $uploadFileService->getUploadedFiles( + # $this->arguments['property'], + # ), + # ], + # $this->buildRenderChildrenClosure(), + # $this->renderingContext, + # ); + #} public static function renderStatic( array $arguments, diff --git a/Classes/ViewHelpers/Widget/UploadViewHelper.php b/Classes/ViewHelpers/Widget/UploadViewHelper.php index bc9bec5..204e2a5 100644 --- a/Classes/ViewHelpers/Widget/UploadViewHelper.php +++ b/Classes/ViewHelpers/Widget/UploadViewHelper.php @@ -8,9 +8,7 @@ * LICENSE.md file that was distributed with this source code. */ -use Fab\Media\Utility\PermissionUtility; use Fab\MediaUpload\Service\UploadFileService; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; @@ -66,38 +64,55 @@ public function initializeArguments() ); } - public function render(): string - { - $uploadFileService = GeneralUtility::makeInstance( - UploadFileService::class, - ); - - return static::renderStatic( - [ - 'allowedExtensions' => $this->arguments['allowedExtensions'], - 'maximumSize' => $this->arguments['maximumSize'], - 'maximumSizeLabel' => self::getMaximumSizeLabel( - (int) $this->arguments['maximumSize'], - ), - 'sizeUnit' => $this->arguments['sizeUnit'], - 'storage' => $this->arguments['storage'], - 'maximumItems' => $this->arguments['maximumItems'], - 'property' => $this->arguments['property'], - 'uploadedFileList' => $uploadFileService->getUploadedFileList( - $this->arguments['property'], - ), - 'widgetIdentifier' => uniqid(), - ], - $this->buildRenderChildrenClosure(), - $this->renderingContext, - ); - } + #public function render(): string + #{ + # $uploadFileService = GeneralUtility::makeInstance( + # UploadFileService::class, + # ); + # return static::renderStatic( + # [ + # 'allowedExtensions' => $this->arguments['allowedExtensions'], + # 'maximumSize' => $this->arguments['maximumSize'], + # 'maximumSizeLabel' => 'qwer' . self::getMaximumSizeLabel( + # (int) $this->arguments['maximumSize'], + # ), + # 'sizeUnit' => $this->arguments['sizeUnit'], + # 'storage' => $this->arguments['storage'], + # 'maximumItems' => $this->arguments['maximumItems'], + # 'property' => $this->arguments['property'], + # 'uploadedFileList' => $uploadFileService->getUploadedFileList( + # $this->arguments['property'], + # ), + # 'widgetIdentifier' => uniqid(), + # ], + # $this->buildRenderChildrenClosure(), + # $this->renderingContext, + # ); + #} public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext ): string { + + $uploadFileService = GeneralUtility::makeInstance( + UploadFileService::class, + ); + + $arguments['maximumSizeLabel'] = self::getMaximumSizeLabel( + (int)$arguments['maximumSize'], + ); + + if ($arguments['maximumSize'] === 0) { + $arguments['maximumSize'] = GeneralUtility::getMaxUploadFileSize() * 1024; + } + + $arguments['uploadedFileList'] = $uploadFileService->getUploadedFileList( + $arguments['property'], + ); + + $arguments['widgetIdentifier'] = uniqid(); /** @var StandaloneView $view */ $view = GeneralUtility::makeInstance(StandaloneView::class); @@ -124,7 +139,7 @@ public static function getMaximumSizeLabel(int $maximumSize = 0): int */ public static function getUploadedFileList($property = ''): string { - $parameters = GeneralUtility::_GPmerged('tx_mediaupload_pi1'); + $parameters = GeneralUtility::_GPmerged('tx_mediaupload_upload'); return empty($parameters['uploadedFiles'][$property]) ? '' : $parameters['uploadedFiles'][$property]; diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index c18b060..683de96 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -45,12 +45,7 @@ page_1386871773 { userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run vendorName = Fab extensionName = MediaUpload - pluginName = Pi1 - switchableControllerActions { - MediaUpload { - 1 = upload - } - } + pluginName = Upload } } @@ -70,14 +65,8 @@ page_1386871774 { 10 = USER_INT 10 { userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run - vendorName = Fab extensionName = MediaUpload - pluginName = Pi1 - switchableControllerActions { - MediaUpload { - 1 = delete - } - } + pluginName = Delete } -} \ No newline at end of file +} diff --git a/Resources/Private/Assets/JavaScript/MediaUpload.js b/Resources/Private/Assets/JavaScript/MediaUpload.js index dfa4d3d..3ed4db4 100644 --- a/Resources/Private/Assets/JavaScript/MediaUpload.js +++ b/Resources/Private/Assets/JavaScript/MediaUpload.js @@ -72,7 +72,7 @@ }) .on('submit', {_settings: settings}, function(event) { var params = {}; - var parameterPrefix = 'tx_mediaupload_pi1'; + var parameterPrefix = 'tx_mediaupload_upload'; params[parameterPrefix + '[storageIdentifier]'] = event.data._settings.storage; params['type'] = '1386871773'; $(this).fineUploader('setParams', params); diff --git a/Resources/Private/Templates/ViewHelpers/Widget/ShowUploaded/Index.html b/Resources/Private/Templates/ViewHelpers/Widget/ShowUploaded/Index.html index 7f84107..baec730 100644 --- a/Resources/Private/Templates/ViewHelpers/Widget/ShowUploaded/Index.html +++ b/Resources/Private/Templates/ViewHelpers/Widget/ShowUploaded/Index.html @@ -1,7 +1,7 @@
+ name="tx_mediaupload_upload[uploadedFiles][{property}]" value="{uploadedFileList}" />
-{namespace m=TYPO3\CMS\Media\ViewHelpers} \ No newline at end of file +{namespace m=TYPO3\CMS\Media\ViewHelpers} diff --git a/Resources/Private/Templates/ViewHelpers/Widget/Upload/Index.html b/Resources/Private/Templates/ViewHelpers/Widget/Upload/Index.html index d768e7d..7c6af8e 100644 --- a/Resources/Private/Templates/ViewHelpers/Widget/Upload/Index.html +++ b/Resources/Private/Templates/ViewHelpers/Widget/Upload/Index.html @@ -1,21 +1,21 @@
+ name="tx_mediaupload_upload[uploadedFiles][{property}]" value="{uploadedFileList}"/>
diff --git a/Resources/Public/Build/media_upload.js b/Resources/Public/Build/media_upload.js index ddf99c3..1090cf4 100644 --- a/Resources/Public/Build/media_upload.js +++ b/Resources/Public/Build/media_upload.js @@ -10,7 +10,7 @@ * Repository: git://github.com/FineUploader/fine-uploader.git * * Licensed only under the MIT license (http://fineuploader.com/licensing). -*/ +*/ (function(global) { @@ -10732,9 +10732,9 @@ qq.extend(qq.Scaler.prototype, { qq.ExifRestorer = (function() { - + var ExifRestorer = {}; - + ExifRestorer.KEY_STR = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + @@ -10775,7 +10775,7 @@ qq.ExifRestorer = (function() return output; }; - + ExifRestorer.restore = function(origFileBase64, resizedFileBase64) { var expectedBase64Header = "data:image/jpeg;base64,"; @@ -10783,15 +10783,15 @@ qq.ExifRestorer = (function() if (!origFileBase64.match(expectedBase64Header)) { return resizedFileBase64; - } - + } + var rawImage = this.decode64(origFileBase64.replace(expectedBase64Header, "")); var segments = this.slice2Segments(rawImage); - + var image = this.exifManipulation(resizedFileBase64, segments); - + return expectedBase64Header + this.encode64(image); - + }; @@ -10835,7 +10835,7 @@ qq.ExifRestorer = (function() }; - + ExifRestorer.slice2Segments = function(rawImageArray) { var head = 0, @@ -10863,8 +10863,8 @@ qq.ExifRestorer = (function() }; - - ExifRestorer.decode64 = function(input) + + ExifRestorer.decode64 = function(input) { var output = "", chr1, chr2, chr3 = "", @@ -10907,7 +10907,7 @@ qq.ExifRestorer = (function() return buf; }; - + return ExifRestorer; })(); @@ -11791,7 +11791,7 @@ else { }) .on('submit', {_settings: settings}, function(event) { var params = {}; - var parameterPrefix = 'tx_mediaupload_pi1'; + var parameterPrefix = 'tx_mediaupload_upload'; params[parameterPrefix + '[storageIdentifier]'] = event.data._settings.storage; params['type'] = '1386871773'; $(this).fineUploader('setParams', params); diff --git a/Resources/Public/Build/media_upload.min.js b/Resources/Public/Build/media_upload.min.js index bedea09..94bbb07 100644 --- a/Resources/Public/Build/media_upload.min.js +++ b/Resources/Public/Build/media_upload.min.js @@ -10,7 +10,7 @@ * Repository: git://github.com/FineUploader/fine-uploader.git * * Licensed only under the MIT license (http://fineuploader.com/licensing). -*/ +*/ !function(global){var qq=function(a){"use strict";return{hide:function(){return a.style.display="none",this},attach:function(b,c){return a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c),function(){qq(a).detach(b,c)}},detach:function(b,c){return a.removeEventListener?a.removeEventListener(b,c,!1):a.attachEvent&&a.detachEvent("on"+b,c),this},contains:function(b){return b?a===b?!0:a.contains?a.contains(b):!!(8&b.compareDocumentPosition(a)):!1},insertBefore:function(b){return b.parentNode.insertBefore(a,b),this},remove:function(){return a.parentNode.removeChild(a),this},css:function(b){if(null==a.style)throw new qq.Error("Can't apply style to node as it is not on the HTMLElement prototype chain!");return null!=b.opacity&&"string"!=typeof a.style.opacity&&"undefined"!=typeof a.filters&&(b.filter="alpha(opacity="+Math.round(100*b.opacity)+")"),qq.extend(a.style,b),this},hasClass:function(b,c){var d=new RegExp("(^| )"+b+"( |$)");return d.test(a.className)||!(!c||!d.test(a.parentNode.className))},addClass:function(b){return qq(a).hasClass(b)||(a.className+=" "+b),this},removeClass:function(b){var c=new RegExp("(^| )"+b+"( |$)");return a.className=a.className.replace(c," ").replace(/^\s+|\s+$/g,""),this},getByClass:function(b,c){var d,e=[];return c&&a.querySelector?a.querySelector("."+b):a.querySelectorAll?a.querySelectorAll("."+b):(d=a.getElementsByTagName("*"),qq.each(d,function(a,c){qq(c).hasClass(b)&&e.push(c)}),c?e[0]:e)},getFirstByClass:function(b){return qq(a).getByClass(b,!0)},children:function(){for(var b=[],c=a.firstChild;c;)1===c.nodeType&&b.push(c),c=c.nextSibling;return b},setText:function(b){return a.innerText=b,a.textContent=b,this},clearText:function(){return qq(a).setText("")},hasAttribute:function(b){var c;return a.hasAttribute?a.hasAttribute(b)?null==/^false$/i.exec(a.getAttribute(b)):!1:(c=a[b],void 0===c?!1:null==/^false$/i.exec(c))}}};!function(){"use strict";qq.canvasToBlob=function(a,b,c){return qq.dataUriToBlob(a.toDataURL(b,c))},qq.dataUriToBlob=function(a){var b,c,d,e,f=function(a,b){var c=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,d=c&&new c;return d?(d.append(a),d.getBlob(b)):new Blob([a],{type:b})};return c=a.split(",")[0].indexOf("base64")>=0?atob(a.split(",")[1]):decodeURI(a.split(",")[1]),e=a.split(",")[0].split(":")[1].split(";")[0],b=new ArrayBuffer(c.length),d=new Uint8Array(b),qq.each(c,function(a,b){d[a]=b.charCodeAt(0)}),f(b,e)},qq.log=function(a,b){window.console&&(b&&"info"!==b?window.console[b]?window.console[b](a):window.console.log("<"+b+"> "+a):window.console.log(a))},qq.isObject=function(a){return a&&!a.nodeType&&"[object Object]"===Object.prototype.toString.call(a)},qq.isFunction=function(a){return"function"==typeof a},qq.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)||a&&window.ArrayBuffer&&a.buffer&&a.buffer.constructor===ArrayBuffer},qq.isItemList=function(a){return"[object DataTransferItemList]"===Object.prototype.toString.call(a)},qq.isNodeList=function(a){return"[object NodeList]"===Object.prototype.toString.call(a)||a.item&&a.namedItem},qq.isString=function(a){return"[object String]"===Object.prototype.toString.call(a)},qq.trimStr=function(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},qq.format=function(a){var b=Array.prototype.slice.call(arguments,1),c=a,d=c.indexOf("{}");return qq.each(b,function(a,b){var e=c.substring(0,d),f=c.substring(d+2);return c=e+b+f,d=c.indexOf("{}",d+b.length),0>d?!1:void 0}),c},qq.isFile=function(a){return window.File&&"[object File]"===Object.prototype.toString.call(a)},qq.isFileList=function(a){return window.FileList&&"[object FileList]"===Object.prototype.toString.call(a)},qq.isFileOrInput=function(a){return qq.isFile(a)||qq.isInput(a)},qq.isInput=function(a,b){var c=function(a){var c=a.toLowerCase();return b?"file"!==c:"file"===c};return window.HTMLInputElement&&"[object HTMLInputElement]"===Object.prototype.toString.call(a)&&a.type&&c(a.type)?!0:a.tagName&&"input"===a.tagName.toLowerCase()&&a.type&&c(a.type)?!0:!1},qq.isBlob=function(a){return window.Blob&&"[object Blob]"===Object.prototype.toString.call(a)?!0:void 0},qq.isXhrUploadSupported=function(){var a=document.createElement("input");return a.type="file",void 0!==a.multiple&&"undefined"!=typeof File&&"undefined"!=typeof FormData&&"undefined"!=typeof qq.createXhrInstance().upload},qq.createXhrInstance=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(a){return qq.log("Neither XHR or ActiveX are supported!","error"),null}},qq.isFolderDropSupported=function(a){return a.items&&a.items.length>0&&a.items[0].webkitGetAsEntry},qq.isFileChunkingSupported=function(){return!qq.androidStock()&&qq.isXhrUploadSupported()&&(void 0!==File.prototype.slice||void 0!==File.prototype.webkitSlice||void 0!==File.prototype.mozSlice)},qq.sliceBlob=function(a,b,c){var d=a.slice||a.mozSlice||a.webkitSlice;return d.call(a,b,c)},qq.arrayBufferToHex=function(a){var b="",c=new Uint8Array(a);return qq.each(c,function(a,c){var d=c.toString(16);d.length<2&&(d="0"+d),b+=d}),b},qq.readBlobToHex=function(a,b,c){var d=qq.sliceBlob(a,b,b+c),e=new FileReader,f=new qq.Promise;return e.onload=function(){f.success(qq.arrayBufferToHex(e.result))},e.onerror=f.failure,e.readAsArrayBuffer(d),f},qq.extend=function(a,b,c){return qq.each(b,function(b,d){c&&qq.isObject(d)?(void 0===a[b]&&(a[b]={}),qq.extend(a[b],d,!0)):a[b]=d}),a},qq.override=function(a,b){var c={},d=b(c);return qq.each(d,function(b,d){void 0!==a[b]&&(c[b]=a[b]),a[b]=d}),a},qq.indexOf=function(a,b,c){if(a.indexOf)return a.indexOf(b,c);c=c||0;var d=a.length;for(0>c&&(c+=d);d>c;c+=1)if(a.hasOwnProperty(c)&&a[c]===b)return c;return-1},qq.getUniqueId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=0|16*Math.random(),c="x"==a?b:8|3&b;return c.toString(16)})},qq.ie=function(){return-1!==navigator.userAgent.indexOf("MSIE")||-1!==navigator.userAgent.indexOf("Trident")},qq.ie7=function(){return-1!==navigator.userAgent.indexOf("MSIE 7")},qq.ie8=function(){return-1!==navigator.userAgent.indexOf("MSIE 8")},qq.ie10=function(){return-1!==navigator.userAgent.indexOf("MSIE 10")},qq.ie11=function(){return qq.ie()&&-1!==navigator.userAgent.indexOf("rv:11")},qq.edge=function(){return navigator.userAgent.indexOf("Edge")>=0},qq.safari=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Apple")},qq.chrome=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Google")},qq.opera=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Opera")},qq.firefox=function(){return!qq.edge()&&!qq.ie11()&&-1!==navigator.userAgent.indexOf("Mozilla")&&void 0!==navigator.vendor&&""===navigator.vendor},qq.windows=function(){return"Win32"===navigator.platform},qq.android=function(){return-1!==navigator.userAgent.toLowerCase().indexOf("android")},qq.androidStock=function(){return qq.android()&&navigator.userAgent.toLowerCase().indexOf("chrome")<0},qq.ios6=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 6_")},qq.ios7=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 7_")},qq.ios8=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 8_")},qq.ios800=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 8_0 ")},qq.ios=function(){return-1!==navigator.userAgent.indexOf("iPad")||-1!==navigator.userAgent.indexOf("iPod")||-1!==navigator.userAgent.indexOf("iPhone")},qq.iosChrome=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf("CriOS")},qq.iosSafari=function(){return qq.ios()&&!qq.iosChrome()&&-1!==navigator.userAgent.indexOf("Safari")},qq.iosSafariWebView=function(){return qq.ios()&&!qq.iosChrome()&&!qq.iosSafari()},qq.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},qq.toElement=function(){var a=document.createElement("div");return function(b){a.innerHTML=b;var c=a.firstChild;return a.removeChild(c),c}}(),qq.each=function(a,b){var c,d;if(a)if(window.Storage&&a.constructor===window.Storage)for(c=0;c0?a.substr(b,a.length-b):void 0},qq.getFilename=function(a){return qq.isInput(a)?a.value.replace(/.*(\/|\\)/,""):qq.isFile(a)&&null!==a.fileName&&void 0!==a.fileName?a.fileName:a.name},qq.DisposeSupport=function(){var a=[];return{dispose:function(){var b;do b=a.shift(),b&&b();while(b)},attach:function(){var a=arguments;this.addDisposer(qq(a[0]).attach.apply(this,Array.prototype.slice.call(arguments,1)))},addDisposer:function(b){a.push(b)}}}}(),function(){"use strict";qq.Error=function(a){this.message="[Fine Uploader "+qq.version+"] "+a},qq.Error.prototype=new Error}(),qq.version="5.10.1",qq.supportedFeatures=function(){"use strict";function a(){var a,b=!0;try{a=document.createElement("input"),a.type="file",qq(a).hide(),a.disabled&&(b=!1)}catch(c){b=!1}return b}function b(){return(qq.chrome()||qq.opera())&&void 0!==navigator.userAgent.match(/Chrome\/[2][1-9]|Chrome\/[3-9][0-9]/)}function c(){return(qq.chrome()||qq.opera())&&void 0!==navigator.userAgent.match(/Chrome\/[1][4-9]|Chrome\/[2-9][0-9]/)}function d(){if(window.XMLHttpRequest){var a=qq.createXhrInstance();return void 0!==a.withCredentials}return!1}function e(){return void 0!==window.XDomainRequest}function f(){return d()?!0:e()}function g(){return void 0!==document.createElement("input").webkitdirectory}function h(){try{return!!window.localStorage&&qq.isFunction(window.localStorage.setItem)}catch(a){return!1}}function i(){var a=document.createElement("span");return("draggable"in a||"ondragstart"in a&&"ondrop"in a)&&!qq.android()&&!qq.ios()}var j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return j=a(),m=j&&qq.isXhrUploadSupported(),k=m&&!qq.androidStock(),l=m&&i(),n=l&&b(),o=m&&qq.isFileChunkingSupported(),p=m&&o&&h(),q=m&&c(),r=j&&(void 0!==window.postMessage||m),t=d(),s=e(),u=f(),v=g(),w=m&&void 0!==window.FileReader,x=function(){return m?!qq.androidStock()&&!qq.iosChrome():!1}(),{ajaxUploading:m,blobUploading:k,canDetermineSize:m,chunking:o,deleteFileCors:u,deleteFileCorsXdr:s,deleteFileCorsXhr:t,dialogElement:!!window.HTMLDialogElement,fileDrop:l,folderDrop:n,folderSelection:v,imagePreviews:w,imageValidation:w,itemSizeValidation:m,pause:o,progressBar:x,resume:p,scaling:w&&k,tiffPreviews:qq.safari(),unlimitedScaledImageSize:!qq.ios(),uploading:j,uploadCors:r,uploadCustomHeaders:m,uploadNonMultipart:m,uploadViaPaste:q}}(),qq.isGenericPromise=function(a){"use strict";return!!(a&&a.then&&qq.isFunction(a.then))},qq.Promise=function(){"use strict";var a,b,c=[],d=[],e=[],f=0;qq.extend(this,{then:function(e,g){return 0===f?(e&&c.push(e),g&&d.push(g)):-1===f?g&&g.apply(null,b):e&&e.apply(null,a),this},done:function(c){return 0===f?e.push(c):c.apply(null,void 0===b?a:b),this},success:function(){return f=1,a=arguments,c.length&&qq.each(c,function(b,c){c.apply(null,a)}),e.length&&qq.each(e,function(b,c){c.apply(null,a)}),this},failure:function(){return f=-1,b=arguments,d.length&&qq.each(d,function(a,c){c.apply(null,b)}),e.length&&qq.each(e,function(a,c){c.apply(null,b)}),this}})},qq.BlobProxy=function(a,b){"use strict";qq.extend(this,{referenceBlob:a,create:function(){return b(a)}})},qq.UploadButton=function(a){"use strict";function b(){var a=document.createElement("input");return a.setAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME,d),a.setAttribute("title",g.title),e.setMultiple(g.multiple,a),g.folders&&qq.supportedFeatures.folderSelection&&a.setAttribute("webkitdirectory",""),g.acceptFiles&&a.setAttribute("accept",g.acceptFiles),a.setAttribute("type","file"),a.setAttribute("name",g.name),qq(a).css({position:"absolute",right:0,top:0,fontFamily:"Arial",fontSize:qq.ie()&&!qq.ie8()?"3500px":"118px",margin:0,padding:0,cursor:"pointer",opacity:0}),!qq.ie7()&&qq(a).css({height:"100%"}),g.element.appendChild(a),f.attach(a,"change",function(){g.onChange(a)}),f.attach(a,"mouseover",function(){qq(g.element).addClass(g.hoverClass)}),f.attach(a,"mouseout",function(){qq(g.element).removeClass(g.hoverClass)}),f.attach(a,"focus",function(){qq(g.element).addClass(g.focusClass)}),f.attach(a,"blur",function(){qq(g.element).removeClass(g.focusClass)}),a}var c,d,e=this,f=new qq.DisposeSupport,g={acceptFiles:null,element:null,focusClass:"qq-upload-button-focus",folders:!1,hoverClass:"qq-upload-button-hover",ios8BrowserCrashWorkaround:!1,multiple:!1,name:"qqfile",onChange:function(){},title:null};qq.extend(g,a),d=qq.getUniqueId(),qq(g.element).css({position:"relative",overflow:"hidden",direction:"ltr"}),qq.extend(this,{getInput:function(){return c},getButtonId:function(){return d},setMultiple:function(a,b){var c=b||this.getInput();g.ios8BrowserCrashWorkaround&&qq.ios8()&&(qq.iosChrome()||qq.iosSafariWebView())?c.setAttribute("multiple",""):a?c.setAttribute("multiple",""):c.removeAttribute("multiple")},setAcceptFiles:function(a){a!==g.acceptFiles&&c.setAttribute("accept",a)},reset:function(){c.parentNode&&qq(c).remove(),qq(g.element).removeClass(g.focusClass),c=null,c=b()}}),c=b()},qq.UploadButton.BUTTON_ID_ATTR_NAME="qq-button-id",qq.UploadData=function(a){"use strict";function b(a){if(qq.isArray(a)){var b=[];return qq.each(a,function(a,c){b.push(e[c])}),b}return e[a]}function c(a){if(qq.isArray(a)){var b=[];return qq.each(a,function(a,c){b.push(e[f[c]])}),b}return e[f[a]]}function d(a){var b=[],c=[].concat(a);return qq.each(c,function(a,c){var d=g[c];void 0!==d&&qq.each(d,function(a,c){b.push(e[c])})}),b}var e=[],f={},g={},h={},i={};qq.extend(this,{addFile:function(b){var c=b.status||qq.status.SUBMITTING,d=e.push({name:b.name,originalName:b.name,uuid:b.uuid,size:null==b.size?-1:b.size,status:c})-1;return b.batchId&&(e[d].batchId=b.batchId,void 0===i[b.batchId]&&(i[b.batchId]=[]),i[b.batchId].push(d)),b.proxyGroupId&&(e[d].proxyGroupId=b.proxyGroupId,void 0===h[b.proxyGroupId]&&(h[b.proxyGroupId]=[]),h[b.proxyGroupId].push(d)),e[d].id=d,f[b.uuid]=d,void 0===g[c]&&(g[c]=[]),g[c].push(d),a.onStatusChange(d,null,c),d},retrieve:function(a){return qq.isObject(a)&&e.length?void 0!==a.id?b(a.id):void 0!==a.uuid?c(a.uuid):a.status?d(a.status):void 0:qq.extend([],e,!0)},reset:function(){e=[],f={},g={},i={}},setStatus:function(b,c){var d=e[b].status,f=qq.indexOf(g[d],b);g[d].splice(f,1),e[b].status=c,void 0===g[c]&&(g[c]=[]),g[c].push(b),a.onStatusChange(b,d,c)},uuidChanged:function(a,b){var c=e[a].uuid;e[a].uuid=b,f[b]=a,delete f[c]},updateName:function(a,b){e[a].name=b},updateSize:function(a,b){e[a].size=b},setParentId:function(a,b){e[a].parentId=b},getIdsInProxyGroup:function(a){var b=e[a].proxyGroupId;return b?h[b]:[]},getIdsInBatch:function(a){var b=e[a].batchId;return i[b]}})},qq.status={SUBMITTING:"submitting",SUBMITTED:"submitted",REJECTED:"rejected",QUEUED:"queued",CANCELED:"canceled",PAUSED:"paused",UPLOADING:"uploading",UPLOAD_RETRYING:"retrying upload",UPLOAD_SUCCESSFUL:"upload successful",UPLOAD_FAILED:"upload failed",DELETE_FAILED:"delete failed",DELETING:"deleting",DELETED:"deleted"},function(){"use strict";qq.basePublicApi={addBlobs:function(a,b,c){this.addFiles(a,b,c)},addInitialFiles:function(a){var b=this;qq.each(a,function(a,c){b._addCannedFile(c)})},addFiles:function(a,b,c){this._maybeHandleIos8SafariWorkaround();var d=0===this._storedIds.length?qq.getUniqueId():this._currentBatchId,e=qq.bind(function(a){this._handleNewFile({blob:a,name:this._options.blobs.defaultName},d,l)},this),f=qq.bind(function(a){this._handleNewFile(a,d,l)},this),g=qq.bind(function(a){var b=qq.canvasToBlob(a);this._handleNewFile({blob:b,name:this._options.blobs.defaultName+".png"},d,l)},this),h=qq.bind(function(a){var b=a.quality&&a.quality/100,c=qq.canvasToBlob(a.canvas,a.type,b);this._handleNewFile({blob:c,name:a.name},d,l)},this),i=qq.bind(function(a){if(qq.isInput(a)&&qq.supportedFeatures.ajaxUploading){var b=Array.prototype.slice.call(a.files),c=this;qq.each(b,function(a,b){c._handleNewFile(b,d,l)})}else this._handleNewFile(a,d,l)},this),j=function(){qq.isFileList(a)&&(a=Array.prototype.slice.call(a)),a=[].concat(a)},k=this,l=[];this._currentBatchId=d,a&&(j(),qq.each(a,function(a,b){qq.isFileOrInput(b)?i(b):qq.isBlob(b)?e(b):qq.isObject(b)?b.blob&&b.name?f(b):b.canvas&&b.name&&h(b):b.tagName&&"canvas"===b.tagName.toLowerCase()?g(b):k.log(b+" is not a valid file container! Ignoring!","warn")}),this.log("Received "+l.length+" files."),this._prepareItemsForUpload(l,b,c))},cancel:function(a){this._handler.cancel(a)},cancelAll:function(){var a=[],b=this;qq.extend(a,this._storedIds),qq.each(a,function(a,c){b.cancel(c)}),this._handler.cancelAll()},clearStoredFiles:function(){this._storedIds=[]},continueUpload:function(a){var b=this._uploadData.retrieve({id:a});return qq.supportedFeatures.pause&&this._options.chunking.enabled?b.status===qq.status.PAUSED?(this.log(qq.format("Paused file ID {} ({}) will be continued. Not paused.",a,this.getName(a))),this._uploadFile(a),!0):(this.log(qq.format("Ignoring continue for file ID {} ({}). Not paused.",a,this.getName(a)),"error"),!1):!1},deleteFile:function(a){return this._onSubmitDelete(a)},doesExist:function(a){return this._handler.isValid(a)},drawThumbnail:function(a,b,c,d,e){var f,g,h=new qq.Promise;return this._imageGenerator?(f=this._thumbnailUrls[a],g={customResizeFunction:e,maxSize:c>0?c:null,scale:c>0},!d&&qq.supportedFeatures.imagePreviews&&(f=this.getFile(a)),null==f?h.failure({container:b,error:"File or URL not found."}):this._imageGenerator.generate(f,b,g).then(function(a){h.success(a)},function(a,b){h.failure({container:a,error:b||"Problem generating thumbnail"})})):h.failure({container:b,error:"Missing image generator module"}),h},getButton:function(a){return this._getButton(this._buttonIdsForFileIds[a])},getEndpoint:function(a){return this._endpointStore.get(a)},getFile:function(a){return this._handler.getFile(a)||null},getInProgress:function(){return this._uploadData.retrieve({status:[qq.status.UPLOADING,qq.status.UPLOAD_RETRYING,qq.status.QUEUED]}).length},getName:function(a){return this._uploadData.retrieve({id:a}).name},getParentId:function(a){var b=this.getUploads({id:a}),c=null;return b&&void 0!==b.parentId&&(c=b.parentId),c},getResumableFilesData:function(){return this._handler.getResumableFilesData()},getSize:function(a){return this._uploadData.retrieve({id:a}).size},getNetUploads:function(){return this._netUploaded},getRemainingAllowedItems:function(){var a=this._currentItemLimit;return a>0?a-this._netUploadedOrQueued:null},getUploads:function(a){return this._uploadData.retrieve(a)},getUuid:function(a){return this._uploadData.retrieve({id:a}).uuid},log:function(a,b){!this._options.debug||b&&"info"!==b?b&&"info"!==b&&qq.log("[Fine Uploader "+qq.version+"] "+a,b):qq.log("[Fine Uploader "+qq.version+"] "+a)},pauseUpload:function(a){var b=this._uploadData.retrieve({id:a});if(!qq.supportedFeatures.pause||!this._options.chunking.enabled)return!1;if(qq.indexOf([qq.status.UPLOADING,qq.status.UPLOAD_RETRYING],b.status)>=0){if(this._handler.pause(a))return this._uploadData.setStatus(a,qq.status.PAUSED),!0;this.log(qq.format("Unable to pause file ID {} ({}).",a,this.getName(a)),"error")}else this.log(qq.format("Ignoring pause for file ID {} ({}). Not in progress.",a,this.getName(a)),"error");return!1},reset:function(){this.log("Resetting uploader..."),this._handler.reset(),this._storedIds=[],this._autoRetries=[],this._retryTimeouts=[],this._preventRetries=[],this._thumbnailUrls=[],qq.each(this._buttons,function(a,b){b.reset()}),this._paramsStore.reset(),this._endpointStore.reset(),this._netUploadedOrQueued=0,this._netUploaded=0,this._uploadData.reset(),this._buttonIdsForFileIds=[],this._pasteHandler&&this._pasteHandler.reset(),this._options.session.refreshOnReset&&this._refreshSessionData(),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[],this._totalProgress&&this._totalProgress.reset()},retry:function(a){return this._manualRetry(a)},scaleImage:function(a,b){var c=this;return qq.Scaler.prototype.scaleImage(a,b,{log:qq.bind(c.log,c),getFile:qq.bind(c.getFile,c),uploadData:c._uploadData})},setCustomHeaders:function(a,b){this._customHeadersStore.set(a,b)},setDeleteFileCustomHeaders:function(a,b){this._deleteFileCustomHeadersStore.set(a,b)},setDeleteFileEndpoint:function(a,b){this._deleteFileEndpointStore.set(a,b)},setDeleteFileParams:function(a,b){this._deleteFileParamsStore.set(a,b)},setEndpoint:function(a,b){this._endpointStore.set(a,b)},setForm:function(a){this._updateFormSupportAndParams(a)},setItemLimit:function(a){this._currentItemLimit=a},setName:function(a,b){this._uploadData.updateName(a,b)},setParams:function(a,b){this._paramsStore.set(a,b)},setUuid:function(a,b){return this._uploadData.uuidChanged(a,b)},uploadStoredFiles:function(){0===this._storedIds.length?this._itemError("noFilesError"):this._uploadStoredFiles()}},qq.basePrivateApi={_addCannedFile:function(a){var b=this._uploadData.addFile({uuid:a.uuid,name:a.name,size:a.size,status:qq.status.UPLOAD_SUCCESSFUL});return a.deleteFileEndpoint&&this.setDeleteFileEndpoint(a.deleteFileEndpoint,b),a.deleteFileParams&&this.setDeleteFileParams(a.deleteFileParams,b),a.thumbnailUrl&&(this._thumbnailUrls[b]=a.thumbnailUrl),this._netUploaded++,this._netUploadedOrQueued++,b},_annotateWithButtonId:function(a,b){qq.isFile(a)&&(a.qqButtonId=this._getButtonId(b))},_batchError:function(a){this._options.callbacks.onError(null,null,a,void 0)},_createDeleteHandler:function(){var a=this;return new qq.DeleteFileAjaxRequester({method:this._options.deleteFile.method.toUpperCase(),maxConnections:this._options.maxConnections,uuidParamName:this._options.request.uuidName,customHeaders:this._deleteFileCustomHeadersStore,paramsStore:this._deleteFileParamsStore,endpointStore:this._deleteFileEndpointStore,cors:this._options.cors,log:qq.bind(a.log,a),onDelete:function(b){a._onDelete(b),a._options.callbacks.onDelete(b)},onDeleteComplete:function(b,c,d){a._onDeleteComplete(b,c,d),a._options.callbacks.onDeleteComplete(b,c,d)}})},_createPasteHandler:function(){var a=this;return new qq.PasteSupport({targetElement:this._options.paste.targetElement,callbacks:{log:qq.bind(a.log,a),pasteReceived:function(b){a._handleCheckedCallback({name:"onPasteReceived",callback:qq.bind(a._options.callbacks.onPasteReceived,a,b),onSuccess:qq.bind(a._handlePasteSuccess,a,b),identifier:"pasted image"})}}})},_createStore:function(a,b){var c={},d=a,e={},f=b,g=function(a){return qq.isObject(a)?qq.extend({},a):a},h=function(){return qq.isFunction(f)?f():f},i=function(a,b){f&&qq.isObject(b)&&qq.extend(b,h()),e[a]&&qq.extend(b,e[a])};return{set:function(a,b){null==b?(c={},d=g(a)):c[b]=g(a)},get:function(a){var b;return b=null!=a&&c[a]?c[a]:g(d),i(a,b),g(b)},addReadOnly:function(a,b){qq.isObject(c)&&(null===a?qq.isFunction(b)?f=b:(f=f||{},qq.extend(f,b)):(e[a]=e[a]||{},qq.extend(e[a],b)))},remove:function(a){return delete c[a]},reset:function(){c={},e={},d=a}}},_createUploadDataTracker:function(){var a=this;return new qq.UploadData({getName:function(b){return a.getName(b)},getUuid:function(b){return a.getUuid(b)},getSize:function(b){return a.getSize(b)},onStatusChange:function(b,c,d){a._onUploadStatusChange(b,c,d),a._options.callbacks.onStatusChange(b,c,d),a._maybeAllComplete(b,d),a._totalProgress&&setTimeout(function(){a._totalProgress.onStatusChange(b,c,d)},0)}})},_createUploadButton:function(a){function b(){return qq.supportedFeatures.ajaxUploading?d._options.workarounds.iosEmptyVideos&&qq.ios()&&!qq.ios6()&&d._isAllowedExtension(f,".mov")?!1:void 0===a.multiple?d._options.multiple:a.multiple:!1}var c,d=this,e=a.accept||this._options.validation.acceptFiles,f=a.allowedExtensions||this._options.validation.allowedExtensions;return c=new qq.UploadButton({acceptFiles:e,element:a.element,focusClass:this._options.classes.buttonFocus,folders:a.folders,hoverClass:this._options.classes.buttonHover,ios8BrowserCrashWorkaround:this._options.workarounds.ios8BrowserCrash,multiple:b(),name:this._options.request.inputName,onChange:function(a){d._onInputChange(a)},title:null==a.title?this._options.text.fileInputTitle:a.title}),this._disposeSupport.addDisposer(function(){c.dispose()}),d._buttons.push(c),c},_createUploadHandler:function(a,b){var c=this,d={},e={debug:this._options.debug,maxConnections:this._options.maxConnections,cors:this._options.cors,paramsStore:this._paramsStore,endpointStore:this._endpointStore,chunking:this._options.chunking,resume:this._options.resume,blobs:this._options.blobs,log:qq.bind(c.log,c),preventRetryParam:this._options.retry.preventRetryResponseProperty,onProgress:function(a,b,e,f){0>e||0>f||(d[a]?(d[a].loaded!==e||d[a].total!==f)&&(c._onProgress(a,b,e,f),c._options.callbacks.onProgress(a,b,e,f)):(c._onProgress(a,b,e,f),c._options.callbacks.onProgress(a,b,e,f)),d[a]={loaded:e,total:f})},onComplete:function(a,b,e,f){delete d[a];var g,h=c.getUploads({id:a}).status;h!==qq.status.UPLOAD_SUCCESSFUL&&h!==qq.status.UPLOAD_FAILED&&(g=c._onComplete(a,b,e,f),g instanceof qq.Promise?g.done(function(){c._options.callbacks.onComplete(a,b,e,f)}):c._options.callbacks.onComplete(a,b,e,f))},onCancel:function(a,b,d){var e=new qq.Promise;return c._handleCheckedCallback({name:"onCancel",callback:qq.bind(c._options.callbacks.onCancel,c,a,b),onFailure:e.failure,onSuccess:function(){d.then(function(){c._onCancel(a,b)}),e.success()},identifier:a}),e},onUploadPrep:qq.bind(this._onUploadPrep,this),onUpload:function(a,b){c._onUpload(a,b),c._options.callbacks.onUpload(a,b)},onUploadChunk:function(a,b,d){c._onUploadChunk(a,d),c._options.callbacks.onUploadChunk(a,b,d)},onUploadChunkSuccess:function(){c._options.callbacks.onUploadChunkSuccess.apply(c,arguments)},onResume:function(a,b,d){return c._options.callbacks.onResume(a,b,d)},onAutoRetry:function(){return c._onAutoRetry.apply(c,arguments)},onUuidChanged:function(a,b){c.log("Server requested UUID change from '"+c.getUuid(a)+"' to '"+b+"'"),c.setUuid(a,b)},getName:qq.bind(c.getName,c),getUuid:qq.bind(c.getUuid,c),getSize:qq.bind(c.getSize,c),setSize:qq.bind(c._setSize,c),getDataByUuid:function(a){return c.getUploads({uuid:a})},isQueued:function(a){var b=c.getUploads({id:a}).status;return b===qq.status.QUEUED||b===qq.status.SUBMITTED||b===qq.status.UPLOAD_RETRYING||b===qq.status.PAUSED},getIdsInProxyGroup:c._uploadData.getIdsInProxyGroup,getIdsInBatch:c._uploadData.getIdsInBatch};return qq.each(this._options.request,function(a,b){e[a]=b}),e.customHeaders=this._customHeadersStore,a&&qq.each(a,function(a,b){e[a]=b}),new qq.UploadHandlerController(e,b)},_fileOrBlobRejected:function(a){this._netUploadedOrQueued--,this._uploadData.setStatus(a,qq.status.REJECTED)},_formatSize:function(a){var b=-1;do a/=1e3,b++;while(a>999);return Math.max(a,.1).toFixed(1)+this._options.text.sizeSymbols[b]},_generateExtraButtonSpecs:function(){var a=this;this._extraButtonSpecs={},qq.each(this._options.extraButtons,function(b,c){var d=c.multiple,e=qq.extend({},a._options.validation,!0),f=qq.extend({},c);void 0===d&&(d=a._options.multiple),f.validation&&qq.extend(e,c.validation,!0),qq.extend(f,{multiple:d,validation:e},!0),a._initExtraButton(f)})},_getButton:function(a){var b=this._extraButtonSpecs[a];return b?b.element:a===this._defaultButtonId?this._options.button:void 0},_getButtonId:function(a){var b,c,d=a;if(d instanceof qq.BlobProxy&&(d=d.referenceBlob),d&&!qq.isBlob(d)){if(qq.isFile(d))return d.qqButtonId;if("input"===d.tagName.toLowerCase()&&"file"===d.type.toLowerCase())return d.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME);if(b=d.getElementsByTagName("input"),qq.each(b,function(a,b){return"file"===b.getAttribute("type")?(c=b,!1):void 0}),c)return c.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME)}},_getNotFinished:function(){return this._uploadData.retrieve({status:[qq.status.UPLOADING,qq.status.UPLOAD_RETRYING,qq.status.QUEUED,qq.status.SUBMITTING,qq.status.SUBMITTED,qq.status.PAUSED]}).length},_getValidationBase:function(a){var b=this._extraButtonSpecs[a];return b?b.validation:this._options.validation},_getValidationDescriptor:function(a){return a.file instanceof qq.BlobProxy?{name:qq.getFilename(a.file.referenceBlob),size:a.file.referenceBlob.size}:{name:this.getUploads({id:a.id}).name,size:this.getUploads({id:a.id}).size}},_getValidationDescriptors:function(a){var b=this,c=[];return qq.each(a,function(a,d){c.push(b._getValidationDescriptor(d))}),c},_handleCameraAccess:function(){if(this._options.camera.ios&&qq.ios()){var a="image/*;capture=camera",b=this._options.camera.button,c=b?this._getButtonId(b):this._defaultButtonId,d=this._options;c&&c!==this._defaultButtonId&&(d=this._extraButtonSpecs[c]),d.multiple=!1,null===d.validation.acceptFiles?d.validation.acceptFiles=a:d.validation.acceptFiles+=","+a,qq.each(this._buttons,function(a,b){return b.getButtonId()===c?(b.setMultiple(d.multiple),b.setAcceptFiles(d.acceptFiles),!1):void 0})}},_handleCheckedCallback:function(a){var b=this,c=a.callback();return qq.isGenericPromise(c)?(this.log(a.name+" - waiting for "+a.name+" promise to be fulfilled for "+a.identifier),c.then(function(c){b.log(a.name+" promise success for "+a.identifier),a.onSuccess(c)},function(){a.onFailure?(b.log(a.name+" promise failure for "+a.identifier),a.onFailure()):b.log(a.name+" promise failure for "+a.identifier)})):(c!==!1?a.onSuccess(c):a.onFailure?(this.log(a.name+" - return value was 'false' for "+a.identifier+". Invoking failure callback."),a.onFailure()):this.log(a.name+" - return value was 'false' for "+a.identifier+". Will not proceed."),c)},_handleNewFile:function(a,b,c){var d=this,e=qq.getUniqueId(),f=-1,g=qq.getFilename(a),h=a.blob||a,i=this._customNewFileHandler?this._customNewFileHandler:qq.bind(d._handleNewFileGeneric,d);!qq.isInput(h)&&h.size>=0&&(f=h.size),i(h,g,e,f,c,b,this._options.request.uuidName,{uploadData:d._uploadData,paramsStore:d._paramsStore,addFileToHandler:function(a,b){d._handler.add(a,b),d._netUploadedOrQueued++,d._trackButton(a)}})},_handleNewFileGeneric:function(a,b,c,d,e,f){var g=this._uploadData.addFile({uuid:c,name:b,size:d,batchId:f});this._handler.add(g,a),this._trackButton(g),this._netUploadedOrQueued++,e.push({id:g,file:a})},_handlePasteSuccess:function(a,b){var c=a.type.split("/")[1],d=b; @@ -21,4 +21,4 @@ qq.extend(this,{enabled:qq.supportedFeatures.scaling&&j.length>0,getFileRecords: /*! 2016-08-18 */ -!function(a){a(function(){var b=function(){var a=window.location.pathname;return/index.php/.test(window.location.pathname)&&(a+=window.location.search),a};if("object"==typeof MediaUpload)for(var c=0;c1,debug:!1,template:"media-upload-template-"+e.uniqueId,classes:{success:"alert alert-success",fail:"alert alert-error"},validation:{allowedExtensions:e.allowedExtensions,itemLimit:e.maximumItems,sizeLimit:e.maximumSize},messages:e.messages,showMessage:function(a){alert(a)},deleteFile:{enabled:!0,method:"POST",endpoint:b(),params:{type:1386871774}},request:{endpoint:b()}}).on("deleteComplete",{_settings:e},function(b){var c=[];a("#qq-upload-list-"+b.data._settings.uniqueId).find("li.alert-success").find(".view-btn").each(function(b,d){var e=a(d).attr("href"),f=e.replace(/.*\//,"");c.push(f)}),a("#uploaded-files-"+b.data._settings.property).val(c.join(","))}).on("submit",{_settings:e},function(b){var c={},d="tx_mediaupload_pi1";c[d+"[storageIdentifier]"]=b.data._settings.storage,c.type="1386871773",a(this).fineUploader("setParams",c)}).on("complete",{_settings:e},function(b,c,d,e){var f=b.data._settings.uniqueId,g=b.data._settings.property,h=a(this).fineUploader("getItemByFileId",c),i=h.find(".view-btn");if(e.success){i.removeClass("hide"),i.attr("href",e.viewUrl);var j=[];a("#qq-upload-list-"+f).find("li.alert-success").find(".view-btn").each(function(b,c){var d=a(c).attr("href"),e=d.replace("/typo3temp/MediaUpload/","");j.push(e)}),a("#uploaded-files-"+g).val(j.join(","))}})}})}(jQuery); +!function(a){a(function(){var b=function(){var a=window.location.pathname;return/index.php/.test(window.location.pathname)&&(a+=window.location.search),a};if("object"==typeof MediaUpload)for(var c=0;c1,debug:!1,template:"media-upload-template-"+e.uniqueId,classes:{success:"alert alert-success",fail:"alert alert-error"},validation:{allowedExtensions:e.allowedExtensions,itemLimit:e.maximumItems,sizeLimit:e.maximumSize},messages:e.messages,showMessage:function(a){alert(a)},deleteFile:{enabled:!0,method:"POST",endpoint:b(),params:{type:1386871774}},request:{endpoint:b()}}).on("deleteComplete",{_settings:e},function(b){var c=[];a("#qq-upload-list-"+b.data._settings.uniqueId).find("li.alert-success").find(".view-btn").each(function(b,d){var e=a(d).attr("href"),f=e.replace(/.*\//,"");c.push(f)}),a("#uploaded-files-"+b.data._settings.property).val(c.join(","))}).on("submit",{_settings:e},function(b){var c={},d="tx_mediaupload_upload";c[d+"[storageIdentifier]"]=b.data._settings.storage,c.type="1386871773",a(this).fineUploader("setParams",c)}).on("complete",{_settings:e},function(b,c,d,e){var f=b.data._settings.uniqueId,g=b.data._settings.property,h=a(this).fineUploader("getItemByFileId",c),i=h.find(".view-btn");if(e.success){i.removeClass("hide"),i.attr("href",e.viewUrl);var j=[];a("#qq-upload-list-"+f).find("li.alert-success").find(".view-btn").each(function(b,c){var d=a(c).attr("href"),e=d.replace("/typo3temp/MediaUpload/","");j.push(e)}),a("#uploaded-files-"+g).val(j.join(","))}})}})}(jQuery); diff --git a/ext_localconf.php b/ext_localconf.php index dd3ae88..8466e10 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,6 +1,7 @@ 'upload', - ), + 'MediaUpload', + 'Upload', + [ + MediaUploadController::class => 'upload', + ], // non-cacheable actions - array( - 'MediaUpload' => 'upload', - ) + [ + MediaUploadController::class => 'upload', + ] + ); + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'MediaUpload', + 'Delete', + [ + MediaUploadController::class => 'delete', + ], + // non-cacheable actions + [ + MediaUploadController::class => 'delete', + ] ); // command line is replaced by symphony command: // ./vendor/bin/typo3cms mediaupload:removeTempFiles rundry=1 -}); \ No newline at end of file +});