[dw-free] jQuerify icon browser
[commit: http://hg.dwscoalition.org/dw-free/rev/e101470471a3]
http://bugs.dwscoalition.org/show_bug.cgi?id=3675
Pass in whether to use beta or not from the outside; if we're not on a
journal page, then the journal jquery JS shouldn't be applied.
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3675
Pass in whether to use beta or not from the outside; if we're not on a
journal page, then the journal jquery JS shouldn't be applied.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/LJ/S2/EntryPage.pm
- cgi-bin/LJ/S2/ReplyPage.pm
- cgi-bin/LJ/Talk.pm
- cgi-bin/LJ/Widget/UserpicSelector.pm
- htdocs/talkpost.bml
- htdocs/talkpost_do.bml
- htdocs/talkread.bml
-------------------------------------------------------------------------------- diff -r d71c0e6f42d9 -r e101470471a3 cgi-bin/LJ/S2/EntryPage.pm --- a/cgi-bin/LJ/S2/EntryPage.pm Sat Dec 10 13:10:49 2011 +0800 +++ b/cgi-bin/LJ/S2/EntryPage.pm Sat Dec 10 22:15:43 2011 +0800 @@ -76,7 +76,8 @@ $p->{head_content} .= LJ::canonical_link( $permalink, $get->{thread} ); # quickreply js libs - LJ::need_res( LJ::Talk::init_iconbrowser_js( LJ::BetaFeatures->user_in_beta( LJ::get_remote() => "journaljquery" ) ? 'stc/jquery/jquery.ui.theme.smoothness.css' : 'stc/lj_base.css' ) ) + my $beta = LJ::BetaFeatures->user_in_beta( $remote => "journaljquery" ); + LJ::need_res( LJ::Talk::init_iconbrowser_js( $beta, $beta ? 'stc/jquery/jquery.ui.theme.smoothness.css' : 'stc/lj_base.css' ) ) if $remote && $remote->can_use_userpic_select; LJ::need_res(qw( diff -r d71c0e6f42d9 -r e101470471a3 cgi-bin/LJ/S2/ReplyPage.pm --- a/cgi-bin/LJ/S2/ReplyPage.pm Sat Dec 10 13:10:49 2011 +0800 +++ b/cgi-bin/LJ/S2/ReplyPage.pm Sat Dec 10 22:15:43 2011 +0800 @@ -63,7 +63,8 @@ LJ::need_res('stc/display_none.css'); # libs for userpicselect - LJ::need_res( LJ::Talk::init_iconbrowser_js( LJ::BetaFeatures->user_in_beta( LJ::get_remote() => "journaljquery" ) ? 'stc/jquery/jquery.ui.theme.smoothness.css' : 'stc/lj_base.css' ) ) + my $beta = LJ::BetaFeatures->user_in_beta( $remote => "journaljquery" ); + LJ::need_res( LJ::Talk::init_iconbrowser_js( $beta, $beta ? 'stc/jquery/jquery.ui.theme.smoothness.css' : 'stc/lj_base.css' ) ) if $remote && $remote->can_use_userpic_select; if ($u->should_block_robots || $entry->should_block_robots) { diff -r d71c0e6f42d9 -r e101470471a3 cgi-bin/LJ/Talk.pm --- a/cgi-bin/LJ/Talk.pm Sat Dec 10 13:10:49 2011 +0800 +++ b/cgi-bin/LJ/Talk.pm Sat Dec 10 22:15:43 2011 +0800 @@ -2131,9 +2131,8 @@ # args: names of any additional files to load # returns: full list of arguments to pass to LJ::need_res sub init_iconbrowser_js { - my @additional = @_; - - my $beta = LJ::BetaFeatures->user_in_beta( LJ::get_remote() => "journaljquery" ); + my ( $beta, @additional ) = @_; + my @list = $beta ? ( { group => 'jquery' }, diff -r d71c0e6f42d9 -r e101470471a3 cgi-bin/LJ/Widget/UserpicSelector.pm --- a/cgi-bin/LJ/Widget/UserpicSelector.pm Sat Dec 10 13:10:49 2011 +0800 +++ b/cgi-bin/LJ/Widget/UserpicSelector.pm Sat Dec 10 22:15:43 2011 +0800 @@ -20,7 +20,8 @@ use LJ::Talk; sub need_res { - return LJ::Talk::init_iconbrowser_js( 'stc/entry.css' ); + # force to not use beta, because this is not used in journal spaces + return LJ::Talk::init_iconbrowser_js( 0, 'stc/entry.css' ); } sub handle_post { diff -r d71c0e6f42d9 -r e101470471a3 htdocs/talkpost.bml --- a/htdocs/talkpost.bml Sat Dec 10 13:10:49 2011 +0800 +++ b/htdocs/talkpost.bml Sat Dec 10 22:15:43 2011 +0800 @@ -27,7 +27,7 @@ my $errtxt; # libs for userpicselect - LJ::need_res( LJ::Talk::init_iconbrowser_js() ) + LJ::need_res( LJ::Talk::init_iconbrowser_js( LJ::BetaFeatures->user_in_beta( $remote => "journaljquery" ) ) ) if $remote && $remote->can_use_userpic_select; LJ::set_active_resource_group( "jquery" ) if LJ::BetaFeatures->user_in_beta( $remote => "journaljquery" ); diff -r d71c0e6f42d9 -r e101470471a3 htdocs/talkpost_do.bml --- a/htdocs/talkpost_do.bml Sat Dec 10 13:10:49 2011 +0800 +++ b/htdocs/talkpost_do.bml Sat Dec 10 22:15:43 2011 +0800 @@ -117,7 +117,7 @@ LJ::need_res('stc/display_none.css'); # libs for userpicselect - LJ::need_res( LJ::Talk::init_iconbrowser_js() ) + LJ::need_res( LJ::Talk::init_iconbrowser_js( LJ::BetaFeatures->user_in_beta( $remote => "journaljquery" ) ) ) if $remote && $remote->can_use_userpic_select; # FIXME: this isn't entirely correct, if ecphash is present but ignored/incorrect diff -r d71c0e6f42d9 -r e101470471a3 htdocs/talkread.bml --- a/htdocs/talkread.bml Sat Dec 10 13:10:49 2011 +0800 +++ b/htdocs/talkread.bml Sat Dec 10 22:15:43 2011 +0800 @@ -228,7 +228,7 @@ js/jquery.quickreply.js ) ); - LJ::need_res( LJ::Talk::init_iconbrowser_js( 'stc/lj_base.css' ) ) + LJ::need_res( LJ::Talk::init_iconbrowser_js( LJ::BetaFeatures->user_in_beta( $remote => "journaljquery" ), 'stc/lj_base.css' ) ) if $remote->can_use_userpic_select; } --------------------------------------------------------------------------------