wpLink: support whole URLs including query/fragment when pre-filling the URL field. Fixes #19992
Built from https://develop.svn.wordpress.org/trunk@28828 git-svn-id: http://core.svn.wordpress.org/trunk@28632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c6ef7d05e0
commit
c8ce9e2815
|
@ -270,14 +270,14 @@ var wpLink;
|
|||
setDefaultValues: function() {
|
||||
var selection = editor && editor.selection.getContent(),
|
||||
emailRegexp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i,
|
||||
urlRegexp = /^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
|
||||
urlRegexp = /^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,4}[^ "]*$/i;
|
||||
|
||||
if ( selection && emailRegexp.test( selection ) ) {
|
||||
// Selection is email address
|
||||
inputs.url.val( 'mailto:' + selection );
|
||||
} else if ( selection && urlRegexp.test( selection ) ) {
|
||||
// Selection is URL
|
||||
inputs.url.val( selection );
|
||||
inputs.url.val( selection.replace( /&|�?38;/gi, '&' ) );
|
||||
} else {
|
||||
// Set URL to default.
|
||||
inputs.url.val( 'http://' );
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.0-alpha-20140624';
|
||||
$wp_version = '4.0-alpha-20140625';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue