Skip to content

Commit

Permalink
added grunt file for min
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Wilson committed Mar 7, 2013
1 parent 4b7bbc3 commit 0fabbea
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 82 deletions.
27 changes: 27 additions & 0 deletions grunt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var src = ['ng-upload.js'];

module.exports = function(grunt) {
grunt.initConfig({
lint: {
files: src
},
min: {
adherence: {
src: ['ng-upload.js'],
dest: 'ng-upload.min.js'
}
},
watch: {
scripts: {
files: 'ng-upload.js',
tasks: ['lint','min'],
options: {
interrupt: true
}
}
}
});
grunt.registerTask('default', 'lint min');

}

File renamed without changes.
File renamed without changes.
13 changes: 7 additions & 6 deletions main/ng-upload.js → ng-upload.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Version 0.1.0
// AngularJS simple file upload directive
// this directive uses an iframe as a target
// to enable the uploading of files without
Expand All @@ -12,7 +13,7 @@
// </div>
// </div>
//
// angular.module('app', ['ng-upload'])
// angular.module('app', ['ngUpload'])
// .controller('mainCtrl', function($scope) {
// $scope.results = function(content) {
// console.log(content);
Expand Down Expand Up @@ -64,7 +65,7 @@ angular.module('ngUpload', [])
scope.$apply(function () { callbackFn(content); });

// remove iframe
setTimeout(function () { iframe.remove() }, 250);
setTimeout(function () { iframe.remove(); }, 250);

//if (options.enableControls == null || !(options.enableControls.length >= 0))
submitControl.attr('disabled', null);
Expand All @@ -73,7 +74,7 @@ angular.module('ngUpload', [])

// add the new iframe to application
element.parent().append(iframe);
}
};

// 1) get the upload submit control(s) on the form (submitters must be decorated with the 'ng-upload-submit' class)
// 2) attach a handler to the controls' click event
Expand All @@ -82,10 +83,10 @@ angular.module('ngUpload', [])

scope.$apply(function () { callbackFn('Please wait...'); });

console.log(angular.toJson(options));
//console.log(angular.toJson(options));

var enabled = true;
if (options.enableControls == null || !(options.enableControls.length >= 0)) {
if (options.enableControls === null || options.enableControls.length === 0) {
// disable the submit control on click
$(this).attr('disabled', 'disabled');
enabled = false;
Expand All @@ -103,5 +104,5 @@ angular.module('ngUpload', [])
else
console.log("No callback function found on the ngUpload directive.");
}
}
};
});
1 change: 1 addition & 0 deletions ng-upload.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 0 additions & 74 deletions ngUpload.sln

This file was deleted.

Binary file removed ngUpload.v11.suo
Binary file not shown.
8 changes: 6 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Create a basic form with a file input element
<div ng-controller="mainCtrl">
<form action="/uploads" ng-upload="results()">
<input type="file" name="avatar"></input>
<input type="submit upload-submit" value="Upload"></input>
<input type="submit" class="upload-submit" value="Upload"></input>
</form>
</div>
</div>
Expand Down Expand Up @@ -67,7 +67,7 @@ angular.module('app', ['ngUpload'])

## Example

Example of forms that posts to ASP.Net MVC or NodeJS server are now include under the [/examples](https://github.com/adebisi-fa/ngUpload/tree/master/examples) folder.
Example of forms that posts to ASP.Net MVC or NodeJS server are now included under the [/examples](https://github.com/adebisi-fa/ngUpload/tree/master/examples) folder.

Live examples of the ASP.Net MVC sample can be found at http://ng-upload.azurewebsites.net

Expand All @@ -79,6 +79,10 @@ MIT

pull requests welcome.

## Contributors

* ADEBISI Foluso A. (https://github.com/adebisi-fa)

## Thanks

* AngularJS Team
Expand Down
1 change: 1 addition & 0 deletions test/ngUploadSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO

0 comments on commit 0fabbea

Please sign in to comment.