summaryrefslogtreecommitdiffabout
path: root/content/photoset-props.js
authorMichael Krelin <hacker@klever.net>2006-09-26 19:21:57 (UTC)
committer Michael Krelin <hacker@klever.net>2006-09-26 19:21:57 (UTC)
commitc5ea6ff7abd6e376ae151c9724d24f6fe156766e (patch) (unidiff)
tree0df2e4ecf02f89c4b85d1950b5c6f4fd2f67f9bd /content/photoset-props.js
parent5207247fdc837ae9de1d81db903f6cd92532595e (diff)
downloadfireflix-0.0.zip
fireflix-0.0.tar.gz
fireflix-0.0.tar.bz2
Initial import into public repository0.0
git-svn-id: http://svn.klever.net/kin/fireflix/trunk@159 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (limited to 'content/photoset-props.js') (more/less context) (ignore whitespace changes)
-rw-r--r--content/photoset-props.js81
1 files changed, 81 insertions, 0 deletions
diff --git a/content/photoset-props.js b/content/photoset-props.js
new file mode 100644
index 0000000..43dc1b9
--- a/dev/null
+++ b/content/photoset-props.js
@@ -0,0 +1,81 @@
1
2var psetprops = {
3 fireflix: null,
4 photoset: null,
5 pripic: null,
6
7 settitle: null, setdesc: null,
8 primarypic: null,
9 photos: new Array(),
10 init: function() {
11 this.fireflix = window.arguments[0];
12 this.photoset = window.arguments[1];
13 this.settitle = document.getElementById('set_title');
14 this.settitle.value = this.photoset.title;
15 this.setdesc = document.getElementById('set_desc');
16 this.setdesc.value = this.photoset.description;
17 this.primarypic = document.getElementById('primary_picture');
18 this.primarypic.src =
19 this.fireflix.flickr.get_image_url( this.photoset, 't' );
20 this.primarypic.hidden = false;
21 this.picslist = document.getElementById('primary_picture_list');
22
23 var _this = this;
24 this.fireflix.flickr.api_call(
25 {
26 method: 'flickr.photosets.getPhotos',
27 auth_token: 'default',
28 photoset_id: this.photoset.id
29 }, function(xr) {
30 var x = xr.responseXML;
31 var xp = x.evaluate(
32 '/rsp/photoset/photo', x, null,
33 XPathResult.ORDERED_NODE_ITERATOR_TYPE, null );
34 _this.picslist.removeAllItems(); _this.photos= new Array();
35 var n; while(n=xp.iterateNext()) {
36 _this.photos.push(
37 {
38 id: n.getAttribute('id'),
39 secret: n.getAttribute('secret'),
40 server: n.getAttribute('server')
41 }
42 );
43 var ni = _this.picslist.appendItem(
44 n.getAttribute('title'), _this.photos.length-1
45 );
46 ni.setAttribute('command','cmd_select_picture');
47 if(n.getAttribute('isprimary')==1) {
48 _this.picslist.selectedItem = ni;
49 _this.pripic = _this.photos[_this.photos.length-1];
50 }
51 }
52 _this.picslist.hidden = false;
53 }, function() { }
54 );
55 },
56 on_select_picture: function(ev) {
57 var epic = ev.explicitOriginalTarget;
58 this.picslist.selectedItem = epic;
59 var pic = this.photos[this.picslist.selectedItem.value];
60 this.pripic = pic;
61 this.primarypic.src =
62 this.fireflix.flickr.get_photo_url(
63 pic.server,
64 pic.id,
65 pic.secret,
66 't'
67 );
68 },
69 on_accept: function() {
70 this.photoset.title =
71 document.getElementById('set_title').value;
72 this.photoset.description =
73 document.getElementById('set_desc').value;
74 this.photoset.server = this.pripic.server;
75 this.photoset.primary = this.pripic.id;
76 this.photoset.secret = this.pripic.secret;
77 this.photoset.dirty = true;
78 return;
79 }
80};
81