wpLink: change the text label to Link text, always focus the URK field, fix Ctrl/Cmd + K shortcut. See #28206.

Built from https://develop.svn.wordpress.org/trunk@31714


git-svn-id: http://core.svn.wordpress.org/trunk@31695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-03-11 03:01:27 +00:00
parent 9029c07592
commit eb878043a5
7 changed files with 7 additions and 13 deletions

View File

@ -1449,7 +1449,7 @@ final class _WP_Editors {
<div id="link-options">
<p class="howto"><?php _e( 'Enter the destination URL' ); ?></p>
<div class="wp-link-text-field">
<label><span><?php _e( 'Text' ); ?></span><input id="wp-link-text" type="text" /></label>
<label><span><?php _e( 'Link text' ); ?></span><input id="wp-link-text" type="text" /></label>
</div>
<div>
<label><span><?php _e( 'URL' ); ?></span><input id="wp-link-url" type="text" /></label>

View File

@ -5,14 +5,13 @@ tinymce.PluginManager.add( 'wplink', function( editor ) {
});
// WP default shortcut
editor.addShortcut( 'alt+shift+a', '', 'WP_Link' );
editor.addShortcut( 'Alt+Shift+A', '', 'WP_Link' );
// The "de-facto standard" shortcut, see #27305
editor.addShortcut( 'ctrl+k', '', 'WP_Link' );
editor.addShortcut( 'Meta+K', '', 'WP_Link' );
editor.addButton( 'link', {
icon: 'link',
tooltip: 'Insert/edit link',
shortcut: 'Alt+Shift+A',
cmd: 'WP_Link',
stateSelector: 'a[href]'
});
@ -26,7 +25,6 @@ tinymce.PluginManager.add( 'wplink', function( editor ) {
editor.addMenuItem( 'link', {
icon: 'link',
text: 'Insert link',
shortcut: 'Alt+Shift+A',
cmd: 'WP_Link',
stateSelector: 'a[href]',
context: 'insert',

View File

@ -1 +1 @@
tinymce.PluginManager.add("wplink",function(a){a.addCommand("WP_Link",function(){window.wpLink&&window.wpLink.open(a.id)}),a.addShortcut("alt+shift+a","","WP_Link"),a.addShortcut("ctrl+k","","WP_Link"),a.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Alt+Shift+A",cmd:"WP_Link",stateSelector:"a[href]"}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink"}),a.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Alt+Shift+A",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0}),a.on("pastepreprocess",function(b){var c=b.content;a.selection.isCollapsed()||(c=c.replace(/<[^>]+>/g,""),c=tinymce.trim(c),/^(?:https?:)?\/\/\S+$/i.test(c)&&(a.execCommand("mceInsertLink",!1,{href:a.dom.decode(c)}),b.preventDefault()))})});
tinymce.PluginManager.add("wplink",function(a){a.addCommand("WP_Link",function(){window.wpLink&&window.wpLink.open(a.id)}),a.addShortcut("Alt+Shift+A","","WP_Link"),a.addShortcut("Meta+K","","WP_Link"),a.addButton("link",{icon:"link",tooltip:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]"}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink"}),a.addMenuItem("link",{icon:"link",text:"Insert link",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0}),a.on("pastepreprocess",function(b){var c=b.content;a.selection.isCollapsed()||(c=c.replace(/<[^>]+>/g,""),c=tinymce.trim(c),/^(?:https?:)?\/\/\S+$/i.test(c)&&(a.execCommand("mceInsertLink",!1,{href:a.dom.decode(c)}),b.preventDefault()))})});

View File

@ -161,11 +161,7 @@ var wpLink;
// Focus the URL field and highlight its contents.
// If this is moved above the selection changes,
// IE will show a flashing cursor over the dialog.
if ( inputs.wrap.hasClass( 'has-text-field' ) ) {
inputs.text.focus();
} else {
inputs.url.focus()[0].select();
}
inputs.url.focus()[0].select();
}
// Load the most recent results if this is the first time opening the panel.

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31713';
$wp_version = '4.2-alpha-31714';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.