fix for 335014, thanks TH for the code

This commit is contained in:
bugzilla%micropipes.com 2006-04-30 00:28:37 +00:00
Родитель b269a62cb1
Коммит 74ff37cf21
2 изменённых файлов: 29 добавлений и 45 удалений

Просмотреть файл

@ -87,7 +87,7 @@
} }
.install-box { .install-box {
width: 18em; width: 20em;
} }
.key-point { .key-point {
background-color:#bee6a1; background-color:#bee6a1;

Просмотреть файл

@ -37,53 +37,37 @@ Works with:
{/foreach} {/foreach}
</table> </table>
<div class="key-point install-box"> <div class="key-point install-box">
<div class="install"> <div class="install" id="install-{$addon->ID}">
<script type="text/javascript"> {foreach key=key item=item from=$addon->OsVersions}
//<![CDATA[ {if $item.URI}
var installs = new Array(3); <div class="{$item.OSName|escape}">
/* If an install has a URI, it's available. Otherwise, you're <a href="{$item.URI|escape}" onclick="return {$addon->installFunc}(event,'{$item.AppName|escape} {$item.Version|escape}', '{$config.webpath}/images/default.png');" title="Install for {$item.OSName|escape} {$item.Version|escape} (Right-Click to Download)">
* out of luck. :-/ */ Install Now
{foreach key=key item=item from=$addon->OsVersions} {if $multiDownloadLinks}
installs["{$key|escape}"] = "{$item.URI|escape}"; for {$item.OSName|escape}
{/foreach} {/if}
</a> ({$item.Size|escape} <abbr title="Kilobytes">KB</abbr>)
var platform = getPlatformName(); </div>
document.writeln("<div>");
if (installs[platform]) {ldelim}
document.writeln("<a id=\"install-link\" href=\"" + installs[platform]+ "\" onclick=\"return {$addon->installFunc}(event,'{$addon->Name|escape} {$addon->Version|escape}', '{$config.webpath}/images/default.png');\" title=\"Install for " + platform + " (Right-Click to Download)\">Install Now for " + platform + "</a> ({$item.Size|escape} <abbr title=\"Kilobytes\">KB</abbr>)");
{rdelim} else if ("{$key|escape}" == "ALL") {ldelim}
document.writeln("<a id=\"install-link\" href=\"{$item.URI|escape}\" onclick=\"return {$addon->installFunc}(event,'{$addon->Name|escape} {$addon->Version|escape}', '{$config.webpath}/images/default.png');\" title=\"Install for " + platform + " (Right-Click to Download)\">Install Now for " + platform + "</a> ({$item.Size|escape} <abbr title=\"Kilobytes\">KB</abbr>)");
{rdelim} else {ldelim}
document.writeln("<strong>{$addon->Name|escape}</strong> is not available for " + platform + ".");
{rdelim}
document.writeln("</div>");
//]]>
</script>
<noscript>
{if $multiDownloadLinks}
<b>Install Now:</b><br />
{/if} {/if}
{foreach key=key item=item from=$addon->OsVersions} {/foreach}
{if $item.URI}
<div>
<a href="{$item.URI|escape}" onclick="return {$addon->installFunc}(event,'{$item.AppName|escape} {$item.Version|escape}', '{$config.webpath}/images/default.png');" title="Install for {$item.OSName|escape} {$item.Version|escape} (Right-Click to Download)">
{if $multiDownloadLinks}
{$item.OSName|escape}
{else}
Install Now
{/if}
</a> ({$item.Size|escape} <abbr title="Kilobytes">KB</abbr>)
</div>
{/if}
{/foreach}
</noscript>
</div> </div>
</div> </div>
<script type="text/javascript">
var platform = getPlatformName();
var outer = document.getElementById("install-{$addon->ID}");
var installs = outer.getElementsByTagName("DIV");
var found = false;
for(var i = 0; i < installs.length; ++i) {ldelim}
if(installs[i].className == platform || installs[i].className == "ALL") {ldelim}
found = true;
{rdelim} else {ldelim}
installs[i].style.display = "none";
{rdelim}
{rdelim}
if(!found) {ldelim}
outer.appendChild(document.createTextNode("{$addon->Name|escape} is not available for "+platform+"."));
{rdelim}
</script>
<div class="install-other"> <div class="install-other">
<a href="{$config.webpath}/{$app}/{$addon->ID}/history">Other Versions</a> <a href="{$config.webpath}/{$app}/{$addon->ID}/history">Other Versions</a>
</div> </div>