This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed
wp/wp-content/themes/tcs-responsive Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,23 @@ <h2>Comment Examples</h2>
175175 } else {
176176 photoLink = tcconfig . communityURL + '/i/m/nophoto_login.gif' ;
177177 }
178+
179+ var color = '' ;
180+ var ratings = data [ 'ratingSummary' ] ;
181+ if ( ratings ) {
182+ var maxRating = 0 ;
183+ for ( var i = 0 ; i < ratings . length ; i ++ ) {
184+ if ( maxRating < ratings [ i ] [ 'rating' ] ) {
185+ maxRating = ratings [ i ] [ 'rating' ] ;
186+ color = ratings [ i ] [ 'colorStyle' ] . split ( ": " ) [ 1 ] ;
187+ }
188+ }
189+ } else if ( data [ 'isPM' ] == true ) {
190+ color = '#FF9900' ;
191+ }
192+
178193 $timeout ( function ( ) {
194+ vm . handleStyle = { color : color } ;
179195 vm . photoURL = photoLink ;
180196 } ) ;
181197 } ) ;
Original file line number Diff line number Diff line change 2020 < div class ="menu-item-header ">
2121 < a ng-href ={{vm.profileLink}} class ="profile-link-dropdown ">
2222 < img ng-src ="{{vm.photoURL}} " class ="user-avatar "/>
23- < span class ="username "> {{vm.userHandle}}</ span >
23+ < span ng-style =" vm.handleStyle " class ="username "> {{vm.userHandle}}</ span >
2424 </ a >
2525 </ div >
2626 < a href ="/settings/profile " class ="btn-link btn-edit-profile show-small "> EDIT</ a >
Original file line number Diff line number Diff line change @@ -256,7 +256,23 @@ function _kms(u){
256256 } else {
257257 photoLink = tcconfig.communityURL + '/i/m/nophoto_login.gif';
258258 }
259+
260+ var color = '';
261+ var ratings = data['ratingSummary'];
262+ if (ratings) {
263+ var maxRating = 0;
264+ for (var i = 0; i < ratings.length; i++) {
265+ if (maxRating < ratings[i]['rating']) {
266+ maxRating = ratings[i]['rating'];
267+ color = ratings[i]['colorStyle'].split(": ")[1];
268+ }
269+ }
270+ } else if (data['isPM'] == true) {
271+ color = '#FF9900';
272+ }
273+
259274 $timeout(function() {
275+ vm.handleStyle = { color: color };
260276 vm.photoURL = photoLink;
261277 });
262278 });
You can’t perform that action at this time.
0 commit comments