From 1708baa922781cbe51114f6d24278dd6b0c65aad Mon Sep 17 00:00:00 2001 From: sarojlakra Date: Mon, 21 Jul 2014 20:51:41 +0530 Subject: [PATCH 1/5] Template shortcode name attribute added in shortcode generator --- classes/class-aq-page-builder.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/class-aq-page-builder.php b/classes/class-aq-page-builder.php index 8b3c378..4db7a77 100644 --- a/classes/class-aq-page-builder.php +++ b/classes/class-aq-page-builder.php @@ -705,6 +705,7 @@ function add_media_display() { From 6c1646c84449a439b42c75f04471e0c262f84c1a Mon Sep 17 00:00:00 2001 From: sarojlakra Date: Tue, 22 Jul 2014 00:05:35 +0530 Subject: [PATCH 2/5] template name added in shortcode(builder panel) --- assets/stylesheets/aqpb.css | 2 +- view/view-builder-page.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/stylesheets/aqpb.css b/assets/stylesheets/aqpb.css index 2b6742c..a2f4d20 100644 --- a/assets/stylesheets/aqpb.css +++ b/assets/stylesheets/aqpb.css @@ -178,7 +178,7 @@ a:hover, a:active, a:focus { color: #d54e21; } float: left; } #template-shortcode input { - width: 120px; + width: 200px; height: 2em; } diff --git a/view/view-builder-page.php b/view/view-builder-page.php index 2b00b68..d270892 100644 --- a/view/view-builder-page.php +++ b/view/view-builder-page.php @@ -234,7 +234,7 @@
- +
From f9eaf60eaa4588332b74040664f96abcf0a0dbbc Mon Sep 17 00:00:00 2001 From: sarojlakra Date: Tue, 22 Jul 2014 00:25:05 +0530 Subject: [PATCH 3/5] Template shortcode name attr --- view/view-builder-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/view-builder-page.php b/view/view-builder-page.php index d270892..f5c04bf 100644 --- a/view/view-builder-page.php +++ b/view/view-builder-page.php @@ -234,7 +234,7 @@
- + "]' onclick="select()"/>
From 7ac25ac5460d00c6fc96a54597c2c54f628df04f Mon Sep 17 00:00:00 2001 From: sarojlakra Date: Tue, 22 Jul 2014 01:29:39 +0530 Subject: [PATCH 4/5] Added Font-Awesome icons. Column block bug, prevent self as child block --- assets/stylesheets/aqpb.css | 16 ++++++++++++---- blocks/aq-alert-block.php | 1 + blocks/aq-clear-block.php | 1 + blocks/aq-column-block.php | 9 ++++++--- blocks/aq-editor-block.php | 1 + blocks/aq-tabs-block.php | 1 + blocks/aq-text-block.php | 1 + blocks/aq-upload-block.php | 1 + blocks/aq-widgets-block.php | 1 + classes/class-aq-block.php | 4 +++- classes/class-aq-page-builder.php | 2 ++ view/view-builder-page.php | 8 ++++---- 12 files changed, 34 insertions(+), 12 deletions(-) diff --git a/assets/stylesheets/aqpb.css b/assets/stylesheets/aqpb.css index a2f4d20..19ac054 100644 --- a/assets/stylesheets/aqpb.css +++ b/assets/stylesheets/aqpb.css @@ -32,7 +32,9 @@ a:hover, a:active, a:focus { color: #d54e21; } #manage-templates .add-new-template-action { float: left; } - + #manage-templates .add-new-template-action i.fa { + margin-right: 5px; + } #manage-templates label { padding-right: 5px; } @@ -157,6 +159,9 @@ a:hover, a:active, a:focus { color: #d54e21; } #page-builder .major-publishing-actions { clear: both; padding: 3px 0 6px; +} +#page-builder .major-publishing-actions i.fa { + margin-right: 5px; } #page-builder .major-publishing-actions .open-label { color: #666; @@ -182,7 +187,6 @@ a:hover, a:active, a:focus { color: #d54e21; } height: 2em; } - #page-builder .publishing-action { text-align: right; float: right; @@ -195,7 +199,6 @@ a:hover, a:active, a:focus { color: #d54e21; } float: left; padding-right: 15px; margin-top: 6px; - } #page-builder .delete-action .submitdelete { display: block; @@ -217,7 +220,6 @@ a:hover, a:active, a:focus { color: #d54e21; } float: left; margin: 4px 0; line-height: 15px; - text-decoration: none; } /*blocks*/ @@ -259,6 +261,12 @@ a:hover, a:active, a:focus { color: #d54e21; } font-weight: bold; display: block; margin-right: 20px; +} +#page-builder .block-title i.fa, +#blocks-archive .block-title i.fa { + margin-right: 10px; + font-size: 16px; + color: #999999; } #page-builder .block-title {overflow: hidden;} .in-block-title { color: #666; } diff --git a/blocks/aq-alert-block.php b/blocks/aq-alert-block.php index d685d49..279146a 100644 --- a/blocks/aq-alert-block.php +++ b/blocks/aq-alert-block.php @@ -9,6 +9,7 @@ function __construct() { $block_options = array( 'name' => __('Alerts', 'aqpb-l10n'), 'size' => 'span6', + 'icon' => 'fa-exclamation-circle', ); //create the block diff --git a/blocks/aq-clear-block.php b/blocks/aq-clear-block.php index 3bc85a8..318ee49 100644 --- a/blocks/aq-clear-block.php +++ b/blocks/aq-clear-block.php @@ -11,6 +11,7 @@ function __construct() { $block_options = array( 'name' => __('Clear', 'aqpb-l10n'), 'size' => 'span12', + 'icon' => 'fa-minus', ); //create the block diff --git a/blocks/aq-column-block.php b/blocks/aq-column-block.php index d44d522..a1b65aa 100644 --- a/blocks/aq-column-block.php +++ b/blocks/aq-column-block.php @@ -8,6 +8,7 @@ function __construct() { $block_options = array( 'name' => __('Column', 'aqpb-l10n'), 'size' => 'span6', + 'icon' => 'fa-columns', ); //create the widget @@ -22,13 +23,14 @@ function before_form($instance) { extract($instance); $title = $title ? ' : '.$title.'' : ''; + $fa_icon = $icon ? '' : ''; $resizable = $resizable ? '' : 'not-resizable'; echo '
  • ', '
    ', '
    ', '
    ', - $name , $title, + $fa_icon, $name , $title, '
    ', '', 'Edit Block', @@ -55,7 +57,8 @@ function form_callback($instance = array()) { extract($instance); $col_order = $order; - + $self = $id_base; + //column block header if(isset($template_id)) { echo '
  • ', @@ -77,7 +80,7 @@ function form_callback($instance = array()) { //get the block object $block = $aq_registered_blocks[$id_base]; - if($parent == $col_order) { + if($parent == $col_order && ($id_base != $self) ) { // prevents self as child block $block->form_callback($child); } } diff --git a/blocks/aq-editor-block.php b/blocks/aq-editor-block.php index 15c5583..3e9ee1e 100644 --- a/blocks/aq-editor-block.php +++ b/blocks/aq-editor-block.php @@ -7,6 +7,7 @@ function __construct() { $block_options = array( 'name' => __('Visual Editor', 'aqpb-l10n'), 'size' => 'span6', + 'icon' => 'fa-file-text', ); //create the block diff --git a/blocks/aq-tabs-block.php b/blocks/aq-tabs-block.php index e93c012..e2e2eb2 100644 --- a/blocks/aq-tabs-block.php +++ b/blocks/aq-tabs-block.php @@ -7,6 +7,7 @@ function __construct() { $block_options = array( 'name' => __('Tabs & Toggles', 'aqpb-l10n'), 'size' => 'span6', + 'icon' => 'fa-list-alt', ); //create the widget diff --git a/blocks/aq-text-block.php b/blocks/aq-text-block.php index ad88c07..2291fd5 100644 --- a/blocks/aq-text-block.php +++ b/blocks/aq-text-block.php @@ -7,6 +7,7 @@ function __construct() { $block_options = array( 'name' => __('Text', 'aqpb-l10n'), 'size' => 'span6', + 'icon' => 'fa-font', ); //create the block diff --git a/blocks/aq-upload-block.php b/blocks/aq-upload-block.php index b42af0c..a649a31 100644 --- a/blocks/aq-upload-block.php +++ b/blocks/aq-upload-block.php @@ -10,6 +10,7 @@ function __construct() { $block_options = array( 'name' => __('Media', 'aqpb-l10n'), 'size' => 'span6', + 'icon' => 'fa-upload', //Font awesome icon class ); //create the block diff --git a/blocks/aq-widgets-block.php b/blocks/aq-widgets-block.php index 67813b7..f14dd3c 100644 --- a/blocks/aq-widgets-block.php +++ b/blocks/aq-widgets-block.php @@ -6,6 +6,7 @@ function __construct() { $block_options = array( 'name' => __('Widgets', 'aqpb-l10n'), 'size' => 'span4', + 'icon' => 'fa-th-large', ); parent::__construct('AQ_Widgets_Block', $block_options); diff --git a/classes/class-aq-block.php b/classes/class-aq-block.php index 6289689..7a46dcd 100644 --- a/classes/class-aq-block.php +++ b/classes/class-aq-block.php @@ -111,6 +111,7 @@ function parse_block($block_options) { 'number' => '__i__', //block consecutive numbering 'first' => false, //column first 'resizable' => 1, //whether block is resizable/not + 'icon' => '', //font-awesome icon class e.g: fa-cog http://fontawesome.io/icons/ ); $block_options = is_array($block_options) ? wp_parse_args($block_options, $defaults) : $defaults; @@ -124,13 +125,14 @@ function before_form($instance) { extract($instance); $title = $title ? ' : '.$title.'' : ''; + $fa_icon = $icon ? '' : ''; $resizable = $resizable ? '' : 'not-resizable'; echo '
  • ', '
    ', '
    ', '
    ', - $name , $title, + $fa_icon, $name , $title, '
    ', '', ''. __('Edit Block', 'aqpb-l10n') .'', diff --git a/classes/class-aq-page-builder.php b/classes/class-aq-page-builder.php index 4db7a77..db6997d 100644 --- a/classes/class-aq-page-builder.php +++ b/classes/class-aq-page-builder.php @@ -107,12 +107,14 @@ function admin_enqueue() { // Register 'em wp_register_style( 'aqpb-css', $this->url.'assets/stylesheets/aqpb.css', array(), time(), 'all'); wp_register_style( 'aqpb-blocks-css', $this->url.'assets/stylesheets/aqpb_blocks.css', array(), time(), 'all'); + wp_register_style( 'font-awesome-css', $this->url.'assets/stylesheets/font-awesome.min.css', array(), time(), 'all'); wp_register_script('aqpb-js', $this->url . 'assets/javascripts/aqpb.js', array('jquery'), time(), true); wp_register_script('aqpb-fields-js', $this->url . 'assets/javascripts/aqpb-fields.js', array('jquery'), time(), true); // Enqueue 'em wp_enqueue_style('aqpb-css'); wp_enqueue_style('aqpb-blocks-css'); + wp_enqueue_style('font-awesome-css'); wp_enqueue_style('wp-color-picker'); wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-sortable'); diff --git a/view/view-builder-page.php b/view/view-builder-page.php index f5c04bf..3b222df 100644 --- a/view/view-builder-page.php +++ b/view/view-builder-page.php @@ -189,7 +189,7 @@ admin_url( 'themes.php' ) )); ?> - "> + "> @@ -294,12 +294,12 @@ '_wpnonce' => wp_create_nonce('delete-template'), ), admin_url( 'themes.php' ) - )) . '">'. __('Delete Template', 'aqpb-l10n') .''; + )) . '">'. __('Delete Template', 'aqpb-l10n') .''; ?>
  • - $this->args['page_slug'], @@ -309,7 +309,7 @@ '_wpnonce' => wp_create_nonce('clone-template'), ), admin_url( 'themes.php' ) - )) . '">'. __('Clone Template', 'aqpb-l10n') .''; + )) . '">'. __('Clone Template', 'aqpb-l10n') .''; ?>
    From d85e34e87f096d29a86c7391c0cbae7c601c358a Mon Sep 17 00:00:00 2001 From: sarojlakra Date: Tue, 22 Jul 2014 01:32:25 +0530 Subject: [PATCH 5/5] Updated url --- contribute.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contribute.md b/contribute.md index 61bf0f6..1d40578 100644 --- a/contribute.md +++ b/contribute.md @@ -14,4 +14,4 @@ Here are some guidelines: Please feel free to add yourself on this list :) * [Syamil MJ](http://aquagraphite.com) (author) -* [Saroj] (Contributor) +* [Saroj](https://github.com/sarojlakra)