![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
AngularJS (1.x) plugin, upload files, make canvas, drag & drop, no need jquery
npm install uploadk
var app = angular.module('myApp', ['uploadk'])
<div catch-files on-drop="callback" catch-options="options">
controller :
$scope.dropCallback = function(files) { //do business };
html :
<div catch-files on-drop="dropCallback"></div>
on-drag-enter / on-drag-leave same syntax
catch-if
This attributes will evaluate your expression, if your expression is equivalent to undefined or false, the directive will be inactive.
<div catch-files="dropCallback" catch-if="user"></div>
catch-options the directive will extend its default options to your own, you can override each options properties (see below)
controller:
$scope.options = {
multiple = false;
};
html :
<div catch-files="dropCallback catch-options="options"></div>
multiple (default:true) if set to false, the directive will only provide the first file catched to your callback function
drag (default:true) define if the drag & drop feature is active or not
click (default:false) define if the click feature is active or not (will create an hidden input and pop a file window on the click event)
fileReader
fileReader.readAsDataURL(file, scope);
canvas
canvas.make(dataUrl, height);
fileUploader
fileUploader.post(files, [method])
.to(url, headers)
.then(function (success){
}, function (err){
}, function (notify){
});
angular app :
var app = angular.module('myApp', ['uploadk'])
.controller('MainCtrl', ['$scope', '$rootScope', 'fileReader', 'canvas', 'fileUploader',
function ($scope, $rootScope, fileReader, canvas, fileUploader) {
$scope.canUpload = true;
$scope.options = {
drag:true,
click:true,
};
var token = "123";
var droppedFiles = [];
$scope.images = [];
$scope.dropCallback = function(files) {
for (var i = 0; l = files.length, i < l; ++i) {
droppedFiles.push(files[i]);
fileReader.readAsDataUrl(files[i], $scope).then(function (result)
{
canvas.make(result, 400).then(function (src){
var image = {src:src};
$scope.images.unshift(image);
});
});
}
};
$scope.upload = function() {
var headers = {
"auth-token": token
};
var url = 'http://google.fr';
/* change url and use with a server side application, have fun */
fileUploader.post(droppedFiles)
.to(url, headers)
.then(function (success){
$scope.success = success;
}, function (error){
$scope.error = error;
}, function (notify){
$scope.prct = notify.prct;
});
};
}]);
html :
<div class="dropfile" catch-files on-drop="dropCallback" catch-options="options" catch-if="canUpload">
<div>Drag & Drop </br>Or click</div>
</div>
<img data-ng-repeat="image in images" src="{{image.src}}"/>
<div ng-show="images.length > 0">
<button type="button" ng-click="upload()">Upload</button>
</div>
<div style="margin-top:50px;">
<div data-ng-show="prct">process : {{prct}} %</div>
<div data-ng-show="success">success : {{success}}</div>
<div data-ng-show="error">error : {{error}}</div>
</div>
FAQs
AngularJS (1.x) plugin, upload files, make canvas, drag & drop, no need jquery
The npm package uploadk receives a total of 0 weekly downloads. As such, uploadk popularity was classified as not popular.
We found that uploadk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.