Useful improvements to the user interface

Unfortunately, this doesn’t do anything for me if I save while the Visual tab shows.

I have SCRIPT_DEBUG set to true and have added the line document.dispatchEvent( new Event( 'scrollable' ) ); at line 346 in ~/wp-includes/js/mce-view.js and then added event listeners for the scrollable event inside script tags within ~/wp-includes/class-wp-editor.php (both within a document.addEventListener( 'DOMContentLoaded' event and outside it) and neither listener is hearing anything.

1 Like

Hm. Good point. Try to add galleries to your post for testing. I think, these is my mistake.

Sorry. I will try to fix those bugs tomorrow. But with the galleries the code works just fine. So you can see it in action.

Thank you for SCRIPT_DEBUG. Never heard about it. Useful feature.

I tried to find the appropriate event for my code. Looks like even WP developers use wait() with random magic numbers.

So, I created plugin with working example. It can save the scroll position + selection. And enable | disable it.

Link on Google Drive. I can’t upload .zip here for some reason.

Thanks. What most people do is create a repository on Github.

This doesn’t work for me. Is there something I need to do apart from activate this plugin?

1 Like

I never used Github to share my code. I’m not real developer.

On edit screen there is an option for activation scroll saving (where prev / next buttons). I think it’s the most logical way to implement such staff.

Feel free to modify or share this code, if you think it may be useful for someone else.

1 Like

I think you sell yourself short there.
Regardless, even if you just help out here some, setting yourself up at Github does make sense and the basic stuff is pretty simple. It makes helping and sharing a lot easier than posting code back and forth in a chat or forum.

2 Likes

Thank you. Maybe sometimes I will learn about Github more.

1 Like

I’ve just started using Git(hub) myself to work on ClassicPress and another group project, as I’ve previously only developed on my own. Once it was set up I’ve found it a great way to work.

You’ve got some great ideas and it will help you contribute them to ClassicPress more easily :slight_smile:

Found this recently that saves in any admin screen with a save button, and handles drafts too. It’s old but just JS so should be easy to assess for security etc

I have already tried it, and it doesn’t work. Threads on the wordpress.org forum report the same thing.