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

Rewrite - Standalone frame #582

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open

Conversation

mattheu
Copy link
Contributor

@mattheu mattheu commented Feb 29, 2016

Following some of the feedback we've had, I've pulled the 'Add post element' menu item out of the 'add media' modal, and into its own frame.

This is a bit of a big change, but would be interested to get some feedback on it.

From a UX perspective, I like it. Code wise, I like this too. Feels quite neat.

Heres a rundown of the changes.

  • Backwards compatibility - should be good, unless you're doing a lot of custom stuff.
  • Consolidate views/shortcode-ui.js and views/media-frame.js into a single view. These were too tightly coupled and couldn't really be used independently of one another.
  • The code for the new frame very closely follows the code for the core MediaFrame.
  • The new frame can now be used anywhere, and is not really coupled with TinyMCE. I've allowed you to pass a custom insertCallback to do whatever you need. You would of course need to do a bunch of stuff yourself such as preview, edit, buttons etc. But theoretically its possible.
  • Cleanup of code. Tried to trim it all down, and reuse some core stuff as much as possible.

Despite the complete rewrite of the media-frame code, it should still function very much as before.

NOTE - this DIFF is massive. But i've got a few other pull requests that can go in before this and will make it much more readable.

@mattheu mattheu added this to the v0.7.0 milestone Mar 2, 2016

// Path to WordPress install. Either absoloute or relative to this plugin.
// Change this by passing --abspath="new/path" as a grunt option.
var abspath = grunt.option( "abspath" ) ? grunt.option( "abspath" ) : '/tmp/wordpress';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to sniff the WP_DEVELOP_DIR environment variable too, so it works interchangeably with how PHPUnit tests work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this too. Prioritiy is

  1. If passing abspath use that. (Allows running tests without setting up full test install)
  2. If environment var defined use that
  3. Else use /tmp/wordpress

@danielbachhuber
Copy link
Contributor

Lot of code changing here :) I'll check it out locally sometime in the next week or so to give it more of a click-through.

For common reference, can you share some screenshots or GIFs of how it looks?

@mattheu
Copy link
Contributor Author

mattheu commented Mar 3, 2016

Yes this is a big one :)

He'res a little video: https://www.youtube.com/watch?v=QOAlpes9rz8

Note - it includes the code from this which can go in first and is also fairly large: #581

@mattheu mattheu removed this from the v0.7.0 milestone Oct 31, 2016
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

Successfully merging this pull request may close these issues.

2 participants