Don't show any traces of the dynamic preview if JavaScript is disabled.
Patch by allen.
diffs (28 lines):
diff -r a9a663f628bd -r a110390a7520 cgi-bin/DW/Setting/XPostAccounts.pm
--- a/cgi-bin/DW/Setting/XPostAccounts.pm Thu Nov 19 16:36:36 2009 +0000
+++ b/cgi-bin/DW/Setting/XPostAccounts.pm Thu Nov 19 16:45:03 2009 +0000
@@ -145,7 +145,7 @@ sub option {
value => $footer_text
}) . "<br/><br/>";
- $ret .= "" . $class->ml('setting.xpost.preview') . "\n";
+ $ret .= "<div id='preview_section' style='display: none;'>" .
$class->ml('setting.xpost.preview') . "\n";
my $baseurl = $LJ::SITEROOT;
my $alttext =
$class->ml('setting.xpost.option.footer.vars.comment_image.alttext');
@@ -153,6 +153,7 @@ sub option {
$ret .= qq [
<div id='footer_preview' class='xpost_footer_preview'></div>
+ </div>
<script type="text/javascript">
function updatePreview() {
var previewString = \$('${key}crosspost_footer_text').value;
@@ -165,6 +166,7 @@ sub option {
previewString = previewString.replace(/%%comment_image%%/, '<img
src="$baseurl/tools/commentcount?samplecount=23" width="30" height="12"
alt="$alttext" style="vertical-align: middle;"/>');
\$('footer_preview').innerHTML = previewString;
}
+ \$('preview_section').style.display = 'block';
updatePreview();
</script>
];
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog