summaryrefslogtreecommitdiffabout
path: root/content
authorMichael Krelin <hacker@klever.net>2006-11-16 22:08:51 (UTC)
committer Michael Krelin <hacker@klever.net>2006-11-16 22:08:51 (UTC)
commit4b21b4fc5248322c10ffb24edfd5ec78ebcce824 (patch) (side-by-side diff)
tree54557f61052727010a06d7ab243353a06204d155 /content
parentdd82dbcb0be6f49d58594bfbe3a3ae5f01c54e5c (diff)
downloadfireflix-4b21b4fc5248322c10ffb24edfd5ec78ebcce824.zip
fireflix-4b21b4fc5248322c10ffb24edfd5ec78ebcce824.tar.gz
fireflix-4b21b4fc5248322c10ffb24edfd5ec78ebcce824.tar.bz2
clear selection in photoset photos when changing the set
git-svn-id: http://svn.klever.net/kin/fireflix/trunk@228 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (limited to 'content') (more/less context) (show whitespace changes)
-rw-r--r--content/fireflix.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/content/fireflix.js b/content/fireflix.js
index 2ee408f..24894df 100644
--- a/content/fireflix.js
+++ b/content/fireflix.js
@@ -87,96 +87,97 @@ var fireflix = {
this.refresh_user_tags();
},
/* photoset treeview */
photoset: {
photos: new Array(),
fireflix: null,
init: function(f) {
this.fireflix = f;
pull_elements(this,document,[ 'set_photo' ]);
document.getElementById('setphotos').view = this;
},
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;
if(c.id=='sp_upload') {
var du = new Date(p.dateupload*1000);
var rv = du.getFullYear()+'-'+(du.getMonth()+1)+'-'+du.getDate()
+' '+
du.getHours()+':'+du.getMinutes()+':'+du.getSeconds();
return rv.replace(/(\D)(\d)(\D)/,'$10$2$3');
}
return c.id;
},
setTree: function(t) { this.tree = t },
isContainer: function(r) { return false; },
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) {},
getCellProperties: function(cid,cel,p) {},
getColumnProperties: function(cid,cel,p) { },
cycleHeader: function(cid,e) { },
getParentIndex: function(r) { return -1; },
drop: function(r,o) { },
canDropBeforeAfter: function(r,b) { return false },
importXPR: function(xp) {
this.tree.beginUpdateBatch();
this.photos = new Array();
var n; while(n=xp.iterateNext()) {
this.photos.push(new Photo(n));
}
this.rowCount = this.photos.length;
this.tree.endUpdateBatch();
+ this.selection.clearSelection();
},
load_photos: function(psid) {
var _this = this;
this.fireflix.flickr.api_call(
{
method: 'flickr.photosets.getPhotos',
auth_token: 'default',
photoset_id: psid,
extras: 'license,date_upload,date_taken,owner_name,icon_server,original_format,last_update'
}, function(xr) {
var x = xr.responseXML;
var xp = x.evaluate(
'/rsp/photoset/photo', x, null,
XPathResult.ORDERED_NODE_ITERATOR_TYPE, null );
_this.importXPR(xp);
}, function(x,s,c,m) {
_this.fireflix.flickr_failure(x,s,c,m);
}
);
},
on_select: function() {
if(this.selection.count==1) {
var p = this.photos[this.selection.currentIndex];
this.set_photo.src =
this.fireflix.flickr.get_photo_url(p.server,p.id,p.secret,'t');
this.set_photo.hidden = false;
}else{
this.set_photo.hidden = true;
}
},
on_cmd_open: function(ev) {
if(this.selection.currentIndex<0)
return;
var p = this.photos[this.selection.currentIndex];
if(!p.id)
return;
this.fireflix.openTab(this.fireflix.flickr.make_photo_url(p,'p'));
}
},
/* photosets treeview */
photosets: {
sets: new Array(),
fireflix: null,
init: function(f) {
this.fireflix = f;
document.getElementById('setslist').view = this;
},