Вход Регистрация
Файл: wordpress/wp-includes/js/tinymce/plugins/wplink/plugin.js
Строк: 61
<?php
/* global tinymce */
tinymce.PluginManager.add'wplink', function( editor ) {
    
editor.addCommand'WP_Link', function() {
        
window.wpLink && window.wpLink.openeditor.id );
    });

    
// WP default shortcut
    
editor.addShortcut'Alt+Shift+A''''WP_Link' );
    
// The "de-facto standard" shortcut, see #27305
    
editor.addShortcut'Meta+K''''WP_Link' );

    
editor.addButton'link', {
        
icon'link',
        
tooltip'Insert/edit link',
        
cmd'WP_Link',
        
stateSelector'a[href]'
    
});

    
editor.addButton'unlink', {
        
icon'unlink',
        
tooltip'Remove link',
        
cmd'unlink'
    
});

    
editor.addMenuItem'link', {
        
icon'link',
        
text'Insert/edit link',
        
cmd'WP_Link',
        
stateSelector'a[href]',
        
context'insert',
        
prependToContexttrue
    
});

    
editor.on'pastepreprocess', function( event ) {
        var 
pastedStr event.content;

        if ( ! 
editor.selection.isCollapsed() ) {
            
pastedStr pastedStr.replace( /<[^>]+>/g'' );
            
pastedStr tinymce.trimpastedStr );

            if ( /^(?:
https?:)?//S+$/i.test( pastedStr ) ) {
                
editor.execCommand'mceInsertLink'false, {
                    
hrefeditor.dom.decodepastedStr )
                } );

                
event.preventDefault();
            }
        }
    } );
});
?>
Онлайн: 1
Реклама