Skip to content

Commit

Permalink
added another workaround for JavaScript parsing errors; updates #11
Browse files Browse the repository at this point in the history
  • Loading branch information
following5 committed Aug 9, 2015
1 parent 1a72824 commit ebcdfab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions htdocs/templates2/ocstyle/map2.tpl
Expand Up @@ -1165,11 +1165,12 @@ function parseXML_GetHTML(xmlobject)
sHtml += "<tr><td colspan='2'><font size='2' color='red'><b>" + xmlentities(sStatusText) + "</b></font></td></tr>";
// InfoWindows have a min width; set min width for content to avoid large right borders:
sHtml += "<tr><td><img src='resource2/ocstyle/images/cacheicon/20x20-" + nTypeId + ".png' alt='" + xmlentities(sTypeText) + "' title='" + xmlentities(sTypeText) + "' height='20px' width='20px' /></td><td style='min-width:150px";
apos = "'"; // fix for issue #11 / nested " ' " JavaScript parsing errors in some browsers
sHtml += "<tr><td><img src=" +apos+"resource2/ocstyle/images/cacheicon/20x20-"+nTypeId+".png"+apos+ " alt=" + apos+xmlentities(sTypeText)+apos + " title=" + apos+xmlentities(sTypeText)+apos + " height='20px' width='20px' /></td><td style='min-width:150px";
if (sName.length > 60)
sHtml += "; white-space:normal";
sHtml += "'><a href='viewcache.php?wp=" + encodeURI(sWPOC) + "' target='_blank'><font size='2'>" + xmlentities(sName) + "</font></a></td><td align='right' vertical-align:'top'><font size='2'><b>&nbsp;" + xmlentities(sWPOC) + "</b></font></td></tr>";
sHtml += "<tr><td colspan='2' style='vertical-align:top;'>{t escape=js}by{/t} <a href='viewprofile.php?userid=" + encodeURI(nUserId) + "' target='_blank'>" + xmlentities(sUsername) + "</a></td><td align='right'><a class='nooutline' href='articles.php?page=cacheinfo#difficulty' target='_blank'><img src='resource2/{$opt.template.style}/images/difficulty/diff-" + String(nDifficulty*10) + ".gif' border='0' width='19' height='16' hspace='2' onmouseover='Tip(\"{t}Difficulty{/t}: " + String(nDifficulty) + " {t}of{/t} 5\", DELAY, 0, FADEIN, false, FADEOUT, false, BGCOLOR, \"#fffedf\", BORDERCOLOR, \"grey\")' onmouseout='UnTip()' /><img src='resource2/{$opt.template.style}/images/difficulty/terr-" + String(nTerrain*10) + ".gif' border='0' width='19' height='16' hspace='2' onmouseover='Tip(\"{t}Terrain{/t}: " + String(nTerrain) + " {t}of{/t} 5\", DELAY, 0, FADEIN, false, FADEOUT, false, BGCOLOR, \"#fffedf\", BORDERCOLOR, \"grey\")' onmouseout='UnTip()' /></a></td></tr>";
sHtml += apos+"><a href=" +apos+"viewcache.php?wp="+encodeURI(sWPOC)+apos +" target='_blank'><font size='2'>" + xmlentities(sName) + "</font></a></td><td align='right' vertical-align:'top'><font size='2'><b>&nbsp;" + xmlentities(sWPOC) + "</b></font></td></tr>";
sHtml += "<tr><td colspan='2' style='vertical-align:top;'>{t escape=js}by{/t} <a href=" +apos+"viewprofile.php?userid="+encodeURI(nUserId)+apos+ " target='_blank'>" + xmlentities(sUsername) + "</a></td><td align='right'><a class='nooutline' href='articles.php?page=cacheinfo#difficulty' target='_blank'><img src=" + apos+"resource2/{$opt.template.style}/images/difficulty/diff-"+String(nDifficulty*10)+".gif"+apos + " border='0' width='19' height='16' hspace='2' onmouseover=" +apos+"Tip(\"{t}Difficulty{/t}: " + String(nDifficulty) + " {t}of{/t} 5\", DELAY, 0, FADEIN, false, FADEOUT, false, BGCOLOR, \"#fffedf\", BORDERCOLOR, \"grey\")"+apos+ " onmouseout='UnTip()' /><img src=" +apos+"resource2/{$opt.template.style}/images/difficulty/terr-"+String(nTerrain*10)+".gif"+apos + " border='0' width='19' height='16' hspace='2' onmouseover=" +apos+"Tip(\"{t}Terrain{/t}: " + String(nTerrain) + " {t}of{/t} 5\", DELAY, 0, FADEIN, false, FADEOUT, false, BGCOLOR, \"#fffedf\", BORDERCOLOR, \"grey\")"+apos+ " onmouseout='UnTip()' /></a></td></tr>";
sHtml += "<tr><td colspan='3' height='3px'></td></tr>";
sHtml += "<tr><td colspan='2'>" + xmlentities(sTypeText) + " (" + xmlentities(sSizeText) + ")</td><td align='right' rowspan='2'>" + (bOconly==1 ? "{$help_oconly}<img src='resource2/ocstyle/images/misc/is_oconly_small.png' alt='OConly' title='OConly' /></a>" : "") + "</td></tr>";
Expand Down

0 comments on commit ebcdfab

Please sign in to comment.