upgrade jquery to 1.7.1

mouseout on index drop down bozes
improved multisize center of interest

git-svn-id: http://piwigo.org/svn/trunk@13052 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2012-02-07 21:25:20 +00:00
parent 14a17a5ab2
commit ecf196ba31
6 changed files with 1783 additions and 1539 deletions

View File

@@ -202,18 +202,18 @@ SELECT
}
$ok = true;
if (!isset($conf['never_delete_originals']))
{
foreach ($files as $path)
{
if (is_file($path) and !unlink($path))
{
$ok = false;
trigger_error('"'.$path.'" cannot be removed', E_USER_WARNING);
break;
}
}
}
if (!isset($conf['never_delete_originals']))
{
foreach ($files as $path)
{
if (is_file($path) and !unlink($path))
{
$ok = false;
trigger_error('"'.$path.'" cannot be removed', E_USER_WARNING);
break;
}
}
}
if ($ok)
{
@@ -2306,7 +2306,7 @@ function clear_derivative_cache_rec($path, $pattern)
}
}
function delete_element_derivatives($infos)
function delete_element_derivatives($infos, $type='all')
{
$path = $infos['path'];
if (!empty($infos['representative_ext']))
@@ -2317,8 +2317,16 @@ function delete_element_derivatives($infos)
{
$path = substr($path, 3);
}
$dot = strpos($path, '.');
$path = substr_replace($path, '-*', $dot, 0);
$dot = strrpos($path, '.');
if ($type=='all')
{
$pattern = '-*';
}
else
{
$pattern = '-'.derivative_to_url($type).'*';
}
$path = substr_replace($path, $pattern, $dot, 0);
foreach( glob(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$path) as $file)
{
@unlink($file);

View File

@@ -57,7 +57,24 @@ $row = pwg_db_fetch_assoc( pwg_query($query) );
if (isset($_POST['submit']))
{
delete_element_derivatives($row);
foreach(ImageStdParams::get_defined_type_map() as $params)
{
if ($params->sizing->max_crop != 0)
{
delete_element_derivatives($row, $params->type);
}
}
delete_element_derivatives($row, IMG_CUSTOM);
$uid = '&b='.time();
$conf['question_mark_in_urls'] = $conf['php_extension_in_urls'] = true;
if ($conf['derivative_url_style']==1)
{
$conf['derivative_url_style']=0; //auto
}
}
else
{
$uid = '';
}
$tpl_var = array(
@@ -76,20 +93,19 @@ if (!empty($row['coi']))
);
}
if (isset($_POST['submit']))
foreach(ImageStdParams::get_defined_type_map() as $params)
{
$uid = '&b='.time();
$conf['question_mark_in_urls'] = $conf['php_extension_in_urls'] = true;
$conf['derivative_url_style']=2; //script
$tpl_var['U_SQUARE'] = DerivativeImage::url(IMG_SQUARE, $row).$uid;
$tpl_var['U_THUMB'] = DerivativeImage::url(IMG_THUMB, $row).$uid;
}
else
{
$tpl_var['U_SQUARE'] = DerivativeImage::url(IMG_SQUARE, $row);
$tpl_var['U_THUMB'] = DerivativeImage::url(IMG_THUMB, $row);
if ($params->sizing->max_crop != 0)
{
$derivative = new DerivativeImage($params, new SrcImage($row) );
$template->append( 'cropped_derivatives', array(
'U_IMG' => $derivative->get_url().$uid,
'HTM_SIZE' => $derivative->get_size_htm(),
) );
}
}
$template->assign($tpl_var);
$template->set_filename('picture_coi', 'picture_coi.tpl');

View File

@@ -8,13 +8,17 @@
<a href="{$U_EDIT}">{'Edit photo information'|@translate}</a>
</div>
<div>
<img src="{$U_SQUARE}" alt="{$ALT}">
<img src="{$U_THUMB}" alt="{$ALT}">
</div>
<div>
<form method="post">
<fieldset>
<legend>{'Crop'|@translate}</legend>
{foreach from=$cropped_derivatives item=deriv}
<img src="{$deriv.U_IMG}" alt="{$ALT}" {$deriv.HTM_SIZE}>
{/foreach}
</fieldset>
<fieldset>
<legend>{'Center of interest'|@translate}</legend>
<input type="hidden" id="l" name="l" value="{if isset($coi)}{$coi.l}{/if}">
<input type="hidden" id="t" name="t" value="{if isset($coi)}{$coi.t}{/if}">
<input type="hidden" id="r" name="r" value="{if isset($coi)}{$coi.r}{/if}">
@@ -25,8 +29,8 @@
<p>
<input type="submit" name="submit" value="{'Submit'|@translate}">
</p>
</fieldset>
</form>
</div>
{footer_script}
{literal}
@@ -51,7 +55,7 @@ function jOnRelease() {
{/literal}
jQuery("#jcrop").Jcrop( {ldelim}
boxWidth: 400, boxHeight: 400,
boxWidth: 500, boxHeight: 400,
onChange: jOnChange,
onRelease: jOnRelease
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -7,7 +7,7 @@
<li>{strip}<a href="javascript:toggleSortOrderBox()" id="sortOrderLink" title="{'Sort order'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
<span class="pwg-icon pwg-icon-sort">&nbsp;</span><span class="pwg-button-text">{'Sort order'|@translate}</span>
</a>
<div id="sortOrderBox" style="display:none; text-align:left" onclick="toggleSortOrderBox()">
<div id="sortOrderBox" style="display:none; text-align:left" onclick="toggleSortOrderBox()" onmouseout="e=event.toElement||event.relatedTarget;if(e.parentNode!=this&amp;&amp;e!=this)toggleSortOrderBox()">
{'Sort order'|@translate}:
{foreach from=$image_orders item=image_order}<br>
{if $image_order.SELECTED}
@@ -18,15 +18,13 @@
{/foreach}
</div>
{footer_script}{literal}
function toggleSortOrderBox()
{
function toggleSortOrderBox() {
var elt = document.getElementById("sortOrderBox"),
ePos = document.getElementById("sortOrderLink");
if (elt.style.display==="none")
{
if (elt.style.display==="none") {
elt.style.position = "absolute";
elt.style.left = (ePos.offsetLeft) + "px";
elt.style.top = (ePos.offsetTop + ePos.offsetHeight) + "px";
elt.style.left = ePos.offsetLeft+"px";
elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px";
elt.style.display="";
}
else
@@ -40,7 +38,7 @@ function toggleSortOrderBox()
<li>{strip}<a href="javascript:toggleImageDerivativesBox()" id="derivativeChooseLink" title="{'Photo Sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
<span class="pwg-icon pwg-icon-sizes">&nbsp;</span><span class="pwg-button-text">{'Photo Sizes'|@translate}</span>
</a>
<div id="derivativeSwitchBox" style="display:none; text-align:left" onclick="toggleImageDerivativesBox()">
<div id="derivativeSwitchBox" style="display:none; text-align:left" onclick="toggleImageDerivativesBox()" onmouseout="e=event.toElement||event.relatedTarget;if(e.parentNode!=this&amp;&amp;e!=this)toggleImageDerivativesBox()">
{foreach from=$image_derivatives item=image_derivative name=deriv_loop}{if !$smarty.foreach.deriv_loop.first}<br>{/if}
{if $image_derivative.SELECTED}
<span>{$image_derivative.DISPLAY}</span>
@@ -50,15 +48,13 @@ function toggleSortOrderBox()
{/foreach}
</div>
{footer_script}{literal}
function toggleImageDerivativesBox()
{
function toggleImageDerivativesBox() {
var elt = document.getElementById("derivativeSwitchBox"),
ePos = document.getElementById("derivativeChooseLink");
if (elt.style.display==="none")
{
if (elt.style.display==="none") {
elt.style.position = "absolute";
elt.style.left = (ePos.offsetLeft) + "px";
elt.style.top = (ePos.offsetTop + ePos.offsetHeight) + "px";
elt.style.left = ePos.offsetLeft+"px";
elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px";
elt.style.display="";
}
else