Ignore:
Timestamp:
May 17, 2010, 8:36:54 PM (14 years ago)
Author:
grum
Message:

prepare release 1.0.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ColorStat/admin/cstat_config.tpl

    r6176 r6210  
    4545        break;
    4646    }
    47 
    4847  }
    4948
     
    5352    $("#icstat_stat_minPct_slider").slider(
    5453      {
    55         min:0.5,
     54        min:0.25,
    5655        max:60,
    5756        step:0.25,
     
    6059      });
    6160    $("#icstat_stat_minPct_slider a").addClass('gcBgInput');
     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();
    6275    displayConfig('database');
     76  }
     77
     78  function formatPx(px)
     79  {
     80    $("#icstat_display_colorSize").val(px);
     81    $("#icstat_display_colorSize_display").html(px+"px");
    6382  }
    6483
     
    6887    $("#icstat_stat_minPct_display").html(pct.toFixed(2)+"%");
    6988  }
     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
    70204</script>
    71205{/literal}
     
    79213  <div id='iDisplayConfigDatabase' style='display:none;'>
    80214
     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}>&nbsp;{'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}>&nbsp;{'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}>&nbsp;{'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}>&nbsp;{'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}>&nbsp;{'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>
    81298  </div>
    82299
    83300  <div id='iDisplayConfigStatSearch'  style='display:none;'>
    84301    <fieldset>
    85       <legend>{'cstat_stat_and_search'|@translate}</legend>
     302      <legend>{'cstat_significant_colors'|@translate}</legend>
    86303
    87304      <table class="formtable">
     
    104321  <div id='iDisplayConfigDisplay'  style='display:none;'>
    105322    <fieldset>
    106       <legend>{'cstat_gallery_integration'|@translate}</legend>
     323      <legend>{'cstat_gallery_display_colors'|@translate}</legend>
    107324
    108325      <label>
    109         <input type="checkbox" id='idisplay_gallery_showColorsCBox' onclick="$('#idisplay_gallery_showColors').val(($('#idisplay_gallery_showColorsCBox').get(0).checked=='on')?'y':'n');" {if $datas.showColors=='y'}checked{/if} >
     326        <input type="checkbox" id='idisplay_gallery_showColorsCBox' onclick="showColors();" {if $datas.showColors=='y'}checked{/if} >
    110327        {'cstat_display_colors_on_image'|@translate}
    111328        <input type="hidden" id='idisplay_gallery_showColors' name='f_display_gallery_showColors' value='{$datas.showColors}'>
    112329      </label>
    113330
     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
    114349    </fieldset>
    115350  </div>
Note: See TracChangeset for help on using the changeset viewer.