b2636fe5 by Jeff Balicki

plugins

1 parent e45e48f5
Showing 189 changed files with 3705 additions and 0 deletions
#c2p-factory-post h2 {
display: inline-block;
margin-top: 0 !important;
}
#c2p-factory-post .toggle {
float: right;
margin-top: 1px;
width: 75px;
height: 25px;
}
#c2p-factory-post .toggle-on {
background: #007cba;
color: white;
}
#c2p-factory-post .toggle-on, #c2p-factory-post .toggle-off {
font-weight: bold;
font-size: 16px;
}
.add-more-field::before {
padding-right: 2px;
}
.nice-select ul.list {
max-height: 300px;
overflow-y: auto;
}
ol.helper-list {
padding-left: 13px;
}
#cf7-2-post .cf7-2-post-map-labels:hover {
width: auto;
}
#cf7-2-post #custom-meta-fields.mapping-published .post-meta-field:hover .cf7-2-post-map-labels {
width: auto;
min-width: 200px;
}
#cf7-2-post .select2{
min-width: 120px;
}
.misc-pub-section {
padding: 6px 0px 8px;
}
.select2-container:not(.select2-container--disabled):hover {
width: auto !important;
}
#cf7-2-post .default-meta-field select:disabled {
width: max-content;
max-width: 400px;
}
.hybrid-option.system-taxonomy {
color: #0015ff;
}
#c2p-default-post-fields{
padding: 0 12px 12px 12px;
}
#c2p-default-post-fields .cf7-2-post-map-labels {
display: inline-block;
font-size: 1.1em;
min-width: 7rem;
text-align: right;
margin-right: 5px;
}
#c2p-default-post-fields .nice-select.field-options.post-options {
display: inline-block;
float: none;
margin-left: 5px;
vertical-align: middle;
}
#c2p-mapped-fields .cf7-post-msg {
display: inline-block;
margin: 0 5px;
/* width: calc(100% - 325px); */
line-height: 15px;
vertical-align: middle;
position: relative;
}
label{
cursor: default;
}
.nice-select .current {
display: block;
overflow: hidden;
}
.nice-select.disabled {
float: none;
clear: unset;
display: inline-block;
vertical-align: middle;
}
#postbox-container-1 .nice-select {
float: none;
display: inline-block;
vertical-align: middle;
clear: unset;
}
.post_type_labels {
font-size: 1.1em;
}
.display-none,.display-none+.hybrid-select-js,
#c2p-mapped-fields .display-none:not(.custom-taxonomy-input-fields) + .cf7-post-msg,
#cf7-2-post .cf7-2-post-map-labels.hide{
display:none;
}
#adminmenu ul.wp-submenu li a[href="admin.php?page=map_cf7_2_post"] {
display: none;
}
#save_post {
float: right;
margin-bottom: 10px;
}
#creation-action{
display: inline-block;
float: right;
}
#ajax-response{
display: inline-block;
padding: 0 5px;
width: 57%;
}
#save-draft-actions {
display: inline-block;
float: right;
margin-bottom: 5px;
}
#save-draft-action .spinner{
margin: 4px 5px;
}
#post-creation-actions .spinner{
float: left;
}
label[for="post_type"] {
min-width: 90px;
display: inline-block;
}
.add-more-field {
color: blue;
font-size: 1.4rem;
vertical-align: middle;
display: inline-block;
margin-left: -1px;
}
.remove-field {
color: red;
font-size: 1.5em;
vertical-align: middle;
display: inline-block;
margin-left: -1px;
margin-bottom: 3px;
}
.remove-field:hover,.add-more-field:hover { cursor: pointer; }
#cf7-2-post .cf7-post-error-msg{
display: inline-block;
margin: 0 5px;
width: calc(100% - 435px);
line-height: 15px;
vertical-align: middle;
position: relative;
}
#cf7-2-post #c2p-post-meta-fields .cf7-post-error-msg,
#cf7-2-post .taxonomy-fields .cf7-post-error-msg{
width: calc(100% - 480px);
min-width: 200px;
margin-left: 2px;
vertical-align: middle;
line-height: 15px;
}
#c2p-mapped-fields li > div:not(.display-none) {
display: inline-block;
margin-right: 10px;
box-sizing: border-box;
}
#cf7-2-post .cf7-post-error-msg a {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: calc(100% - 50px);
vertical-align: middle;
margin-left: 0;
padding-right: 0;
}
#cf7-2-post .cf7-post-error-msg a.code:hover {
position: absolute;
width: auto;
top: -5px;
}
.custom-taxonomy-input-fields p {
margin-top: 0;
}
.custom-taxonomy-input-fields > p > em {
color: blue;
font-weight: bold;
}
.custom-meta-field select.field-options {
width: 200px;
padding: 3px 0;
}
/* #cf7-2-post .post-meta-field, */
#cf7-2-post .custom-taxonomy-field{
min-width: 460px;
}
#cf7-2-post #custom-meta-fields.mapping-published .custom-meta-field,
#cf7-2-post #post_taxonomy_map.mapping-published .custom-taxonomy-field {
max-width: 80%;
width: auto;
}
#cf7-2-post #custom-meta-fields.mapping-published .cf7-post-error-msg,
#cf7-2-post #post_taxonomy_map.mapping-published .cf7-post-error-msg{
width: auto;
min-width: 0;
max-width: calc(100% - 475px);
margin-right: 0;
}
#cf7-2-post #custom-meta-fields.mapping-published .cf7-post-error-msg .cf7-2-post-map-labels {
min-width: 0;
width: auto;
}
#cf7-2-post .mapping-published .cf7-2-post-map-labels:disabled {
max-width: 260px;
width: auto;
}
#cf7-2-post .custom-taxonomy-input-fields input {
width: 100px;
}
#cf7-2-post .cf7-2-post-map-labels.taxonomy-slug {
width: 170px;
}
.custom-taxonomy-input-fields label {
margin: 0 5px;
}
.misc-pub-section.misc-pub-post-type label[for="post_type"]::before{
font-family: "dashicons";
content: "\f537";
}
#post-type-display, p.post-type-display{
font-weight: 600;
margin-top:0;
margin-bottom:0;
}
#post-type-select input[type="text"],
select#post_type_source,
select#system-post-type {
/* width: calc(50% - 5px); */
}
#system-poststuff span.code {
background-color: #eaeaea;
display: inline-block;
padding: 5px 10px;
}
.post_type_labels {
min-width: 90px;
display: inline-block;
/* width: calc(50% - 5px); */
}
#c2p-factory-post {
background: white;
padding: 5px 10px;
border: solid 1px #d2d2d2;
}
#post_type_is_menu_position{
display: none;
}
input[name="mapped_post_type_show_in_menu"]:checked ~ div#post_type_is_menu_position{
display: block;
}
select.field-options option{
text-align: right;
}
select.field-options option.filter-option{
color: red;
}
p.cf7-post-error-msg span.code{
font-size: 1.1em;
}
#c2p-mapped-fields span.animate-color,
#c2p-mapped-fields span.animate-change{
-webkit-animation: color-change 1s 3;
-moz-animation: color-change 1s 3;
-o-animation: color-change 1s 3;
-ms-animation: color-change 1s 3;
animation: color-change 1s 3;
}
#c2p-default-post-fields, #c2p-post-meta-fields, #c2p-taxonomy-fields {
background-color: white;
padding: 10px 5px;
border-radius: 3px;
border: solid 1px #dddada;
}
#menu-position {
display: inline-block;
}
.post-field-name {display: inline-block;}
#c2p-post-meta-fields > li {margin: 0;}
label.post_type_cb_labels {
border-bottom: blue 1px dotted;
padding: 2px 4px;
margin-right: 8px;
display: inline-block;
background-color: #ececec;
border-radius: 6px;
}
@-webkit-keyframes color-change {
0% { background-color: red; }
50% { background-color: inherit; }
100% { background-color: red; }
}
@-moz-keyframes color-change {
0% { background-color: red; }
50% { background-color: inherit; }
100% { background-color: red; }
}
@-ms-keyframes color-change {
0% { background-color: red; }
50% { background-color: inherit; }
100% { background-color: red; }
}
@-o-keyframes color-change {
0% { background-color: red; }
50% { background-color: inherit; }
100% { background-color: red; }
}
@keyframes color-change {
0% { background-color: red; }
50% { background-color: inherit; }
100% { background-color: red; }
}
span.link-button.disabled{
color: grey;
cursor: not-allowed;
}
span.link-button.enabled{
color: blue;
cursor: pointer;
text-decoration: underline;
}
button.button-link.close-details {
vertical-align: middle;
}
.error-msg{
color:red;
}
#c2p-filter-clipboard {
position: relative;
}
.popup {
display: none;
position: absolute;
top: -38px;
left: 38px;
background: #515151;
color: white;
padding: 5px;
font-weight: bold;
border-radius: 3px;
}
#c2p-filter-clipboard .popup {
top: auto;
bottom: 23px;
}
.cf7-post-msg a.code:hover + span.popup{
display:block;
width: max-content;
}
.popup span {
display: block;
font-weight: normal;
}
.spinner.meta-label {
float: none;
margin: 4px 57px;
display:none;
visibility: visible;
}
.code {
padding: 5px;
display: inline-block;
background: #efefef;
margin-left: 10px;
}
.code >.code {
padding:0px;
background:none;
margin-left: 0;
}
select.hybridddised.display-none + .hybrid-dropdown {
display: none;
}
.custom-meta-field .nice-select, #post_taxonomy_map .nice-select {
float: none;
clear: unset;
display: inline-block;
vertical-align: middle;
}
#c2p-tax-notes, #cf7-2-post p,#c2p-tax-notes li {
margin: 0;
}
#c2p-tax-notes li {
list-style: inside;
}
.custom-taxonomy-field span.php-filter-button {
background-image: url('./image/php-sprite.png');
width: 22px;
display: inline-block;
height: 11px;
background-size: 200%;
vertical-align: text-bottom;
margin-left: 4px;
border: solid 1px blue;
border-radius: 3px;
padding: 1px 2px;
display: none;
}
.dashicons.remove-field + .php-filter-button {
display: inline-block;
}
.hooked .dashicons.remove-field + .php-filter-button {
display: none;
}
.custom-taxonomy-field span.php-filter-button:hover {
cursor: pointer;
color: blue;
background-position-x: 26px;
}
#c2p-taxonomy-fields ul.helper-list > li {
display: block;
}
#c2p-taxonomy-fields{
position: relative;
}
#c2p-taxonomy-fields ul.helper-list:not(.display-none) {
display: inline-block;
position: absolute;
border: solid 1px;
border-radius: 3px;
padding: 3px;
list-style: none;
margin: -22px 0 0 3px;
background-color: white;
z-index: 108;
}
#c2p-taxonomy-fields ul.helper-list .dashicons {
position: absolute;
top: -13px;
right: -6px;
width: 14px;
height: 14px;
background: white;
transform: rotate(45deg);
}
#wpbody-content .inline-edit-row-page .inline-edit-col-right {
margin-top: 0;
}
.c2p-post-type {
font-weight: bold;
}
.display-none, .inline-edit-col .display-none.c2p-delete-mapping{display:none}
.c2p-delete-warning {
line-height: normal;
clear: both;
}
a:hover + .popup {
display: block;
position: absolute;
background: black;
color: white;
padding: 2px 5px;
margin-left: 5px;
}
.c2p-delete-data a span {
font-weight: bold;
}
.cf72post-field label {
font-weight: bold;
min-width: 175px;
display: inline-block;
}
.cf72post-field label + div {
display: inline-block;
}
field-value {
vertical-align: middle;
display: inline-block;
}
.cf72post-field {
padding: 1px 0;
}
.default-post-fields label {
width: 8em;
display: inline-block;
text-align: right;
}
.default-post-fields li {
margin: 0;
}
<?php // Silence is golden
\ No newline at end of file
(function($) {
//obtained from wordpress codex: https://codex.wordpress.org/Plugin_API/Action_Reference/quick_edit_custom_box
// we create a copy of the WP inline edit post function
var $wp_quick_edit = inlineEditPost.edit;
// and then we overwrite the function with our own code
inlineEditPost.edit = function( id ) {
// "call" the original WP edit function
// we don't want to leave WordPress hanging
$wp_quick_edit.apply( this, arguments );
// now we take care of our business
// get the post ID
var $post_id = 0;
if ( typeof( id ) == 'object' ) {
$post_id = parseInt( this.getId( id ) );
}
if ( $post_id > 0 ) {
// define the edit row
var $edit_row = $( '#edit-' + $post_id );
var $post_row = $( '#post-' + $post_id );
// get the status
var $submit = $('.cf7-2-post-submit', $post_row);
if($submit.length>0 && 'yes'==$submit.text()){
$('input[name="cf7_2_post_submit"]', $edit_row).prop('checked', true);
}
}
}
})(jQuery);
(function($) {
//obtained from wordpress codex: https://codex.wordpress.org/Plugin_API/Action_Reference/quick_edit_custom_box
// we create a copy of the WP inline edit post function
let $wp_quick_edit = inlineEditPost.edit;
// and then we overwrite the function with our own code
inlineEditPost.edit = function( id ) {
// "call" the original WP edit function
// we don't want to leave WordPress hanging
$wp_quick_edit.apply( this, arguments );
// now we take care of our business
// get the post ID
let postId = 0;
if ( typeof( id ) == 'object' ) {
postId = parseInt( this.getId( id ) );
}
if ( postId > 0 ) {
// define the edit row
let $editRow = $( '#edit-' + postId ),
$postRow = $( '#post-' + postId ),
$type = $('.cf7-2-post-type', $postRow);
if($type.length>0){
let $warn = $('.c2p-delete-warning',$editRow),
$delete = $('.c2p-delete-mapping',$editRow);
$('.c2p-post-type', $delete).text($type.val());
$('.title>input', $delete).val(postId).on('change',function(){
if(this.checked){
$warn.show();
if($type.is('.c2p-factory')){
let $data = $('.c2p-delete-data',$delete),
$filter = $('span', $data).not('.popup'), $clip, text;
if($filter.length>0){
$clip = $('a',$data).remove(),
text = $clip.data('clipboard-text').replace('${post_type}',$type.val());
$clip.attr('data-clipboard-text', text).text($filter.text());
$filter.after($clip);
$filter.remove();
$data.show();
new Clipboard($clip[0]);
}
}
}else{
$warn.hide();
}
});
$delete.show();
}
}
}
})(jQuery);
(function($) {
$(document).ready(function(){
$('#toplevel_page_wpcf7 li a[href="admin.php?page=map_cf7_2_post"]').parent().remove();
});
})(jQuery);
<?php
/**
* Display quickedit options in table of wpcf7 form posts.
* @since 5.3.0
*/
wp_nonce_field( 'c2p_quickedit_nonce', 'c2p_nonce' );
?>
<fieldset class="inline-edit-col-right">
<div class="inline-edit-col">
<div class="inline-edit-group wp-clearfix">
<label class="alignright display-none c2p-delete-mapping">
<span class="title"><input type="checkbox" name="delete_c2p_map" value="0"><?= __('Delete mapping:','post-my-cf7-form')?><span class="c2p-post-type"></span></span>
<div class="c2p-delete-warning display-none">
<em><?= __('This will reset the mapping')?></em>
<div class="c2p-delete-data display-none"><a class="code" data-clipboard-text="
add_filter('c2p_delete_all_submitted_posts','delete_all_submissions',10,3);
/**
* this filter controls wether or not to delete all submissions saved to the custom post type in the dashboard.
* @param Boolean $delete_all default is false
* @param String $post_type the custom post type that is mapped.
* @param String $cf7_key the current form key of which the mapping is being deleted.
* @return Boolean .
*/
function delete_all_submissions($delete_all, $post_type, $cf7_key){
if('${post_type}'!=$post_type) return $delete_all;
return true;
}
add_filter('c2p_delete_all_submitted_posts_query','delete_post_submissions',10,3);
/**
* In case the above filter return true, this filter controls the query to retrive the posts which get deleted.
* @param Array $post_query query to retrieve posts to be deleted (all by default), set codex get_posts() documention.
* @param String $post_type the custom post type that is mapped.
* @param String $cf7_key the current form key of which the mapping is being deleted.
* @return Boolean .
*/
function delete_all_submissions($post_query, $post_type, $cf7_key){
if('${post_type}'!=$post_type) return $post_query;
//modify the query such as to delete posts by a certain author or a perticular date...
return $post_query;
}" href="javascript:void(0);"></a><?= __('WARNING: this will also delete all saved submissions! Use this <span>filter</span> in your <code>functions.php</code> file to control the deletion of saved submissions.','post-my-cf7-form')?><span class="popup display-none">Click to Copy!</span></div>
</div>
</label>
</div>
</div>
</fieldset>
<?php
if(!empty($mapped_fields)){
foreach( $mapped_fields as $cf7_field => $post_field ){
?>
<div class="cf72post-field">
<label><?=$cf7_field?></label>
<?php if(false && current_user_can('edit_others_posts',$post->ID)):?>
<input type="text" class="field-value" name="<?= $post_field?>" value="<?= get_post_meta($post->ID, $post_field , true)?>" />
<?php else:
$value = get_post_meta($post->ID, $post_field , true);
if(is_array($value)){
echo '<div>';
foreach($value as $key=>$avalue){
if(is_array($avalue)){
echo $key.":";
foreach($avalue as $row=>$rvalue){
$out = '';
if(!empty($rvalue)) $out = implode(',', $rvalue);
output_cf72post_field($out);
}
echo '</div><div>';
}else{
echo $avalue.',';
}
}
echo '</div>';
}else{
output_cf72post_field($value);
}
endif;?>
</div>
<?php
}
}
function output_cf72post_field($value){
echo '<span class="field-value">'.$value.'</span>';
}
<fieldset class="inline-edit-col-left">
<div class="inline-edit-col">
<label><span class="title"><?=__('CF7 >> Post', 'post-my-contact-form-7' )?></span><input class="cf72post-submit" type="checkbox" name="cf7_2_post_submit"/><? _e('Form Submitted', 'post-my-contact-form-7' )?></label>
<p><em><?=__('Uncheck to reload post in form', 'post-my-contact-form-7' )?></em></p>
</div>
</fieldset>
<?php
// require_once plugin_dir_path( dirname( __DIR__ ) ) . 'includes/class-cf7-2-post-factory.php' ;
// $is_new_mapping = true;
$select_form_fields='<select %4$s name="cf7_2_post_map_meta_value%1$s" value="%2$s" class="field-options post-options select-hybrid">
<option class="default-option" selected="true" value="">'. __('Select a form field', 'post-my-contact-form-7' ). '</option>
<option class="filter-option" value="cf7_2_post_filter%3$s%1$s">'.__('Hook with a filter', 'post-my-contact-form-7' ). '</option>
</select>';
//%1 - post-field name.
//%2 - form-field name.
//%3 - post type.
//%4 - disabled attr.
$mapped_fields = $post_mapper->get_mapped_meta_fields();
// debug_msg($mapped_fields, "meta fields...");
// debug_msg($post_mapper);
foreach( $mapped_fields as $cf7_field => $post_field ):
?>
<li>
<div class="post-meta-field cf7-2-post-field">
<div class="post-field-name">
<?php
if('system' == $source){
echo $factory->get_metafield_menu($post_mapper->get('type'),$post_field);
}else{
echo $post_mapper->get_metafield_input($post_field);
}
?>
</div>
<?php
//display the meta-field's form field dropdown.
echo sprintf( $select_form_fields, "-$post_field", $cf7_field, "-{$post_mapper->get('type')}", '');
?>
<span class="dashicons dashicons-remove remove-field"></span>
</div><span class="cf7-post-msg"></span>
</li>
<?php endforeach;?>
<li class="default-meta-field">
<div class="post-meta-field cf7-2-post-field">
<span class="spinner meta-label"></span>
<div class="post-field-name">
<?php
if('system' == $source){
echo $factory->get_metafield_menu($post_mapper->get('type'),'');
}else{
echo $post_mapper->get_metafield_input('');
}
?>
</div>
<?= sprintf( $select_form_fields, '-meta_key_1','','', 'disabled="true"'); //display the form field selevt.?>
<span class="dashicons dashicons-insert add-more-field"></span>
</div>
</li>
<?php
/**
* Loop taxonomies
*/
$mapped_taxonomy = $post_mapper->get_mapped_taxonomy();
foreach( $mapped_taxonomy as $cf7_field => $post_taxonomy ) :
$taxonomy = $post_mapper->get_taxonomy($post_taxonomy);
$val = $cf7_field;
if(strpos($cf7_field,'cf7_2_post_filter-')===0) $val = '';
?>
<li>
<div class="custom-taxonomy-field cf7-2-post-field<?= empty($val)?' hooked':'';?>">
<label class="taxonomy-label-field cf7-2-post-map-labels">
<span class="taxonomy-name">
<strong><?= $taxonomy['name']; ?></strong>
</span>&nbsp;
(<span class="enabled link-button edit-taxonomy"><?= __('Edit', 'post-my-contact-form-7')?></span>)
</label>
<select class="select-hybrid field-options taxonomy-options" name="cf7_2_post_map_taxonomy_value-<?=$post_taxonomy;?>/<?=$val?>" value="<?=$cf7_field?>">
<option class="default-option" selected="true" value="">
<?= __('Select a form field', 'post-my-contact-form-7' )?>
</option>
<option class="filter-option" value="cf7_2_post_filter-<?=$post_taxonomy?>">
<?=__('Hook with a filter', 'post-my-contact-form-7' )?>
</option>
</select>
<span class="dashicons dashicons-remove remove-field"></span>
<span class="php-filter-button"></span>
</div>
<span class="cf7-post-msg"></span>
<div class="custom-taxonomy-input-fields display-none">
<p>
<?= __('Choose a taxonomy, in blue are existing public taxonomies', 'post-my-contact-form-7'); ?>
</p>
<?= $post_mapper->get_taxonomy_listing($post_taxonomy); ?>
<label for="cf7_2_post_map_taxonomy_names-<?=$post_taxonomy; ?>">
<strong><?= __('Plural Name', 'post-my-contact-form-7')?></strong>
</label>
<?php $readonly = ('system'==$taxonomy['source']) ? 'readonly="true"' : '';?>
<input class="c2p-tax-labels plural-name" type="text" <?=$readonly?> name="cf7_2_post_map_taxonomy_names-<?= $post_taxonomy; ?>" value="<?= $taxonomy['name']?>" />
<label for="cf7_2_post_map_taxonomy_name-<?= $post_taxonomy; ?>">
<strong><?=__('Singular Name', 'post-my-contact-form-7'); ?></strong>
</label>
<input class="c2p-tax-labels singular-name" type="text" name="cf7_2_post_map_taxonomy_name-<?=$post_taxonomy; ?>" <?=$readonly?> value="<?=$taxonomy['singular_name']; ?>">
<label for="cf7_2_post_map_taxonomy_slug-<?=$post_taxonomy; ?>">
<strong><?=__('Slug', 'post-my-contact-form-7'); ?></strong>
</label>
<input class="c2p-tax-labels taxonomy-slug" type="text" name="cf7_2_post_map_taxonomy_slug-<?=$post_taxonomy; ?>" <?=$readonly?> value="<?=$post_taxonomy; ?>" />
<input type="hidden" class="taxonomy-source" name="cf7_2_post_map_taxonomy_source-<?=$post_taxonomy; ?>" value="<?=$taxonomy['source']; ?>" />
<button class="button-link close-details">
<span class="screen-reader-text">
<?=__('Toggle panel: Taxonomy details', 'post-my-contact-form-7'); ?>
</span>
<span class="focus button save-taxonomy">
<?= __('Save', 'post-my-contact-form-7')?>
</span>
</button>
</div>
</li>
<?php endforeach; // ENDFOREACH $mapped_taxonomy as $cf7_field => $post_taxonomy ?>
<?php
/**
* Default new taxonomy slug
*/
$taxonomy_slug = sanitize_title($post_mapper->get('singular_name')) . '_categories';
?>
<li>
<div class="custom-taxonomy-field cf7-2-post-field">
<label class="taxonomy-label-field cf7-2-post-map-labels">
<span class="taxonomy-name">
<strong><?=__('New Categories', 'post-my-contact-form-7' )?></strong>
</span>&nbsp;(<span class="link-button edit-taxonomy disabled"><?= __('Edit', 'post-my-contact-form-7')?></span>)
</label>
<select disabled="true" class="field-options taxonomy-options" name="cf7_2_post_map_taxonomy_value-<?=$taxonomy_slug;?>" value="">
<option class="default-option" selected="true" value="">
<?= __('Select a form field', 'post-my-contact-form-7' )?>
</option>
<option class="filter-option" value="cf7_2_post_filter-<?=$taxonomy_slug?>">
<?=__('Hook with a filter', 'post-my-contact-form-7' )?>
</option>
</select>
<span class="dashicons dashicons-insert add-more-field"></span>
<span class="php-filter-button"></span>
</div>
<span class="cf7-post-msg"></span>
<div class="display-none custom-taxonomy-input-fields">
<p>
<?= __('Choose a taxonomy, in <em>blue</em> are existing public taxonomies', 'post-my-contact-form-7'); ?>
</p>
<?= $post_mapper->get_taxonomy_listing(); ?>
<label for="cf7_2_post_map_taxonomy_names-<?=$taxonomy_slug; ?>">
<strong><?= __('Plural Name', 'post-my-contact-form-7')?></strong>
</label>
<input type="hidden" class="taxonomy-source" name="cf7_2_post_map_taxonomy_source-<?= $taxonomy_slug;?>" disabled="disabled" value="factory"/>
<input disabled="disabled" class="c2p-tax-labels plural-name" type="text" name="cf7_2_post_map_taxonomy_names-<?= $taxonomy_slug;?>" value="<?=__('New Categories', 'post-my-contact-form-7' )?>">
<label for="cf7_2_post_map_taxonomy_name-<?= $taxonomy_slug;?>">
<strong><?=__('Singular Name', 'post-my-contact-form-7' )?></strong>
</label>
<input disabled="disabled" class="c2p-tax-labels singular-name" type="text" name="cf7_2_post_map_taxonomy_name-<?= $taxonomy_slug;?>" value="New Category">
<label for="cf7_2_post_map_taxonomy_slug-<?= $taxonomy_slug;?>">
<strong><?=__('Slug', 'post-my-contact-form-7' )?></strong>
</label>
<input disabled="disabled" class="c2p-tax-labels taxonomy-slug" type="text" name="cf7_2_post_map_taxonomy_slug-<?= $taxonomy_slug;?>" value="<?= $taxonomy_slug;?>" />
<button class="button-link close-details">
<span class="focus button save-taxonomy">
<?= __('Save', 'post-my-contact-form-7')?>
</span>
</button>
</div>
</li>
<?php
/**
* Display C2P admin tab for filtered mappings.
*
* @link https://profiles.wordpress.org/aurovrata/
* @since 5.4.3
*
* @package Cf7_2_Post
* @subpackage Cf7_2_Post/admin/partials
*/
$cf7_key_flat = str_replace('-','_',$cf7_key);
?>
<h1><?= esc_html('Save submissions as ','post-my-contact-form-7' ); ?><span id="custom-post-title">filter</span></h1>
<!-- $form = get_post($cf7_post_id); ?> -->
<input type="hidden" id="c2p-cf7-key" value="<?=$cf7_key?>"/>
<input type="hidden" id="c2p-mapping-changed" name="c2p_mapping_changes" value="0"/>
<input type="hidden" id="c2p-active-tab" name="c2p_active_tab" value="0"/>
<input type="hidden" id="c2p-mapping-status" name="mapped_post_map" value="<?=$status?>"/>
<input type="hidden" name="mapped_post_default" value="0"/>
<input type="hidden" name="mapped_post_type_source" value="filter"/>
<?php wp_nonce_field('cf7_2_post_mapping', 'cf7_2_post_nonce', false, true);?>
<div id="c2p-factory-post">
<div class="c2p-title-header">
<h2><?=__('Map form to...','post-my-contact-form-7' )?></h2>
<div class="toggle toggle-light"></div>
</div>
<p>
<?= __("This form's submissions saved using an action callback, hook ",'post-my-contact-form-7');?>
<span id="c2p-filter-clipboard" class="cf7-post-msg animate-color">
<a class="code" data-clipboard-text="add_action('cf7_2_post_save_submission','c2p_save_<?=$cf7_key_flat?>',10,3);<?=PHP_EOL?>function c2p_save_<?=$cf7_key_flat?>($form_key, $form_data, $form_files){<?=PHP_EOL?> //$form_key is the unique form key.<?=PHP_EOL?> // $form_data is the submitted form data.<?=PHP_EOL?> //$form_files are submitted files if any.<?=PHP_EOL?>}" href="javascript:void(0);">cf7_2_post_save_submission</a>
<span class="popup"><?= __('Click to copy!', 'post-my-contact-form-7')?>
<span>
<?=__('Paste helper code into your theme functions.php file.', 'post-my-contact-form-7')?>
</span>
</span>
</span>
</p>
</div>
<script type="text/javascript">
(function($){
$(document).ready(function(){
new Clipboard(document.querySelector('#c2p-filter-clipboard a.code'));
})
})( jQuery )
</script>
<div class="c2p-filter">
<?php if(!defined('CF7_GRID_VERSION')){
$closed ='';
echo '<h2>'.__('Hooks & Filters to customise the mapping', 'post-my-contact-form-7').'</h2>';
include_once 'cf7-2-post-helper-metabox.php';
}?>
</div>
<?php
/**
* Provide a admin area view for the plugin
*
* This file is used to markup the admin-facing aspects of the plugin.
*
* @link http://syllogic.in
* @since 1.0.0
*
* @package Cf7_2_Post
* @subpackage Cf7_2_Post/admin/partials
*/
//TODO: add a check box to include or not address fields
?>
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
<div class="control-box cf7_2_post-save">
<fieldset>
<legend><?=__('Save button for Post My CF7 Form extension', 'post-my-contact-form-7')?></legend>
<table id="cf7_2_post-tag-generator" class="form-table">
<tbody>
<tr>
<th scope="row"><label for="tag-generator-panel-submit-values"><?=__('Label', 'post-my-contact-form-7')?></label></th>
<td><input name="values" class="oneline" id="tag-generator-panel-save-values" type="text"></td>
</tr>
<tr>
<th scope="row"><label for="tag-generator-panel-submit-id"><?=__('Id attribute', 'post-my-contact-form-7')?></label></th>
<td><input name="id" class="idvalue oneline option" id="tag-generator-panel-save-id" type="text"></td>
</tr>
<tr>
<th scope="row"><label for="tag-generator-panel-submit-class"><?=__('Class attribute', 'post-my-contact-form-7')?></label></th>
<td><input name="class" class="classvalue oneline option" id="tag-generator-panel-save-class" type="text"></td>
</tr>
</tbody>
</table>
</fieldset>
</div>
<div class="insert-box">
<input type="hidden" name="values" value="" />
<input type="text" name="save" class="tag code" readonly="readonly" onfocus="this.select()" />
<div class="submitbox">
<input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" />
</div>
<br class="clear" />
</div>
<script type="text/javascript">
(function( $ ) {
'use strict';
$(document).ready(function() {
$('#adminmenu ul.wp-submenu li a[href="admin.php?page=cf7_post"]').parent().hide();
});
})( jQuery );
</script>
/**
* All of the CSS for your admin-specific functionality should be
* included in this file.
*/
.display-none {
display: none;
}
#wpbody-content .inline-edit-row-page fieldset.hide-element,
#wpbody-content .inline-edit-row-page fieldset.hide-element *{
height: 0;
width: 0;
overflow: hidden;
margin:0;
}
.cf7-2-post-key-error {
color: red;
display: none;
}
.cf7-help-tip{
position: relative;
}
.cf7-help-tip span {
display: none;
}
.cf7-help-tip:hover > span {
display: block;
position: absolute;
width: 210px;
bottom: -18px;
line-height: 1.2em;
font-size: 90%;
left: 90px;
background: #e7e7e7;
padding: 5px;
border: 1px solid grey;
border-radius: 3px;
}
.cf7-help-tip a {
font-size: 95%;
font-style: italic;
}
#shortcode {
line-height: 1.2em;
}
.display-none{display: none;}
span.cf7sg-popup {
background: rgba(227, 224, 224, 0.81);
border-radius: 5px;
top: -2.2em;
left: 10px;
position: absolute;
transition: 500ms ease;
padding: .4em;
white-space: nowrap;
line-height: normal;
border: solid 1px;
}
.row-title.cf7-errors:hover+span.cf7sg-popup {display: block;}
.row-title.cf7-errors::after {
content: '\2731';
color: #d10000;
position: absolute;
top: -5px;
}
fieldset label.c2p-delete-mapping span.title {
width: 100%;
}
.c2p-delete-warning {
max-width: 26em;
}
(function($) {
$(document).ready(function(){
$('table.wp-list-table').on('click','.editinline',function(e){
const $post = $(e.target).closest('tr'),
post_id = $post.attr('id').replace('post-',''),
$edit = $('#edit-'+post_id, $post.parent());
$('fieldset.inline-edit-col-left',$edit).first().children('.inline-edit-col').children(':not(label)').hide();
$('fieldset.inline-edit-col-right',$edit).first().children().hide();
})
})
})(jQuery);
<?php
require_once plugin_dir_path( __FILE__ ) . 'admin/cf7-post-admin-table.php';
//reset the cf7 admin table
$cf7_admin = Cf7_WP_Post_Table::set_table();
if(!$cf7_admin->hooks()){
add_action( 'admin_enqueue_scripts', array($cf7_admin , 'enqueue_styles'));
add_action( 'admin_enqueue_scripts', array($cf7_admin , 'enqueue_script'));
//add_action( 'admin_enqueue_scripts', array($this, 'enqueue_scripts') ));
//modify the CF7 post type
add_action('init', array( $cf7_admin, 'modify_cf7_post_type' ) , 20 );
//cf7 sub-menu
add_action('admin_menu', array( $cf7_admin, 'add_cf7_sub_menu' ));
add_filter( 'custom_menu_order', array( $cf7_admin, 'change_cf7_submenu_order' ));
//modify the cf7 list table columns
add_filter('manage_wpcf7_contact_form_posts_columns' , array( $cf7_admin, 'modify_cf7_list_columns' ),1,1);
add_action('manage_wpcf7_contact_form_posts_custom_column', array( $cf7_admin, 'populate_custom_column') ,1,2 );
add_filter('post_row_actions', array( $cf7_admin, 'modify_cf7_list_row_actions') , 1, 2 );
//change the 'Add New' button link.
add_action('admin_print_footer_scripts', array( $cf7_admin, 'change_add_new_button' ),1);
//catch cf7 delete redirection
add_filter('wp_redirect', array( $cf7_admin, 'filter_cf7_redirect'),1,2 );
/** @since 4.1.8 edit edit link for form posts. */
add_filter('get_edit_post_link', array($cf7_admin, 'edit_form_link'),10,2 );
//add quick edit
//add_action( 'quick_edit_custom_box', array( $cf7_admin, 'quick_edit_box'), 100, 2 );
//cf7-form shortcode
add_shortcode( 'cf7-form', array( $cf7_admin, 'shortcode') );
add_shortcode( 'cf7form', array( $cf7_admin, 'shortcode') );
/** @since 5.3.2 */
add_action('admin_footer', array($cf7_admin, 'update_form_highlight'));
}
.hybrid-dropdown{position:relative;width:max-content;min-width:30px;min-height:2.5em;display:inline-block;vertical-align:baseline;font-size:1em;border:1px solid #6f6f6f;border-radius:.25em;padding:0 30px 0 18px;cursor:pointer;background:inherit}.hybriddd-none{width:unset;padding:0}select.hybridddised{visibility:hidden!important;width:0!important;height:0!important}.hybrid-dropdown:focus{box-shadow:1px 1px 3px}.hybriddd-option::before,.hybriddd-group::before{display:none!important;content:none;margin:0;padding:0}.hybridddised:disabled+.hybrid-dropdown{background:#ccc;color:grey}.hybrid-dropdown .hybriddd-wrapper{overflow:hidden;z-index:7777;position:absolute;left:0;max-height:34vh;min-width:max-content;display:none;background-color:inherit}.hybrid-dropdown.hybriddd-none .hybriddd-wrapper{display:block;position:static;max-width:100%;max-height:none;min-width:auto}.hybriddd-wrapper.hybriddd-grid{width:calc(max-content * var(--hybriddd-col))}.hybrid-dropdown .hybriddd-grid ul.hybriddd-options{display:grid;grid-template-columns:repeat(var(--hybriddd-col),1fr)}.hybrid-dropdown.hybriddd-none .hybriddd-options>li{display:inline-block}.hybrid-dropdown .hybriddd-grid .hybriddd-options>li{display:flex;line-height:0}.hybrid-dropdown .hybriddd-grid .hybridddl{line-height:normal;width:max-content}.hybrid-dropdown.hybriddd-top .hybriddd-wrapper{bottom:var(--hybriddd-top)}.hybrid-dropdown.hybriddd-right .hybriddd-wrapper{right:0;left:auto}.hybrid-dropdown ul.hybriddd-options{border:1px solid #6f6f6f;border-radius:.25em;overflow:hidden auto;scrollbar-width:thin;height:100%;background-color:inherit;overscroll-behavior:contain;position:relative;z-index:18}.hybrid-dropdown:not(.hybriddd-none) ul.hybriddd-options{list-style:none!important;margin:0!important;padding:0!important}.hybrid-dropdown.hybriddd-none .hybriddd-options{display:block;width:auto;margin:0;padding:0;overflow:unset}.hybrid-dropdown.active>.hybriddd-wrapper{display:block}.hybrid-dropdown *,.hybrid-dropdown .hybriddd-options .hybriddd-option,.hybrid-dropdown .hybriddd-options .hybriddd-option ul,.hybrid-dropdown .hybriddd-options .hybriddd-group,.hybrid-dropdown .hybriddd-options .hybriddd-group ul{box-sizing:border-box;cursor:default;margin:0}.hybriddd-selected{position:relative;width:auto;height:100%;padding:.4em 3px;cursor:pointer;min-width:100%;max-width:inherit;display:inline-block;z-index:7}.hybriddd-none .hybriddd-selected{display:none}.hybriddd-selected::after{border-bottom:2px solid #90a1b5;border-right:2px solid #90a1b5;content:'';display:block;height:5px;margin-top:-4px;pointer-events:none;position:absolute;right:-12px;top:50%;-webkit-transform-origin:66% 66%;-ms-transform-origin:66% 66%;transform-origin:66% 66%;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-transition:all 0.15s ease-in-out;transition:all 0.15s ease-in-out;width:5px}.hybriddd-landscape .hybriddd-options>.hybriddd-option,.hybriddd-landscape .hybriddd-options>.hybriddd-group>ul>.hybriddd-option{display:inline-block}.hybriddd-landscape .hybriddd-options .hybridddl:dir(rtl){float:right}.hybriddd-landscape .hybriddd-options .hybriddd-group{clear:both;border-top:none;padding:0}.hybriddd-landscape .hybriddd-option>label{padding:.1em}ul.hybriddd-options::-webkit-scrollbar{width:6px}ul.hybriddd-options::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgb(1 1 1 / 35%)}.hybriddd-options ul{list-style:none;padding:0}.hybriddd-group>span{font-weight:700}.hybriddd-l0{padding:0 .5em}.hybriddd-l1{padding:0 1em 0 1em}.hybriddd-l2{padding:0 1em 0 1.5em}.hybriddd-l3{padding:0 1em 0 2em}.hybriddd-l4{padding:0 1em 0 2.5em}.hybriddd-l5{padding:0 1em 0 3em}.hybriddd-group>span{padding:0 .5em}.hybriddd-options ul .hybriddd-group>span{padding:0 1em}.hybriddd-option label{user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;display:block}.hybriddd-none .hybriddd-option label{padding:0;position:relative;width:100%}.hybriddd-option label>*{display:inline-block}.hybridddcb{width:0;height:0;vertical-align:middle;display:inline-block;visibility:hidden}.hybrid-dropdown.show-cb .hybridddcb{visibility:visible;width:16px;height:16px;border:solid 1px;margin:0 3px 3px 2px}.hybriddd-option>label>input{opacity:0;position:absolute;width:0;height:0}.hybridddcb::before{content:'';display:block;width:10px;height:10px;margin:2px auto}.hybriddd-option input[type="radio"] .hybridddcb{border-radius:50%}.hybriddd-option input:checked .hybridddcb::before{border:solid 3px;padding:1px}.hybriddd-option.active>label{background:#0466ff;color:#fff}input:checked+.hybridddcb::before{background:#fff}.hybriddd-option.partial>label .hybridddcb::before{background:#a5a5a5}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="421.79376mm"
height="440.0788mm"
viewBox="0 0 421.79376 440.0788"
version="1.1"
id="svg8"
inkscape:export-filename="/home/vrata/Documents/WordPress/Repo/post-my-contact-form-7/assets/screenshot-9.png"
inkscape:export-xdpi="90.029999"
inkscape:export-ydpi="90.029999"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="screenshot-9.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="598.89035"
inkscape:cy="993.24656"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
showguides="false"
inkscape:guide-bbox="true"
fit-margin-top="20"
fit-margin-left="20"
fit-margin-right="20"
fit-margin-bottom="20"
inkscape:window-width="1920"
inkscape:window-height="998"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1">
<sodipodi:guide
position="20.000001,275.73051"
orientation="1,0"
id="guide5054"
inkscape:locked="false" />
<sodipodi:guide
position="45.123332,264.50519"
orientation="1,0"
id="guide5056"
inkscape:locked="false" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(269.62973,-11.845862)">
<rect
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.78199995;stroke-miterlimit:3.70000005;stroke-dasharray:none;stroke-opacity:1"
id="rect5058"
width="392.78674"
height="411.37302"
x="-254.44058"
y="26.966103"
inkscape:export-xdpi="90.029999"
inkscape:export-ydpi="90.029999" />
<image
sodipodi:absref="/home/vrata/Desktop/Screenshots/Screenshot-20181205095337-643x555.png"
xlink:href="/home/vrata/Desktop/Screenshots/Screenshot-20181205095337-643x555.png"
width="170.12709"
height="146.84375"
preserveAspectRatio="none"
id="image4825"
x="-120.37301"
y="59.223335" />
<image
sodipodi:absref="/home/vrata/Desktop/Screenshots/Screenshot-20181205095231-1430x183.png"
xlink:href="/home/vrata/Desktop/Screenshots/Screenshot-20181205095231-1430x183.png"
width="378.35416"
height="48.418751"
preserveAspectRatio="none"
id="image4887"
x="-249.62973"
y="383.50592" />
<image
sodipodi:absref="/home/vrata/Pictures/Screenshot from 2018-12-05 09-51-35.png"
xlink:href="/home/vrata/Pictures/Screenshot from 2018-12-05 09-51-35.png"
width="381.79376"
height="101.07083"
preserveAspectRatio="none"
id="image4984"
x="-249.62973"
y="259.8031" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="-250.16426"
y="39.886715"
id="text4989"><tspan
sodipodi:role="line"
id="tspan4987"
x="-250.16426"
y="39.886715"
style="stroke-width:0.26458332">how to map a field to a taxonomy?</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:7.76111126px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="-223.97185"
y="74.631752"
id="text4993"><tspan
sodipodi:role="line"
id="tspan4991"
x="-223.97185"
y="74.631752"
style="stroke-width:0.26458332">In your form create</tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="84.333138"
style="stroke-width:0.26458332"
id="tspan4995">a new field, this can </tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="94.034531"
style="stroke-width:0.26458332"
id="tspan4997">be either a checkbox</tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="103.73592"
style="stroke-width:0.26458332"
id="tspan4999">a radio field, or a </tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="113.43731"
style="stroke-width:0.26458332"
id="tspan5001">dropdown select field.</tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="123.13869"
style="stroke-width:0.26458332"
id="tspan5003" /><tspan
sodipodi:role="line"
x="-223.97185"
y="132.84009"
style="stroke-width:0.26458332"
id="tspan5005">Make sure you leave</tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="142.54147"
style="stroke-width:0.26458332"
id="tspan5007">the options section </tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="152.24286"
style="stroke-width:0.26458332"
id="tspan5009">blank as all options </tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="161.94426"
style="stroke-width:0.26458332"
id="tspan5011">will automatically be f</tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="171.64565"
style="stroke-width:0.26458332"
id="tspan5013">filled with the mapped</tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="181.34703"
style="stroke-width:0.26458332"
id="tspan5015">taxonomy terms by </tspan><tspan
sodipodi:role="line"
x="-223.97185"
y="191.04842"
style="stroke-width:0.26458332"
id="tspan5017">the plugin </tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:8.46666622px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="-225.04094"
y="221.62999"
id="text5040"><tspan
sodipodi:role="line"
id="tspan5038"
x="-225.04094"
y="221.62999"
style="stroke-width:0.26458332">In your form mapping edit page (at the bottom), you can select a</tspan><tspan
sodipodi:role="line"
x="-225.04094"
y="232.21332"
style="stroke-width:0.26458332"
id="tspan5042">taxonomy field. add a new field (blue + button) and edit your </tspan><tspan
sodipodi:role="line"
x="-225.04094"
y="242.79666"
style="stroke-width:0.26458332"
id="tspan5044">taxonomy, either select an existing one or create new one, then save</tspan><tspan
sodipodi:role="line"
x="-225.04094"
y="253.37999"
style="stroke-width:0.26458332"
id="tspan5050">your selection.</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:8.46666622px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="-223.43733"
y="369.6973"
id="text5048"><tspan
sodipodi:role="line"
id="tspan5046"
x="-223.43733"
y="369.6973"
style="stroke-width:0.26458332">Once you have selected the taxonomy, you need to map it to the field</tspan><tspan
sodipodi:role="line"
x="-223.43733"
y="380.28064"
style="stroke-width:0.26458332"
id="tspan5052">you created in the first step. </tspan></text>
</g>
</svg>
.nice-select {
-webkit-tap-highlight-color: transparent;
background-color: #fff;
border-radius: 5px;
border: solid 1px #e8e8e8;
box-sizing: border-box;
clear: both;
cursor: pointer;
display: block;
float: left;
font-family: inherit;
font-size: 14px;
font-weight: normal;
height: 42px;
line-height: 40px;
outline: none;
padding-left: 18px;
padding-right: 30px;
position: relative;
text-align: left !important;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
width: auto; }
.nice-select:hover {
border-color: #dbdbdb; }
.nice-select:active, .nice-select.open, .nice-select:focus {
border-color: #999; }
.nice-select:after {
border-bottom: 2px solid #999;
border-right: 2px solid #999;
content: '';
display: block;
height: 5px;
margin-top: -4px;
pointer-events: none;
position: absolute;
right: 12px;
top: 50%;
-webkit-transform-origin: 66% 66%;
-ms-transform-origin: 66% 66%;
transform-origin: 66% 66%;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transition: all 0.15s ease-in-out;
transition: all 0.15s ease-in-out;
width: 5px; }
.nice-select.open:after {
-webkit-transform: rotate(-135deg);
-ms-transform: rotate(-135deg);
transform: rotate(-135deg); }
.nice-select.open .list {
opacity: 1;
pointer-events: auto;
-webkit-transform: scale(1) translateY(0);
-ms-transform: scale(1) translateY(0);
transform: scale(1) translateY(0); }
.nice-select.disabled {
border-color: #ededed;
color: #999;
pointer-events: none; }
.nice-select.disabled:after {
border-color: #cccccc; }
.nice-select.wide {
width: 100%; }
.nice-select.wide .list {
left: 0 !important;
right: 0 !important; }
.nice-select.right {
float: right; }
.nice-select.right .list {
left: auto;
right: 0; }
.nice-select.small {
font-size: 12px;
height: 36px;
line-height: 34px; }
.nice-select.small:after {
height: 4px;
width: 4px; }
.nice-select.small .option {
line-height: 34px;
min-height: 34px; }
.nice-select .list {
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 0 1px rgba(68, 68, 68, 0.11);
box-sizing: border-box;
margin-top: 4px;
opacity: 0;
overflow: hidden;
padding: 0;
pointer-events: none;
position: absolute;
top: 100%;
left: 0;
-webkit-transform-origin: 50% 0;
-ms-transform-origin: 50% 0;
transform-origin: 50% 0;
-webkit-transform: scale(0.75) translateY(-21px);
-ms-transform: scale(0.75) translateY(-21px);
transform: scale(0.75) translateY(-21px);
-webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out;
transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out;
z-index: 9; }
.nice-select .list:hover .option:not(:hover) {
background-color: transparent !important; }
.nice-select .option {
cursor: pointer;
font-weight: 400;
line-height: 40px;
list-style: none;
min-height: 40px;
outline: none;
padding-left: 18px;
padding-right: 29px;
text-align: left;
-webkit-transition: all 0.2s;
transition: all 0.2s; }
.nice-select .option:hover, .nice-select .option.focus, .nice-select .option.selected.focus {
background-color: #f6f6f6; }
.nice-select .option.selected {
font-weight: bold; }
.nice-select .option.disabled {
background-color: transparent;
color: #999;
cursor: default; }
.no-csspointerevents .nice-select .list {
display: none; }
.no-csspointerevents .nice-select.open .list {
display: block; }
.nice-select {
-webkit-tap-highlight-color: transparent;
background-color: #fff;
border-radius: 5px;
border: solid 1px #e0e7ee;
box-sizing: border-box;
clear: both;
cursor: pointer;
display: block;
float: left;
font-family: inherit;
font-size: 14px;
font-weight: normal;
height: 42px;
line-height: 40px;
outline: none;
padding-left: 18px;
padding-right: 30px;
position: relative;
text-align: left !important;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
width: auto; }
.nice-select:hover {
border-color: #d0dae5; }
.nice-select:active, .nice-select.open, .nice-select:focus {
border-color: #88bfff; }
.nice-select:after {
border-bottom: 2px solid #90a1b5;
border-right: 2px solid #90a1b5;
content: '';
display: block;
height: 5px;
margin-top: -4px;
pointer-events: none;
position: absolute;
right: 12px;
top: 50%;
-webkit-transform-origin: 66% 66%;
-ms-transform-origin: 66% 66%;
transform-origin: 66% 66%;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transition: all 0.15s ease-in-out;
transition: all 0.15s ease-in-out;
width: 5px; }
.nice-select.open:after {
-webkit-transform: rotate(-135deg);
-ms-transform: rotate(-135deg);
transform: rotate(-135deg); }
.nice-select.open .list {
opacity: 1;
pointer-events: auto;
-webkit-transform: scale(1) translateY(0);
-ms-transform: scale(1) translateY(0);
transform: scale(1) translateY(0); }
.nice-select.disabled {
border-color: #e7ecf2;
color: #90a1b5;
pointer-events: none; }
.nice-select.disabled:after {
border-color: #cdd5de; }
.nice-select.wide {
width: 100%; }
.nice-select.wide .list {
left: 0 !important;
right: 0 !important; }
.nice-select.right {
float: right; }
.nice-select.right .list {
left: auto;
right: 0; }
.nice-select.small {
font-size: 12px;
height: 36px;
line-height: 34px; }
.nice-select.small:after {
height: 4px;
width: 4px; }
.nice-select.small .option {
line-height: 34px;
min-height: 34px; }
.nice-select .list {
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 0 1px rgba(68, 88, 112, 0.11);
box-sizing: border-box;
margin-top: 4px;
opacity: 0;
overflow: hidden;
padding: 0;
pointer-events: none;
position: absolute;
top: 100%;
left: 0;
-webkit-transform-origin: 50% 0;
-ms-transform-origin: 50% 0;
transform-origin: 50% 0;
-webkit-transform: scale(0.75) translateY(-21px);
-ms-transform: scale(0.75) translateY(-21px);
transform: scale(0.75) translateY(-21px);
-webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out;
transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out;
z-index: 9; }
.nice-select .list:hover .option:not(:hover) {
background-color: transparent !important; }
.nice-select .option {
cursor: pointer;
font-weight: 400;
line-height: 40px;
list-style: none;
min-height: 40px;
outline: none;
padding-left: 18px;
padding-right: 29px;
text-align: left;
-webkit-transition: all 0.2s;
transition: all 0.2s; }
.nice-select .option:hover, .nice-select .option.focus, .nice-select .option.selected.focus {
background-color: #f6f7f9; }
.nice-select .option.selected {
font-weight: bold; }
.nice-select .option.disabled {
background-color: transparent;
color: #90a1b5;
cursor: default; }
.no-csspointerevents .nice-select .list {
display: none; }
.no-csspointerevents .nice-select.open .list {
display: block; }
code[class*="language-"],
pre[class*="language-"] {
border-radius: 2px;
color: #445870;
-webkit-hyphens: none;
-ms-hyphens: none;
hyphens: none;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
text-align: left;
white-space: pre;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
direction: ltr;
font-family: Inconsolata, monospace;
font-size: 13px;
letter-spacing: 0; }
/* Code blocks */
pre[class*="language-"] {
padding: 18px 24px;
margin: 0 0 24px;
overflow: auto; }
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f6f7f9; }
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: 0 2px 1px; }
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #90a1b5; }
.token.punctuation {
color: #999; }
.namespace {
opacity: .7; }
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #EC4444; }
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #4ABF60; }
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: rgba(255, 255, 255, 0.5); }
.token.atrule,
.token.attr-value,
.token.keyword {
color: #55a1fb; }
.token.function {
color: #DD4A68; }
.token.regex,
.token.important,
.token.variable {
color: #e90; }
.token.important,
.token.bold {
font-weight: bold; }
.token.italic {
font-style: italic; }
.token.entity {
cursor: help; }
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #445870;
font-family: 'Work Sans', sans-serif;
font-size: 14px;
font-weight: normal;
letter-spacing: -0.25px;
margin: 0;
padding: 0 18px; }
p {
line-height: 1.6;
margin: 0 0 1.6em; }
h1 {
font-size: 36px;
font-weight: 300;
letter-spacing: -2px;
margin: 0 0 24px; }
h2 {
font-size: 22px;
font-weight: 400;
margin: 0 0 12px;
padding-top: 48px; }
h3 {
font-size: 18px;
font-weight: 400;
margin: 0 0 12px;
padding-top: 12px; }
ul {
margin: 0;
padding-left: 16px; }
a:not(.button) {
color: #55a1fb;
outline: none;
text-decoration: none;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
border-bottom: 1px solid transparent; }
a:not(.button):hover, a:not(.button):focus {
border-bottom: 1px solid #88bfff; }
::-moz-selection {
background: #f3f4f7; }
::selection {
background: #f3f4f7; }
.container {
margin: 96px auto 60px;
max-width: 40em; }
.box {
background-color: #f6f7f9;
border-radius: 2px;
margin-bottom: 30px;
padding: 24px 30px; }
.box:before, .box:after {
content: "";
display: table; }
.box:after {
clear: both; }
label {
color: #90a1b5;
font-size: 11px;
margin: 0 2px 4px;
text-transform: uppercase;
float: left; }
label.right {
float: right; }
.button {
-webkit-tap-highlight-color: transparent;
background-color: #55a1fb;
border-radius: 5px;
border: none;
box-sizing: border-box;
color: #fff;
cursor: pointer;
display: inline-block;
font-weight: 600;
height: 42px;
line-height: 42px;
outline: none;
padding: 0 24px;
text-align: center;
text-decoration: none;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
white-space: nowrap;
width: auto; }
.button:hover, .button:focus {
background-color: #4196fb; }
.button:active, .button.nice-select.open {
background-color: #2d8bfa; }
.button.light {
background-color: #fff;
border: 1px solid #e0e7ee;
color: #55a1fb;
line-height: 40px;
margin-left: 24px; }
.button.light:hover {
border-color: #d0dae5; }
.button.light:active, .button.light.nice-select.open, .button.light:focus {
border-color: #88bfff; }
@media screen and (max-width: 360px) {
.button {
width: 100%; }
.button.light {
margin: 18px 0 0; } }
.header {
text-align: center;
margin-bottom: 60px; }
@media screen and (min-width: 600px) {
.header {
padding: 0 18px; } }
.header p {
color: #90a1b5;
font-size: 18px;
margin-bottom: 36px; }
.footer {
text-align: center; }
.footer p {
margin-bottom: 90px; }
.credit {
color: #90a1b5;
clear: both;
font-size: 12px;
margin-top: 90px; }
/* jQuery Nice Select - v1.1.0
https://github.com/hernansartorio/jquery-nice-select
Made by Hernán Sartorio */
(function($) {
$.fn.niceSelect = function(method) {
// Methods
if (typeof method == 'string') {
if (method == 'update') {
this.each(function() {
var $select = $(this);
var $dropdown = $(this).next('.nice-select');
var open = $dropdown.hasClass('open');
if ($dropdown.length) {
$dropdown.remove();
create_nice_select($select);
if (open) {
$select.next().trigger('click');
}
}
});
} else if (method == 'destroy') {
this.each(function() {
var $select = $(this);
var $dropdown = $(this).next('.nice-select');
if ($dropdown.length) {
$dropdown.remove();
$select.css('display', '');
}
});
if ($('.nice-select').length == 0) {
$(document).off('.nice_select');
}
} else {
console.log('Method "' + method + '" does not exist.')
}
return this;
}
// Hide native select
this.hide();
// Create custom markup
this.each(function() {
var $select = $(this);
if (!$select.next().hasClass('nice-select')) {
create_nice_select($select);
}
});
function create_nice_select($select) {
$select.after($('<div></div>')
.addClass('nice-select')
.addClass($select.attr('class') || '')
.addClass($select.attr('disabled') ? 'disabled' : '')
.attr('tabindex', $select.attr('disabled') ? null : '0')
.html('<span class="current"></span><ul class="list"></ul>')
);
var $dropdown = $select.next();
var $options = $select.find('option');
var $selected = $select.find('option:selected');
$dropdown.find('.current').html($selected.data('display') || $selected.text());
$options.each(function(i) {
var $option = $(this);
var display = $option.data('display');
$dropdown.find('ul').append($('<li></li>')
.attr('data-value', $option.val())
.attr('data-display', (display || null))
.addClass('option' +
($option.is(':selected') ? ' selected' : '') +
($option.is(':disabled') ? ' disabled' : ''))
.html($option.text())
);
});
}
/* Event listeners */
// Unbind existing events in case that the plugin has been initialized before
$(document).off('.nice_select');
// Open/close
$(document).on('click.nice_select', '.nice-select', function(event) {
var $dropdown = $(this);
$('.nice-select').not($dropdown).removeClass('open');
$dropdown.toggleClass('open');
if ($dropdown.hasClass('open')) {
$dropdown.find('.option');
$dropdown.find('.focus').removeClass('focus');
$dropdown.find('.selected').addClass('focus');
} else {
$dropdown.focus();
}
});
// Close when clicking outside
$(document).on('click.nice_select', function(event) {
if ($(event.target).closest('.nice-select').length === 0) {
$('.nice-select').removeClass('open').find('.option');
}
});
// Option click
$(document).on('click.nice_select', '.nice-select .option:not(.disabled)', function(event) {
var $option = $(this);
var $dropdown = $option.closest('.nice-select');
$dropdown.find('.selected').removeClass('selected');
$option.addClass('selected');
var text = $option.data('display') || $option.text();
$dropdown.find('.current').text(text);
$dropdown.prev('select').val($option.data('value')).trigger('change');
});
// Keyboard events
$(document).on('keydown.nice_select', '.nice-select', function(event) {
var $dropdown = $(this);
var $focused_option = $($dropdown.find('.focus') || $dropdown.find('.list .option.selected'));
// Space or Enter
if (event.keyCode == 32 || event.keyCode == 13) {
if ($dropdown.hasClass('open')) {
$focused_option.trigger('click');
} else {
$dropdown.trigger('click');
}
return false;
// Down
} else if (event.keyCode == 40) {
if (!$dropdown.hasClass('open')) {
$dropdown.trigger('click');
} else {
var $next = $focused_option.nextAll('.option:not(.disabled)').first();
if ($next.length > 0) {
$dropdown.find('.focus').removeClass('focus');
$next.addClass('focus');
}
}
return false;
// Up
} else if (event.keyCode == 38) {
if (!$dropdown.hasClass('open')) {
$dropdown.trigger('click');
} else {
var $prev = $focused_option.prevAll('.option:not(.disabled)').first();
if ($prev.length > 0) {
$dropdown.find('.focus').removeClass('focus');
$prev.addClass('focus');
}
}
return false;
// Esc
} else if (event.keyCode == 27) {
if ($dropdown.hasClass('open')) {
$dropdown.trigger('click');
}
// Tab
} else if (event.keyCode == 9) {
if ($dropdown.hasClass('open')) {
return false;
}
}
});
// Detect CSS pointer-events support, for IE <= 10. From Modernizr.
var style = document.createElement('a').style;
style.cssText = 'pointer-events:auto';
if (style.pointerEvents !== 'auto') {
$('html').addClass('no-csspointerevents');
}
return this;
};
}(jQuery));
\ No newline at end of file
/* jQuery Nice Select - v1.0
https://github.com/hernansartorio/jquery-nice-select
Made by Hernán Sartorio */
!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
\ No newline at end of file
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+scss */
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=_self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=t.util.clone(e[r]));return a;case"Array":return e.map&&e.map(function(e){return t.util.clone(e)})}return e}},languages:{extend:function(e,n){var a=t.util.clone(t.languages[e]);for(var r in n)a[r]=n[r];return a},insertBefore:function(e,n,a,r){r=r||t.languages;var i=r[e];if(2==arguments.length){a=arguments[1];for(var l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);return i}var o={};for(var s in i)if(i.hasOwnProperty(s)){if(s==n)for(var l in a)a.hasOwnProperty(l)&&(o[l]=a[l]);o[s]=i[s]}return t.languages.DFS(t.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,n,a){for(var r in e)e.hasOwnProperty(r)&&(n.call(e,r,e[r],a||r),"Object"===t.util.type(e[r])?t.languages.DFS(e[r],n):"Array"===t.util.type(e[r])&&t.languages.DFS(e[r],n,r))}},plugins:{},highlightAll:function(e,n){for(var a,r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),i=0;a=r[i++];)t.highlightElement(a,e===!0,n)},highlightElement:function(a,r,i){for(var l,o,s=a;s&&!e.test(s.className);)s=s.parentNode;s&&(l=(s.className.match(e)||[,""])[1],o=t.languages[l]),a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,s=a.parentNode,/pre/i.test(s.nodeName)&&(s.className=s.className.replace(e,"").replace(/\s+/g," ")+" language-"+l);var u=a.textContent,g={element:a,language:l,grammar:o,code:u};if(!u||!o)return t.hooks.run("complete",g),void 0;if(t.hooks.run("before-highlight",g),r&&_self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){g.highlightedCode=n.stringify(JSON.parse(e.data),l),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(g.element),t.hooks.run("after-highlight",g),t.hooks.run("complete",g)},c.postMessage(JSON.stringify({language:g.language,code:g.code,immediateClose:!0}))}else g.highlightedCode=t.highlight(g.code,g.grammar,g.language),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(a),t.hooks.run("after-highlight",g),t.hooks.run("complete",g)},highlight:function(e,a,r){var i=t.tokenize(e,a);return n.stringify(t.util.encode(i),r)},tokenize:function(e,n){var a=t.Token,r=[e],i=n.rest;if(i){for(var l in i)n[l]=i[l];delete n.rest}e:for(var l in n)if(n.hasOwnProperty(l)&&n[l]){var o=n[l];o="Array"===t.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],g=u.inside,c=!!u.lookbehind,f=0,h=u.alias;u=u.pattern||u;for(var p=0;p<r.length;p++){var d=r[p];if(r.length>e.length)break e;if(!(d instanceof a)){u.lastIndex=0;var m=u.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),N=[p,1];b&&N.push(b);var O=new a(l,g?t.tokenize(m,g):m,h);N.push(O),w&&N.push(w),Array.prototype.splice.apply(r,N)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("Array"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var i={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}t.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=(o?" ":"")+s+'="'+(i.attributes[s]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+o+">"+i.content+"</"+i.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code,i=n.immediateClose;_self.postMessage(JSON.stringify(t.util.encode(t.tokenize(r,t.languages[a])))),i&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
Prism.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&amp;/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css},alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));
Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),Prism.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript},alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript;
Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)*url(?=\()/i,selector:{pattern:/(?=\S)[^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m,inside:{placeholder:/%[-_\w]+/}}}),Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)/i,{pattern:/( +)(?:from|through)(?= )/,lookbehind:!0}]}),Prism.languages.insertBefore("scss","property",{variable:/\$[-_\w]+|#\{\$[-_\w]+\}/}),Prism.languages.insertBefore("scss","function",{placeholder:{pattern:/%[-_\w]+/,alias:"selector"},statement:/\B!(?:default|optional)\b/i,"boolean":/\b(?:true|false)\b/,"null":/\bnull\b/,operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),Prism.languages.scss.atrule.inside.rest=Prism.util.clone(Prism.languages.scss);
\ No newline at end of file
Copyright (C) 2012 - 2015 Simon Tabor
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.
# jQuery Toggles
[![Dependencies](https://david-dm.org/simontabor/jquery-toggles.svg)](https://david-dm.org/simontabor/jquery-toggles)
[![Dev Dependencies](https://david-dm.org/simontabor/jquery-toggles/dev-status.svg)](https://david-dm.org/simontabor/jquery-toggles)
![Bower](https://img.shields.io/bower/v/jquery-toggles.svg)
[![Join the chat at https://gitter.im/simontabor/jquery-toggles](https://img.shields.io/badge/gitter-join%20chat-blue.svg)](https://gitter.im/simontabor/jquery-toggles)
[![NPM](https://nodei.co/npm/jquery-toggles.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/jquery-toggles)
Want to create easy toggle buttons that you can click, drag, animate, use to toggle checkboxes and more? Yeah.
Examples can be seen [here](http://simontabor.com/toggles/).
## Usage
### Step 1: Include it in your page
Include the CSS at the start:
```html
<head>
<title>My cool page</title>
<link rel="stylesheet" href="css/toggles.css">
<link rel="stylesheet" href="css/toggles-modern.css">
<!-- ALL OF THE THEMES -->
<!-- <link rel="stylesheet" href="css/toggles-all.css"> -->
<!-- ALL OF THE CSS AND THEMES IN ONE FILE -->
<!-- <link rel="stylesheet" href="css/toggles-full.css"> -->
```
And the JS at the end:
```html
<script src="js/toggles.js" type="text/javascript"></script>
<!-- MINIFIED JS - recommended for production -->
<!-- <script src="js/toggles.min.js" type="text/javascript"></script> -->
</body>
</html>
```
### Step 2: Create your element
You need to specify the class for the specific theme you want to use. In this case we are using `toggle-modern`. The `toggle` class is simply what we will use as our selector to initialize it.
```html
<div class="toggle toggle-modern">
```
The themes we could have used are:
* soft
* light
* dark
* iphone
* modern
Of course, you can write your own themes/tweak the styling.
### Step 3: Initialize!
Now we just need to initialize the element we made to make it toggleable!
```javascript
// Simplest way:
$('.toggle').toggles();
// With options (defaults shown below)
$('.toggle').toggles({
drag: true, // allow dragging the toggle between positions
click: true, // allow clicking on the toggle
text: {
on: 'ON', // text for the ON position
off: 'OFF' // and off
},
on: true, // is the toggle ON on init
animate: 250, // animation time (ms)
easing: 'swing', // animation transition easing function
checkbox: null, // the checkbox to toggle (for use in forms)
clicker: null, // element that can be clicked on to toggle. removes binding from the toggle itself (use nesting)
width: 50, // width used if not set in css
height: 20, // height if not set in css
type: 'compact' // if this is set to 'select' then the select style toggle will be used
});
// Getting notified of changes, and the new state:
$('.toggle').on('toggle', function(e, active) {
if (active) {
console.log('Toggle is now ON!');
} else {
console.log('Toggle is now OFF!');
}
});
```
## Advanced Usage
### Setting toggle states
```javascript
// initiate a new Toggles class
$('.toggles').toggles({
on: true
});
// the underlying Toggles class can be accessed
var myToggle = $('.toggles').data('toggles');
console.log(myToggle.active); // true
myToggle.toggle();
console.log(myToggle.active); // false
// set the state to 'false'
// will not do anything if the state is already false
myToggle.toggle(false);
console.log(myToggle.active); // false
// passing a boolean in place of options on an active toggle element
// will set the state
$('.toggles').toggles(true);
console.log(myToggle.active); // true
// the toggle-active data attribute stores the state too
console.log($('.toggles').data('toggle-active')); // true
// myToggle.toggle(state, noAnimate, noEvent)
// don't animate the change
myToggle.toggle(false, true);
// change the state without triggering an event
myToggle.toggle(true, false, true);
```
### Using data-toggle-\* attributes on the element
Any of the following options can be set using data-toggle attributes: `on`, `drag`, `click`, `width`, `height`, `animate`, `easing`, `type`, `checkbox`
```html
<div class="toggles" data-toggle-on="true" data-toggle-height="20" data-toggle-width="60"></div>
```
```javascript
$('.toggles').toggles();
```
### Disabling user interaction
It can be useful to disable the toggle to stop users from changing the state. Set the `disabled` attribute on the toggle element to do this. Alternatively, you could use CSS to set `pointer-events: none`
```js
// your toggle element
var toggle = $('.toggle');
// initialise it
toggle.toggles();
// disable the toggle element (click + drag will no longer work)
toggle.toggleClass('disabled', true);
// setting the state via JS is NOT disabled, only user input
// toggle the toggle on
toggle.toggles(true);
// re-enable the toggle
toggle.toggleClass('disabled', false);
```
## Contributing
Make your JavaScript edits to `js/Toggles.js`. Any styling edits should be made to the relevent files in the `less` folder. JS edits must be compatible with Closure Compiler advanced optimisations - if you aren't able to code in this style then I'll happily tweak any pull requests/help out.
To build the files for release, run `make`. Again, if you struggle then I'll be able to build the files for you. (Note: use node v5)
{
"name": "simontabor/jquery-toggles",
"version": "4.0.0",
"main": "toggles.min.js",
"description": "Toggles is a lightweight jQuery plugin that creates easily-styleable toggle buttons.",
"license": "MIT",
"ignore": [
"lib/*"
]
}
.toggle-dark .toggle-slide {
border-radius: 5px;
box-shadow: 0 0 0 1px #242529, 0 1px 0 1px #666;
}
.toggle-dark .toggle-on,
.toggle-dark .toggle-off,
.toggle-dark .toggle-blob {
color: rgba(255, 255, 255, 0.7);
font-size: 11px;
}
.toggle-dark .toggle-on,
.toggle-dark .toggle-select .toggle-inner .active {
background: -webkit-linear-gradient(#1A70BE, #31A2E1);
background: linear-gradient(#1A70BE, #31A2E1);
}
.toggle-dark .toggle-off,
.toggle-dark .toggle-select .toggle-on {
background: -webkit-linear-gradient(#242529, #34363B);
background: linear-gradient(#242529, #34363B);
}
.toggle-dark .toggle-blob {
border-radius: 4px;
background: -webkit-linear-gradient(#CFCFCF, whiteSmoke);
background: linear-gradient(#CFCFCF, whiteSmoke);
box-shadow: inset 0 0 0 1px #888, inset 0 0 0 2px white;
}
.toggle-dark .toggle-blob:hover {
background: -webkit-linear-gradient(#c0c0c0, #dadada);
background: linear-gradient(#c0c0c0, #dadada);
box-shadow: inset 0 0 0 1px #888,inset 0 0 0 2px #ddd;
}
.toggle-iphone .toggle-slide {
border-radius: 9999px;
box-shadow: 0 0 0 1px #999;
}
.toggle-iphone .toggle-on,
.toggle-iphone .toggle-off {
color: white;
font-size: 18px;
font-weight: bold;
text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}
.toggle-iphone .toggle-on {
border-radius: 9999px 0 0 9999px;
background: #037bda;
box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.4);
}
.toggle-iphone .toggle-on:after {
background: -webkit-linear-gradient(#1189f1, #3797ef);
background: linear-gradient(#1189f1, #3797ef);
height: 50%;
content: '';
margin-top: -19%;
display: block;
border-radius: 9999px;
margin-left: 10%;
}
.toggle-iphone .toggle-off {
box-shadow: inset -2px 2px 5px rgba(0, 0, 0, 0.4);
border-radius: 0 9999px 9999px 0;
color: #828282;
background: #ECECEC;
text-shadow: 0 0 1px white;
}
.toggle-iphone .toggle-off:after {
background: -webkit-linear-gradient(#fafafa, #fdfdfd);
background: linear-gradient(#fafafa, #fdfdfd);
height: 50%;
content: '';
margin-top: -19%;
display: block;
margin-right: 10%;
border-radius: 9999px;
}
.toggle-iphone .toggle-blob {
border-radius: 50px;
background: -webkit-linear-gradient(#d1d1d1, #fafafa);
background: linear-gradient(#d1d1d1, #fafafa);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 2px white, 0 0 3px rgba(0, 0, 0, 0.6);
}
.toggle-light .toggle-slide {
border-radius: 9999px;
box-shadow: 0 0 0 1px #999;
}
.toggle-light .toggle-on,
.toggle-light .toggle-off {
font-size: 11px;
font-weight: 500;
}
.toggle-light .toggle-on,
.toggle-light .toggle-select .toggle-inner .active {
background: #45a31f;
box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.2);
text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
color: rgba(255, 255, 255, 0.8);
}
.toggle-light .toggle-off,
.toggle-light .toggle-select .toggle-on {
color: rgba(0, 0, 0, 0.6);
text-shadow: 0 1px rgba(255, 255, 255, 0.2);
background: -webkit-linear-gradient(#cfcfcf, #f5f5f5);
background: linear-gradient(#cfcfcf, #f5f5f5);
}
.toggle-light .toggle-blob {
border-radius: 50px;
background: -webkit-linear-gradient(#f5f5f5, #cfcfcf);
background: linear-gradient(#f5f5f5, #cfcfcf);
box-shadow: 1px 1px 2px #888;
}
.toggle-light .toggle-blob:hover {
background: -webkit-linear-gradient(#e4e4e4, #f9f9f9);
background: linear-gradient(#e4e4e4, #f9f9f9);
}
.toggle-modern .toggle-slide {
border-radius: 4px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.2);
background: -webkit-linear-gradient(#c0c5c9, #a1a9af);
background: linear-gradient(#c0c5c9, #a1a9af);
box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.15);
}
.toggle-modern .toggle-on,
.toggle-modern .toggle-off {
-webkit-transition: all 0.1s ease-out;
transition: all 0.1s ease-out;
color: white;
text-shadow: 1px 1px rgba(0, 0, 0, 0.1);
font-size: 11px;
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.2);
}
.toggle-modern .toggle-select .toggle-off,
.toggle-modern .toggle-select .toggle-on {
background: none;
}
.toggle-modern .toggle-off,
.toggle-modern .toggle-off.active {
background: -webkit-linear-gradient(#737e8d, #3f454e);
background: linear-gradient(#737e8d, #3f454e);
}
.toggle-modern .toggle-on,
.toggle-modern .toggle-on.active {
background: -webkit-linear-gradient(#4894cd, #2852a6);
background: linear-gradient(#4894cd, #2852a6);
}
.toggle-modern .toggle-blob {
background: -webkit-linear-gradient(#c0c6c9, #81898f);
background: linear-gradient(#c0c6c9, #81898f);
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.1), 1px 1px 2px rgba(0, 0, 0, 0.2);
border-radius: 3px;
}
.toggle-modern .toggle-blob:hover {
background-image: -webkit-linear-gradient(#a1a9af, #a1a9af);
background-image: linear-gradient(#a1a9af, #a1a9af);
}
.toggle-soft .toggle-slide {
border-radius: 5px;
box-shadow: 0 0 0 1px #999;
}
.toggle-soft .toggle-on,
.toggle-soft .toggle-off {
color: rgba(0, 0, 0, 0.7);
font-size: 11px;
text-shadow: 1px 1px white;
}
.toggle-soft .toggle-on,
.toggle-soft .toggle-select .toggle-inner .active {
background: -webkit-linear-gradient(#d2ff52, #91e842);
background: linear-gradient(#d2ff52, #91e842);
}
.toggle-soft .toggle-off,
.toggle-soft .toggle-select .toggle-on {
background: -webkit-linear-gradient(#cfcfcf, #f5f5f5);
background: linear-gradient(#cfcfcf, #f5f5f5);
}
.toggle-soft .toggle-blob {
border-radius: 4px;
background: -webkit-linear-gradient(#cfcfcf, #f5f5f5);
background: linear-gradient(#cfcfcf, #f5f5f5);
box-shadow: inset 0 0 0 1px #bbb, inset 0 0 0 2px white;
}
.toggle-soft .toggle-blob:hover {
background: -webkit-linear-gradient(#e4e4e4, #f9f9f9);
background: linear-gradient(#e4e4e4, #f9f9f9);
box-shadow: inset 0 0 0 1px #ddd,inset 0 0 0 2px #ddd;
}
.toggle-dark .toggle-slide {
border-radius: 5px;
box-shadow: 0 0 0 1px #242529, 0 1px 0 1px #666;
}
.toggle-dark .toggle-on,
.toggle-dark .toggle-off,
.toggle-dark .toggle-blob {
color: rgba(255, 255, 255, 0.7);
font-size: 11px;
}
.toggle-dark .toggle-on,
.toggle-dark .toggle-select .toggle-inner .active {
background: -webkit-linear-gradient(#1A70BE, #31A2E1);
background: linear-gradient(#1A70BE, #31A2E1);
}
.toggle-dark .toggle-off,
.toggle-dark .toggle-select .toggle-on {
background: -webkit-linear-gradient(#242529, #34363B);
background: linear-gradient(#242529, #34363B);
}
.toggle-dark .toggle-blob {
border-radius: 4px;
background: -webkit-linear-gradient(#CFCFCF, whiteSmoke);
background: linear-gradient(#CFCFCF, whiteSmoke);
box-shadow: inset 0 0 0 1px #888, inset 0 0 0 2px white;
}
.toggle-dark .toggle-blob:hover {
background: -webkit-linear-gradient(#c0c0c0, #dadada);
background: linear-gradient(#c0c0c0, #dadada);
box-shadow: inset 0 0 0 1px #888,inset 0 0 0 2px #ddd;
}
.toggle-iphone .toggle-slide {
border-radius: 9999px;
box-shadow: 0 0 0 1px #999;
}
.toggle-iphone .toggle-on,
.toggle-iphone .toggle-off {
color: white;
font-size: 18px;
font-weight: bold;
text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}
.toggle-iphone .toggle-on {
border-radius: 9999px 0 0 9999px;
background: #037bda;
box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.4);
}
.toggle-iphone .toggle-on:after {
background: -webkit-linear-gradient(#1189f1, #3797ef);
background: linear-gradient(#1189f1, #3797ef);
height: 50%;
content: '';
margin-top: -19%;
display: block;
border-radius: 9999px;
margin-left: 10%;
}
.toggle-iphone .toggle-off {
box-shadow: inset -2px 2px 5px rgba(0, 0, 0, 0.4);
border-radius: 0 9999px 9999px 0;
color: #828282;
background: #ECECEC;
text-shadow: 0 0 1px white;
}
.toggle-iphone .toggle-off:after {
background: -webkit-linear-gradient(#fafafa, #fdfdfd);
background: linear-gradient(#fafafa, #fdfdfd);
height: 50%;
content: '';
margin-top: -19%;
display: block;
margin-right: 10%;
border-radius: 9999px;
}
.toggle-iphone .toggle-blob {
border-radius: 50px;
background: -webkit-linear-gradient(#d1d1d1, #fafafa);
background: linear-gradient(#d1d1d1, #fafafa);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 2px white, 0 0 3px rgba(0, 0, 0, 0.6);
}
.toggle-light .toggle-slide {
border-radius: 9999px;
box-shadow: 0 0 0 1px #999;
}
.toggle-light .toggle-on,
.toggle-light .toggle-off {
font-size: 11px;
font-weight: 500;
}
.toggle-light .toggle-on,
.toggle-light .toggle-select .toggle-inner .active {
background: #45a31f;
box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.2);
text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
color: rgba(255, 255, 255, 0.8);
}
.toggle-light .toggle-off,
.toggle-light .toggle-select .toggle-on {
color: rgba(0, 0, 0, 0.6);
text-shadow: 0 1px rgba(255, 255, 255, 0.2);
background: -webkit-linear-gradient(#cfcfcf, #f5f5f5);
background: linear-gradient(#cfcfcf, #f5f5f5);
}
.toggle-light .toggle-blob {
border-radius: 50px;
background: -webkit-linear-gradient(#f5f5f5, #cfcfcf);
background: linear-gradient(#f5f5f5, #cfcfcf);
box-shadow: 1px 1px 2px #888;
}
.toggle-light .toggle-blob:hover {
background: -webkit-linear-gradient(#e4e4e4, #f9f9f9);
background: linear-gradient(#e4e4e4, #f9f9f9);
}
.toggle-light .toggle-slide{border-radius:9999px;box-shadow:0 0 0 1px #999}.toggle-light .toggle-off,.toggle-light .toggle-on{font-size:11px;font-weight:500}.toggle-light .toggle-on,.toggle-light .toggle-select .toggle-inner .active{background:#45a31f;box-shadow:inset 2px 2px 6px rgba(0,0,0,.2);text-shadow:1px 1px rgba(0,0,0,.2);color:rgba(255,255,255,.8)}.toggle-light .toggle-off,.toggle-light .toggle-select .toggle-on{color:rgba(0,0,0,.6);text-shadow:0 1px rgba(255,255,255,.2);background:-webkit-linear-gradient(#cfcfcf,#f5f5f5);background:linear-gradient(#cfcfcf,#f5f5f5)}.toggle-light .toggle-blob{border-radius:50px;background:-webkit-linear-gradient(#f5f5f5,#cfcfcf);background:linear-gradient(#f5f5f5,#cfcfcf);box-shadow:1px 1px 2px #888}.toggle-light .toggle-blob:hover{background:-webkit-linear-gradient(#e4e4e4,#f9f9f9);background:linear-gradient(#e4e4e4,#f9f9f9)}
.toggle-modern .toggle-slide {
border-radius: 4px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.2);
background: -webkit-linear-gradient(#c0c5c9, #a1a9af);
background: linear-gradient(#c0c5c9, #a1a9af);
box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.15);
}
.toggle-modern .toggle-on,
.toggle-modern .toggle-off {
-webkit-transition: all 0.1s ease-out;
transition: all 0.1s ease-out;
color: white;
text-shadow: 1px 1px rgba(0, 0, 0, 0.1);
font-size: 11px;
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.2);
}
.toggle-modern .toggle-select .toggle-off,
.toggle-modern .toggle-select .toggle-on {
background: none;
}
.toggle-modern .toggle-off,
.toggle-modern .toggle-off.active {
background: -webkit-linear-gradient(#737e8d, #3f454e);
background: linear-gradient(#737e8d, #3f454e);
}
.toggle-modern .toggle-on,
.toggle-modern .toggle-on.active {
background: -webkit-linear-gradient(#4894cd, #2852a6);
background: linear-gradient(#4894cd, #2852a6);
}
.toggle-modern .toggle-blob {
background: -webkit-linear-gradient(#c0c6c9, #81898f);
background: linear-gradient(#c0c6c9, #81898f);
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.1), 1px 1px 2px rgba(0, 0, 0, 0.2);
border-radius: 3px;
}
.toggle-modern .toggle-blob:hover {
background-image: -webkit-linear-gradient(#a1a9af, #a1a9af);
background-image: linear-gradient(#a1a9af, #a1a9af);
}
.toggle-soft .toggle-slide {
border-radius: 5px;
box-shadow: 0 0 0 1px #999;
}
.toggle-soft .toggle-on,
.toggle-soft .toggle-off {
color: rgba(0, 0, 0, 0.7);
font-size: 11px;
text-shadow: 1px 1px white;
}
.toggle-soft .toggle-on,
.toggle-soft .toggle-select .toggle-inner .active {
background: -webkit-linear-gradient(#d2ff52, #91e842);
background: linear-gradient(#d2ff52, #91e842);
}
.toggle-soft .toggle-off,
.toggle-soft .toggle-select .toggle-on {
background: -webkit-linear-gradient(#cfcfcf, #f5f5f5);
background: linear-gradient(#cfcfcf, #f5f5f5);
}
.toggle-soft .toggle-blob {
border-radius: 4px;
background: -webkit-linear-gradient(#cfcfcf, #f5f5f5);
background: linear-gradient(#cfcfcf, #f5f5f5);
box-shadow: inset 0 0 0 1px #bbb, inset 0 0 0 2px white;
}
.toggle-soft .toggle-blob:hover {
background: -webkit-linear-gradient(#e4e4e4, #f9f9f9);
background: linear-gradient(#e4e4e4, #f9f9f9);
box-shadow: inset 0 0 0 1px #ddd,inset 0 0 0 2px #ddd;
}
.toggle-slide {
overflow: hidden;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
direction: ltr;
text-align: center;
}
div.disabled > .toggle-slide {
opacity: 0.7;
pointer-events: none;
}
.toggle-slide .toggle-on,
.toggle-slide .toggle-off,
.toggle-slide .toggle-blob {
float: left;
}
.toggle-slide .toggle-blob {
position: relative;
z-index: 99;
cursor: hand;
cursor: grab;
}
.toggle-dark .toggle-slide {
border-radius: 5px;
box-shadow: 0 0 0 1px #242529, 0 1px 0 1px #666;
}
.toggle-dark .toggle-on,
.toggle-dark .toggle-off,
.toggle-dark .toggle-blob {
color: rgba(255, 255, 255, 0.7);
font-size: 11px;
}
.toggle-dark .toggle-on,
.toggle-dark .toggle-select .toggle-inner .active {
background: -webkit-linear-gradient(#1A70BE, #31A2E1);
background: linear-gradient(#1A70BE, #31A2E1);
}
.toggle-dark .toggle-off,
.toggle-dark .toggle-select .toggle-on {
background: -webkit-linear-gradient(#242529, #34363B);
background: linear-gradient(#242529, #34363B);
}
.toggle-dark .toggle-blob {
border-radius: 4px;
background: -webkit-linear-gradient(#CFCFCF, whiteSmoke);
background: linear-gradient(#CFCFCF, whiteSmoke);
box-shadow: inset 0 0 0 1px #888, inset 0 0 0 2px white;
}
.toggle-dark .toggle-blob:hover {
background: -webkit-linear-gradient(#c0c0c0, #dadada);
background: linear-gradient(#c0c0c0, #dadada);
box-shadow: inset 0 0 0 1px #888,inset 0 0 0 2px #ddd;
}
.toggle-iphone .toggle-slide {
border-radius: 9999px;
box-shadow: 0 0 0 1px #999;
}
.toggle-iphone .toggle-on,
.toggle-iphone .toggle-off {
color: white;
font-size: 18px;
font-weight: bold;
text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}
.toggle-iphone .toggle-on {
border-radius: 9999px 0 0 9999px;
background: #037bda;
box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.4);
}
.toggle-iphone .toggle-on:after {
background: -webkit-linear-gradient(#1189f1, #3797ef);
background: linear-gradient(#1189f1, #3797ef);
height: 50%;
content: '';
margin-top: -19%;
display: block;
border-radius: 9999px;
margin-left: 10%;
}
.toggle-iphone .toggle-off {
box-shadow: inset -2px 2px 5px rgba(0, 0, 0, 0.4);
border-radius: 0 9999px 9999px 0;
color: #828282;
background: #ECECEC;
text-shadow: 0 0 1px white;
}
.toggle-iphone .toggle-off:after {
background: -webkit-linear-gradient(#fafafa, #fdfdfd);
background: linear-gradient(#fafafa, #fdfdfd);
height: 50%;
content: '';
margin-top: -19%;
display: block;
margin-right: 10%;
border-radius: 9999px;
}
.toggle-iphone .toggle-blob {
border-radius: 50px;
background: -webkit-linear-gradient(#d1d1d1, #fafafa);
background: linear-gradient(#d1d1d1, #fafafa);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 2px white, 0 0 3px rgba(0, 0, 0, 0.6);
}
.toggle-light .toggle-slide {
border-radius: 9999px;
box-shadow: 0 0 0 1px #999;
}
.toggle-light .toggle-on,
.toggle-light .toggle-off {
font-size: 11px;
font-weight: 500;
}
.toggle-light .toggle-on,
.toggle-light .toggle-select .toggle-inner .active {
background: #45a31f;
box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.2);
text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
color: rgba(255, 255, 255, 0.8);
}
.toggle-light .toggle-off,
.toggle-light .toggle-select .toggle-on {
color: rgba(0, 0, 0, 0.6);
text-shadow: 0 1px rgba(255, 255, 255, 0.2);
background: -webkit-linear-gradient(#cfcfcf, #f5f5f5);
background: linear-gradient(#cfcfcf, #f5f5f5);
}
.toggle-light .toggle-blob {
border-radius: 50px;
background: -webkit-linear-gradient(#f5f5f5, #cfcfcf);
background: linear-gradient(#f5f5f5, #cfcfcf);
box-shadow: 1px 1px 2px #888;
}
.toggle-light .toggle-blob:hover {
background: -webkit-linear-gradient(#e4e4e4, #f9f9f9);
background: linear-gradient(#e4e4e4, #f9f9f9);
}
.toggle-modern .toggle-slide {
border-radius: 4px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.2);
background: -webkit-linear-gradient(#c0c5c9, #a1a9af);
background: linear-gradient(#c0c5c9, #a1a9af);
box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.15);
}
.toggle-modern .toggle-on,
.toggle-modern .toggle-off {
-webkit-transition: all 0.1s ease-out;
transition: all 0.1s ease-out;
color: white;
text-shadow: 1px 1px rgba(0, 0, 0, 0.1);
font-size: 11px;
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.2);
}
.toggle-modern .toggle-select .toggle-off,
.toggle-modern .toggle-select .toggle-on {
background: none;
}
.toggle-modern .toggle-off,
.toggle-modern .toggle-off.active {
background: -webkit-linear-gradient(#737e8d, #3f454e);
background: linear-gradient(#737e8d, #3f454e);
}
.toggle-modern .toggle-on,
.toggle-modern .toggle-on.active {
background: -webkit-linear-gradient(#4894cd, #2852a6);
background: linear-gradient(#4894cd, #2852a6);
}
.toggle-modern .toggle-blob {
background: -webkit-linear-gradient(#c0c6c9, #81898f);
background: linear-gradient(#c0c6c9, #81898f);
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.1), 1px 1px 2px rgba(0, 0, 0, 0.2);
border-radius: 3px;
}
.toggle-modern .toggle-blob:hover {
background-image: -webkit-linear-gradient(#a1a9af, #a1a9af);
background-image: linear-gradient(#a1a9af, #a1a9af);
}
.toggle-soft .toggle-slide {
border-radius: 5px;
box-shadow: 0 0 0 1px #999;
}
.toggle-soft .toggle-on,
.toggle-soft .toggle-off {
color: rgba(0, 0, 0, 0.7);
font-size: 11px;
text-shadow: 1px 1px white;
}
.toggle-soft .toggle-on,
.toggle-soft .toggle-select .toggle-inner .active {
background: -webkit-linear-gradient(#d2ff52, #91e842);
background: linear-gradient(#d2ff52, #91e842);
}
.toggle-soft .toggle-off,
.toggle-soft .toggle-select .toggle-on {
background: -webkit-linear-gradient(#cfcfcf, #f5f5f5);
background: linear-gradient(#cfcfcf, #f5f5f5);
}
.toggle-soft .toggle-blob {
border-radius: 4px;
background: -webkit-linear-gradient(#cfcfcf, #f5f5f5);
background: linear-gradient(#cfcfcf, #f5f5f5);
box-shadow: inset 0 0 0 1px #bbb, inset 0 0 0 2px white;
}
.toggle-soft .toggle-blob:hover {
background: -webkit-linear-gradient(#e4e4e4, #f9f9f9);
background: linear-gradient(#e4e4e4, #f9f9f9);
box-shadow: inset 0 0 0 1px #ddd,inset 0 0 0 2px #ddd;
}
.toggle-slide {
overflow: hidden;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
direction: ltr;
text-align: center;
}
div.disabled > .toggle-slide {
opacity: 0.7;
pointer-events: none;
}
.toggle-slide .toggle-on,
.toggle-slide .toggle-off,
.toggle-slide .toggle-blob {
float: left;
}
.toggle-slide .toggle-blob {
position: relative;
z-index: 99;
cursor: hand;
cursor: grab;
}
.toggle-slide{overflow:hidden;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;direction:ltr;text-align:center}div.disabled>.toggle-slide{opacity:.7;pointer-events:none}.toggle-slide .toggle-blob,.toggle-slide .toggle-off,.toggle-slide .toggle-on{float:left}.toggle-slide .toggle-blob{position:relative;z-index:99;cursor:hand;cursor:grab}
var Toggles = root['Toggles'] = function(el, opts) {
var self = this;
if (typeof opts === 'boolean' && el.data('toggles')) {
el.data('toggles').toggle(opts);
return;
}
var dataAttr = [
'on',
'drag',
'click',
'width',
'height',
'animate',
'easing',
'type',
'checkbox'
];
var dataOpts = {};
for (var i = 0; i < dataAttr.length; i++) {
var opt = el.data('toggle-' + dataAttr[i]);
if (typeof opt !== 'undefined') dataOpts[dataAttr[i]] = opt;
}
// extend default opts with the users options
opts = $.extend({
// can the toggle be dragged
'drag': true,
// can it be clicked to toggle
'click': true,
'text': {
// text for the ON/OFF position
'on': 'ON',
'off': 'OFF'
},
// is the toggle ON on init
'on': false,
// animation time (ms)
'animate': 250,
// animation transition easing function,
'easing': 'swing',
// the checkbox to toggle (for use in forms)
'checkbox': null,
// element that can be clicked on to toggle. removes binding from the toggle itself (use nesting)
'clicker': null,
// width (falls back to 50px)
'width': 0,
// height (falls back to 20px)
'height': 0,
// defaults to a compact toggle, other option is 'select' where both options are shown at once
'type': 'compact',
// the event name to fire when we toggle
'event': 'toggle'
}, opts || {}, dataOpts);
el.data('toggles', self);
// set active to the opposite of what we want, so toggle will run properly
var active = !opts['on'];
var selectType = opts['type'] === 'select';
// make checkbox a jquery element
var checkbox = $(opts['checkbox']);
var clicker = opts['clicker'] && $(opts['clicker']);
var height = opts['height'] || el.height() || 20;
var width = opts['width'] || el.width() || 50;
el.height(height);
el.width(width);
var div = function(name) {
return $('<div class="toggle-' + name + '">');
};
// wrapper inside toggle
var elSlide = div('slide');
// inside slide, this bit moves
var elInner = div('inner');
// the on/off divs
var elOn = div('on');
var elOff = div('off');
// the grip to drag the toggle
var elBlob = div('blob');
var halfHeight = height / 2;
var onOffWidth = width - halfHeight;
var text = opts['text'];
// set up the CSS for the individual elements
elOn
.css({
height: height,
width: onOffWidth,
textIndent: selectType ? '' : -height / 3,
lineHeight: height + 'px'
})
.html(text['on']);
elOff
.css({
height: height,
width: onOffWidth,
marginLeft: selectType ? '' : -halfHeight,
textIndent: selectType ? '' : height / 3,
lineHeight: height + 'px'
})
.html(text['off']);
elBlob.css({
height: height,
width: height,
marginLeft: -halfHeight
});
elInner.css({
width: width * 2 - height,
marginLeft: selectType ? 0 : -width + height
});
if (selectType) {
elSlide.addClass('toggle-select');
el.css('width', onOffWidth * 2);
elBlob.hide();
}
// construct the toggle
elInner.append(elOn, elBlob, elOff);
elSlide.html(elInner);
el.html(elSlide);
var doToggle = self.toggle = function(state, noAnimate, noEvent) {
// check we arent already in the desired state
if (active === state) return;
active = self['active'] = !active;
el.data('toggle-active', active);
elOff.toggleClass('active', !active);
elOn.toggleClass('active', active);
checkbox.prop('checked', active);
if (!noEvent) el.trigger(opts['event'], active);
if (selectType) return;
var margin = active ? 0 : -width + height;
// move the toggle!
elInner.stop().animate({
'marginLeft': margin
}, noAnimate ? 0 : opts['animate'], opts['easing']);
};
// evt handler for click events
var clickHandler = function(e) {
// if the target isn't the blob or dragging is disabled, toggle!
if (!el.hasClass('disabled') && (e['target'] !== elBlob[0] || !opts['drag'])) {
doToggle();
}
};
// if click is enabled and toggle isn't within the clicker element (stops double binding)
if (opts['click'] && (!clicker || !clicker.has(el).length)) {
el.on('click', clickHandler);
}
// setup the clicker element
if (clicker) {
clicker.on('click', clickHandler);
}
// bind up dragging stuff
if (opts['drag'] && !selectType) {
// time to begin the dragging parts/blob clicks
var diff;
var slideLimit = (width - height) / 4;
// fired on mouseup and mouseleave events
var upLeave = function(e) {
el.off('mousemove');
elSlide.off('mouseleave');
elBlob.off('mouseup');
if (!diff && opts['click'] && e.type !== 'mouseleave') {
doToggle();
return;
}
var overBound = active ? diff < -slideLimit : diff > slideLimit;
if (overBound) {
// dragged far enough, toggle
doToggle();
} else {
// reset to previous state
elInner.stop().animate({
marginLeft: active ? 0 : -width + height
}, opts['animate'] / 2, opts['easing']);
}
};
var wh = -width + height;
elBlob.on('mousedown', function(e) {
if (el.hasClass('disabled')) return;
// reset diff
diff = 0;
elBlob.off('mouseup');
elSlide.off('mouseleave');
var cursor = e.pageX;
el.on('mousemove', elBlob, function(e) {
diff = e.pageX - cursor;
var marginLeft;
if (active) {
marginLeft = diff;
// keep it within the limits
if (diff > 0) marginLeft = 0;
if (diff < wh) marginLeft = wh;
} else {
marginLeft = diff + wh;
if (diff < 0) marginLeft = wh;
if (diff > -wh) marginLeft = 0;
}
elInner.css('margin-left', marginLeft);
});
elBlob.on('mouseup', upLeave);
elSlide.on('mouseleave', upLeave);
});
}
// toggle the toggle to the correct state with no animation and no event
doToggle(opts['on'], true, true);
};
/**
@license jQuery Toggles v4.0.0
Copyright 2012 - 2015 Simon Tabor - MIT License
https://github.com/simontabor/jquery-toggles / http://simontabor.com/labs/toggles
*/
(function(root) {
var factory = function($) {
<<Toggles>>
$.fn['toggles'] = function(opts) {
return this.each(function() {
new Toggles($(this), opts);
});
};
};
if (typeof define === 'function' && define['amd']) {
define(['jquery'], factory);
} else {
factory(root['jQuery'] || root['Zepto'] || root['ender'] || root['$'] || $);
}
})(this);
.toggle-dark {
.toggle-slide {
border-radius: 5px;
box-shadow: 0 0 0 1px #242529, 0 1px 0 1px #666;
}
.toggle-on, .toggle-off, .toggle-blob {
color: rgba(255, 255, 255, 0.7);
font-size: 11px;
}
.toggle-on, .toggle-select .toggle-inner .active {
background: linear-gradient(#1A70BE, #31A2E1);
}
.toggle-off, .toggle-select .toggle-on {
background: linear-gradient(#242529, #34363B);
}
.toggle-blob {
border-radius: 4px;
background: linear-gradient(#CFCFCF, whiteSmoke);
box-shadow: inset 0 0 0 1px #888, inset 0 0 0 2px white;
&:hover {
background: linear-gradient(#c0c0c0, #dadada);
box-shadow: inset 0 0 0 1px #888,inset 0 0 0 2px #ddd;
}
}
}
.toggle-iphone {
.toggle-slide {
border-radius: 9999px;
box-shadow: 0 0 0 1px #999;
}
.toggle-on, .toggle-off {
color: white;
font-size: 18px;
font-weight: bold;
text-shadow: 0 0 8px rgba(0,0,0,0.5);
}
.toggle-on {
border-radius: 9999px 0 0 9999px;
background: #037bda;
box-shadow: inset 2px 2px 5px rgba(0,0,0,0.4);
&:after {
background: linear-gradient(#1189f1, #3797ef);
height: 50%;
content: '';
margin-top: -19%;
display: block;
border-radius: 9999px;
margin-left: 10%;
}
}
.toggle-off {
box-shadow: inset -2px 2px 5px rgba(0,0,0,0.4);
border-radius: 0 9999px 9999px 0;
color: rgb(130,130,130);
background: #ECECEC;
text-shadow: 0 0 1px white;
&:after {
background: linear-gradient(#fafafa, #fdfdfd);
height: 50%;
content: '';
margin-top: -19%;
display: block;
margin-right: 10%;
border-radius: 9999px;
}
}
.toggle-blob {
border-radius: 50px;
background: linear-gradient(#d1d1d1, #fafafa);
box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6), inset 0 0 0 2px white, 0 0 3px rgba(0,0,0,0.6);
}
}
.toggle-light {
.toggle-slide {
border-radius: 9999px;
box-shadow: 0 0 0 1px #999;
}
.toggle-on, .toggle-off {
font-size: 11px;
font-weight: 500;
}
.toggle-on, .toggle-select .toggle-inner .active {
background: rgb(69,163,31);
box-shadow: inset 2px 2px 6px rgba(0,0,0,0.2);
text-shadow: 1px 1px rgba(0,0,0,0.2);
color: rgba(255,255,255, 0.8);
}
.toggle-off, .toggle-select .toggle-on {
color: rgba(0,0,0,0.6);
text-shadow: 0 1px rgba(255,255,255,0.2);
background: linear-gradient(#cfcfcf ,#f5f5f5);
}
.toggle-blob {
border-radius: 50px;
background: linear-gradient(#f5f5f5, #cfcfcf);
box-shadow: 1px 1px 2px #888;
&:hover {
background: linear-gradient(#e4e4e4, #f9f9f9);
}
}
}
.toggle-modern {
.toggle-slide {
border-radius: 4px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.2);
background: linear-gradient(#c0c5c9, #a1a9af);
box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.15);
}
.toggle-on, .toggle-off {
transition: all 0.1s ease-out;
color: white;
text-shadow: 1px 1px rgba(0, 0, 0, 0.1);
font-size: 11px;
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.2);
}
.toggle-select {
.toggle-off, .toggle-on {
background: none;
}
}
.toggle-off, .toggle-off.active {
background: linear-gradient(#737e8d, #3f454e);
}
.toggle-on, .toggle-on.active {
background: linear-gradient(#4894cd, #2852a6);
}
.toggle-blob {
background: linear-gradient(#c0c6c9, #81898f);
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 -1px 1px rgba(0, 0, 0, 0.1), 1px 1px 2px rgba(0,0,0,0.2);
border-radius: 3px;
&:hover {
background-image: linear-gradient(#a1a9af, #a1a9af);
}
}
}
.toggle-soft {
.toggle-slide {
border-radius: 5px;
box-shadow: 0 0 0 1px #999;
}
.toggle-on, .toggle-off {
color: rgba(0, 0, 0, 0.7);
font-size: 11px;
text-shadow: 1px 1px white;
}
.toggle-on, .toggle-select .toggle-inner .active {
background: linear-gradient(#d2ff52, #91e842);
}
.toggle-off, .toggle-select .toggle-on {
background: linear-gradient(#cfcfcf, #f5f5f5);
}
.toggle-blob {
border-radius: 4px;
background: linear-gradient(#cfcfcf, #f5f5f5);
box-shadow: inset 0 0 0 1px #bbb, inset 0 0 0 2px white;
&:hover {
background: linear-gradient(#e4e4e4, #f9f9f9);
box-shadow: inset 0 0 0 1px #ddd,inset 0 0 0 2px #ddd;
}
}
}
.toggle-slide {
overflow: hidden;
cursor: pointer;
user-select: none;
direction: ltr;
text-align: center;
div.disabled > & {
opacity: 0.7;
pointer-events: none;
}
.toggle-on, .toggle-off, .toggle-blob {
float: left;
}
.toggle-blob {
position: relative;
z-index: 99;
cursor: hand;
cursor: grab;
}
}
{
"name": "jquery-toggles",
"version": "4.0.0",
"description": "Toggles is a lightweight jQuery plugin that creates easily-styleable toggle buttons.",
"main": "toggles.min.js",
"author": "Simon Tabor <me@simontabor.com> (http://simontabor.com/)",
"homepage": "http://simontabor.com/labs/toggles/",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/simontabor/jquery-toggles.git"
},
"keywords": [
"toggles",
"checkbox",
"jquery-plugin",
"ecosystem:jquery"
],
"bugs": {
"url": "https://github.com/simontabor/jquery-toggles/issues"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {},
"devDependencies": {
"autoprefixer": "^6.0.3",
"js-beautify": "^1.5.10",
"less": "^2.5.3",
"postcss-cli": "^2.3.2"
}
}
/**
@license jQuery Toggles v4.0.0
Copyright 2012 - 2015 Simon Tabor - MIT License
https://github.com/simontabor/jquery-toggles / http://simontabor.com/labs/toggles
*/
(function(root) {
var factory = function($) {
var Toggles = root['Toggles'] = function(el, opts) {
var self = this;
if (typeof opts === 'boolean' && el.data('toggles')) {
el.data('toggles').toggle(opts);
return;
}
var dataAttr = [
'on',
'drag',
'click',
'width',
'height',
'animate',
'easing',
'type',
'checkbox'
];
var dataOpts = {};
for (var i = 0; i < dataAttr.length; i++) {
var opt = el.data('toggle-' + dataAttr[i]);
if (typeof opt !== 'undefined') dataOpts[dataAttr[i]] = opt;
}
// extend default opts with the users options
opts = $.extend({
// can the toggle be dragged
'drag': true,
// can it be clicked to toggle
'click': true,
'text': {
// text for the ON/OFF position
'on': 'ON',
'off': 'OFF'
},
// is the toggle ON on init
'on': false,
// animation time (ms)
'animate': 250,
// animation transition easing function,
'easing': 'swing',
// the checkbox to toggle (for use in forms)
'checkbox': null,
// element that can be clicked on to toggle. removes binding from the toggle itself (use nesting)
'clicker': null,
// width (falls back to 50px)
'width': 0,
// height (falls back to 20px)
'height': 0,
// defaults to a compact toggle, other option is 'select' where both options are shown at once
'type': 'compact',
// the event name to fire when we toggle
'event': 'toggle'
}, opts || {}, dataOpts);
el.data('toggles', self);
// set active to the opposite of what we want, so toggle will run properly
var active = !opts['on'];
var selectType = opts['type'] === 'select';
// make checkbox a jquery element
var checkbox = $(opts['checkbox']);
var clicker = opts['clicker'] && $(opts['clicker']);
var height = opts['height'] || el.height() || 20;
var width = opts['width'] || el.width() || 50;
el.height(height);
el.width(width);
var div = function(name) {
return $('<div class="toggle-' + name + '">');
};
// wrapper inside toggle
var elSlide = div('slide');
// inside slide, this bit moves
var elInner = div('inner');
// the on/off divs
var elOn = div('on');
var elOff = div('off');
// the grip to drag the toggle
var elBlob = div('blob');
var halfHeight = height / 2;
var onOffWidth = width - halfHeight;
var text = opts['text'];
// set up the CSS for the individual elements
elOn
.css({
height: height,
width: onOffWidth,
textIndent: selectType ? '' : -height / 3,
lineHeight: height + 'px'
})
.html(text['on']);
elOff
.css({
height: height,
width: onOffWidth,
marginLeft: selectType ? '' : -halfHeight,
textIndent: selectType ? '' : height / 3,
lineHeight: height + 'px'
})
.html(text['off']);
elBlob.css({
height: height,
width: height,
marginLeft: -halfHeight
});
elInner.css({
width: width * 2 - height,
marginLeft: selectType ? 0 : -width + height
});
if (selectType) {
elSlide.addClass('toggle-select');
el.css('width', onOffWidth * 2);
elBlob.hide();
}
// construct the toggle
elInner.append(elOn, elBlob, elOff);
elSlide.html(elInner);
el.html(elSlide);
var doToggle = self.toggle = function(state, noAnimate, noEvent) {
// check we arent already in the desired state
if (active === state) return;
active = self['active'] = !active;
el.data('toggle-active', active);
elOff.toggleClass('active', !active);
elOn.toggleClass('active', active);
checkbox.prop('checked', active);
if (!noEvent) el.trigger(opts['event'], active);
if (selectType) return;
var margin = active ? 0 : -width + height;
// move the toggle!
elInner.stop().animate({
'marginLeft': margin
}, noAnimate ? 0 : opts['animate'], opts['easing']);
};
// evt handler for click events
var clickHandler = function(e) {
// if the target isn't the blob or dragging is disabled, toggle!
if (!el.hasClass('disabled') && (e['target'] !== elBlob[0] || !opts['drag'])) {
doToggle();
}
};
// if click is enabled and toggle isn't within the clicker element (stops double binding)
if (opts['click'] && (!clicker || !clicker.has(el).length)) {
el.on('click', clickHandler);
}
// setup the clicker element
if (clicker) {
clicker.on('click', clickHandler);
}
// bind up dragging stuff
if (opts['drag'] && !selectType) {
// time to begin the dragging parts/blob clicks
var diff;
var slideLimit = (width - height) / 4;
// fired on mouseup and mouseleave events
var upLeave = function(e) {
el.off('mousemove');
elSlide.off('mouseleave');
elBlob.off('mouseup');
if (!diff && opts['click'] && e.type !== 'mouseleave') {
doToggle();
return;
}
var overBound = active ? diff < -slideLimit : diff > slideLimit;
if (overBound) {
// dragged far enough, toggle
doToggle();
} else {
// reset to previous state
elInner.stop().animate({
marginLeft: active ? 0 : -width + height
}, opts['animate'] / 2, opts['easing']);
}
};
var wh = -width + height;
elBlob.on('mousedown', function(e) {
if (el.hasClass('disabled')) return;
// reset diff
diff = 0;
elBlob.off('mouseup');
elSlide.off('mouseleave');
var cursor = e.pageX;
el.on('mousemove', elBlob, function(e) {
diff = e.pageX - cursor;
var marginLeft;
if (active) {
marginLeft = diff;
// keep it within the limits
if (diff > 0) marginLeft = 0;
if (diff < wh) marginLeft = wh;
} else {
marginLeft = diff + wh;
if (diff < 0) marginLeft = wh;
if (diff > -wh) marginLeft = 0;
}
elInner.css('margin-left', marginLeft);
});
elBlob.on('mouseup', upLeave);
elSlide.on('mouseleave', upLeave);
});
}
// toggle the toggle to the correct state with no animation and no event
doToggle(opts['on'], true, true);
};
$.fn['toggles'] = function(opts) {
return this.each(function() {
new Toggles($(this), opts);
});
};
};
if (typeof define === 'function' && define['amd']) {
define(['jquery'], factory);
} else {
factory(root['jQuery'] || root['Zepto'] || root['ender'] || root['$'] || $);
}
})(this);
/*
jQuery Toggles v4.0.0
Copyright 2012 - 2015 Simon Tabor - MIT License
https://github.com/simontabor/jquery-toggles / http://simontabor.com/labs/toggles
*/
(function(g){function p(q){var p=g.Toggles=function(c,a){var g=this;if("boolean"===typeof a&&c.data("toggles"))c.data("toggles").toggle(a);else{for(var k="on drag click width height animate easing type checkbox".split(" "),b={},l=0;l<k.length;l++){var t=c.data("toggle-"+k[l]);"undefined"!==typeof t&&(b[k[l]]=t)}a=q.extend({drag:!0,click:!0,text:{on:"ON",off:"OFF"},on:!1,animate:250,easing:"swing",checkbox:null,clicker:null,width:0,height:0,type:"compact",event:"toggle"},a||{},b);c.data("toggles",
g);var f=!a.on,n="select"===a.type,p=q(a.checkbox),k=a.clicker&&q(a.clicker),d=a.height||c.height()||20,m=a.width||c.width()||50;c.height(d);c.width(m);var b=function(a){return q('<div class="toggle-'+a+'">')},r=b("slide"),s=b("inner"),w=b("on"),x=b("off"),h=b("blob"),b=d/2,l=m-b,t=a.text;w.css({height:d,width:l,textIndent:n?"":-d/3,lineHeight:d+"px"}).html(t.on);x.css({height:d,width:l,marginLeft:n?"":-b,textIndent:n?"":d/3,lineHeight:d+"px"}).html(t.off);h.css({height:d,width:d,marginLeft:-b});
s.css({width:2*m-d,marginLeft:n?0:-m+d});n&&(r.addClass("toggle-select"),c.css("width",2*l),h.hide());s.append(w,h,x);r.html(s);c.html(r);var v=g.toggle=function(b,e,A){f!==b&&(f=g.active=!f,c.data("toggle-active",f),x.toggleClass("active",!f),w.toggleClass("active",f),p.prop("checked",f),A||c.trigger(a.event,f),n||(b=f?0:-m+d,s.stop().animate({marginLeft:b},e?0:a.animate,a.easing)))},b=function(b){c.hasClass("disabled")||b.target===h[0]&&a.drag||v()};if(a.click&&(!k||!k.has(c).length))c.on("click",
b);if(k)k.on("click",b);if(a.drag&&!n){var e,y=(m-d)/4,z=function(b){c.off("mousemove");r.off("mouseleave");h.off("mouseup");!e&&a.click&&"mouseleave"!==b.type?v():(f?e<-y:e>y)?v():s.stop().animate({marginLeft:f?0:-m+d},a.animate/2,a.easing)},u=-m+d;h.on("mousedown",function(a){if(!c.hasClass("disabled")){e=0;h.off("mouseup");r.off("mouseleave");var b=a.pageX;c.on("mousemove",h,function(a){e=a.pageX-b;f?(a=e,0<e&&(a=0),e<u&&(a=u)):(a=e+u,0>e&&(a=u),e>-u&&(a=0));s.css("margin-left",a)});h.on("mouseup",
z);r.on("mouseleave",z)}})}v(a.on,!0,!0)}};q.fn.toggles=function(c){return this.each(function(){new p(q(this),c)})}}"function"===typeof define&&define.amd?define(["jquery"],p):p(g.jQuery||g.Zepto||g.ender||g.$||$)})(this);
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="الرجاء حذف "+t+" عناصر";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="الرجاء إضافة "+t+" عناصر";return n},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){var t="تستطيع إختيار "+e.maximum+" بنود فقط";return t},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak méně":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky méně":"Prosím zadejte o "+n+" znaků méně"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte ještě jeden znak":n<=4?"Prosím zadejte ještě další "+e(n,!0)+" znaky":"Prosím zadejte ještě dalších "+n+" znaků"},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky":"Můžete zvolit maximálně "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Angiv venligst "+t+" tegn mindre";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Angiv venligst "+t+" tegn mere";return n},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها می‌توانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Elimine ";return t===1?n+="un carácter":n+=t+" caracteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Engada ";return t===1?n+="un carácter":n+=t+" caracteres",n},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){var t="Só pode ";return e.maximum===1?t+="un elemento":t+=e.maximum+" elementos",t},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.