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

Last change on this file since 16007 was 16007, checked in by grum, 12 years ago

feature:2637- compatibility with Piwigo 2.4

  • Property svn:executable set to *
File size: 9.1 KB
RevLine 
[4905]1{literal}
2<script type="text/javascript">
3
4  var globalTagId;
5
[5088]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,
[5935]18        draggable:true,
19        dialogClass: 'gcBgTabSheet gcBorder',
[5088]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
[4905]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
[5088]46    displayTagListOrder();
47
[5935]48    $("#iListTags").html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>");
49
50    $.ajax(
51      {
[4905]52        type: "POST",
53        url: "{/literal}{$datas.urlRequest}{literal}",
[5935]54        async: true,
[16007]55        data: { ajaxfct:"admin.showStats.getListTags", token:'{/literal}{$token}{literal}', orderType:order, filterType:filter, excludeUnusedTag:unusedTag, selectedTagOnly:selectedOnly },
[5935]56        success:
57          function(msg)
58          {
59            $("#iListTags").html(msg);
[5088]60
[5935]61            $("#iListTagsNb").html(
62              "{/literal}{'g003_number_of_filtered_metadata'|@translate}{literal} "+$("#iListTags table tr").length
63            );
[5088]64
[5935]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              );
[5088]74
[5935]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    );
[5088]86
[4905]87  }
88
89  function loadTagDetail(tag)
90  {
[5088]91    $("#dialogViewDetail").dialog('open');
92
[4905]93    globalTagId=tag;
94    order=$('#iSelectOrderImageList').val();
[5935]95    $("#iListImages").html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>");
[5005]96    $("#iHeaderListImagesTagName").html("["+tag+"]");
[4905]97
98    $.ajax(
99      {
100        type: "POST",
101        url: "{/literal}{$datas.urlRequest}{literal}",
102        async: true,
[16007]103        data: { ajaxfct:"admin.showStats.getListImages", token:'{/literal}{$token}{literal}', orderType:order, tagId:tag,  },
[4905]104        success:
105          function(msg)
106          {
107            $("#iListImages").html(msg);
[5005]108            $("#iListImagesNb").html(
109              "{/literal}{'g003_number_of_distinct_values'|@translate}{literal} "+$("#iListImages table tr").length
110            );
[4905]111          }
112      }
113    );
114  }
115
[5088]116  function updateTagSelect(numId, mode)
[4905]117  {
[5088]118
119    if(mode=='switch')
120    {
121      $("#"+numId).get(0).checked=!$("#"+numId).get(0).checked;
122    }
123
[4905]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,
[16007]131        data: { ajaxfct:"admin.updateTag.select", token:'{/literal}{$token}{literal}', tagSelected:selected, numId:numId.substr(6) }
[4905]132       }).responseText
133    );
[5935]134
[4905]135  }
136
[5088]137  function sortTagList(by)
138  {
139    $("#iSelectOrderTagList").val(by);
140    displayTagListOrder();
141    loadTagList();
142  }
[4905]143
[5088]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;");
[5226]156      $("#iHLTOrderLabel").html("");
[5088]157      $("#iHLTOrderNum").html("");
158    }
[5226]159    else if($("#iSelectOrderTagList").val()=="num")
[5088]160    {
161      $("#iHLTOrderTag").html("");
[5226]162      $("#iHLTOrderLabel").html("");
[5088]163      $("#iHLTOrderNum").html("&#8593;");
164    }
[5226]165    else
166    {
167      // by label
[5935]168      /* not fully implemented
[5226]169      $("#iHLTOrderTag").html("");
170      $("#iHLTOrderLabel").html("&#8593;");
171      $("#iHLTOrderNum").html("");
[5935]172      */
[5226]173    }
[5088]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
[4905]191</script>
192{/literal}
193
194
[5959]195<h2>{'g003_select_metadata'|@translate}</h2>
[4905]196
[6950]197<div class='helps'>
198  <p>{'g003_select_page_help'|@translate}</p>
199</div>
200
[4905]201<form>
[5088]202  <input type="hidden" id="iSelectOrderTagList" value="{$datas.config_GetListTags_OrderType}"/>
[4905]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>
[6729]207      {if !in_array('magic', $amdConfig.amd_FillDataBaseExcludeFilters)}
[4999]208      <option value="magic" {if $datas.config_GetListTags_FilterType=="magic"}selected{/if}>{'g003_magic_filter'|@translate}</option>
[6729]209      {/if}
[6722]210      <option value="userDefined" {if $datas.config_GetListTags_FilterType=="userDefined"}selected{/if}>{'g003_userDefined_filter'|@translate}</option>
[6729]211
212      {if !in_array('exif', $amdConfig.amd_FillDataBaseExcludeFilters)}
[4905]213      <option value="exif" {if $datas.config_GetListTags_FilterType=="exif"}selected{/if}>Exif</option>
[6729]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)}
[4905]221      <option value="xmp" {if $datas.config_GetListTags_FilterType=="xmp"}selected{/if}>Xmp</option>
[6729]222      {/if}
223      {if !in_array('iptc', $amdConfig.amd_FillDataBaseExcludeFilters)}
[4905]224      <option value="iptc" {if $datas.config_GetListTags_FilterType=="iptc"}selected{/if}>Iptc</option>
[6729]225      {/if}
[7519]226      {if !in_array('com', $amdConfig.amd_FillDataBaseExcludeFilters)}
227      <option value="com" {if $datas.config_GetListTags_FilterType=="com"}selected{/if}>Com</option>
228      {/if}
[4905]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>
[5088]244    <th style="width:35%;min-width:340px;"><span id="iHLTOrderTag"></span><a onclick="sortTagList('tag');">{'g003_TagId'|@translate}</a></th>
[5935]245    {* <th><span id="iHLTOrderLabel"></span><a onclick="sortTagList('label');">{'g003_TagLabel'|@translate}</a></th> *}
246    <th>{'g003_TagLabel'|@translate}</th>
[5088]247    <th width="80px"><span id="iHLTOrderNum"></span><a onclick="sortTagList('num');">{'g003_NumOfImage'|@translate}</a></th>
[4905]248    <th width="40px">{'g003_Pct'|@translate}</th>
249    <th width="110px">&nbsp;</th>
250  </tr>
251</table>
[5935]252<div id='iListTags' class="{$themeconf.name}">
[4905]253</div>
[5005]254<div id="iListTagsNb"></div>
[4905]255
256
[5088]257<div id="dialogViewDetail">
258  <form>
259    <input type="hidden" id="iSelectOrderImageList" value="{$datas.config_GetListImages_OrderType}"/>
260  </form>
[4905]261
[5088]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>
[4905]270
[5935]271  <div id='iListImages' class="{$themeconf.name}">
[5088]272    <div style="width:100%;text-align:center;padding-top:20px;">{'g003_no_items_selected'|@translate}</div>
273  </div>
274  <div id="iListImagesNb"></div>
[4905]275</div>
276
277
278<script type="text/javascript">
[5088]279  init();
[4905]280  loadTagList();
[5088]281  displayTagDetailOrder();
[4905]282</script>
Note: See TracBrowser for help on using the repository browser.