From 71a2c8a80f3c7a99e893efb32c6bbf5080e16ff1 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Mon, 18 Dec 2006 18:56:09 +0000 Subject: doubleclicking files in upload git-svn-id: http://svn.klever.net/kin/fireflix/trunk@241 fe716a7a-6dde-0310-88d9-d003556173a8 --- (limited to 'content') diff --git a/content/fireflix-panel.xul b/content/fireflix-panel.xul index 405804c..8aec0e4 100644 --- a/content/fireflix-panel.xul +++ b/content/fireflix-panel.xul @@ -244,7 +244,8 @@ + context="uploads_menu" ondblclick="fireflix.uploads.on_cmd_open(event)" + onkeypress="if(event.keyCode==event.DOM_VK_RETURN) fireflix.uploads.on_cmd_open(event)" > diff --git a/content/fireflix.js b/content/fireflix.js index 78e56c2..225e21c 100644 --- a/content/fireflix.js +++ b/content/fireflix.js @@ -628,6 +628,17 @@ var fireflix = { this.add(f.path); } } + }, + on_cmd_open: function(ev) { + if(this.selection.currentIndex<0) return; + var f = this.files[this.selection.currentIndex]; + if(f.photoid) { + this.fireflix.openTab( + this.fireflix.flickr.make_uploader_edit_url(f.photoid) + ); + }else{ + this.fireflix.openTab( 'file://'+f.file); + } } }, @@ -913,11 +924,9 @@ var fireflix = { } }, 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')); } }, diff --git a/content/flickr.js b/content/flickr.js index b8360c1..e09d5f0 100644 --- a/content/flickr.js +++ b/content/flickr.js @@ -97,6 +97,7 @@ Flickr.prototype = { photo_url: 'http://static.flickr.com/', photos_url: 'http://www.flickr.com/photos/', upload_url: 'http://www.flickr.com/services/upload/', + uploader_edit_url: 'http://www.flickr.com/tools/uploader_edit.gne', api_sig: function(paramstr) { return MD5(toutf8(this.api_shs+paramstr)); @@ -275,6 +276,10 @@ Flickr.prototype = { // TODO: allow for using someone else's photoset? return this.photos_url+this.user.nsid+'/sets/'+ps.id; }, + make_uploader_edit_url: function(pid) { + // TODO: handle arrays + return this.uploader_edit_url+'?ids='+pid; + }, upload_file: function(f,fa,on_success,on_failure) { try { -- cgit v0.9.0.2