Permalink
Browse files

Merge pull request #11 from stulentsev/patch-1

Fix code indentation in README
  • Loading branch information...
2 parents 0626a96 + dde561c commit 2028b406dd5f795f782a1ab940592bcb94ed8013 @drogus committed Mar 26, 2014
Showing with 55 additions and 54 deletions.
  1. +55 −54 README.md
View
109 README.md
@@ -17,71 +17,72 @@ some html:
then some css:
- .bar {
- width: 300px;
- }
+ .bar {
+ width: 300px;
+ }
- #progress {
- background: #eee;
- border: 1px solid #222;
- margin-top: 20px;
- }
- #progressbar {
- width: 0px;
- height: 24px;
- background: #333;
- }
+ #progress {
+ background: #eee;
+ border: 1px solid #222;
+ margin-top: 20px;
+ }
+ #progressbar {
+ width: 0px;
+ height: 24px;
+ background: #333;
+ }
and a bit of javascript:
-$(function() {
- $('form').uploadProgress({
- /* scripts locations for safari */
- jqueryPath: "../lib/jquery.js",
- uploadProgressPath: "../jquery.uploadProgress.js",
- /* function called each time bar is updated */
- uploading: function(upload) {$('#percents').html(upload.percents+'%');},
- /* selector or element that will be updated */
- progressBar: "#progressbar",
- /* progress reports url */
- progressUrl: "/progress",
- /* how often will bar be updated */
- interval: 2000
+ $(function() {
+ $('form').uploadProgress({
+ /* scripts locations for safari */
+ jqueryPath: "../lib/jquery.js",
+ uploadProgressPath: "../jquery.uploadProgress.js",
+ /* function called each time bar is updated */
+ uploading: function(upload) {$('#percents').html(upload.percents+'%');},
+ /* selector or element that will be updated */
+ progressBar: "#progressbar",
+ /* progress reports url */
+ progressUrl: "/progress",
+ /* how often will bar be updated */
+ interval: 2000
+ });
});
-});
If you need to update the progress bar from a different domain or subdomain, liek if your upload server is different from your normal web server, you can try the JSON-P protocol, like this:
-$(function() {
- $('form').uploadProgress({
- /* scripts locations for safari */
- jqueryPath: "../lib/jquery.js",
- uploadProgressPath: "../jquery.uploadProgress.js",
- /* function called each time bar is updated */
- uploading: function(upload) {$('#percents').html(upload.percents+'%');},
- /* selector or element that will be updated */
- progressBar: "#progressbar",
- /* progress reports url in a different domain or subdomain from caller */
- progressUrl: "uploads.somewhere.com/progress",
- /* how often will bar be updated */
- interval: 2000,
- /* use json-p for cross-domain call */
- dataType: 'jsonp'
+
+ $(function() {
+ $('form').uploadProgress({
+ /* scripts locations for safari */
+ jqueryPath: "../lib/jquery.js",
+ uploadProgressPath: "../jquery.uploadProgress.js",
+ /* function called each time bar is updated */
+ uploading: function(upload) {$('#percents').html(upload.percents+'%');},
+ /* selector or element that will be updated */
+ progressBar: "#progressbar",
+ /* progress reports url in a different domain or subdomain from caller */
+ progressUrl: "uploads.somewhere.com/progress",
+ /* how often will bar be updated */
+ interval: 2000,
+ /* use json-p for cross-domain call */
+ dataType: 'jsonp'
+ });
});
-});
defaults:
-interval: 2000
-progressBar: "#progressbar"
-progressUrl: "/progress"
-start: function() {}
-uploading: function() {}
-complete: function() {}
-success: function() {}
-error: function() {}
-uploadProgressPath: '/javascripts/jquery.js'
-jqueryPath: '/javascripts/jquery.uploadProgress.js'
-dataType: 'json'
+ interval: 2000
+ progressBar: "#progressbar"
+ progressUrl: "/progress"
+ start: function() {}
+ uploading: function() {}
+ complete: function() {}
+ success: function() {}
+ error: function() {}
+ uploadProgressPath: '/javascripts/jquery.js'
+ jqueryPath: '/javascripts/jquery.uploadProgress.js'
+ dataType: 'json'
## License

0 comments on commit 2028b40

Please sign in to comment.