-rw-r--r-- | content/fireflix-panel.xul | 57 | ||||
-rw-r--r-- | content/fireflix.css | 8 | ||||
-rw-r--r-- | content/fireflix.js | 25 |
3 files changed, 56 insertions, 34 deletions
diff --git a/content/fireflix-panel.xul b/content/fireflix-panel.xul index 0e511c5..aa3dbd6 100644 --- a/content/fireflix-panel.xul +++ b/content/fireflix-panel.xul | |||
@@ -246,51 +246,54 @@ | |||
246 | onselect="fireflix.uploads.selectionChanged()" | 246 | onselect="fireflix.uploads.selectionChanged()" |
247 | context="uploads_menu"> | 247 | context="uploads_menu"> |
248 | <treecols> | 248 | <treecols> |
249 | <treecol id="up_file" label="&panel.uploadlist.file.label;" flex="4" crop="start" align="start"/> | 249 | <treecol id="up_file" label="&panel.uploadlist.file.label;" flex="4" crop="start" align="start"/> |
250 | <splitter class="tree-splitter" /> | 250 | <splitter class="tree-splitter" /> |
251 | <treecol id="up_title" label="&panel.uploadlist.title.label;" flex="5" crop="end" align="start" /> | 251 | <treecol id="up_title" label="&panel.uploadlist.title.label;" flex="5" crop="end" align="start" /> |
252 | <splitter class="tree-splitter" /> | 252 | <splitter class="tree-splitter" /> |
253 | <treecol id="up_status" label="&panel.uploadlist.status.label;" flex="1" crop="end" align="start" /> | 253 | <treecol id="up_status" label="&panel.uploadlist.status.label;" flex="1" crop="end" align="start" /> |
254 | </treecols> | 254 | </treecols> |
255 | <treechildren/> | 255 | <treechildren/> |
256 | </tree> | 256 | </tree> |
257 | <progressmeter id="upload_progress" mode="undetermined" hidden="true" /> | 257 | <progressmeter id="upload_progress" mode="undetermined" hidden="true" /> |
258 | <groupbox id="upload_file_props" orient="horizontal" hidden="true"> | 258 | <groupbox id="upload_file_props" orient="vertical" hidden="true"> |
259 | <image id="upload_file_preview" width="100" height="100" /> | 259 | <hbox> |
260 | <grid flex="1"> | 260 | <image id="upload_file_preview" width="100" height="100" /> |
261 | <columns> | 261 | <grid flex="1"> |
262 | <column/> | 262 | <columns> |
263 | <column flex="1"/> | 263 | <column/> |
264 | </columns> | 264 | <column flex="1"/> |
265 | <rows> | 265 | </columns> |
266 | <row> | 266 | <rows> |
267 | <label control="upload_filename" | 267 | <row> |
268 | value="&panel.upload_props.filename.label;" /> | 268 | <label control="upload_filename" |
269 | <textbox id="upload_filename" | 269 | value="&panel.upload_props.filename.label;" /> |
270 | oninput="fireflix.uploads.propsToSel('filename')"/> | 270 | <textbox id="upload_filename" |
271 | </row> | 271 | oninput="fireflix.uploads.propsToSel('filename')"/> |
272 | <row> | 272 | </row> |
273 | <label control="upload_title" value="&panel.upload_props.title.label;" /> | 273 | <row> |
274 | <textbox id="upload_title" | 274 | <label control="upload_title" value="&panel.upload_props.title.label;" /> |
275 | oninput="fireflix.uploads.propsToSel('title')"/> | 275 | <textbox id="upload_title" |
276 | </row> | 276 | oninput="fireflix.uploads.propsToSel('title')"/> |
277 | <row> | 277 | </row> |
278 | <label control="uplod_tags" value="&panel.upload_props.tags.label;" /> | 278 | <row> |
279 | <textbox id="upload_tags" | 279 | <label control="upload_tags" value="&panel.upload_props.tags.label;" /> |
280 | oninput="fireflix.uploads.propsToSel('tags')"/> | 280 | <textbox id="upload_tags" |
281 | </row> | 281 | oninput="fireflix.uploads.propsToSel('tags')"/> |
282 | <!-- TODO: description, public, friend, family --> | 282 | </row> |
283 | </rows> | 283 | <!-- TODO: description, public, friend, family --> |
284 | </grid> | 284 | </rows> |
285 | </grid> | ||
286 | </hbox> | ||
287 | <description id="upload_failure" hidden="true"/> | ||
285 | </groupbox> | 288 | </groupbox> |
286 | <hbox> | 289 | <hbox> |
287 | <button class="lean" command="cmd_uploads_add" /> | 290 | <button class="lean" command="cmd_uploads_add" /> |
288 | <spacer flex="1"/> | 291 | <spacer flex="1"/> |
289 | <button class="lean" command="cmd_uploads_remove" /> | 292 | <button class="lean" command="cmd_uploads_remove" /> |
290 | <spacer flex="1"/> | 293 | <spacer flex="1"/> |
291 | <button class="lean" command="cmd_uploads_clear" /> | 294 | <button class="lean" command="cmd_uploads_clear" /> |
292 | </hbox> | 295 | </hbox> |
293 | <hbox pack="center"> | 296 | <hbox pack="center"> |
294 | <button command="cmd_uploads_upload" flex="1"/> | 297 | <button command="cmd_uploads_upload" flex="1"/> |
295 | </hbox> | 298 | </hbox> |
296 | </vbox> | 299 | </vbox> |
diff --git a/content/fireflix.css b/content/fireflix.css index ab90c11..06ae28a 100644 --- a/content/fireflix.css +++ b/content/fireflix.css | |||
@@ -34,24 +34,32 @@ tree#uploadlist treechildren::-moz-tree-cell-text(uploading) { | |||
34 | groupbox#searchresult_props, | 34 | groupbox#searchresult_props, |
35 | groupbox.search_params, | 35 | groupbox.search_params, |
36 | groupbox#upload_file_props, | 36 | groupbox#upload_file_props, |
37 | groupbox#set_props, | 37 | groupbox#set_props, |
38 | groupbox#set_photo_props { | 38 | groupbox#set_photo_props { |
39 | background: white; | 39 | background: white; |
40 | } | 40 | } |
41 | 41 | ||
42 | groupbox#upload_file_props label { | 42 | groupbox#upload_file_props label { |
43 | text-align: right; | 43 | text-align: right; |
44 | } | 44 | } |
45 | 45 | ||
46 | description#upload_failure { | ||
47 | border-top: solid 1px red; | ||
48 | margin: 0px; padding: 2px; | ||
49 | text-align: left; | ||
50 | font-size: 85%; | ||
51 | line-height: 105%; | ||
52 | } | ||
53 | |||
46 | image#search_photo, image#set_photo, image#set_primary { | 54 | image#search_photo, image#set_photo, image#set_primary { |
47 | border: black 1px solid; | 55 | border: black 1px solid; |
48 | } | 56 | } |
49 | 57 | ||
50 | .about .insides { | 58 | .about .insides { |
51 | margin: 1ex; | 59 | margin: 1ex; |
52 | } | 60 | } |
53 | .about .text { | 61 | .about .text { |
54 | border: yellow solid 1px; | 62 | border: yellow solid 1px; |
55 | background: green; | 63 | background: green; |
56 | } | 64 | } |
57 | .about .title { | 65 | .about .title { |
diff --git a/content/fireflix.js b/content/fireflix.js index 995ec5c..7291b68 100644 --- a/content/fireflix.js +++ b/content/fireflix.js | |||
@@ -323,25 +323,25 @@ var fireflix = { | |||
323 | document.getElementById('fireflix_tabs').selectedTab | 323 | document.getElementById('fireflix_tabs').selectedTab |
324 | = document.getElementById('tab_upload'); | 324 | = document.getElementById('tab_upload'); |
325 | } | 325 | } |
326 | }, | 326 | }, |
327 | 327 | ||
328 | uploads: { | 328 | uploads: { |
329 | fireflix: null, | 329 | fireflix: null, |
330 | init: function(f) { | 330 | init: function(f) { |
331 | this.fireflix=f; | 331 | this.fireflix=f; |
332 | pull_elements(this,document,[ | 332 | pull_elements(this,document,[ |
333 | 'upload_filename','upload_title','upload_file_preview', | 333 | 'upload_filename','upload_title','upload_file_preview', |
334 | 'upload_file_props','upload_progress','upload_tags', | 334 | 'upload_file_props','upload_progress','upload_tags', |
335 | 'cmd_uploads_upload' | 335 | 'cmd_uploads_upload', 'upload_failure' |
336 | ]); | 336 | ]); |
337 | document.getElementById('uploadlist').view = this; | 337 | document.getElementById('uploadlist').view = this; |
338 | }, | 338 | }, |
339 | files: new Array(), | 339 | files: new Array(), |
340 | rowCount: 0, | 340 | rowCount: 0, |
341 | getCellText: function(r,c) { | 341 | getCellText: function(r,c) { |
342 | var f = this.files[r]; | 342 | var f = this.files[r]; |
343 | if(c.id=='up_file') return f.file; | 343 | if(c.id=='up_file') return f.file; |
344 | if(c.id=='up_title') return f.title; | 344 | if(c.id=='up_title') return f.title; |
345 | if(c.id=='up_status') return f.state; | 345 | if(c.id=='up_status') return f.state; |
346 | return c.id; | 346 | return c.id; |
347 | }, | 347 | }, |
@@ -480,44 +480,53 @@ var fireflix = { | |||
480 | this.tree.endUpdateBatch(); | 480 | this.tree.endUpdateBatch(); |
481 | this.selToProps(); | 481 | this.selToProps(); |
482 | }, | 482 | }, |
483 | selectionChanged: function() { | 483 | selectionChanged: function() { |
484 | this.selToProps(); | 484 | this.selToProps(); |
485 | }, | 485 | }, |
486 | disableProps: function() { | 486 | disableProps: function() { |
487 | this.upload_filename.value=''; | 487 | this.upload_filename.value=''; |
488 | this.upload_filename.disabled = true; | 488 | this.upload_filename.disabled = true; |
489 | this.upload_title.value=''; | 489 | this.upload_title.value=''; |
490 | this.upload_title.disabled = true; | 490 | this.upload_title.disabled = true; |
491 | this.upload_file_preview.src = null; | 491 | this.upload_file_preview.src = null; |
492 | this.upload_file_props.hidden = true; | ||
493 | this.upload_tags.value=''; | 492 | this.upload_tags.value=''; |
494 | this.upload_tags.disabled = true; | 493 | this.upload_tags.disabled = true; |
494 | /* this.upload_file_props.hidden = true; */ | ||
495 | }, | 495 | }, |
496 | selToProps: function() { | 496 | selToProps: function() { |
497 | if(!this.selection.count) { | 497 | if(!this.selection.count) { |
498 | this.disableProps(); | 498 | this.disableProps(); |
499 | this.upload_file_props.hidden = true; | ||
499 | }else if(this.selection.count==1) { | 500 | }else if(this.selection.count==1) { |
500 | var f=this.files[this.selection.currentIndex]; | 501 | var f=this.files[this.selection.currentIndex]; |
501 | if(f==null || f.state!='pending') { | 502 | if(f==null) { |
502 | this.disableProps(); | 503 | this.disableProps(); |
504 | this.upload_file_props.hidden = true; | ||
503 | }else{ | 505 | }else{ |
506 | var inactives = f.state!='pending'; | ||
504 | this.upload_filename.value = f.file; | 507 | this.upload_filename.value = f.file; |
505 | this.upload_filename.disabled = false; | 508 | this.upload_filename.disabled = inactives; |
506 | this.upload_title.value = f.title; | 509 | this.upload_title.value = f.title; |
507 | this.upload_title.disabled = false; | 510 | this.upload_title.disabled = inactives; |
508 | this.upload_file_preview.src = 'file:///'+f.file; | 511 | this.upload_file_preview.src = 'file:///'+f.file; |
509 | this.upload_file_props.hidden = false; | ||
510 | this.upload_tags.value = f.tags; | 512 | this.upload_tags.value = f.tags; |
511 | this.upload_tags.disabled = false; | 513 | this.upload_tags.disabled = inactives; |
514 | if(f.state=='failed') { | ||
515 | this.upload_failure.textContent=f.flickr_errcode+': '+f.flickr_errmsg; | ||
516 | this.upload_failure.hidden = false; | ||
517 | }else{ | ||
518 | this.upload_failure.hidden = true; | ||
519 | } | ||
520 | this.upload_file_props.hidden = false; | ||
512 | } | 521 | } |
513 | }else{ | 522 | }else{ |
514 | var ftitle = null; var onetitle = true; | 523 | var ftitle = null; var onetitle = true; |
515 | var ftags = null; var onetag = true; | 524 | var ftags = null; var onetag = true; |
516 | var fs = 0; | 525 | var fs = 0; |
517 | for(var ff in this.files) { | 526 | for(var ff in this.files) { |
518 | if(this.selection.isSelected(ff) && this.files[ff].state=='pending' ) { | 527 | if(this.selection.isSelected(ff) && this.files[ff].state=='pending' ) { |
519 | ++fs; | 528 | ++fs; |
520 | if(ftitle==null) { | 529 | if(ftitle==null) { |
521 | ftitle = this.files[ff].title; | 530 | ftitle = this.files[ff].title; |
522 | }else if(ftitle!=this.files[ff].title) { | 531 | }else if(ftitle!=this.files[ff].title) { |
523 | onetitle = false; | 532 | onetitle = false; |
@@ -530,27 +539,29 @@ var fireflix = { | |||
530 | } | 539 | } |
531 | } | 540 | } |
532 | if(fs) { | 541 | if(fs) { |
533 | this.upload_filename.value=''; | 542 | this.upload_filename.value=''; |
534 | this.upload_filename.disabled = true; | 543 | this.upload_filename.disabled = true; |
535 | if(onetitle) | 544 | if(onetitle) |
536 | this.upload_title.value = ftitle; | 545 | this.upload_title.value = ftitle; |
537 | this.upload_title.disabled = false; | 546 | this.upload_title.disabled = false; |
538 | if(onetag) | 547 | if(onetag) |
539 | this.upload_tags.value = ftags; | 548 | this.upload_tags.value = ftags; |
540 | this.upload_tags.disabled = false; | 549 | this.upload_tags.disabled = false; |
541 | this.upload_file_preview.src = null; | 550 | this.upload_file_preview.src = null; |
551 | this.upload_failure.hidden = true; | ||
542 | this.upload_file_props.hidden = false; | 552 | this.upload_file_props.hidden = false; |
543 | }else | 553 | }else |
544 | this.disableProps(); | 554 | this.disableProps(); |
555 | this.upload_file_props.hidden = true; | ||
545 | } | 556 | } |
546 | }, | 557 | }, |
547 | propsToSel: function(prop) { | 558 | propsToSel: function(prop) { |
548 | if(this.selection.count<=0) return; | 559 | if(this.selection.count<=0) return; |
549 | for(var ff in this.files) { | 560 | for(var ff in this.files) { |
550 | if(this.selection.isSelected(ff) && this.files[ff].state=='pending') { | 561 | if(this.selection.isSelected(ff) && this.files[ff].state=='pending') { |
551 | if(prop=='filename') | 562 | if(prop=='filename') |
552 | this.files[ff].file = this.upload_filename.value; | 563 | this.files[ff].file = this.upload_filename.value; |
553 | if(prop=='title') | 564 | if(prop=='title') |
554 | this.files[ff].title = this.upload_title.value; | 565 | this.files[ff].title = this.upload_title.value; |
555 | if(prop=='tags') | 566 | if(prop=='tags') |
556 | this.files[ff].tags = this.upload_tags.value; | 567 | this.files[ff].tags = this.upload_tags.value; |