Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/popup-bu.../public/js
File: MediaButton.js
function SGPBMediaButton(){}
[0] Fix | Delete
SGPBMediaButton.prototype.init=function()
[1] Fix | Delete
{this.openMediaButtonPopup();};SGPBMediaButton.prototype.tinymceButton=function()
[2] Fix | Delete
{var that=this;jQuery(document).on('tinymce-editor-setup',function(event,editor){if('sgpb-newsletter-text'===editor.settings.id){return;}
[3] Fix | Delete
if(editor.settings.toolbar1.indexOf('popupBuilderEditorButton')!==-1){return;}
[4] Fix | Delete
editor.settings.toolbar1+=', popupBuilderEditorButton';editor.addButton('popupBuilderEditorButton',{icon:'wp-menu-image dashicons-before dashicons-menu-icon-sgpb sgpb-tinymce-button',onclick:function(){that.mediaButtonPopup();}});});};SGPBMediaButton.prototype.openMediaButtonPopup=function()
[5] Fix | Delete
{var that=this;jQuery('.sgpb-tinymce-button, .sgpb-insert-media-button-js, .sgpb-insert-js-variable').unbind('click').bind('click',function(e){e.preventDefault();that.mediaButtonPopup(jQuery(this));});};SGPBMediaButton.prototype.mediaButtonPopup=function(currentTag)
[6] Fix | Delete
{var select2Init=1;var that=this;var hiddenDivId=jQuery(currentTag).attr('data-id')||'sgpb-hidden-media-popup';var popupConfigObj=new PopupConfig();popupConfigObj.magicCall('setContentPadding',14);popupConfigObj.magicCall('setContentBorderRadius',4);popupConfigObj.magicCall('setContentBorderRadiusType','px');popupConfigObj.magicCall('setContentBorderWidth',0);popupConfigObj.magicCall('setContentBorderColor','#506274');popupConfigObj.magicCall('setShadowSpread',1);popupConfigObj.magicCall('setContentShadowBlur',4);popupConfigObj.magicCall('setContentShadowColor','#cccccc');popupConfigObj.magicCall('setMinWidth',400);popupConfigObj.magicCall('setSrcElement',hiddenDivId);popupConfigObj.magicCall('setOverlayColor','black');popupConfigObj.magicCall('setOverlayOpacity',40);var config=popupConfigObj.combineConfigObj();var popup=new SGPopup(config);popup.open();jQuery(window).bind('sgpbDidOpen',function(){jQuery('.sgpb-insert-popup').addClass('js-sg-select2');if(mediaButtonParams.currentPostType!==mediaButtonParams.popupBuilderPostType){jQuery('.sgpb-insert-popup-event').addClass('js-sg-select2');if(select2Init===1){that.popupSelect2();}
[7] Fix | Delete
select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();}
[8] Fix | Delete
else{that.popupSelect2();jQuery('.select2-container--below').remove();}
[9] Fix | Delete
that.closeMediaButtonPopup(popup);});that.insertPopup(popup);};SGPBMediaButton.prototype.closeMediaButtonPopup=function(popup)
[10] Fix | Delete
{jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBMediaButton.prototype.insertPopup=function(popup)
[11] Fix | Delete
{var insidePopup=false;if(mediaButtonParams.currentPostType===mediaButtonParams.popupBuilderPostType){insidePopup=true;}
[12] Fix | Delete
jQuery('.sgpb-insert-popup-js').unbind('click').bind('click',function(){var selectedContent='';var selectedPopup=jQuery('.sgpb-insert-popup').val();var selectedPopupEvent=jQuery('.sgpb-insert-popup-event').val();if(typeof selectedPopupEvent!=='undefined'){selectedPopupEvent=' event="'+selectedPopupEvent+'"';}
[13] Fix | Delete
else{selectedPopupEvent='';if(insidePopup){selectedPopupEvent=' insidePopup="on"';}}
[14] Fix | Delete
if(selectedPopup===''||selectedPopup===null){popup.close();return;}
[15] Fix | Delete
if(selectedPopupEvent==='onLoad'&&!insidePopup){window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+'][/sg_popup]');popup.close();return;}
[16] Fix | Delete
if(typeof tinyMCE.editors.content!=='undefined'&&(document.getElementById('content').offsetParent===null)){selectedContent=(tinyMCE.activeEditor.selection.getContent())?tinyMCE.activeEditor.selection.getContent():'';}
[17] Fix | Delete
else{var content=document.getElementById('content');if(typeof document.selection!=='undefined'){content.focus();var sel=document.selection.createRange();selectedContent=sel.text;}
[18] Fix | Delete
else if(typeof content!=='undefined'&&content!==null){if(typeof content.selectionStart!=='undefined'){var startPos=content.selectionStart;var endPos=content.selectionEnd;selectedContent=content.value.substring(startPos,endPos);}}}
[19] Fix | Delete
window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+']'+selectedContent+'[/sg_popup]');popup.close();});jQuery('.sgpb-insert-js-variable-to-editor').unbind('click').bind('click',function(){var jsVariableSelector=jQuery('.sgpb-popup-dialog-main-div-wrapper .sgpb-js-variable-selector').val();var jsVariableAttribute=jQuery('.sgpb-popup-dialog-main-div-wrapper .sgpb-js-variable-attribute').val();jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');var valid=true;if(jsVariableSelector===''){valid=false;jQuery('.sgpb-js-variable-selector-error').removeClass('sg-hide-element');}
[20] Fix | Delete
if(jsVariableAttribute===''){valid=false;jQuery('.sgpb-js-variable-attribute-error').removeClass('sg-hide-element');}
[21] Fix | Delete
if(!valid){return false;}
[22] Fix | Delete
jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');window.send_to_editor('[pbvariable selector="'+jsVariableSelector+'" attribute="'+jsVariableAttribute+'"]');popup.close();});};SGPBMediaButton.prototype.popupSelect2=function()
[23] Fix | Delete
{if(!jQuery('.js-sg-select2').length){return;}
[24] Fix | Delete
jQuery('select.js-sg-select2').each(function(){var type=jQuery(this).attr('data-select-type');var className=jQuery(this).attr('data-select-class');var options={width:'100%'};if(type==='ajax'){if(typeof SGPB_JS_PARAMS==='undefined'){return;}
[25] Fix | Delete
options=jQuery.extend(options,{minimumInputLength:1,ajax:{url:SGPB_JS_PARAMS.url,dataType:'json',delay:250,type:'POST',data:function(params){var searchKey=jQuery(this).attr('data-value-param');return{action:'select2_search_data',nonce_ajax:SGPB_JS_PARAMS.nonce,searchTerm:params.term,searchKey:searchKey};},processResults:function(data){return{results:jQuery.map(data.items,function(item){return{text:item.text,id:item.id}})};}}});}
[26] Fix | Delete
jQuery(this).sgpbselect2(options);});};jQuery(document).ready(function(){var mediaButton=new SGPBMediaButton();jQuery(document).on('tinymce-editor-init',function(event,editor){mediaButton.init();});});
[27] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function