Skip to content

Commit

Permalink
采用omd 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tison committed Feb 19, 2016
1 parent 5aa5f7b commit 22234af
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 45 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ you spot any mistakes.

## 1.0.2

* OMD: this version is written on omd 1.1, look at https://github.com/tangshuang/omd
* OMD: this version is written on omd 1.1.2, look at https://github.com/tangshuang/omd
* showPreview: this version add a setting option `showPreview`, value: 0 - without preview, 1 - preview selected origin image, 2 preview selected origin image but uploaded image on server after uploaded
32 changes: 9 additions & 23 deletions HHuploadify.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
/**
* version 1.0.2
* HHuploadify - a jquery plugin for pictures uploading extending Huploadify ( which extends uploadify )
* written on omd 1.1 https://github.com/tangshuang/omd
* written on omd 1.1.2 https://github.com/tangshuang/omd
*/

!function(dependencies,window,factory){
!function(dependencies,factory){
// amd || cmd
if(typeof define == 'function') {
// amd requirejs
if(define.amd != undefined) {
define(dependencies,function() {
return factory(window,require);
});
}
// cmd seajs
else if(define.cmd != undefined) {
define(dependencies,function(require) {
return factory(window,require);
});
}
if(typeof define == 'function' && (define.cmd || define.amd)) {
define(dependencies,function() {
return factory();
});
}
else {
var ex = factory(window);
var ex = factory();
// CommonJS NodeJS
if(typeof module !== 'undefined' && typeof exports === 'object') {
module.exports = ex;
Expand All @@ -33,11 +24,8 @@
}
}
}
}(['jquery'],window,function(window,require){
if(typeof window.$ === 'undefined')
throw new Error("jQuery required");

window.$.fn.HHuploadify = function(opts){
}(['jquery'],function(){
$.fn.HHuploadify = function(opts){
var itemTemp = '<span id="${fileID}" class="uploadify-queue-item"><span class="uploadify-queue-item-container"><span class="uploadify-progress"><span class="uploadify-progress-bar"></span></span><span class="up_filename">${fileName}</span><a href="javascript:void(0);" class="uploadbtn">上传</a><a href="javascript:void(0);" class="delfilebtn">&times;</a></span></span>';
var defaults = {
fileTypeExts:'*.jpg;*.jpeg;*.png;*.gif',//file can be uploaded exts like: '*.jpg;*.doc'
Expand Down Expand Up @@ -475,7 +463,5 @@
});

return returnObj;

}

});
29 changes: 8 additions & 21 deletions HHuploadifyReady.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,15 @@
* written on omd 1.1 https://github.com/tangshuang/omd
*/

!function(dependencies,window,factory){
!function(dependencies,factory){
// amd || cmd
if(typeof define == 'function') {
// amd requirejs
if(define.amd != undefined) {
define(dependencies,function() {
return factory(window,require);
});
}
// cmd seajs
else if(define.cmd != undefined) {
define(dependencies,function(require) {
return factory(window,require);
});
}
if(typeof define == 'function' && (define.cmd || define.amd)) {
define(dependencies,function() {
return factory();
});
}
else {
var ex = factory(window);
var ex = factory();
// CommonJS NodeJS
if(typeof module !== 'undefined' && typeof exports === 'object') {
module.exports = ex;
Expand All @@ -32,11 +23,7 @@
}
}
}
}(['jquery'],window,function(window,require){
if(typeof window.$ === 'undefined')
throw new Error("jQuery required");
var $ = window.$;

}(['jquery'],function(){
function initHHuploadify(selector,uploader,field,isSingle,title) {
isSingle = typeof isSingle == 'boolean' ? isSingle : false;
$(selector).HHuploadify({
Expand Down Expand Up @@ -163,7 +150,7 @@
});
}

window.$.extend({
$.extend({
HHuploadify : {
init : initHHuploadify,
initOne : initHHuploadifyOne,
Expand Down

0 comments on commit 22234af

Please sign in to comment.