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/wp-revie.../admin/assets/js
File: rating-inputs.js
( function( $ ) {
[0] Fix | Delete
"use strict";
[1] Fix | Delete
[2] Fix | Delete
var defaults = {
[3] Fix | Delete
value: 0,
[4] Fix | Delete
color: '',
[5] Fix | Delete
callback: null
[6] Fix | Delete
};
[7] Fix | Delete
[8] Fix | Delete
function triggerCallback( options, value ) {
[9] Fix | Delete
if ( typeof options.callback == 'function' ) {
[10] Fix | Delete
options.callback.call( options._this, value );
[11] Fix | Delete
}
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
// Star input.
[15] Fix | Delete
$.fn.wprStarInput = function( method ) {
[16] Fix | Delete
var methods = {
[17] Fix | Delete
init: function( options ) {
[18] Fix | Delete
var _this = this, wrapper, html, starHtml, width;
[19] Fix | Delete
options = $.extend( {}, defaults, this.data(), options );
[20] Fix | Delete
if ( this.val() ) {
[21] Fix | Delete
options.value = this.val() ? parseFloat( this.val() ) : 0;
[22] Fix | Delete
}
[23] Fix | Delete
options._this = this;
[24] Fix | Delete
[25] Fix | Delete
width = parseFloat( options.value ) * 20;
[26] Fix | Delete
[27] Fix | Delete
starHtml = '';
[28] Fix | Delete
for ( var i = 0; i < 5; i++ ) {
[29] Fix | Delete
starHtml += '<span class="star-icon dashicons dashicons-star-filled"></span>';
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
html = '<div class="wpr-star-input-wrapper wpr-input-wrapper" data-value="' + options.value + '" data-width="' + width + '" style="color: ' + options.color + '">\
[33] Fix | Delete
<div class="stars-bg" style="color: ' + options.inactiveColor + '">' + starHtml + '</div>\
[34] Fix | Delete
<div class="stars-result" style="width: ' + width + '%">' + starHtml + '</div>\
[35] Fix | Delete
</div>';
[36] Fix | Delete
[37] Fix | Delete
wrapper = $( html );
[38] Fix | Delete
this.before( wrapper );
[39] Fix | Delete
[40] Fix | Delete
if ( typeof options.ready == 'function' ) {
[41] Fix | Delete
options.ready.call( this, wrapper, options )
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
wrapper.on( 'mousemove', function( ev ) {
[45] Fix | Delete
var newWidth;
[46] Fix | Delete
newWidth = ev.pageX - $( this ).offset().left;
[47] Fix | Delete
newWidth = newWidth / $( this ).width() * 100;
[48] Fix | Delete
newWidth = Math.ceil( newWidth / 10 ) * 10;
[49] Fix | Delete
$( this ).attr( 'data-value', newWidth / 20 ); // width / 100 * 5
[50] Fix | Delete
$( this ).find( '.stars-result' ).css( 'width', newWidth + '%' );
[51] Fix | Delete
$( this ).attr( 'data-width', newWidth );
[52] Fix | Delete
}).on( 'mouseleave', function() {
[53] Fix | Delete
// Reset to old width.
[54] Fix | Delete
$( this ).find( '.stars-result' ).css( 'width', width + '%' );
[55] Fix | Delete
$( this ).attr( 'data-width', width );
[56] Fix | Delete
$( this ).attr( 'data-value', options.value );
[57] Fix | Delete
}).on( 'click', function() {
[58] Fix | Delete
width = $( this ).attr( 'data-width' );
[59] Fix | Delete
options.value = parseFloat( $( this ).attr( 'data-value' ) );
[60] Fix | Delete
_this.val( options.value );
[61] Fix | Delete
triggerCallback( options, options.value );
[62] Fix | Delete
});
[63] Fix | Delete
[64] Fix | Delete
wrapper.css({ color: options.color });
[65] Fix | Delete
[66] Fix | Delete
this.on( 'change', function() {
[67] Fix | Delete
var value = $( this ).val() ? parseFloat( $( this ).val() ) : 0;
[68] Fix | Delete
wrapper.attr( 'data-value', value );
[69] Fix | Delete
wrapper.attr( 'data-width', value * 20 );
[70] Fix | Delete
wrapper.find( '.stars-result' ).css( 'width', ( value * 20 ) + '%' );
[71] Fix | Delete
triggerCallback( options, value );
[72] Fix | Delete
});
[73] Fix | Delete
}
[74] Fix | Delete
};
[75] Fix | Delete
[76] Fix | Delete
if ( ! method || typeof method == 'object' ) {
[77] Fix | Delete
methods.init.apply( this, arguments );
[78] Fix | Delete
return;
[79] Fix | Delete
}
[80] Fix | Delete
if ( methods[ method ] ) {
[81] Fix | Delete
methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
[82] Fix | Delete
return;
[83] Fix | Delete
}
[84] Fix | Delete
};
[85] Fix | Delete
[86] Fix | Delete
// Percentage input.
[87] Fix | Delete
$.fn.wprPercentageInput = function( method ) {
[88] Fix | Delete
var methods = {
[89] Fix | Delete
init: function( options ) {
[90] Fix | Delete
var _this = this, wrapper;
[91] Fix | Delete
options = $.extend( {}, defaults, this.data(), options );
[92] Fix | Delete
if ( this.val() ) {
[93] Fix | Delete
options.value = this.val();
[94] Fix | Delete
}
[95] Fix | Delete
options._this = this;
[96] Fix | Delete
[97] Fix | Delete
if ( ! options.inactiveColor ) {
[98] Fix | Delete
options.inactiveColor = '#ccc';
[99] Fix | Delete
}
[100] Fix | Delete
[101] Fix | Delete
wrapper = $( '<div class="wpr-percentage-input-wrapper wpr-input-wrapper"></div>' );
[102] Fix | Delete
this.before( wrapper );
[103] Fix | Delete
[104] Fix | Delete
if ( typeof options.ready == 'function' ) {
[105] Fix | Delete
options.ready.call( this, wrapper, options )
[106] Fix | Delete
}
[107] Fix | Delete
[108] Fix | Delete
wrapper.slider({
[109] Fix | Delete
min: 0,
[110] Fix | Delete
max: 100,
[111] Fix | Delete
step: 1,
[112] Fix | Delete
range: 'min',
[113] Fix | Delete
value: options.value,
[114] Fix | Delete
create: function( ev, ui ) {
[115] Fix | Delete
wrapper.css( 'backgroundColor', options.inactiveColor );
[116] Fix | Delete
wrapper.find( '.ui-slider-range' ).css( 'backgroundColor', options.color );
[117] Fix | Delete
},
[118] Fix | Delete
slide: function( ev, ui ) {
[119] Fix | Delete
triggerCallback( options, ui.value );
[120] Fix | Delete
}
[121] Fix | Delete
});
[122] Fix | Delete
[123] Fix | Delete
this.on( 'change', function() {
[124] Fix | Delete
var value = $( this ).val();
[125] Fix | Delete
wrapper.slider( 'value', value );
[126] Fix | Delete
triggerCallback( options, value );
[127] Fix | Delete
});
[128] Fix | Delete
}
[129] Fix | Delete
};
[130] Fix | Delete
[131] Fix | Delete
if ( ! method || typeof method == 'object' ) {
[132] Fix | Delete
methods.init.apply( this, arguments );
[133] Fix | Delete
return;
[134] Fix | Delete
}
[135] Fix | Delete
if ( methods[ method ] ) {
[136] Fix | Delete
methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
[137] Fix | Delete
return;
[138] Fix | Delete
}
[139] Fix | Delete
};
[140] Fix | Delete
[141] Fix | Delete
// Point input.
[142] Fix | Delete
$.fn.wprPointInput = function( method ) {
[143] Fix | Delete
var methods = {
[144] Fix | Delete
init: function( options ) {
[145] Fix | Delete
var _this = this, wrapper;
[146] Fix | Delete
options = $.extend( {}, defaults, this.data(), options );
[147] Fix | Delete
if ( this.val() ) {
[148] Fix | Delete
options.value = this.val();
[149] Fix | Delete
}
[150] Fix | Delete
options._this = this;
[151] Fix | Delete
[152] Fix | Delete
if ( ! options.inactiveColor ) {
[153] Fix | Delete
options.inactiveColor = '#ccc';
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
wrapper = $( '<div class="wpr-percentage-input-wrapper wpr-input-wrapper"></div>' );
[157] Fix | Delete
this.before( wrapper );
[158] Fix | Delete
[159] Fix | Delete
if ( typeof options.ready == 'function' ) {
[160] Fix | Delete
options.ready.call( this, wrapper, options )
[161] Fix | Delete
}
[162] Fix | Delete
[163] Fix | Delete
wrapper.slider({
[164] Fix | Delete
min: 0,
[165] Fix | Delete
max: 10,
[166] Fix | Delete
step: 0.1,
[167] Fix | Delete
range: 'min',
[168] Fix | Delete
value: options.value,
[169] Fix | Delete
create: function( ev, ui ) {
[170] Fix | Delete
wrapper.css( 'backgroundColor', options.inactiveColor );
[171] Fix | Delete
wrapper.find( '.ui-slider-range' ).css( 'backgroundColor', options.color );
[172] Fix | Delete
},
[173] Fix | Delete
slide: function( ev, ui ) {
[174] Fix | Delete
triggerCallback( options, ui.value );
[175] Fix | Delete
}
[176] Fix | Delete
});
[177] Fix | Delete
[178] Fix | Delete
this.on( 'change', function() {
[179] Fix | Delete
var value = $( this ).val();
[180] Fix | Delete
wrapper.slider( 'value', value );
[181] Fix | Delete
triggerCallback( options, value );
[182] Fix | Delete
});
[183] Fix | Delete
}
[184] Fix | Delete
};
[185] Fix | Delete
[186] Fix | Delete
if ( ! method || typeof method == 'object' ) {
[187] Fix | Delete
methods.init.apply( this, arguments );
[188] Fix | Delete
return;
[189] Fix | Delete
}
[190] Fix | Delete
if ( methods[ method ] ) {
[191] Fix | Delete
methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
[192] Fix | Delete
return;
[193] Fix | Delete
}
[194] Fix | Delete
};
[195] Fix | Delete
[196] Fix | Delete
})( jQuery );
[197] Fix | Delete
[198] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function