Changeset 3389
- Timestamp:
- 08/07/2011 05:15:27 AM (15 years ago)
- Location:
- branches/plugin/bbp-themes/bbp-twentyten
- Files:
-
- 2 edited
-
functions.php (modified) (5 diffs)
-
js/topic.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-themes/bbp-twentyten/functions.php
r3374 r3389 35 35 function bbp_twentyten_enqueue_styles () { 36 36 37 $version = 20110807; 38 37 39 // Right to left 38 40 if ( is_rtl() ) { 39 41 40 42 // TwentyTen 41 wp_enqueue_style( 'twentyten', get_template_directory_uri() . '/style.css', '', 20100503, 'screen' );42 wp_enqueue_style( 'twentyten-rtl', get_template_directory_uri() . '/rtl.css', 'twentyten', 20100503, 'screen' );43 wp_enqueue_style( 'twentyten', get_template_directory_uri() . '/style.css', '', $version, 'screen' ); 44 wp_enqueue_style( 'twentyten-rtl', get_template_directory_uri() . '/rtl.css', 'twentyten', $version, 'screen' ); 43 45 44 46 // bbPress specific 45 wp_enqueue_style( 'bbp-twentyten-bbpress', get_stylesheet_directory_uri() . '/css/bbpress-rtl.css', 'twentyten-rtl', 20100503, 'screen' );47 wp_enqueue_style( 'bbp-twentyten-bbpress', get_stylesheet_directory_uri() . '/css/bbpress-rtl.css', 'twentyten-rtl', $version, 'screen' ); 46 48 47 49 // Left to right … … 49 51 50 52 // TwentyTen 51 wp_enqueue_style( 'twentyten', get_template_directory_uri() . '/style.css', '', 20100503, 'screen' );53 wp_enqueue_style( 'twentyten', get_template_directory_uri() . '/style.css', '', $version, 'screen' ); 52 54 53 55 // bbPress specific 54 wp_enqueue_style( 'bbp-twentyten-bbpress', get_stylesheet_directory_uri() . '/css/bbpress.css', 'twentyten', 20100503, 'screen' );56 wp_enqueue_style( 'bbp-twentyten-bbpress', get_stylesheet_directory_uri() . '/css/bbpress.css', 'twentyten', $version, 'screen' ); 55 57 } 56 58 } … … 70 72 */ 71 73 function bbp_twentyten_enqueue_scripts () { 74 75 $version = 20110807; 76 72 77 if ( bbp_is_single_topic() ) 73 wp_enqueue_script( 'bbp_topic', get_stylesheet_directory_uri() . '/js/topic.js', array( 'wp-lists' ), '20101202');78 wp_enqueue_script( 'bbp_topic', get_stylesheet_directory_uri() . '/js/topic.js', array( 'wp-lists' ), $version ); 74 79 75 80 if ( bbp_is_single_user_edit() ) 76 81 wp_enqueue_script( 'user-profile' ); 77 82 } 78 add_action( 'bbp_ setup_theme_compat', 'bbp_twentyten_enqueue_scripts' );83 add_action( 'bbp_enqueue_scripts', 'bbp_twentyten_enqueue_scripts' ); 79 84 endif; 80 85 … … 139 144 'currentUserId' => $user_id, 140 145 'topicId' => bbp_get_topic_id(), 141 'favoritesLink' => bbp_get_favorites_permalink( $user_id ),142 'isFav' => (int) bbp_is_user_favorite( $user_id ),143 'favLinkYes' => __( 'favorites', 'bbpress' ),144 'favLinkNo' => __( '?', 'bbpress' ),145 'favYes' => __( 'This topic is one of your %favLinkYes% [%favDel%]', 'bbpress' ),146 'favNo' => __( '%favAdd% (%favLinkNo%)', 'bbpress' ),147 'favDel' => __( '×', 'bbpress' ),148 'favAdd' => __( 'Add this topic to your favorites', 'bbpress' )149 146 ); 150 147 148 // Favorites 149 if ( bbp_is_favorites_active() ) { 150 $localizations['favoritesActive'] = 1; 151 $localizations['favoritesLink'] = bbp_get_favorites_permalink( $user_id ); 152 $localizations['isFav'] = (int) bbp_is_user_favorite( $user_id ); 153 $localizations['favLinkYes'] = __( 'favorites', 'bbpress' ); 154 $localizations['favLinkNo'] = __( '?', 'bbpress' ); 155 $localizations['favYes'] = __( 'This topic is one of your %favLinkYes% [%favDel%]', 'bbpress' ); 156 $localizations['favNo'] = __( '%favAdd% (%favLinkNo%)', 'bbpress' ); 157 $localizations['favDel'] = __( '×', 'bbpress' ); 158 $localizations['favAdd'] = __( 'Add this topic to your favorites', 'bbpress' ); 159 } else { 160 $localizations['favoritesActive'] = 0; 161 } 162 163 // Subscriptions 151 164 if ( bbp_is_subscriptions_active() ) { 152 165 $localizations['subsActive'] = 1; … … 161 174 wp_localize_script( 'bbp_topic', 'bbpTopicJS', $localizations ); 162 175 } 163 add_filter( 'bbp_ setup_theme_compat', 'bbp_twentyten_topic_script_localization' );176 add_filter( 'bbp_enqueue_scripts', 'bbp_twentyten_topic_script_localization' ); 164 177 endif; 165 178 -
branches/plugin/bbp-themes/bbp-twentyten/js/topic.js
r2818 r3389 6 6 // Favorites 7 7 favoritesLink: '', 8 favoritesActive: 0, 8 9 isFav: 0, 9 10 favLinkYes: 'favorites', … … 23 24 24 25 // Topic Global 25 bbpTopicJS.isFav = parseInt( bbpTopicJS.isFav ); 26 bbpTopicJS.subsActive = parseInt( bbpTopicJS.subsActive ); 27 bbpTopicJS.isSubscribed = parseInt( bbpTopicJS.isSubscribed ); 26 bbpTopicJS.favoritesActive = parseInt( bbpTopicJS.favoritesActive ); 27 bbpTopicJS.isFav = parseInt( bbpTopicJS.isFav ); 28 bbpTopicJS.subsActive = parseInt( bbpTopicJS.subsActive ); 29 bbpTopicJS.isSubscribed = parseInt( bbpTopicJS.isSubscribed ); 28 30 29 31 // Run it 30 jQuery( function($) { 32 jQuery(document).ready( function() { 33 31 34 /** Favorites *************************************************************/ 32 var favoritesToggle = $( '#favorite-toggle' )33 .addClass( 'list:favorite' )34 .wpList( { alt: '', dimAfter: favLinkSetup } );35 35 36 var favoritesToggleSpan = favoritesToggle.children( 'span' ) 37 [bbpTopicJS.isFav ? 'addClass' : 'removeClass' ]( 'is-favorite' ); 36 if ( 1 == bbpTopicJS.favoritesActive ) { 37 var favoritesToggle = jQuery( '#favorite-toggle' ) 38 .addClass( 'list:favorite' ) 39 .wpList( { alt: '', dimAfter: favLinkSetup } ); 40 41 var favoritesToggleSpan = favoritesToggle.children( 'span' ) 42 [bbpTopicJS.isFav ? 'addClass' : 'removeClass' ]( 'is-favorite' ); 43 } 38 44 39 45 function favLinkSetup() { 40 bbpTopicJS.isFav = favoritesToggleSpan.is( '.is-favorite');46 bbpTopicJS.isFav = favoritesToggleSpan.is( '.is-favorite' ); 41 47 var aLink = "<a href='" + bbpTopicJS.favoritesLink + "'>"; 42 48 var aDim = "<a href='" + favoritesToggleSpan.find( 'a[class^="dim:"]' ).attr( 'href' ) + "' class='dim:favorite-toggle:" + favoritesToggleSpan.attr( 'id' ) + ":is-favorite'>"; … … 55 61 56 62 /** Subscriptions *********************************************************/ 63 64 if ( 1 == bbpTopicJS.subsActive ) { 65 var subscriptionToggle = jQuery( '#subscription-toggle' ) 66 .addClass( 'list:subscription' ) 67 .wpList( { alt: '', dimAfter: subsLinkSetup } ); 68 69 var subscriptionToggleSpan = subscriptionToggle.children( 'span' ) 70 [bbpTopicJS.isSubscribed ? 'addClass' : 'removeClass' ]( 'is-subscribed' ); 71 } 72 57 73 function subsLinkSetup() { 58 74 bbpTopicJS.isSubscribed = subscriptionToggleSpan.is( '.is-subscribed' ); … … 69 85 subscriptionToggle.get(0).wpList.process( subscriptionToggle ); 70 86 } 71 72 if ( bbpTopicJS.subsActive == 1 ) {73 var subscriptionToggle = $( '#subscription-toggle' )74 .addClass( 'list:subscription' )75 .wpList( { alt: '', dimAfter: subsLinkSetup } );76 77 var subscriptionToggleSpan = subscriptionToggle.children( 'span' )78 [bbpTopicJS.isSubscribed ? 'addClass' : 'removeClass' ]( 'is-subscribed' );79 }80 87 } );
Note: See TracChangeset
for help on using the changeset viewer.