-rw-r--r-- | content/fireflix.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/content/fireflix.js b/content/fireflix.js index 966630c..63a4118 100644 --- a/content/fireflix.js +++ b/content/fireflix.js | |||
@@ -14,35 +14,32 @@ var fireflix = { | |||
14 | init: function() { | 14 | init: function() { |
15 | pull_elements(this,document,[ | 15 | pull_elements(this,document,[ |
16 | 'cmd_auth_auth','cmd_auth_done','cmd_auth_unauth', | 16 | 'cmd_auth_auth','cmd_auth_done','cmd_auth_unauth', |
17 | 'menu_auth_done','b_auth','b_auth_done','auth_info', | 17 | 'menu_auth_done','b_auth','b_auth_done','auth_info', |
18 | 'loc_strings','cmd_set_props' | 18 | 'loc_strings','cmd_set_props' |
19 | ]); | 19 | ]); |
20 | this.build_menus(); | 20 | this.build_menus(); |
21 | this.foundphotos.init(this); | 21 | this.foundphotos.init(this); |
22 | this.photosets.init(this); | 22 | this.photosets.init(this); |
23 | this.photoset.init(this); | 23 | this.photoset.init(this); |
24 | this.uploads.init(this); | 24 | this.uploads.init(this); |
25 | this.uploadObserver.init(this); | 25 | this.uploadObserver.init(this); |
26 | this.flickr.api_key = '9c43cd66947a57e6f29db1a9da3f72e3'; | 26 | this.flickr.api_key = '9c43cd66947a57e6f29db1a9da3f72e3'; |
27 | this.flickr.api_shs = '9c33c9e2f0f0cfd5'; | 27 | this.flickr.api_shs = '9c33c9e2f0f0cfd5'; |
28 | this.flickr.prefs_root = 'net.klever.kin.fireflix'; | 28 | this.flickr.prefs_root = 'net.klever.kin.fireflix'; |
29 | this.flickr.load_token(); | 29 | this.flickr.load_token(); |
30 | document.getElementById('setslist').view = this.photosets; | ||
31 | document.getElementById('setphotos').view = this.photoset; | ||
32 | document.getElementById('uploadlist').view = this.uploads; | ||
33 | this.no_auth_info_label = this.auth_info.value; | 30 | this.no_auth_info_label = this.auth_info.value; |
34 | this.set_auth_state(this.flickr.token,false); | 31 | this.set_auth_state(this.flickr.token,false); |
35 | if(this.flickr.token) { | 32 | if(this.flickr.token) { |
36 | this.refresh_stuff(); | 33 | this.refresh_stuff(); |
37 | }else{ | 34 | }else{ |
38 | this.on_cmd_auth(); | 35 | this.on_cmd_auth(); |
39 | } | 36 | } |
40 | }, | 37 | }, |
41 | set_auth_state: function(au,inp) { /* authorized, in progress */ | 38 | set_auth_state: function(au,inp) { /* authorized, in progress */ |
42 | this.cmd_auth_unauth.disabled = !au; | 39 | this.cmd_auth_unauth.disabled = !au; |
43 | this.b_auth.hidden = au || inp; | 40 | this.b_auth.hidden = au || inp; |
44 | this.b_auth_done.hidden = !inp; | 41 | this.b_auth_done.hidden = !inp; |
45 | this.menu_auth_done.hidden = !inp; | 42 | this.menu_auth_done.hidden = !inp; |
46 | this.cmd_auth_done.setAttribute('disabled',!inp); | 43 | this.cmd_auth_done.setAttribute('disabled',!inp); |
47 | this.auth_info.disabled = !au; | 44 | this.auth_info.disabled = !au; |
48 | if(au) { | 45 | if(au) { |
@@ -84,32 +81,33 @@ var fireflix = { | |||
84 | this.set_auth_state(false,false); | 81 | this.set_auth_state(false,false); |
85 | }, | 82 | }, |
86 | 83 | ||
87 | refresh_sets: function() { this.photosets.refresh_sets(); }, | 84 | refresh_sets: function() { this.photosets.refresh_sets(); }, |
88 | refresh_stuff: function() { | 85 | refresh_stuff: function() { |
89 | this.refresh_sets(); | 86 | this.refresh_sets(); |
90 | this.refresh_user_tags(); | 87 | this.refresh_user_tags(); |
91 | }, | 88 | }, |
92 | 89 | ||
93 | /* photoset treeview */ | 90 | /* photoset treeview */ |
94 | photoset: { | 91 | photoset: { |
95 | photos: new Array(), | 92 | photos: new Array(), |
96 | fireflix: null, | 93 | fireflix: null, |
97 | init: function(f) { | 94 | init: function(f) { |
98 | this.fireflix = f; | 95 | this.fireflix = f; |
99 | pull_elements(this,document,[ 'set_photo' ]); | 96 | pull_elements(this,document,[ 'set_photo' ]); |
97 | document.getElementById('setphotos').view = this; | ||
100 | }, | 98 | }, |
101 | rowCount: 0, | 99 | rowCount: 0, |
102 | getCellText: function(r,c) { | 100 | getCellText: function(r,c) { |
103 | var p = this.photos[r]; | 101 | var p = this.photos[r]; |
104 | if(c.id=='sp_title') return p.title; | 102 | if(c.id=='sp_title') return p.title; |
105 | if(c.id=='sp_taken') return p.datetaken; | 103 | if(c.id=='sp_taken') return p.datetaken; |
106 | if(c.id=='sp_upload') return p.dateupload; /* TODO: unixtime conversion */ | 104 | if(c.id=='sp_upload') return p.dateupload; /* TODO: unixtime conversion */ |
107 | return c.id; | 105 | return c.id; |
108 | }, | 106 | }, |
109 | setTree: function(t) { this.tree = t }, | 107 | setTree: function(t) { this.tree = t }, |
110 | isContainer: function(r) { return false; }, | 108 | isContainer: function(r) { return false; }, |
111 | isSeparator: function(r) { return false; }, | 109 | isSeparator: function(r) { return false; }, |
112 | isSorted: function(r) { return false; }, | 110 | isSorted: function(r) { return false; }, |
113 | getLevel: function(r) { return 0; }, | 111 | getLevel: function(r) { return 0; }, |
114 | getImageSrc: function(r,c) { return null }, | 112 | getImageSrc: function(r,c) { return null }, |
115 | getRowProperties: function(r,p) {}, | 113 | getRowProperties: function(r,p) {}, |
@@ -153,32 +151,33 @@ var fireflix = { | |||
153 | var p = this.photos[this.selection.currentIndex]; | 151 | var p = this.photos[this.selection.currentIndex]; |
154 | this.set_photo.src = | 152 | this.set_photo.src = |
155 | this.fireflix.flickr.get_photo_url(p.server,p.id,p.secret,'t'); | 153 | this.fireflix.flickr.get_photo_url(p.server,p.id,p.secret,'t'); |
156 | this.set_photo.hidden = false; | 154 | this.set_photo.hidden = false; |
157 | }else{ | 155 | }else{ |
158 | this.set_photo.hidden = true; | 156 | this.set_photo.hidden = true; |
159 | } | 157 | } |
160 | } | 158 | } |
161 | }, | 159 | }, |
162 | 160 | ||
163 | /* photosets treeview */ | 161 | /* photosets treeview */ |
164 | photosets: { | 162 | photosets: { |
165 | sets: new Array(), | 163 | sets: new Array(), |
166 | fireflix: null, | 164 | fireflix: null, |
167 | init: function(f) { | 165 | init: function(f) { |
168 | this.fireflix = f; | 166 | this.fireflix = f; |
167 | document.getElementById('setslist').view = this; | ||
169 | }, | 168 | }, |
170 | rowCount: 0, | 169 | rowCount: 0, |
171 | getCellText: function(r,c) { | 170 | getCellText: function(r,c) { |
172 | var s = this.sets[r]; | 171 | var s = this.sets[r]; |
173 | if(c.id=='sl_name') return s.title; | 172 | if(c.id=='sl_name') return s.title; |
174 | if(c.id=='sl_photos') return s.photos; | 173 | if(c.id=='sl_photos') return s.photos; |
175 | return c.id; | 174 | return c.id; |
176 | }, | 175 | }, |
177 | setTree: function(t) { this.tree = t }, | 176 | setTree: function(t) { this.tree = t }, |
178 | isContainer: function(r) { return false; }, | 177 | isContainer: function(r) { return false; }, |
179 | isSeparator: function(r) { return false; }, | 178 | isSeparator: function(r) { return false; }, |
180 | isSorted: function() { return false; }, | 179 | isSorted: function() { return false; }, |
181 | getLevel: function(r) { return 0; }, | 180 | getLevel: function(r) { return 0; }, |
182 | getImageSrc: function(r,c) { return null }, | 181 | getImageSrc: function(r,c) { return null }, |
183 | getRowProperties: function(r,p) {}, | 182 | getRowProperties: function(r,p) {}, |
184 | getCellProperties: function(cid,cel,p) { }, | 183 | getCellProperties: function(cid,cel,p) { }, |
@@ -303,32 +302,33 @@ var fireflix = { | |||
303 | if(/\S/.test(us[ui])) | 302 | if(/\S/.test(us[ui])) |
304 | this.fireflix.uploads.add(us[ui]); | 303 | this.fireflix.uploads.add(us[ui]); |
305 | document.getElementById('fireflix_tabs').selectedTab | 304 | document.getElementById('fireflix_tabs').selectedTab |
306 | = document.getElementById('tab_upload'); | 305 | = document.getElementById('tab_upload'); |
307 | } | 306 | } |
308 | }, | 307 | }, |
309 | 308 | ||
310 | uploads: { | 309 | uploads: { |
311 | fireflix: null, | 310 | fireflix: null, |
312 | init: function(f) { | 311 | init: function(f) { |
313 | this.fireflix=f; | 312 | this.fireflix=f; |
314 | pull_elements(this,document,[ | 313 | pull_elements(this,document,[ |
315 | 'upload_filename','upload_title','upload_file_preview', | 314 | 'upload_filename','upload_title','upload_file_preview', |
316 | 'upload_file_props','upload_progress','upload_tags', | 315 | 'upload_file_props','upload_progress','upload_tags', |
317 | 'cmd_uploads_upload' | 316 | 'cmd_uploads_upload' |
318 | ]); | 317 | ]); |
318 | document.getElementById('uploadlist').view = this; | ||
319 | }, | 319 | }, |
320 | files: new Array(), | 320 | files: new Array(), |
321 | rowCount: 0, | 321 | rowCount: 0, |
322 | getCellText: function(r,c) { | 322 | getCellText: function(r,c) { |
323 | var f = this.files[r]; | 323 | var f = this.files[r]; |
324 | if(c.id=='up_file') return f.file; | 324 | if(c.id=='up_file') return f.file; |
325 | if(c.id=='up_title') return f.title; | 325 | if(c.id=='up_title') return f.title; |
326 | if(c.id=='up_status') return f.state; | 326 | if(c.id=='up_status') return f.state; |
327 | return c.id; | 327 | return c.id; |
328 | }, | 328 | }, |
329 | setTree: function(t) { this.tree = t }, | 329 | setTree: function(t) { this.tree = t }, |
330 | isContainer: function(r) { return false; }, | 330 | isContainer: function(r) { return false; }, |
331 | isSeparator: function(r) { return false; }, | 331 | isSeparator: function(r) { return false; }, |
332 | isSorted: function(r) { return false; }, | 332 | isSorted: function(r) { return false; }, |
333 | getLevel: function(r) { return 0; }, | 333 | getLevel: function(r) { return 0; }, |
334 | getImageSrc: function(r,c) { return null }, | 334 | getImageSrc: function(r,c) { return null }, |