| Server IP : 52.25.153.185 / Your IP : 216.73.217.131 Web Server : Apache System : Linux ip-172-26-6-158 5.10.0-35-cloud-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64 User : daemon ( 1) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/testify/js/ |
Upload File : |
// This file was modified by Jonathan Hall, Dominika Rauk, Coulter Peterson and/or others; last modified 2020-09-02
/*! @license
* plugin.js
*
* Released under GNU General Public License version 3.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
/*global tinymce:true */
var testifyMCEEditor;
tinymce.PluginManager.add('testify', function(editor) {
editor.addCommand('InsertTestifyTestimonials', function() {
testifyMCEEditor = this;
jQuery('<a>')
.attr('href', ajaxurl + '?action=testify_shortcode_dialog&nonce=' + tinyMCEPreInit.mceInit.content.testify_shortcode_dialog_nonce)
.modal({});
/*jQuery.post(ajaxurl, {
action: 'testify_shortcode_dialog',
nonce: tinyMCEPreInit.mceInit.content.testify_shortcode_dialog_nonce,
}, function(data) {
if (data.dialog_html) {
jQuery('<div>').html(data.dialog_html).modal({
});
}
}, 'json');*/
});
var imgUrl = tinymce.PluginManager.urls.testify;
//imgUrl = imgUrl.substr(0, imgUrl.lastIndexOf('/', imgUrl.lastIndexOf('/') - 1));
imgUrl = imgUrl.substr(0, imgUrl.lastIndexOf('/'));
imgUrl += '/img/testify-icon.svg';
editor.addButton('testify', {
image: imgUrl,
tooltip: 'Insert Testify Testimonials shortcode',
cmd: 'InsertTestifyTestimonials'
});
editor.addMenuItem('testify', {
image: imgUrl,
text: 'Insert Testify Testimonials shortcode',
cmd: 'InsertTestifyTestimonials',
context: 'insert'
});
});
jQuery(document).ready(function() {
jQuery('body').on(jQuery.modal.OPEN, '*', function(ev, m) {
if (m.$blocker.find('.testify-shortcode-dialog-body').length && !m.$blocker.find('.testify-shortcode-dialog').length) {
m.$blocker.find('.modal').addClass('testify-shortcode-dialog');
m.$blocker.find('.nav-tab:first').click();
m.$blocker.find('form').submit(function() {
jQuery(this).find('.testify-shortcode-dialog-buttons button').attr('disabled', true).filter('.button-primary').html('Please wait...');
var reqData = jQuery(this).serialize();
jQuery.post(ajaxurl, reqData, function(data) {
if (data.shortcode) {
testifyMCEEditor.focus();
testifyMCEEditor.execCommand('mceInsertContent', false, data.shortcode);
jQuery.modal.close();
} else {
alert('An error occurred while generating the Testify shortcode. Please try again.');
jQuery(this).find('.testify-shortcode-dialog-buttons button').attr('disabled', false).filter('.button-primary').html('Insert');
}
}, 'json').fail(function() {
alert('An error occurred while generating the Testify shortcode. Please try again.');
jQuery(this).find('.testify-shortcode-dialog-buttons button').attr('disabled', false).filter('.button-primary').html('Insert');
});
return false;
});
m.$blocker.find('.button-cancel').click(function() {
jQuery.modal.close();
});
}
});
});