WordPress.org

Ready to get started?Download WordPress

Forums

P2
Change post/reply update color (5 posts)

  1. astromono
    Member
    Posted 1 year ago #

    Hey guys, would anyone know how to change the background-color property of a post or reply that's just recently been added?

    When you write a post on P2 and post it in real time, P2 will highlight the post or reply with color #F6F3D1 and then do a slow animation until the color fades into rgb(255,255,255) aka white background-color. The white color of the background is hardcoded into the html and I don't know how to change it.

    I tried using the #main #postlist li selector to change the background-color, but that doesn't seem to be working :/

    The controls for the animation are in the list-creator.php file of the theme, however I don't know how to change the code there.

    Any help would be greatly appreciated!

    http://wordpress.org/extend/themes/p2/

  2. Somiac
    Member
    Posted 1 year ago #

    I would use jquery, check out when the comment was posted, have it be a certain color until lets say its five minutes old then have it fade with a time check asynchronously.

  3. astromono
    Member
    Posted 1 year ago #

    Thanks, but the theme already does that. All I want is for it to fade into the background color I have as opposed to white.

    The creator-list.php file seems to control this, but I don't know what to change in it:

    <script type="text/javascript">
    jQuery( function( $ ) {
    	$( 'body' )
    		.addClass( 'is-js' )
    		.delegate( '.p2-task-list :checkbox', 'click', function() {
    			var $this = $( this ),
    			    $li = $this.parents( 'li:first' ),
    			    $form = $this.parents( 'form:first' ),
    			    data = $li.find( ':input' ).serialize(),
    			    colorEl = $li, origColor = $li.css( 'background-color' ), color;
    
    			while ( colorEl.get(0).tagName && colorEl.css( 'background-color' ).match( /^\s*(rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*0+\s*\)|transparent)\s*$/ ) ) {
    				colorEl = colorEl.parent();
    			}
    
    			color = colorEl.get(0).tagName ? colorEl.css( 'background-color' ) : '#ffffff';
    
    			data += '&ajax=1&' + $form.find( '.submit :input' ).serialize();
    
    			$.post( $form.attr( 'action' ), data, function( response ) {
    				if ( '1' === response )
    					$li.css( 'background-color', '#F6F3D1' ).animate( { backgroundColor: color }, 'slow', function() { $li.css( 'background-color', origColor ); } );
    			} );
    	} );
    } );
    </script>
  4. demoman2k10
    Member
    Posted 1 year ago #

    Have the same issue.. I have a Light on Dark set up and Replies end up White on White... :( Still no fix for this yet?

  5. demoman2k10
    Member
    Posted 1 year ago #

    Fix is addressed here..

    http://wordpress.org/support/topic/theme-p2-fix-newcomment-transparency-animation?replies=2

    I've made the changes to the code on my site... Removed the animated effect and seems to work. http://www.technojunkyard.net Chatroom.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags