-rw-r--r-- | content/fireflix-panel.xul | 57 | ||||
-rw-r--r-- | content/fireflix.js | 53 | ||||
-rw-r--r-- | locale/en-US/fireflix.dtd | 3 |
3 files changed, 72 insertions, 41 deletions
diff --git a/content/fireflix-panel.xul b/content/fireflix-panel.xul index aa3dbd6..405804c 100644 --- a/content/fireflix-panel.xul +++ b/content/fireflix-panel.xul @@ -259,29 +259,36 @@ <hbox> <image id="upload_file_preview" width="100" height="100" /> - <grid flex="1"> - <columns> - <column/> - <column flex="1"/> - </columns> - <rows> - <row> - <label control="upload_filename" - value="&panel.upload_props.filename.label;" /> - <textbox id="upload_filename" - oninput="fireflix.uploads.propsToSel('filename')"/> - </row> - <row> - <label control="upload_title" value="&panel.upload_props.title.label;" /> - <textbox id="upload_title" - oninput="fireflix.uploads.propsToSel('title')"/> - </row> - <row> - <label control="upload_tags" value="&panel.upload_props.tags.label;" /> - <textbox id="upload_tags" - oninput="fireflix.uploads.propsToSel('tags')"/> - </row> - <!-- TODO: description, public, friend, family --> - </rows> - </grid> + <vbox flex="1"> + <grid> + <columns> + <column/> + <column flex="1"/> + </columns> + <rows> + <row> + <label control="upload_filename" + value="&panel.upload_props.filename.label;" /> + <textbox id="upload_filename" + oninput="fireflix.uploads.propsToSel('filename')"/> + </row> + <row> + <label control="upload_title" value="&panel.upload_props.title.label;" /> + <textbox id="upload_title" + oninput="fireflix.uploads.propsToSel('title')"/> + </row> + <row> + <label control="upload_tags" value="&panel.upload_props.tags.label;" /> + <textbox id="upload_tags" + oninput="fireflix.uploads.propsToSel('tags')"/> + </row> + <!-- TODO: description, public, friend, family --> + </rows> + </grid> + <hbox> + <checkbox id="upload_is_public" label="&panel.upload_props.is_public;"/> + <checkbox id="upload_is_friends" label="&panel.upload_props.is_friend;"/> + <checkbox id="upload_is_family" label="&panel.upload_props.is_family;"/> + </hbox> + </vbox> </hbox> <description id="upload_failure" hidden="true"/> diff --git a/content/fireflix.js b/content/fireflix.js index 7291b68..78e56c2 100644 --- a/content/fireflix.js +++ b/content/fireflix.js @@ -333,7 +333,20 @@ var fireflix = { 'upload_filename','upload_title','upload_file_preview', 'upload_file_props','upload_progress','upload_tags', - 'cmd_uploads_upload', 'upload_failure' + 'cmd_uploads_upload', 'upload_failure', 'upload_is_public', + 'upload_is_friends', 'upload_is_family' ]); document.getElementById('uploadlist').view = this; + this.upload_is_public.addEventListener( + 'CheckboxStateChange', { that: this, + handleEvent: function(ev) { this.that.propsToSel('is_public'); } + }, false ); + this.upload_is_friends.addEventListener( + 'CheckboxStateChange', { that: this, + handleEvent: function(ev) { this.that.propsToSel('is_friends'); } + }, false ); + this.upload_is_family.addEventListener( + 'CheckboxStateChange', { that: this, + handleEvent: function(ev) { this.that.propsToSel('is_family'); } + }, false ); }, files: new Array(), @@ -386,4 +399,5 @@ var fireflix = { title: t, tags: '', + is_public: true, is_friend: false, is_family: false, state: 'pending' } ); @@ -401,6 +415,10 @@ var fireflix = { var _this = this; this.fireflix.flickr.upload_file( - ff.file, { title: ff.title, tags: ff.tags }, - function(x,p) { + ff.file, { + title: ff.title, tags: ff.tags, + is_public: ff.is_public?'1':'0', + is_friend: ff.is_friend?'1':'0', + is_family: ff.is_family?'1':'0' + }, function(x,p) { ff.photoid = p; _this.batch_ids.push(p); @@ -492,4 +510,7 @@ var fireflix = { this.upload_tags.value=''; this.upload_tags.disabled = true; + this.upload_is_public.disabled = true; + this.upload_is_friends.disabled = true; + this.upload_is_family.disabled = true; /* this.upload_file_props.hidden = true; */ }, @@ -505,13 +526,13 @@ var fireflix = { }else{ var inactives = f.state!='pending'; - this.upload_filename.value = f.file; - this.upload_filename.disabled = inactives; - this.upload_title.value = f.title; - this.upload_title.disabled = inactives; + this.upload_filename.value = f.file; this.upload_filename.disabled = inactives; + this.upload_title.value = f.title; this.upload_title.disabled = inactives; this.upload_file_preview.src = 'file:///'+f.file; - this.upload_tags.value = f.tags; - this.upload_tags.disabled = inactives; + this.upload_tags.value = f.tags; this.upload_tags.disabled = inactives; + this.upload_is_public.checked = f.is_public; this.upload_is_public.disabled = inactives; + this.upload_is_friends.checked = f.is_friend; this.upload_is_friends.disabled = inactives; + this.upload_is_family.checked = f.is_family; this.upload_is_family.disabled = inactives; if(f.state=='failed') { - this.upload_failure.textContent=f.flickr_errcode+': '+f.flickr_errmsg; + this.upload_failure.textContent=((f.flickr_errcode<0)?'':f.flickr_errcode+': ')+f.flickr_errmsg; this.upload_failure.hidden = false; }else{ @@ -560,10 +581,10 @@ var fireflix = { for(var ff in this.files) { if(this.selection.isSelected(ff) && this.files[ff].state=='pending') { - if(prop=='filename') - this.files[ff].file = this.upload_filename.value; - if(prop=='title') - this.files[ff].title = this.upload_title.value; - if(prop=='tags') - this.files[ff].tags = this.upload_tags.value; + if(prop=='filename') this.files[ff].file = this.upload_filename.value; + if(prop=='title') this.files[ff].title = this.upload_title.value; + if(prop=='tags') this.files[ff].tags = this.upload_tags.value; + if(prop=='is_public') this.files[ff].is_public = this.upload_is_public.checked; + if(prop=='is_friends') this.files[ff].is_friend = this.upload_is_friends.checked; + if(prop=='is_family') this.files[ff].is_family = this.upload_is_family.checked; this.tree.invalidateRow(ff); } diff --git a/locale/en-US/fireflix.dtd b/locale/en-US/fireflix.dtd index 3380078..d975031 100644 --- a/locale/en-US/fireflix.dtd +++ b/locale/en-US/fireflix.dtd @@ -70,4 +70,7 @@ <!ENTITY panel.upload_props.title.label "Title:"> <!ENTITY panel.upload_props.tags.label "Tags:"> +<!ENTITY panel.upload_props.is_public "Public"> +<!ENTITY panel.upload_props.is_friend "Friends"> +<!ENTITY panel.upload_props.is_family "Family"> <!ENTITY panel.uploads.upload.label "Upload"> |