TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
/* global tinymce */
|
2013-12-30 02:54:11 +01:00
|
|
|
tinymce.PluginManager.add('wpgallery', function( editor ) {
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
function replaceGalleryShortcodes( content ) {
|
|
|
|
return content.replace( /\[gallery([^\]]*)\]/g, function( match ) {
|
2014-02-13 21:13:13 +01:00
|
|
|
return html( 'wp-gallery', match );
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2014-02-13 21:13:13 +01:00
|
|
|
function html( cls, data ) {
|
|
|
|
data = window.encodeURIComponent( data );
|
|
|
|
return '<img src="' + tinymce.Env.transparentSrc + '" class="wp-media mceItem ' + cls + '" ' +
|
|
|
|
'data-wp-media="' + data + '" data-mce-resize="false" data-mce-placeholder="1" />';
|
|
|
|
}
|
|
|
|
|
|
|
|
function replaceCallback( match, type, close ) {
|
|
|
|
var index;
|
|
|
|
|
|
|
|
if ( close && close.indexOf( '[' + type ) > -1 ) {
|
|
|
|
index = match.length - close.length;
|
|
|
|
return html( 'wp-' + type, match.substring( 0, index ) ) + match.substring( index );
|
|
|
|
}
|
|
|
|
|
|
|
|
return html( 'wp-' + type, match );
|
|
|
|
}
|
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
function replaceAVShortcodes( content ) {
|
2014-02-24 19:08:16 +01:00
|
|
|
var testRegex = /\[(video-playlist|audio|video|playlist)[^\]]*\]/,
|
|
|
|
replaceRegex = /\[(video-playlist|audio|video|playlist)[^\]]*\]([\s\S]*?\[\/\1\])?/;
|
2014-02-13 06:10:11 +01:00
|
|
|
|
2014-02-13 21:13:13 +01:00
|
|
|
while ( testRegex.test( content ) ) {
|
|
|
|
content = content.replace( replaceRegex, replaceCallback );
|
|
|
|
}
|
|
|
|
|
|
|
|
return content;
|
2014-02-13 06:10:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function restoreMediaShortcodes( content ) {
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
function getAttr( str, name ) {
|
2014-02-13 06:10:11 +01:00
|
|
|
name = new RegExp( name + '=\"([^\"]+)\"' ).exec( str );
|
|
|
|
return name ? window.decodeURIComponent( name[1] ) : '';
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
}
|
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
return content.replace( /(?:<p(?: [^>]+)?>)*(<img [^>]+>)(?:<\/p>)*/g, function( match, image ) {
|
|
|
|
var data = getAttr( image, 'data-wp-media' );
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
if ( data ) {
|
|
|
|
return '<p>' + data + '</p>';
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return match;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
function editMedia( node ) {
|
|
|
|
var gallery, frame, data;
|
|
|
|
|
|
|
|
if ( node.nodeName !== 'IMG' ) {
|
|
|
|
return;
|
|
|
|
}
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
|
2014-03-05 08:01:14 +01:00
|
|
|
// Check if the `wp.media` API exists.
|
2014-02-24 19:08:16 +01:00
|
|
|
if ( typeof wp === 'undefined' || ! wp.media ) {
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-03-05 16:06:14 +01:00
|
|
|
data = window.decodeURIComponent( editor.dom.getAttrib( node, 'data-wp-media' ) );
|
|
|
|
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
// Make sure we've selected a gallery node.
|
2014-02-24 19:08:16 +01:00
|
|
|
if ( editor.dom.hasClass( node, 'wp-gallery' ) && wp.media.gallery ) {
|
2014-02-13 06:10:11 +01:00
|
|
|
gallery = wp.media.gallery;
|
|
|
|
frame = gallery.edit( data );
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
|
|
|
|
frame.state('gallery-edit').on( 'update', function( selection ) {
|
2014-02-13 06:10:11 +01:00
|
|
|
var shortcode = gallery.shortcode( selection ).string();
|
|
|
|
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
2014-02-25 22:03:15 +01:00
|
|
|
frame.detach();
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
});
|
2014-02-24 19:08:16 +01:00
|
|
|
} else if ( editor.dom.hasClass( node, 'wp-playlist' ) && wp.media.playlist ) {
|
|
|
|
frame = wp.media.playlist.edit( data );
|
|
|
|
|
|
|
|
frame.state('playlist-edit').on( 'update', function( selection ) {
|
|
|
|
var shortcode = wp.media.playlist.shortcode( selection ).string();
|
|
|
|
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
2014-02-25 22:03:15 +01:00
|
|
|
frame.detach();
|
2014-02-24 19:08:16 +01:00
|
|
|
});
|
|
|
|
} else if ( editor.dom.hasClass( node, 'wp-video-playlist' ) && wp.media['video-playlist'] ) {
|
|
|
|
frame = wp.media['video-playlist'].edit( data );
|
|
|
|
|
|
|
|
frame.state('video-playlist-edit').on( 'update', function( selection ) {
|
|
|
|
var shortcode = wp.media['video-playlist'].shortcode( selection ).string();
|
|
|
|
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
2014-02-25 22:03:15 +01:00
|
|
|
frame.detach();
|
2014-02-24 19:08:16 +01:00
|
|
|
});
|
2014-03-05 16:06:14 +01:00
|
|
|
} else if ( editor.dom.hasClass( node, 'wp-video' ) ) {
|
|
|
|
frame = wp.media.video.edit( data );
|
2014-03-06 20:06:16 +01:00
|
|
|
frame.on( 'close', function () {
|
|
|
|
frame.detach();
|
|
|
|
} );
|
2014-03-05 16:06:14 +01:00
|
|
|
frame.state( 'video-details' ).on( 'update replace', function ( selection ) {
|
|
|
|
var shortcode = wp.media.video.shortcode( selection );
|
|
|
|
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
2014-03-06 20:06:16 +01:00
|
|
|
frame.detach();
|
2014-03-05 16:06:14 +01:00
|
|
|
} );
|
|
|
|
frame.open();
|
|
|
|
} else if ( editor.dom.hasClass( node, 'wp-audio' ) ) {
|
|
|
|
frame = wp.media.audio.edit( data );
|
2014-03-06 20:06:16 +01:00
|
|
|
frame.on( 'close', function () {
|
|
|
|
frame.detach();
|
|
|
|
} );
|
2014-03-05 16:06:14 +01:00
|
|
|
frame.state( 'audio-details' ).on( 'update replace', function ( selection ) {
|
|
|
|
var shortcode = wp.media.audio.shortcode( selection );
|
|
|
|
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
2014-03-06 20:06:16 +01:00
|
|
|
frame.detach();
|
2014-03-05 16:06:14 +01:00
|
|
|
} );
|
|
|
|
frame.open();
|
2014-02-13 06:10:11 +01:00
|
|
|
} else {
|
|
|
|
// temp
|
2014-03-05 16:06:14 +01:00
|
|
|
window.console && window.console.log( 'Edit AV shortcode ' + data );
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
}
|
2014-02-13 06:10:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
|
|
|
|
editor.addCommand( 'WP_Gallery', function() {
|
|
|
|
editMedia( editor.selection.getNode() );
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
});
|
|
|
|
/*
|
|
|
|
editor.on( 'init', function( e ) {
|
|
|
|
// _createButtons()
|
|
|
|
|
|
|
|
// iOS6 doesn't show the buttons properly on click, show them on 'touchstart'
|
|
|
|
if ( 'ontouchstart' in window ) {
|
|
|
|
editor.dom.events.bind( editor.getBody(), 'touchstart', function( e ) {
|
|
|
|
var target = e.target;
|
|
|
|
|
|
|
|
if ( target.nodeName == 'IMG' && editor.dom.hasClass( target, 'wp-gallery' ) ) {
|
|
|
|
editor.selection.select( target );
|
|
|
|
editor.dom.events.cancel( e );
|
|
|
|
editor.plugins.wordpress._hideButtons();
|
|
|
|
editor.plugins.wordpress._showButtons( target, 'wp_gallerybtns' );
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
*/
|
2014-02-13 06:10:11 +01:00
|
|
|
editor.on( 'mouseup', function( event ) {
|
|
|
|
var dom = editor.dom,
|
|
|
|
node = event.target;
|
|
|
|
|
2014-02-13 21:13:13 +01:00
|
|
|
function unselect() {
|
|
|
|
dom.removeClass( dom.select( 'img.wp-media-selected' ), 'wp-media-selected' );
|
|
|
|
}
|
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
if ( node.nodeName === 'IMG' && dom.getAttrib( node, 'data-wp-media' ) ) {
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
// Don't trigger on right-click
|
2014-02-13 06:10:11 +01:00
|
|
|
if ( event.button !== 2 ) {
|
|
|
|
if ( dom.hasClass( node, 'wp-media-selected' ) ) {
|
|
|
|
editMedia( node );
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
} else {
|
2014-02-13 21:13:13 +01:00
|
|
|
unselect();
|
2014-02-13 06:10:11 +01:00
|
|
|
dom.addClass( node, 'wp-media-selected' );
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2014-02-13 21:13:13 +01:00
|
|
|
unselect();
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
// Display gallery, audio or video instead of img in the element path
|
|
|
|
editor.on( 'ResolveName', function( event ) {
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
var dom = editor.dom,
|
2014-02-13 06:10:11 +01:00
|
|
|
node = event.target;
|
|
|
|
|
|
|
|
if ( node.nodeName === 'IMG' && dom.getAttrib( node, 'data-wp-media' ) ) {
|
|
|
|
if ( dom.hasClass( node, 'wp-gallery' ) ) {
|
|
|
|
event.name = 'gallery';
|
|
|
|
} else if ( dom.hasClass( node, 'wp-video' ) ) {
|
|
|
|
event.name = 'video';
|
|
|
|
} else if ( dom.hasClass( node, 'wp-audio' ) ) {
|
|
|
|
event.name = 'audio';
|
2014-02-24 19:08:16 +01:00
|
|
|
} else if ( dom.hasClass( node, 'wp-playlist' ) ) {
|
|
|
|
event.name = 'playlist';
|
|
|
|
} else if ( dom.hasClass( node, 'wp-video-playlist' ) ) {
|
|
|
|
event.name = 'video-playlist';
|
2014-02-13 06:10:11 +01:00
|
|
|
}
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
editor.on( 'BeforeSetContent', function( event ) {
|
2014-03-05 08:01:14 +01:00
|
|
|
// 'wpview' handles the gallery shortcode when present
|
|
|
|
if ( ! editor.plugins.wpview ) {
|
|
|
|
event.content = replaceGalleryShortcodes( event.content );
|
|
|
|
}
|
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
event.content = replaceAVShortcodes( event.content );
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
});
|
|
|
|
|
2014-02-13 06:10:11 +01:00
|
|
|
editor.on( 'PostProcess', function( event ) {
|
|
|
|
if ( event.get ) {
|
|
|
|
event.content = restoreMediaShortcodes( event.content );
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876
git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-29 00:53:15 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|