first commit
This commit is contained in:
+463
@@ -0,0 +1,463 @@
|
||||
<?php
|
||||
/**
|
||||
* The admin-specific functionality of the module.
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Modules/Admin
|
||||
*/
|
||||
|
||||
/**
|
||||
* The admin-specific functionality of the module.
|
||||
*/
|
||||
class Powerkit_Basic_Elements_Admin extends Powerkit_Module_Admin {
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
public function initialize() {
|
||||
add_action( 'wp_ajax_powerkit_basic_shortcodes_sections', array( $this, 'powerkit_basic_shortcodes_ajax_panel' ) );
|
||||
add_filter( 'mce_buttons', array( $this, 'powerkit_basic_shortcodes_register_buttons' ) );
|
||||
add_filter( 'mce_external_plugins', array( $this, 'powerkit_basic_shortcodes_register_plugin' ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register shorcodes button for TinyMCE buttons (Visual tab).
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @param array $buttons First-row list of buttons.
|
||||
* @return array Buttons.
|
||||
*/
|
||||
public function powerkit_basic_shortcodes_register_buttons( $buttons ) {
|
||||
if ( current_user_can( 'edit_posts' ) ) {
|
||||
array_push( $buttons, 'powerkit_basic_shortcodes_button' );
|
||||
}
|
||||
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register shortcodes plugin
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @param array $plugins An array of external TinyMCE plugins.
|
||||
* @return array Plugins.
|
||||
*/
|
||||
public function powerkit_basic_shortcodes_register_plugin( $plugins ) {
|
||||
if ( current_user_can( 'edit_posts' ) ) {
|
||||
$plugins['powerkit_basic_shortcodes'] = trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/admin-powerkit-basic-elements.js';
|
||||
}
|
||||
|
||||
return $plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate Section Fileds
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @param array $section Sections Fields.
|
||||
* @param array $counter Unique field identifier.
|
||||
*/
|
||||
public function generate_section_fields( $section, $counter = 0 ) {
|
||||
if ( isset( $section['fields'] ) && is_array( $section['fields'] ) ) {
|
||||
|
||||
// Default Field Settings.
|
||||
$default_field = array(
|
||||
'type' => 'input',
|
||||
'name' => '',
|
||||
'label' => '',
|
||||
'desc' => '',
|
||||
'default' => '',
|
||||
'attrs' => array(),
|
||||
'style' => 'vertical', // For radio.
|
||||
'suffix' => '', // For inputs.
|
||||
'options' => array(), // For select, radio.
|
||||
'fields' => array(), // For repeater.
|
||||
);
|
||||
|
||||
foreach ( $section['fields'] as $field ) {
|
||||
|
||||
$counter++;
|
||||
|
||||
// Merge Settings.
|
||||
$field = array_merge( $default_field, $field );
|
||||
|
||||
// Attrs.
|
||||
$attrs = null;
|
||||
|
||||
if ( ! empty( $field['attrs'] ) ) {
|
||||
foreach ( $field['attrs'] as $key => $value ) {
|
||||
$attrs[] = sprintf( '%s="%s"', $key, $value );
|
||||
}
|
||||
$attrs = implode( ' ', $attrs );
|
||||
}
|
||||
|
||||
// Output by type.
|
||||
switch ( $field['type'] ) {
|
||||
case 'section':
|
||||
?>
|
||||
<tr>
|
||||
<th><h3><?php echo wp_kses_post( $field['label'] ); ?></h3></th><td> </td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
case 'input':
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
|
||||
<td>
|
||||
<input name="<?php echo esc_attr( $field['name'] ); ?>" type="text" value="<?php echo esc_attr( $field['default'] ); ?>" <?php echo wp_kses_data( $attrs ); ?>><?php echo esc_attr( $field['suffix'] ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
case 'textarea':
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
|
||||
<td>
|
||||
<textarea name="<?php echo esc_attr( $field['name'] ); ?>" <?php echo wp_kses_data( $attrs ); ?>><?php echo wp_kses_post( $field['default'] ); ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
case 'select':
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
|
||||
<td>
|
||||
<select name="<?php echo esc_attr( $field['name'] ); ?>" <?php echo wp_kses_data( $attrs ); ?>>
|
||||
<?php if ( isset( $field['options'] ) && $field['options'] ) : ?>
|
||||
<?php foreach ( $field['options'] as $key => $option ) : ?>
|
||||
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $field['default'], esc_attr( $key ) ); ?>><?php echo esc_attr( $option ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'checkbox':
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
|
||||
<td>
|
||||
<input name="<?php echo esc_attr( $field['name'] ); ?>" type="checkbox" value="true" <?php checked( (bool) $field['default'], true ); ?> <?php echo wp_kses_data( $attrs ); ?>>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'radio':
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
|
||||
<td>
|
||||
<?php if ( isset( $field['options'] ) && $field['options'] ) : ?>
|
||||
<?php foreach ( $field['options'] as $key => $option ) : $counter++; ?>
|
||||
<?php $id = sprintf( 'field-%s-%s-%s', $section['name'], $field['name'], $counter ); ?>
|
||||
<input id="<?php echo esc_attr( $id ); ?>" name="<?php echo esc_attr( $field['name'] ); ?>" type="radio" value="<?php echo esc_attr( $key ); ?>" <?php checked( $field['default'], $key ); ?> <?php echo wp_kses_data( $attrs ); ?>>
|
||||
<label for="<?php echo esc_attr( $id ); ?>"><?php echo esc_attr( $option ); ?></label>
|
||||
<?php if ( 'vertical' === $field['style'] ) : ?>
|
||||
<br>
|
||||
<?php else : ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'content':
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
|
||||
<td>
|
||||
<textarea name="<?php echo esc_attr( $field['name'] ); ?>" <?php echo wp_kses_data( $attrs ); ?>><?php echo wp_kses_post( $field['default'] ); ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'repeater':
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo wp_kses_post( $field['label'] ); ?>:</label><small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
|
||||
<td class="basic-shortcodes-repeater-field">
|
||||
<div data-repeater-list="<?php echo esc_attr( $field['base'] ); ?>" >
|
||||
<table class="form-table" data-repeater-item>
|
||||
<tbody>
|
||||
<?php $this->generate_section_fields( $field, $counter ); ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<span class="button-secondary" data-repeater-delete><?php esc_html_e( 'Delete Item', 'powerkit' ); ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<span data-repeater-create class="button-primary"><?php esc_html_e( 'Add Item', 'powerkit' ); ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax Load Admin Shortcodes Panel
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function powerkit_basic_shortcodes_ajax_panel() {
|
||||
|
||||
// Allow themes and plugins to enable/disable specific shortcodes UI panel.
|
||||
$sections = apply_filters( 'powerkit_basic_shortcodes_ui_args', array() );
|
||||
|
||||
// Sort elements.
|
||||
usort( $sections, function ( $a, $b ) {
|
||||
return $a['priority'] - $b['priority'];
|
||||
} );
|
||||
?>
|
||||
<div class="wrap powerkit_basic_shortcodes_wrap">
|
||||
|
||||
<div class="powerkit_basic_shortcodes_tabs">
|
||||
|
||||
<ul>
|
||||
<?php foreach ( $sections as $section ) : ?>
|
||||
<li><a data-nav="<?php echo esc_attr( $section['name'] ); ?>" href="#"><?php echo esc_html( $section['title'] ); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="powerkit_basic_shortcodes_tabs_sections">
|
||||
|
||||
<?php foreach ( $sections as $section ) : ?>
|
||||
<div class="hidable wrap tabs-<?php echo esc_attr( $section['name'] ); ?>" style="display: none;">
|
||||
|
||||
<form class="powerkit_basic_shortcodes_tab" enctype="multipart/form-data">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<?php $this->generate_section_fields( $section ); ?>
|
||||
|
||||
<tr>
|
||||
<th><input type="submit" class="button-primary" value="<?php esc_html_e( 'Insert', 'powerkit' ); ?>"></th>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($) {
|
||||
|
||||
// Insert Shortcode.
|
||||
$('.tabs-<?php echo esc_attr( $section['name'] ); ?> form').submit( function( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
// Hide Popup.
|
||||
tb_remove();
|
||||
|
||||
// Get input values from form.
|
||||
var fieldsObj = $( this ).serializeObject();
|
||||
|
||||
// Vars.
|
||||
var shortcodeContent = '',
|
||||
shortcodeAttrs = [];
|
||||
|
||||
<?php foreach ( (array) $section['fields'] as $field ) : ?>
|
||||
|
||||
var fieldName = '<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : '' ); ?>';
|
||||
<?php
|
||||
switch ( $field['type'] ) {
|
||||
case 'section':
|
||||
break;
|
||||
case 'repeater':
|
||||
?>
|
||||
var subContentVars = [],
|
||||
subCheckboxVars = [],
|
||||
shortcodeBase = '<?php echo esc_attr( $field['base'] ); ?>';
|
||||
|
||||
<?php foreach ( (array) $field['fields'] as $sub_field ) : ?>
|
||||
|
||||
<?php if ( 'content' === $sub_field['type'] ) : ?>
|
||||
subContentVars.push( '<?php echo esc_attr( $sub_field['name'] ); ?>' );
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( 'checkbox' === $sub_field['type'] ) : ?>
|
||||
subCheckboxVars.push( '<?php echo esc_attr( $sub_field['name'] ); ?>' );
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
if( typeof fieldsObj[ shortcodeBase ] !== 'undefined' ) {
|
||||
|
||||
$.each( fieldsObj[ shortcodeBase ], function( key, obj ) {
|
||||
|
||||
var subShortcodeContent = '',
|
||||
subShortcodeAttrs = [];
|
||||
|
||||
$.each( obj, function( s_key, s_obj ) {
|
||||
if( typeof s_obj !== 'undefined' ) {
|
||||
|
||||
// Field "Content" fix.
|
||||
if( ! $.inArray( s_key, subContentVars ) ) {
|
||||
subShortcodeContent += s_obj;
|
||||
} else {
|
||||
|
||||
// Other fields.
|
||||
subShortcodeAttrs.push( s_key + '="' + s_obj + '"' );
|
||||
}
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
// Add Inner Shortcode.
|
||||
if( subShortcodeContent ) {
|
||||
shortcodeContent += '[' + shortcodeBase + ' ' + subShortcodeAttrs.join( ' ' ) + ']<br>' + subShortcodeContent + '<br>[/' + shortcodeBase + ']<br>';
|
||||
} else {
|
||||
shortcodeContent += '[' + shortcodeBase + ' ' + subShortcodeAttrs.join( ' ' ) + ']<br>';
|
||||
}
|
||||
|
||||
} );
|
||||
}
|
||||
<?php
|
||||
break;
|
||||
case 'content':
|
||||
?>
|
||||
if( typeof fieldsObj[ fieldName ] !== 'undefined' ) {
|
||||
shortcodeContent += fieldsObj[ fieldName ];
|
||||
}
|
||||
<?php
|
||||
break;
|
||||
case 'checkbox':
|
||||
?>
|
||||
if( typeof fieldsObj[ fieldName ] !== 'undefined' ) {
|
||||
var fieldAttr = fieldName + '="' + fieldsObj[ fieldName ] + '"';
|
||||
} else {
|
||||
var fieldAttr = fieldName + '="false"';
|
||||
}
|
||||
|
||||
shortcodeAttrs.push( fieldAttr );
|
||||
<?php
|
||||
break;
|
||||
default:
|
||||
?>
|
||||
if( typeof fieldsObj[ fieldName ] !== 'undefined' ) {
|
||||
var fieldAttr = fieldName + '="' + fieldsObj[ fieldName ] + '"';
|
||||
} else {
|
||||
var fieldAttr = fieldName + '=""';
|
||||
}
|
||||
|
||||
shortcodeAttrs.push( fieldAttr );
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
// Add Shortcode.
|
||||
var shortcodeName = '<?php echo esc_attr( $section['base'] ); ?>';
|
||||
|
||||
if( shortcodeContent ) {
|
||||
|
||||
// Trim Line Breaks.
|
||||
shortcodeContent = shortcodeContent.replace( /^<br>|<br>$/gm, '' );
|
||||
|
||||
var content = '[' + shortcodeName + ' ' + shortcodeAttrs.join( ' ' ) + ']<br>' + shortcodeContent + '<br>[/' + shortcodeName + ']';
|
||||
} else {
|
||||
var content = '[' + shortcodeName + ' ' + shortcodeAttrs.join( ' ' ) + ']';
|
||||
}
|
||||
|
||||
// Remove odd space.
|
||||
content = content.replace(/\s\]/g, ']');
|
||||
|
||||
// Convert br.
|
||||
content = content.replace(/([^>])\n/g, '$1<br/>');
|
||||
|
||||
powerkit_basic_shortcodes.setContent( content );
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
( function( $ ) {
|
||||
|
||||
// Tabs Navigation.
|
||||
$( '.powerkit_basic_shortcodes_tabs a' ).click( function( e ) {
|
||||
e.preventDefault();
|
||||
powerkit_basic_shortcodes_tabs_switch( $( this ) );
|
||||
} );
|
||||
|
||||
powerkit_basic_shortcodes_tabs_switch( $( '.powerkit_basic_shortcodes_tabs a' ).first() );
|
||||
|
||||
function powerkit_basic_shortcodes_tabs_switch( obj ) {
|
||||
$( '.powerkit_basic_shortcodes_tabs_sections .hidable' ).hide();
|
||||
$( '.powerkit_basic_shortcodes_tabs_sections .tabs-' + obj.attr( 'data-nav' ) ).show();
|
||||
$( '.powerkit_basic_shortcodes_tabs li' ).removeClass( 'current' );
|
||||
obj.parent().addClass( 'current' );
|
||||
}
|
||||
|
||||
// Init Repeater.
|
||||
$( document ).ready( function() {
|
||||
$( '.basic-shortcodes-repeater-field' ).each( function() {
|
||||
$( this ).repeater( {
|
||||
show: function() {
|
||||
$( this ).slideDown();
|
||||
},
|
||||
hide: function( deleteElement ) {
|
||||
$( this ).fadeOut( 400 );
|
||||
},
|
||||
isFirstItemUndeletable: true,
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
} )( jQuery );
|
||||
/* ]]> */
|
||||
</script>
|
||||
</div>
|
||||
<?php
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the stylesheets and JavaScript for the admin area.
|
||||
*
|
||||
* @param string $page Current page.
|
||||
*/
|
||||
public function admin_enqueue_scripts( $page ) {
|
||||
|
||||
add_thickbox();
|
||||
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
|
||||
// Styles.
|
||||
wp_enqueue_style( 'powerkit-basic-elements', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/admin-powerkit-basic-elements.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
|
||||
|
||||
wp_enqueue_script( 'wp-color-picker' );
|
||||
// Scripts.
|
||||
wp_enqueue_script( 'powerkit-jquery-serialize', plugin_dir_url( __FILE__ ) . 'js/jquery.serialize-to-json.min.js', array( 'jquery' ), powerkit_get_setting( 'version' ), false );
|
||||
wp_enqueue_script( 'powerkit-jquery-repeater', plugin_dir_url( __FILE__ ) . 'js/jquery.repeater.min.js', array( 'jquery' ), powerkit_get_setting( 'version' ), false );
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
.powerkit_basic_shortcodes_wrap {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
height: 97.5%;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_wrap .form-table td,
|
||||
.powerkit_basic_shortcodes_wrap .form-table th {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs {
|
||||
width: 200px;
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
background: #f9f9f9;
|
||||
border-left: 1px solid #EEE;
|
||||
float: right;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
font-family: Helvetica, Arial;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs ul {
|
||||
list-style: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs ul li {
|
||||
width: 201px;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs li.current {
|
||||
display: block;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs li.current a {
|
||||
background: #FFF;
|
||||
box-shadow: 0 -1px 0 #eee;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs ul li a {
|
||||
display: block;
|
||||
padding: 14px 20px;
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
box-shadow: 0 -1px 0 #eee;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs ul li:last-child a {
|
||||
box-shadow: 0 -1px 0 #eee, 0 1px 0 #eee;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs_sections {
|
||||
overflow: auto;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
padding: 0 20px 0 0;
|
||||
margin: 0;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs_sections table tr th small {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
color: #777777;
|
||||
}
|
||||
|
||||
/* Repeater */
|
||||
.powerkit_basic_shortcodes_wrap .basic-shortcodes-repeater-field .form-table th,
|
||||
.powerkit_basic_shortcodes_wrap .basic-shortcodes-repeater-field .form-table td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.basic-shortcodes-repeater-field th,
|
||||
.basic-shortcodes-repeater-field td {
|
||||
display: block;
|
||||
padding: 0 0 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.basic-shortcodes-repeater-field tfoot {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.basic-shortcodes-repeater-field tfoot th {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* TB_window */
|
||||
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent {
|
||||
padding: 0 0 30px 0;
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent li:before {
|
||||
display: none;
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
.powerkit_basic_shortcodes_wrap {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
height: 97.5%;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_wrap .form-table td,
|
||||
.powerkit_basic_shortcodes_wrap .form-table th {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs {
|
||||
width: 200px;
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
background: #f9f9f9;
|
||||
border-right: 1px solid #EEE;
|
||||
float: left;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
font-family: Helvetica, Arial;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs ul {
|
||||
list-style: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs ul li {
|
||||
width: 201px;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs li.current {
|
||||
display: block;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs li.current a {
|
||||
background: #FFF;
|
||||
box-shadow: 0 -1px 0 #eee;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs ul li a {
|
||||
display: block;
|
||||
padding: 14px 20px;
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
box-shadow: 0 -1px 0 #eee;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs ul li:last-child a {
|
||||
box-shadow: 0 -1px 0 #eee, 0 1px 0 #eee;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs_sections {
|
||||
overflow: auto;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
padding: 0 0 0 20px;
|
||||
margin: 0;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.powerkit_basic_shortcodes_tabs_sections table tr th small {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
color: #777777;
|
||||
}
|
||||
|
||||
/* Repeater */
|
||||
.powerkit_basic_shortcodes_wrap .basic-shortcodes-repeater-field .form-table th,
|
||||
.powerkit_basic_shortcodes_wrap .basic-shortcodes-repeater-field .form-table td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.basic-shortcodes-repeater-field th,
|
||||
.basic-shortcodes-repeater-field td {
|
||||
display: block;
|
||||
padding: 0 0 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.basic-shortcodes-repeater-field tfoot {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.basic-shortcodes-repeater-field tfoot th {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* TB_window */
|
||||
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent {
|
||||
padding: 0 0 30px 0;
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent li:before {
|
||||
display: none;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
+49
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
var powerkit_basic_shortcodes;
|
||||
var powerkit_basic_shortcodes_content;
|
||||
|
||||
( function() {
|
||||
tinymce.create( 'tinymce.plugins.powerkit_basic_shortcodes', {
|
||||
init: function( ed, url ) {
|
||||
ed.addButton( 'powerkit_basic_shortcodes_button', {
|
||||
title: 'Basic Shortcodes',
|
||||
image: url.substring( 0, url.length - 3 ) + '/images/icon.png',
|
||||
onclick: function() {
|
||||
|
||||
powerkit_basic_shortcodes = ed.selection;
|
||||
powerkit_basic_shortcodes_content = ed.selection.getContent();
|
||||
|
||||
var width = jQuery( window ).width(),
|
||||
H = jQuery( window ).height(),
|
||||
W = ( 720 < width ) ? 720 : width;
|
||||
W = W - 80;
|
||||
H = H - 84;
|
||||
|
||||
|
||||
var shortcodes_loaded = jQuery( '#powerkit_basic_shortcodes_holder' ).length;
|
||||
|
||||
if ( shortcodes_loaded ) {
|
||||
|
||||
tb_show( 'Basic Shortcodes', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=powerkit_basic_shortcodes' );
|
||||
jQuery( '#TB_window' ).addClass( 'powerkit_basic_shortcodes_window' );
|
||||
|
||||
} else {
|
||||
|
||||
jQuery( "body" ).append( '<div id="powerkit_basic_shortcodes_holder" style="display: none;"><div id="powerkit_basic_shortcodes"></div></div>' );
|
||||
|
||||
jQuery.get( 'admin-ajax.php?action=powerkit_basic_shortcodes_sections', function( data ) {
|
||||
jQuery( '#powerkit_basic_shortcodes' ).html( data );
|
||||
tb_show( 'Basic Shortcodes', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=powerkit_basic_shortcodes' );
|
||||
jQuery( '#TB_window' ).addClass( 'powerkit_basic_shortcodes_window' );
|
||||
} );
|
||||
}
|
||||
}
|
||||
} );
|
||||
},
|
||||
createControl: function( n, cm ) {
|
||||
return null;
|
||||
},
|
||||
} );
|
||||
tinymce.PluginManager.add( 'powerkit_basic_shortcodes', tinymce.plugins.powerkit_basic_shortcodes );
|
||||
} )();
|
||||
+5
File diff suppressed because one or more lines are too long
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* jQuery serializeObject
|
||||
* @copyright 2014, macek <paulmacek@gmail.com>
|
||||
* @link https://github.com/macek/jquery-serialize-object
|
||||
* @license BSD
|
||||
* @version 2.5.0
|
||||
*/
|
||||
!function(e,i){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(e,r){return i(e,r)});else if("undefined"!=typeof exports){var r=require("jquery");i(exports,r)}else i(e,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,i){function r(e,r){function n(e,i,r){return e[i]=r,e}function a(e,i){for(var r,a=e.match(t.key);void 0!==(r=a.pop());)if(t.push.test(r)){var u=s(e.replace(/\[\]$/,""));i=n([],u,i)}else t.fixed.test(r)?i=n([],r,i):t.named.test(r)&&(i=n({},r,i));return i}function s(e){return void 0===h[e]&&(h[e]=0),h[e]++}function u(e){switch(i('[name="'+e.name+'"]',r).attr("type")){case"checkbox":return"on"===e.value?!0:e.value;default:return e.value}}function f(i){if(!t.validate.test(i.name))return this;var r=a(i.name,u(i));return l=e.extend(!0,l,r),this}function d(i){if(!e.isArray(i))throw new Error("formSerializer.addPairs expects an Array");for(var r=0,t=i.length;t>r;r++)this.addPair(i[r]);return this}function o(){return l}function c(){return JSON.stringify(o())}var l={},h={};this.addPair=f,this.addPairs=d,this.serialize=o,this.serializeJSON=c}var t={validate:/^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,key:/[a-z0-9_]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_]+$/i};return r.patterns=t,r.serializeObject=function(){return new r(i,this).addPairs(this.serializeArray()).serialize()},r.serializeJSON=function(){return new r(i,this).addPairs(this.serializeArray()).serializeJSON()},"undefined"!=typeof i.fn&&(i.fn.serializeObject=r.serializeObject,i.fn.serializeJSON=r.serializeJSON),e.FormSerializer=r,r});
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Basic Elements
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Modules
|
||||
*/
|
||||
|
||||
if ( class_exists( 'Powerkit_Module' ) ) {
|
||||
/**
|
||||
* Init module
|
||||
*/
|
||||
class Powerkit_Basic_Elements extends Powerkit_Module {
|
||||
|
||||
/**
|
||||
* Register module
|
||||
*/
|
||||
public function register() {
|
||||
$this->name = esc_html__( 'Basic Elements', 'powerkit' );
|
||||
$this->desc = esc_html__( 'Basic shortcodes with a shortcode generator right in the WordPress editor.', 'powerkit' );
|
||||
$this->slug = 'basic_elements';
|
||||
$this->type = 'default';
|
||||
$this->category = 'basic';
|
||||
$this->priority = 80;
|
||||
$this->public = true;
|
||||
$this->enabled = true;
|
||||
|
||||
$this->links = array(
|
||||
array(
|
||||
'name' => esc_html__( 'View documentation', 'powerkit' ),
|
||||
'url' => powerkit_get_setting( 'documentation' ) . '/content-presentation/basic-elements/',
|
||||
'target' => '_blank',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize module
|
||||
*/
|
||||
public function initialize() {
|
||||
|
||||
/* Load the required dependencies for this module */
|
||||
|
||||
// Helpers Functions for the module.
|
||||
require_once dirname( __FILE__ ) . '/helpers/helper-basic-elements.php';
|
||||
|
||||
// Admin and public area.
|
||||
require_once dirname( __FILE__ ) . '/admin/class-powerkit-basic-elements-admin.php';
|
||||
require_once dirname( __FILE__ ) . '/public/class-powerkit-basic-elements-public.php';
|
||||
|
||||
// Include default templates.
|
||||
powerkit_basic_shortcodes_autoload( dirname( __FILE__ ) . '/templates' );
|
||||
|
||||
new Powerkit_Basic_Elements_Admin( $this->slug );
|
||||
new Powerkit_Basic_Elements_Public( $this->slug );
|
||||
}
|
||||
}
|
||||
|
||||
new Powerkit_Basic_Elements();
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* Helpers Social Links
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Modules/Helper
|
||||
*/
|
||||
|
||||
/**
|
||||
* Register Shortcodes
|
||||
*
|
||||
* @param array $map Shortcode parameters.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_register( $map ) {
|
||||
add_filter( 'powerkit_basic_shortcodes_ui_args', function( $sections ) use ( $map ) {
|
||||
$sections[] = $map;
|
||||
return $sections;
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
* Autoload files in the directory.
|
||||
*
|
||||
* @param string $path Directory path.
|
||||
* @param string $pattern Regex pattern.
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function powerkit_basic_shortcodes_autoload( $path, $pattern = false ) {
|
||||
if ( is_dir( $path ) ) {
|
||||
$files = scandir( $path );
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
// loop folders.
|
||||
foreach ( $files as $file ) {
|
||||
$path_file = $path . '/' . basename( $file );
|
||||
|
||||
if ( $pattern && ! preg_match( "/$pattern/", basename( $file ) ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( file_exists( $path_file ) && 'index.php' !== $file ) {
|
||||
|
||||
if ( is_dir( $path_file ) && file_exists( $path_file . "/$file.php" ) ) {
|
||||
require_once $path_file . "/$file.php";
|
||||
} elseif ( is_file( $path_file ) && preg_match( '/\.php$/i', $path_file ) ) {
|
||||
require_once $path_file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean shortcodes
|
||||
*
|
||||
* @param string $content Post content.
|
||||
* @return string Filtered Post content.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_clean( $content ) {
|
||||
$array = array(
|
||||
'<p>[' => '[',
|
||||
']</p>' => ']',
|
||||
']<br />' => ']',
|
||||
);
|
||||
$content = strtr( $content, $array );
|
||||
return $content;
|
||||
}
|
||||
add_filter( 'the_content', 'powerkit_basic_shortcodes_clean' );
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
/**
|
||||
* The public-facing functionality of the module.
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Modules/public
|
||||
*/
|
||||
|
||||
/**
|
||||
* The public-facing functionality of the module.
|
||||
*/
|
||||
class Powerkit_Basic_Elements_Public extends Powerkit_Module_Public {
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
public function initialize() {
|
||||
add_action( 'init', array( $this, 'register_custom_shortcodes' ) );
|
||||
|
||||
$this->register_shortcodes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcodes custom.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
*/
|
||||
public function register_custom_shortcodes() {
|
||||
|
||||
$dir_path = apply_filters( 'powerkit_basic_shortcodes_autoload_path', 'shortcodes' );
|
||||
|
||||
$custom_path = wp_normalize_path( get_template_directory() . '/' . $dir_path );
|
||||
|
||||
if ( file_exists( $custom_path ) ) {
|
||||
powerkit_basic_shortcodes_autoload( $custom_path );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Shortcodes
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access private
|
||||
*/
|
||||
private function register_shortcodes() {
|
||||
|
||||
// Get all shortcodes.
|
||||
$sections = apply_filters( 'powerkit_basic_shortcodes_ui_args', array() );
|
||||
|
||||
// Add shortcodes.
|
||||
foreach ( $sections as $section ) {
|
||||
if ( true === $section['autoregister'] ) {
|
||||
add_shortcode( $section['base'], array( $this, 'shortcode_display' ) );
|
||||
}
|
||||
|
||||
// Repeat Shortcodes.
|
||||
if ( ! empty( $section['fields'] ) ) {
|
||||
foreach ( $section['fields'] as $field ) {
|
||||
if ( 'repeater' === $field['type'] && true === $field['autoregister'] ) {
|
||||
add_shortcode( $field['base'], array( $this, 'shortcode_display' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcode Public Display
|
||||
*
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode Content.
|
||||
* @param string $shortcode The name of the shortcode.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
public function shortcode_display( $atts, $content = false, $shortcode = '' ) {
|
||||
// Get all shortcodes.
|
||||
$sections = apply_filters( 'powerkit_basic_shortcodes_ui_args', array() );
|
||||
|
||||
// Get Default Attrs.
|
||||
$default_attrs = array();
|
||||
foreach ( $sections as $section ) {
|
||||
if ( isset( $section['fields'] ) && is_array( $section['fields'] ) ) {
|
||||
foreach ( $section['fields'] as $field ) {
|
||||
switch ( $field['type'] ) {
|
||||
case 'section':
|
||||
break;
|
||||
case 'repeater':
|
||||
if ( $field['base'] === $shortcode ) {
|
||||
foreach ( $field['fields'] as $repeater_field ) {
|
||||
$default_attrs[ $repeater_field['name'] ] = $repeater_field['default'] ? $repeater_field['default'] : '';
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if ( $section['base'] === $shortcode ) {
|
||||
$default_attrs[ $field['name'] ] = $field['default'] ? $field['default'] : '';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Merge Attrs.
|
||||
$atts = shortcode_atts( $default_attrs, $atts );
|
||||
|
||||
// Content.
|
||||
$content = do_shortcode( $content );
|
||||
|
||||
/**
|
||||
* Filters a shortcode's HTML.
|
||||
*
|
||||
* @param array $output Shortcode HTML.
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode tag content.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
$output = apply_filters( $shortcode . '_shortcode', '', $atts, $content );
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the stylesheets for the public-facing side of the site.
|
||||
*/
|
||||
public function wp_enqueue_scripts() {
|
||||
// Styles.
|
||||
wp_enqueue_style( 'powerkit-basic-elements', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-basic-elements.css' ), false, powerkit_get_setting( 'version' ), 'screen' );
|
||||
|
||||
// Add RTL support.
|
||||
wp_style_add_data( 'powerkit-basic-elements', 'rtl', 'replace' );
|
||||
|
||||
// Scripts.
|
||||
wp_enqueue_script( 'powerkit-basic-elements', plugin_dir_url( __FILE__ ) . 'js/public-powerkit-basic-elements.js', array( 'jquery' ), '4.0.0', true );
|
||||
}
|
||||
}
|
||||
+882
@@ -0,0 +1,882 @@
|
||||
/**
|
||||
* All of the CSS for your public-facing functionality should be
|
||||
* included in this file.
|
||||
*/
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/*--------------------------------------------------------------*/
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-tabs,
|
||||
.pk-pills,
|
||||
.pk-accordion,
|
||||
.pk-progress,
|
||||
.pk-button.pk-button-block {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-button {
|
||||
display: inline-block;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 0.25rem;
|
||||
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
||||
color: white;
|
||||
border: none;
|
||||
box-shadow: none !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pk-button {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
.pk-button:hover, .pk-button:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.pk-button:focus, .pk-button.focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
|
||||
}
|
||||
|
||||
.pk-button-primary {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-primary:hover {
|
||||
color: #fff;
|
||||
background-color: #0069d9;
|
||||
border-color: #0062cc;
|
||||
}
|
||||
|
||||
.pk-button-primary:focus, .pk-button-primary.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-primary.disabled, .pk-button-primary:disabled {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-primary:not(:disabled):not(.disabled):active, .pk-button-primary:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-primary.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #0062cc;
|
||||
border-color: #005cbf;
|
||||
}
|
||||
|
||||
.pk-button-primary:not(:disabled):not(.disabled):active:focus, .pk-button-primary:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-primary.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-secondary {
|
||||
color: #212529;
|
||||
background-color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-secondary:hover {
|
||||
color: #fff;
|
||||
background-color: #8d8d8d;
|
||||
border-color: #878686;
|
||||
}
|
||||
|
||||
.pk-button-secondary:focus, .pk-button-secondary.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(141, 142, 142, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-secondary.disabled, .pk-button-secondary:disabled {
|
||||
color: #212529;
|
||||
background-color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-secondary:not(:disabled):not(.disabled):active, .pk-button-secondary:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-secondary.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #878686;
|
||||
border-color: gray;
|
||||
}
|
||||
|
||||
.pk-button-secondary:not(:disabled):not(.disabled):active:focus, .pk-button-secondary:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-secondary.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(141, 142, 142, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-success {
|
||||
color: #fff;
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-success:hover {
|
||||
color: #fff;
|
||||
background-color: #218838;
|
||||
border-color: #1e7e34;
|
||||
}
|
||||
|
||||
.pk-button-success:focus, .pk-button-success.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-success.disabled, .pk-button-success:disabled {
|
||||
color: #fff;
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-success:not(:disabled):not(.disabled):active, .pk-button-success:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-success.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #1e7e34;
|
||||
border-color: #1c7430;
|
||||
}
|
||||
|
||||
.pk-button-success:not(:disabled):not(.disabled):active:focus, .pk-button-success:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-success.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-info {
|
||||
color: #fff;
|
||||
background-color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-info:hover {
|
||||
color: #fff;
|
||||
background-color: #138496;
|
||||
border-color: #117a8b;
|
||||
}
|
||||
|
||||
.pk-button-info:focus, .pk-button-info.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-info.disabled, .pk-button-info:disabled {
|
||||
color: #fff;
|
||||
background-color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-info:not(:disabled):not(.disabled):active, .pk-button-info:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-info.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #117a8b;
|
||||
border-color: #10707f;
|
||||
}
|
||||
|
||||
.pk-button-info:not(:disabled):not(.disabled):active:focus, .pk-button-info:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-info.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-warning {
|
||||
color: #212529;
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-warning:hover {
|
||||
color: #212529;
|
||||
background-color: #e0a800;
|
||||
border-color: #d39e00;
|
||||
}
|
||||
|
||||
.pk-button-warning:focus, .pk-button-warning.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-warning.disabled, .pk-button-warning:disabled {
|
||||
color: #212529;
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-warning:not(:disabled):not(.disabled):active, .pk-button-warning:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-warning.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #d39e00;
|
||||
border-color: #c69500;
|
||||
}
|
||||
|
||||
.pk-button-warning:not(:disabled):not(.disabled):active:focus, .pk-button-warning:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-warning.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-danger {
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-danger:hover {
|
||||
color: #fff;
|
||||
background-color: #c82333;
|
||||
border-color: #bd2130;
|
||||
}
|
||||
|
||||
.pk-button-danger:focus, .pk-button-danger.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-danger.disabled, .pk-button-danger:disabled {
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-danger:not(:disabled):not(.disabled):active, .pk-button-danger:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-danger.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #bd2130;
|
||||
border-color: #b21f2d;
|
||||
}
|
||||
|
||||
.pk-button-danger:not(:disabled):not(.disabled):active:focus, .pk-button-danger:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-danger.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-light {
|
||||
color: #212529;
|
||||
background-color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-light:hover {
|
||||
color: #212529;
|
||||
background-color: #e2e6ea;
|
||||
border-color: #dae0e5;
|
||||
}
|
||||
|
||||
.pk-button-light:focus, .pk-button-light.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-light.disabled, .pk-button-light:disabled {
|
||||
color: #212529;
|
||||
background-color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-light:not(:disabled):not(.disabled):active, .pk-button-light:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-light.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #dae0e5;
|
||||
border-color: #d3d9df;
|
||||
}
|
||||
|
||||
.pk-button-light:not(:disabled):not(.disabled):active:focus, .pk-button-light:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-light.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-dark {
|
||||
color: #fff;
|
||||
background-color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-dark:hover {
|
||||
color: #fff;
|
||||
background-color: #23272b;
|
||||
border-color: #1d2124;
|
||||
}
|
||||
|
||||
.pk-button-dark:focus, .pk-button-dark.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-dark.disabled, .pk-button-dark:disabled {
|
||||
color: #fff;
|
||||
background-color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-dark:not(:disabled):not(.disabled):active, .pk-button-dark:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-dark.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #1d2124;
|
||||
border-color: #171a1d;
|
||||
}
|
||||
|
||||
.pk-button-dark:not(:disabled):not(.disabled):active:focus, .pk-button-dark:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-dark.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-primary {
|
||||
color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-outline-primary:hover {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-outline-primary:focus, .pk-button-outline-primary.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-primary.disabled, .pk-button-outline-primary:disabled {
|
||||
color: #007bff;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-primary:not(:disabled):not(.disabled):active, .pk-button-outline-primary:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-primary.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-outline-primary:not(:disabled):not(.disabled):active:focus, .pk-button-outline-primary:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-primary.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary {
|
||||
color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary:hover {
|
||||
color: #212529;
|
||||
background-color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary:focus, .pk-button-outline-secondary.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(160, 160, 160, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary.disabled, .pk-button-outline-secondary:disabled {
|
||||
color: #A0A0A0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary:not(:disabled):not(.disabled):active, .pk-button-outline-secondary:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-secondary.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary:not(:disabled):not(.disabled):active:focus, .pk-button-outline-secondary:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-secondary.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(160, 160, 160, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-success {
|
||||
color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-outline-success:hover {
|
||||
color: #fff;
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-outline-success:focus, .pk-button-outline-success.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-success.disabled, .pk-button-outline-success:disabled {
|
||||
color: #28a745;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-success:not(:disabled):not(.disabled):active, .pk-button-outline-success:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-success.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-outline-success:not(:disabled):not(.disabled):active:focus, .pk-button-outline-success:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-success.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-info {
|
||||
color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-outline-info:hover {
|
||||
color: #fff;
|
||||
background-color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-outline-info:focus, .pk-button-outline-info.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-info.disabled, .pk-button-outline-info:disabled {
|
||||
color: #17a2b8;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-info:not(:disabled):not(.disabled):active, .pk-button-outline-info:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-info.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-outline-info:not(:disabled):not(.disabled):active:focus, .pk-button-outline-info:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-info.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-warning {
|
||||
color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-outline-warning:hover {
|
||||
color: #212529;
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-outline-warning:focus, .pk-button-outline-warning.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-warning.disabled, .pk-button-outline-warning:disabled {
|
||||
color: #ffc107;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-warning:not(:disabled):not(.disabled):active, .pk-button-outline-warning:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-warning.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-outline-warning:not(:disabled):not(.disabled):active:focus, .pk-button-outline-warning:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-warning.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-danger {
|
||||
color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-outline-danger:hover {
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-outline-danger:focus, .pk-button-outline-danger.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-danger.disabled, .pk-button-outline-danger:disabled {
|
||||
color: #dc3545;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-danger:not(:disabled):not(.disabled):active, .pk-button-outline-danger:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-danger.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-outline-danger:not(:disabled):not(.disabled):active:focus, .pk-button-outline-danger:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-danger.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-light {
|
||||
color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-outline-light:hover {
|
||||
color: #212529;
|
||||
background-color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-outline-light:focus, .pk-button-outline-light.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-light.disabled, .pk-button-outline-light:disabled {
|
||||
color: #f8f9fa;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-light:not(:disabled):not(.disabled):active, .pk-button-outline-light:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-light.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-outline-light:not(:disabled):not(.disabled):active:focus, .pk-button-outline-light:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-light.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-dark {
|
||||
color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-outline-dark:hover {
|
||||
color: #fff;
|
||||
background-color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-outline-dark:focus, .pk-button-outline-dark.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-dark.disabled, .pk-button-outline-dark:disabled {
|
||||
color: #343a40;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-dark:not(:disabled):not(.disabled):active, .pk-button-outline-dark:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-dark.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-outline-dark:not(:disabled):not(.disabled):active:focus, .pk-button-outline-dark:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-dark.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-lg {
|
||||
padding: 0.5rem 1rem;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 0.3rem;
|
||||
}
|
||||
|
||||
.pk-button-sm {
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 0.2rem;
|
||||
}
|
||||
|
||||
.pk-button-block {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.pk-button-block + .pk-button-block {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
/* Tabs */
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
padding-right: 0;
|
||||
margin-bottom: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.pk-fade {
|
||||
transition: opacity 0.15s linear;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pk-fade {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
.pk-nav-link {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.pk-nav-link:hover, .pk-nav-link:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.pk-nav-tabs .pk-nav-item + .pk-nav-item .pk-nav-link {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.pk-nav-tabs .pk-nav-link {
|
||||
border: 1px solid transparent;
|
||||
border-color: #dee2e6;
|
||||
color: #adb5bd;
|
||||
border-top-right-radius: 0.25rem;
|
||||
border-top-left-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.pk-nav-tabs .pk-nav-link.pk-active {
|
||||
color: #000;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.pk-nav-tabs .pk-nav-link:hover, .pk-nav-tabs .pk-nav-link:focus {
|
||||
color: #212529;
|
||||
}
|
||||
|
||||
.pk-tab-content > .pk-tab-pane {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pk-tab-content > .pk-active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav-link {
|
||||
padding: 1rem 1.5rem;
|
||||
line-height: 1;
|
||||
font-size: 1rem;
|
||||
text-decoration: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-tab-pane > *:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav-tabs .pk-nav-link.pk-active {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav-pills .pk-nav-link {
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.75rem 1rem;
|
||||
line-height: 1;
|
||||
color: #adb5bd;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav-pills .pk-nav-link.pk-active {
|
||||
color: #000;
|
||||
background-color: #e9ecef;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.pk-tabs .pk-nav-item + .pk-nav-item .pk-nav-link {
|
||||
margin-top: 0;
|
||||
}
|
||||
.pk-tabs .pk-nav-link:not(.pk-active) {
|
||||
border-color: transparent;
|
||||
}
|
||||
.pk-tabs .pk-nav-tabs .pk-nav-link.pk-active {
|
||||
background-color: transparent;
|
||||
}
|
||||
.pk-tabs-horizontal .pk-nav {
|
||||
flex-direction: row;
|
||||
}
|
||||
.pk-tabs-horizontal .pk-nav-tabs {
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
.pk-tabs-horizontal .pk-nav-item {
|
||||
transform: translateY(1px);
|
||||
}
|
||||
.pk-tabs-horizontal .pk-nav-link.pk-active {
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-container {
|
||||
display: flex;
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-navigation {
|
||||
flex: 0 0 30%;
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-navigation .pk-nav {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-navigation .pk-nav-item {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
transform: translateX(-1px);
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-content {
|
||||
margin-right: 5%;
|
||||
flex: 0 0 65%;
|
||||
}
|
||||
.pk-tabs-vertical .pk-nav-tabs {
|
||||
border-left: 1px solid #dee2e6;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
.pk-tabs-vertical .pk-nav-tabs .pk-nav-link {
|
||||
border-radius: 0 0.25rem 0.25rem 0;
|
||||
}
|
||||
.pk-tabs-vertical .pk-nav-tabs .pk-nav-link.pk-active {
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.pk-tabs-vertical .pk-nav-pills {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
/* Collapsibles */
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
word-wrap: break-word;
|
||||
margin-bottom: 0;
|
||||
background-clip: border-box;
|
||||
}
|
||||
|
||||
.pk-card + .pk-card {
|
||||
border-top: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.pk-collapsing {
|
||||
position: relative;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pk-card-body {
|
||||
flex: 1 1 auto;
|
||||
padding: 0.75rem 0;
|
||||
}
|
||||
|
||||
.pk-card-header {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.pk-card-header .pk-card-title {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.pk-card-header a {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0.75rem 0;
|
||||
border: none;
|
||||
color: #212529;
|
||||
transition: 0.3s;
|
||||
text-decoration: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.pk-card-header a:hover {
|
||||
color: #adb5bd;
|
||||
}
|
||||
|
||||
.pk-card-header a:after {
|
||||
font-family: 'powerkit-icons';
|
||||
content: "\e90d";
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.pk-card.expanded .pk-card-header a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.pk-card.expanded .pk-card-header a:after {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
/* Progress */
|
||||
/*--------------------------------------------------------------*/
|
||||
@-webkit-keyframes progress-bar-stripes {
|
||||
from {
|
||||
background-position: 1rem 0;
|
||||
}
|
||||
to {
|
||||
background-position: 0 0;
|
||||
}
|
||||
}
|
||||
@keyframes progress-bar-stripes {
|
||||
from {
|
||||
background-position: 1rem 0;
|
||||
}
|
||||
to {
|
||||
background-position: 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
.pk-progress {
|
||||
display: flex;
|
||||
height: 1rem;
|
||||
overflow: hidden;
|
||||
font-size: 0.75rem;
|
||||
background-color: #e9ecef;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.pk-progress-bar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
transition: width 0.6s ease;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pk-progress-bar {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
.pk-progress-bar.pk-bg-primary {
|
||||
background-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-progress-bar-striped {
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-size: 1rem 1rem;
|
||||
}
|
||||
|
||||
.pk-progress-bar-animated {
|
||||
-webkit-animation: progress-bar-stripes 1s linear infinite;
|
||||
animation: progress-bar-stripes 1s linear infinite;
|
||||
}
|
||||
|
||||
/* Separators */
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-separator {
|
||||
border-bottom-color: #ddd;
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
+882
@@ -0,0 +1,882 @@
|
||||
/**
|
||||
* All of the CSS for your public-facing functionality should be
|
||||
* included in this file.
|
||||
*/
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/*--------------------------------------------------------------*/
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-tabs,
|
||||
.pk-pills,
|
||||
.pk-accordion,
|
||||
.pk-progress,
|
||||
.pk-button.pk-button-block {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-button {
|
||||
display: inline-block;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 0.25rem;
|
||||
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
||||
color: white;
|
||||
border: none;
|
||||
box-shadow: none !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pk-button {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
.pk-button:hover, .pk-button:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.pk-button:focus, .pk-button.focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
|
||||
}
|
||||
|
||||
.pk-button-primary {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-primary:hover {
|
||||
color: #fff;
|
||||
background-color: #0069d9;
|
||||
border-color: #0062cc;
|
||||
}
|
||||
|
||||
.pk-button-primary:focus, .pk-button-primary.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-primary.disabled, .pk-button-primary:disabled {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-primary:not(:disabled):not(.disabled):active, .pk-button-primary:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-primary.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #0062cc;
|
||||
border-color: #005cbf;
|
||||
}
|
||||
|
||||
.pk-button-primary:not(:disabled):not(.disabled):active:focus, .pk-button-primary:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-primary.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-secondary {
|
||||
color: #212529;
|
||||
background-color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-secondary:hover {
|
||||
color: #fff;
|
||||
background-color: #8d8d8d;
|
||||
border-color: #878686;
|
||||
}
|
||||
|
||||
.pk-button-secondary:focus, .pk-button-secondary.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(141, 142, 142, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-secondary.disabled, .pk-button-secondary:disabled {
|
||||
color: #212529;
|
||||
background-color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-secondary:not(:disabled):not(.disabled):active, .pk-button-secondary:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-secondary.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #878686;
|
||||
border-color: gray;
|
||||
}
|
||||
|
||||
.pk-button-secondary:not(:disabled):not(.disabled):active:focus, .pk-button-secondary:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-secondary.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(141, 142, 142, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-success {
|
||||
color: #fff;
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-success:hover {
|
||||
color: #fff;
|
||||
background-color: #218838;
|
||||
border-color: #1e7e34;
|
||||
}
|
||||
|
||||
.pk-button-success:focus, .pk-button-success.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-success.disabled, .pk-button-success:disabled {
|
||||
color: #fff;
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-success:not(:disabled):not(.disabled):active, .pk-button-success:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-success.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #1e7e34;
|
||||
border-color: #1c7430;
|
||||
}
|
||||
|
||||
.pk-button-success:not(:disabled):not(.disabled):active:focus, .pk-button-success:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-success.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-info {
|
||||
color: #fff;
|
||||
background-color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-info:hover {
|
||||
color: #fff;
|
||||
background-color: #138496;
|
||||
border-color: #117a8b;
|
||||
}
|
||||
|
||||
.pk-button-info:focus, .pk-button-info.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-info.disabled, .pk-button-info:disabled {
|
||||
color: #fff;
|
||||
background-color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-info:not(:disabled):not(.disabled):active, .pk-button-info:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-info.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #117a8b;
|
||||
border-color: #10707f;
|
||||
}
|
||||
|
||||
.pk-button-info:not(:disabled):not(.disabled):active:focus, .pk-button-info:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-info.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-warning {
|
||||
color: #212529;
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-warning:hover {
|
||||
color: #212529;
|
||||
background-color: #e0a800;
|
||||
border-color: #d39e00;
|
||||
}
|
||||
|
||||
.pk-button-warning:focus, .pk-button-warning.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-warning.disabled, .pk-button-warning:disabled {
|
||||
color: #212529;
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-warning:not(:disabled):not(.disabled):active, .pk-button-warning:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-warning.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #d39e00;
|
||||
border-color: #c69500;
|
||||
}
|
||||
|
||||
.pk-button-warning:not(:disabled):not(.disabled):active:focus, .pk-button-warning:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-warning.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-danger {
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-danger:hover {
|
||||
color: #fff;
|
||||
background-color: #c82333;
|
||||
border-color: #bd2130;
|
||||
}
|
||||
|
||||
.pk-button-danger:focus, .pk-button-danger.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-danger.disabled, .pk-button-danger:disabled {
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-danger:not(:disabled):not(.disabled):active, .pk-button-danger:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-danger.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #bd2130;
|
||||
border-color: #b21f2d;
|
||||
}
|
||||
|
||||
.pk-button-danger:not(:disabled):not(.disabled):active:focus, .pk-button-danger:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-danger.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-light {
|
||||
color: #212529;
|
||||
background-color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-light:hover {
|
||||
color: #212529;
|
||||
background-color: #e2e6ea;
|
||||
border-color: #dae0e5;
|
||||
}
|
||||
|
||||
.pk-button-light:focus, .pk-button-light.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-light.disabled, .pk-button-light:disabled {
|
||||
color: #212529;
|
||||
background-color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-light:not(:disabled):not(.disabled):active, .pk-button-light:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-light.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #dae0e5;
|
||||
border-color: #d3d9df;
|
||||
}
|
||||
|
||||
.pk-button-light:not(:disabled):not(.disabled):active:focus, .pk-button-light:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-light.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-dark {
|
||||
color: #fff;
|
||||
background-color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-dark:hover {
|
||||
color: #fff;
|
||||
background-color: #23272b;
|
||||
border-color: #1d2124;
|
||||
}
|
||||
|
||||
.pk-button-dark:focus, .pk-button-dark.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-dark.disabled, .pk-button-dark:disabled {
|
||||
color: #fff;
|
||||
background-color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-dark:not(:disabled):not(.disabled):active, .pk-button-dark:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-dark.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #1d2124;
|
||||
border-color: #171a1d;
|
||||
}
|
||||
|
||||
.pk-button-dark:not(:disabled):not(.disabled):active:focus, .pk-button-dark:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-dark.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-primary {
|
||||
color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-outline-primary:hover {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-outline-primary:focus, .pk-button-outline-primary.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-primary.disabled, .pk-button-outline-primary:disabled {
|
||||
color: #007bff;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-primary:not(:disabled):not(.disabled):active, .pk-button-outline-primary:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-primary.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-button-outline-primary:not(:disabled):not(.disabled):active:focus, .pk-button-outline-primary:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-primary.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary {
|
||||
color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary:hover {
|
||||
color: #212529;
|
||||
background-color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary:focus, .pk-button-outline-secondary.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(160, 160, 160, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary.disabled, .pk-button-outline-secondary:disabled {
|
||||
color: #A0A0A0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary:not(:disabled):not(.disabled):active, .pk-button-outline-secondary:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-secondary.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #A0A0A0;
|
||||
border-color: #A0A0A0;
|
||||
}
|
||||
|
||||
.pk-button-outline-secondary:not(:disabled):not(.disabled):active:focus, .pk-button-outline-secondary:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-secondary.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(160, 160, 160, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-success {
|
||||
color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-outline-success:hover {
|
||||
color: #fff;
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-outline-success:focus, .pk-button-outline-success.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-success.disabled, .pk-button-outline-success:disabled {
|
||||
color: #28a745;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-success:not(:disabled):not(.disabled):active, .pk-button-outline-success:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-success.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.pk-button-outline-success:not(:disabled):not(.disabled):active:focus, .pk-button-outline-success:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-success.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-info {
|
||||
color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-outline-info:hover {
|
||||
color: #fff;
|
||||
background-color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-outline-info:focus, .pk-button-outline-info.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-info.disabled, .pk-button-outline-info:disabled {
|
||||
color: #17a2b8;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-info:not(:disabled):not(.disabled):active, .pk-button-outline-info:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-info.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #17a2b8;
|
||||
border-color: #17a2b8;
|
||||
}
|
||||
|
||||
.pk-button-outline-info:not(:disabled):not(.disabled):active:focus, .pk-button-outline-info:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-info.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-warning {
|
||||
color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-outline-warning:hover {
|
||||
color: #212529;
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-outline-warning:focus, .pk-button-outline-warning.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-warning.disabled, .pk-button-outline-warning:disabled {
|
||||
color: #ffc107;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-warning:not(:disabled):not(.disabled):active, .pk-button-outline-warning:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-warning.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
}
|
||||
|
||||
.pk-button-outline-warning:not(:disabled):not(.disabled):active:focus, .pk-button-outline-warning:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-warning.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-danger {
|
||||
color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-outline-danger:hover {
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-outline-danger:focus, .pk-button-outline-danger.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-danger.disabled, .pk-button-outline-danger:disabled {
|
||||
color: #dc3545;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-danger:not(:disabled):not(.disabled):active, .pk-button-outline-danger:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-danger.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.pk-button-outline-danger:not(:disabled):not(.disabled):active:focus, .pk-button-outline-danger:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-danger.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-light {
|
||||
color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-outline-light:hover {
|
||||
color: #212529;
|
||||
background-color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-outline-light:focus, .pk-button-outline-light.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-light.disabled, .pk-button-outline-light:disabled {
|
||||
color: #f8f9fa;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-light:not(:disabled):not(.disabled):active, .pk-button-outline-light:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-light.dropdown-toggle {
|
||||
color: #212529;
|
||||
background-color: #f8f9fa;
|
||||
border-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-button-outline-light:not(:disabled):not(.disabled):active:focus, .pk-button-outline-light:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-light.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-dark {
|
||||
color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-outline-dark:hover {
|
||||
color: #fff;
|
||||
background-color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-outline-dark:focus, .pk-button-outline-dark.focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-outline-dark.disabled, .pk-button-outline-dark:disabled {
|
||||
color: #343a40;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pk-button-outline-dark:not(:disabled):not(.disabled):active, .pk-button-outline-dark:not(:disabled):not(.disabled).active,
|
||||
.show > .pk-button-outline-dark.dropdown-toggle {
|
||||
color: #fff;
|
||||
background-color: #343a40;
|
||||
border-color: #343a40;
|
||||
}
|
||||
|
||||
.pk-button-outline-dark:not(:disabled):not(.disabled):active:focus, .pk-button-outline-dark:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .pk-button-outline-dark.dropdown-toggle:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
|
||||
}
|
||||
|
||||
.pk-button-lg {
|
||||
padding: 0.5rem 1rem;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 0.3rem;
|
||||
}
|
||||
|
||||
.pk-button-sm {
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 0.2rem;
|
||||
}
|
||||
|
||||
.pk-button-block {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.pk-button-block + .pk-button-block {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
/* Tabs */
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
padding-left: 0;
|
||||
margin-bottom: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.pk-fade {
|
||||
transition: opacity 0.15s linear;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pk-fade {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
.pk-nav-link {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.pk-nav-link:hover, .pk-nav-link:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.pk-nav-tabs .pk-nav-item + .pk-nav-item .pk-nav-link {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.pk-nav-tabs .pk-nav-link {
|
||||
border: 1px solid transparent;
|
||||
border-color: #dee2e6;
|
||||
color: #adb5bd;
|
||||
border-top-left-radius: 0.25rem;
|
||||
border-top-right-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.pk-nav-tabs .pk-nav-link.pk-active {
|
||||
color: #000;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.pk-nav-tabs .pk-nav-link:hover, .pk-nav-tabs .pk-nav-link:focus {
|
||||
color: #212529;
|
||||
}
|
||||
|
||||
.pk-tab-content > .pk-tab-pane {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pk-tab-content > .pk-active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav-link {
|
||||
padding: 1rem 1.5rem;
|
||||
line-height: 1;
|
||||
font-size: 1rem;
|
||||
text-decoration: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-tab-pane > *:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav-tabs .pk-nav-link.pk-active {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav-pills .pk-nav-link {
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.75rem 1rem;
|
||||
line-height: 1;
|
||||
color: #adb5bd;
|
||||
}
|
||||
|
||||
.pk-tabs .pk-nav-pills .pk-nav-link.pk-active {
|
||||
color: #000;
|
||||
background-color: #e9ecef;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.pk-tabs .pk-nav-item + .pk-nav-item .pk-nav-link {
|
||||
margin-top: 0;
|
||||
}
|
||||
.pk-tabs .pk-nav-link:not(.pk-active) {
|
||||
border-color: transparent;
|
||||
}
|
||||
.pk-tabs .pk-nav-tabs .pk-nav-link.pk-active {
|
||||
background-color: transparent;
|
||||
}
|
||||
.pk-tabs-horizontal .pk-nav {
|
||||
flex-direction: row;
|
||||
}
|
||||
.pk-tabs-horizontal .pk-nav-tabs {
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
.pk-tabs-horizontal .pk-nav-item {
|
||||
transform: translateY(1px);
|
||||
}
|
||||
.pk-tabs-horizontal .pk-nav-link.pk-active {
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-container {
|
||||
display: flex;
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-navigation {
|
||||
flex: 0 0 30%;
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-navigation .pk-nav {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-navigation .pk-nav-item {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
transform: translateX(1px);
|
||||
}
|
||||
.pk-tabs-vertical .pk-tabs-content {
|
||||
margin-left: 5%;
|
||||
flex: 0 0 65%;
|
||||
}
|
||||
.pk-tabs-vertical .pk-nav-tabs {
|
||||
border-right: 1px solid #dee2e6;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
.pk-tabs-vertical .pk-nav-tabs .pk-nav-link {
|
||||
border-radius: 0.25rem 0 0 0.25rem;
|
||||
}
|
||||
.pk-tabs-vertical .pk-nav-tabs .pk-nav-link.pk-active {
|
||||
border-right-color: #fff;
|
||||
}
|
||||
.pk-tabs-vertical .pk-nav-pills {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
/* Collapsibles */
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
word-wrap: break-word;
|
||||
margin-bottom: 0;
|
||||
background-clip: border-box;
|
||||
}
|
||||
|
||||
.pk-card + .pk-card {
|
||||
border-top: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.pk-collapsing {
|
||||
position: relative;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pk-card-body {
|
||||
flex: 1 1 auto;
|
||||
padding: 0.75rem 0;
|
||||
}
|
||||
|
||||
.pk-card-header {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.pk-card-header .pk-card-title {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.pk-card-header a {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0.75rem 0;
|
||||
border: none;
|
||||
color: #212529;
|
||||
transition: 0.3s;
|
||||
text-decoration: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.pk-card-header a:hover {
|
||||
color: #adb5bd;
|
||||
}
|
||||
|
||||
.pk-card-header a:after {
|
||||
font-family: 'powerkit-icons';
|
||||
content: "\e914";
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.pk-card.expanded .pk-card-header a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.pk-card.expanded .pk-card-header a:after {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
/* Progress */
|
||||
/*--------------------------------------------------------------*/
|
||||
@-webkit-keyframes progress-bar-stripes {
|
||||
from {
|
||||
background-position: 1rem 0;
|
||||
}
|
||||
to {
|
||||
background-position: 0 0;
|
||||
}
|
||||
}
|
||||
@keyframes progress-bar-stripes {
|
||||
from {
|
||||
background-position: 1rem 0;
|
||||
}
|
||||
to {
|
||||
background-position: 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
.pk-progress {
|
||||
display: flex;
|
||||
height: 1rem;
|
||||
overflow: hidden;
|
||||
font-size: 0.75rem;
|
||||
background-color: #e9ecef;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.pk-progress-bar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
transition: width 0.6s ease;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pk-progress-bar {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
.pk-progress-bar.pk-bg-primary {
|
||||
background-color: #007bff;
|
||||
}
|
||||
|
||||
.pk-progress-bar-striped {
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-size: 1rem 1rem;
|
||||
}
|
||||
|
||||
.pk-progress-bar-animated {
|
||||
-webkit-animation: progress-bar-stripes 1s linear infinite;
|
||||
animation: progress-bar-stripes 1s linear infinite;
|
||||
}
|
||||
|
||||
/* Separators */
|
||||
/*--------------------------------------------------------------*/
|
||||
.pk-separator {
|
||||
border-bottom-color: #ddd;
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Basic Shortcodes
|
||||
*/
|
||||
( function( $ ) {
|
||||
|
||||
$( document ).ready( function() {
|
||||
|
||||
/* Alerts */
|
||||
$( document ).on( 'click', '.pk-alert .pk-close', function() {
|
||||
$( this ).closest( '.pk-alert' ).remove();
|
||||
} );
|
||||
|
||||
/* Tabs */
|
||||
$( '.pk-tab-pane' ).removeClass( 'pk-fade' );
|
||||
|
||||
$( document ).on( 'click', '.pk-tabs .pk-nav-item .pk-nav-link', function() {
|
||||
// Nav.
|
||||
$( this ).parent().siblings().find( '.pk-active' ).removeClass( 'pk-active' );
|
||||
$( this ).addClass( 'pk-active' );
|
||||
|
||||
// Pane.
|
||||
$( this ).closest( '.pk-tabs' ).find( '.pk-tab-pane' ).removeClass( 'pk-show pk-active' );
|
||||
$( this ).closest( '.pk-tabs' ).find( '.pk-tab-content' ).find( $( this ).attr( 'href' ) ).addClass( 'pk-show pk-active' );
|
||||
|
||||
return false;
|
||||
} );
|
||||
|
||||
/* Collapsibles */
|
||||
$( document ).on( 'click', '.pk-card a[data-toggle="collapse"]', function() {
|
||||
|
||||
if ( $( this ).closest( '.pk-collapsibles' ).length > 0 ) {
|
||||
$( this ).closest( '.pk-card' ).siblings().removeClass( 'expanded' );
|
||||
$( this ).closest( '.pk-card' ).siblings().find( '.pk-collapse' ).slideUp();
|
||||
}
|
||||
|
||||
$( this ).closest( '.pk-card' ).toggleClass( 'expanded' ).find( $( this ).attr( 'href' ) ).slideToggle();
|
||||
|
||||
return false;
|
||||
} );
|
||||
} );
|
||||
} )( jQuery );
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* Shortcode Alerts config
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Templates
|
||||
*/
|
||||
|
||||
/**
|
||||
* Alerts
|
||||
*/
|
||||
powerkit_basic_shortcodes_register( array(
|
||||
'name' => 'alerts',
|
||||
'title' => esc_html__( 'Alerts', 'powerkit' ),
|
||||
'priority' => 30,
|
||||
'base' => 'powerkit_alert',
|
||||
'autoregister' => true,
|
||||
'fields' => array(
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Options', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'radio',
|
||||
'name' => 'type',
|
||||
'label' => esc_html__( 'Type', 'powerkit' ),
|
||||
'style' => 'vertical',
|
||||
'default' => 'info',
|
||||
'options' => array(
|
||||
'danger' => esc_html__( 'Danger', 'powerkit' ),
|
||||
'info' => esc_html__( 'Info', 'powerkit' ),
|
||||
'link' => esc_html__( 'Link', 'powerkit' ),
|
||||
'success' => esc_html__( 'Success', 'powerkit' ),
|
||||
'warning' => esc_html__( 'Warning', 'powerkit' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'dismissible',
|
||||
'label' => esc_html__( 'Display close button', 'powerkit' ),
|
||||
'default' => false,
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'multiline',
|
||||
'label' => esc_html__( 'Multiline', 'powerkit' ),
|
||||
'default' => false,
|
||||
),
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Content', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'content',
|
||||
'name' => 'content',
|
||||
'label' => esc_html__( 'Content', 'powerkit' ),
|
||||
'default' => '',
|
||||
'attrs' => array(
|
||||
'class' => 'widefat',
|
||||
'rows' => 6,
|
||||
),
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
|
||||
/**
|
||||
* Alert Shortcode
|
||||
*
|
||||
* @param array $output Shortcode HTML.
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode tag content.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_alert( $output, $atts, $content ) {
|
||||
$dm_class = null;
|
||||
$dm_button = null;
|
||||
|
||||
if ( 'true' === $atts['dismissible'] ) {
|
||||
$dm_class .= ' pk-alert-dismissible';
|
||||
$dm_button .= '
|
||||
<button type="button" class="pk-close" data-dismiss="alert" aria-label="' . esc_attr__( 'Close', 'powerkit' ) . '">
|
||||
<i class="pk-icon-x"></i>
|
||||
</button>';
|
||||
}
|
||||
|
||||
if ( 'true' === $atts['multiline'] ) {
|
||||
$dm_class .= ' pk-alert-multiline';
|
||||
}
|
||||
|
||||
$output = sprintf(
|
||||
'<div class="pk-alert pk-alert-%s%s" role="alert" >%s%s</div>',
|
||||
$atts['type'],
|
||||
$dm_class,
|
||||
$dm_button,
|
||||
$content
|
||||
);
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'powerkit_alert_shortcode', 'powerkit_basic_shortcodes_alert', 10, 3 );
|
||||
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* Shortcode Buttons config
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Templates
|
||||
*/
|
||||
|
||||
/**
|
||||
* Buttons
|
||||
*/
|
||||
powerkit_basic_shortcodes_register( array(
|
||||
'name' => 'buttons',
|
||||
'title' => esc_html__( 'Buttons', 'powerkit' ),
|
||||
'priority' => 20,
|
||||
'base' => 'powerkit_button',
|
||||
'autoregister' => true,
|
||||
'fields' => array(
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Style Options', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'radio',
|
||||
'name' => 'size',
|
||||
'label' => esc_html__( 'Size', 'powerkit' ),
|
||||
'style' => 'horizontal',
|
||||
'default' => 'md',
|
||||
'options' => array(
|
||||
'sm' => esc_html__( 'Small', 'powerkit' ),
|
||||
'md' => esc_html__( 'Default', 'powerkit' ),
|
||||
'lg' => esc_html__( 'Large', 'powerkit' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'radio',
|
||||
'name' => 'style',
|
||||
'label' => esc_html__( 'Style', 'powerkit' ),
|
||||
'style' => 'vertical',
|
||||
'default' => 'primary',
|
||||
'options' => array(
|
||||
'primary' => esc_html__( 'Primary', 'powerkit' ),
|
||||
'secondary' => esc_html__( 'Secondary', 'powerkit' ),
|
||||
'success' => esc_html__( 'Success', 'powerkit' ),
|
||||
'info' => esc_html__( 'Info', 'powerkit' ),
|
||||
'warning' => esc_html__( 'Warning', 'powerkit' ),
|
||||
'danger' => esc_html__( 'Danger', 'powerkit' ),
|
||||
'link' => esc_html__( 'Link', 'powerkit' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'block',
|
||||
'label' => esc_html__( 'Block', 'powerkit' ),
|
||||
'default' => false,
|
||||
),
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Link Options', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'input',
|
||||
'name' => 'url',
|
||||
'label' => esc_html__( 'URL', 'powerkit' ),
|
||||
'default' => 'http://',
|
||||
),
|
||||
array(
|
||||
'type' => 'radio',
|
||||
'name' => 'target',
|
||||
'label' => esc_html__( 'Link target', 'powerkit' ),
|
||||
'style' => 'vertical',
|
||||
'default' => '_self',
|
||||
'options' => array(
|
||||
'_self' => esc_html__( 'Open in same window', 'powerkit' ),
|
||||
'_blank' => esc_html__( 'Open in new window/tab', 'powerkit' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'content',
|
||||
'name' => 'title',
|
||||
'label' => esc_html__( 'Title', 'powerkit' ),
|
||||
'default' => 'Button',
|
||||
'attrs' => array(
|
||||
'class' => 'widefat',
|
||||
'rows' => 6,
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'nofollow',
|
||||
'label' => esc_html__( 'Apply "nofollow" attribute', 'powerkit' ),
|
||||
'default' => false,
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
|
||||
/**
|
||||
* Button Shortcode
|
||||
*
|
||||
* @param array $output Shortcode HTML.
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode tag content.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_button( $output, $atts, $content ) {
|
||||
$nofollow = ( 'true' === $atts['nofollow'] ) ? 'rel="nofollow"' : '';
|
||||
$block = ( 'true' === $atts['block'] ) ? ' pk-button-block' : '';
|
||||
|
||||
if ( isset( $atts['title'] ) && $atts['title'] ) {
|
||||
$title = $atts['title'];
|
||||
}
|
||||
|
||||
if ( $content ) {
|
||||
$title = $content;
|
||||
}
|
||||
|
||||
$output = sprintf(
|
||||
'<a class="pk-button pk-button-%s pk-button-%s%s pk-font-primary" href="%s" target="%s" %s>
|
||||
%s
|
||||
</a>',
|
||||
$atts['size'],
|
||||
$atts['style'],
|
||||
$block,
|
||||
$atts['url'],
|
||||
$atts['target'],
|
||||
$nofollow,
|
||||
$title
|
||||
);
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'powerkit_button_shortcode', 'powerkit_basic_shortcodes_button', 10, 3 );
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* Shortcode Collapsibles config
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Templates
|
||||
*/
|
||||
|
||||
/**
|
||||
* Collapsibles
|
||||
*/
|
||||
powerkit_basic_shortcodes_register( array(
|
||||
'name' => 'collapsibles',
|
||||
'title' => esc_html__( 'Collapsibles', 'powerkit' ),
|
||||
'priority' => 50,
|
||||
'base' => 'powerkit_collapsibles',
|
||||
'autoregister' => true,
|
||||
'fields' => array(
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Content', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'repeater',
|
||||
'base' => 'powerkit_collapsible',
|
||||
'autoregister' => true,
|
||||
'label' => esc_html__( 'Collapsibles', 'powerkit' ),
|
||||
'fields' => array(
|
||||
array(
|
||||
'type' => 'input',
|
||||
'name' => 'title',
|
||||
'label' => esc_html__( 'Title', 'powerkit' ),
|
||||
'default' => '',
|
||||
'attrs' => array(
|
||||
'class' => 'widefat',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'content',
|
||||
'name' => 'content',
|
||||
'label' => esc_html__( 'Content', 'powerkit' ),
|
||||
'default' => '',
|
||||
'attrs' => array(
|
||||
'class' => 'widefat',
|
||||
'rows' => 6,
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'opened',
|
||||
'label' => esc_html__( 'Opened', 'powerkit' ),
|
||||
'default' => false,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
|
||||
/**
|
||||
* Collapsibles Shortcode
|
||||
*
|
||||
* @param array $output Shortcode HTML.
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode tag content.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_collapsibles( $output, $atts, $content ) {
|
||||
|
||||
$collapse_id = uniqid();
|
||||
|
||||
$output = sprintf(
|
||||
'<div id="collapsibles-%1$s" class="pk-collapsibles" role="tablist" aria-multiselectable="true">%2$s</div>
|
||||
',
|
||||
$collapse_id,
|
||||
str_replace( 'data-parent="#"', 'data-parent="#pk-collapsibles-' . $collapse_id . '"', $content )
|
||||
);
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'powerkit_collapsibles_shortcode', 'powerkit_basic_shortcodes_collapsibles', 10, 3 );
|
||||
|
||||
|
||||
/**
|
||||
* Collapsible Shortcode
|
||||
*
|
||||
* @param array $output Shortcode HTML.
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode tag content.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_collapsible( $output, $atts, $content ) {
|
||||
|
||||
$item_id = uniqid();
|
||||
$output = sprintf(
|
||||
'<div class="pk-collapsible pk-card %4$s">
|
||||
<div class="pk-card-header" role="tab" id="card-%1$s">
|
||||
<h6 class="pk-card-title pk-title">
|
||||
<a data-toggle="collapse" class="pk-font-heading" href="#pk-collapse-%1$s" data-parent="#" aria-controls="collapse-%1$s">
|
||||
%2$s
|
||||
</a>
|
||||
</h6>
|
||||
</div>
|
||||
|
||||
<div id="pk-collapse-%1$s" class="pk-collapse" style="%3$s" role="tabpanel" aria-labelledby="card-%1$s">
|
||||
<div class="pk-card-body">
|
||||
%5$s
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
',
|
||||
$item_id,
|
||||
$atts['title'],
|
||||
( 'true' === $atts['opened'] ) ? 'display:block;' : 'display:none;',
|
||||
( 'true' === $atts['opened'] ) ? 'expanded' : '',
|
||||
do_shortcode( $content )
|
||||
);
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'powerkit_collapsible_shortcode', 'powerkit_basic_shortcodes_collapsible', 10, 3 );
|
||||
@@ -0,0 +1,201 @@
|
||||
<?php
|
||||
/**
|
||||
* Shortcode Grid config
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Templates
|
||||
*/
|
||||
|
||||
/**
|
||||
* Init module
|
||||
*/
|
||||
class Powerkit_Basic_Grid {
|
||||
|
||||
/**
|
||||
* Initialize.
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
if ( class_exists( 'Gridable' ) ) {
|
||||
add_filter( 'gridable_row_class', array( $this, 'gridable_row_class' ) );
|
||||
add_filter( 'gridable_column_class', array( $this, 'gridable_column_class' ), 10, 4 );
|
||||
add_filter( 'gridable_load_public_style', '__return_false' );
|
||||
|
||||
} else {
|
||||
|
||||
add_shortcode( 'powerkit_row', array( $this, 'add_row_shortcode' ) );
|
||||
add_shortcode( 'powerkit_col', array( $this, 'add_column_shortcode' ) );
|
||||
add_shortcode( 'row', array( $this, 'add_row_shortcode' ) );
|
||||
add_shortcode( 'col', array( $this, 'add_column_shortcode' ) );
|
||||
add_filter( 'the_content', array( $this, 'parse_content_for_nested_rows' ), 9 );
|
||||
add_filter( 'powerkit_the_column_content', array( $this, 'fix_lost_p_tags' ), 10, 2 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the [powerkit-row]
|
||||
*
|
||||
* @param array $atts The atts.
|
||||
* @param string $content The content.
|
||||
*/
|
||||
public function add_row_shortcode( $atts, $content ) {
|
||||
ob_start();
|
||||
?>
|
||||
<div class="pk-row">
|
||||
<?php
|
||||
$row_content = apply_filters( 'powerkit_the_row_content', $content, $atts );
|
||||
|
||||
if ( apply_filters( 'powerkit_render_shortcodes_in_row', true, $content, $atts ) ) {
|
||||
echo do_shortcode( $row_content );
|
||||
} else {
|
||||
echo $row_content; // XSS.
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the [powerkit-col]
|
||||
*
|
||||
* @param array $atts The atts.
|
||||
* @param string $content The content.
|
||||
*/
|
||||
public function add_column_shortcode( $atts, $content ) {
|
||||
$size = 1;
|
||||
if ( ! empty( $atts['size'] ) ) {
|
||||
$size = (int) $atts['size'];
|
||||
}
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div class="pk-col-md-<?php echo esc_attr( $size ); ?>">
|
||||
<?php
|
||||
$column_content = apply_filters( 'powerkit_the_column_content', $content, $atts );
|
||||
|
||||
if ( apply_filters( 'powerkit_render_shortcodes_in_column', true, $content, $atts ) ) {
|
||||
echo do_shortcode( $column_content );
|
||||
} else {
|
||||
echo $column_content; // XSS.
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function strips unclosed p tags at a beggining and at the end of a row
|
||||
*
|
||||
* @param string $content The content.
|
||||
* @param array $atts The atts.
|
||||
*/
|
||||
public function fix_lost_p_tags( $content, $atts ) {
|
||||
if ( is_admin() ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
$first_4_chars = substr( $content, 0, 4 );
|
||||
|
||||
$last_3_chars = substr( $content, -3, 4 );
|
||||
|
||||
if ( '</p>' === $first_4_chars ) {
|
||||
$content = substr( $content, 5 );
|
||||
}
|
||||
|
||||
if ( '<p>' === $last_3_chars ) {
|
||||
$content = substr( $content, 0, -4 );
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to allow one level of nested rows
|
||||
*
|
||||
* @param string $content The content.
|
||||
* @param bool $rec The rec.
|
||||
*/
|
||||
public function parse_content_for_nested_rows( $content, $rec = false ) {
|
||||
$rows_matches = array();
|
||||
|
||||
preg_match_all( '#' . get_shortcode_regex( array( 'powerkit-row' ) ) . '#ims', $content, $rows_matches );
|
||||
|
||||
/**
|
||||
* Basically in the first group of matches are the plain row texts
|
||||
* If a row contains another row, we should render it before.
|
||||
*/
|
||||
if ( ! empty( $rows_matches[0] ) ) {
|
||||
|
||||
// Iterate through each row and check if anyone has a nested row.
|
||||
foreach ( $rows_matches[0] as $key => $match ) {
|
||||
|
||||
$row_pos = strpos( $rows_matches[0][ $key ], '[powerkit-row cols_nr="', 5 );
|
||||
|
||||
// If there is another row inside render it first.
|
||||
if ( false !== $row_pos ) {
|
||||
// Make a clone of the original row.
|
||||
$temp_row = $match;
|
||||
// If this row has an inner row, let's render it and replace it in the clone row.
|
||||
preg_match( '#' . get_shortcode_regex( array( 'powerkit-row' ) ) . '#', $match, $smatch );
|
||||
if ( substr_count( $smatch[0], '[powerkit-row ' ) > 1 ) {
|
||||
$inner_rows = array();
|
||||
|
||||
// Right now the row form is [powerkit-row] content [powerkit-row]content[/powerkit-row]
|
||||
// if we render the available rows we will have a nested-free row.
|
||||
$remove_starting_row = '~\[' . $smatch[1] . $smatch[2] . $smatch[3] . '\]~';
|
||||
|
||||
$temp_content = preg_replace( $remove_starting_row, '', $smatch[0], 1 );
|
||||
|
||||
preg_match_all( '#' . get_shortcode_regex( array( 'powerkit-row' ) ) . '#ms', $temp_content, $inner_rows );
|
||||
|
||||
// There may be more than one inner row, catch'em all.
|
||||
foreach ( $inner_rows[0] as $inner_row ) {
|
||||
$temp_row = str_replace( $inner_row, do_shortcode( $inner_row ), $temp_row );
|
||||
}
|
||||
}
|
||||
// Now we have a [powerkit-row] content <div class="pk-row"></div>
|
||||
// the closing [/powerkit-row] is definetly somewhere after.
|
||||
$content = str_replace( $match, $temp_row, $content );
|
||||
} else {
|
||||
if ( ! $rec ) {
|
||||
$content = $this->parse_content_for_nested_rows( $content, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* -------------------------------------------------------------------------
|
||||
* [ Support Gridable ]
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Row Class
|
||||
*/
|
||||
public function gridable_row_class() {
|
||||
return array( 'pk-row' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Column Class
|
||||
*
|
||||
* @param array $classes Available classes.
|
||||
* @param int $size Column size.
|
||||
* @param array $atts Attributes.
|
||||
* @param string $content Content.
|
||||
*/
|
||||
public function gridable_column_class( $classes, $size, $atts, $content ) {
|
||||
|
||||
$classes = array( 'pk-col-md-' . $size );
|
||||
|
||||
return $classes;
|
||||
}
|
||||
}
|
||||
|
||||
new Powerkit_Basic_Grid();
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* Shortcode Progress Bars config
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Templates
|
||||
*/
|
||||
|
||||
/**
|
||||
* Progress Bars
|
||||
*/
|
||||
powerkit_basic_shortcodes_register( array(
|
||||
'name' => 'progressbars',
|
||||
'title' => esc_html__( 'Progress Bars', 'powerkit' ),
|
||||
'priority' => 60,
|
||||
'base' => 'powerkit_progressbar',
|
||||
'autoregister' => true,
|
||||
'fields' => array(
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Options', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'input',
|
||||
'name' => 'value',
|
||||
'label' => esc_html__( 'Value', 'powerkit' ),
|
||||
'default' => '25',
|
||||
'suffix' => ' %',
|
||||
'desc' => '(0-100)',
|
||||
),
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Style', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'input',
|
||||
'name' => 'height',
|
||||
'label' => esc_html__( 'Height (thickness)', 'powerkit' ),
|
||||
'default' => '20',
|
||||
'suffix' => ' px',
|
||||
),
|
||||
array(
|
||||
'type' => 'radio',
|
||||
'name' => 'color',
|
||||
'label' => esc_html__( 'Color', 'powerkit' ),
|
||||
'style' => 'vertical',
|
||||
'default' => 'primary',
|
||||
'options' => array(
|
||||
'primary' => esc_html__( 'Primary', 'powerkit' ),
|
||||
'secondary' => esc_html__( 'Secondary', 'powerkit' ),
|
||||
'success' => esc_html__( 'Success', 'powerkit' ),
|
||||
'info' => esc_html__( 'Info', 'powerkit' ),
|
||||
'warning' => esc_html__( 'Warning', 'powerkit' ),
|
||||
'danger' => esc_html__( 'Danger', 'powerkit' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'display_value',
|
||||
'label' => esc_html__( 'Display value', 'powerkit' ),
|
||||
'default' => false,
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'striped',
|
||||
'label' => esc_html__( 'Striped', 'powerkit' ),
|
||||
'default' => false,
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'animated',
|
||||
'label' => esc_html__( 'Animated', 'powerkit' ),
|
||||
'default' => false,
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
|
||||
/**
|
||||
* Progress Bar Shortcode
|
||||
*
|
||||
* @param array $output Shortcode HTML.
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode tag content.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_progressbar( $output, $atts, $content ) {
|
||||
|
||||
// Value.
|
||||
$atts['value'] = $atts['value'] > 100 ? 100 : $atts['value'];
|
||||
|
||||
// Display value.
|
||||
$display_value = ( 'true' === $atts['display_value'] ) ? $atts['value'] . '%' : '';
|
||||
|
||||
// Striped and animated.
|
||||
$class = 'pk-progress-bar';
|
||||
$class .= ( 'true' === $atts['striped'] ) ? ' pk-progress-bar-striped' : '';
|
||||
$class .= ( 'true' === $atts['animated'] ) ? ' pk-progress-bar-animated' : '';
|
||||
|
||||
// Color.
|
||||
$class .= sprintf( ' pk-bg-%s', $atts['color'] );
|
||||
|
||||
$output = sprintf(
|
||||
'<div class="pk-progress" style="height: %2$spx;">
|
||||
<div class="%s" role="progressbar" style="width: %3$s%%;" aria-valuenow="%3$s" aria-valuemin="0" aria-valuemax="100">%4$s</div>
|
||||
</div>',
|
||||
$class,
|
||||
$atts['height'],
|
||||
$atts['value'],
|
||||
$display_value
|
||||
);
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'powerkit_progressbar_shortcode', 'powerkit_basic_shortcodes_progressbar', 10, 3 );
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Shortcode Separators config
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Templates
|
||||
*/
|
||||
|
||||
/**
|
||||
* Separators
|
||||
*/
|
||||
powerkit_basic_shortcodes_register( array(
|
||||
'name' => 'separators',
|
||||
'title' => esc_html__( 'Separators', 'powerkit' ),
|
||||
'priority' => 10,
|
||||
'base' => 'powerkit_separator',
|
||||
'autoregister' => true,
|
||||
'fields' => array(
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Options', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'radio',
|
||||
'name' => 'style',
|
||||
'label' => esc_html__( 'Style', 'powerkit' ),
|
||||
'style' => 'vertical',
|
||||
'default' => 'solid',
|
||||
'options' => array(
|
||||
'solid' => esc_html__( 'Solid', 'powerkit' ),
|
||||
'double' => esc_html__( 'Double', 'powerkit' ),
|
||||
'dotted' => esc_html__( 'Dotted', 'powerkit' ),
|
||||
'dashed' => esc_html__( 'Dashed', 'powerkit' ),
|
||||
'blank' => esc_html__( 'Blank (empty space)', 'powerkit' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'input',
|
||||
'name' => 'height',
|
||||
'label' => esc_html__( 'Height', 'powerkit' ),
|
||||
'default' => '',
|
||||
'suffix' => ' px',
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
|
||||
/**
|
||||
* Separator Shortcode
|
||||
*
|
||||
* @param array $output Shortcode HTML.
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode tag content.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_separator( $output, $atts, $content ) {
|
||||
|
||||
if ( 'blank' === $atts['style'] ) {
|
||||
$inl_css = sprintf( 'style="height: %dpx;"', absint( $atts['height'] ) );
|
||||
} else {
|
||||
$inl_css = sprintf( 'style="border-bottom-width: %dpx; border-bottom-style: %s;"', absint( $atts['height'] ), $atts['style'] );
|
||||
}
|
||||
|
||||
$output = sprintf(
|
||||
'<div class="pk-separator" %s>%s</div>',
|
||||
$inl_css,
|
||||
$content
|
||||
);
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'powerkit_separator_shortcode', 'powerkit_basic_shortcodes_separator', 10, 3 );
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* Shortcode Tabs config
|
||||
*
|
||||
* @package Powerkit
|
||||
* @subpackage Templates
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tabs
|
||||
*/
|
||||
powerkit_basic_shortcodes_register( array(
|
||||
'name' => 'tabs',
|
||||
'title' => esc_html__( 'Tabs', 'powerkit' ),
|
||||
'priority' => 40,
|
||||
'base' => 'powerkit_tabs',
|
||||
'autoregister' => true,
|
||||
'fields' => array(
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Options', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'radio',
|
||||
'name' => 'type',
|
||||
'label' => esc_html__( 'Type', 'powerkit' ),
|
||||
'style' => 'horizontal',
|
||||
'default' => 'tabs',
|
||||
'options' => array(
|
||||
'tabs' => esc_html__( 'Tabs', 'powerkit' ),
|
||||
'pills' => esc_html__( 'Pills', 'powerkit' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'radio',
|
||||
'name' => 'nav',
|
||||
'label' => esc_html__( 'Navigation type', 'powerkit' ),
|
||||
'style' => 'horizontal',
|
||||
'default' => 'horizontal',
|
||||
'options' => array(
|
||||
'horizontal' => esc_html__( 'Horizontal', 'powerkit' ),
|
||||
'vertical' => esc_html__( 'Vertical', 'powerkit' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'section',
|
||||
'label' => esc_html__( 'Content', 'powerkit' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'repeater',
|
||||
'base' => 'powerkit_tab',
|
||||
'autoregister' => true,
|
||||
'label' => esc_html__( 'Tabs', 'powerkit' ),
|
||||
'fields' => array(
|
||||
array(
|
||||
'type' => 'input',
|
||||
'name' => 'title',
|
||||
'label' => esc_html__( 'Title', 'powerkit' ),
|
||||
'default' => '',
|
||||
'attrs' => array(
|
||||
'class' => 'widefat',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'content',
|
||||
'name' => 'content',
|
||||
'label' => esc_html__( 'Content', 'powerkit' ),
|
||||
'default' => '',
|
||||
'attrs' => array(
|
||||
'class' => 'widefat',
|
||||
'rows' => 6,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
|
||||
/**
|
||||
* Tabs Wrap Shortcode
|
||||
*
|
||||
* @param array $output Shortcode HTML.
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode tag content.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_tabs( $output, $atts, $content ) {
|
||||
global $powerkit_basic_shortcodes_tabs;
|
||||
if ( ! is_array( $powerkit_basic_shortcodes_tabs ) ) {
|
||||
$powerkit_basic_shortcodes_tabs = array();
|
||||
}
|
||||
|
||||
// Output.
|
||||
$nav_items = '';
|
||||
$pane_items = '';
|
||||
$num = 1;
|
||||
|
||||
foreach ( $powerkit_basic_shortcodes_tabs as $tab ) {
|
||||
$data_toggle = ( 'tabs' === $atts['type'] ) ? 'tab' : 'pill';
|
||||
$item_id = uniqid();
|
||||
$content_id = $data_toggle . '-' . $item_id;
|
||||
|
||||
$nav_items .= sprintf(
|
||||
'<li class="pk-nav-item"><a class="pk-nav-link%s pk-font-heading" data-toggle="%s" href="#%s">%s</a></li>',
|
||||
( 1 === $num ) ? ' pk-active' : '',
|
||||
$data_toggle,
|
||||
$content_id,
|
||||
$tab['title']
|
||||
);
|
||||
|
||||
$pane_items .= sprintf(
|
||||
'<div id="%s" class="pk-tab-pane pk-fade%s" role="tabpanel">%s</div>',
|
||||
$content_id,
|
||||
( 1 === $num ) ? ' pk-show pk-active' : '',
|
||||
$tab['content']
|
||||
);
|
||||
|
||||
$num++;
|
||||
}
|
||||
|
||||
// Reset Tabs.
|
||||
$powerkit_basic_shortcodes_tabs = array();
|
||||
|
||||
// Tabs Output.
|
||||
$output = '';
|
||||
$output .= '<div class="pk-tabs pk-tabs-' . $atts['nav'] . '">';
|
||||
$output .= '<div class="pk-tabs-container">';
|
||||
$output .= '<div class="pk-tabs-navigation"><ul class="pk-nav pk-nav-' . $atts['type'] . '" role="tablist">' . $nav_items . '</ul></div>';
|
||||
$output .= '<div class="pk-tabs-content"><div class="pk-tab-content">' . $pane_items . '</div></div>';
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'powerkit_tabs_shortcode', 'powerkit_basic_shortcodes_tabs', 10, 3 );
|
||||
|
||||
|
||||
/**
|
||||
* Tab Item Shortcode
|
||||
*
|
||||
* @param array $output Shortcode HTML.
|
||||
* @param array $atts User defined attributes in shortcode tag.
|
||||
* @param string $content Shorcode tag content.
|
||||
* @return string Shortcode result HTML.
|
||||
*/
|
||||
function powerkit_basic_shortcodes_tab( $output, $atts, $content ) {
|
||||
global $powerkit_basic_shortcodes_tabs;
|
||||
if ( ! is_array( $powerkit_basic_shortcodes_tabs ) ) {
|
||||
$powerkit_basic_shortcodes_tabs = array();
|
||||
}
|
||||
|
||||
$powerkit_basic_shortcodes_tabs[] = array(
|
||||
'title' => $atts['title'],
|
||||
'content' => $content,
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
add_filter( 'powerkit_tab_shortcode', 'powerkit_basic_shortcodes_tab', 10, 3 );
|
||||
Reference in New Issue
Block a user