summaryrefslogtreecommitdiffabout
path: root/content/fireflix-panel.xul
blob: 62862a94960ebba457907b7aa504c79c429bb98c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="fireflix.css" type="text/css"?>
<!DOCTYPE page SYSTEM "chrome://fireflix/locale/fireflix.dtd">
<page
 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
 id="fireflixwindow" title="Fireflix"
 onload="fireflix.init()"
 orient="vertical"
 ondragover="nsDragAndDrop.dragOver(event,fireflix.uploadObserver)"
 ondragdrop="nsDragAndDrop.drop(event,fireflix.uploadObserver)"
 >

 <script src="chrome://global/content/nsDragAndDrop.js"/>
 <script src="chrome://global/content/nsTransferable.js"/>
 <script type="application/x-javascript" src="md5.js" />
 <script type="application/x-javascript" src="util.js" />
 <script type="application/x-javascript" src="flickr.js" />
 <script type="application/x-javascript" src="fireflix.js" />

 <stringbundleset>
  <stringbundle id="loc_strings" src="chrome://fireflix/locale/fireflix.properties" />
 </stringbundleset>

 <commandset>
  <command id="cmd_auth_auth" label="&panel.auth.auth.label;"
  oncommand="fireflix.on_cmd_auth()"/>
  <command id="cmd_auth_done" label="&panel.auth.done.label;"
  oncommand="fireflix.on_cmd_auth_done()" disabled="true"/>
  <command id="cmd_auth_open_flickr" label="&panel.auth.flickr.label;"
  oncommand="fireflix.openTab('http://www.flickr.com/')" />
  <command id="cmd_auth_unauth" label="&panel.auth.unauth.label;"
  oncommand="fireflix.on_cmd_auth_unauth()" />
  <command id="cmd_help" label="?"
  oncommand="fireflix.openTab('chrome://fireflix/content/help.xml')" />
 </commandset>
 
 <popupset>
  <popup id="auth_menu">
   <menuitem command="cmd_auth_auth"/>
   <menuitem command="cmd_auth_done" hidden="true" id="menu_auth_done"/>
   <menuitem command="cmd_auth_unauth" />
   <menuseparator/>
   <menuitem command="cmd_auth_open_flickr"/>
  </popup>
 </popupset>

 <commandset id="cmdset_search">
  <command id="cmd_search" label="&panel.search.cmd_search.label;"
  oncommand="fireflix.foundphotos.search_photos()"/>
  <command id="cmd_search_open" label="&panel.search.cmd_search_open.label;"
  oncommand="fireflix.foundphotos.on_cmd_open(event)" />
  <command id="cmd_search_prev_page"
  label="&panel.search.cmd_search_prev_page.label;"
  oncommand="fireflix.foundphotos.on_cmd_prev(event)" disabled="true"/>
  <command id="cmd_search_next_page"
  label="&panel.search.cmd_search_next_page.label;"
  oncommand="fireflix.foundphotos.on_cmd_next(event)" disabled="true"/>
 </commandset>

 <commandset id="cmdset_sets">
  <command id="cmd_refresh_sets" label="&panel.sets.cmd_refresh_sets;"
  oncommand="fireflix.on_refresh_sets()" />
  <command id="cmd_set_props" label="&panel.sets.cmd_properties;"
  oncommand="fireflix.on_set_props()" disabled="true" />
 </commandset>

 <popupset>
  <popup id="sets_menu">
   <menuitem command="cmd_set_props"/>
   <menuitem command="cmd_refresh_sets"/>
   <menuseparator/>
   <menu label="&panel.sets.generate_html;" id="sets_html_menu"/>
  </popup>
 </popupset>

 <commandset id="cmdset_uploads">
  <command id="cmd_uploads_clear" label="&panel.uploads.clear.label;"
  oncommand="fireflix.uploads.on_clear()" />
  <command id="cmd_uploads_upload" label="&panel.uploads.upload.label;"
  oncommand="fireflix.uploads.on_upload()" />
  <command id="cmd_uploads_remove" label="&panel.uploads.remove.label;"
  oncommand="fireflix.uploads.on_remove()" />
  <command id="cmd_uploads_add" label="&panel.uploads.add.label;"
  oncommand="fireflix.uploads.on_add()" />
 </commandset>

 <popupset>
  <popup id="uploads_menu">
   <menuitem command="cmd_uploads_add"/>
   <menuitem command="cmd_uploads_clear"/>
   <menuitem command="cmd_uploads_remove"/>
   <menuseparator/>
   <menuitem command="cmd_uploads_upload"/>
   <menuseparator/>
   <menu label="&panel.uploads.generate_html;" id="uploads_html_menu"/>
  </popup>
 </popupset>

 <vbox class="wholething" flex="1">

  <groupbox context="auth_menu">
   <caption label="&panel.auth_info;"/>
   <hbox>
    <vbox pack="center" flex="1">
     <label id="auth_info" value="&panel.no_auth_info;" disabled="true" crop="end"/>
    </vbox>
    <button class="lean" id="b_auth" command="cmd_auth_auth"/>
    <button class="lean" id="b_auth_done" command="cmd_auth_done" hidden="true"/>
    <button class="lean" command="cmd_auth_open_flickr" 
    tooltiptext="&panel.auth.flickr.tip;"/>
    <button class="lean" command="cmd_help"/>
   </hbox>
  </groupbox>

  <tabbox flex="1" id="fireflix_tabs">

   <tabs>
    <tab label="&panel.tabs.search;"/>
    <tab label="&panel.tabs.sets;"/>
    <tab label="&panel.tabs.tags;" hidden="true"/> <!-- TODO: -->
    <tab id="tab_upload" label="&panel.tabs.upload;"/>
   </tabs>

   <tabpanels flex="1">

    <tabpanel id="tabpanel_search" flex="1">
     <vbox flex="1">
      <groupbox class="search_params" orient="vertical" onkeypress="if(event.keyCode==event.DOM_VK_RETURN) fireflix.foundphotos.search_photos()">
       <hbox>
        <vbox pack="center">
	 <label control="search_for" value="&panel.search.search_for.label;" accesskey="s"/>
	</vbox>
	<textbox id="search_for" flex="1"/>
       </hbox>
       <hbox>
        <checkbox id="search_tags" label="&panel.search.mode.tagsonly.label;"
	tooltiptext="&panel.search.mode.tagsonly.tip;" checked="false"
	accesskey="t" />
	<checkbox id="search_mine" label="&panel.search.mode.mine.label;" checked="true" accesskey="m"/>
	<spacer flex="1"/>
	<button class="lean" command="cmd_search"/>
       </hbox>
      </groupbox>
      <hbox>
       <button class="lean" command="cmd_search_prev_page"/>
       <spacer flex="1"/>
       <label id="search_page" hidden="true"/>
       <spacer flex="1"/>
       <button class="lean" command="cmd_search_next_page"/>
      </hbox>
      <tree id="searchresults" rows="2" flex="1"
      onselect="fireflix.foundphotos.on_select()"
      ondblclick="fireflix.foundphotos.on_cmd_open(event)"
      onkeypress="if(event.keyCode==event.DOM_VK_RETURN) fireflix.foundphotos.on_cmd_open(event)">
       <treecols>
        <treecol id="sr_title" label="&panel.search.col.title.label;" flex="2" crop="end" align="start" />
       </treecols>
       <treechildren/>
      </tree>
      <groupbox id="searchresult_props" orient="horizontal" hidden="true">
       <vbox width="100" pack="center">
        <hbox pack="center">
         <image id="search_photo"
	 ondblclick="fireflix.foundphotos.on_cmd_open(event)"/>
	</hbox>
       </vbox>
       <vbox flex="1">
        <label id="searchresult_title" crop="end"/>
	<hbox flex="1" pack="center">
	 <div flex="1" id="searchresult_description" xmlns="http://www.w3.org/1999/xhtml"/>
	</hbox>
	<hbox pack="end">
	 <button command="cmd_search_open"/>
	</hbox>
       </vbox>
      </groupbox>
     </vbox>
    </tabpanel>

    <tabpanel id="tabpanel_sets" flex="1"
     onkeypress="if(event.keyCode==event.DOM_VK_RETURN)
     document.getElementById('setphotos').focus()">
     <vbox flex="1">
      <tree id="setslist" rows="2" onselect="fireflix.photosets.on_select()"
      flex="1" context="sets_menu"
      ondblclick="fireflix.photosets.on_cmd_open_in_flickr(event)"
      >
       <treecols>
	<treecol id="sl_name" label="&panel.sets.name.label;" flex="4" crop="end" align="start" tooltiptext="&panel.sets.name.tip;"/>
	<splitter class="tree-splitter" />
	<treecol id="sl_photos" label="&panel.sets.photos.label;" flex="1" align="end" tooltiptext="&panel.sets.photos.tip;" />
       </treecols>
       <treechildren/>
      </tree>
      <hbox>
       <button command="cmd_refresh_sets" />
       <button command="cmd_set_props" />
      </hbox>
      <tree id="setphotos" rows="2" onselect="fireflix.photoset.on_select()"
      flex="1" ondblclick="fireflix.photoset.on_cmd_open(event)"
      onkeypress="if(event.keyCode==event.DOM_VK_RETURN) fireflix.photoset.on_cmd_open(event)">
       <treecols>
	<treecol id="sp_title" label="&panel.setphotos.title.label;" flex="1" crop="end" align="start" tooltiptext="&panel.setphotos.title.tip;" />
	<splitter class="tree-splitter" />
	<treecol id="sp_taken" label="&panel.setphotos.taken.label;" crop="end" align="start" tooltiptext="&panel.setphotos.taken.tip;" hidden="true" />
	<treecol id="sp_upload" label="&panel.setphotos.upload.label;" crop="end" align="start" tooltiptext="&panel.setphotos.upload.tip;" hidden="true" />
       </treecols>
       <treechildren/>
      </tree>
      <groupbox id="set_photo_props" orient="horizontal" hidden="true">
       <vbox width="100" pack="center">
        <hbox pack="center">
	 <image id="set_photo"
	 ondblclick="fireflix.photoset.on_cmd_open(event)" />
	</hbox>
       </vbox>
       <spacer flex="1"/>
      </groupbox>
     </vbox>
    </tabpanel>

    <tabpanel id="tabpanel_tags">
     <listbox id="tagslist" rows="8" flex="1">
      <listhead>
       <listheader label="&panel.tagslist.tag.label;"/>
      </listhead>
      <listcols>
       <listcol flex="1"/>
      </listcols>
     </listbox>
    </tabpanel>

    <tabpanel id="tabpanel_upload">
     <vbox flex="1">
      <tree id="uploadlist" rows="2" flex="1"
      onselect="fireflix.uploads.selectionChanged()"
      context="uploads_menu">
       <treecols>
	<treecol id="up_file" label="&panel.uploadlist.file.label;" flex="4" crop="start" align="start"/>
	<splitter class="tree-splitter" />
	<treecol id="up_title" label="&panel.uploadlist.title.label;" flex="5" crop="end" align="start" />
	<splitter class="tree-splitter" />
	<treecol id="up_status" label="&panel.uploadlist.status.label;" flex="1" crop="end" align="start" />
       </treecols>
       <treechildren/>
      </tree>
      <progressmeter id="upload_progress" mode="undetermined" hidden="true" />
      <groupbox id="upload_file_props" orient="horizontal" hidden="true">
       <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="uplod_tags" value="&panel.upload_props.tags.label;" />
	  <textbox id="upload_tags"
	  oninput="fireflix.uploads.propsToSel('tags')"/>
	 </row>
	 <!-- TODO: description, public, friend, family -->
	</rows>
       </grid>
      </groupbox>
      <hbox>
       <button class="lean" command="cmd_uploads_add" />
       <spacer flex="1"/>
       <button class="lean" command="cmd_uploads_remove" />
       <spacer flex="1"/>
       <button class="lean" command="cmd_uploads_clear" />
      </hbox>
      <hbox pack="center">
       <button command="cmd_uploads_upload" flex="1"/>
      </hbox>
     </vbox>
    </tabpanel>

   </tabpanels>

  </tabbox>

 </vbox>

</page>