author | Michael Krelin <hacker@klever.net> | 2006-11-16 21:54:55 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2006-11-16 21:54:55 (UTC) |
commit | 8db8cc953a91ccba910228bdaf2563ffd92f3d61 (patch) (side-by-side diff) | |
tree | cce7bfe83b5273f309f8b3a47ae0373bc029910d /content | |
parent | 26b7e66a091703dab249ca11f00a1cb49987c393 (diff) | |
download | fireflix-8db8cc953a91ccba910228bdaf2563ffd92f3d61.zip fireflix-8db8cc953a91ccba910228bdaf2563ffd92f3d61.tar.gz fireflix-8db8cc953a91ccba910228bdaf2563ffd92f3d61.tar.bz2 |
open flickr page on enter or dblclicking photo in set browser
git-svn-id: http://svn.klever.net/kin/fireflix/trunk@226 fe716a7a-6dde-0310-88d9-d003556173a8
-rw-r--r-- | content/fireflix-panel.xul | 9 | ||||
-rw-r--r-- | content/fireflix.js | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/content/fireflix-panel.xul b/content/fireflix-panel.xul index 2356c82..b2ca7dc 100644 --- a/content/fireflix-panel.xul +++ b/content/fireflix-panel.xul @@ -139,34 +139,33 @@ accesskey="t" /> <checkbox id="search_mine" label="&panel.search.mode.mine.label;" checked="true" accesskey="m"/> <spacer flex="1"/> <button class="lean" command="cmd_search"/> </hbox> </groupbox> <hbox> <button class="lean" command="cmd_search_prev_page"/> <spacer flex="1"/> <label id="search_page" hidden="true"/> <spacer flex="1"/> <button class="lean" command="cmd_search_next_page"/> </hbox> <tree id="searchresults" rows="2" flex="1" onselect="fireflix.foundphotos.on_select()" ondblclick="fireflix.foundphotos.on_cmd_open(event)" - onkeypress="if(event.keyCode==event.DOM_VK_RETURN) - fireflix.foundphotos.on_cmd_open(event)"> + onkeypress="if(event.keyCode==event.DOM_VK_RETURN) fireflix.foundphotos.on_cmd_open(event)"> <treecols> <treecol id="sr_title" label="&panel.search.col.title.label;" flex="2" crop="end" align="start" /> </treecols> <treechildren/> </tree> <groupbox id="searchresult_props" orient="horizontal" hidden="true"> <vbox width="100" pack="center"> <hbox pack="center"> <image id="search_photo" ondblclick="fireflix.foundphotos.on_cmd_open(event)"/> </hbox> </vbox> <vbox flex="1"> <label id="searchresult_title" crop="end"/> <hbox flex="1" pack="center"> <div flex="1" id="searchresult_description" xmlns="http://www.w3.org/1999/xhtml"/> @@ -185,45 +184,47 @@ <vbox flex="1"> <tree id="setslist" rows="2" onselect="fireflix.photosets.on_select()" flex="1" context="sets_menu" > <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> <treechildren/> </tree> <hbox> <button command="cmd_refresh_sets" /> <button command="cmd_set_props" /> </hbox> <tree id="setphotos" rows="2" onselect="fireflix.photoset.on_select()" - flex="1"> + flex="1" ondblclick="fireflix.photoset.on_cmd_open(event)" + onkeypress="if(event.keyCode==event.DOM_VK_RETURN) fireflix.photoset.on_cmd_open(event)"> <treecols> <treecol id="sp_title" label="&panel.setphotos.title.label;" flex="1" crop="end" align="start" tooltiptext="&panel.setphotos.title.tip;" /> <splitter class="tree-splitter" /> <treecol id="sp_taken" label="&panel.setphotos.taken.label;" crop="end" align="start" tooltiptext="&panel.setphotos.taken.tip;" hidden="true" /> <treecol id="sp_upload" label="&panel.setphotos.upload.label;" crop="end" align="start" tooltiptext="&panel.setphotos.upload.tip;" hidden="true" /> </treecols> <treechildren/> </tree> <groupbox id="set_photo_props" orient="horizontal"> <vbox width="100" pack="center"> <hbox pack="center"> - <image id="set_photo" hidden="true"/> + <image id="set_photo" hidden="true" + ondblclick="fireflix.photoset.on_cmd_open(event)" /> </hbox> </vbox> <spacer flex="1"/> </groupbox> </vbox> </tabpanel> <tabpanel id="tabpanel_tags"> <listbox id="tagslist" rows="8" flex="1"> <listhead> <listheader label="&panel.tagslist.tag.label;"/> </listhead> <listcols> <listcol flex="1"/> </listcols> </listbox> diff --git a/content/fireflix.js b/content/fireflix.js index 0f51397..2ee408f 100644 --- a/content/fireflix.js +++ b/content/fireflix.js @@ -148,32 +148,40 @@ var fireflix = { 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; }, rowCount: 0, getCellText: function(r,c) { var s = this.sets[r]; if(c.id=='sl_name') return s.title; if(c.id=='sl_photos') return s.photos; |