Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

AMD support #616

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def coreFiles = ["${jsSrcDir}/header.js",
"${jsSrcDir}/uploader.js",
"${jsSrcDir}/handler.base.js",
"${jsSrcDir}/handler.form.js",
"${jsSrcDir}/handler.xhr.js"]
"${jsSrcDir}/handler.xhr.js",
"${jsSrcDir}/footer.js"]

def cssFiles = ["$srcDir/fineuploader.css"]

Expand Down
1 change: 1 addition & 0 deletions client/js/footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
}(window));
2 changes: 2 additions & 0 deletions client/js/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
*
* Licensed under MIT license, GNU GPL 2 or later, GNU LGPL 2 or later, see license.txt.
*/

(function(root) {

This comment was marked as spam.

12 changes: 10 additions & 2 deletions client/js/jquery-plugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
/*globals jQuery, qq*/

This comment was marked as spam.

(function($) {
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(jQuery);
}
}(function($) {
"use strict";
var uploader, $el, init, dataStore, pluginOption, pluginOptions, addCallbacks, transformVariables, isValidCommand,
delegateCommand;
Expand Down Expand Up @@ -165,4 +173,4 @@
return this;
};

}(jQuery));
}));
9 changes: 9 additions & 0 deletions client/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,3 +554,12 @@ qq.DisposeSupport = function() {
}
};
};

if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = qq;
}
exports.qq = qq;
} else {
root.qq = qq;
}
1 change: 1 addition & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<script src="../client/js/uploader.basic.js"></script>
<script src="../client/js/dnd.js"></script>
<script src="../client/js/uploader.js"></script>
<script src="../client/js/footer.js"></script>
<script src="js/uploader-demo.js"></script>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions test/jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<script src="../client/js/uploader.basic.js"></script>
<script src="../client/js/dnd.js"></script>
<script src="../client/js/uploader.js"></script>
<script src="../client/js/footer.js"></script>
<script src="../client/js/jquery-plugin.js"></script>
<script src="js/uploader-demo-jquery.js"></script>
</head>
Expand Down