Ignore:
Timestamp:
Jun 6, 2013, 2:29:14 PM (11 years ago)
Author:
plg
Message:

add 2 configuration settings to let the webmaster decide of errors margins.

(margins can be negative)

bug fixed: do not hide the check sign in front of "Automatic" option in size
list when the user selects another size.

Location:
extensions/automatic_size
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/automatic_size/main.inc.php

    r23033 r23074  
    6666      if ($size)
    6767      {
    68         // echo $type.' => '.$size[0].' x '.$size[1].'<br>';
    6968        if ($size[0] <= $available_size[0] and $size[1] <= $available_size[1])
    7069        {
     
    128127      'ALT_IMG' => $element_info['file'],
    129128      'COOKIE_PATH' => cookie_path(),
     129      'asize_width_margin' => isset($conf['automatic_size_width_margin']) ? $conf['automatic_size_width_margin'] : 12,
     130      'asize_height_margin' => isset($conf['automatic_size_height_margin']) ? $conf['automatic_size_height_margin'] : 40,
    130131      )
    131132    );
     
    141142  $pattern = '#\{foreach from=\$current\.unique_derivatives#';
    142143  $replacement = '
    143 <span class="switchCheck" id="aSizeChecked"{if !$is_automatic_size} style="visibility:hidden"{/if}>&#x2714; </span> <a id="aSize" href="{$ASIZE_URL}" title="{$ASIZE_TITLE}" data-checked="{if $is_automatic_size}yes{else}no{/if}">{\'Automatic\'|@translate}</a>
     144<span id="aSizeChecked"{if !$is_automatic_size} style="visibility:hidden"{/if}>&#x2714; </span> <a id="aSize" href="{$ASIZE_URL}" title="{$ASIZE_TITLE}" data-checked="{if $is_automatic_size}yes{else}no{/if}">{\'Automatic\'|@translate}</a>
    144145<br><br>
    145146{foreach from=$current.unique_derivatives';
  • extensions/automatic_size/picture_js.tpl

    r23022 r23074  
    33  if (jQuery("#theImage").size() > 0) {
    44    function save_available_size() {
    5       var width = jQuery("#theImage").width();
     5      var width = jQuery("#theImage").width()
     6      width -= {/literal}{$asize_width_margin}{literal};
    67
    78      var docHeight = "innerHeight" in window ? window.innerHeight : document.documentElement.offsetHeight;
    89      var offset = jQuery("#theImage").offset();
    9       var bottomMargin = 40;
    10       var height = docHeight - Math.ceil(offset.top) - bottomMargin;
     10      var height = docHeight - Math.ceil(offset.top);
     11      height -= {/literal}{$asize_height_margin}{literal};
    1112
    1213      document.cookie= 'available_size='+width+'x'+height+';path={/literal}{$COOKIE_PATH}{literal}';
Note: See TracChangeset for help on using the changeset viewer.