[dw-free] Investigate using cgi-bin/imageconf.pl instead of scattering image URLs all over the place
[commit: http://hg.dwscoalition.org/dw-free/rev/8fd7c9fe6c8c]
http://bugs.dwscoalition.org/show_bug.cgi?id=1207
Rest of cgi-bin, and a few leftover in htdocs.
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1207
Rest of cgi-bin, and a few leftover in htdocs.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/en.dat
- cgi-bin/DW/Logic/ProfilePage.pm
- cgi-bin/LJ/CProd/Feeds.pm
- cgi-bin/LJ/CProd/Polls.pm
- cgi-bin/LJ/Widget/CreateAccount.pm
- cgi-bin/LJ/Widget/InboxFolder.pm
- cgi-bin/LJ/Widget/InboxFolderNav.pm
- cgi-bin/LJ/Widget/Login.pm
- cgi-bin/imageconf.pl
- cgi-bin/weblib.pl
- htdocs/community/sentinvites.bml
- htdocs/login.bml
- htdocs/manage/emailpost.bml
- htdocs/manage/pubkey.bml
- htdocs/profile.bml.text
-------------------------------------------------------------------------------- diff -r 9d9de7627e00 -r 8fd7c9fe6c8c bin/upgrading/en.dat --- a/bin/upgrading/en.dat Mon Jul 12 17:39:45 2010 +0800 +++ b/bin/upgrading/en.dat Mon Jul 12 18:03:12 2010 +0800 @@ -2051,6 +2051,8 @@ img.rss=RSS img.searchdots=... +img.ssl=Secure Login + img.tellfriend=Tell a Friend! img.track=Track This diff -r 9d9de7627e00 -r 8fd7c9fe6c8c cgi-bin/DW/Logic/ProfilePage.pm --- a/cgi-bin/DW/Logic/ProfilePage.pm Mon Jul 12 17:39:45 2010 +0800 +++ b/cgi-bin/DW/Logic/ProfilePage.pm Mon Jul 12 18:03:12 2010 +0800 @@ -377,7 +377,7 @@ sub _basic_info_display_name { my $synd = $u->get_syndicated; $ret->[3] = { url => LJ::ehtml( $synd->{synurl} ), - text => "<img src='$LJ::IMGPREFIX/xml.gif' width='36' height='14' align='absmiddle' border='0' alt=\"" . LJ::Lang::ml( '.syn.xml' ) . "\" /></a>", + text => LJ::img( 'xml', '', { align => 'absmiddle' } ), }; } else { $ret->[0] = LJ::Lang::ml( '.label.name' ); diff -r 9d9de7627e00 -r 8fd7c9fe6c8c cgi-bin/LJ/CProd/Feeds.pm --- a/cgi-bin/LJ/CProd/Feeds.pm Mon Jul 12 17:39:45 2010 +0800 +++ b/cgi-bin/LJ/CProd/Feeds.pm Mon Jul 12 18:03:12 2010 +0800 @@ -35,8 +35,8 @@ sub render { sub render { my ($class, $u, $version) = @_; my $user = LJ::ljuser($u); - my $icon = "<div style=\"float: left; padding-right: 5px;\"> - <img border=\"1\" src=\"$LJ::SITEROOT/img/syndicated24x24.gif\" /></div>"; + my $icon = "<div style=\"float: left; padding-right: 5px;\">" . + LJ::img( 'id_feed-24', '', { border => 1 } ) . "</div>"; my $link = $class->clickthru_link('cprod.feeds.link', $version); return "<p>$icon " . BML::ml($class->get_ml($version), { "user" => $user, diff -r 9d9de7627e00 -r 8fd7c9fe6c8c cgi-bin/LJ/CProd/Polls.pm --- a/cgi-bin/LJ/CProd/Polls.pm Mon Jul 12 17:39:45 2010 +0800 +++ b/cgi-bin/LJ/CProd/Polls.pm Mon Jul 12 18:03:12 2010 +0800 @@ -32,26 +32,23 @@ sub render { my ($class, $u, $version) = @_; my $user = LJ::ljuser($u); my $link = $class->clickthru_link('cprod.polls.link', $version); + my $lbar = LJ::img( 'poll_left', '', { style => 'vertical-align:middle' } ); + my $rbar = LJ::img( 'poll_right', '', { style => 'vertical-align:middle' } ); + my $poll = " -<div style='margin: 2px'><div>That's crazy!</div><div style='white-space: nowrap'> -<img src='$LJ::IMGPREFIX/poll/leftbar.gif' style='vertical-align:middle' -height='14' alt='' /><img src='$LJ::IMGPREFIX/poll/mainbar.gif' -style='vertical-align:middle' height='14' width='174' alt='' /><img -src='$LJ::IMGPREFIX/poll/rightbar.gif' style='vertical-align:middle' -height='14' width='7' alt='' /> <b>283</b> (58.0%)</div> -<div>I can't wait to try.</div> -<div style='white-space: nowrap'> -<img src='$LJ::IMGPREFIX/poll/leftbar.gif' style='vertical-align:middle' height='14' -alt='' /><img src='$LJ::IMGPREFIX/poll/mainbar.gif' style='vertical-align:middle' -height='14' width='81' alt='' /><img src='$LJ::IMGPREFIX/poll/rightbar.gif' -style='vertical-align:middle' height='14' width='7' alt='' /> -<b>132</b> (27.0%)</div> -<div>What type of poll am I?</div> -<div style='white-space: nowrap'> -<img src='$LJ::IMGPREFIX/poll/leftbar.gif' style='vertical-align:middle' height='14' -alt='' /><img src='$LJ::IMGPREFIX/poll/mainbar.gif' style='vertical-align:middle' -height='14' width='45' alt='' /><img src='$LJ::IMGPREFIX/poll/rightbar.gif' -style='vertical-align:middle' height='14' width='7' alt='' /> <b>73</b> (15.0%)</div> +<div style='margin: 2px'> +<div>That's crazy!</div><div style='white-space: nowrap'> +$lbar <img src='$LJ::IMGPREFIX/poll/mainbar.gif' + style='vertical-align:middle' height='14' width='174' alt='' /> +$rbar <b>283</b> (58.0%)</div> +<div>I can't wait to try.</div><div style='white-space: nowrap'> +$lbar <img src='$LJ::IMGPREFIX/poll/mainbar.gif' + style='vertical-align:middle' height='14' width='81' alt='' /> +$rbar <b>132</b> (27.0%)</div> +<div>What type of poll am I?</div><div style='white-space: nowrap'> +$lbar <img src='$LJ::IMGPREFIX/poll/mainbar.gif' + style='vertical-align:middle' height='14' width='45' alt='' /> +$rbar <b>73</b> (15.0%)</div> </div>"; return BML::ml($class->get_ml($version), { "user" => $user, "link" => $link, "poll" => $poll }); diff -r 9d9de7627e00 -r 8fd7c9fe6c8c cgi-bin/LJ/Widget/CreateAccount.pm --- a/cgi-bin/LJ/Widget/CreateAccount.pm Mon Jul 12 17:39:45 2010 +0800 +++ b/cgi-bin/LJ/Widget/CreateAccount.pm Mon Jul 12 18:03:12 2010 +0800 @@ -114,11 +114,8 @@ sub render_body { # If JavaScript is available, check to see if the username is available # before submitting the form. Make sure that responses are returned as # ARIA live region for screen reader compatibility. - $ret .= " <img id='username_check' src='$LJ::IMGPREFIX/create/check.png' alt='" - . $class->ml('widget.createaccount.field.username.available') - . "' title='" - . $class->ml('widget.createaccount.field.username.available') - . "' aria-live='polite' />"; + $ret .= LJ::img( 'create_check', '', { 'id' => 'username_check', + 'aria-live' => 'polite' } ); $ret .= "<span id='username_error'><br /><span id='username_error_inner' class='formitemFlag' role='alert'></span></span>"; $ret .= "</td></tr>\n"; diff -r 9d9de7627e00 -r 8fd7c9fe6c8c cgi-bin/LJ/Widget/InboxFolder.pm --- a/cgi-bin/LJ/Widget/InboxFolder.pm Mon Jul 12 17:39:45 2010 +0800 +++ b/cgi-bin/LJ/Widget/InboxFolder.pm Mon Jul 12 18:03:12 2010 +0800 @@ -166,15 +166,11 @@ sub render_body { }); # HTML for displaying bookmark flag - my ( $bookmark, $bookmark_alt ); - if ( $inbox->is_bookmark($qid) ) { - $bookmark = "on"; - $bookmark_alt = "<?_ml widget.inbox.notification.rem_bookmark _ml?>"; - } else { - $bookmark = "off"; - $bookmark_alt = "<?_ml widget.inbox.notification.add_bookmark _ml?>"; - } - $bookmark = "<a href='$LJ::SITEROOT/inbox/?page=$page&bookmark_$bookmark=$qid'><img src='$LJ::IMGPREFIX/flag_$bookmark.gif' width='16' height='18' class='InboxItem_Bookmark' border='0' alt='$bookmark_alt' /></a>"; + my $bookmark = 'bookmark_' + . $inbox->is_bookmark( $qid ) ? "on" : "off"; + $bookmark = "<a href='$LJ::SITEROOT/inbox/?page=$page&$bookmark=$qid'>" + . LJ::img( $bookmark, "", { class => 'InboxItem_Bookmark' } ) + . "</a>"; my $when = LJ::ago_text(time() - $inbox_item->when_unixtime); my $contents = $inbox_item->as_html || ''; @@ -191,20 +187,11 @@ sub render_body { $expanded ||= $remote->prop('esn_inbox_default_expand'); $expanded = 0 if $inbox_item->read; - my ( $expand_img, $expand_alt ); - if ( $expanded ) { - $expand_img = "expand.gif"; - $expand_alt = "<?_ml widget.inbox.notification.expanded _ml?>"; - } else { - $expand_img = "collapse.gif"; - $expand_alt = "<?_ml widget.inbox.notification.collapsed _ml?>"; - } - my $expand_img = $expanded ? "expand.gif" : "collapse.gif"; - my $expand_img = $expanded ? "expand.gif" : "collapse.gif"; + my $expand_img = $expanded ? "inbox_expand" : "inbox_collapse"; - $expandbtn = qq { - <a href="$LJ::SITEROOT/inbox/?page=$page&expand=$qid"><img src="$LJ::IMGPREFIX/$expand_img" class="InboxItem_Expand" border="0" alt="$expand_alt" /></a> - }; + $expandbtn .= qq { <a href="$LJ::SITEROOT/inbox/?page=$page&expand=$qid"> }; + $expandbtn .= LJ::img( $expand_img, '', { class => 'InboxItem_Expand' } ); + $expandbtn .= "</a>\n"; my $display = $expanded ? "block" : "none"; diff -r 9d9de7627e00 -r 8fd7c9fe6c8c cgi-bin/LJ/Widget/InboxFolderNav.pm --- a/cgi-bin/LJ/Widget/InboxFolderNav.pm Mon Jul 12 17:39:45 2010 +0800 +++ b/cgi-bin/LJ/Widget/InboxFolderNav.pm Mon Jul 12 18:03:12 2010 +0800 @@ -93,8 +93,7 @@ sub render_body { $body .= $subfolder_link->( "pollvote", "inbox.menu.poll_votes", "subs", $unread_html->( $inbox->pollvote_event_count ) ); $body .= qq{<span class="subs">---</span>\n}; $body .= $subfolder_link->( "unread", "inbox.menu.unread", "subs", $unread_all_html ); - $body .= $subfolder_link->( "bookmark", "inbox.menu.bookmarks", "subs", "", - qq{<img src="$LJ::IMGPREFIX/flag_on.gif" width="12" height="14" border="0" />} ); + $body .= $subfolder_link->( "bookmark", "inbox.menu.bookmarks", "subs", "", LJ::img( 'flag', '' ) ); $body .= $subfolder_link->( "usermsg_sent", "inbox.menu.sent", "subs", $unread_html->( $inbox->usermsg_sent_event_count ) ) if LJ::is_enabled( 'user_messaging' ); $body .= $subfolder_link->( "archived", "inbox.menu.archive", "subs" ) if LJ::is_enabled( 'esn_archive' ); diff -r 9d9de7627e00 -r 8fd7c9fe6c8c cgi-bin/LJ/Widget/Login.pm --- a/cgi-bin/LJ/Widget/Login.pm Mon Jul 12 17:39:45 2010 +0800 +++ b/cgi-bin/LJ/Widget/Login.pm Mon Jul 12 18:03:12 2010 +0800 @@ -94,7 +94,7 @@ sub render_body { # standard/secure links removed for now my $secure = "<p>"; - $secure .= "<img src='$LJ::IMGPREFIX/padlocked.gif' class='secure-image' width='20' height='16' alt='secure login' />"; + $secure .= LJ::img( 'ssl_locked', '', { class => 'secure-image' } ); $secure .= LJ::Lang::ml('/login.bml.login.secure') . " | <a href='$LJ::SITEROOT/login?nojs=1'>" . LJ::Lang::ml('/login.bml.login.standard') . "</a></p>"; $ret .= "<p><input name='action:login' type='submit' value='" @@ -111,19 +111,27 @@ sub render_body { # javascript version of login if they seem to have javascript, otherwise # noscript to SSL $ret .= "<script type='text/javascript' language='Javascript'>\n"; - $ret .= "<!-- \n document.write(\"<p style='padding-bottom: 5px'><img src='$LJ::IMGPREFIX/unpadlocked.gif' width='20' height='16' alt='secure login' align='middle' />" . - LJ::ejs(" <a href='$LJ::SITEROOT/login'>" . LJ::Lang::ml('/login.bml.login.secure') . "</a> | " . LJ::Lang::ml('/login.bml.login.standard') . "</p>") . + $ret .= "<!-- \n document.write(\"<p style='padding-bottom: 5px'>" . + LJ::img( 'ssl_unlocked', '', { align => 'middle' } ) . + LJ::ejs( " <a href='$LJ::SITEROOT/login'>" . + LJ::Lang::ml('/login.bml.login.secure') . "</a> | " . + LJ::Lang::ml('/login.bml.login.standard') . "</p>" ) . "\"); \n // -->\n </script>\n"; if ($LJ::USE_SSL) { - $ret .= "<noscript>"; - $ret .= "<p style='padding-bottom: 5px'><img src='$LJ::IMGPREFIX/unpadlocked.gif' width='20' height='16' alt='secure login' align='middle' /> <a href='$LJ::SSLROOT/login'>" . LJ::Lang::ml('/login.bml.login.secure') . "</a> | " . LJ::Lang::ml('/login.bml.login.standard') . "</p>"; + $ret .= "<noscript><p style='padding-bottom: 5px'>"; + $ret .= LJ::img( 'ssl_unlocked', '', { align => 'middle' } ); + $ret .= " <a href='$LJ::SSLROOT/login'>" . + LJ::Lang::ml('/login.bml.login.secure') . "</a> | " . + LJ::Lang::ml('/login.bml.login.standard') . "</p>"; $ret .= "</noscript>"; } } else { # insecure now, and not because it was forced, so javascript doesn't work. # only way to get to secure now is via SSL, so link there - $ret .= "<p><img src='$LJ::IMGPREFIX/unpadlocked.gif' width='20' height='16' class='secure-image' alt='secure login' />"; - $ret .= " <a href='$LJ::SSLROOT/login'>" . LJ::Lang::ml('/login.bml.login.secure') . "</a> | " . LJ::Lang::ml('/login.bml.login.standard') . "</p>\n" + $ret .= "<p>" . LJ::img( 'ssl_unlocked', '', { class => 'secure-image' } ); + $ret .= " <a href='$LJ::SSLROOT/login'>" . + LJ::Lang::ml('/login.bml.login.secure') . "</a> | " . + LJ::Lang::ml('/login.bml.login.standard') . "</p>\n" if $LJ::USE_SSL; } diff -r 9d9de7627e00 -r 8fd7c9fe6c8c cgi-bin/imageconf.pl --- a/cgi-bin/imageconf.pl Mon Jul 12 17:39:45 2010 +0800 +++ b/cgi-bin/imageconf.pl Mon Jul 12 18:03:12 2010 +0800 @@ -269,15 +269,78 @@ use vars qw(%img); alt => 'img.circle_no', }; +$img{create_check} = { + src => '/create/check.png', + width => 12, + height => 12, + alt => 'widget.createaccount.field.username.available', +}; + +$img{check} = { + src => '/check.gif', + width => 15, + height => 15, + alt => '', +}; + +$img{flag} = { + src => '/flag_on.gif', + width => 12, + height => 14, + alt => '', +}; + +$img{bookmark_on} = { + src => '/flag_on.gif', + width => 16, + height => 18, + alt => 'widget.inbox.notification.rem_bookmark', +}; + +$img{bookmark_off} = { + src => '/flag_off.gif', + width => 16, + height => 18, + alt => 'widget.inbox.notification.add_bookmark', +}; + +$img{inbox_expand} = { + src => '/expand.gif', + width => 11, + height => 11, + alt => 'widget.inbox.notification.expanded', +}; + +$img{inbox_collapse} = { + src => '/collapse.gif', + width => 11, + height => 11, + alt => 'widget.inbox.notification.collapsed', +}; + +$img{ssl_locked} = { + src => '/padlocked.gif', + width => 20, + height => 16, + alt => 'img.ssl', +}; + +$img{ssl_unlocked} = { + src => '/unpadlocked.gif', + width => 20, + height => 16, + alt => 'img.ssl', +}; + $img{'arrow-down'} = { - src => 'profile_icons/arrow-down.gif', + src => '/profile_icons/arrow-down.gif', width => 12, height => 12, alt => 'img.arrow-down', }; $img{'arrow-right'} = { - src => 'profile_icons/arrow-right.gif', + src => '/profile_icons/arrow-right.gif', width => 12, height => 12, alt => 'img.arrow-right', @@ -388,10 +451,16 @@ use vars qw(%img); alt => '', }; +$img{post} = { + src => '/silk/profile/post.png', + width => 20, + height => 18, + alt => '', +}; + # load the site-local version, if it's around. if (-e "$LJ::HOME/cgi-bin/imageconf-local.pl") { require "$LJ::HOME/cgi-bin/imageconf-local.pl"; } 1; - diff -r 9d9de7627e00 -r 8fd7c9fe6c8c cgi-bin/weblib.pl --- a/cgi-bin/weblib.pl Mon Jul 12 17:39:45 2010 +0800 +++ b/cgi-bin/weblib.pl Mon Jul 12 18:03:12 2010 +0800 @@ -3447,7 +3447,9 @@ sub subscribe_interface { # show blurb if not tracking anything if ($cat_empty && $is_tracking_category) { my $blurb = "<?p <strong>" . LJ::Lang::ml('subscribe_interface.nosubs.title') . "</strong><br />"; - $blurb .= LJ::Lang::ml('subscribe_interface.nosubs.text', { img => "<img src='$LJ::SITEROOT/img/silk/entry/track.png' width='16' height='16' align='absmiddle' alt='$ui_notify' />" }) . " p?>"; + $blurb .= LJ::Lang::ml( 'subscribe_interface.nosubs.text', + { img => LJ::img( 'track', '', { align => 'absmiddle', + alt => $ui_notify } ) } ) . " p?>"; $cat_html .= "<td colspan='$cols'>$blurb</td>"; } diff -r 9d9de7627e00 -r 8fd7c9fe6c8c htdocs/community/sentinvites.bml --- a/htdocs/community/sentinvites.bml Mon Jul 12 17:39:45 2010 +0800 +++ b/htdocs/community/sentinvites.bml Mon Jul 12 18:03:12 2010 +0800 @@ -232,7 +232,7 @@ END my $can_revoke = 0; # checkboxes and such - my $yes = '<img src="/img/check.gif" width="15" height="15" border="0">'; + my $yes = LJ::img( 'check', '' ); my $no = '-'; # rows for existing users diff -r 9d9de7627e00 -r 8fd7c9fe6c8c htdocs/login.bml --- a/htdocs/login.bml Mon Jul 12 17:39:45 2010 +0800 +++ b/htdocs/login.bml Mon Jul 12 18:03:12 2010 +0800 @@ -134,7 +134,7 @@ _c?> unless ( $remote->is_identity ) { $body .= "<div style='float: left; padding: 5px 10px 0px 10px;'>"; - $body .= "<img src='/img/silk/profile/post.png'></div>\n"; + $body .= LJ::img( 'post', '' ) . "</div>\n"; $body .= "<div style='margin-left: 36px;'>"; $body .= "<?h2 <a href='$LJ::SITEROOT/update'>"; $body .= "$ML{'.loggedin.suggesthead1'}</a> h2?>\n"; @@ -143,7 +143,7 @@ _c?> } $body .= "<div style='float: left; padding: 5px 10px 0px 10px'>"; - $body .= "<img src='/img/silk/identity/user.png'></div>\n"; + $body .= LJ::img( 'id_user', '', { alt => '' } ) . "</div>\n"; $body .= "<div style='margin-left: 36px'>"; $body .= "<?h2 <a href='$base/read'>"; $body .= "$ML{'.loggedin.suggesthead2'}</a> h2?>\n"; diff -r 9d9de7627e00 -r 8fd7c9fe6c8c htdocs/manage/emailpost.bml --- a/htdocs/manage/emailpost.bml Mon Jul 12 17:39:45 2010 +0800 +++ b/htdocs/manage/emailpost.bml Mon Jul 12 18:03:12 2010 +0800 @@ -232,7 +232,8 @@ body<= <?h1 $ML{'.help.advanced.header'} h1?><br /> <a name="pgp"></a> - <fieldset><legend>$ML{'.help.advanced.pgp.header'} <img src="/img/key.gif" width="16" height="16"></legend> + <fieldset><legend>$ML{'.help.advanced.pgp.header'} } . + LJ::img( 'key', '', { alt => '' } ) . qq{ </legend> <?p } . BML::ml('.help.advanced.pgp.text1', {'pgp' => "<b>PGP</b>"}) . qq{ p?> <?p } . BML::ml('.help.advanced.pgp.text2', {'aopts' => "href='$LJ::SITEROOT/manage/pubkey'"}) . qq{ p?> <?emailex diff -r 9d9de7627e00 -r 8fd7c9fe6c8c htdocs/manage/pubkey.bml --- a/htdocs/manage/pubkey.bml Mon Jul 12 17:39:45 2010 +0800 +++ b/htdocs/manage/pubkey.bml Mon Jul 12 18:03:12 2010 +0800 @@ -91,7 +91,8 @@ body<= }); $ret .= " p?>"; - $ret .= "<?h1 $ML{'.header'} <img src='/img/key.gif' height='16' width='16'> h1?>"; + $ret .= "<?h1 $ML{'.header'} "; + $ret .= LJ::img( 'key', '', { alt => '' } ) . " h1?>"; $ret .= "<form method='post' action='pubkey'>\n"; $ret .= LJ::form_auth(); $ret .= $error if $error; diff -r 9d9de7627e00 -r 8fd7c9fe6c8c htdocs/profile.bml.text --- a/htdocs/profile.bml.text Mon Jul 12 17:39:45 2010 +0800 +++ b/htdocs/profile.bml.text Mon Jul 12 18:03:12 2010 +0800 @@ -418,8 +418,6 @@ .syn.parseerror=Error Message: -.syn.xml=XML - .syndinfo.body2=If you would like articles from the syndicated site to appear on your friends page, you can <a [[aopts]]>add this journal to your friends list</a>. .syndinfo.name=Syndication Journal --------------------------------------------------------------------------------
no subject