Editor: Fix JSHint errors after [41783].
See #42059. git-svn-id: https://develop.svn.wordpress.org/trunk@41785 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3c72ff101f
commit
944d28b6e4
|
@ -101,10 +101,10 @@ window.wp = window.wp || {};
|
||||||
|
|
||||||
var keepSelection = false;
|
var keepSelection = false;
|
||||||
if ( editor ) {
|
if ( editor ) {
|
||||||
keepSelection = editor.getParam( 'wp_keep_scroll_position' )
|
keepSelection = editor.getParam( 'wp_keep_scroll_position' );
|
||||||
} else {
|
} else {
|
||||||
keepSelection = window.tinyMCEPreInit.mceInit[ id ] &&
|
keepSelection = window.tinyMCEPreInit.mceInit[ id ] &&
|
||||||
window.tinyMCEPreInit.mceInit[ id ]['wp_keep_scroll_position']
|
window.tinyMCEPreInit.mceInit[ id ].wp_keep_scroll_position;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( keepSelection ) {
|
if ( keepSelection ) {
|
||||||
|
@ -321,7 +321,7 @@ window.wp = window.wp || {};
|
||||||
* @param {string} content The content we want to scan for shortcodes
|
* @param {string} content The content we want to scan for shortcodes
|
||||||
*/
|
*/
|
||||||
function getShortCodePositionsInText( content ) {
|
function getShortCodePositionsInText( content ) {
|
||||||
var allShortcodes = getShortcodesInText( content );
|
var allShortcodes = getShortcodesInText( content ), shortcodeInfo;
|
||||||
|
|
||||||
if ( allShortcodes.length === 0 ) {
|
if ( allShortcodes.length === 0 ) {
|
||||||
return [];
|
return [];
|
||||||
|
@ -348,15 +348,16 @@ window.wp = window.wp || {};
|
||||||
* In addition, if the shortcode will get rendered as plain text ( see above ),
|
* In addition, if the shortcode will get rendered as plain text ( see above ),
|
||||||
* we can treat it as text and use the selection markers in it.
|
* we can treat it as text and use the selection markers in it.
|
||||||
*/
|
*/
|
||||||
var isPreviewable = ! showAsPlainText && isShortcodePreviewable( shortcodeMatch[2] ),
|
var isPreviewable = ! showAsPlainText && isShortcodePreviewable( shortcodeMatch[2] );
|
||||||
shortcodeInfo = {
|
|
||||||
shortcodeName: shortcodeMatch[2],
|
shortcodeInfo = {
|
||||||
showAsPlainText: showAsPlainText,
|
shortcodeName: shortcodeMatch[2],
|
||||||
startIndex: shortcodeMatch.index,
|
showAsPlainText: showAsPlainText,
|
||||||
endIndex: shortcodeMatch.index + shortcodeMatch[0].length,
|
startIndex: shortcodeMatch.index,
|
||||||
length: shortcodeMatch[0].length,
|
endIndex: shortcodeMatch.index + shortcodeMatch[0].length,
|
||||||
isPreviewable: isPreviewable
|
length: shortcodeMatch[0].length,
|
||||||
};
|
isPreviewable: isPreviewable
|
||||||
|
};
|
||||||
|
|
||||||
shortcodesDetails.push( shortcodeInfo );
|
shortcodesDetails.push( shortcodeInfo );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue