[10630] | 1 | {combine_script id="jquery.ui" path="themes/default/js/ui/minified/jquery.ui.core.min.js"} |
---|
| 2 | {combine_script id="jquery.ui.slider" path="themes/default/js/ui/minified/jquery.ui.slider.min.js"} |
---|
[6107] | 3 | |
---|
| 4 | |
---|
| 5 | {literal} |
---|
| 6 | <style> |
---|
| 7 | .ui-slider { |
---|
| 8 | width:600px; |
---|
| 9 | height:10px; |
---|
| 10 | border-width:1px; |
---|
| 11 | border-style:solid; |
---|
| 12 | margin-right:5px; |
---|
| 13 | padding-right:14px; |
---|
| 14 | } |
---|
| 15 | .ui-slider-handle { |
---|
| 16 | width:12px; |
---|
| 17 | height:12px; |
---|
| 18 | position:relative; |
---|
| 19 | top:-2px; |
---|
| 20 | border-width:1px; |
---|
| 21 | border-style:solid; |
---|
| 22 | display:block; |
---|
| 23 | } |
---|
| 24 | </style> |
---|
| 25 | <script type="text/javascript"> |
---|
| 26 | |
---|
[6176] | 27 | function displayConfig(tabsheet) |
---|
| 28 | { |
---|
| 29 | switch(tabsheet) |
---|
| 30 | { |
---|
| 31 | case 'database': |
---|
| 32 | $('#iDisplayConfigDatabase').css('display', 'block'); |
---|
| 33 | $('#iDisplayConfigStatSearch').css('display', 'none'); |
---|
| 34 | $('#iDisplayConfigDisplay').css('display', 'none'); |
---|
| 35 | break; |
---|
| 36 | case 'statsearch': |
---|
| 37 | $('#iDisplayConfigDatabase').css('display', 'none'); |
---|
| 38 | $('#iDisplayConfigStatSearch').css('display', 'block'); |
---|
| 39 | $('#iDisplayConfigDisplay').css('display', 'none'); |
---|
| 40 | break; |
---|
| 41 | case 'display': |
---|
| 42 | $('#iDisplayConfigDatabase').css('display', 'none'); |
---|
| 43 | $('#iDisplayConfigStatSearch').css('display', 'none'); |
---|
| 44 | $('#iDisplayConfigDisplay').css('display', 'block'); |
---|
| 45 | break; |
---|
| 46 | } |
---|
| 47 | } |
---|
| 48 | |
---|
[6107] | 49 | function init() |
---|
| 50 | { |
---|
| 51 | formatPct({/literal}{$datas.minPct}{literal}); |
---|
| 52 | $("#icstat_stat_minPct_slider").slider( |
---|
| 53 | { |
---|
[6210] | 54 | min:0.25, |
---|
[6107] | 55 | max:60, |
---|
| 56 | step:0.25, |
---|
| 57 | value:{/literal}{$datas.minPct}{literal}, |
---|
| 58 | slide: function(event, ui) { formatPct(ui.value); } |
---|
| 59 | }); |
---|
| 60 | $("#icstat_stat_minPct_slider a").addClass('gcBgInput'); |
---|
[6210] | 61 | |
---|
| 62 | formatPx({/literal}{$datas.colorSize}{literal}); |
---|
| 63 | $("#icstat_display_colorSize_slider").slider( |
---|
| 64 | { |
---|
| 65 | min:5, |
---|
| 66 | max:25, |
---|
| 67 | step:1, |
---|
| 68 | value:{/literal}{$datas.colorSize}{literal}, |
---|
| 69 | slide: function(event, ui) { formatPx(ui.value); } |
---|
| 70 | }); |
---|
| 71 | $("#icstat_display_colorSize_slider a").addClass('gcBgInput'); |
---|
| 72 | |
---|
| 73 | showColors(); |
---|
| 74 | qi.calculateTimes(); |
---|
[6176] | 75 | displayConfig('database'); |
---|
[6107] | 76 | } |
---|
| 77 | |
---|
[6210] | 78 | function formatPx(px) |
---|
| 79 | { |
---|
| 80 | $("#icstat_display_colorSize").val(px); |
---|
| 81 | $("#icstat_display_colorSize_display").html(px+"px"); |
---|
| 82 | } |
---|
| 83 | |
---|
[6107] | 84 | function formatPct(pct) |
---|
| 85 | { |
---|
| 86 | $("#icstat_stat_minPct").val(pct); |
---|
| 87 | $("#icstat_stat_minPct_display").html(pct.toFixed(2)+"%"); |
---|
| 88 | } |
---|
[6210] | 89 | |
---|
| 90 | function showColors() |
---|
| 91 | { |
---|
| 92 | if($('#idisplay_gallery_showColorsCBox').get(0).checked) |
---|
| 93 | { |
---|
| 94 | $('#idisplay_gallery_showColors').val('y'); |
---|
| 95 | $('#icstat_display_colorSize_area').css('display', 'block'); |
---|
| 96 | } |
---|
| 97 | else |
---|
| 98 | { |
---|
| 99 | $('#idisplay_gallery_showColors').val('n'); |
---|
| 100 | $('#icstat_display_colorSize_area').css('display', 'none'); |
---|
| 101 | } |
---|
| 102 | } |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | qualityInterface = function(optionsToSet) |
---|
| 106 | { |
---|
| 107 | var qualityValues = [{/literal}{$datas.qualityHighest}, {$datas.qualityHigh}, {$datas.qualityNormal}, {$datas.qualityLow}, {$datas.qualityLowest}{literal}]; |
---|
| 108 | var qualityKeys = ['highest', 'hight', 'normal', 'low', 'lowest']; |
---|
| 109 | |
---|
| 110 | var options = jQuery.extend( |
---|
| 111 | { |
---|
| 112 | pps:0, |
---|
| 113 | }, |
---|
| 114 | optionsToSet); |
---|
| 115 | |
---|
| 116 | |
---|
| 117 | this.calculateTimes = function () |
---|
| 118 | { |
---|
| 119 | _calculateTimes(); |
---|
| 120 | } |
---|
| 121 | |
---|
| 122 | var _calculateTimes = function () |
---|
| 123 | { |
---|
| 124 | values=new Array(); |
---|
| 125 | |
---|
| 126 | for(i=0;i<qualityValues.length;i++) |
---|
| 127 | { |
---|
| 128 | if(options.pps==0) |
---|
| 129 | { |
---|
| 130 | values[i]=Array('-', '-'); |
---|
| 131 | } |
---|
| 132 | else |
---|
| 133 | { |
---|
| 134 | values[i]=Array( |
---|
| 135 | (qualityValues[i]/options.pps).toFixed(2)+'s', |
---|
| 136 | formatTime({/literal}{$datas.nbPictures}{literal}*qualityValues[i]/options.pps) |
---|
| 137 | ); |
---|
| 138 | } |
---|
| 139 | } |
---|
| 140 | |
---|
| 141 | $('#iEstimatedHighest').html(values[0][0]); |
---|
| 142 | $('#iEstimatedHighestAll').html(values[0][1]); |
---|
| 143 | |
---|
| 144 | $('#iEstimatedHigh').html(values[1][0]); |
---|
| 145 | $('#iEstimatedHighAll').html(values[1][1]); |
---|
| 146 | |
---|
| 147 | $('#iEstimatedNormal').html(values[2][0]); |
---|
| 148 | $('#iEstimatedNormalAll').html(values[2][1]); |
---|
| 149 | |
---|
| 150 | $('#iEstimatedLow').html(values[3][0]); |
---|
| 151 | $('#iEstimatedLowAll').html(values[3][1]); |
---|
| 152 | |
---|
| 153 | $('#iEstimatedLowest').html(values[4][0]); |
---|
| 154 | $('#iEstimatedLowestAll').html(values[4][1]); |
---|
| 155 | } |
---|
| 156 | |
---|
| 157 | |
---|
| 158 | |
---|
| 159 | this.doRequest = function () |
---|
| 160 | { |
---|
| 161 | displayBench(true); |
---|
| 162 | $.ajax( |
---|
| 163 | { |
---|
| 164 | type: "POST", |
---|
| 165 | url: "{/literal}{$datas.urlRequest}{literal}", |
---|
| 166 | async: true, |
---|
| 167 | data: { ajaxfct:"doPpsBench", quality:2 }, |
---|
| 168 | success: function(msg) |
---|
| 169 | { |
---|
| 170 | options.pps=msg; |
---|
| 171 | _calculateTimes(); |
---|
| 172 | displayBench(false); |
---|
| 173 | }, |
---|
| 174 | } |
---|
| 175 | ); |
---|
| 176 | } |
---|
| 177 | |
---|
| 178 | var formatTime = function (eTime) |
---|
| 179 | { |
---|
| 180 | var seconds=(eTime%60).toFixed(2); |
---|
| 181 | var minutes=((eTime-seconds)/60).toFixed(0); |
---|
| 182 | var returned=seconds+"s"; |
---|
| 183 | if(minutes>0) returned=minutes+"m"+returned; |
---|
| 184 | return(returned); |
---|
| 185 | } |
---|
| 186 | |
---|
| 187 | var displayBench = function (processing) |
---|
| 188 | { |
---|
| 189 | if(processing) |
---|
| 190 | { |
---|
| 191 | $('#iBenchBtn').css('display', 'none'); |
---|
| 192 | $('#iBenchWait').css('display', 'block'); |
---|
| 193 | } |
---|
| 194 | else |
---|
| 195 | { |
---|
| 196 | $('#iBenchBtn').css('display', 'block'); |
---|
| 197 | $('#iBenchWait').css('display', 'none'); |
---|
| 198 | } |
---|
| 199 | } |
---|
| 200 | } |
---|
| 201 | |
---|
| 202 | var qi=new qualityInterface({pps:{/literal}{$datas.pps}{literal}}); |
---|
| 203 | |
---|
[6107] | 204 | </script> |
---|
| 205 | {/literal} |
---|
| 206 | |
---|
[6176] | 207 | {$configTabsheet} |
---|
[6107] | 208 | |
---|
[5961] | 209 | <h2>{'cstat_config_plugin'|@translate}</h2> |
---|
[6107] | 210 | |
---|
| 211 | <form id="iConfig" method="post" action="" class="general"> |
---|
| 212 | |
---|
[6176] | 213 | <div id='iDisplayConfigDatabase' style='display:none;'> |
---|
[6107] | 214 | |
---|
[6210] | 215 | <fieldset> |
---|
| 216 | <legend>{'cstat_bench'|@translate}</legend> |
---|
| 217 | <div>{'cstat_do_benchmark'|@translate}</div> |
---|
| 218 | <br> |
---|
| 219 | <div id='iBenchBtn'> |
---|
| 220 | <input type="button" onclick="qi.doRequest();" value="{'cstat_do_bench'|@translate}"> |
---|
| 221 | </div> |
---|
| 222 | <div id='iBenchWait' style='display:none;text-align:center;'> |
---|
| 223 | <img src='./plugins/GrumPluginClasses/icons/processing.gif'> |
---|
| 224 | </div> |
---|
| 225 | </fieldset> |
---|
| 226 | |
---|
| 227 | <fieldset> |
---|
| 228 | <legend>{'cstat_quality_of_analyze'|@translate}</legend> |
---|
| 229 | |
---|
| 230 | <table class="formtable table2"> |
---|
| 231 | <tr class='throw'> |
---|
| 232 | <td>{'cstat_quality_level'|@translate}</td> |
---|
| 233 | <td>{'cstat_estimated_time_one_picture'|@translate}</td> |
---|
| 234 | <td>{'cstat_estimated_time_all_pictures'|@translate}</td> |
---|
| 235 | </tr> |
---|
| 236 | <tr> |
---|
| 237 | <td> |
---|
| 238 | <label><input type="radio" name="f_analyze_ppsQuality" value="{$datas.qualityHighest}" {if $datas.quality==$datas.qualityHighest}checked{/if}> {'cstat_quality_highest'|@translate}</label> |
---|
| 239 | </td> |
---|
| 240 | <td class='estimatedTime'> |
---|
| 241 | <span id='iEstimatedHighest'>-</span> |
---|
| 242 | </td> |
---|
| 243 | <td class='estimatedTime'> |
---|
| 244 | <span id='iEstimatedHighestAll'>-</span> |
---|
| 245 | </td> |
---|
| 246 | </tr> |
---|
| 247 | <tr> |
---|
| 248 | <td> |
---|
| 249 | <label><input type="radio" name="f_analyze_ppsQuality" value="{$datas.qualityHigh}" {if $datas.quality==$datas.qualityHigh}checked{/if}> {'cstat_quality_high'|@translate}</label> |
---|
| 250 | </td> |
---|
| 251 | <td class='estimatedTime'> |
---|
| 252 | <span id='iEstimatedHigh'>-</span> |
---|
| 253 | </td> |
---|
| 254 | <td class='estimatedTime'> |
---|
| 255 | <span id='iEstimatedHighAll'>-</span> |
---|
| 256 | </td> |
---|
| 257 | </tr> |
---|
| 258 | <tr> |
---|
| 259 | <td> |
---|
| 260 | <label><input type="radio" name="f_analyze_ppsQuality" value="{$datas.qualityNormal}" {if $datas.quality==$datas.qualityNormal}checked{/if}> {'cstat_quality_normal'|@translate}</label> |
---|
| 261 | </td> |
---|
| 262 | <td class='estimatedTime'> |
---|
| 263 | <span id='iEstimatedNormal'>-</span> |
---|
| 264 | </td> |
---|
| 265 | <td class='estimatedTime'> |
---|
| 266 | <span id='iEstimatedNormalAll'>-</span> |
---|
| 267 | </td> |
---|
| 268 | </tr> |
---|
| 269 | <tr> |
---|
| 270 | <td> |
---|
| 271 | <label><input type="radio" name="f_analyze_ppsQuality" value="{$datas.qualityLow}" {if $datas.quality==$datas.qualityLow}checked{/if}> {'cstat_quality_low'|@translate}</label> |
---|
| 272 | </td> |
---|
| 273 | <td class='estimatedTime'> |
---|
| 274 | <span id='iEstimatedLow'>-</span> |
---|
| 275 | </td> |
---|
| 276 | <td class='estimatedTime'> |
---|
| 277 | <span id='iEstimatedLowAll'>-</span> |
---|
| 278 | </td> |
---|
| 279 | </tr> |
---|
| 280 | <tr> |
---|
| 281 | <td> |
---|
| 282 | <label><input type="radio" name="f_analyze_ppsQuality" value="{$datas.qualityLowest}" {if $datas.quality==$datas.qualityLowest}checked{/if}> {'cstat_quality_lowest'|@translate}</label> |
---|
| 283 | </td> |
---|
| 284 | <td class='estimatedTime'> |
---|
| 285 | <span id='iEstimatedLowest'>-</span> |
---|
| 286 | </td> |
---|
| 287 | <td class='estimatedTime'> |
---|
| 288 | <span id='iEstimatedLowestAll'>-</span> |
---|
| 289 | </td> |
---|
| 290 | </tr> |
---|
| 291 | </table> |
---|
| 292 | |
---|
| 293 | |
---|
| 294 | |
---|
| 295 | |
---|
| 296 | |
---|
| 297 | </fieldset> |
---|
[6176] | 298 | </div> |
---|
[6107] | 299 | |
---|
[6176] | 300 | <div id='iDisplayConfigStatSearch' style='display:none;'> |
---|
| 301 | <fieldset> |
---|
[6210] | 302 | <legend>{'cstat_significant_colors'|@translate}</legend> |
---|
[6107] | 303 | |
---|
[6176] | 304 | <table class="formtable"> |
---|
| 305 | <tr> |
---|
| 306 | <td colspan="2">{'cstat_percent_min_significant'|@translate}</td> |
---|
| 307 | </tr> |
---|
| 308 | <tr> |
---|
| 309 | <td> |
---|
| 310 | <input type="hidden" name="f_stat_minPct" id="icstat_stat_minPct" value="{$datas.minPct}"> |
---|
| 311 | <div id="icstat_stat_minPct_slider" class="gcBgInput gcBorderInput"></div> |
---|
| 312 | </td> |
---|
| 313 | <td width="90px"> |
---|
| 314 | <div id="icstat_stat_minPct_display"></div> |
---|
| 315 | </td> |
---|
| 316 | </tr> |
---|
| 317 | </table> |
---|
| 318 | </fieldset> |
---|
| 319 | </div> |
---|
[6107] | 320 | |
---|
[6176] | 321 | <div id='iDisplayConfigDisplay' style='display:none;'> |
---|
| 322 | <fieldset> |
---|
[6210] | 323 | <legend>{'cstat_gallery_display_colors'|@translate}</legend> |
---|
[6107] | 324 | |
---|
[6176] | 325 | <label> |
---|
[6210] | 326 | <input type="checkbox" id='idisplay_gallery_showColorsCBox' onclick="showColors();" {if $datas.showColors=='y'}checked{/if} > |
---|
[6176] | 327 | {'cstat_display_colors_on_image'|@translate} |
---|
| 328 | <input type="hidden" id='idisplay_gallery_showColors' name='f_display_gallery_showColors' value='{$datas.showColors}'> |
---|
| 329 | </label> |
---|
[6107] | 330 | |
---|
[6210] | 331 | <div id='icstat_display_colorSize_area'> |
---|
| 332 | <br> |
---|
| 333 | <table class="formtable"> |
---|
| 334 | <tr> |
---|
| 335 | <td colspan="2">{'cstat_color_size'|@translate}</td> |
---|
| 336 | </tr> |
---|
| 337 | <tr> |
---|
| 338 | <td> |
---|
| 339 | <input type="hidden" name="f_display_gallery_colorSize" id="icstat_display_colorSize" value="{$datas.colorSize}"> |
---|
| 340 | <div id="icstat_display_colorSize_slider" class="gcBgInput gcBorderInput"></div> |
---|
| 341 | </td> |
---|
| 342 | <td width="90px"> |
---|
| 343 | <div id="icstat_display_colorSize_display"></div> |
---|
| 344 | </td> |
---|
| 345 | </tr> |
---|
| 346 | </table> |
---|
| 347 | </div> |
---|
| 348 | |
---|
[6176] | 349 | </fieldset> |
---|
| 350 | </div> |
---|
[6107] | 351 | |
---|
| 352 | <input type="submit" value="{'cstat_apply'|@translate}" name="submit_save_config" style="margin-left:1em;" > |
---|
| 353 | |
---|
| 354 | </form> |
---|
| 355 | |
---|
| 356 | |
---|
| 357 | <script type="text/javascript"> |
---|
| 358 | init(); |
---|
| 359 | </script> |
---|