Goal would be to have all functionality of Media without being dependent on WYSIWYG module. My impression from migrating over to D7 and trying WYSIWYG is that is quite immature and I have not found a satisfying configuration. And additionally, everything else in Media works more or less however it can't be accessed without the dependency.

The only thing needed is a paste button or a "copy embed code" text field in the Media Browser.

Comments

Scott J’s picture

Personally, I like http://drupal.org/project/BUEditor and it does let you easily define your own new buttons.

retrakker’s picture

Maybe I wasn't really clear with my request. As the Media module is using an input filter all I want is that the browser is giving me some sort of interface (i.e. a collapsible textarea or the like) for getting the media inline code. That wouldn't involve any editor but would instantaneously make the whole thing somehow usable.

safetypin’s picture

Perhaps this functionality could be included in a separate module, like the "Insert" module that allows image fields to be inserted into text areas without a WYSIWYG editor.

jpstrikesback’s picture

+1, this seems like a no brainer...

Edit:

To clarify, the minimal thing would be to just be able to:

1) Upload a media item
2a) Look at the pretty picture
2b) Look at the pretty (and oh so useful & copyable) text : [[{"type":"media","view_mode":"media_preview","fid":"3","attributes":{"alt":"","class":"media-image","typeof":"foaf:Image"}}]]

I'll see what I can do...

arthurf’s picture

Status: Active » Closed (works as designed)

@jpstrikesback - you should look at http://drupal.org/project/insert for examples of how to do this.

Closing issue as this should be handled in a separate module.

imp7’s picture

This media module is so awesome, I hope to see it working in other projects too, I would also like to see it work in BUEditor. Any pointers on where to start? Are you suggesting that we recreate a separate media browser to get media to work with BUEditor or any other external interface that is not WYSIWYG. Is there not some way we can use the existing code on a custom BUEditor button?

dave reid’s picture

Well the problem is we can't just keep integrating with every single thing out there - this is why having other WYSIWYG modules integrate with the WYSIWYG module itself is handy for other modules. Looks like I would support #429684: Add editor: BUEditor before we added a one-off custom WYSIWYG integration in Media.

imp7’s picture

Fair enough Dave, however having a framework where the media browser is able to be integrated into in different use cases besides wysiwyg would surely be a worthy goal. For instance I would also like to use media inside the markdown syntax, it works great atm, just need to figure out the best way to recreate the ui to choose the media. Any tips thoughts on this would be helpful. Thanks.

darksnow’s picture

I've copied some code from the media wysiwyg module and created a small piece of code which allows you to add code to the button editor in BUEditor.

Since you already include code to make media a wysiwyg plugin, I thought this was the logic place to but my code.

See the sandbox http://drupal.org/sandbox/darksnow/1877606 for the code (I'm testing on IE right now).

As Dave said above, it's perhaps not the place for media to support everything, and my code should be a separate module, but it's so trivial that I don't see it warranting another module install. I've seen it asked for here, and on other websites reviewing wysiwyg modules. They are saying that while BUEditor is not WYSIWYG it's a light weight alternative, and since is uses a real textarea instead of some JavaScript powered DIV, it works across mobile browsers too.

Given that, and the fact it's used on this very site, I was wondering if an exception could be made to add a small amount of code to support an important means of input.

Cheers.

Martin...

darksnow’s picture

I've tested this in IE7, Opera, Chrome and Firefox and it all seems to be working fine.

The media wysiwyg code creates an IMG tag in jQuery and extracts the attribute values from there, but there's loads of handling code to work around IE7 issues. I changed this idea to use a regular expression to extract the width and height explicitly. I think it simplifies the whole thing and is probably faster too. This change has been committed to the sandbox.

I'm still to test on IE8, IE9 and Safari but if it works in IE7 and Chrome I can't see it not working on the other two.

I'm ready to put this live on my own site so was wondering if anyone wants to incorporate it here or should I try and get this promoted to a live module? There's not much code to it really, so I thought another module was overkill.