Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
albanx committed Mar 1, 2017
1 parent 9578529 commit 393e4fc
Show file tree
Hide file tree
Showing 64 changed files with 13,459 additions and 1 deletion.
15 changes: 15 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Version 4.0
1. Partially removed internal jQuery dependency
2. Added template system for rendering html
3. Added MD5 file calculation with WebWorkers
4. Added image scale with Bilinear, Bicubic, Lancoz algorithms
5. Added exif reader
6. Added unit test
7. Added queue system for single file operation
8. Performance and memory wise optimizations
9. Remove Boostrap classes hardcoded. Managed with templates
10. Removed Flash support (buggy, html5 diffusion)
11. Removed IE6, IE7 support
12. Parameter data support only object style, not any more strings
13. Removed Firefox 6 or lower support
14. Added listeners method
270 changes: 270 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
//Build grunt file
module.exports = function (grunt) {
"use strict";

// load all tasks from the package.json file using load-grunt-tasks
require('load-grunt-tasks')(grunt, {
scope: ['devDependencies', 'optionalDependencies']
});

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
karma: {
package: {
options: {
configFile: 'tests/config/karma-package.unit.js'
}
},
application: {
options: {
configFile: 'tests/config/karma-app.unit.js'
}
}
},

jsdoc: {
dist: {
src: ['js/**/*.js', 'README.md'],
options: {
destination: 'docs',
template: 'node_modules/ink-docstrap/template',
configure: 'node_modules/ink-docstrap/template/jsdoc.conf.json'
}
}
},

prompt: {
buildprompt: {
options: {
questions: [
{
config: 'prompt.buildType',
message: 'Select option:',
default: 'default',
type: 'list',
choices: function () {
var json = grunt.file.readJSON('version.json');
grunt.config.set('version', json.version);
var buildType = [{
name: 'Build package v.' + grunt.config.get('version'),
value: 'build'
}, {
name: 'Generate Doc',
value: 'generateDoc'
}, {
name: 'Build i18n',
value: 'i18n'
}];

return buildType;
}
},
{
config: 'prompt.execute',
type: 'confirm',
message: 'Tasks ready to run. Continue?'
}
],
then: function (results, done) {
if (results['prompt.execute']) {
grunt.config.set('buildType', results['prompt.buildType']);

if (results['prompt.buildType'] == 'build') {
grunt.task.run(['doBuild']);
} else if (results['prompt.buildType'] == 'generateDoc') {
grunt.task.run(['generateDoc']);
} else if (results['prompt.buildType'] == 'i18n') {
grunt.task.run(['i18n']);
}
}
}
}
}
},

template: {
commercial: {
options: {
data: {
builddate: new Date(),
version: grunt.config.get('version'),
MD5_ON: 'true',
IMAGE_SCALE_ON: 'true',
EXIF_ON: 'true',
ENV: 'PROD'
}
},
files: [
{src: 'js/Constants.tpl.js', dest: 'js/Constants.js'},
{src: 'start.tpl.frag', dest: 'start.frag'}
]
}
},

/**
* Compile JS files to a single file
*/
requirejs: {
dev: {
options: {
baseUrl: 'js',
name: 'RealUploader',
mainConfigFile: 'js/main.js',
out: 'build/temp/realuploader.js',
almond: true,
wrap: {
startFile: 'start.frag',
endFile: 'end.frag'
},
optimize: "none"
}
},
min: {
options: {
baseUrl: 'js',
name: 'RealUploader',
mainConfigFile: 'js/main.js',
out: 'build/temp/realuploader-min.js',
almond: true,
wrap: {
startFile: 'start.frag',
endFile: 'end.frag'
},
optimize: 'uglify'
}
}
},

/**
* Compile sass files to create the final CSS
*/
compass: {
dev: {
options: {
config: 'config.rb'
}
}
},

/**
* Copy created files to create the packages
*/
copy: {
commercial: {
files: [
//License
{
expand: true,
src: ['LICENSE_COMMERCIAL.TXT'],
dest: 'build/prod/',
filter: 'isFile',
flatten: true
},
{
expand: true,
src: ['LICENSE_ENTERPRISE.TXT'],
dest: 'build/prod/',
filter: 'isFile',
flatten: true
},

//copy all CSS files, all themes
{expand: true, src: ['css/*.css'], dest: 'build/prod/css/', filter: 'isFile', flatten: true},
//Copy to web site repo
{
expand: false,
src: ['build/temp/realuploader-min.js'],
dest: 'web/js/jquery-ui.js',
filter: 'isFile'
},

//copy minifield and not compressed files
{expand: true, src: ['build/temp/*.js'], dest: 'build/prod/js/', filter: 'isFile', flatten: true},
{expand: false, src: ['examples.html'], dest: 'build/prod/', filter: 'isFile'},
{expand: false, src: ['upload.php', 'upload.jsp'], dest: 'build/prod/', filter: 'isFile'},

//copy all project source
{
expand: true,
src: ['js/**', 'sass/**', 'libs/**', 'tests/**', '!js/*.tpl.js'],
dest: 'build/prod/source/'
}
]
},
zip: {
files: [
{
expand: false,
src: ['build/v<%=version%>.zip'],
dest: 'build/realuploader-commercial.zip',
filter: 'isFile'
},
{
expand: false,
src: ['build/v<%=version%>.zip'],
dest: 'build/realuploader-enterprise.zip',
filter: 'isFile'
}
]
}
},

compress: {
commercial: {
options: {
archive: 'build/v<%=version%>.zip'
},
files: [
{expand: true, cwd: 'build/prod/', src: ['**'], dest: ''} // includes files in path and its subdirs
]
}
},
'ftp-deploy': {
upload: {
auth: {
host: 'ftp.realuploader.com',
port: 21,
authKey: 'realuploader'
},
src: 'build/*.zip',
dest: 'web/download/'
}
},
shell: {}
});

grunt.registerTask('default', ['prompt:buildprompt']);

grunt.registerTask('build', 'Just build the requirejs', function () {
grunt.task.run('requirejs:dev');//compile js
});

grunt.registerTask('doBuild', 'Main task runner', function () {
var tasks = [];
tasks.push('template:commercial');//set constants vars
tasks.push('requirejs:dev');//compile js
tasks.push('requirejs:min');//compile js min
tasks.push('compass:dev');//compile sass to css (not needed in this case)
tasks.push('copy:commercial');
tasks.push('compress:commercial');
grunt.task.run(tasks);
});

grunt.registerTask('generateDoc', '', function () {
var tasks = [];
tasks.push('jsdoc');
grunt.task.run(tasks);
});

grunt.registerTask('i18n', '', function () {
var files = grunt.file.expand(['js/*.js']);
for (var i = 0; i < files.length; i++) {
var matches = grunt.file.read(files[i]).match(/\_\((.*?)\)/gmi);
if (matches) {
for (var j = 0; j < matches.length; j++) {
console.log(matches[j].replace('_(', '').replace(')', ''));
}
}
}
});
};
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
# real-uploader
A modern Ajax File Uploader with multiple feature
<a href="http://www.realuploader.com/"><img alt="Real Uploader logo" src="http://www.albanx.com/ajaxuploader/images/logo.png"></a>
==================
#### Real Uploader 4.0 - The HTML5 Ajax Uploader


Real Uploader is a HTML5 javascript uploader, for uploading multiple files with ajax on the web.
It was born in 2010 when Firefox 3.5 added the mozSlice method and Files api. Now has evolved to support all
modern browsers.

#### Goals of Real Uploader:
- Keep code simple and small
- Support all modern and mobile browsers
- Simple for users to integrate
- Simple for developers to customize

#### Current features:
- Multiple upload
- Chunk Uploading
- Parallel uploads
- Responsive theme
- Drag and Drop upload
- Image preview
- Check file exists before upload
- Events, Callback and APIs
- Https support
- Server side thumbnail generation for images
- Mobile browser support
- MD5 client side file calculation
- Client side image resize
- Cross origin support
- Exif, IPTC reader for all JPG files
- Antifreeze system

#### Next features
- Support for JSP
- Support for ASPX
- Resume uploads
25 changes: 25 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require 'compass/import-once/activate'
# Require any additional compass plugins here.

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"

# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed

# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false


# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
Binary file added css/baseTheme/close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/baseTheme/icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/baseTheme/loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 393e4fc

Please sign in to comment.