Skip to content

Instantly share code, notes, and snippets.

@timersys
Created May 13, 2015 13:48
Show Gist options
  • Select an option

  • Save timersys/49625ab231f0fa7d591c to your computer and use it in GitHub Desktop.

Select an option

Save timersys/49625ab231f0fa7d591c to your computer and use it in GitHub Desktop.
finxed tinymce
function TinyMceOptin() {
SPUP_ADMIN.spu_editor = $("#content_ifr").contents().find('html #tinymce');
var spu_box_container = false;
// If there is not content add some
var content = SPUP_ADMIN.spu_editor.text();
if( SPUP_ADMIN.spu_editor.find('.spu-box-container').length) {
spu_box_container = true;
content = SPUP_ADMIN.spu_editor.html();
}
if( content == '' ){
SPUP_ADMIN.spu_editor.html('<h2 style="text-align:center">Support us!</h2><p style="text-align:center">Subscribe to get the latest offers and deals!</p>')
}
//Add popup class if not exist
if( !spu_box_container ) {
SPUP_ADMIN.spu_editor.find('*').wrapAll('<div class="spu-box-container"/>');
}
// If we are using optin we need to add email field to form
if (spup_js.opts.optin) {
add_optin_form();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment