Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/core/FileUpload.js
Show All 32 Lines | members : { | ||||
_isResume: false, | _isResume: false, | ||||
addUploadedBytes: function(bytes) { | addUploadedBytes: function(bytes) { | ||||
var uploaded = this.getUploadedBytes(); | var uploaded = this.getUploadedBytes(); | ||||
this.setUploadedBytes(uploaded + bytes); | this.setUploadedBytes(uploaded + bytes); | ||||
return this; | return this; | ||||
}, | }, | ||||
getPageID: function() { | |||||
avivey: I think we call these "monograms". | |||||
return 'F' + this.getID(); | |||||
}, | |||||
getPageURI: function() { | |||||
return '/' + this.getPageID(); | |||||
}, | |||||
setChunks: function(chunks) { | setChunks: function(chunks) { | ||||
var chunk; | var chunk; | ||||
for (var ii = 0; ii < chunks.length; ii++) { | for (var ii = 0; ii < chunks.length; ii++) { | ||||
chunk = chunks[ii]; | chunk = chunks[ii]; | ||||
if (chunk.complete) { | if (chunk.complete) { | ||||
this.addUploadedBytes(chunk.byteEnd - chunk.byteStart); | this.addUploadedBytes(chunk.byteEnd - chunk.byteStart); | ||||
this._isResume = true; | this._isResume = true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | update : function() { | ||||
.show(); | .show(); | ||||
var content; | var content; | ||||
// TODO: This stuff needs some work for translations. | // TODO: This stuff needs some work for translations. | ||||
switch (this.getStatus()) { | switch (this.getStatus()) { | ||||
case 'done': | case 'done': | ||||
var link = JX.$N('a', {href: this.getURI()}, 'F' + this.getID()); | var link = JX.$N('a', {href: this.getPageURI()}, this.getPageID()); | ||||
content = [ | content = [ | ||||
JX.$N('strong', {}, ['Upload Complete (', link, ')']), | JX.$N('strong', {}, ['Upload Complete (', link, ')']), | ||||
JX.$N('br'), | JX.$N('br'), | ||||
this.getName() | this.getName() | ||||
]; | ]; | ||||
this._notification | this._notification | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
I think we call these "monograms".