summaryrefslogtreecommitdiffabout
path: root/content
authorMichael Krelin <hacker@klever.net>2006-11-16 22:22:23 (UTC)
committer Michael Krelin <hacker@klever.net>2006-11-16 22:22:23 (UTC)
commitd98dfeb112f9db06c5e642e14ee9bbda4d90d0cb (patch) (side-by-side diff)
treedee166a9e25442a9043492f38104397fb748633b /content
parent4b21b4fc5248322c10ffb24edfd5ec78ebcce824 (diff)
downloadfireflix-d98dfeb112f9db06c5e642e14ee9bbda4d90d0cb.zip
fireflix-d98dfeb112f9db06c5e642e14ee9bbda4d90d0cb.tar.gz
fireflix-d98dfeb112f9db06c5e642e14ee9bbda4d90d0cb.tar.bz2
double click on photoset opens photoset in flickr now
git-svn-id: http://svn.klever.net/kin/fireflix/trunk@229 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (limited to 'content') (more/less context) (ignore whitespace changes)
-rw-r--r--content/fireflix-panel.xul1
-rw-r--r--content/fireflix.js12
-rw-r--r--content/flickr.js4
3 files changed, 13 insertions, 4 deletions
diff --git a/content/fireflix-panel.xul b/content/fireflix-panel.xul
index b2ca7dc..af92d22 100644
--- a/content/fireflix-panel.xul
+++ b/content/fireflix-panel.xul
@@ -181,12 +181,13 @@
<tabpanel id="tabpanel_sets" flex="1"
onkeypress="if(event.keyCode==event.DOM_VK_RETURN)
document.getElementById('setphotos').focus()">
<vbox flex="1">
<tree id="setslist" rows="2" onselect="fireflix.photosets.on_select()"
flex="1" context="sets_menu"
+ ondblclick="fireflix.photosets.on_cmd_open_in_flickr(event)"
>
<treecols>
<treecol id="sl_name" label="&panel.sets.name.label;" flex="4" crop="end" align="start" tooltiptext="&panel.sets.name.tip;"/>
<splitter class="tree-splitter" />
<treecol id="sl_photos" label="&panel.sets.photos.label;" flex="1" align="end" tooltiptext="&panel.sets.photos.tip;" />
</treecols>
diff --git a/content/fireflix.js b/content/fireflix.js
index 24894df..48053c5 100644
--- a/content/fireflix.js
+++ b/content/fireflix.js
@@ -161,17 +161,15 @@ var fireflix = {
this.set_photo.hidden = false;
}else{
this.set_photo.hidden = true;
}
},
on_cmd_open: function(ev) {
- if(this.selection.currentIndex<0)
- return;
+ if(this.selection.currentIndex<0) return;
var p = this.photos[this.selection.currentIndex];
- if(!p.id)
- return;
+ if(!p.id) return;
this.fireflix.openTab(this.fireflix.flickr.make_photo_url(p,'p'));
}
},
/* photosets treeview */
photosets: {
@@ -233,12 +231,18 @@ var fireflix = {
this.fireflix.cmd_set_props.setAttribute('disabled','false');
var s = this.sets[this.selection.currentIndex];
this.fireflix.photoset.load_photos(s.id);
}else{
this.fireflix.cmd_set_props.setAttribute('disabled','true');
}
+ },
+ on_cmd_open_in_flickr: function(ev) {
+ if(this.selection.currentIndex<0) return;
+ var p = this.sets[this.selection.currentIndex];
+ if(!p.id) return;
+ this.fireflix.openTab(this.fireflix.flickr.make_photoset_url(p));
}
},
refresh_user_tags: function() {
var lb = document.getElementById('tagslist');
var _this = this;
diff --git a/content/flickr.js b/content/flickr.js
index 75d1a72..b8360c1 100644
--- a/content/flickr.js
+++ b/content/flickr.js
@@ -268,12 +268,16 @@ Flickr.prototype = {
make_photo_url: function(p,sfx) {
if(sfx=='p')
return this.get_photo_page_url(p);
else
return this.get_image_url(p,sfx);
},
+ make_photoset_url: function(ps) {
+ // TODO: allow for using someone else's photoset?
+ return this.photos_url+this.user.nsid+'/sets/'+ps.id;
+ },
upload_file: function(f,fa,on_success,on_failure) {
try {
var fi = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
fi.initWithPath( f );