Fixed bug in weather where icons would sometimes not show up
This commit is contained in:
parent
33b9d25e07
commit
96c4320a53
2 changed files with 103 additions and 101 deletions
77
docs/upgrades/templates-7.4.3/WeatherDataTmpl0000001.tmpl
Normal file
77
docs/upgrades/templates-7.4.3/WeatherDataTmpl0000001.tmpl
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
#WeatherDataTmpl0000001
|
||||
<a name="id<tmpl_var assetId>"></a>
|
||||
|
||||
<tmpl_if session.var.adminOn>
|
||||
<p><tmpl_var controls></p>
|
||||
</tmpl_if>
|
||||
|
||||
<tmpl_if displayTitle>
|
||||
<h2><tmpl_var title></h2>
|
||||
</tmpl_if>
|
||||
|
||||
<tmpl_if description>
|
||||
<tmpl_var description><p></p>
|
||||
</tmpl_if>
|
||||
|
||||
<tmpl_loop ourLocations.loop>
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td rowspan="3" style="width:55px;"><img src="<tmpl_var mediumIcon>" alt="<tmpl_var iconAlt>" /></td>
|
||||
<td style="background-color:#E0E0E0;">
|
||||
<div class="weatherTitle">
|
||||
<div style="float:left;"> <b><tmpl_var cityState></b></div>
|
||||
|
||||
<div style="float:right;margin-right:1px;margin-top:2px;vertical-align:middle;">
|
||||
<a href="#" style="color:gray;font-weight:bold;">X</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<tmpl_var sky><br /><tmpl_var tempF>°F<br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</tmpl_loop>
|
||||
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady(correctPNG);
|
||||
</script>
|
||||
|
||||
~~~
|
||||
|
||||
<script type="text/javascript" src="^Extras(/yui/build/yahoo/yahoo-min.js);"></script>
|
||||
<script type="text/javascript" src="^Extras(/yui/build/yahoo/event-min.js);"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// correctly handle PNG transparency in Win IE 5.5 or higher.
|
||||
var correctPNG = function() {
|
||||
if (YAHOO.util.Event.isIE) {
|
||||
for(var i=0; i<document.images.length; i++) {
|
||||
var img = document.images[i]
|
||||
var imgName = img.src.toUpperCase()
|
||||
if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
|
||||
var imgID = (img.id) ? "id='" + img.id + "' " : ""
|
||||
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
|
||||
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
|
||||
var imgStyle = "display:inline-block;" + img.style.cssText
|
||||
if (img.align == "left") imgStyle = "float:left;" + imgStyle
|
||||
if (img.align == "right") imgStyle = "float:right;" + imgStyle
|
||||
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
|
||||
var strNewHTML = "<span " + imgID + imgClass + imgTitle
|
||||
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
|
||||
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
|
||||
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
|
||||
img.outerHTML = strNewHTML
|
||||
i = i-1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue