Current File : /home/k/a/r/karenpetzb/www/items/category/wordpress.tar |
plugin.js 0000644 00000102542 15071211776 0006413 0 ustar 00 /* global getUserSetting, setUserSetting */
( function( tinymce ) {
// Set the minimum value for the modals z-index higher than #wpadminbar (100000).
if ( ! tinymce.ui.FloatPanel.zIndex || tinymce.ui.FloatPanel.zIndex < 100100 ) {
tinymce.ui.FloatPanel.zIndex = 100100;
}
tinymce.PluginManager.add( 'wordpress', function( editor ) {
var wpAdvButton, style,
DOM = tinymce.DOM,
each = tinymce.each,
__ = editor.editorManager.i18n.translate,
$ = window.jQuery,
wp = window.wp,
hasWpautop = ( wp && wp.editor && wp.editor.autop && editor.getParam( 'wpautop', true ) ),
wpTooltips = false;
if ( $ ) {
// Runs as soon as TinyMCE has started initializing, while plugins are loading.
// Handlers attached after the `tinymce.init()` call may not get triggered for this instance.
$( document ).triggerHandler( 'tinymce-editor-setup', [ editor ] );
}
function toggleToolbars( state ) {
var initial, toolbars, iframeHeight,
pixels = 0,
classicBlockToolbar = tinymce.$( '.block-library-classic__toolbar' );
if ( state === 'hide' ) {
initial = true;
} else if ( classicBlockToolbar.length && ! classicBlockToolbar.hasClass( 'has-advanced-toolbar' ) ) {
// Show the second, third, etc. toolbar rows in the Classic block instance.
classicBlockToolbar.addClass( 'has-advanced-toolbar' );
state = 'show';
}
if ( editor.theme.panel ) {
toolbars = editor.theme.panel.find('.toolbar:not(.menubar)');
}
if ( toolbars && toolbars.length > 1 ) {
if ( ! state && toolbars[1].visible() ) {
state = 'hide';
}
each( toolbars, function( toolbar, i ) {
if ( i > 0 ) {
if ( state === 'hide' ) {
toolbar.hide();
pixels += 34;
} else {
toolbar.show();
pixels -= 34;
}
}
});
}
// Resize editor iframe, not needed for iOS and inline instances.
// Don't resize if the editor is in a hidden container.
if ( pixels && ! tinymce.Env.iOS && editor.iframeElement && editor.iframeElement.clientHeight ) {
iframeHeight = editor.iframeElement.clientHeight + pixels;
// Keep min-height.
if ( iframeHeight > 50 ) {
DOM.setStyle( editor.iframeElement, 'height', iframeHeight );
}
}
if ( ! initial ) {
if ( state === 'hide' ) {
setUserSetting( 'hidetb', '0' );
wpAdvButton && wpAdvButton.active( false );
} else {
setUserSetting( 'hidetb', '1' );
wpAdvButton && wpAdvButton.active( true );
}
}
editor.fire( 'wp-toolbar-toggle' );
}
// Add the kitchen sink button :)
editor.addButton( 'wp_adv', {
tooltip: 'Toolbar Toggle',
cmd: 'WP_Adv',
onPostRender: function() {
wpAdvButton = this;
wpAdvButton.active( getUserSetting( 'hidetb' ) === '1' );
}
});
// Hide the toolbars after loading.
editor.on( 'PostRender', function() {
if ( editor.getParam( 'wordpress_adv_hidden', true ) && getUserSetting( 'hidetb', '0' ) === '0' ) {
toggleToolbars( 'hide' );
} else {
tinymce.$( '.block-library-classic__toolbar' ).addClass( 'has-advanced-toolbar' );
}
});
editor.addCommand( 'WP_Adv', function() {
toggleToolbars();
});
editor.on( 'focus', function() {
window.wpActiveEditor = editor.id;
});
editor.on( 'BeforeSetContent', function( event ) {
var title;
if ( event.content ) {
if ( event.content.indexOf( '<!--more' ) !== -1 ) {
title = __( 'Read more...' );
event.content = event.content.replace( /<!--more(.*?)-->/g, function( match, moretext ) {
return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="more" data-wp-more-text="' + moretext + '" ' +
'class="wp-more-tag mce-wp-more" alt="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />';
});
}
if ( event.content.indexOf( '<!--nextpage-->' ) !== -1 ) {
title = __( 'Page break' );
event.content = event.content.replace( /<!--nextpage-->/g,
'<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" ' +
'alt="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' );
}
if ( event.load && event.format !== 'raw' ) {
if ( hasWpautop ) {
event.content = wp.editor.autop( event.content );
} else {
// Prevent creation of paragraphs out of multiple HTML comments.
event.content = event.content.replace( /-->\s+<!--/g, '--><!--' );
}
}
if ( event.content.indexOf( '<script' ) !== -1 || event.content.indexOf( '<style' ) !== -1 ) {
event.content = event.content.replace( /<(script|style)[^>]*>[\s\S]*?<\/\1>/g, function( match, tag ) {
return '<img ' +
'src="' + tinymce.Env.transparentSrc + '" ' +
'data-wp-preserve="' + encodeURIComponent( match ) + '" ' +
'data-mce-resize="false" ' +
'data-mce-placeholder="1" '+
'class="mce-object mce-object-' + tag + '" ' +
'width="20" height="20" '+
'alt="<' + tag + '>" ' +
'/>';
} );
}
}
});
editor.on( 'setcontent', function() {
// Remove spaces from empty paragraphs.
editor.$( 'p' ).each( function( i, node ) {
if ( node.innerHTML && node.innerHTML.length < 10 ) {
var html = tinymce.trim( node.innerHTML );
if ( ! html || html === ' ' ) {
node.innerHTML = ( tinymce.Env.ie && tinymce.Env.ie < 11 ) ? '' : '<br data-mce-bogus="1">';
}
}
} );
});
editor.on( 'PostProcess', function( event ) {
if ( event.get ) {
event.content = event.content.replace(/<img[^>]+>/g, function( image ) {
var match,
string,
moretext = '';
if ( image.indexOf( 'data-wp-more="more"' ) !== -1 ) {
if ( match = image.match( /data-wp-more-text="([^"]+)"/ ) ) {
moretext = match[1];
}
string = '<!--more' + moretext + '-->';
} else if ( image.indexOf( 'data-wp-more="nextpage"' ) !== -1 ) {
string = '<!--nextpage-->';
} else if ( image.indexOf( 'data-wp-preserve' ) !== -1 ) {
if ( match = image.match( / data-wp-preserve="([^"]+)"/ ) ) {
string = decodeURIComponent( match[1] );
}
}
return string || image;
});
}
});
// Display the tag name instead of img in element path.
editor.on( 'ResolveName', function( event ) {
var attr;
if ( event.target.nodeName === 'IMG' && ( attr = editor.dom.getAttrib( event.target, 'data-wp-more' ) ) ) {
event.name = attr;
}
});
// Register commands.
editor.addCommand( 'WP_More', function( tag ) {
var parent, html, title,
classname = 'wp-more-tag',
dom = editor.dom,
node = editor.selection.getNode(),
rootNode = editor.getBody();
tag = tag || 'more';
classname += ' mce-wp-' + tag;
title = tag === 'more' ? 'Read more...' : 'Next page';
title = __( title );
html = '<img src="' + tinymce.Env.transparentSrc + '" alt="' + title + '" class="' + classname + '" ' +
'data-wp-more="' + tag + '" data-mce-resize="false" data-mce-placeholder="1" />';
// Most common case.
if ( node === rootNode || ( node.nodeName === 'P' && node.parentNode === rootNode ) ) {
editor.insertContent( html );
return;
}
// Get the top level parent node.
parent = dom.getParent( node, function( found ) {
if ( found.parentNode && found.parentNode === rootNode ) {
return true;
}
return false;
}, editor.getBody() );
if ( parent ) {
if ( parent.nodeName === 'P' ) {
parent.appendChild( dom.create( 'p', null, html ).firstChild );
} else {
dom.insertAfter( dom.create( 'p', null, html ), parent );
}
editor.nodeChanged();
}
});
editor.addCommand( 'WP_Code', function() {
editor.formatter.toggle('code');
});
editor.addCommand( 'WP_Page', function() {
editor.execCommand( 'WP_More', 'nextpage' );
});
editor.addCommand( 'WP_Help', function() {
var access = tinymce.Env.mac ? __( 'Ctrl + Alt + letter:' ) : __( 'Shift + Alt + letter:' ),
meta = tinymce.Env.mac ? __( '⌘ + letter:' ) : __( 'Ctrl + letter:' ),
table1 = [],
table2 = [],
row1 = {},
row2 = {},
i1 = 0,
i2 = 0,
labels = editor.settings.wp_shortcut_labels,
header, html, dialog, $wrap;
if ( ! labels ) {
return;
}
function tr( row, columns ) {
var out = '<tr>';
var i = 0;
columns = columns || 1;
each( row, function( text, key ) {
out += '<td><kbd>' + key + '</kbd></td><td>' + __( text ) + '</td>';
i++;
});
while ( i < columns ) {
out += '<td></td><td></td>';
i++;
}
return out + '</tr>';
}
each ( labels, function( label, name ) {
var letter;
if ( label.indexOf( 'meta' ) !== -1 ) {
i1++;
letter = label.replace( 'meta', '' ).toLowerCase();
if ( letter ) {
row1[ letter ] = name;
if ( i1 % 2 === 0 ) {
table1.push( tr( row1, 2 ) );
row1 = {};
}
}
} else if ( label.indexOf( 'access' ) !== -1 ) {
i2++;
letter = label.replace( 'access', '' ).toLowerCase();
if ( letter ) {
row2[ letter ] = name;
if ( i2 % 2 === 0 ) {
table2.push( tr( row2, 2 ) );
row2 = {};
}
}
}
} );
// Add remaining single entries.
if ( i1 % 2 > 0 ) {
table1.push( tr( row1, 2 ) );
}
if ( i2 % 2 > 0 ) {
table2.push( tr( row2, 2 ) );
}
header = [ __( 'Letter' ), __( 'Action' ), __( 'Letter' ), __( 'Action' ) ];
header = '<tr><th>' + header.join( '</th><th>' ) + '</th></tr>';
html = '<div class="wp-editor-help">';
// Main section, default and additional shortcuts.
html = html +
'<h2>' + __( 'Default shortcuts,' ) + ' ' + meta + '</h2>' +
'<table class="wp-help-th-center fixed">' +
header +
table1.join('') +
'</table>' +
'<h2>' + __( 'Additional shortcuts,' ) + ' ' + access + '</h2>' +
'<table class="wp-help-th-center fixed">' +
header +
table2.join('') +
'</table>';
if ( editor.plugins.wptextpattern && ( ! tinymce.Env.ie || tinymce.Env.ie > 8 ) ) {
// Text pattern section.
html = html +
'<h2>' + __( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ) + '</h2>' +
'<table class="wp-help-th-center fixed">' +
tr({ '*': 'Bullet list', '1.': 'Numbered list' }) +
tr({ '-': 'Bullet list', '1)': 'Numbered list' }) +
'</table>';
html = html +
'<h2>' + __( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ) + '</h2>' +
'<table class="wp-help-single">' +
tr({ '>': 'Blockquote' }) +
tr({ '##': 'Heading 2' }) +
tr({ '###': 'Heading 3' }) +
tr({ '####': 'Heading 4' }) +
tr({ '#####': 'Heading 5' }) +
tr({ '######': 'Heading 6' }) +
tr({ '---': 'Horizontal line' }) +
'</table>';
}
// Focus management section.
html = html +
'<h2>' + __( 'Focus shortcuts:' ) + '</h2>' +
'<table class="wp-help-single">' +
tr({ 'Alt + F8': 'Inline toolbar (when an image, link or preview is selected)' }) +
tr({ 'Alt + F9': 'Editor menu (when enabled)' }) +
tr({ 'Alt + F10': 'Editor toolbar' }) +
tr({ 'Alt + F11': 'Elements path' }) +
'</table>' +
'<p>' + __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ) + '</p>';
html += '</div>';
dialog = editor.windowManager.open( {
title: editor.settings.classic_block_editor ? 'Classic Block Keyboard Shortcuts' : 'Keyboard Shortcuts',
items: {
type: 'container',
classes: 'wp-help',
html: html
},
buttons: {
text: 'Close',
onclick: 'close'
}
} );
if ( dialog.$el ) {
dialog.$el.find( 'div[role="application"]' ).attr( 'role', 'document' );
$wrap = dialog.$el.find( '.mce-wp-help' );
if ( $wrap[0] ) {
$wrap.attr( 'tabindex', '0' );
$wrap[0].focus();
$wrap.on( 'keydown', function( event ) {
// Prevent use of: page up, page down, end, home, left arrow, up arrow, right arrow, down arrow
// in the dialog keydown handler.
if ( event.keyCode >= 33 && event.keyCode <= 40 ) {
event.stopPropagation();
}
});
}
}
} );
editor.addCommand( 'WP_Medialib', function() {
if ( wp && wp.media && wp.media.editor ) {
wp.media.editor.open( editor.id );
}
});
// Register buttons.
editor.addButton( 'wp_more', {
tooltip: 'Insert Read More tag',
onclick: function() {
editor.execCommand( 'WP_More', 'more' );
}
});
editor.addButton( 'wp_page', {
tooltip: 'Page break',
onclick: function() {
editor.execCommand( 'WP_More', 'nextpage' );
}
});
editor.addButton( 'wp_help', {
tooltip: 'Keyboard Shortcuts',
cmd: 'WP_Help'
});
editor.addButton( 'wp_code', {
tooltip: 'Code',
cmd: 'WP_Code',
stateSelector: 'code'
});
// Insert->Add Media.
if ( wp && wp.media && wp.media.editor ) {
editor.addButton( 'wp_add_media', {
tooltip: 'Add Media',
icon: 'dashicon dashicons-admin-media',
cmd: 'WP_Medialib'
} );
editor.addMenuItem( 'add_media', {
text: 'Add Media',
icon: 'wp-media-library',
context: 'insert',
cmd: 'WP_Medialib'
});
}
// Insert "Read More...".
editor.addMenuItem( 'wp_more', {
text: 'Insert Read More tag',
icon: 'wp_more',
context: 'insert',
onclick: function() {
editor.execCommand( 'WP_More', 'more' );
}
});
// Insert "Next Page".
editor.addMenuItem( 'wp_page', {
text: 'Page break',
icon: 'wp_page',
context: 'insert',
onclick: function() {
editor.execCommand( 'WP_More', 'nextpage' );
}
});
editor.on( 'BeforeExecCommand', function(e) {
if ( tinymce.Env.webkit && ( e.command === 'InsertUnorderedList' || e.command === 'InsertOrderedList' ) ) {
if ( ! style ) {
style = editor.dom.create( 'style', {'type': 'text/css'},
'#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}');
}
editor.getDoc().head.appendChild( style );
}
});
editor.on( 'ExecCommand', function( e ) {
if ( tinymce.Env.webkit && style &&
( 'InsertUnorderedList' === e.command || 'InsertOrderedList' === e.command ) ) {
editor.dom.remove( style );
}
});
editor.on( 'init', function() {
var env = tinymce.Env,
bodyClass = ['mceContentBody'], // Back-compat for themes that use this in editor-style.css...
doc = editor.getDoc(),
dom = editor.dom;
if ( env.iOS ) {
dom.addClass( doc.documentElement, 'ios' );
}
if ( editor.getParam( 'directionality' ) === 'rtl' ) {
bodyClass.push('rtl');
dom.setAttrib( doc.documentElement, 'dir', 'rtl' );
}
dom.setAttrib( doc.documentElement, 'lang', editor.getParam( 'wp_lang_attr' ) );
if ( env.ie ) {
if ( parseInt( env.ie, 10 ) === 9 ) {
bodyClass.push('ie9');
} else if ( parseInt( env.ie, 10 ) === 8 ) {
bodyClass.push('ie8');
} else if ( env.ie < 8 ) {
bodyClass.push('ie7');
}
} else if ( env.webkit ) {
bodyClass.push('webkit');
}
bodyClass.push('wp-editor');
each( bodyClass, function( cls ) {
if ( cls ) {
dom.addClass( doc.body, cls );
}
});
// Remove invalid parent paragraphs when inserting HTML.
editor.on( 'BeforeSetContent', function( event ) {
if ( event.content ) {
event.content = event.content.replace( /<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)( [^>]*)?>/gi, '<$1$2>' )
.replace( /<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)>\s*<\/p>/gi, '</$1>' );
}
});
if ( $ ) {
// Run on DOM ready. Otherwise TinyMCE may initialize earlier and handlers attached
// on DOM ready of after the `tinymce.init()` call may not get triggered.
$( function() {
$( document ).triggerHandler( 'tinymce-editor-init', [editor] );
});
}
if ( window.tinyMCEPreInit && window.tinyMCEPreInit.dragDropUpload ) {
dom.bind( doc, 'dragstart dragend dragover drop', function( event ) {
if ( $ ) {
// Trigger the jQuery handlers.
$( document ).trigger( new $.Event( event ) );
}
});
}
if ( editor.getParam( 'wp_paste_filters', true ) ) {
editor.on( 'PastePreProcess', function( event ) {
// Remove trailing <br> added by WebKit browsers to the clipboard.
event.content = event.content.replace( /<br class="?Apple-interchange-newline"?>/gi, '' );
// In WebKit this is handled by removeWebKitStyles().
if ( ! tinymce.Env.webkit ) {
// Remove all inline styles.
event.content = event.content.replace( /(<[^>]+) style="[^"]*"([^>]*>)/gi, '$1$2' );
// Put back the internal styles.
event.content = event.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi, '$1 style=$2' );
}
});
editor.on( 'PastePostProcess', function( event ) {
// Remove empty paragraphs.
editor.$( 'p', event.node ).each( function( i, node ) {
if ( dom.isEmpty( node ) ) {
dom.remove( node );
}
});
if ( tinymce.isIE ) {
editor.$( 'a', event.node ).find( 'font, u' ).each( function( i, node ) {
dom.remove( node, true );
});
}
});
}
});
editor.on( 'SaveContent', function( event ) {
// If editor is hidden, we just want the textarea's value to be saved.
if ( ! editor.inline && editor.isHidden() ) {
event.content = event.element.value;
return;
}
// Keep empty paragraphs :(
event.content = event.content.replace( /<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g, '<p> </p>' );
if ( hasWpautop ) {
event.content = wp.editor.removep( event.content );
} else {
// Restore formatting of block boundaries.
event.content = event.content.replace( /-->\s*<!-- wp:/g, '-->\n\n<!-- wp:' );
}
});
editor.on( 'preInit', function() {
var validElementsSetting = '@[id|accesskey|class|dir|lang|style|tabindex|' +
'title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],' + // Global attributes.
'i,' + // Don't replace <i> with <em> and <b> with <strong> and don't remove them when empty.
'b,' +
'script[src|async|defer|type|charset|crossorigin|integrity]'; // Add support for <script>.
editor.schema.addValidElements( validElementsSetting );
if ( tinymce.Env.iOS ) {
editor.settings.height = 300;
}
each( {
c: 'JustifyCenter',
r: 'JustifyRight',
l: 'JustifyLeft',
j: 'JustifyFull',
q: 'mceBlockQuote',
u: 'InsertUnorderedList',
o: 'InsertOrderedList',
m: 'WP_Medialib',
t: 'WP_More',
d: 'Strikethrough',
p: 'WP_Page',
x: 'WP_Code'
}, function( command, key ) {
editor.shortcuts.add( 'access+' + key, '', command );
} );
editor.addShortcut( 'meta+s', '', function() {
if ( wp && wp.autosave ) {
wp.autosave.server.triggerSave();
}
} );
// Alt+Shift+Z removes a block in the block editor, don't add it to the Classic block.
if ( ! editor.settings.classic_block_editor ) {
editor.addShortcut( 'access+z', '', 'WP_Adv' );
}
// Workaround for not triggering the global help modal in the block editor by the Classic block shortcut.
editor.on( 'keydown', function( event ) {
var match;
if ( tinymce.Env.mac ) {
match = event.ctrlKey && event.altKey && event.code === 'KeyH';
} else {
match = event.shiftKey && event.altKey && event.code === 'KeyH';
}
if ( match ) {
editor.execCommand( 'WP_Help' );
event.stopPropagation();
event.stopImmediatePropagation();
return false;
}
return true;
});
if ( window.getUserSetting( 'editor_plain_text_paste_warning' ) > 1 ) {
editor.settings.paste_plaintext_inform = false;
}
// Change the editor iframe title on MacOS, add the correct help shortcut.
if ( tinymce.Env.mac ) {
tinymce.$( editor.iframeElement ).attr( 'title', __( 'Rich Text Area. Press Control-Option-H for help.' ) );
}
} );
editor.on( 'PastePlainTextToggle', function( event ) {
// Warn twice, then stop.
if ( event.state === true ) {
var times = parseInt( window.getUserSetting( 'editor_plain_text_paste_warning' ), 10 ) || 0;
if ( times < 2 ) {
window.setUserSetting( 'editor_plain_text_paste_warning', ++times );
}
}
});
editor.on( 'beforerenderui', function() {
if ( editor.theme.panel ) {
each( [ 'button', 'colorbutton', 'splitbutton' ], function( buttonType ) {
replaceButtonsTooltips( editor.theme.panel.find( buttonType ) );
} );
addShortcutsToListbox();
}
} );
function prepareTooltips() {
var access = 'Shift+Alt+';
var meta = 'Ctrl+';
wpTooltips = {};
// For MacOS: ctrl = \u2303, cmd = \u2318, alt = \u2325.
if ( tinymce.Env.mac ) {
access = '\u2303\u2325';
meta = '\u2318';
}
// Some tooltips are translated, others are not...
if ( editor.settings.wp_shortcut_labels ) {
each( editor.settings.wp_shortcut_labels, function( value, tooltip ) {
var translated = editor.translate( tooltip );
value = value.replace( 'access', access ).replace( 'meta', meta );
wpTooltips[ tooltip ] = value;
// Add the translated so we can match all of them.
if ( tooltip !== translated ) {
wpTooltips[ translated ] = value;
}
} );
}
}
function getTooltip( tooltip ) {
var translated = editor.translate( tooltip );
var label;
if ( ! wpTooltips ) {
prepareTooltips();
}
if ( wpTooltips.hasOwnProperty( translated ) ) {
label = wpTooltips[ translated ];
} else if ( wpTooltips.hasOwnProperty( tooltip ) ) {
label = wpTooltips[ tooltip ];
}
return label ? translated + ' (' + label + ')' : translated;
}
function replaceButtonsTooltips( buttons ) {
if ( ! buttons ) {
return;
}
each( buttons, function( button ) {
var tooltip;
if ( button && button.settings.tooltip ) {
tooltip = getTooltip( button.settings.tooltip );
button.settings.tooltip = tooltip;
// Override the aria label with the translated tooltip + shortcut.
if ( button._aria && button._aria.label ) {
button._aria.label = tooltip;
}
}
} );
}
function addShortcutsToListbox() {
// listbox for the "blocks" drop-down.
each( editor.theme.panel.find( 'listbox' ), function( listbox ) {
if ( listbox && listbox.settings.text === 'Paragraph' ) {
each( listbox.settings.values, function( item ) {
if ( item.text && wpTooltips.hasOwnProperty( item.text ) ) {
item.shortcut = '(' + wpTooltips[ item.text ] + ')';
}
} );
}
} );
}
/**
* Experimental: create a floating toolbar.
* This functionality will change in the next releases. Not recommended for use by plugins.
*/
editor.on( 'preinit', function() {
var Factory = tinymce.ui.Factory,
settings = editor.settings,
activeToolbar,
currentSelection,
timeout,
container = editor.getContainer(),
wpAdminbar = document.getElementById( 'wpadminbar' ),
mceIframe = document.getElementById( editor.id + '_ifr' ),
mceToolbar,
mceStatusbar,
wpStatusbar,
cachedWinSize;
if ( container ) {
mceToolbar = tinymce.$( '.mce-toolbar-grp', container )[0];
mceStatusbar = tinymce.$( '.mce-statusbar', container )[0];
}
if ( editor.id === 'content' ) {
wpStatusbar = document.getElementById( 'post-status-info' );
}
function create( buttons, bottom ) {
var toolbar,
toolbarItems = [],
buttonGroup;
each( buttons, function( item ) {
var itemName;
var tooltip;
function bindSelectorChanged() {
var selection = editor.selection;
if ( itemName === 'bullist' ) {
selection.selectorChanged( 'ul > li', function( state, args ) {
var i = args.parents.length,
nodeName;
while ( i-- ) {
nodeName = args.parents[ i ].nodeName;
if ( nodeName === 'OL' || nodeName == 'UL' ) {
break;
}
}
item.active( state && nodeName === 'UL' );
} );
}
if ( itemName === 'numlist' ) {
selection.selectorChanged( 'ol > li', function( state, args ) {
var i = args.parents.length,
nodeName;
while ( i-- ) {
nodeName = args.parents[ i ].nodeName;
if ( nodeName === 'OL' || nodeName === 'UL' ) {
break;
}
}
item.active( state && nodeName === 'OL' );
} );
}
if ( item.settings.stateSelector ) {
selection.selectorChanged( item.settings.stateSelector, function( state ) {
item.active( state );
}, true );
}
if ( item.settings.disabledStateSelector ) {
selection.selectorChanged( item.settings.disabledStateSelector, function( state ) {
item.disabled( state );
} );
}
}
if ( item === '|' ) {
buttonGroup = null;
} else {
if ( Factory.has( item ) ) {
item = {
type: item
};
if ( settings.toolbar_items_size ) {
item.size = settings.toolbar_items_size;
}
toolbarItems.push( item );
buttonGroup = null;
} else {
if ( ! buttonGroup ) {
buttonGroup = {
type: 'buttongroup',
items: []
};
toolbarItems.push( buttonGroup );
}
if ( editor.buttons[ item ] ) {
itemName = item;
item = editor.buttons[ itemName ];
if ( typeof item === 'function' ) {
item = item();
}
item.type = item.type || 'button';
if ( settings.toolbar_items_size ) {
item.size = settings.toolbar_items_size;
}
tooltip = item.tooltip || item.title;
if ( tooltip ) {
item.tooltip = getTooltip( tooltip );
}
item = Factory.create( item );
buttonGroup.items.push( item );
if ( editor.initialized ) {
bindSelectorChanged();
} else {
editor.on( 'init', bindSelectorChanged );
}
}
}
}
} );
toolbar = Factory.create( {
type: 'panel',
layout: 'stack',
classes: 'toolbar-grp inline-toolbar-grp',
ariaRoot: true,
ariaRemember: true,
items: [ {
type: 'toolbar',
layout: 'flow',
items: toolbarItems
} ]
} );
toolbar.bottom = bottom;
function reposition() {
if ( ! currentSelection ) {
return this;
}
var scrollX = window.pageXOffset || document.documentElement.scrollLeft,
scrollY = window.pageYOffset || document.documentElement.scrollTop,
windowWidth = window.innerWidth,
windowHeight = window.innerHeight,
iframeRect = mceIframe ? mceIframe.getBoundingClientRect() : {
top: 0,
right: windowWidth,
bottom: windowHeight,
left: 0,
width: windowWidth,
height: windowHeight
},
toolbar = this.getEl(),
toolbarWidth = toolbar.offsetWidth,
toolbarHeight = toolbar.clientHeight,
selection = currentSelection.getBoundingClientRect(),
selectionMiddle = ( selection.left + selection.right ) / 2,
buffer = 5,
spaceNeeded = toolbarHeight + buffer,
wpAdminbarBottom = wpAdminbar ? wpAdminbar.getBoundingClientRect().bottom : 0,
mceToolbarBottom = mceToolbar ? mceToolbar.getBoundingClientRect().bottom : 0,
mceStatusbarTop = mceStatusbar ? windowHeight - mceStatusbar.getBoundingClientRect().top : 0,
wpStatusbarTop = wpStatusbar ? windowHeight - wpStatusbar.getBoundingClientRect().top : 0,
blockedTop = Math.max( 0, wpAdminbarBottom, mceToolbarBottom, iframeRect.top ),
blockedBottom = Math.max( 0, mceStatusbarTop, wpStatusbarTop, windowHeight - iframeRect.bottom ),
spaceTop = selection.top + iframeRect.top - blockedTop,
spaceBottom = windowHeight - iframeRect.top - selection.bottom - blockedBottom,
editorHeight = windowHeight - blockedTop - blockedBottom,
className = '',
iosOffsetTop = 0,
iosOffsetBottom = 0,
top, left;
if ( spaceTop >= editorHeight || spaceBottom >= editorHeight ) {
this.scrolling = true;
this.hide();
this.scrolling = false;
return this;
}
// Add offset in iOS to move the menu over the image, out of the way of the default iOS menu.
if ( tinymce.Env.iOS && currentSelection.nodeName === 'IMG' ) {
iosOffsetTop = 54;
iosOffsetBottom = 46;
}
if ( this.bottom ) {
if ( spaceBottom >= spaceNeeded ) {
className = ' mce-arrow-up';
top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom;
} else if ( spaceTop >= spaceNeeded ) {
className = ' mce-arrow-down';
top = selection.top + iframeRect.top + scrollY - toolbarHeight + iosOffsetTop;
}
} else {
if ( spaceTop >= spaceNeeded ) {
className = ' mce-arrow-down';
top = selection.top + iframeRect.top + scrollY - toolbarHeight + iosOffsetTop;
} else if ( spaceBottom >= spaceNeeded && editorHeight / 2 > selection.bottom + iframeRect.top - blockedTop ) {
className = ' mce-arrow-up';
top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom;
}
}
if ( typeof top === 'undefined' ) {
top = scrollY + blockedTop + buffer + iosOffsetBottom;
}
left = selectionMiddle - toolbarWidth / 2 + iframeRect.left + scrollX;
if ( selection.left < 0 || selection.right > iframeRect.width ) {
left = iframeRect.left + scrollX + ( iframeRect.width - toolbarWidth ) / 2;
} else if ( toolbarWidth >= windowWidth ) {
className += ' mce-arrow-full';
left = 0;
} else if ( ( left < 0 && selection.left + toolbarWidth > windowWidth ) || ( left + toolbarWidth > windowWidth && selection.right - toolbarWidth < 0 ) ) {
left = ( windowWidth - toolbarWidth ) / 2;
} else if ( left < iframeRect.left + scrollX ) {
className += ' mce-arrow-left';
left = selection.left + iframeRect.left + scrollX;
} else if ( left + toolbarWidth > iframeRect.width + iframeRect.left + scrollX ) {
className += ' mce-arrow-right';
left = selection.right - toolbarWidth + iframeRect.left + scrollX;
}
// No up/down arrows on the menu over images in iOS.
if ( tinymce.Env.iOS && currentSelection.nodeName === 'IMG' ) {
className = className.replace( / ?mce-arrow-(up|down)/g, '' );
}
toolbar.className = toolbar.className.replace( / ?mce-arrow-[\w]+/g, '' ) + className;
DOM.setStyles( toolbar, {
'left': left,
'top': top
} );
return this;
}
toolbar.on( 'show', function() {
this.reposition();
} );
toolbar.on( 'keydown', function( event ) {
if ( event.keyCode === 27 ) {
this.hide();
editor.focus();
}
} );
editor.on( 'remove', function() {
toolbar.remove();
} );
toolbar.reposition = reposition;
toolbar.hide().renderTo( document.body );
return toolbar;
}
editor.shortcuts.add( 'alt+119', '', function() {
var node;
if ( activeToolbar ) {
node = activeToolbar.find( 'toolbar' )[0];
node && node.focus( true );
}
} );
editor.on( 'nodechange', function( event ) {
var collapsed = editor.selection.isCollapsed();
var args = {
element: event.element,
parents: event.parents,
collapsed: collapsed
};
editor.fire( 'wptoolbar', args );
currentSelection = args.selection || args.element;
if ( activeToolbar && activeToolbar !== args.toolbar ) {
activeToolbar.hide();
}
if ( args.toolbar ) {
activeToolbar = args.toolbar;
if ( activeToolbar.visible() ) {
activeToolbar.reposition();
} else {
activeToolbar.show();
}
} else {
activeToolbar = false;
}
} );
editor.on( 'focus', function() {
if ( activeToolbar ) {
activeToolbar.show();
}
} );
function hide( event ) {
var win;
var size;
if ( activeToolbar ) {
if ( activeToolbar.tempHide || event.type === 'hide' || event.type === 'blur' ) {
activeToolbar.hide();
activeToolbar = false;
} else if ( (
event.type === 'resizewindow' ||
event.type === 'scrollwindow' ||
event.type === 'resize' ||
event.type === 'scroll'
) && ! activeToolbar.blockHide ) {
/*
* Showing a tooltip may trigger a `resize` event in Chromium browsers.
* That results in a flicketing inline menu; tooltips are shown on hovering over a button,
* which then hides the toolbar on `resize`, then it repeats as soon as the toolbar is shown again.
*/
if ( event.type === 'resize' || event.type === 'resizewindow' ) {
win = editor.getWin();
size = win.innerHeight + win.innerWidth;
// Reset old cached size.
if ( cachedWinSize && ( new Date() ).getTime() - cachedWinSize.timestamp > 2000 ) {
cachedWinSize = null;
}
if ( cachedWinSize ) {
if ( size && Math.abs( size - cachedWinSize.size ) < 2 ) {
// `resize` fired but the window hasn't been resized. Bail.
return;
}
} else {
// First of a new series of `resize` events. Store the cached size and bail.
cachedWinSize = {
timestamp: ( new Date() ).getTime(),
size: size,
};
return;
}
}
clearTimeout( timeout );
timeout = setTimeout( function() {
if ( activeToolbar && typeof activeToolbar.show === 'function' ) {
activeToolbar.scrolling = false;
activeToolbar.show();
}
}, 250 );
activeToolbar.scrolling = true;
activeToolbar.hide();
}
}
}
if ( editor.inline ) {
editor.on( 'resizewindow', hide );
// Enable `capture` for the event.
// This will hide/reposition the toolbar on any scrolling in the document.
document.addEventListener( 'scroll', hide, true );
} else {
// Bind to the editor iframe and to the parent window.
editor.dom.bind( editor.getWin(), 'resize scroll', hide );
editor.on( 'resizewindow scrollwindow', hide );
}
editor.on( 'remove', function() {
document.removeEventListener( 'scroll', hide, true );
editor.off( 'resizewindow scrollwindow', hide );
editor.dom.unbind( editor.getWin(), 'resize scroll', hide );
} );
editor.on( 'blur hide', hide );
editor.wp = editor.wp || {};
editor.wp._createToolbar = create;
}, true );
function noop() {}
// Expose some functions (back-compat).
return {
_showButtons: noop,
_hideButtons: noop,
_setEmbed: noop,
_getEmbed: noop
};
});
}( window.tinymce ));
plugin.min.js 0000644 00000040027 15071211776 0007174 0 ustar 00 !function(k){(!k.ui.FloatPanel.zIndex||k.ui.FloatPanel.zIndex<100100)&&(k.ui.FloatPanel.zIndex=100100),k.PluginManager.add("wordpress",function(p){var a,t,E=k.DOM,m=k.each,u=p.editorManager.i18n.translate,i=window.jQuery,o=window.wp,r=o&&o.editor&&o.editor.autop&&p.getParam("wpautop",!0),s=!1;function e(n){var e,t,o=0,i=k.$(".block-library-classic__toolbar");"hide"===n?e=!0:i.length&&!i.hasClass("has-advanced-toolbar")&&(i.addClass("has-advanced-toolbar"),n="show"),(t=p.theme.panel?p.theme.panel.find(".toolbar:not(.menubar)"):t)&&1<t.length&&(!n&&t[1].visible()&&(n="hide"),m(t,function(e,t){0<t&&("hide"===n?(e.hide(),o+=34):(e.show(),o-=34))})),o&&!k.Env.iOS&&p.iframeElement&&p.iframeElement.clientHeight&&50<(i=p.iframeElement.clientHeight+o)&&E.setStyle(p.iframeElement,"height",i),e||("hide"===n?(setUserSetting("hidetb","0"),a&&a.active(!1)):(setUserSetting("hidetb","1"),a&&a.active(!0))),p.fire("wp-toolbar-toggle")}function d(e){var t,o,i,n=p.translate(e);return s||(o="Shift+Alt+",i="Ctrl+",s={},k.Env.mac&&(o="\u2303\u2325",i="\u2318"),p.settings.wp_shortcut_labels&&m(p.settings.wp_shortcut_labels,function(e,t){var n=p.translate(t);e=e.replace("access",o).replace("meta",i),s[t]=e,t!==n&&(s[n]=e)})),s.hasOwnProperty(n)?t=s[n]:s.hasOwnProperty(e)&&(t=s[e]),t?n+" ("+t+")":n}function n(){}return i&&i(document).triggerHandler("tinymce-editor-setup",[p]),p.addButton("wp_adv",{tooltip:"Toolbar Toggle",cmd:"WP_Adv",onPostRender:function(){(a=this).active("1"===getUserSetting("hidetb"))}}),p.on("PostRender",function(){p.getParam("wordpress_adv_hidden",!0)&&"0"===getUserSetting("hidetb","0")?e("hide"):k.$(".block-library-classic__toolbar").addClass("has-advanced-toolbar")}),p.addCommand("WP_Adv",function(){e()}),p.on("focus",function(){window.wpActiveEditor=p.id}),p.on("BeforeSetContent",function(e){var n;e.content&&(-1!==e.content.indexOf("\x3c!--more")&&(n=u("Read more..."),e.content=e.content.replace(/<!--more(.*?)-->/g,function(e,t){return'<img src="'+k.Env.transparentSrc+'" data-wp-more="more" data-wp-more-text="'+t+'" class="wp-more-tag mce-wp-more" alt="'+n+'" data-mce-resize="false" data-mce-placeholder="1" />'})),-1!==e.content.indexOf("\x3c!--nextpage--\x3e")&&(n=u("Page break"),e.content=e.content.replace(/<!--nextpage-->/g,'<img src="'+k.Env.transparentSrc+'" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" alt="'+n+'" data-mce-resize="false" data-mce-placeholder="1" />')),e.load&&"raw"!==e.format&&(e.content=r?o.editor.autop(e.content):e.content.replace(/-->\s+<!--/g,"--\x3e\x3c!--")),-1===e.content.indexOf("<script")&&-1===e.content.indexOf("<style")||(e.content=e.content.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(e,t){return'<img src="'+k.Env.transparentSrc+'" data-wp-preserve="'+encodeURIComponent(e)+'" data-mce-resize="false" data-mce-placeholder="1" class="mce-object mce-object-'+t+'" width="20" height="20" alt="<'+t+'>" />'})))}),p.on("setcontent",function(){p.$("p").each(function(e,t){var n;t.innerHTML&&t.innerHTML.length<10&&((n=k.trim(t.innerHTML))&&" "!==n||(t.innerHTML=k.Env.ie&&k.Env.ie<11?"":'<br data-mce-bogus="1">'))})}),p.on("PostProcess",function(e){e.get&&(e.content=e.content.replace(/<img[^>]+>/g,function(e){var t,n,o="";return-1!==e.indexOf('data-wp-more="more"')?n="\x3c!--more"+(o=(t=e.match(/data-wp-more-text="([^"]+)"/))?t[1]:o)+"--\x3e":-1!==e.indexOf('data-wp-more="nextpage"')?n="\x3c!--nextpage--\x3e":-1!==e.indexOf("data-wp-preserve")&&(t=e.match(/ data-wp-preserve="([^"]+)"/))&&(n=decodeURIComponent(t[1])),n||e}))}),p.on("ResolveName",function(e){var t;"IMG"===e.target.nodeName&&(t=p.dom.getAttrib(e.target,"data-wp-more"))&&(e.name=t)}),p.addCommand("WP_More",function(e){var t,n="wp-more-tag",o=p.dom,i=p.selection.getNode(),a=p.getBody();n+=" mce-wp-"+(e=e||"more"),t=u("more"===e?"Read more...":"Next page"),t='<img src="'+k.Env.transparentSrc+'" alt="'+t+'" class="'+n+'" data-wp-more="'+e+'" data-mce-resize="false" data-mce-placeholder="1" />',i===a||"P"===i.nodeName&&i.parentNode===a?p.insertContent(t):(n=o.getParent(i,function(e){return!(!e.parentNode||e.parentNode!==a)},p.getBody()))&&("P"===n.nodeName?n.appendChild(o.create("p",null,t).firstChild):o.insertAfter(o.create("p",null,t),n),p.nodeChanged())}),p.addCommand("WP_Code",function(){p.formatter.toggle("code")}),p.addCommand("WP_Page",function(){p.execCommand("WP_More","nextpage")}),p.addCommand("WP_Help",function(){var e,t=k.Env.mac?u("Ctrl + Alt + letter:"):u("Shift + Alt + letter:"),n=k.Env.mac?u("\u2318 + letter:"):u("Ctrl + letter:"),o=[],i=[],a={},r={},s=0,d=0,l=p.settings.wp_shortcut_labels;function c(e,t){var n="<tr>",o=0;for(t=t||1,m(e,function(e,t){n+="<td><kbd>"+t+"</kbd></td><td>"+u(e)+"</td>",o++});o<t;)n+="<td></td><td></td>",o++;return n+"</tr>"}l&&(m(l,function(e,t){var n;-1!==e.indexOf("meta")?(s++,(n=e.replace("meta","").toLowerCase())&&(a[n]=t,s%2==0)&&(o.push(c(a,2)),a={})):-1!==e.indexOf("access")&&(d++,n=e.replace("access","").toLowerCase())&&(r[n]=t,d%2==0)&&(i.push(c(r,2)),r={})}),0<s%2&&o.push(c(a,2)),0<d%2&&i.push(c(r,2)),l="<tr><th>"+(l=[u("Letter"),u("Action"),u("Letter"),u("Action")]).join("</th><th>")+"</th></tr>",e=(e='<div class="wp-editor-help">')+"<h2>"+u("Default shortcuts,")+" "+n+'</h2><table class="wp-help-th-center fixed">'+l+o.join("")+"</table><h2>"+u("Additional shortcuts,")+" "+t+'</h2><table class="wp-help-th-center fixed">'+l+i.join("")+"</table>",e=(e=p.plugins.wptextpattern&&(!k.Env.ie||8<k.Env.ie)?(e=e+"<h2>"+u("When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.")+'</h2><table class="wp-help-th-center fixed">'+c({"*":"Bullet list","1.":"Numbered list"})+c({"-":"Bullet list","1)":"Numbered list"})+"</table>")+"<h2>"+u("The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.")+'</h2><table class="wp-help-single">'+c({">":"Blockquote"})+c({"##":"Heading 2"})+c({"###":"Heading 3"})+c({"####":"Heading 4"})+c({"#####":"Heading 5"})+c({"######":"Heading 6"})+c({"---":"Horizontal line"})+"</table>":e)+"<h2>"+u("Focus shortcuts:")+'</h2><table class="wp-help-single">'+c({"Alt + F8":"Inline toolbar (when an image, link or preview is selected)"})+c({"Alt + F9":"Editor menu (when enabled)"})+c({"Alt + F10":"Editor toolbar"})+c({"Alt + F11":"Elements path"})+"</table><p>"+u("To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.")+"</p>",(n=p.windowManager.open({title:p.settings.classic_block_editor?"Classic Block Keyboard Shortcuts":"Keyboard Shortcuts",items:{type:"container",classes:"wp-help",html:e+="</div>"},buttons:{text:"Close",onclick:"close"}})).$el)&&(n.$el.find('div[role="application"]').attr("role","document"),(t=n.$el.find(".mce-wp-help"))[0])&&(t.attr("tabindex","0"),t[0].focus(),t.on("keydown",function(e){33<=e.keyCode&&e.keyCode<=40&&e.stopPropagation()}))}),p.addCommand("WP_Medialib",function(){o&&o.media&&o.media.editor&&o.media.editor.open(p.id)}),p.addButton("wp_more",{tooltip:"Insert Read More tag",onclick:function(){p.execCommand("WP_More","more")}}),p.addButton("wp_page",{tooltip:"Page break",onclick:function(){p.execCommand("WP_More","nextpage")}}),p.addButton("wp_help",{tooltip:"Keyboard Shortcuts",cmd:"WP_Help"}),p.addButton("wp_code",{tooltip:"Code",cmd:"WP_Code",stateSelector:"code"}),o&&o.media&&o.media.editor&&(p.addButton("wp_add_media",{tooltip:"Add Media",icon:"dashicon dashicons-admin-media",cmd:"WP_Medialib"}),p.addMenuItem("add_media",{text:"Add Media",icon:"wp-media-library",context:"insert",cmd:"WP_Medialib"})),p.addMenuItem("wp_more",{text:"Insert Read More tag",icon:"wp_more",context:"insert",onclick:function(){p.execCommand("WP_More","more")}}),p.addMenuItem("wp_page",{text:"Page break",icon:"wp_page",context:"insert",onclick:function(){p.execCommand("WP_More","nextpage")}}),p.on("BeforeExecCommand",function(e){!k.Env.webkit||"InsertUnorderedList"!==e.command&&"InsertOrderedList"!==e.command||(t=t||p.dom.create("style",{type:"text/css"},"#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}"),p.getDoc().head.appendChild(t))}),p.on("ExecCommand",function(e){k.Env.webkit&&t&&("InsertUnorderedList"===e.command||"InsertOrderedList"===e.command)&&p.dom.remove(t)}),p.on("init",function(){var e=k.Env,t=["mceContentBody"],n=p.getDoc(),o=p.dom;e.iOS&&o.addClass(n.documentElement,"ios"),"rtl"===p.getParam("directionality")&&(t.push("rtl"),o.setAttrib(n.documentElement,"dir","rtl")),o.setAttrib(n.documentElement,"lang",p.getParam("wp_lang_attr")),e.ie?9===parseInt(e.ie,10)?t.push("ie9"):8===parseInt(e.ie,10)?t.push("ie8"):e.ie<8&&t.push("ie7"):e.webkit&&t.push("webkit"),t.push("wp-editor"),m(t,function(e){e&&o.addClass(n.body,e)}),p.on("BeforeSetContent",function(e){e.content&&(e.content=e.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)( [^>]*)?>/gi,"<$1$2>").replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)>\s*<\/p>/gi,"</$1>"))}),i&&i(function(){i(document).triggerHandler("tinymce-editor-init",[p])}),window.tinyMCEPreInit&&window.tinyMCEPreInit.dragDropUpload&&o.bind(n,"dragstart dragend dragover drop",function(e){i&&i(document).trigger(new i.Event(e))}),p.getParam("wp_paste_filters",!0)&&(p.on("PastePreProcess",function(e){e.content=e.content.replace(/<br class="?Apple-interchange-newline"?>/gi,""),k.Env.webkit||(e.content=e.content.replace(/(<[^>]+) style="[^"]*"([^>]*>)/gi,"$1$2"),e.content=e.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi,"$1 style=$2"))}),p.on("PastePostProcess",function(e){p.$("p",e.node).each(function(e,t){o.isEmpty(t)&&o.remove(t)}),k.isIE&&p.$("a",e.node).find("font, u").each(function(e,t){o.remove(t,!0)})}))}),p.on("SaveContent",function(e){!p.inline&&p.isHidden()?e.content=e.element.value:(e.content=e.content.replace(/<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g,"<p> </p>"),e.content=r?o.editor.removep(e.content):e.content.replace(/-->\s*<!-- wp:/g,"--\x3e\n\n\x3c!-- wp:"))}),p.on("preInit",function(){p.schema.addValidElements("@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b,script[src|async|defer|type|charset|crossorigin|integrity]"),k.Env.iOS&&(p.settings.height=300),m({c:"JustifyCenter",r:"JustifyRight",l:"JustifyLeft",j:"JustifyFull",q:"mceBlockQuote",u:"InsertUnorderedList",o:"InsertOrderedList",m:"WP_Medialib",t:"WP_More",d:"Strikethrough",p:"WP_Page",x:"WP_Code"},function(e,t){p.shortcuts.add("access+"+t,"",e)}),p.addShortcut("meta+s","",function(){o&&o.autosave&&o.autosave.server.triggerSave()}),p.settings.classic_block_editor||p.addShortcut("access+z","","WP_Adv"),p.on("keydown",function(e){var t=k.Env.mac?e.ctrlKey&&e.altKey&&"KeyH"===e.code:e.shiftKey&&e.altKey&&"KeyH"===e.code;return!t||(p.execCommand("WP_Help"),e.stopPropagation(),e.stopImmediatePropagation(),!1)}),1<window.getUserSetting("editor_plain_text_paste_warning")&&(p.settings.paste_plaintext_inform=!1),k.Env.mac&&k.$(p.iframeElement).attr("title",u("Rich Text Area. Press Control-Option-H for help."))}),p.on("PastePlainTextToggle",function(e){!0===e.state&&(e=parseInt(window.getUserSetting("editor_plain_text_paste_warning"),10)||0)<2&&window.setUserSetting("editor_plain_text_paste_warning",++e)}),p.on("beforerenderui",function(){p.theme.panel&&(m(["button","colorbutton","splitbutton"],function(e){(e=p.theme.panel.find(e))&&m(e,function(e){var t;e&&e.settings.tooltip&&(t=d(e.settings.tooltip),e.settings.tooltip=t,e._aria)&&e._aria.label&&(e._aria.label=t)})}),m(p.theme.panel.find("listbox"),function(e){e&&"Paragraph"===e.settings.text&&m(e.settings.values,function(e){e.text&&s.hasOwnProperty(e.text)&&(e.shortcut="("+s[e.text]+")")})}))}),p.on("preinit",function(){var n,v,t,_,y,P,o,r=k.ui.Factory,s=p.settings,e=p.getContainer(),x=document.getElementById("wpadminbar"),C=document.getElementById(p.id+"_ifr");function i(e){if(n)if(n.tempHide||"hide"===e.type||"blur"===e.type)n.hide(),n=!1;else if(("resizewindow"===e.type||"scrollwindow"===e.type||"resize"===e.type||"scroll"===e.type)&&!n.blockHide){if("resize"===e.type||"resizewindow"===e.type){if(e=(e=p.getWin()).innerHeight+e.innerWidth,!(o=o&&2e3<(new Date).getTime()-o.timestamp?null:o))return void(o={timestamp:(new Date).getTime(),size:e});if(e&&Math.abs(e-o.size)<2)return}clearTimeout(t),t=setTimeout(function(){n&&"function"==typeof n.show&&(n.scrolling=!1,n.show())},250),n.scrolling=!0,n.hide()}}e&&(_=k.$(".mce-toolbar-grp",e)[0],y=k.$(".mce-statusbar",e)[0]),"content"===p.id&&(P=document.getElementById("post-status-info")),p.shortcuts.add("alt+119","",function(){var e;n&&(e=n.find("toolbar")[0])&&e.focus(!0)}),p.on("nodechange",function(e){var t=p.selection.isCollapsed(),e={element:e.element,parents:e.parents,collapsed:t};p.fire("wptoolbar",e),v=e.selection||e.element,n&&n!==e.toolbar&&n.hide(),e.toolbar?(n=e.toolbar).visible()?n.reposition():n.show():n=!1}),p.on("focus",function(){n&&n.show()}),p.inline?(p.on("resizewindow",i),document.addEventListener("scroll",i,!0)):(p.dom.bind(p.getWin(),"resize scroll",i),p.on("resizewindow scrollwindow",i)),p.on("remove",function(){document.removeEventListener("scroll",i,!0),p.off("resizewindow scrollwindow",i),p.dom.unbind(p.getWin(),"resize scroll",i)}),p.on("blur hide",i),p.wp=p.wp||{},p.wp._createToolbar=function(e,t){var n,o,a=[];return m(e,function(i){var t,e;function n(){var e=p.selection;"bullist"===t&&e.selectorChanged("ul > li",function(e,t){for(var n,o=t.parents.length;o--&&"OL"!==(n=t.parents[o].nodeName)&&"UL"!=n;);i.active(e&&"UL"===n)}),"numlist"===t&&e.selectorChanged("ol > li",function(e,t){for(var n,o=t.parents.length;o--&&"OL"!==(n=t.parents[o].nodeName)&&"UL"!==n;);i.active(e&&"OL"===n)}),i.settings.stateSelector&&e.selectorChanged(i.settings.stateSelector,function(e){i.active(e)},!0),i.settings.disabledStateSelector&&e.selectorChanged(i.settings.disabledStateSelector,function(e){i.disabled(e)})}"|"===i?o=null:r.has(i)?(i={type:i},s.toolbar_items_size&&(i.size=s.toolbar_items_size),a.push(i),o=null):(o||(o={type:"buttongroup",items:[]},a.push(o)),p.buttons[i]&&(t=i,(i="function"==typeof(i=p.buttons[t])?i():i).type=i.type||"button",s.toolbar_items_size&&(i.size=s.toolbar_items_size),(e=i.tooltip||i.title)&&(i.tooltip=d(e)),i=r.create(i),o.items.push(i),p.initialized?n():p.on("init",n)))}),(n=r.create({type:"panel",layout:"stack",classes:"toolbar-grp inline-toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:[{type:"toolbar",layout:"flow",items:a}]})).bottom=t,n.on("show",function(){this.reposition()}),n.on("keydown",function(e){27===e.keyCode&&(this.hide(),p.focus())}),p.on("remove",function(){n.remove()}),n.reposition=function(){var e,t,n,o,i,a,r,s,d,l,c,p,m,u,g,h,f,w,b;return v&&(e=window.pageXOffset||document.documentElement.scrollLeft,t=window.pageYOffset||document.documentElement.scrollTop,n=window.innerWidth,u=window.innerHeight,o=C?C.getBoundingClientRect():{top:0,right:n,bottom:u,left:0,width:n,height:u},a=(i=this.getEl()).offsetWidth,r=i.clientHeight,d=((s=v.getBoundingClientRect()).left+s.right)/2,l=r+5,c=x?x.getBoundingClientRect().bottom:0,b=_?_.getBoundingClientRect().bottom:0,p=y?u-y.getBoundingClientRect().top:0,m=P?u-P.getBoundingClientRect().top:0,c=Math.max(0,c,b,o.top),b=Math.max(0,p,m,u-o.bottom),p=s.top+o.top-c,m=u-o.top-s.bottom-b,g="",f=h=0,(u=u-c-b)<=p||u<=m?(this.scrolling=!0,this.hide(),this.scrolling=!1):(k.Env.iOS&&"IMG"===v.nodeName&&(h=54,f=46),this.bottom?l<=m?(g=" mce-arrow-up",w=s.bottom+o.top+t-f):l<=p&&(g=" mce-arrow-down",w=s.top+o.top+t-r+h):l<=p?(g=" mce-arrow-down",w=s.top+o.top+t-r+h):l<=m&&u/2>s.bottom+o.top-c&&(g=" mce-arrow-up",w=s.bottom+o.top+t-f),void 0===w&&(w=t+c+5+f),b=d-a/2+o.left+e,s.left<0||s.right>o.width?b=o.left+e+(o.width-a)/2:n<=a?(g+=" mce-arrow-full",b=0):b<0&&s.left+a>n||n<b+a&&s.right-a<0?b=(n-a)/2:b<o.left+e?(g+=" mce-arrow-left",b=s.left+o.left+e):b+a>o.width+o.left+e&&(g+=" mce-arrow-right",b=s.right-a+o.left+e),k.Env.iOS&&"IMG"===v.nodeName&&(g=g.replace(/ ?mce-arrow-(up|down)/g,"")),i.className=i.className.replace(/ ?mce-arrow-[\w]+/g,"")+g,E.setStyles(i,{left:b,top:w}))),this},n.hide().renderTo(document.body),n}},!0),{_showButtons:n,_hideButtons:n,_setEmbed:n,_getEmbed:n}})}(window.tinymce); images/style.svg 0000644 00000002754 15071323275 0007707 0 ustar 00 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path fill="#D5D5D5" d="M0 0h20v20H0z"/><path fill="#101517" d="m8.43 18.18-5.05-2.45v-.84l5.05-2.42v1.1l-3.9 1.74 3.9 1.77v1.1zM16.38 15.73l-5.05 2.45v-1.1l3.9-1.77-3.9-1.74v-1.1l5.05 2.42v.84zM7.25 2.1 6.89 3c-.35-.25-.89-.37-1.63-.37-.69 0-1.24.3-1.66.89-.41.6-.62 1.36-.62 2.3 0 .9.21 1.62.64 2.18a2 2 0 0 0 1.66.83c.73 0 1.3-.26 1.7-.78l.59.82c-.62.62-1.43.93-2.4.93-1.03 0-1.84-.37-2.43-1.11s-.9-1.72-.9-2.93c0-1.18.32-2.15.95-2.93s1.45-1.17 2.45-1.17c.85 0 1.52.14 2 .43zM8.45 9.31l.4-.98c.2.14.44.27.74.36.3.1.57.15.8.15.42 0 .76-.11 1.01-.34s.38-.52.38-.88c0-.26-.07-.5-.2-.73-.15-.23-.5-.48-1.07-.75l-.64-.3a2.53 2.53 0 0 1-1.12-.89 2.31 2.31 0 0 1-.32-1.24c0-.59.2-1.07.62-1.46s.95-.58 1.6-.58c.87 0 1.48.14 1.82.42l-.32.94c-.14-.1-.36-.2-.65-.3s-.57-.15-.82-.15A1.08 1.08 0 0 0 9.5 3.7a1.25 1.25 0 0 0 .43.96c.13.12.41.27.82.47l.65.31c.54.25.91.56 1.13.91.22.35.33.8.33 1.35 0 .59-.24 1.09-.72 1.5a2.8 2.8 0 0 1-1.9.62c-.7 0-1.3-.17-1.79-.5zM13.74 9.31l.4-.98c.2.14.44.27.74.36.3.1.57.15.8.15.43 0 .76-.11 1.02-.34s.38-.52.38-.88c0-.26-.07-.5-.21-.73-.15-.23-.5-.48-1.07-.75l-.63-.3a2.53 2.53 0 0 1-1.13-.88 2.31 2.31 0 0 1-.32-1.25c0-.58.2-1.07.62-1.46s.95-.58 1.6-.58c.88 0 1.48.15 1.82.43l-.32.93c-.14-.1-.36-.2-.65-.3s-.57-.15-.82-.15c-.36 0-.65.1-.86.32-.21.2-.32.47-.32.8a1.25 1.25 0 0 0 .43.96c.14.11.41.27.83.47l.64.3c.54.26.91.56 1.13.91.22.35.33.8.33 1.35 0 .59-.24 1.09-.72 1.5a2.8 2.8 0 0 1-1.9.62c-.7 0-1.3-.17-1.79-.5z"/></svg>