Skip to content
This repository was archived by the owner on Sep 23, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules/
npm-debug.log

# Bower Components
bower_components
30 changes: 30 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "dropify",
"title": "Dropify",
"description": "Override your input files with style",
"keywords": [
"upload",
"file",
"drag",
"drop",
"jquery"
],
"homepage": "http://jeremyfagis.github.io/dropify/",
"author": {
"name": "Jeremy Fagis",
"url": "http://www.fagis.fr/"
},
"repository": {
"type": "https",
"url": "https://github.com/umitgunduz/dropify"
},
"bugs": "https://github.com/JeremyFagis/dropify/issues",
"dependencies": {
"jquery": ">=1.8"
},
"main": [
"dist/js/dropify.js",
"dist/js/angular-dropify.js",
"dist/css/dropify.css"
]
}
56 changes: 56 additions & 0 deletions dist/js/angular-dropify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Define module using Universal Module Definition pattern
// https://github.com/umdjs/umd/blob/master/returnExports.js

(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// Support AMD. Register as an anonymous module.
// EDIT: List all dependencies in AMD style
define(['angular', 'dropify'], factory);
}
else {
// No AMD. Set module as a global variable
// EDIT: Pass dependencies to factory function
factory(root.angular, root.Dropify);
}
}(this,
//EDIT: The dependencies are passed to this function
function (angular, Dropify) {
//---------------------------------------------------
// BEGIN code for this module
//---------------------------------------------------

'use strict';

return angular.module('ngDropify', [])
.directive('ngDropify', function () {
return {
restrict: 'AE',
template: '<div ng-transclude></div>',
transclude: true,
scope: {
dropifyConfig: '=',
eventHandlers: '='
},
link: function(scope, element, attrs, ctrls) {
try { Dropify }
catch (error) {
throw new Error('dropify.js not loaded.');
}

var dropify = new Dropify(element[0], scope.dropifyConfig);

if (scope.eventHandlers) {
Object.keys(scope.eventHandlers).forEach(function (eventName) {
dropify.on(eventName, scope.eventHandlers[eventName]);
});
}

scope.dropify = dropify;
}
};
});

//---------------------------------------------------
// END code for this module
//---------------------------------------------------
}));
Loading