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

Last change on this file since 7519 was 7519, checked in by grum, 13 years ago

Exploit the JpegMetadata class previous evolution
feature:1975, feature:1976, feature:1978

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