mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
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:
parent
9029c07592
commit
eb878043a5
@ -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>
|
||||
|
@ -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',
|
||||
|
@ -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()))})});
|
Binary file not shown.
@ -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.
|
||||
|
2
wp-includes/js/wplink.min.js
vendored
2
wp-includes/js/wplink.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user