Current Path : /var/www/ooareogundevinitiative/wp-content/plugins/give/assets/dist/js/ |
Current File : /var/www/ooareogundevinitiative/wp-content/plugins/give/assets/dist/js/admin-shortcodes.js |
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=713)}({713:function(e,t){ /*! * Give Admin Shortcodes JS * * @description: The Give Admin Shortcode scripts. Only enqueued on the admin widgets screen; used to show shortcode dialogs, show/hide, and other functions * @package: Give * @subpackage: Assets/JS * @author: Paul Ryley * @copyright: Copyright (c) 2016, GiveWP * @license: http://opensource.org/licenses/gpl-2.0.php GNU Public License * @since: 1.3.0 */ var n,o;jQuery((function(e){var t=e(this);window.render_continue_button_title_field=function(){var t=e(".mce-txt",".mce-give-display-style").text();-1!==e.inArray(t,["- Select -","All Fields"])?e(".mce-give-continue-button-title").closest(".mce-container").hide():e(".mce-give-continue-button-title").closest(".mce-container").show()},window.scForm={open:function(t){var o,i,r,c,s,a=tinymce.get(t);a&&(o={action:"give_shortcode",shortcode:n},e.post(ajaxurl,o,(function(t){if(t.body){if(0===t.body.length)return window.send_to_editor("["+t.shortcode+"]"),void scForm.destroy();e.each(t.body,(function(e,n){"display_style"===n.name&&(t.body[e].onselect=function(){render_continue_button_title_field()})}));var o={title:t.title,body:t.body,classes:"sc-popup",minWidth:320,buttons:[{text:t.ok,classes:"primary sc-primary",onclick:function(){for(var e in s=a.windowManager.getWindows()[0],r=scShortcodes[n],c=!0,r)if(r.hasOwnProperty(e)&&void 0!==(i=s.find("#"+e)[0])&&""===i.state.data.value){c=!1,new Give.modal.GiveErrorAlert({modalContent:{desc:r[e],cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render();break}c&&s.submit()}},{text:t.close,onclick:"close"}],onsubmit:function(e){var n="";for(var o in e.data)e.data.hasOwnProperty(o)&&""!==e.data[o]&&(n+=" "+o+'="'+e.data[o]+'"');window.send_to_editor("["+t.shortcode+n+"]")},onclose:function(){scForm.destroy()},onopen:function(){var t=e(".mce-sc-popup");t.css({width:t.width(),height:t.height(),overflow:"auto"}),render_continue_button_title_field()}};t.ok.constructor===Array&&(o.buttons[0].text=t.ok[0],o.buttons[0].onclick="close",delete o.buttons[1]),a.windowManager.open(o)}else console.error("Bad AJAX response!")})))},destroy:function(){var t=e("#scTemp");t.length&&(tinymce.get("scTemp").remove(),t.remove())}};var i=function(){void 0!==o&&o.removeClass("active").parent().find(".sc-menu").hide()};t.on("click",(function(t){e(t.target).closest(".sc-wrap").length||i()})),t.on("click",".sc-button",(function(t){t.preventDefault(),(o=e(this)).hasClass("active")?i():o.addClass("active").parent().find(".sc-menu").show()})),t.on("click",".sc-shortcode",(function(t){t.preventDefault(),(n=e(this).attr("data-shortcode"))?(tinymce.get(window.wpActiveEditor)?tinymce.execCommand("Give_Shortcode"):(e("#scTemp").length||(e("body").append('<textarea id="scTemp" style="display: none;" />'),tinymce.init({mode:"exact",elements:"scTemp",plugins:["give_shortcode","wplink"]})),setTimeout((function(){tinymce.execCommand("Give_Shortcode")}),200)),setTimeout((function(){i()}),100)):console.warn("That is not a valid shortcode link.")}))}))}});