Permalink
Browse files

FIX: travis-ci notices

  • Loading branch information...
1 parent 62c6fd6 commit 32549c49b31b1c5fcb1ffc1e4ee7bcf42c1aef5c MakhonkoDenis committed Aug 24, 2016
Showing with 106 additions and 81 deletions.
  1. +1 −0 .jscsrc
  2. +35 −35 modules/cherry-interface-builder/cherry-interface-builder.php
  3. +36 −36 modules/cherry-interface-builder/inc/assets/cherry-interface-builder.js
  4. +2 −0 modules/cherry-interface-builder/inc/views/component-accordion.php
  5. +2 −0 modules/cherry-interface-builder/inc/views/component-repeater.php
  6. +2 −0 modules/cherry-interface-builder/inc/views/component-tab-horizontal.php
  7. +2 −0 modules/cherry-interface-builder/inc/views/component-tab-vertical.php
  8. +2 −0 modules/cherry-interface-builder/inc/views/component-toggle.php
  9. +2 −0 modules/cherry-interface-builder/inc/views/control.php
  10. +2 −0 modules/cherry-interface-builder/inc/views/html.php
  11. +2 −0 modules/cherry-interface-builder/inc/views/section.php
  12. +2 −0 modules/cherry-interface-builder/inc/views/settings-children-title.php
  13. +2 −0 modules/cherry-interface-builder/inc/views/settings.php
  14. +2 −0 modules/cherry-interface-builder/inc/views/tab-children-title.php
  15. +2 −0 modules/cherry-interface-builder/inc/views/toggle-children-title.php
  16. +2 −2 modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.js
  17. +1 −1 modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-radio.js
  18. +1 −1 modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.js
  19. +3 −3 modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.js
  20. +2 −2 modules/cherry-ui-elements/inc/ui-elements/ui-select/ui-select.php
  21. +1 −1 modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.js
View
@@ -17,5 +17,6 @@
"modules/cherry-ui-elements/inc/ui-elements/ui-collection/assets/js/jquery.collection.js",
"modules/cherry-ui-elements/inc/ui-elements/ui-collection/assets/js/ui-collection.js",
"modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/jquery-iconpicker.js",
+ "modules/cherry-interface-builder/inc/assets/cherry-interface-builder.js",
]
}
@@ -1,3 +1,4 @@
+
<?php
/**
* Module Name: Interface Builder
@@ -100,7 +101,7 @@ class Cherry_Interface_Builder {
* @return void
*/
public function __construct( $core, array $args = array() ) {
- $this->args = array_merge_recursive (
+ $this->args = array_merge_recursive(
$args,
$this->args
);
@@ -175,18 +176,18 @@ public function register_html( array $args = array() ) {
*
* @since 1.0.0
* @access protected
- * @param string $type Options new element.
- * @param array $args Type new element.
+ * @param array $args Options new element.
+ * @param string $type Type new element.
* @return void
*/
protected function add_new_element( array $args = array(), $type = 'section' ) {
- if ( ! isset( $args[ 0 ] ) && ! is_array( current( $args ) ) ) {
+ if ( ! isset( $args[0] ) && ! is_array( current( $args ) ) ) {
$this->structure[ $args['id'] ] = $args;
- }else{
+ } else {
foreach ( $args as $key => $value ) {
if ( $type !== 'control' ) {
- $value[ 'type' ] = $type;
+ $value['type'] = $type;
}
$this->structure[ $key ] = $value;
@@ -199,20 +200,19 @@ protected function add_new_element( array $args = array(), $type = 'section' ) {
*
* @since 1.0.0
* @access protected
- * @param string $structure The original structure of the elements.
+ * @param array $structure The original structure of the elements.
* @param string $parent_key The key of the parent element.
* @return array
*/
-
protected function sort_structure( array $structure = array(), $parent_key = null ) {
$new_array = array();
foreach ( $structure as $key => $value ) {
- if(
+ if (
( null === $parent_key && ! isset( $value['parent'] ) )
|| null === $parent_key && ! isset( $structure[ $value['parent'] ] )
|| ( isset( $value['parent'] ) && $value['parent'] === $parent_key )
- ){
+ ) {
if ( ! isset( $value['id'] ) ) {
$value['id'] = $parent_key ? $parent_key . '-' . $key : $key ;
@@ -223,7 +223,7 @@ protected function sort_structure( array $structure = array(), $parent_key = nul
$new_array[ $key ] = $value;
$children = $this->sort_structure( $structure, $key );
- if ( !empty( $children ) ) {
+ if ( ! empty( $children ) ) {
$new_array[ $key ][ 'children' ] = $children;
}
}
@@ -238,7 +238,7 @@ protected function sort_structure( array $structure = array(), $parent_key = nul
* @since 1.0.0
* @access protected
* @param string $type View type.
- * @param string $args Input data.
+ * @param array $args Input data.
* @return string
*/
protected function get_view( $type = 'control', array $args = array() ) {
@@ -249,7 +249,7 @@ protected function get_view( $type = 'control', array $args = array() ) {
if ( empty( $view ) ) {
$path = dirname( __FILE__ ) . '/';
- $path .= ( array_key_exists( $type, $this->args['views'] ) ) ? $this->args['views'][ $type ] : $this->args['views'][ 'control' ] ;
+ $path .= ( array_key_exists( $type, $this->args['views'] ) ) ? $this->args['views'][ $type ] : $this->args['views']['control'] ;
} else {
$path = $view;
}
@@ -268,8 +268,8 @@ protected function get_view( $type = 'control', array $args = array() ) {
*
* @since 1.0.0
* @access public
- * @param array $args The original structure of the elements.
- * @param array $echo input data.
+ * @param array $args The original structure of the elements.
+ * @param bool $echo Input data.
* @return string
*/
public function render( array $args = array(), $echo = true ) {
@@ -295,8 +295,8 @@ public function render( array $args = array(), $echo = true ) {
*
* @since 1.0.0
* @access protected
- * @param array $args input data.
- * @return void
+ * @param array $args Input data.
+ * @return string
*/
protected function build( array $args = array() ) {
$output = '';
@@ -308,12 +308,12 @@ protected function build( array $args = array() ) {
$this->args['views_args']
);
- $value[ 'class' ] = '' ;
- if ( $value[ 'scroll' ] ) {
- $value[ 'class' ] .= 'cherry-scroll';
+ $value['class'] = '' ;
+ if ( $value['scroll'] ) {
+ $value['class'] .= 'cherry-scroll';
}
- if ( $value[ 'master' ] ) {
- $value[ 'class' ] .= $value[ 'master' ];
+ if ( $value['master'] ) {
+ $value['class'] .= $value['master'];
}
$type = array_key_exists( $value['type'], $views ) ? $value['type'] : 'field' ;
@@ -322,41 +322,41 @@ protected function build( array $args = array() ) {
switch ( $type ) {
case 'component-tab-vertical':
case 'component-tab-horizontal':
- if( $has_child ){
+ if ( $has_child ) {
$value['tabs'] = '';
- foreach ( $value['children'] as $key_children => $value_children) {
+ foreach ( $value['children'] as $key_children => $value_children ) {
$value['tabs'] .= $this->get_view( 'tab-children-title', $value_children );
- unset( $value[ 'children' ][ $key_children ][ 'title' ] );
+ unset( $value['children'][ $key_children ]['title'] );
}
}
break;
case 'component-toggle':
case 'component-accordion':
- if( $has_child ){
- foreach ( $value['children'] as $key_children => $value_children) {
- $value[ 'children' ][ $key_children ][ 'title_in_view' ] = $this->get_view( 'toggle-children-title', $value_children );
+ if ( $has_child ) {
+ foreach ( $value['children'] as $key_children => $value_children ) {
+ $value['children'][ $key_children ]['title_in_view'] = $this->get_view( 'toggle-children-title', $value_children );
}
}
break;
case 'settings':
- if ( isset( $value[ 'title' ] ) && $value[ 'title' ] ) {
- $value[ 'title' ] = isset( $value['title_in_view'] ) ? $value['title_in_view'] : $this->get_view( 'settings-children-title', $value ) ;
+ if ( isset( $value['title'] ) && $value['title'] ) {
+ $value['title'] = isset( $value['title_in_view'] ) ? $value['title_in_view'] : $this->get_view( 'settings-children-title', $value );
}
break;
case 'html':
- $value[ 'children' ] = $value[ 'html' ];
+ $value['children'] = $value['html'];
break;
case 'field':
- if( isset( $value[ 'master' ] ) ){
- $value[ 'master' ] = '';
+ if ( isset( $value['master'] ) ) {
+ $value['master'] = '';
}
- $value[ 'children' ] = $this->ui_elements->get_ui_element_instance( $value[ 'type' ], $value )->render();
+ $value['children'] = $this->ui_elements->get_ui_element_instance( $value['type'], $value )->render();
break;
}
@@ -376,7 +376,7 @@ protected function build( array $args = array() ) {
* @since 1.0.0
* @access protected
* @param string $output Output HTML.
- * @param boolean $echo Output type.
+ * @param boolean $echo Output type.
* @return string
*/
protected function output_method( $output = '', $echo = true ) {
@@ -1,13 +1,13 @@
/**
- * Radio
+ * Interface Builder
*/
-;( function( $, CherryJsCore ){
+;( function( $, CherryJsCore ) {
'use strict';
- CherryJsCore.utilites.namespace('interfaceBuilder');
+ CherryJsCore.utilites.namespace( 'interfaceBuilder' );
CherryJsCore.interfaceBuilder = {
- init: function () {
+ init: function() {
this.component.init();
},
component: {
@@ -33,18 +33,18 @@
this.addEvent();
},
- addEvent: function () {
+ addEvent: function() {
$( 'body' )
.on( 'click',
this.tabClass + ' ' + this.buttonClass + ', ' +
this.toggleClass + ' ' + this.buttonClass + ', ' +
this.accordionClass + ' ' + this.buttonClass,
this.componentClick.bind( this )
- )
+ );
},
- componentInit: function ( componentClass ) {
+ componentInit: function( componentClass ) {
var _this = this,
components = $( componentClass ),
componentId = null,
@@ -53,14 +53,13 @@
notShow = '';
components.each( function( index, component ) {
- component = $( component );
- componentId = component.data('compotent-id');
-
+ component = $( component );
+ componentId = component.data( 'compotent-id' );
switch ( componentClass ) {
case _this.toggleClass:
if ( _this.localStorage[ componentId ] && _this.localStorage[ componentId ].length ) {
- notShow = _this.localStorage[ componentId ].join(', ');
+ notShow = _this.localStorage[ componentId ].join( ', ' );
}
$( _this.contentClass, component )
@@ -72,10 +71,10 @@
case _this.tabClass:
case _this.accordionClass:
- if( _this.localStorage[ componentId ] ){
+ if ( _this.localStorage[ componentId ] ) {
contentId = _this.localStorage[ componentId ][ 0 ];
button = $( '[data-content-id="' + contentId + '"]', component );
- }else{
+ } else {
button = $( _this.buttonClass, component ).eq( 0 );
contentId = button.data( 'content-id' );
}
@@ -86,42 +85,42 @@
} );
},
- componentClick: function ( event ) {
- var $_target = $( event.target ),
- $_parent = $_target.closest( this.tabClass + ', ' + this.accordionClass + ', ' + this.toggleClass ),
+ componentClick: function( event ) {
+ var $target = $( event.target ),
+ $parent = $target.closest( this.tabClass + ', ' + this.accordionClass + ', ' + this.toggleClass ),
expr = new RegExp( this.tabClass + '|' + this.accordionClass + '|' + this.toggleClass ),
- componentName = $_parent[0].className.match( expr )[ 0 ].replace( ' ', '.' ),
- contentId = $_target.data( 'content-id' ),
- componentId = $_parent.data( 'compotent-id' ),
- activeFlag = $_target.hasClass( this.buttonActiveClass ),
+ componentName = $parent[0].className.match( expr )[ 0 ].replace( ' ', '.' ),
+ contentId = $target.data( 'content-id' ),
+ componentId = $parent.data( 'compotent-id' ),
+ activeFlag = $target.hasClass( this.buttonActiveClass ),
itemClosed;
switch ( componentName ) {
case this.tabClass:
if ( ! activeFlag ) {
- this.hideElement( $_parent );
- this.showElement( $_target, $_parent, contentId );
+ this.hideElement( $parent );
+ this.showElement( $target, $parent, contentId );
- this.localStorage[ componentId ] = new Array ( contentId );
+ this.localStorage[ componentId ] = new Array( contentId );
this.setState();
}
break;
case this.accordionClass:
- this.hideElement( $_parent );
+ this.hideElement( $parent );
- if( ! activeFlag ){
- this.showElement( $_target, $_parent, contentId );
+ if ( ! activeFlag ) {
+ this.showElement( $target, $parent, contentId );
- this.localStorage[ componentId ] = new Array ( contentId );
- }else{
+ this.localStorage[ componentId ] = new Array( contentId );
+ } else {
this.localStorage[ componentId ] = {};
}
this.setState();
break;
case this.toggleClass:
- $_target
+ $target
.toggleClass( this.buttonActiveClass )
.nextAll( contentId )
.toggleClass( this.showClass );
@@ -131,25 +130,26 @@
if ( -1 !== itemClosed ) {
this.localStorage[ componentId ].splice( itemClosed, 1 );
- }else{
+ } else {
this.localStorage[ componentId ].push( contentId );
}
- }else{
- this.localStorage[ componentId ] = new Array ( contentId );
+ } else {
+ this.localStorage[ componentId ] = new Array( contentId );
}
this.setState();
break;
}
- $_target.blur();
+ $target.blur();
},
showElement: function ( button, holder, contentId ) {
button
.addClass( this.buttonActiveClass );
- holder.data( 'content-id', contentId );
+ holder
+ .data( 'content-id', contentId );
$( contentId, holder )
.addClass( this.showClass );
@@ -165,13 +165,13 @@
.removeClass( this.showClass );
},
- getState: function(){
+ getState: function() {
if ( localStorage ) {
return JSON.parse( localStorage.getItem( 'interface-builder' ) );
}
},
- setState: function(){
+ setState: function() {
if ( localStorage ) {
localStorage.setItem( 'interface-builder', JSON.stringify( this.localStorage ) );
}
@@ -1,5 +1,7 @@
<?php
/**
+ * Accordion template.
+ *
* @package Cherry_Interface_Builder
* @subpackage Views
* @author Cherry Team <cherryframework@gmail.com>
@@ -1,5 +1,7 @@
<?php
/**
+ * Repeater template.
+ *
* @package Cherry_Interface_Builder
* @subpackage Views
* @author Cherry Team <cherryframework@gmail.com>
Oops, something went wrong.

0 comments on commit 32549c4

Please sign in to comment.