Add upstream
This commit is contained in:
20
wp-content/plugins/updraftplus/includes/labelauty/LICENSE
Normal file
20
wp-content/plugins/updraftplus/includes/labelauty/LICENSE
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Francisco Neves
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 318 B |
Binary file not shown.
|
After Width: | Height: | Size: 154 B |
@@ -0,0 +1,267 @@
|
||||
/*!
|
||||
* LABELAUTY jQuery Plugin Styles
|
||||
*
|
||||
* @file: jquery-labelauty.css
|
||||
* @author: Francisco Neves (@fntneves)
|
||||
* @site: www.francisconeves.com
|
||||
* @license: MIT License
|
||||
*/
|
||||
|
||||
/* Prevent text and blocks selection */
|
||||
input.labelauty + label ::-moz-selection { background-color: rgba(255, 255, 255, 0); }
|
||||
input.labelauty + label ::selection { background-color: rgba(255, 255, 255, 0); }
|
||||
input.labelauty + label ::-moz-selection { background-color: rgba(255, 255, 255, 0); }
|
||||
|
||||
/* Hide original checkboxes. They are ugly! */
|
||||
input.labelauty { display: none !important; }
|
||||
|
||||
/*
|
||||
* Let's style the input
|
||||
* Feel free to work with it as you wish!
|
||||
*/
|
||||
input.labelauty + label
|
||||
{
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
padding: 10px;
|
||||
background-color: #efefef;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
width: 96%;
|
||||
|
||||
border-radius: 3px 3px 3px 3px;
|
||||
-moz-border-radius: 3px 3px 3px 3px;
|
||||
-webkit-border-radius: 3px 3px 3px 3px;
|
||||
|
||||
|
||||
transition: background-color 0.25s;
|
||||
-moz-transition: background-color 0.25s;
|
||||
-webkit-transition: background-color 0.25s;
|
||||
-o-transition: background-color 0.25s;
|
||||
|
||||
-moz-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-o-user-select: none;
|
||||
}
|
||||
|
||||
/* Stylish text inside label */
|
||||
|
||||
input.labelauty + label > span.labelauty-unchecked,
|
||||
input.labelauty + label > span.labelauty-checked
|
||||
{
|
||||
display: inline-block;
|
||||
line-height: 1.1;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Stylish icons inside label */
|
||||
|
||||
input.labelauty + label > span.labelauty-unchecked-image,
|
||||
input.labelauty + label > span.labelauty-checked-image
|
||||
{
|
||||
display: inline-block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
vertical-align: middle;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
background-size: contain;
|
||||
|
||||
transition: background-image 0.5s linear;
|
||||
-moz-transition: background-image 0.5s linear;
|
||||
-webkit-transition: background-image 0.5s linear;
|
||||
-o-transition: background-image 0.5s linear;
|
||||
}
|
||||
|
||||
/* When there's a label, add a little margin to the left */
|
||||
input.labelauty + label > span.labelauty-unchecked-image + span.labelauty-unchecked,
|
||||
input.labelauty + label > span.labelauty-checked-image + span.labelauty-checked
|
||||
{
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
/* When not Checked */
|
||||
input.labelauty:not(:checked):not([disabled]) + label:hover
|
||||
{
|
||||
background-color: #eaeaea;
|
||||
color: #a7a7a7;
|
||||
}
|
||||
input.labelauty:not(:checked) + label > span.labelauty-checked-image
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
input.labelauty:not(:checked) + label > span.labelauty-checked
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* When Checked */
|
||||
input.labelauty:checked + label
|
||||
{
|
||||
background-color: #3498db;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
input.labelauty:checked:not([disabled]) + label:hover
|
||||
{
|
||||
background-color: #72c5fd;
|
||||
}
|
||||
input.labelauty:checked + label > span.labelauty-unchecked-image
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
input.labelauty:checked + label > span.labelauty-unchecked
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
input.labelauty:checked + label > span.labelauty-checked
|
||||
{
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
input.labelauty.no-label:checked + label > span.labelauty-checked
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* When Disabled */
|
||||
input.labelauty[disabled] + label
|
||||
{
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Add a background to (un)checked images */
|
||||
input.labelauty + label > span.labelauty-unchecked-image
|
||||
{
|
||||
background-image: url( images/icons/folder.png );
|
||||
}
|
||||
|
||||
input.labelauty + label > span.labelauty-checked-image
|
||||
{
|
||||
background-image: url( images/icons/folder.png );
|
||||
}
|
||||
|
||||
input.labelauty.email + label > span.labelauty-checked-image,
|
||||
input.labelauty.email + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/email.png );
|
||||
}
|
||||
|
||||
input.labelauty.cloudfiles + label > span.labelauty-checked-image,
|
||||
input.labelauty.cloudfiles + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/cloudfiles.png );
|
||||
}
|
||||
|
||||
input.labelauty.dreamobjects + label > span.labelauty-checked-image,
|
||||
input.labelauty.dreamobjects + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/dreamobjects.png );
|
||||
}
|
||||
|
||||
input.labelauty.dropbox + label > span.labelauty-checked-image,
|
||||
input.labelauty.dropbox + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/dropbox.png );
|
||||
}
|
||||
|
||||
input.labelauty.ftp + label > span.labelauty-checked-image,
|
||||
input.labelauty.ftp + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/folder.png );
|
||||
}
|
||||
|
||||
input.labelauty.sftp + label > span.labelauty-checked-image,
|
||||
input.labelauty.sftp + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/folder.png );
|
||||
}
|
||||
|
||||
input.labelauty.googledrive + label > span.labelauty-checked-image,
|
||||
input.labelauty.googledrive + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/googledrive.png );
|
||||
}
|
||||
|
||||
input.labelauty.s3generic + label > span.labelauty-checked-image,
|
||||
input.labelauty.s3generic + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/folder.png );
|
||||
}
|
||||
|
||||
input.labelauty.onedrive + label > span.labelauty-checked-image,
|
||||
input.labelauty.onedrive + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/onedrive.png );
|
||||
}
|
||||
|
||||
input.labelauty.azure + label > span.labelauty-checked-image,
|
||||
input.labelauty.azure + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/azure.png );
|
||||
}
|
||||
|
||||
input.labelauty.backblaze + label > span.labelauty-checked-image,
|
||||
input.labelauty.backblaze + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/backblaze.png );
|
||||
}
|
||||
|
||||
input.labelauty.openstack + label > span.labelauty-checked-image,
|
||||
input.labelauty.openstack + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/openstack.png );
|
||||
}
|
||||
|
||||
input.labelauty.s3 + label > span.labelauty-checked-image,
|
||||
input.labelauty.s3 + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/s3.png );
|
||||
}
|
||||
|
||||
input.labelauty.updraftvault + label > span.labelauty-checked-image,
|
||||
input.labelauty.updraftvault + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/updraftvault.png );
|
||||
}
|
||||
|
||||
input.labelauty.webdav + label > span.labelauty-checked-image,
|
||||
input.labelauty.webdav + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/webdav.png );
|
||||
}
|
||||
|
||||
input.labelauty.googlecloud + label > span.labelauty-checked-image,
|
||||
input.labelauty.googlecloud + label > span.labelauty-unchecked-image {
|
||||
background-image: url( ../../images/icons/googlecloud.png );
|
||||
}
|
||||
|
||||
#remote-storage-container {
|
||||
height: auto;
|
||||
width: auto;
|
||||
column-count: 2;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 480px) {
|
||||
|
||||
#remote-storage-container {
|
||||
height: auto;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1000px) {
|
||||
|
||||
#remote-storage-container {
|
||||
column-count: 3;
|
||||
height: auto;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 480px) {
|
||||
|
||||
input.labelauty + label {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input.labelauty + label > span.labelauty-unchecked-image, input.labelauty + label > span.labelauty-checked-image {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
}
|
||||
278
wp-content/plugins/updraftplus/includes/labelauty/jquery-labelauty.js
vendored
Normal file
278
wp-content/plugins/updraftplus/includes/labelauty/jquery-labelauty.js
vendored
Normal file
@@ -0,0 +1,278 @@
|
||||
/*!
|
||||
* LABELAUTY jQuery Plugin
|
||||
*
|
||||
* @file: jquery-labelauty.js
|
||||
* @author: Francisco Neves (@fntneves)
|
||||
* @site: www.francisconeves.com
|
||||
* @license: MIT License
|
||||
*/
|
||||
|
||||
(function( $ ){
|
||||
|
||||
$.fn.labelauty = function( options )
|
||||
{
|
||||
/*
|
||||
* Our default settings
|
||||
* Hope you don't need to change anything, with these settings
|
||||
*/
|
||||
var settings = $.extend(
|
||||
{
|
||||
// Development Mode
|
||||
// This will activate console debug messages
|
||||
development: false,
|
||||
|
||||
// Trigger Class
|
||||
// This class will be used to apply styles
|
||||
class: "labelauty",
|
||||
|
||||
// Use text label ?
|
||||
// If false, then only an icon represents the input
|
||||
label: true,
|
||||
|
||||
// Separator between labels' messages
|
||||
// If you use this separator for anything, choose a new one
|
||||
separator: "|",
|
||||
|
||||
// Default Checked Message
|
||||
// This message will be visible when input is checked
|
||||
checked_label: "Checked",
|
||||
|
||||
// Default UnChecked Message
|
||||
// This message will be visible when input is unchecked
|
||||
unchecked_label: "Unchecked",
|
||||
|
||||
// Force random ID's
|
||||
// Replace original ID's with random ID's,
|
||||
force_random_id: false,
|
||||
|
||||
// Minimum Label Width
|
||||
// This value will be used to apply a minimum width to the text labels
|
||||
minimum_width: false,
|
||||
|
||||
// Use the greatest width between two text labels ?
|
||||
// If this has a true value, then label width will be the greatest between labels
|
||||
same_width: true
|
||||
}, options);
|
||||
|
||||
/*
|
||||
* Let's create the core function
|
||||
* It will try to cover all settings and mistakes of using
|
||||
*/
|
||||
return this.each(function()
|
||||
{
|
||||
var $object = $( this );
|
||||
var selected = $object.is(':checked');
|
||||
var type = $object.attr('type');
|
||||
var use_labels = true;
|
||||
var labels;
|
||||
var labels_object;
|
||||
var input_id;
|
||||
|
||||
//Get the aria label from the input element
|
||||
var aria_label = $object.attr( "aria-label" );
|
||||
|
||||
// Hide the object form screen readers
|
||||
$object.attr( "aria-hidden", true );
|
||||
|
||||
// Test if object is a check input
|
||||
// Don't mess me up, come on
|
||||
if( $object.is( ":checkbox" ) === false && $object.is( ":radio" ) === false )
|
||||
return this;
|
||||
|
||||
// Add "labelauty" class to all checkboxes
|
||||
// So you can apply some custom styles
|
||||
$object.addClass( settings.class );
|
||||
|
||||
// Get the value of "data-labelauty" attribute
|
||||
// Then, we have the labels for each case (or not, as we will see)
|
||||
labels = $object.attr( "data-labelauty" );
|
||||
|
||||
use_labels = settings.label;
|
||||
|
||||
// It's time to check if it's going to the right way
|
||||
// Null values, more labels than expected or no labels will be handled here
|
||||
if( use_labels === true )
|
||||
{
|
||||
if( labels == null || labels.length === 0 )
|
||||
{
|
||||
// If attribute has no label and we want to use, then use the default labels
|
||||
labels_object = new Array();
|
||||
labels_object[0] = settings.unchecked_label;
|
||||
labels_object[1] = settings.checked_label;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ok, ok, it's time to split Checked and Unchecked labels
|
||||
// We split, by the "settings.separator" option
|
||||
labels_object = labels.split( settings.separator );
|
||||
|
||||
// Now, let's check if exist _only_ two labels
|
||||
// If there's more than two, then we do not use labels :(
|
||||
// Else, do some additional tests
|
||||
if( labels_object.length > 2 )
|
||||
{
|
||||
use_labels = false;
|
||||
debug( settings.development, "There's more than two labels. LABELAUTY will not use labels." );
|
||||
}
|
||||
else
|
||||
{
|
||||
// If there's just one label (no split by "settings.separator"), it will be used for both cases
|
||||
// Here, we have the possibility of use the same label for both cases
|
||||
if( labels_object.length === 1 )
|
||||
debug( settings.development, "There's just one label. LABELAUTY will use this one for both cases." );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Let's begin the beauty
|
||||
*/
|
||||
|
||||
// Start hiding ugly checkboxes
|
||||
// Obviously, we don't need native checkboxes :O
|
||||
$object.css({ display : "none" });
|
||||
|
||||
// We don't need more data-labelauty attributes!
|
||||
// Ok, ok, it's just for beauty improvement
|
||||
$object.removeAttr( "data-labelauty" );
|
||||
|
||||
// Now, grab checkbox ID Attribute for "label" tag use
|
||||
// If there's no ID Attribute, then generate a new one
|
||||
input_id = $object.attr( "id" );
|
||||
|
||||
if( settings.force_random_id || input_id == null || input_id.trim() === "")
|
||||
{
|
||||
var input_id_number = 1 + Math.floor( Math.random() * 1024000 );
|
||||
input_id = "labelauty-" + input_id_number;
|
||||
|
||||
// Is there any element with this random ID ?
|
||||
// If exists, then increment until get an unused ID
|
||||
while( $( input_id ).length !== 0 )
|
||||
{
|
||||
input_id_number++;
|
||||
input_id = "labelauty-" + input_id_number;
|
||||
debug( settings.development, "Holy crap, between 1024 thousand numbers, one raised a conflict. Trying again." );
|
||||
}
|
||||
|
||||
$object.attr( "id", input_id );
|
||||
}
|
||||
|
||||
// Now, add necessary tags to make this work
|
||||
// Here, we're going to test some control variables and act properly
|
||||
|
||||
var element = jQuery(create( input_id, aria_label, selected, type, labels_object, use_labels ))
|
||||
|
||||
element.click(function(){
|
||||
if($object.is(':checked')){
|
||||
$(element).attr('aria-checked', false);
|
||||
}else{
|
||||
$(element).attr('aria-checked', true);
|
||||
}
|
||||
});
|
||||
|
||||
element.keypress(function(event){
|
||||
event.preventDefault();
|
||||
if(event.keyCode === 32 || event.keyCode === 13){
|
||||
if($object.is(':checked')){
|
||||
$object.prop('checked', false);
|
||||
$(element).attr('aria-checked',false);
|
||||
}else{
|
||||
$object.prop('checked', true);
|
||||
$(element).attr('aria-checked', true);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$object.after(element);
|
||||
|
||||
// Now, add "min-width" to label
|
||||
// Let's say the truth, a fixed width is more beautiful than a variable width
|
||||
if( settings.minimum_width !== false )
|
||||
$object.next( "label[for=" + input_id + "]" ).css({ "min-width": settings.minimum_width });
|
||||
|
||||
// Now, add "min-width" to label
|
||||
// Let's say the truth, a fixed width is more beautiful than a variable width
|
||||
if( settings.same_width != false && settings.label == true )
|
||||
{
|
||||
var label_object = $object.next( "label[for=" + input_id + "]" );
|
||||
var unchecked_width = getRealWidth(label_object.find( "span.labelauty-unchecked" ));
|
||||
var checked_width = getRealWidth(label_object.find( "span.labelauty-checked" ));
|
||||
|
||||
if( unchecked_width > checked_width )
|
||||
label_object.find( "span.labelauty-checked" ).width( unchecked_width );
|
||||
else
|
||||
label_object.find( "span.labelauty-unchecked" ).width( checked_width );
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Tricky code to work with hidden elements, like tabs.
|
||||
* Note: This code is based on jquery.actual plugin.
|
||||
* https://github.com/dreamerslab/jquery.actual
|
||||
*/
|
||||
function getRealWidth( element )
|
||||
{
|
||||
var width = 0;
|
||||
var $target = element;
|
||||
var style = 'position: absolute !important; top: -1000 !important; ';
|
||||
|
||||
$target = $target.clone().attr('style', style).appendTo('body');
|
||||
width = $target.width(true);
|
||||
$target.remove();
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
function debug( debug, message )
|
||||
{
|
||||
if( debug && window.console && window.console.log )
|
||||
window.console.log( "jQuery-LABELAUTY: " + message );
|
||||
};
|
||||
|
||||
function create( input_id, aria_label, selected, type, messages_object, label )
|
||||
{
|
||||
var block;
|
||||
var unchecked_message;
|
||||
var checked_message;
|
||||
var aria = "";
|
||||
|
||||
if( messages_object == null )
|
||||
unchecked_message = checked_message = "";
|
||||
else
|
||||
{
|
||||
unchecked_message = messages_object[0];
|
||||
|
||||
// If checked message is null, then put the same text of unchecked message
|
||||
if( messages_object[1] == null )
|
||||
checked_message = unchecked_message;
|
||||
else
|
||||
checked_message = messages_object[1];
|
||||
}
|
||||
|
||||
if(aria_label == null)
|
||||
aria = "";
|
||||
else
|
||||
aria = 'tabindex="0" role="' + type + '" aria-checked="' + selected + '" aria-label="' + aria_label + '"';
|
||||
|
||||
if( label == true )
|
||||
{
|
||||
block = '<label for="' + input_id + '" ' + aria + '>' +
|
||||
'<span class="labelauty-unchecked-image"></span>' +
|
||||
'<span class="labelauty-unchecked">' + unchecked_message + '</span>' +
|
||||
'<span class="labelauty-checked-image"></span>' +
|
||||
'<span class="labelauty-checked">' + checked_message + '</span>' +
|
||||
'</label>';
|
||||
}
|
||||
else
|
||||
{
|
||||
block = '<label for="' + input_id + '" ' + aria + '>' +
|
||||
'<span class="labelauty-unchecked-image"></span>' +
|
||||
'<span class="labelauty-checked-image"></span>' +
|
||||
'</label>';
|
||||
}
|
||||
|
||||
return block;
|
||||
};
|
||||
|
||||
}( jQuery ));
|
||||
2
wp-content/plugins/updraftplus/includes/labelauty/jquery-labelauty.min.css
vendored
Normal file
2
wp-content/plugins/updraftplus/includes/labelauty/jquery-labelauty.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
wp-content/plugins/updraftplus/includes/labelauty/jquery-labelauty.min.js
vendored
Normal file
1
wp-content/plugins/updraftplus/includes/labelauty/jquery-labelauty.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){function a(e){var a=0,l=e,t="position: absolute !important; top: -1000 !important; ";return l=l.clone().attr("style",t).appendTo("body"),a=l.width(!0),l.remove(),a}function l(e,a){e&&window.console&&window.console.log&&window.console.log("jQuery-LABELAUTY: "+a)}function t(e,a,l,t,n,c){var i,r,s,d="";return null==n?r=s="":(r=n[0],s=null==n[1]?r:n[1]),d=null==a?"":'tabindex="0" role="'+t+'" aria-checked="'+l+'" aria-label="'+a+'"',i=1==c?'<label for="'+e+'" '+d+'><span class="labelauty-unchecked-image"></span><span class="labelauty-unchecked">'+r+'</span><span class="labelauty-checked-image"></span><span class="labelauty-checked">'+s+"</span></label>":'<label for="'+e+'" '+d+'><span class="labelauty-unchecked-image"></span><span class="labelauty-checked-image"></span></label>'}e.fn.labelauty=function(n){var c=e.extend({development:!1,"class":"labelauty",label:!0,separator:"|",checked_label:"Checked",unchecked_label:"Unchecked",force_random_id:!1,minimum_width:!1,same_width:!0},n);return this.each(function(){var n,i,r,s=e(this),d=s.is(":checked"),o=s.attr("type"),h=!0,u=s.attr("aria-label");if(s.attr("aria-hidden",!0),s.is(":checkbox")===!1&&s.is(":radio")===!1)return this;if(s.addClass(c["class"]),n=s.attr("data-labelauty"),h=c.label,h===!0&&(null==n||0===n.length?(i=new Array,i[0]=c.unchecked_label,i[1]=c.checked_label):(i=n.split(c.separator),i.length>2?(h=!1,l(c.development,"There's more than two labels. LABELAUTY will not use labels.")):1===i.length&&l(c.development,"There's just one label. LABELAUTY will use this one for both cases."))),s.css({display:"none"}),s.removeAttr("data-labelauty"),r=s.attr("id"),c.force_random_id||null==r||""===r.trim()){var b=1+Math.floor(1024e3*Math.random());for(r="labelauty-"+b;0!==e(r).length;)b++,r="labelauty-"+b,l(c.development,"Holy crap, between 1024 thousand numbers, one raised a conflict. Trying again.");s.attr("id",r)}var p=jQuery(t(r,u,d,o,i,h));if(p.click(function(){s.is(":checked")?e(p).attr("aria-checked",!1):e(p).attr("aria-checked",!0)}),p.keypress(function(a){a.preventDefault(),32!==a.keyCode&&13!==a.keyCode||(s.is(":checked")?(s.prop("checked",!1),e(p).attr("aria-checked",!1)):(s.prop("checked",!0),e(p).attr("aria-checked",!0)))}),s.after(p),c.minimum_width!==!1&&s.next("label[for="+r+"]").css({"min-width":c.minimum_width}),0!=c.same_width&&1==c.label){var k=s.next("label[for="+r+"]"),m=a(k.find("span.labelauty-unchecked")),y=a(k.find("span.labelauty-checked"));m>y?k.find("span.labelauty-checked").width(m):k.find("span.labelauty-unchecked").width(y)}})}}(jQuery);
|
||||
Reference in New Issue
Block a user