installed plugin Subscribe2
version 10.35
This commit is contained in:
12
wp-content/plugins/subscribe2/tinymce/css/content.css
Normal file
12
wp-content/plugins/subscribe2/tinymce/css/content.css
Normal file
@ -0,0 +1,12 @@
|
||||
.mceSubscribe2
|
||||
{
|
||||
display: block;
|
||||
|
||||
width: 100%;
|
||||
height: 12px;
|
||||
margin-top: 15px;
|
||||
|
||||
border: 0;
|
||||
border-top: 1px;
|
||||
background: url(../../include/s2-marker.png) center top no-repeat #fff;
|
||||
}
|
108
wp-content/plugins/subscribe2/tinymce/editor-plugin4.js
Normal file
108
wp-content/plugins/subscribe2/tinymce/editor-plugin4.js
Normal file
@ -0,0 +1,108 @@
|
||||
/* global tinymce */
|
||||
|
||||
( function() {
|
||||
tinymce.create(
|
||||
'tinymce.plugins.Subscribe2Plugin',
|
||||
{
|
||||
init: function( ed, url ) {
|
||||
var i = 0,
|
||||
pb = '<p><img src="' + url + '/../include/spacer.gif" class="mceSubscribe2 mceItemNoResize" /></p>',
|
||||
cls = 'mceSubscribe2',
|
||||
shortcode = '[subscribe2]',
|
||||
pbreplaced = [],
|
||||
pbreplacedcount,
|
||||
pbRE = new RegExp( /(\[|<!--)subscribe2.*?(\]|-->)/g ),
|
||||
replacer = function( str ) {
|
||||
if ( -1 !== str.indexOf( 'class="mceSubscribe2' ) ) {
|
||||
str = pbreplaced[i];
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
// Register commands
|
||||
ed.addCommand(
|
||||
'mceSubscribe2',
|
||||
function() {
|
||||
ed.execCommand( 'mceInsertContent', 0, pb );
|
||||
}
|
||||
);
|
||||
|
||||
// Register buttons
|
||||
ed.addButton(
|
||||
'subscribe2',
|
||||
{
|
||||
title: 'Insert Subscribe2 Token',
|
||||
image: url + '/../include/s2-button.png',
|
||||
cmd: cls
|
||||
}
|
||||
);
|
||||
|
||||
// load the CSS and enable it on the right class
|
||||
ed.on(
|
||||
'init',
|
||||
function() {
|
||||
ed.dom.loadCSS( url + '/css/content.css' );
|
||||
|
||||
if ( ed.theme.onResolveName ) {
|
||||
ed.theme.onResolveName.add(
|
||||
function( th, o ) {
|
||||
if ( 'IMG' === o.node.nodeName && ed.dom.hasClass( o.node, cls ) ) {
|
||||
o.name = 'subscribe2';
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// create an array of replaced shortcodes so we have additional parameters
|
||||
// then swap in the graphic
|
||||
ed.on(
|
||||
'BeforeSetContent',
|
||||
function( ed ) {
|
||||
pbreplaced = ed.content.match( pbRE );
|
||||
ed.content = ed.content.replace( pbRE, pb );
|
||||
}
|
||||
);
|
||||
|
||||
// swap back the array of shortcodes to preserve parameters
|
||||
// replace any other instances with the default shortcode
|
||||
ed.on(
|
||||
'PostProcess',
|
||||
function( ed ) {
|
||||
if ( ed.get ) {
|
||||
if ( null !== pbreplaced ) {
|
||||
pbreplacedcount = pbreplaced.length;
|
||||
for ( i = 0; i < pbreplacedcount; i++ ) {
|
||||
ed.content = ed.content.replace( /<img[^>]+>/, replacer );
|
||||
}
|
||||
}
|
||||
ed.content = ed.content.replace(
|
||||
/<img[^>]+>/g,
|
||||
function( im ) {
|
||||
if ( -1 !== im.indexOf( 'class="mceSubscribe2' ) ) {
|
||||
im = shortcode;
|
||||
}
|
||||
return im;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
getInfo: function() {
|
||||
return {
|
||||
longname: 'Insert Subscribe2 Token',
|
||||
author: 'Matthew Robinson',
|
||||
authorurl: 'http://subscribe2.wordpress.com',
|
||||
infourl: 'http://subscribe2.wordpress.com',
|
||||
version: tinymce.majorVersion + '.' + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add( 'subscribe2', tinymce.plugins.Subscribe2Plugin );
|
||||
}() );
|
1
wp-content/plugins/subscribe2/tinymce/editor-plugin4.min.js
vendored
Normal file
1
wp-content/plugins/subscribe2/tinymce/editor-plugin4.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
tinymce.create("tinymce.plugins.Subscribe2Plugin",{init:function(e,n){var t,c=0,i='<p><img src="'+n+'/../include/spacer.gif" class="mceSubscribe2 mceItemNoResize" /></p>',o="mceSubscribe2",s=[],r=new RegExp(/(\[|<!--)subscribe2.*?(\]|-->)/g),u=function(e){return-1!==e.indexOf('class="mceSubscribe2')&&(e=s[c]),e};e.addCommand("mceSubscribe2",function(){e.execCommand("mceInsertContent",0,i)}),e.addButton("subscribe2",{title:"Insert Subscribe2 Token",image:n+"/../include/s2-button.png",cmd:o}),e.on("init",function(){e.dom.loadCSS(n+"/css/content.css"),e.theme.onResolveName&&e.theme.onResolveName.add(function(n,t){"IMG"===t.node.nodeName&&e.dom.hasClass(t.node,o)&&(t.name="subscribe2")})}),e.on("BeforeSetContent",function(e){s=e.content.match(r),e.content=e.content.replace(r,i)}),e.on("PostProcess",function(e){if(e.get){if(null!==s)for(t=s.length,c=0;c<t;c++)e.content=e.content.replace(/<img[^>]+>/,u);e.content=e.content.replace(/<img[^>]+>/g,function(e){return-1!==e.indexOf('class="mceSubscribe2')&&(e="[subscribe2]"),e})}})},getInfo:function(){return{longname:"Insert Subscribe2 Token",author:"Matthew Robinson",authorurl:"http://subscribe2.wordpress.com",infourl:"http://subscribe2.wordpress.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}}),tinymce.PluginManager.add("subscribe2",tinymce.plugins.Subscribe2Plugin);
|
Reference in New Issue
Block a user