summaryrefslogtreecommitdiffabout
path: root/content
authorMichael Krelin <hacker@klever.net>2006-11-12 22:14:50 (UTC)
committer Michael Krelin <hacker@klever.net>2006-11-12 22:14:50 (UTC)
commit790a0930a6d9eb52020193b8f5aabf5da1075ba3 (patch) (side-by-side diff)
tree85860b287ce2d3b105229baa781fa67075e7cf95 /content
parentafcae0d9514f35c96484e6db1eb21e76821b5654 (diff)
downloadfireflix-790a0930a6d9eb52020193b8f5aabf5da1075ba3.zip
fireflix-790a0930a6d9eb52020193b8f5aabf5da1075ba3.tar.gz
fireflix-790a0930a6d9eb52020193b8f5aabf5da1075ba3.tar.bz2
remove unneeded dumps
git-svn-id: http://svn.klever.net/kin/fireflix/trunk@216 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (limited to 'content') (more/less context) (show whitespace changes)
-rw-r--r--content/fireflix.js2
1 files changed, 0 insertions, 2 deletions
diff --git a/content/fireflix.js b/content/fireflix.js
index a4f13b6..0f51397 100644
--- a/content/fireflix.js
+++ b/content/fireflix.js
@@ -337,121 +337,119 @@ var fireflix = {
isSeparator: function(r) { return false; },
isSorted: function(r) { return false; },
getLevel: function(r) { return 0; },
getImageSrc: function(r,c) { return null },
getRowProperties: function(r,p) {
try {
if(!Components) return;
}catch(e) { return }
var f = this.files[r];
var as = Components.classes['@mozilla.org/atom-service;1'].
getService(Components.interfaces.nsIAtomService);
p.AppendElement(as.getAtom(f.state));
},
getCellProperties: function(r,c,p) { this.getRowProperties(r,p); },
getColumnProperties: function(c,p) { },
cycleHeader: function(cid,e) { },
getParentIndex: function(r) { return -1; },
drop: function(r,o) { },
canDropBeforeAfter: function(r,b) { return false },
add: function(f) {
if(f.indexOf('file:/')==0) {
f = f.substr(5);
while(f.substr(0,2)=='//') { // XXX: not very performant, is it? ;-)
f = f.substr(1);
}
}
var t = f;
var ls = t.lastIndexOf('/');
if(ls>0) t = t.substr(ls+1);
ls = t.lastIndexOf('\\');
if(ls>0) t = t.substr(ls+1);
var ld = t.lastIndexOf('.');
if(ld>0) t = t.substr(0,ld);
this.files.push( {
file: f,
title: t,
tags: '',
state: 'pending'
} );
this.rowCount = this.files.length;
this.tree.rowCountChanged(this.rowCount-1,1);
},
upload_worker: function() {
for(var f in this.files) {
if(this.files[f].state=='pending') {
var ff = this.files[f];
- dump('upload '+ff.file+'\n');
this.on_file_upload(ff);
ff.state='uploading';
this.tree.invalidate();
var _this = this;
this.fireflix.flickr.upload_file(
ff.file, { title: ff.title, tags: ff.tags },
function(x,p) {
ff.photoid = p;
_this.batch_ids.push(p);
ff.state='completed';
_this.tree.invalidate();
window.setTimeout(_this.upload_to,0,_this);
}, function(x,s,c,m) {
ff.state='failed';
ff.flickr_errcode = c;
ff.flickr_errmsg = m;
_this.tree.invalidate();
window.setTimeout(_this.upload_to,0,_this);
}
);
return;
}
}
- dump('uploading done\n');
this.on_finish_upload();
},
upload_to: function(_this) { _this.upload_worker(); },
on_file_upload: function(f) {
this.cmd_uploads_upload.setAttribute('disabled','true');
for(var fi in this.files) {
if(this.files[fi].file==f.file) {
this.tree.ensureRowIsVisible(fi);
this.selection.rangedSelect(fi,fi,false);
this.selection.currentIndex = fi;
this.selToProps();
break;
}
}
},
on_finish_upload: function() {
if(this.batch_ids.length) {
var psn = prompt(this.fireflix.loc_strings.getString('postUploadPhotoset'));
if(psn!=null) {
var pids = this.batch_ids.join(',');
var ppid = this.batch_ids[0];
var _this = this;
this.fireflix.flickr.api_call(
{
method: 'flickr.photosets.create',
auth_token: 'default',
title: psn,
primary_photo_id: ppid
}, function(x) {
var npid =
x.responseXML.getElementsByTagName('photoset').item(0).getAttribute('id');
_this.fireflix.flickr.api_call(
{
method: 'flickr.photosets.editPhotos',
auth_token: 'default',
photoset_id: npid,
primary_photo_id: ppid,
photo_ids: pids
}, function(x) {
_this.fireflix.refresh_sets();
}, function(x,s,c,m) {
_this.fireflix.flickr_failure(x,s,c,m);
}
);
}, function(x,s,c,m) {
_this.fireflix.flickr_failure(x,s,c,m);
}
);