-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 | |||
@@ -18,27 +18,24 @@ var fireflix = { | |||
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; |
@@ -88,24 +85,25 @@ var fireflix = { | |||
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; }, |
@@ -157,24 +155,25 @@ var fireflix = { | |||
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; }, |
@@ -307,24 +306,25 @@ var fireflix = { | |||
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; }, |