-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some fix
- Loading branch information
KuoKongQingYun
committed
Jan 4, 2015
1 parent
4e231c7
commit dd4cbbc
Showing
3 changed files
with
23 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,15 @@ | ||
(function() { | ||
"use strict"; | ||
function updateUploadProgress(bytesSent, totalBytes) { | ||
if (totalBytes > 0) currentProgress = (bytesSent / totalBytes) * 100; | ||
document.getElementById("progress").innerHTML = currentProgress + "%"; | ||
} | ||
|
||
function uploadBusy(evt) { | ||
alert("Sorry, a file is already being uploaded"); | ||
} | ||
|
||
function uploadComplete(evt) { | ||
alert("123"); | ||
if (evt.success === true) { | ||
alert("File " + evt.localURL + " was uploaded"); | ||
$("#URL").html(evt.localURL); | ||
} else { | ||
alert("Error uploading file " + evt.message); | ||
} | ||
function upload_success(r) { | ||
console.log("Code = " + r.responseCode); | ||
console.log("Response = " + r.response); | ||
console.log("Sent = " + r.bytesSent); | ||
} | ||
|
||
function uploadCancelled(evt) { | ||
alert("File upload was cancelled " + evt.localURL); | ||
function upload_fail(error) { | ||
alert("An error has occurred: Code = " + error.code); | ||
console.log("upload error source " + error.source); | ||
console.log("upload error target " + error.target); | ||
} | ||
document.addEventListener("intel.xdk.file.upload.busy", uploadBusy); | ||
document.addEventListener("intel.xdk.file.upload", uploadComplete); | ||
document.addEventListener("intel.xdk.file.upload.cancel", uploadCancelled); | ||
|
||
})(); |