├── .gitignore ├── CONTRIBUTING.md ├── src ├── svg │ └── loading-spin.svg ├── imgur.css └── imgur.js ├── example ├── svg │ └── loading-spin.svg └── index.html ├── package.json ├── LICENSE ├── Gruntfile.js └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | node_modules 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | 1. Fork it! 4 | 2. Create your feature branch: `git checkout -b my-new-feature` 5 | 3. Commit your changes: `git commit -m 'Add some feature'` 6 | 4. Push to the branch: `git push origin my-new-feature` 7 | 5. Submit a pull request :D 8 | 9 | English is the universal language nowadays, so please don't create or comment on issues using another language. -------------------------------------------------------------------------------- /src/svg/loading-spin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/svg/loading-spin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "imgur", 3 | "description": "Upload images to imgur via JavaScript", 4 | "version": "2.1.0", 5 | "private": true, 6 | "author": "Pedro Rogério", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "devDependencies": { 11 | "grunt": "^1.5.3", 12 | "grunt-contrib-copy": "~1.0.0", 13 | "grunt-contrib-cssmin": "~2.2.1", 14 | "grunt-contrib-uglify": "~3.3.0", 15 | "grunt-contrib-watch": "^1.1.0" 16 | }, 17 | "repository": "https://github.com/pinceladasdaweb/imgur", 18 | "bugs": { 19 | "url": "https://github.com/pinceladasdaweb/imgur/issues" 20 | }, 21 | "licenses": [ 22 | { 23 | "type": "MIT", 24 | "url": "http://opensource.org/licenses/MIT" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Pedro Rogério 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /src/imgur.css: -------------------------------------------------------------------------------- 1 | .dropzone { 2 | border: 4px dashed #ccc; 3 | height: 200px; 4 | margin: 0 10px; 5 | position: relative; 6 | width: auto; 7 | } 8 | 9 | .dropzone p { 10 | height: 100%; 11 | line-height: 200px; 12 | margin: 0; 13 | text-align: center; 14 | width: 100%; 15 | } 16 | 17 | .dropzone input[type="file"] { 18 | height: 100%; 19 | left: 0; 20 | outline: none; 21 | opacity: 0; 22 | position: absolute; 23 | top: 0; 24 | width: 100%; 25 | } 26 | 27 | .dropzone + .status { 28 | border-radius: 5px; 29 | margin: 10px 10px 0; 30 | padding: 15px; 31 | text-align: center; 32 | } 33 | 34 | .dropzone.dropzone-dragging { 35 | border-color: black 36 | } 37 | 38 | .loading-modal { 39 | background-color: rgba( 255, 255, 255, .8 ); 40 | display: none; 41 | position: fixed; 42 | z-index: 1000; 43 | top: 0; 44 | left: 0; 45 | height: 100%; 46 | width: 100%; 47 | } 48 | 49 | .loading-image { 50 | position: absolute; 51 | top: 50%; 52 | left: 50%; 53 | margin: -16px 0 0 -16px 54 | } 55 | 56 | body.busy .loading-modal { 57 | display: block; 58 | } -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | "use strict"; 3 | 4 | var pkg = grunt.file.readJSON("package.json"), 5 | date = new Date(); 6 | 7 | grunt.initConfig({ 8 | meta: { 9 | banner: '/*! ' + pkg.name + ' ' + pkg.version + ' | (c) ' + date.getFullYear() + ' ' + pkg.author + ' | ' + pkg.licenses[0].type + ' License */' 10 | }, 11 | copy: { 12 | main: { 13 | src: 'src/svg/loading-spin.svg', 14 | dest: 'build/svg/loading-spin.svg', 15 | }, 16 | }, 17 | cssmin: { 18 | target: { 19 | files: { 20 | 'build/imgur.min.css': ['src/imgur.css'] 21 | } 22 | } 23 | }, 24 | uglify: { 25 | options: { 26 | banner: '<%= meta.banner %>\n' 27 | }, 28 | target: { 29 | files: { 30 | 'build/imgur.min.js': ['src/imgur.js'] 31 | } 32 | } 33 | }, 34 | watch: { 35 | css: { 36 | files: ['src/imgur.css'], 37 | tasks: ['cssmin'] 38 | }, 39 | js: { 40 | files: ['src/imgur.js'], 41 | tasks: ['uglify'] 42 | } 43 | } 44 | }); 45 | 46 | grunt.loadNpmTasks('grunt-contrib-watch'); 47 | grunt.loadNpmTasks('grunt-contrib-copy'); 48 | grunt.loadNpmTasks('grunt-contrib-cssmin'); 49 | grunt.loadNpmTasks('grunt-contrib-uglify'); 50 | 51 | grunt.registerTask('default', [ 'uglify', 'cssmin', 'copy' ]); 52 | }; 53 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Upload images to imgur via JavaScript
25 |