Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change div element containing action name to input element for easier selecting and copying #26

Open
salcode opened this issue Apr 5, 2017 · 3 comments

Comments

@salcode
Copy link
Contributor

salcode commented Apr 5, 2017

@srikat has suggest some interesting ideas with using an input field instead of a div, which makes it easier to copy the hook name.

Additionally, he suggested using JavaScript to select the entire hook name when the name is clicked.

As a proof of concept, he shared something like

printf( '<input class="genesis_hook" type="text" onclick="jQuery(this).select();" value="%s" />', $current_action );

Notes Regarding Final Implementation

  • the CSS will need to be modified (tests are showing a horizontal scroll bar but this can be fixed)
  • ultimately, using plain JavaScript over jQuery seems preferable ( probably not necessary but it feels tidier for a final version 😀 )
@srikat
Copy link

srikat commented Apr 6, 2017

I've created a simplified version of this plugin which displays all Genesis hooks dynamically, thanks to @salcode's code.

https://github.com/srikat/Genesis-Simple-Hook-Guide

@salcode
Copy link
Contributor Author

salcode commented Apr 6, 2017

@srikat I generally like your changes. My only note here is I think there is a lot of value in having a canonical version of this plugin.

@christophercochran I apologize for the flurry of activity. We all have found so much value in this plugin and appreciate your creating and sharing it.

@christophercochran
Copy link
Owner

christophercochran commented Apr 8, 2017

@salcode @srikat This is a very interesting idea. I actually never thought too much of this, cause usually a double click (due to names containing underscores) will auto select the entire hook.

My only concern is depending on themes and their own styles, the input form could become disjointed without a lot of overrides to maintain a cohesive style.

Also, @salcode No need to apologize! I love all this discussion and ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants