ltsecurityinc安防产品在线商城代码
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<head>
|
||||
<css src="Olegnax_Athlete2::select-image/select-image.css"/>
|
||||
<link src="Olegnax_Athlete2::select-image/select-image.js"/>
|
||||
</head>
|
||||
<body>
|
||||
<referenceContainer name="page.content">
|
||||
<block name="olegnax.athlete2.notice" class="Olegnax\Athlete2\Block\Adminhtml\Notice" after="page.main.actions"/>
|
||||
</referenceContainer>
|
||||
<referenceContainer name="content">
|
||||
<block name="olegnax.athlete2.notice.lic" class="Olegnax\Athlete2\Block\Adminhtml\NoticeLic" before="system.config.edit"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" ?>
|
||||
<page layout="admin-1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="page.main.actions">
|
||||
<block class="Magento\Backend\Block\Store\Switcher" name="adminhtml.system.config.switcher" template="Magento_Backend::store/switcher.phtml">
|
||||
<arguments>
|
||||
<argument name="switch_websites" xsi:type="string">1</argument>
|
||||
<argument name="switch_store_groups" xsi:type="string">0</argument>
|
||||
<argument name="switch_store_views" xsi:type="string">1</argument>
|
||||
<argument name="default_selection_name" xsi:type="string" translate="true">Default Config</argument>
|
||||
<argument name="show_manage_stores_link" xsi:type="string">1</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</referenceContainer>
|
||||
<referenceContainer name="content">
|
||||
<block class="Olegnax\Athlete2\Block\Adminhtml\Import\Exporter" name="import.exporter" template="Olegnax_Athlete2::import/exporter.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" ?>
|
||||
<page layout="admin-1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="page.main.actions">
|
||||
<block class="Magento\Backend\Block\Store\Switcher" name="adminhtml.system.config.switcher" template="Magento_Backend::store/switcher.phtml">
|
||||
<arguments>
|
||||
<argument name="switch_websites" xsi:type="string">1</argument>
|
||||
<argument name="switch_store_groups" xsi:type="string">0</argument>
|
||||
<argument name="switch_store_views" xsi:type="string">1</argument>
|
||||
<argument name="default_selection_name" xsi:type="string" translate="true">Default Config</argument>
|
||||
<argument name="show_manage_stores_link" xsi:type="string">1</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</referenceContainer>
|
||||
<referenceContainer name="content">
|
||||
<block class="Olegnax\Athlete2\Block\Adminhtml\Import\Index" name="import.index" template="Olegnax_Athlete2::import/index.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/** @var Exporter $block */
|
||||
|
||||
use Olegnax\Athlete2\Block\Adminhtml\Import\Exporter;
|
||||
|
||||
$options = $block->getConfig();
|
||||
$blocks = $block->getBlocks();
|
||||
$pages = $block->getPages();
|
||||
$bannerSliders = $block->getBannerSlider();
|
||||
$carousels = $block->getCarousel();
|
||||
?>
|
||||
<form method="POST" action="<?= $block->actionExport(); ?>">
|
||||
<div class="options-wrap">
|
||||
<h2 class="title">Options</h2>
|
||||
|
||||
<input id="options_all" class="option option-all" type="checkbox" name="config_all" value=""> <label for="options_all"><?= __( 'Select All' ) ?></label>
|
||||
<ul class="options" style="padding-left: 30px;">
|
||||
<?php foreach ( $options as $section => $value1 ) { ?>
|
||||
<li>
|
||||
<input id="options_<?= $section ?>" class="option option-section" type="checkbox" name="config[]" value="<?= $section ?>"> <label for="options_<?= $section ?>"><?= $section ?></label>
|
||||
<?php if ( is_array( $value1 ) ) { ?>
|
||||
<ul style="padding-left: 30px;">
|
||||
<?php foreach ( $value1 as $group => $value2 ) { ?>
|
||||
<li>
|
||||
<input id="options_<?= $section ?>_<?= $group ?>" class="option option-group" type="checkbox" name="config[]" value="<?= implode( '/', [ $section, $group ] ) ?>"> <label for="options_<?= $section ?>_<?= $group ?>"><?= $group ?></label>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blocks-wrap">
|
||||
<h2 class="title">Blocks</h2>
|
||||
<input id="block_all" class="block block-all" type="checkbox" name="block_all" value=""> <label for="block_all"><?= __( 'Select All' ) ?></label>
|
||||
<ul class="blocks" style="padding-left: 30px;">
|
||||
<?php foreach ( $blocks as $identifier => $title ) { ?>
|
||||
<li><input id="block_<?= $identifier ?>" class="block option-block" type="checkbox" name="blocks[]" value="<?= $identifier ?>"> <label for="block_<?= $identifier ?>"><?= $title ?></label></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pages-wrap">
|
||||
<h2 class="title">Pages</h2>
|
||||
<input id="pages_all" class="page page-all" type="checkbox" name="page_all" value=""> <label for="pages_all"><?= __( 'Select All' ) ?></label>
|
||||
<ul class="pages" style="padding-left: 30px;">
|
||||
<?php foreach ( $pages as $identifier => $title ) { ?>
|
||||
<li><input id="pages_<?= $identifier ?>" class="page option-page" type="checkbox" name="pages[]" value="<?= $identifier ?>"> <label for="pages_<?= $identifier ?>"><?= $title ?></label></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if ( !empty( $bannerSliders ) ) : ?>
|
||||
<div class="bannersliders-wrap">
|
||||
<h2 class="title">Banner Sliders</h2>
|
||||
<input id="bannersliders_all" class="bannerslider bannerslider-all" type="checkbox" name="bannersliders_all" value=""> <label for="bannersliders_all"><?= __( 'Select All' ) ?></label>
|
||||
<ul class="pages" style="padding-left: 30px;">
|
||||
<?php foreach ( $bannerSliders as $identifier => $title ) { ?>
|
||||
<li><input id="bannersliders_<?= $identifier ?>" class="bannerslider option-bannerslider" type="checkbox" name="bannersliders[]" value="<?= $identifier ?>"> <label for="bannersliders_<?= $identifier ?>"><?= $title ?></label></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( !empty( $carousels ) ) : ?>
|
||||
<div class="bannersliders-wrap">
|
||||
<h2 class="title">Carousel Sliders</h2>
|
||||
<input id="carouselsliders_all" class="carousel carousel-all" type="checkbox" name="carousels_all" value=""> <label for="carousels_all"><?= __( 'Select All' ) ?></label>
|
||||
<ul class="pages" style="padding-left: 30px;">
|
||||
<?php foreach ( $carousels as $identifier => $title ) { ?>
|
||||
<li><input id="carousels_<?= $identifier ?>" class="carousel option-carousel" type="checkbox" name="carousels[]" value="<?= $identifier ?>"> <label
|
||||
for="carousels_<?= $identifier ?>"><?= $title ?></label></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<button type="submit"><?= __( 'Save' ) ?></button>
|
||||
<input name="form_key" type="hidden" value="<?= $block->getFormKey() ?>" />
|
||||
</form>
|
||||
<script>
|
||||
require( [
|
||||
'jquery',
|
||||
], function ( $ ) {
|
||||
'use strict';
|
||||
// options
|
||||
$( '.options .option' ).on( 'change', function ( e ) {
|
||||
var $this = $( this ),
|
||||
$li = $this.closest( 'li' ).eq( 0 ),
|
||||
$submenu = $li.children( 'ul' ),
|
||||
checked = $this.is( ':checked' ),
|
||||
value = $this.attr( 'value' ),
|
||||
child = $( 'input[name^=config][value^="' + $( this ).attr( 'value' ) + '/"]' );
|
||||
$submenu.toggle( !checked );
|
||||
child.prop( 'disabled', checked );
|
||||
if ( checked ) {
|
||||
child.prop( 'checked', true ).trigger( 'change' );
|
||||
} else {
|
||||
var parent_val = $( this ).attr( 'value' ).split( '/' );
|
||||
parent_val.pop();
|
||||
parent_val = parent_val.join( '/' );
|
||||
$( 'input[name^=config][value="' + parent_val + '"]' ).prop( 'checked', false );
|
||||
$( '.option.option-all' ).prop( 'checked', false );
|
||||
}
|
||||
} );
|
||||
$( '.option.option-all' ).on( 'change', function ( e ) {
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
$( '.option.option-section' ).prop( 'checked', true ).trigger( 'change' );
|
||||
}
|
||||
} );
|
||||
// blocks
|
||||
$( '.block.block-all' ).on( 'change', function ( e ) {
|
||||
$( '.block.option-block' ).prop( 'checked', $( this ).is( ':checked' ) ).trigger( 'change' );
|
||||
} );
|
||||
// pages
|
||||
$( '.page.page-all' ).on( 'change', function ( e ) {
|
||||
$( '.page.option-page' ).prop( 'checked', $( this ).is( ':checked' ) ).trigger( 'change' );
|
||||
} );
|
||||
// bannerslider
|
||||
$( '.bannerslider.bannerslider-all' ).on( 'change', function ( e ) {
|
||||
$( '.bannerslider.option-bannerslider' ).prop( 'checked', $( this ).is( ':checked' ) ).trigger( 'change' );
|
||||
} );
|
||||
// carousel
|
||||
$( '.carousel.carousel-all' ).on( 'change', function ( e ) {
|
||||
$( '.carousel.option-carousel' ).prop( 'checked', $( this ).is( ':checked' ) ).trigger( 'change' );
|
||||
} );
|
||||
|
||||
} );
|
||||
</script>
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/** @var Index $block */
|
||||
|
||||
use Olegnax\Athlete2\Block\Adminhtml\Import\Index;
|
||||
|
||||
$demos = $block->getDemo();
|
||||
?>
|
||||
<div class="ox-admin__import">
|
||||
<?php foreach ( $demos as $demoId => $demo ) : ?>
|
||||
<div class="ox-admin-import__block" id="demo-<?= $block->getDemoId( $demoId ) ?>">
|
||||
<img src="<?= $block->getDemoImage( $demoId ) ?>">
|
||||
<span class="ox-admin-import__name"><?= $demo[ 'name' ] ?></span>
|
||||
<a href="#" class="ox-admin__button action-primary ox-admin-modal__action ox-admin-import__button"><?= __( 'Import' ); ?></a>
|
||||
<div class="ox-admin__modal">
|
||||
<div class="ox-admin-modal__inner">
|
||||
<div class="ox-overlay-close-btn action-primary"><span></span></div>
|
||||
<h2><?= __( 'Choose what to Import:' ); ?></h2>
|
||||
<table>
|
||||
<tbody>
|
||||
<?php if ( in_array( 'content', $demo[ 'variations' ] ) ) : ?>
|
||||
<tr>
|
||||
<td>
|
||||
<h3><?= __( 'Pages and CMS Blocks' ); ?></h3>
|
||||
<p>
|
||||
<label class="ox-checkbox" for="<?=$block->escapeHtmlAttr($demoId) ?>_not_replace"><input type="checkbox" class="import-not-replace" id="<?=$block->escapeHtmlAttr($demoId)
|
||||
?>_not_replace"
|
||||
name="<?=$block->escapeHtmlAttr($demoId) ?>_not_replace"> <?= __('Add items, do not replace'); ?></label>
|
||||
</p>
|
||||
<p class="attention"><?= __( 'Attention! This will override your existing Static blocks and CMS Pages with the same Identifiers.' ); ?></p>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?= $block->actionImport( $demoId, 'content' ) ?>" class="ox-admin__button action-primary ox-admin__button-replace"><?= __( 'Import' ); ?></a>
|
||||
<a href="<?= $block->actionImport( $demoId, 'content' ) ?>notreplace/1" class="ox-admin__button action-primary ox-admin__button-not-replace" style="display: none"><?= __(
|
||||
'Import'
|
||||
);
|
||||
?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( in_array( 'bannerslider', $demo[ 'variations' ] ) ) : ?>
|
||||
<tr>
|
||||
<td><h3><?= __( 'Banner Slider & Carousel' ); ?></h3></td>
|
||||
<td><a href="<?= $block->actionImport( $demoId, 'bannerslider' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( in_array( 'settings', $demo[ 'variations' ] ) ) : ?>
|
||||
<tr>
|
||||
<td><h3><?= __( 'Theme Settings' ); ?></h3></td>
|
||||
<td><a href="<?= $block->actionImport( $demoId, 'settings' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( in_array( 'blog', $demo[ 'variations' ] ) ) : ?>
|
||||
<tr>
|
||||
<td><h3><?= __( 'Blog Settings' ); ?></h3><p class="small">Requires Magefan Blog module to be installed.</p></td>
|
||||
<td><a href="<?= $block->actionImport( $demoId, 'blog' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( in_array( 'popup', $demo[ 'variations' ] ) ) : ?>
|
||||
<tr>
|
||||
<td><h3><?= __( 'Newsletter Popup Settings *' ); ?></h3><p class="small">Requires Olegnax Newsletter module to be installed.</p></td>
|
||||
<td><a href="<?= $block->actionImport( $demoId, 'popup' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( in_array( 'hotspots', $demo[ 'variations' ] ) ) : ?>
|
||||
<tr>
|
||||
<td><h3><?= __( 'Hotspots' ); ?></h3><p class="small">Sample page and cms blocks with hotspot content.</p></td>
|
||||
<td><a href="<?= $block->actionImport( $demoId, 'hotspots' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ( in_array( 'googlemap', $demo[ 'variations' ] ) ) : ?>
|
||||
<tr>
|
||||
<td><h3><?= __( 'Google Map Module Settings *' ); ?></h3><p class="small">Requires Olegnax Google map module to be installed.</p></td>
|
||||
<td><a href="<?= $block->actionImport( $demoId, 'googlemap' ) ?>" class="ox-admin__button action-primary"><?= __( 'Import' ); ?></a></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td colspan="2"><p style="text-align: left;"><?= __( '* Options are optional and already present in Theme Settings import. Use them in case you already have website setup and don\'t want to lose existing settings but only import new or specific options.' ); ?></p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<script>
|
||||
require( [
|
||||
'jquery',
|
||||
], function ( $ ) {
|
||||
'use strict';
|
||||
$( 'body' ).on( 'click', '.ox-admin-import__button', function ( e ) {
|
||||
e.preventDefault();
|
||||
$( this ).next( '.ox-admin__modal' ).addClass( 'opened' );
|
||||
} );
|
||||
$( 'body' ).on( 'click', '.ox-overlay-close-btn', function ( e ) {
|
||||
e.preventDefault();
|
||||
$( this ).closest( '.ox-admin__modal' ).removeClass( 'opened' );
|
||||
} );
|
||||
$( 'body' ).on( 'change', '.import-not-replace', function ( e ) {
|
||||
var $this = $(this),
|
||||
parent = $this.closest('tr').eq(0),
|
||||
isChecked = $this.is(':checked');
|
||||
|
||||
parent.find('p.attention, .ox-admin__button-replace').toggle(!isChecked);
|
||||
parent.find('.ox-admin__button-not-replace').toggle(isChecked);
|
||||
});
|
||||
|
||||
} );
|
||||
</script>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
|
||||
<fieldset name="custom_design_update">
|
||||
<field name="ox_post_list_style">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="options" xsi:type="object">Olegnax\Athlete2\Model\Config\Settings\Blog\PostListStyle</item>
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="dataType" xsi:type="string">text</item>
|
||||
<item name="label" xsi:type="string" translate="true">Post Style on Listing(Blog Page)</item>
|
||||
<item name="formElement" xsi:type="string">select</item>
|
||||
<item name="source" xsi:type="string">post</item>
|
||||
<item name="dataScope" xsi:type="string">ox_post_list_style</item>
|
||||
<item name="sortOrder" xsi:type="number">90</item>
|
||||
</item>
|
||||
</argument>
|
||||
</field>
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Olegnax
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Olegnax.com license that is
|
||||
* available through the world-wide-web at this URL:
|
||||
* https://www.olegnax.com/license
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
||||
* version in the future.
|
||||
*
|
||||
* @category Olegnax
|
||||
* @package Olegnax_Athlete2
|
||||
* @copyright Copyright (c) 2010-2021 Olegnax (http://www.olegnax.com/)
|
||||
* @license https://www.olegnax.com/license
|
||||
*/
|
||||
|
||||
@import "variables/_icons.less";
|
||||
|
||||
.lib-font-face(
|
||||
@family-name: @icons-athlete2__font-name,
|
||||
@font-path: @icons-athlete2__font-name-path,
|
||||
@font-weight: normal,
|
||||
@font-style: normal
|
||||
);
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Olegnax
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Olegnax.com license that is
|
||||
* available through the world-wide-web at this URL:
|
||||
* https://www.olegnax.com/license
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
||||
* version in the future.
|
||||
*
|
||||
* @category Olegnax
|
||||
* @package Olegnax_Athlete2
|
||||
* @copyright Copyright (c) 2010-2021 Olegnax (http://www.olegnax.com/)
|
||||
* @license https://www.olegnax.com/license
|
||||
*/
|
||||
|
||||
@icons-athlete2__font-name: 'Athlete2 Icons';
|
||||
@icons-athlete2__file-name: 'athlete2-icons';
|
||||
@icons-athlete2__font-name-path: '@{baseDir}Olegnax_Athlete2/fonts/@{icons-athlete2__file-name}/@{icons-athlete2__file-name}';
|
||||
@icon-athlete2__content: '\e900';
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>
|
||||
<json>
|
||||
<![CDATA[
|
||||
{
|
||||
"fontFamily": "Athlete2-Icons",
|
||||
"majorVersion": 1,
|
||||
"minorVersion": 0,
|
||||
"version": "Version 1.0",
|
||||
"fontId": "Athlete2-Icons",
|
||||
"psName": "Athlete2-Icons",
|
||||
"subFamily": "Regular",
|
||||
"fullName": "Athlete2-Icons",
|
||||
"description": "Font generated by IcoMoon."
|
||||
}
|
||||
]]>
|
||||
</json>
|
||||
</metadata>
|
||||
<defs>
|
||||
<font id="Athlete2-Icons" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||
<glyph unicode="" glyph-name="athlete-2-logo" data-tags="athlete-2-logo-ai" horiz-adv-x="978" d="M312.889 960l-312.889-1024h216.178l56.889 227.556h278.756l51.2-227.556h216.178l-318.578 1024h-187.733zM312.889 334.222l96.711 341.333 96.711-341.333h-193.422zM694.044 960h113.778v-337.92h-113.778v337.92zM864.711 960h113.778v-337.92h-113.778v337.92z" />
|
||||
</font></defs></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,114 @@
|
||||
.athleteform-onoff-container {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
height: 36px;
|
||||
width: 132px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
-webkit-border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
-webkit-box-shadow: inset 1px 1px 6px 0px rgba(170, 157, 137, .16);
|
||||
box-shadow: inset 1px 1px 6px 0px rgba(170, 157, 137, .16);
|
||||
-webkit-transition: all .3s ease-in-out;
|
||||
-moz-transition: all .3s ease-in-out;
|
||||
-o-transition: all .3s ease-in-out;
|
||||
transition: all .3s ease-in-out;
|
||||
border: 1px solid #d2d2d2;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.athleteform-onoff-container.disabled.checked {
|
||||
border-color: rgba(0, 0, 0, 0.4);
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.athleteform-onoff-container.disabled .athleteform-onoff-button {
|
||||
color: rgba(0, 0, 0, 0.4) !important;
|
||||
}
|
||||
|
||||
.athleteform-onoff-container.checked {
|
||||
background: #96b100;
|
||||
border-color: #96b100;
|
||||
}
|
||||
|
||||
.athleteform-onoff-container.checked .athleteform-onoff-button {
|
||||
left: 4px;
|
||||
color: #96b100;
|
||||
}
|
||||
|
||||
.athleteform-onoff-container .athleteform-onoff-button {
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
font: normal normal normal 14px/1 TIFontAwesome;
|
||||
font-size: inherit;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 66px;
|
||||
width: 59px;
|
||||
height: 27px;
|
||||
line-height: 18px;
|
||||
padding: 4px;
|
||||
text-align: center;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 2px;
|
||||
-webkit-box-shadow: 1px 1px 4px 0px rgba(2, 2, 2, .21);
|
||||
box-shadow: 1px 1px 4px 0px rgba(2, 2, 2, .21);
|
||||
-webkit-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
|
||||
-moz-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
|
||||
-o-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
|
||||
transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
|
||||
color: #6b625a;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/* Default Unchecked Icon */
|
||||
.athleteform-onoff-container .athleteform-onoff-button:after,
|
||||
.athleteform-onoff-container .athleteform-onoff-button:before {
|
||||
content: "";
|
||||
width: 10px;
|
||||
height: 2px;
|
||||
background: #524a43;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 25px;
|
||||
top: 12px;
|
||||
}
|
||||
.athleteform-onoff-container .athleteform-onoff-button:before {
|
||||
transform: rotateZ(45deg);
|
||||
}
|
||||
.athleteform-onoff-container .athleteform-onoff-button:after {
|
||||
transform: rotateZ(-45deg);
|
||||
}
|
||||
|
||||
/* Checked Icon */
|
||||
.athleteform-onoff-container.checked .athleteform-onoff-button:before,
|
||||
.athleteform-onoff-container.checked .athleteform-onoff-button:after {
|
||||
background: #96b100;
|
||||
}
|
||||
.athleteform-onoff-container.checked .athleteform-onoff-button:before {
|
||||
width: 10px;
|
||||
left: 26px;
|
||||
top: 12px;
|
||||
transform: rotateZ(-45deg);
|
||||
}
|
||||
.athleteform-onoff-container.checked .athleteform-onoff-button:after {
|
||||
width: 5px;
|
||||
left: 24px;
|
||||
top: 14px;
|
||||
transform: rotateZ(45deg);
|
||||
}
|
||||
|
||||
/* Disabled */
|
||||
.athleteform-onoff-container.disabled {
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
.athleteform-onoff-container select {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
require( [ "jquery" ], function ( $ ) {
|
||||
"use strict";
|
||||
|
||||
$( function () {
|
||||
$.fn.athlete_onoff = function ( so ) {
|
||||
var sd = {
|
||||
value: {
|
||||
on: '',
|
||||
off: ''
|
||||
},
|
||||
class: 'athleteform-onoff',
|
||||
wrap: 'container',
|
||||
button: 'button'
|
||||
},
|
||||
s = $.extend( true, { }, sd, so );
|
||||
return $( this ).each( function () {
|
||||
var a = $( this ),
|
||||
d1c = s.class + '-' + s.wrap;
|
||||
if ( !a.is( 'select' ) || ( !a.children( 'option[value=0]' ).length || !a.children( 'option[value=1]' ).length ) || a.parent( '.' + d1c ).length ) {
|
||||
return a;
|
||||
}
|
||||
var b1 = $( '<div>' ).attr( {
|
||||
class: s.class + '-' + s.button
|
||||
} ),
|
||||
d1 = $( '<div>' ).attr( {
|
||||
id: a.attr( 'id' ) + '_' + s.wrap,
|
||||
class: d1c
|
||||
} );
|
||||
d1.attr( 'class', ( d1.attr( 'class' ) ) );
|
||||
if ( a.is( ':disabled' ) ) {
|
||||
d1.toggleClass( 'disabled', a.is( ':disabled' ) );
|
||||
}
|
||||
d1.toggleClass( 'checked', '0' != a.val() )
|
||||
a.hide().wrap( d1 ).before( b1 );
|
||||
d1 = a.parent();
|
||||
a.off( 'change.onofftrigger' ).on( 'change.onofftrigger', function ( e ) {
|
||||
d1.toggleClass( 'disabled', a.is( ':disabled' ) );
|
||||
if ( d1.hasClass( 'disabled' ) ) {
|
||||
return e.preventDefault();
|
||||
}
|
||||
d1.toggleClass( 'checked', '0' != a.val() );
|
||||
} );
|
||||
d1.off( 'click.onofftrigger' ).on( 'click.onofftrigger', function ( e ) {
|
||||
if ( d1.hasClass( 'disabled' ) ) {
|
||||
return e.preventDefault();
|
||||
}
|
||||
if ( a.is( ':enabled' ) ) {
|
||||
var value = ( '0' != a.val() ) ? '0' : '1';
|
||||
a.val( value );
|
||||
a[0].dispatchEvent( new Event( 'change' ) );
|
||||
a.trigger( 'change' );
|
||||
}
|
||||
} );
|
||||
return a;
|
||||
} );
|
||||
};
|
||||
|
||||
$( '.on-off-trigger' ).athlete_onoff();
|
||||
} );
|
||||
} );
|
||||
@@ -0,0 +1,31 @@
|
||||
.select-image-wrap, .select-image-wrap ul {
|
||||
list-style: none;
|
||||
}
|
||||
.select-image-wrap li{
|
||||
display: inline-block;
|
||||
}
|
||||
.select-image-wrap li {
|
||||
margin: 5px;
|
||||
font-size: 0;
|
||||
cursor: pointer;
|
||||
transition: 0.3s ease;
|
||||
transition-property: box-shadow, border, transform;
|
||||
border: 4px solid transparent;
|
||||
}
|
||||
.select-image-wrap li:hover,
|
||||
.select-image-wrap li.select-image-selected {
|
||||
border-color: #96b100;
|
||||
}
|
||||
|
||||
.select-image-wrap li {
|
||||
box-shadow: 0 4px 39px 0px rgba(0, 0, 0, .06);
|
||||
transform: none;
|
||||
}
|
||||
.select-image-wrap li:hover,
|
||||
.select-image-wrap li.select-image-selected {
|
||||
box-shadow: 0 2px 7px 0px rgba(0, 0, 0, .06);
|
||||
transform: translateY(3px);
|
||||
}
|
||||
select.select-image {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
require( [ "jquery" ], function ( $ ) {
|
||||
"use strict";
|
||||
$.fn.selectimage = function ( so ) {
|
||||
var action = '',
|
||||
s,
|
||||
sd = {
|
||||
class: {
|
||||
wraper: 'select-image-wrap',
|
||||
list: 'select-image-items',
|
||||
item: 'select-image-item',
|
||||
image: 'select-image-image',
|
||||
element: 'select-image-element',
|
||||
active: 'select-image-selected',
|
||||
}
|
||||
}
|
||||
if ( 'string' === typeof so ) {
|
||||
action = so;
|
||||
} else {
|
||||
s = $.extend( true, { }, sd, so );
|
||||
}
|
||||
return $( this ).each( function ( ) {
|
||||
var $this = $( this ),
|
||||
$parent = $this.parent( );
|
||||
if ( !$this.is( 'select' ) && $this.children( ).length ) {
|
||||
return;
|
||||
}
|
||||
var $wraper = $parent.find( '.' + s.class.wraper ),
|
||||
generate_images = function ( $parentlist ) {
|
||||
$this.children( ).each( function ( ) {
|
||||
var $item = $( this );
|
||||
if ( $item.is( 'optgroup' ) ) {
|
||||
var item_value = $item.attr( 'label' ),
|
||||
$li = $parentlist.find( '.' + s.class.item + '.' + s.class.item + '-optgroup[data-value="' + item_value + '"]' ),
|
||||
$submenu;
|
||||
if ( !$li.length ) {
|
||||
$li = $( '<li>' ).addClass( s.class.item ).addClass( s.class.item + '-optgroup' ).attr( 'data-value', item_value ).html( $img );
|
||||
$parentlist.append( $li );
|
||||
}
|
||||
if ( !$li.children( 'span' ) ) {
|
||||
$li.prepend( $( '<span>' ).text( $item ) )
|
||||
}
|
||||
$submenu = $li.children( 'ul.' + s.class.list );
|
||||
if ( !$submenu.length ) {
|
||||
$submenu = $( '<ul>' ).addClass( s.class.list );
|
||||
$li.append( $submenu );
|
||||
}
|
||||
generate_images.call( $item, $submenu );
|
||||
} else if ( $item.is( 'option' ) ) {
|
||||
var item_value = $item.attr( 'value' );
|
||||
if ( !$parentlist.find( '.' + s.class.item + '.' + s.class.item + '-option[data-value="' + item_value + '"]' ).length ) {
|
||||
var item_url = $item.text(),
|
||||
$img = $( '<img>' ).attr( {
|
||||
src: item_url,
|
||||
alt: item_value,
|
||||
class: s.class.image,
|
||||
} );
|
||||
var $li = $( '<li>' ).addClass( s.class.item ).addClass( s.class.item + '-option' ).attr( 'data-value', item_value ).html( $img );
|
||||
$parentlist.append( $li );
|
||||
}
|
||||
}
|
||||
} );
|
||||
};
|
||||
if ( 'select' === action ) {
|
||||
|
||||
return;
|
||||
}
|
||||
if ( !$wraper.length ) {
|
||||
$wraper = $( '<ul>' ).addClass( s.class.wraper ).addClass( s.class.list );
|
||||
$parent.prepend( $wraper );
|
||||
}
|
||||
generate_images.call( $this, $wraper );
|
||||
$wraper.on( 'click', '.' + s.class.item + '-option', function ( e ) {
|
||||
e.preventDefault();
|
||||
var value = $( this ).data( 'value' );
|
||||
if ( $this.find( 'option[value="' + value + '"]' ).length ) {
|
||||
$this.val( value ).trigger( 'change' );
|
||||
}
|
||||
} );
|
||||
$this.on( 'change', function () {
|
||||
var value = $( this ).val(),
|
||||
$item_image = $wraper.find( '.' + s.class.item + '-option[data-value="' + value + '"]' ),
|
||||
$items_active = $wraper.find( '.' + s.class.item + '.' + s.class.active ).not( $item_image );
|
||||
$items_active.removeClass( s.class.active );
|
||||
$item_image.addClass( s.class.active );
|
||||
} );
|
||||
|
||||
$this.trigger( 'change' ).addClass( s.class.element ).hide( );
|
||||
} );
|
||||
};
|
||||
$(function(){
|
||||
$( '.select-image' ).selectimage();
|
||||
});
|
||||
} );
|
||||