summaryrefslogtreecommitdiffabout
path: root/content
authorMichael Krelin <hacker@klever.net>2006-09-30 18:21:31 (UTC)
committer Michael Krelin <hacker@klever.net>2006-09-30 18:21:31 (UTC)
commit4f5e775ff24baf34b3425e93bfeac4a436b4b525 (patch) (side-by-side diff)
tree3dcde487352a9dd8bcef852adeb18f118cbe20c5 /content
parent74a277c2d7ac5416c3b55565e6d5e8e5a15b389d (diff)
downloadfireflix-4f5e775ff24baf34b3425e93bfeac4a436b4b525.zip
fireflix-4f5e775ff24baf34b3425e93bfeac4a436b4b525.tar.gz
fireflix-4f5e775ff24baf34b3425e93bfeac4a436b4b525.tar.bz2
minor code beauty/performance enhancements
git-svn-id: http://svn.klever.net/kin/fireflix/trunk@170 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (limited to 'content') (more/less context) (ignore whitespace changes)
-rw-r--r--content/fireflix.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/content/fireflix.js b/content/fireflix.js
index 98b6d41..337354e 100644
--- a/content/fireflix.js
+++ b/content/fireflix.js
@@ -91,12 +91,13 @@ var fireflix = {
/* photoset treeview */
photoset: {
photos: new Array(),
fireflix: null,
init: function(f) {
this.fireflix = f;
+ pull_elements(this,document,[ 'set_photo' ]);
},
rowCount: 0,
getCellText: function(r,c) {
var p = this.photos[r];
if(c.id=='sp_title') return p.title;
if(c.id=='sp_taken') return p.datetaken;
@@ -145,17 +146,17 @@ var fireflix = {
}
);
},
on_select: function() {
if(this.selection.count==1) {
var p = this.photos[this.selection.currentIndex];
- document.getElementById('set_photo').src =
+ this.set_photo.src =
this.fireflix.flickr.get_photo_url(p.server,p.id,p.secret,'t');
- document.getElementById('set_photo').hidden = false;
+ this.set_photo.hidden = false;
}else{
- document.getElementById('set_photo').hidden = true;
+ this.set_photo.hidden = true;
}
}
},
/* photosets treeview */
photosets: {
@@ -307,13 +308,14 @@ var fireflix = {
uploads: {
fireflix: null,
init: function(f) {
this.fireflix=f;
pull_elements(this,document,[
'upload_filename','upload_title','upload_file_preview',
- 'upload_file_props','upload_progress','upload_tags'
+ 'upload_file_props','upload_progress','upload_tags',
+ 'cmd_uploads_upload'
]);
},
files: new Array(),
rowCount: 0,
getCellText: function(r,c) {
var f = this.files[r];
@@ -398,13 +400,13 @@ var fireflix = {
}
dump('uploading done\n');
this.on_finish_upload();
},
upload_to: function(_this) { _this.upload_worker(); },
on_file_upload: function(f) {
- document.getElementById('cmd_uploads_upload').setAttribute('disabled','true');
+ 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();
@@ -445,13 +447,13 @@ var fireflix = {
_this.fireflix.flickr_failure(x,s,c,m);
}
);
}
}
this.selection.clearSelection();
- document.getElementById('cmd_uploads_upload').setAttribute('disabled','false');
+ this.cmd_uploads_upload.setAttribute('disabled','false');
this.upload_progress.setAttribute('hidden','true');
},
clear_list: function() {
this.tree.beginUpdateBatch();
this.rowCount = 0;