2 // @name FlickrPoolDetails
3 // @namespace http://6v8.gamboni.org/
4 // @description This script brings the "detailed view" feature to the group pool pages.
6 // @identifier http://6v8.gamboni.org/IMG/js/flickrpooldetails.user.js
8 // @creator Pierre Andrews (mortimer.pa@free.fr)
9 // @include http://www.flickr.com/groups/sciencegroup/pool/*
12 // --------------------------------------------------------------------
14 // This is a Greasemonkey user script.
16 // To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
17 // Then restart Firefox and revisit this script.
18 // Under Tools, there will be a new menu item to "Install User Script".
19 // Accept the default configuration and install.
21 // --------------------------------------------------------------------
22 // Copyright (C) 2006 Pierre Andrews
24 // This program is free software; you can redistribute it and/or
25 // modify it under the terms of the GNU General Public License
26 // as published by the Free Software Foundation; either version 2
27 // of the License, or (at your option) any later version.
29 // This program is distributed in the hope that it will be useful,
30 // but WITHOUT ANY WARRANTY; without even the implied warranty of
31 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 // GNU General Public License for more details.
34 // The GNU General Public License is available by visiting
35 // http://www.gnu.org/copyleft/gpl.html
37 // Free Software Foundation, Inc.
38 // 51 Franklin Street, Fifth Floor
39 // Boston, MA 02110-1301
47 name
: "FlickrPoolDetails",
48 namespace: "http://6v8.gamboni.org/",
49 description
: "This script brings the 'detailed view' feature to the group pool pages.",
50 identifier
: "http://6v8.gamboni.org/IMG/js/flickrpooldetails.user.js",
51 version
: "0.1", // version
52 date
: (new Date("2006-12-04")) // update date
56 function ce(tag
,name
){
57 element
= document
.createElement(tag
);
58 element
.setAttribute('name',name
);
63 if(unsafeWindow
.console
)
64 unsafeWindow
.console
.log(arguments
);
69 function getObjectMethodClosure(object
, method
) {
70 return function(arg
) {
71 return object
[method
](arg
);
75 var flickrpooldetails = function() {this.init();}
77 flickrpooldetails
.prototype = {
80 if(document
.location
.hash
== '#detail') this.showPoolDetails();
84 insertButton: function() {
85 var links
= document
.evaluate(
86 "//td[@class='Section']/p[@class='Links']",
87 document
, null, XPathResult
.FIRST_ORDERED_NODE_TYPE
, null
90 links
.innerHTML
+= '<img width="1" height="11" src="/images/subnavi_dots.gif" alt=""/>';
91 var a1
=document
.createElement('A');
92 a1
.setAttribute('href','javascript:;');
93 var txt1
=document
.createTextNode('Detail View');
95 links
.appendChild(a1
);
96 a1
.addEventListener('click',getObjectMethodClosure(this,'showPoolDetails'));
100 showPoolDetails: function(arg
) {
101 document
.location
.hash
= '#detail';
103 var shots
= document
.evaluate(
104 "/html/body/div[@id='Main']/div[1]//img",
105 document
, null, XPathResult
.UNORDERED_NODE_SNAPSHOT_TYPE
, null); // Get all group
109 flickr_photos_getInfo_onLoad: function(success
, responseXML
, responseText
, params
){
111 M8_log(responseText
);
112 /*self.photo[photo_id*1] = eval('('+responseText+')');
113 if(self.received++ > shots.snapshotLength) {
117 GM_log("error looking for group" + responseText
);
120 for(var i
= 0; i
< shots
.snapshotLength
; i
++) {
121 var image
= shots
.snapshotItem(i
);
122 var matches
= /\/([0-9]+)_(.*?)[_.]/.exec(image
.src
);
125 secret
= matches
[2]+'';
130 unsafeWindow
.F
.API
.callMethod('flickr.groups.pool.getInfo', {}, listener
);
135 /* var subNavs = document.getElementById("SubNav");
136 var table1=document.createElement('TABLE');
137 table1.setAttribute('width','100%');
138 table1.setAttribute('cellspacing','0');
139 var tbody1=document.createElement('TBODY');
140 table1.appendChild(tbody1);
142 var shots = document.evaluate(
143 "/html/body/div[@id='Main']/div[1]//img",
144 document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); // Get all group
145 var tr1 = document.createElement('TR');
146 tr1.setAttribute('valign','bottom')
147 tbody1.appendChild(tr1);
148 for(var i = 0; i < shots.snapshotLength; i++) {
149 var image = shots.snapshotItem(i);
150 var matches = /\/([0-9]+)_/.exec(image.src);
152 photo_id = matches[1];
153 photo = this.photos[photo_id*1];
154 var td1=document.createElement('TD');
155 tr1.appendChild(td1);
156 var div1=document.createElement('DIV');
157 div1.className='StreamView';
158 div1.innerHTML ='<p class="Photo">'+
160 '<img width="240" height="180" alt="" src="http://static.flickr.com/1/127194972_8e6cbc4b37_m.jpg"/>'+
163 '<div class="Desc">'+
164 '<div id="description_div127194972" style="width: 240px;" title="Click to edit">'+
165 'See where this photo was taken at Yuan.CC Maps . Added to the Cream of the Crop pool as'+
166 '<a href="/photos/mortimer/127194972/">...</a>'+
169 '<p class="Privacy">'+
170 '<a title="Set privacy permissions for this photo" href="/photo_settings.gne?id=127194972&photos_url=%2Fphotos%2Fmortimer%2Fsets%2F72157594230473349%2Fdetail%2F">'+
171 '<img class="absmiddle" width="15" height="15" alt="This photo is public" src="/images/icon_public.gif"/>'+
173 '<span class="ccIcn ccIcnSmall">'+
174 '<a href="/photo_license.gne?id=127194972">'+
175 '<img class="absmiddle last" width="15" height="15" alt="This photo is licensed" src="/images/icon_creative_commons.gif"/>'+
181 '<a class="Plain" title="Set privacy permissions for this photo" href="/photo_settings.gne?id=127194972&photos_url=%2Fphotos%2Fmortimer%2Fsets%2F72157594230473349%2Fdetail%2F">Change</a>'+
187 '<a class="Plain" href="/photos/mortimer/archives/date-posted/2006/04/12/">Apr 12, 2006</a>'+
189 '<a class="Plain" onclick="mini_map_open(this, 127194972, \'/photos/mortimer/127194972/map/\', \'your\', \'http://static.flickr.com/1/127194972_8e6cbc4b37_s.jpg\', new YGeoPoint(49.022223,5.872364), 16, \'Taken in <a><b>Hagéville, Lorraine<\/b><\/a>\'); return false" href="/photos/mortimer/127194972/map/?view=everyones">Map</a>'+
191 '<a class="Plain" onclick="delete_photo(127194972); return false;" href="/photo_delete.gne?id=127194972&photos_url=%2Fphotos%2Fmortimer%2Fsets%2F72157594230473349%2Fdetail%2F">Delete</a>'+
193 '<p class="Activity">'+
196 '<a class="Plain" href="/photos/mortimer/127194972/">6 notes</a>'+
198 '<a class="Plain" href="/photos/mortimer/127194972/">24 comments</a>'+
203 tr1 = document.createElement('TR');
204 tr1.setAttribute('valign','bottom');
205 tbody1.appendChild(tr1);
209 subNavs.parentNode.insertBefore(table1,subNavs.nextSibling);*/
213 //======================================================================
216 window
.addEventListener("load", function () {
219 // update automatically (http://userscripts.org/scripts/show/2296)
220 win
.UserScriptUpdates
.requestAutomaticUpdates(SCRIPT
);
223 var flickrgp
= new flickrpooldetails();