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-inclu.../js/jquery/ui
File: checkboxradio.js
/*!
[0] Fix | Delete
* jQuery UI Checkboxradio 1.13.3
[1] Fix | Delete
* https://jqueryui.com
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright OpenJS Foundation and other contributors
[4] Fix | Delete
* Released under the MIT license.
[5] Fix | Delete
* https://jquery.org/license
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
//>>label: Checkboxradio
[9] Fix | Delete
//>>group: Widgets
[10] Fix | Delete
//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
[11] Fix | Delete
//>>docs: https://api.jqueryui.com/checkboxradio/
[12] Fix | Delete
//>>demos: https://jqueryui.com/checkboxradio/
[13] Fix | Delete
//>>css.structure: ../../themes/base/core.css
[14] Fix | Delete
//>>css.structure: ../../themes/base/button.css
[15] Fix | Delete
//>>css.structure: ../../themes/base/checkboxradio.css
[16] Fix | Delete
//>>css.theme: ../../themes/base/theme.css
[17] Fix | Delete
[18] Fix | Delete
( function( factory ) {
[19] Fix | Delete
"use strict";
[20] Fix | Delete
[21] Fix | Delete
if ( typeof define === "function" && define.amd ) {
[22] Fix | Delete
[23] Fix | Delete
// AMD. Register as an anonymous module.
[24] Fix | Delete
define( [
[25] Fix | Delete
"jquery",
[26] Fix | Delete
"../form-reset-mixin",
[27] Fix | Delete
"../labels",
[28] Fix | Delete
"../widget"
[29] Fix | Delete
], factory );
[30] Fix | Delete
} else {
[31] Fix | Delete
[32] Fix | Delete
// Browser globals
[33] Fix | Delete
factory( jQuery );
[34] Fix | Delete
}
[35] Fix | Delete
} )( function( $ ) {
[36] Fix | Delete
"use strict";
[37] Fix | Delete
[38] Fix | Delete
$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
[39] Fix | Delete
version: "1.13.3",
[40] Fix | Delete
options: {
[41] Fix | Delete
disabled: null,
[42] Fix | Delete
label: null,
[43] Fix | Delete
icon: true,
[44] Fix | Delete
classes: {
[45] Fix | Delete
"ui-checkboxradio-label": "ui-corner-all",
[46] Fix | Delete
"ui-checkboxradio-icon": "ui-corner-all"
[47] Fix | Delete
}
[48] Fix | Delete
},
[49] Fix | Delete
[50] Fix | Delete
_getCreateOptions: function() {
[51] Fix | Delete
var disabled, labels, labelContents;
[52] Fix | Delete
var options = this._super() || {};
[53] Fix | Delete
[54] Fix | Delete
// We read the type here, because it makes more sense to throw a element type error first,
[55] Fix | Delete
// rather then the error for lack of a label. Often if its the wrong type, it
[56] Fix | Delete
// won't have a label (e.g. calling on a div, btn, etc)
[57] Fix | Delete
this._readType();
[58] Fix | Delete
[59] Fix | Delete
labels = this.element.labels();
[60] Fix | Delete
[61] Fix | Delete
// If there are multiple labels, use the last one
[62] Fix | Delete
this.label = $( labels[ labels.length - 1 ] );
[63] Fix | Delete
if ( !this.label.length ) {
[64] Fix | Delete
$.error( "No label found for checkboxradio widget" );
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
this.originalLabel = "";
[68] Fix | Delete
[69] Fix | Delete
// We need to get the label text but this may also need to make sure it does not contain the
[70] Fix | Delete
// input itself.
[71] Fix | Delete
// The label contents could be text, html, or a mix. We wrap all elements
[72] Fix | Delete
// and read the wrapper's `innerHTML` to get a string representation of
[73] Fix | Delete
// the label, without the input as part of it.
[74] Fix | Delete
labelContents = this.label.contents().not( this.element[ 0 ] );
[75] Fix | Delete
[76] Fix | Delete
if ( labelContents.length ) {
[77] Fix | Delete
this.originalLabel += labelContents
[78] Fix | Delete
.clone()
[79] Fix | Delete
.wrapAll( "<div></div>" )
[80] Fix | Delete
.parent()
[81] Fix | Delete
.html();
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
// Set the label option if we found label text
[85] Fix | Delete
if ( this.originalLabel ) {
[86] Fix | Delete
options.label = this.originalLabel;
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
disabled = this.element[ 0 ].disabled;
[90] Fix | Delete
if ( disabled != null ) {
[91] Fix | Delete
options.disabled = disabled;
[92] Fix | Delete
}
[93] Fix | Delete
return options;
[94] Fix | Delete
},
[95] Fix | Delete
[96] Fix | Delete
_create: function() {
[97] Fix | Delete
var checked = this.element[ 0 ].checked;
[98] Fix | Delete
[99] Fix | Delete
this._bindFormResetHandler();
[100] Fix | Delete
[101] Fix | Delete
if ( this.options.disabled == null ) {
[102] Fix | Delete
this.options.disabled = this.element[ 0 ].disabled;
[103] Fix | Delete
}
[104] Fix | Delete
[105] Fix | Delete
this._setOption( "disabled", this.options.disabled );
[106] Fix | Delete
this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" );
[107] Fix | Delete
this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" );
[108] Fix | Delete
[109] Fix | Delete
if ( this.type === "radio" ) {
[110] Fix | Delete
this._addClass( this.label, "ui-checkboxradio-radio-label" );
[111] Fix | Delete
}
[112] Fix | Delete
[113] Fix | Delete
if ( this.options.label && this.options.label !== this.originalLabel ) {
[114] Fix | Delete
this._updateLabel();
[115] Fix | Delete
} else if ( this.originalLabel ) {
[116] Fix | Delete
this.options.label = this.originalLabel;
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
this._enhance();
[120] Fix | Delete
[121] Fix | Delete
if ( checked ) {
[122] Fix | Delete
this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
[123] Fix | Delete
}
[124] Fix | Delete
[125] Fix | Delete
this._on( {
[126] Fix | Delete
change: "_toggleClasses",
[127] Fix | Delete
focus: function() {
[128] Fix | Delete
this._addClass( this.label, null, "ui-state-focus ui-visual-focus" );
[129] Fix | Delete
},
[130] Fix | Delete
blur: function() {
[131] Fix | Delete
this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" );
[132] Fix | Delete
}
[133] Fix | Delete
} );
[134] Fix | Delete
},
[135] Fix | Delete
[136] Fix | Delete
_readType: function() {
[137] Fix | Delete
var nodeName = this.element[ 0 ].nodeName.toLowerCase();
[138] Fix | Delete
this.type = this.element[ 0 ].type;
[139] Fix | Delete
if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) {
[140] Fix | Delete
$.error( "Can't create checkboxradio on element.nodeName=" + nodeName +
[141] Fix | Delete
" and element.type=" + this.type );
[142] Fix | Delete
}
[143] Fix | Delete
},
[144] Fix | Delete
[145] Fix | Delete
// Support jQuery Mobile enhanced option
[146] Fix | Delete
_enhance: function() {
[147] Fix | Delete
this._updateIcon( this.element[ 0 ].checked );
[148] Fix | Delete
},
[149] Fix | Delete
[150] Fix | Delete
widget: function() {
[151] Fix | Delete
return this.label;
[152] Fix | Delete
},
[153] Fix | Delete
[154] Fix | Delete
_getRadioGroup: function() {
[155] Fix | Delete
var group;
[156] Fix | Delete
var name = this.element[ 0 ].name;
[157] Fix | Delete
var nameSelector = "input[name='" + $.escapeSelector( name ) + "']";
[158] Fix | Delete
[159] Fix | Delete
if ( !name ) {
[160] Fix | Delete
return $( [] );
[161] Fix | Delete
}
[162] Fix | Delete
[163] Fix | Delete
if ( this.form.length ) {
[164] Fix | Delete
group = $( this.form[ 0 ].elements ).filter( nameSelector );
[165] Fix | Delete
} else {
[166] Fix | Delete
[167] Fix | Delete
// Not inside a form, check all inputs that also are not inside a form
[168] Fix | Delete
group = $( nameSelector ).filter( function() {
[169] Fix | Delete
return $( this )._form().length === 0;
[170] Fix | Delete
} );
[171] Fix | Delete
}
[172] Fix | Delete
[173] Fix | Delete
return group.not( this.element );
[174] Fix | Delete
},
[175] Fix | Delete
[176] Fix | Delete
_toggleClasses: function() {
[177] Fix | Delete
var checked = this.element[ 0 ].checked;
[178] Fix | Delete
this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
[179] Fix | Delete
[180] Fix | Delete
if ( this.options.icon && this.type === "checkbox" ) {
[181] Fix | Delete
this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked )
[182] Fix | Delete
._toggleClass( this.icon, null, "ui-icon-blank", !checked );
[183] Fix | Delete
}
[184] Fix | Delete
[185] Fix | Delete
if ( this.type === "radio" ) {
[186] Fix | Delete
this._getRadioGroup()
[187] Fix | Delete
.each( function() {
[188] Fix | Delete
var instance = $( this ).checkboxradio( "instance" );
[189] Fix | Delete
[190] Fix | Delete
if ( instance ) {
[191] Fix | Delete
instance._removeClass( instance.label,
[192] Fix | Delete
"ui-checkboxradio-checked", "ui-state-active" );
[193] Fix | Delete
}
[194] Fix | Delete
} );
[195] Fix | Delete
}
[196] Fix | Delete
},
[197] Fix | Delete
[198] Fix | Delete
_destroy: function() {
[199] Fix | Delete
this._unbindFormResetHandler();
[200] Fix | Delete
[201] Fix | Delete
if ( this.icon ) {
[202] Fix | Delete
this.icon.remove();
[203] Fix | Delete
this.iconSpace.remove();
[204] Fix | Delete
}
[205] Fix | Delete
},
[206] Fix | Delete
[207] Fix | Delete
_setOption: function( key, value ) {
[208] Fix | Delete
[209] Fix | Delete
// We don't allow the value to be set to nothing
[210] Fix | Delete
if ( key === "label" && !value ) {
[211] Fix | Delete
return;
[212] Fix | Delete
}
[213] Fix | Delete
[214] Fix | Delete
this._super( key, value );
[215] Fix | Delete
[216] Fix | Delete
if ( key === "disabled" ) {
[217] Fix | Delete
this._toggleClass( this.label, null, "ui-state-disabled", value );
[218] Fix | Delete
this.element[ 0 ].disabled = value;
[219] Fix | Delete
[220] Fix | Delete
// Don't refresh when setting disabled
[221] Fix | Delete
return;
[222] Fix | Delete
}
[223] Fix | Delete
this.refresh();
[224] Fix | Delete
},
[225] Fix | Delete
[226] Fix | Delete
_updateIcon: function( checked ) {
[227] Fix | Delete
var toAdd = "ui-icon ui-icon-background ";
[228] Fix | Delete
[229] Fix | Delete
if ( this.options.icon ) {
[230] Fix | Delete
if ( !this.icon ) {
[231] Fix | Delete
this.icon = $( "<span>" );
[232] Fix | Delete
this.iconSpace = $( "<span> </span>" );
[233] Fix | Delete
this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" );
[234] Fix | Delete
}
[235] Fix | Delete
[236] Fix | Delete
if ( this.type === "checkbox" ) {
[237] Fix | Delete
toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank";
[238] Fix | Delete
this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" );
[239] Fix | Delete
} else {
[240] Fix | Delete
toAdd += "ui-icon-blank";
[241] Fix | Delete
}
[242] Fix | Delete
this._addClass( this.icon, "ui-checkboxradio-icon", toAdd );
[243] Fix | Delete
if ( !checked ) {
[244] Fix | Delete
this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" );
[245] Fix | Delete
}
[246] Fix | Delete
this.icon.prependTo( this.label ).after( this.iconSpace );
[247] Fix | Delete
} else if ( this.icon !== undefined ) {
[248] Fix | Delete
this.icon.remove();
[249] Fix | Delete
this.iconSpace.remove();
[250] Fix | Delete
delete this.icon;
[251] Fix | Delete
}
[252] Fix | Delete
},
[253] Fix | Delete
[254] Fix | Delete
_updateLabel: function() {
[255] Fix | Delete
[256] Fix | Delete
// Remove the contents of the label ( minus the icon, icon space, and input )
[257] Fix | Delete
var contents = this.label.contents().not( this.element[ 0 ] );
[258] Fix | Delete
if ( this.icon ) {
[259] Fix | Delete
contents = contents.not( this.icon[ 0 ] );
[260] Fix | Delete
}
[261] Fix | Delete
if ( this.iconSpace ) {
[262] Fix | Delete
contents = contents.not( this.iconSpace[ 0 ] );
[263] Fix | Delete
}
[264] Fix | Delete
contents.remove();
[265] Fix | Delete
[266] Fix | Delete
this.label.append( this.options.label );
[267] Fix | Delete
},
[268] Fix | Delete
[269] Fix | Delete
refresh: function() {
[270] Fix | Delete
var checked = this.element[ 0 ].checked,
[271] Fix | Delete
isDisabled = this.element[ 0 ].disabled;
[272] Fix | Delete
[273] Fix | Delete
this._updateIcon( checked );
[274] Fix | Delete
this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
[275] Fix | Delete
if ( this.options.label !== null ) {
[276] Fix | Delete
this._updateLabel();
[277] Fix | Delete
}
[278] Fix | Delete
[279] Fix | Delete
if ( isDisabled !== this.options.disabled ) {
[280] Fix | Delete
this._setOptions( { "disabled": isDisabled } );
[281] Fix | Delete
}
[282] Fix | Delete
}
[283] Fix | Delete
[284] Fix | Delete
} ] );
[285] Fix | Delete
[286] Fix | Delete
return $.ui.checkboxradio;
[287] Fix | Delete
[288] Fix | Delete
} );
[289] Fix | Delete
[290] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function