• Resolved Andy Mercer

    (@kelderic)


    First off, great plugin. Potentially the best for user profile pictures, if we can get a few issues fixed. I’m going to break them into a few posts for clarity.

    The first is a simple one. Focus/active styles are messed up, because the thumbnail img and wrapper a aren’t set to display:block. It’s a simple change in the PHP code:

    Line 371, 373, 377, and 378, where you are building the HTML, need to have display:block hardcoded.

    In the JS file though, I think the easiest was is a third helper function, that takes the stringified HTML, converts to a DOM object, adds the styles, and then returns as a string.

    function mt_display_block(htmlString) {
    		var temp = document.createElement('div');
    		temp.innerHTML = htmlString;
    		temp.firstElementChild.style.display = 'block';
    		temp.firstElementChild.firstElementChild.style.display = 'block';
    		return temp.innerHTML;
    	}

    Then:

    jQuery( "#metronet-profile-image" ).html( mt_display_block( response.thumb_html ) );

    https://wordpress.org/plugins/metronet-profile-picture/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter Andy Mercer

    (@kelderic)

    Second issues is what happens during the initial popup. Right now, the Media Manager opens to a default image that doesn’t exist . See:

    http://i.stack.imgur.com/1dJab.gif

    I’m not sure why this is happening, I’m going to dive into it to try and figure it out, but you might know better since you are more familiar with the code.

    Thread Starter Andy Mercer

    (@kelderic)

    Couple updates. First off, there are a few more places for issue one, where display block needs to be declared. Secondly, I’ve fixed the fake default problem.

    Short explanation: I couldn’t find exactly why it was happening, so I just simplified the media manager. I removed the special Featured Image state, and used defaults, limited with multiple:false. I also added a class that is added to the wrapper a called default-image, which better detects if the image is the default or not.

    Is there a Github mirror of this where I could create a pull request? Or could I email you a copy with my changes?

    Thread Starter Andy Mercer

    (@kelderic)

    Lastly, I think it would be great to add a filter where I could set it as a global option to hide the “Override Avatar” checkbox, and behave as if it is always checked.

    Sorry for the wall of text. I’m just excited about this plugin because it is better than similar ones that I’ve found. Would love to help get the last couple bugs fixed. 🙂

    Plugin Author Ronald Huereca

    (@ronalfy)

    Thanks so much. You’re welcome to do some pull requests if that’s your thing. Otherwise I’ll try to get to your fixes this week. https://github.com/ronalfy/user-profile-picture

    Plugin Author Ronald Huereca

    (@ronalfy)

    I have a filter already for the avatar override. https://wordpress.org/support/topic/hide-override-avatar-option?replies=4

    Thread Starter Andy Mercer

    (@kelderic)

    Was just coming back to say that I’d discovered the override filter. Thanks for the quick reply!

    Thread Starter Andy Mercer

    (@kelderic)

    I just submitted all code changes on the Github repo. Please let me know if you have any questions about why I made any changes.

    Plugin Author Ronald Huereca

    (@ronalfy)

    I’m going to do something slightly controversial and apply the override filter at a priority level 5 so people can override it. That way new users won’t even see the override avatar checkbox.

    Plugin Author Ronald Huereca

    (@ronalfy)

    Thanks a lot. Just pushed out 1.4.0 with your changes.

    Thread Starter Andy Mercer

    (@kelderic)

    Glad I could help, and I appreciate how quick you got the changes reviewed and pushed out!

    As to the override change, it makes more sense to me personally, though I understand how changing behavior can be controversial. Guess just wait and see if anyone mentions it as a problem.

    Thread Starter Andy Mercer

    (@kelderic)

    The only thing left that I can think of to improve would be moving the form itself down and replacing the native Profile section which isn’t editable.

    I looked through the core template file and there aren’t any hooks down there. Might be worth opening a trac ticket to add a filter. It would be even cooler if the default HTML was moved to a filterable function, so that the section itself could just be replaced by the better editable version.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Visual Bug and Fix’ is closed to new replies.