The WordPress views system enables live previewing of certain shortcodes while editing a post. wp.mce.views is a set of utilities that simplifies adding custom UI within a TinyMCE editor. At its core, it serves as a series of converters, transforming text to a custom UI, and back again. The WordPress audio-playlist, video-playlist, audio embeds and video embeds are examples of WordPress views.
Important: Note that Wordpress 4.2 includes a major rewrite of the wp-views as described here
wp.mce.views.register( id, view-object )
A wp.mce.view instance is an extension (subclass) of the Backbone View type:
wp.mce.View.extend = Backbone.View.extend;
_.extend( wp.mce.View.prototype, { ... methods of wp.mce.View ... }
The methods of the view include:
render Renders all view nodes tied to this view instance that are not yet rendered.
getNodes Gets all view nodes tied to this view instance. Parameters:
setContent Sets the content for all view nodes tied to this view instance. Parameters:
setIframes Sets the content in an iframe for all view nodes tied to this view instance. Parameters:
For complete API see the source code.
wp.mce.views source is located in js/_enqueues/wp/mce-view.js
and output in `wp-includes/js/mce-view.js` during build.