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/wp-conte.../plugins/portfoli.../bws_menu/js
File: bws_tooltip.js
/**
[0] Fix | Delete
* BWS tooltip function
[1] Fix | Delete
*/
[2] Fix | Delete
(function($) {
[3] Fix | Delete
"use strict";
[4] Fix | Delete
$( document ).ready(
[5] Fix | Delete
function() {
[6] Fix | Delete
jQuery.bwsTooltip = function( pointer_options ) {
[7] Fix | Delete
var pointer_buttons = pointer_options['buttons'];
[8] Fix | Delete
/* extend pointer options - add close button */
[9] Fix | Delete
pointer_options = $.extend(
[10] Fix | Delete
pointer_options,
[11] Fix | Delete
{
[12] Fix | Delete
buttons: function(event, t) {
[13] Fix | Delete
var button = '';
[14] Fix | Delete
/* check and add dismiss-type buttons */
[15] Fix | Delete
for ( var but in pointer_buttons ) {
[16] Fix | Delete
if ( typeof pointer_buttons[ but ]['type'] != 'undefined' && pointer_buttons[ but ]['type'] == 'dismiss' && typeof pointer_buttons[ but ]['text'] != 'undefined' && pointer_buttons[ but ]['text'] != '' ) {
[17] Fix | Delete
button += '<a style="margin:0px 5px 2px;" class="button-secondary">' + pointer_buttons[ but ]['text'] + '</a>';
[18] Fix | Delete
}
[19] Fix | Delete
}
[20] Fix | Delete
button = jQuery( button );
[21] Fix | Delete
button.on(
[22] Fix | Delete
'click.pointer',
[23] Fix | Delete
function () {
[24] Fix | Delete
t.element.pointer( 'close' );
[25] Fix | Delete
}
[26] Fix | Delete
);
[27] Fix | Delete
return button;
[28] Fix | Delete
},
[29] Fix | Delete
/* add ajax dismiss functionality */
[30] Fix | Delete
close : $.proxy(
[31] Fix | Delete
function () {
[32] Fix | Delete
if ( pointer_options['actions']['onload'] == true ) {
[33] Fix | Delete
$.post( ajaxurl, this );
[34] Fix | Delete
}
[35] Fix | Delete
},
[36] Fix | Delete
{
[37] Fix | Delete
pointer: pointer_options['tooltip_id'],
[38] Fix | Delete
action: 'dismiss-wp-pointer'
[39] Fix | Delete
}
[40] Fix | Delete
)
[41] Fix | Delete
}
[42] Fix | Delete
);
[43] Fix | Delete
/* function to display pointer */
[44] Fix | Delete
function displayPointer( cssSelector ) {
[45] Fix | Delete
cssSelector.pointer( pointer_options ).pointer(
[46] Fix | Delete
{
[47] Fix | Delete
pointerClass: 'wp-pointer ' + pointer_options["tooltip_id"],
[48] Fix | Delete
content: pointer_options['content'],
[49] Fix | Delete
position: {
[50] Fix | Delete
edge: pointer_options['position']['edge'],
[51] Fix | Delete
align: pointer_options['position']['align'],
[52] Fix | Delete
},
[53] Fix | Delete
}
[54] Fix | Delete
).pointer( 'open' );
[55] Fix | Delete
/* display buttons that are not type of dismiss */
[56] Fix | Delete
for ( var but in pointer_buttons ) {
[57] Fix | Delete
if ( typeof pointer_buttons[ but ]['type'] != 'undefined' && pointer_buttons[ but ]['type'] != 'dismiss' && typeof pointer_buttons[ but ]['text'] != 'undefined' && pointer_buttons[ but ]['text'] != '' ) {
[58] Fix | Delete
$( '.' + pointer_options['tooltip_id'] + ' .button-secondary' ).first().before(
[59] Fix | Delete
'<a class="button-primary" style="margin-right: 5px;" ' +
[60] Fix | Delete
( ( pointer_buttons[ but ]['type'] == 'link' && typeof pointer_buttons[ but ]['link'] != 'undefined' && pointer_buttons[ but ]['link'] != '') ? 'target="_blank" href="' + pointer_buttons[ but ]['link'] + '"' : '' )
[61] Fix | Delete
+ '>' + pointer_buttons[ but ]['text'] + '</a>'
[62] Fix | Delete
);
[63] Fix | Delete
};
[64] Fix | Delete
}
[65] Fix | Delete
/* adjust position of pointer */
[66] Fix | Delete
var topPos,
[67] Fix | Delete
leftPos,
[68] Fix | Delete
pointerZindex;
[69] Fix | Delete
topPos = parseInt( $( "." + pointer_options["tooltip_id"] ).css( "top" ) ) + parseInt( pointer_options['position']['pos-top'] );
[70] Fix | Delete
leftPos = parseInt( $( "." + pointer_options["tooltip_id"] ).css( "left" ) ) + parseInt( pointer_options['position']['pos-left'] );
[71] Fix | Delete
if ( pointer_options['position']['align'] == 'left' ) {
[72] Fix | Delete
leftPos += cssSelector.outerWidth() / 2;
[73] Fix | Delete
};
[74] Fix | Delete
$( "." + pointer_options["tooltip_id"] ).css( { "top": topPos + "px", "left": leftPos + "px" } );
[75] Fix | Delete
/* adjust z-index if need */
[76] Fix | Delete
pointerZindex = parseInt( $( "." + pointer_options["tooltip_id"] ).css( "z-index" ) );
[77] Fix | Delete
if ( pointerZindex != pointer_options['position']['zindex'] ) {
[78] Fix | Delete
$( "." + pointer_options["tooltip_id"] ).css( { "z-index": pointer_options['position']['zindex'] } );
[79] Fix | Delete
}
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
/* display pointer for the first time */
[83] Fix | Delete
if ( pointer_options['actions']['onload'] ) {
[84] Fix | Delete
if ( pointer_options['set_timeout'] > 0 ) {
[85] Fix | Delete
var settime = parseInt( pointer_options['set_timeout'] );
[86] Fix | Delete
setTimeout(
[87] Fix | Delete
function() {
[88] Fix | Delete
displayPointer( $( pointer_options['css_selector'] ) );
[89] Fix | Delete
},
[90] Fix | Delete
settime
[91] Fix | Delete
);
[92] Fix | Delete
} else {
[93] Fix | Delete
displayPointer( $( pointer_options['css_selector'] ) );
[94] Fix | Delete
}
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
/* display pointer when clicked on selector */
[98] Fix | Delete
if ( pointer_options['actions']['click'] ) {
[99] Fix | Delete
$( pointer_options['css_selector'] ).click(
[100] Fix | Delete
function () {
[101] Fix | Delete
displayPointer( $( this ) );
[102] Fix | Delete
}
[103] Fix | Delete
);
[104] Fix | Delete
}
[105] Fix | Delete
};
[106] Fix | Delete
}
[107] Fix | Delete
)
[108] Fix | Delete
})( jQuery );
[109] Fix | Delete
[110] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function