From dc51498fa17e0731ade8c55ff2fba0cc19d52cee Mon Sep 17 00:00:00 2001 From: 50 Date: Sat, 4 Jul 2020 10:45:17 +0800 Subject: [PATCH] Update pr 876 examples --- examples/issues/pr876/controllers.js | 33 ------------------------ examples/issues/pr876/iframe.html | 37 +++++++++++---------------- examples/issues/pr876/index.html | 2 +- examples/issues/pr876/uploadPage.html | 12 +++++++++ 4 files changed, 28 insertions(+), 56 deletions(-) delete mode 100644 examples/issues/pr876/controllers.js create mode 100644 examples/issues/pr876/uploadPage.html diff --git a/examples/issues/pr876/controllers.js b/examples/issues/pr876/controllers.js deleted file mode 100644 index b482077..0000000 --- a/examples/issues/pr876/controllers.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; -angular - .module('app', ['angularFileUpload']) - .controller('AppController', ['$scope', 'FileUploader', function ($scope, FileUploader) { - var uploader = $scope.uploader = new FileUploader({ - url: '../upload.php' - }); - - $scope.upload = function () { - var items = uploader.getNotUploadedItems(); - if (items.length == 0) { - console.log("No files to upload"); - return false; - } - - for (var i = 0; i < items.length; i++) { - var fileItem = changeFileName(items[i], ""); - fileItem.upload(); - } - }; - - function changeFileName(fileItem, newFileName) { - newFileName = newFileName || "file" + new Date().getTime(); - - var fileName = fileItem.file.name.split('.'); - if (fileName.length < 2) { - alert("Uploaded file must have a valid extension! For more information see the Supported Formats") - } - var fileExtension = "." + fileName.pop(); - fileItem.file.name = newFileName + fileExtension; - return fileItem; - } - }]); diff --git a/examples/issues/pr876/iframe.html b/examples/issues/pr876/iframe.html index 793f250..f9c6ab2 100644 --- a/examples/issues/pr876/iframe.html +++ b/examples/issues/pr876/iframe.html @@ -1,26 +1,19 @@  - + - - Simple example - - - - - + + iframe page + + - - - - - + + + + - - - - - - - - - + \ No newline at end of file diff --git a/examples/issues/pr876/index.html b/examples/issues/pr876/index.html index a5e6d94..f914b9f 100644 --- a/examples/issues/pr876/index.html +++ b/examples/issues/pr876/index.html @@ -6,7 +6,7 @@ - + \ No newline at end of file diff --git a/examples/issues/pr876/uploadPage.html b/examples/issues/pr876/uploadPage.html new file mode 100644 index 0000000..26b41f0 --- /dev/null +++ b/examples/issues/pr876/uploadPage.html @@ -0,0 +1,12 @@ + + + + + Upload page + + + + + + + \ No newline at end of file