source: extensions/AMetaData/admin/amd_metadata_select.tpl @ 5959

Last change on this file since 5959 was 5959, checked in by grum, 14 years ago

Some changes on release 0.4b

  • Property svn:executable set to *
File size: 8.3 KB
Line 
1{literal}
2<style>
3 .ui-widget-overlay {
4    background:#000000;
5    opacity:0.88;
6    filter:alpha(opacity:88);
7 }
8</style>
9
10
11<script type="text/javascript">
12
13  var globalTagId;
14
15  function init()
16  {
17    computedWidth=$("#content").get(0).clientWidth;
18    computedHeight=$("#content").get(0).clientHeight;
19    $("#dialogViewDetail")
20    .dialog(
21      {
22        autoOpen: false,
23        resizable: false,
24        width:computedWidth,
25        height:computedHeight,
26        modal: true,
27        draggable:true,
28        dialogClass: 'gcBgTabSheet gcBorder',
29        title: '{/literal}{"g003_metadata_detail"|@translate}{literal}',
30        open: function(event, ui)
31        {
32          bH=$("div.ui-dialog-buttonpane").get(0).clientHeight;
33          $("#dialogViewDetail").css('height', (this.clientHeight-bH)+"px");
34          $("#iListImages").css('height', (this.clientHeight-bH-$("#iListImagesNb").get(0).clientHeight-$("#iHeaderListImages").get(0).clientHeight)+"px");
35        },
36        buttons:
37        {
38          '{/literal}{"g003_ok"|@translate}{literal}':
39            function()
40            {
41              $(this).dialog('close');
42            }
43        }
44      }
45    );
46  }
47
48  function loadTagList()
49  {
50    order=$('#iSelectOrderTagList').val();
51    filter=$("#iSelectFilterTagList").val();
52    unusedTag=($("#iExcludeUnusedTagList").get(0).checked)?"y":"n";
53    selectedOnly=($("#iSelectedTagOnly").get(0).checked)?"y":"n";
54
55    displayTagListOrder();
56
57    $("#iListTags").html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>");
58
59    $.ajax(
60      {
61        type: "POST",
62        url: "{/literal}{$datas.urlRequest}{literal}",
63        async: true,
64        data: { ajaxfct:"showStatsGetListTags", orderType:order, filterType:filter, excludeUnusedTag:unusedTag, selectedTagOnly:selectedOnly },
65        success:
66          function(msg)
67          {
68            $("#iListTags").html(msg);
69
70            $("#iListTagsNb").html(
71              "{/literal}{'g003_number_of_filtered_metadata'|@translate}{literal} "+$("#iListTags table tr").length
72            );
73
74            //onclick="updateTagSelect('iNumId{$data.numId}', '')"
75            $("input.cbiListTags")
76              .bind('click',
77                function(event)
78                {
79                  event.stopPropagation();
80                  updateTagSelect($(this).get(0).id, '');
81                }
82              );
83
84            $("a.cbiListTags")
85              .bind('click',
86                function(event)
87                {
88                  event.stopPropagation();
89                  loadTagDetail($(this).get(0).id.substr(7));
90                }
91              );
92          }
93      }
94    );
95
96  }
97
98  function loadTagDetail(tag)
99  {
100    $("#dialogViewDetail").dialog('open');
101
102    globalTagId=tag;
103    order=$('#iSelectOrderImageList').val();
104    $("#iListImages").html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>");
105    $("#iHeaderListImagesTagName").html("["+tag+"]");
106
107    $.ajax(
108      {
109        type: "POST",
110        url: "{/literal}{$datas.urlRequest}{literal}",
111        async: true,
112        data: { ajaxfct:"showStatsGetListImages", orderType:order, tagId:tag,  },
113        success:
114          function(msg)
115          {
116            $("#iListImages").html(msg);
117            $("#iListImagesNb").html(
118              "{/literal}{'g003_number_of_distinct_values'|@translate}{literal} "+$("#iListImages table tr").length
119            );
120          }
121      }
122    );
123  }
124
125  function updateTagSelect(numId, mode)
126  {
127
128    if(mode=='switch')
129    {
130      $("#"+numId).get(0).checked=!$("#"+numId).get(0).checked;
131    }
132
133    selected=($("#"+numId).get(0).checked)?"y":"n";
134
135    $("#iListImages").html(
136      $.ajax({
137        type: "POST",
138        url: "{/literal}{$datas.urlRequest}{literal}",
139        async: false,
140        data: { ajaxfct:"updateTagSelect", tagSelected:selected, numId:numId.substr(6) }
141       }).responseText
142    );
143
144  }
145
146  function sortTagList(by)
147  {
148    $("#iSelectOrderTagList").val(by);
149    displayTagListOrder();
150    loadTagList();
151  }
152
153  function sortTagDetail(by, tag)
154  {
155    $("#iSelectOrderImageList").val(by);
156    displayTagDetailOrder();
157    loadTagDetail(tag);
158  }
159
160  function displayTagListOrder()
161  {
162    if($("#iSelectOrderTagList").val()=="tag")
163    {
164      $("#iHLTOrderTag").html("&#8593;");
165      $("#iHLTOrderLabel").html("");
166      $("#iHLTOrderNum").html("");
167    }
168    else if($("#iSelectOrderTagList").val()=="num")
169    {
170      $("#iHLTOrderTag").html("");
171      $("#iHLTOrderLabel").html("");
172      $("#iHLTOrderNum").html("&#8593;");
173    }
174    else
175    {
176      // by label
177      /* not fully implemented
178      $("#iHLTOrderTag").html("");
179      $("#iHLTOrderLabel").html("&#8593;");
180      $("#iHLTOrderNum").html("");
181      */
182    }
183  }
184
185  function displayTagDetailOrder()
186  {
187    if($("#iSelectOrderImageList").val()=="value")
188    {
189      $("#iHLIOrderValue").html("&#8593;");
190      $("#iHLIOrderNum").html("");
191    }
192    else
193    {
194      $("#iHLIOrderValue").html("");
195      $("#iHLIOrderNum").html("&#8593;");
196    }
197  }
198
199
200</script>
201{/literal}
202
203
204<h2>{'g003_select_metadata'|@translate}</h2>
205
206<form>
207  <input type="hidden" id="iSelectOrderTagList" value="{$datas.config_GetListTags_OrderType}"/>
208
209  <label>{'g003_filter'|@translate}
210    <select id="iSelectFilterTagList" onchange="loadTagList();">
211      <option value="" {if $datas.config_GetListTags_FilterType==""}selected{/if}>{'g003_no_filter'|@translate}</option>
212      <option value="magic" {if $datas.config_GetListTags_FilterType=="magic"}selected{/if}>{'g003_magic_filter'|@translate}</option>
213      <option value="exif" {if $datas.config_GetListTags_FilterType=="exif"}selected{/if}>Exif</option>
214      <option value="exif.Canon" {if $datas.config_GetListTags_FilterType=="exif.Canon"}selected{/if}>Exif [Canon]</option>
215      <option value="exif.Nikon" {if $datas.config_GetListTags_FilterType=="exif.Nikon"}selected{/if}>Exif [Nikon]</option>
216      <option value="exif.Pentax" {if $datas.config_GetListTags_FilterType=="exif.Pentax"}selected{/if}>Exif [Pentax]</option>
217      <option value="xmp" {if $datas.config_GetListTags_FilterType=="xmp"}selected{/if}>Xmp</option>
218      <option value="iptc" {if $datas.config_GetListTags_FilterType=="iptc"}selected{/if}>Iptc</option>
219    </select>
220  </label>
221
222  <label>
223    <input type="checkbox" id="iExcludeUnusedTagList" onchange="loadTagList();"  {if $datas.config_GetListTags_ExcludeUnusedTag=="y"}checked{/if}>&nbsp;{'g003_exclude_unused_tags'|@translate}
224  </label>
225
226  <label>
227    <input type="checkbox" id="iSelectedTagOnly" onchange="loadTagList();" {if $datas.config_GetListTags_SelectedTagOnly=="y"}checked{/if}>&nbsp;{'g003_selected_tags_only'|@translate}
228  </label>
229
230</form>
231
232<table id='iHeaderListTags' class="littlefont">
233  <tr>
234    <th style="width:35%;min-width:340px;"><span id="iHLTOrderTag"></span><a onclick="sortTagList('tag');">{'g003_TagId'|@translate}</a></th>
235    {* <th><span id="iHLTOrderLabel"></span><a onclick="sortTagList('label');">{'g003_TagLabel'|@translate}</a></th> *}
236    <th>{'g003_TagLabel'|@translate}</th>
237    <th width="80px"><span id="iHLTOrderNum"></span><a onclick="sortTagList('num');">{'g003_NumOfImage'|@translate}</a></th>
238    <th width="40px">{'g003_Pct'|@translate}</th>
239    <th width="110px">&nbsp;</th>
240  </tr>
241</table>
242<div id='iListTags' class="{$themeconf.name}">
243</div>
244<div id="iListTagsNb"></div>
245
246
247<div id="dialogViewDetail">
248  <form>
249    <input type="hidden" id="iSelectOrderImageList" value="{$datas.config_GetListImages_OrderType}"/>
250  </form>
251
252  <table id='iHeaderListImages' class="littlefont">
253    <tr>
254      <th><span id="iHLIOrderValue"></span><a onclick="sortTagDetail('value', globalTagId);">{'g003_Value'|@translate}</a>&nbsp;<span id="iHeaderListImagesTagName"></span></th>
255      <th width="80px"><span id="iHLIOrderNum"></span><a onclick="sortTagDetail('num', globalTagId);">{'g003_NumOfImage'|@translate}</a></th>
256      <th width="40px">{'g003_Pct'|@translate}</th>
257      <th width="110px">&nbsp;</th>
258    </tr>
259  </table>
260
261  <div id='iListImages' class="{$themeconf.name}">
262    <div style="width:100%;text-align:center;padding-top:20px;">{'g003_no_items_selected'|@translate}</div>
263  </div>
264  <div id="iListImagesNb"></div>
265</div>
266
267
268<script type="text/javascript">
269  init();
270  loadTagList();
271  displayTagDetailOrder();
272</script>
Note: See TracBrowser for help on using the repository browser.