Changeset 1447317
- Timestamp:
- 07/01/2016 03:03:16 PM (10 years ago)
- Location:
- wp-bootstrap-widgets
- Files:
-
- 12 added
- 6 edited
- 1 copied
-
tags/0.2.0 (copied) (copied from wp-bootstrap-widgets/trunk)
-
tags/0.2.0/README.txt (modified) (4 diffs)
-
tags/0.2.0/assets (added)
-
tags/0.2.0/assets/scripts-admin.js (added)
-
tags/0.2.0/assets/styles-admin.css (added)
-
tags/0.2.0/assets/styles-front.css (added)
-
tags/0.2.0/include (added)
-
tags/0.2.0/include/navigation-bar-walker.php (added)
-
tags/0.2.0/widgets/image.php (modified) (4 diffs)
-
tags/0.2.0/wp-bootstrap-widgets.php (modified) (4 diffs)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/assets (added)
-
trunk/assets/scripts-admin.js (added)
-
trunk/assets/styles-admin.css (added)
-
trunk/assets/styles-front.css (added)
-
trunk/include (added)
-
trunk/include/navigation-bar-walker.php (added)
-
trunk/widgets/image.php (modified) (4 diffs)
-
trunk/wp-bootstrap-widgets.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-bootstrap-widgets/tags/0.2.0/README.txt
r1445949 r1447317 1 1 === WP Bootstrap Widgets === 2 2 Contributors: inxilpro, jgrossi 3 Tags: bootstrap, widget, widgets, page builder, responsive, cms, layout, alert, button, embed, image, panel, well 3 Tags: bootstrap, widget, widgets, page builder, responsive, cms, layout, alert, button, embed, image, panel, well, navbar 4 4 Requires at least: 4.0 5 5 Tested up to: 4.5.2 6 Stable tag: 0. 1.16 Stable tag: 0.2.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 12 12 == Description == 13 13 14 WP Bootstrap Widgets provides configurable widgets for common [Twitter Bootstrap (version 3)](https://getbootstrap.com/) components. If your theme is based on Bootstrap, these widgets will automatically look great! Works particularly well with the [SiteOrigin Page Builder](https://wordpress.org/plugins/siteorigin-panels/) as you can drop your wid ets into your multi-column layouts with ease.14 WP Bootstrap Widgets provides configurable widgets for common [Twitter Bootstrap (version 3)](https://getbootstrap.com/) components. If your theme is based on Bootstrap, these widgets will automatically look great! Works particularly well with the [SiteOrigin Page Builder](https://wordpress.org/plugins/siteorigin-panels/) as you can drop your widgets into your multi-column layouts with ease. 15 15 16 16 Included widgets: … … 19 19 - [Button](https://getbootstrap.com/css/#buttons) 20 20 - [Image](https://getbootstrap.com/css/#images) 21 - [Navigation Bar](https://getbootstrap.com/components/#navbar) 21 22 - [Responsive Embed](https://getbootstrap.com/components/#responsive-embed) 22 23 - [Panels](https://getbootstrap.com/components/#panels) 23 24 - [Wells](https://getbootstrap.com/components/#wells) 24 25 25 All widgets are configurable (choose from `primary`, `succ cess`, `info`, etc).26 All widgets are configurable (choose from `primary`, `success`, `info`, etc). 26 27 27 28 == Installation == … … 33 34 == Changelog == 34 35 36 = 0.2 = 37 * Add navbar widget support, with brand name, logo and color. 38 * Better organization of assets files. 39 * Add CSS file for the front end layer. 40 * Add width and height attributes for image widget. 41 35 42 = 0.1 = 36 43 Initial release -
wp-bootstrap-widgets/tags/0.2.0/widgets/image.php
r1445949 r1447317 5 5 * 6 6 * @author Junior Grossi <@jgrossi> 7 * @todo Add set dimensions8 7 */ 9 8 class WPBW_Widget_Image extends WP_Widget { … … 22 21 ) 23 22 ); 24 add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );25 }26 27 public function admin_scripts() {28 wp_enqueue_media();29 wp_enqueue_script( $this->name, plugin_dir_url( __FILE__ ) . '../js/image.js', array( 'jquery' ) );30 23 } 31 24 … … 58 51 $this->form_field_url( $instance ); 59 52 $this->form_field_alt( $instance ); 53 $this->form_field_dimensions( $instance ); 60 54 $this->form_field_responsive( $instance ); 61 55 $this->form_field_shape( $instance ); … … 84 78 */ 85 79 public function form_field_alt( $instance ) { 86 $id = $this->get_field_id( 'alt' );87 $name = $this->get_field_name( 'alt' );88 $value = isset( $instance['alt'] ) ? $instance['alt'] : '';80 $id = $this->get_field_id( 'alt' ); 81 $name = $this->get_field_name( 'alt' ); 82 $value = isset( $instance['alt'] ) ? $instance['alt'] : ''; 89 83 $placeholder = 'eg. Photo of cat pouncing'; 90 84 wpbw_field_text( $name, __( 'Descriptive Text (alt):' ), compact( 'id', 'placeholder' ), $value ); 85 } 86 87 /** 88 * The image width and height attributes 89 * 90 * @param $instance 91 */ 92 public function form_field_dimensions( $instance ) { 93 $id = $this->get_field_id( 'width' ); 94 $name = $this->get_field_name( 'width' ); 95 $value = isset( $instance['width'] ) ? $instance['width'] : ''; 96 $placeholder = 'eg. 640 or 50%'; 97 wpbw_field_text( $name, __( 'Width (pixels or %):' ), compact( 'id', 'placeholder' ), $value ); 98 $id = $this->get_field_id( 'height' ); 99 $name = $this->get_field_name( 'height' ); 100 $value = isset( $instance['height'] ) ? $instance['height'] : ''; 101 $placeholder = 'eg. 480 or 30%'; 102 wpbw_field_text( $name, __( 'Height (pixels or %):' ), compact( 'id', 'placeholder' ), $value ); 91 103 } 92 104 -
wp-bootstrap-widgets/tags/0.2.0/wp-bootstrap-widgets.php
r1445301 r1447317 14 14 15 15 define( 'WPBW_NAME', 'WP Bootstrap Widgets' ); 16 define( 'WPBW_SLUG', 'wp-bootstrap-widgets' ); 17 define( 'WPBW_URL', plugin_dir_url( __FILE__ ) ); 16 18 define( 'WPBW_REQUIRED_PHP_VERSION', '5.2' ); 17 19 define( 'WPBW_REQUIRED_WP_VERSION', '3.0' ); … … 50 52 register_widget( 'WPBW_Widget_Embed' ); 51 53 register_widget( 'WPBW_Widget_Image' ); 54 register_widget( 'WPBW_Widget_NavigationBar' ); 52 55 register_widget( 'WPBW_Widget_Panel' ); 53 56 register_widget( 'WPBW_Widget_Well' ); … … 74 77 } 75 78 79 /** 80 * Register the plugin CSS and JS files for admin panel 81 */ 82 function wpbw_assets_admin() { 83 wp_enqueue_media(); // Media Library 84 wp_enqueue_script( WPBW_SLUG, WPBW_URL . 'assets/scripts-admin.js', array( 'jquery' ) ); 85 wp_enqueue_style( WPBW_SLUG, WPBW_URL . 'assets/styles-admin.css' ); 86 } 87 88 /** 89 * Register the CSS and JS files for frontend layer 90 */ 91 function wpbw_assets_front() { 92 wp_enqueue_style( WPBW_SLUG, WPBW_URL . 'assets/styles-front.css' ); 93 wp_enqueue_script( 94 'bootstrap', 95 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js', 96 array( 'jquery' ) 97 ); 98 } 99 76 100 /* 77 101 * Check requirements and load main class … … 80 104 if ( wpbw_requirements_met() ) { 81 105 require_once( dirname( __FILE__ ) . '/form-fields.php' ); 106 require_once( dirname( __FILE__ ) . '/include/navigation-bar-walker.php' ); 82 107 require_once( dirname( __FILE__ ) . '/widgets/alert.php' ); 83 108 require_once( dirname( __FILE__ ) . '/widgets/button.php' ); 84 109 require_once( dirname( __FILE__ ) . '/widgets/embed.php' ); 85 110 require_once( dirname( __FILE__ ) . '/widgets/image.php' ); 111 require_once( dirname( __FILE__ ) . '/widgets/navigation-bar.php' ); 86 112 require_once( dirname( __FILE__ ) . '/widgets/panel.php' ); 87 113 require_once( dirname( __FILE__ ) . '/widgets/well.php' ); 88 114 89 115 add_action( 'widgets_init', 'wpbw_widgets_init' ); 116 add_action( 'admin_enqueue_scripts', 'wpbw_assets_admin' ); 117 add_action( 'wp_enqueue_scripts', 'wpbw_assets_front' ); 90 118 // Site Origin Page Builder Plugin 91 119 if ( has_filter( 'siteorigin_panels_widget_dialog_tabs' ) ) { -
wp-bootstrap-widgets/trunk/README.txt
r1445949 r1447317 1 1 === WP Bootstrap Widgets === 2 2 Contributors: inxilpro, jgrossi 3 Tags: bootstrap, widget, widgets, page builder, responsive, cms, layout, alert, button, embed, image, panel, well 3 Tags: bootstrap, widget, widgets, page builder, responsive, cms, layout, alert, button, embed, image, panel, well, navbar 4 4 Requires at least: 4.0 5 5 Tested up to: 4.5.2 6 Stable tag: 0. 1.16 Stable tag: 0.2.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 12 12 == Description == 13 13 14 WP Bootstrap Widgets provides configurable widgets for common [Twitter Bootstrap (version 3)](https://getbootstrap.com/) components. If your theme is based on Bootstrap, these widgets will automatically look great! Works particularly well with the [SiteOrigin Page Builder](https://wordpress.org/plugins/siteorigin-panels/) as you can drop your wid ets into your multi-column layouts with ease.14 WP Bootstrap Widgets provides configurable widgets for common [Twitter Bootstrap (version 3)](https://getbootstrap.com/) components. If your theme is based on Bootstrap, these widgets will automatically look great! Works particularly well with the [SiteOrigin Page Builder](https://wordpress.org/plugins/siteorigin-panels/) as you can drop your widgets into your multi-column layouts with ease. 15 15 16 16 Included widgets: … … 19 19 - [Button](https://getbootstrap.com/css/#buttons) 20 20 - [Image](https://getbootstrap.com/css/#images) 21 - [Navigation Bar](https://getbootstrap.com/components/#navbar) 21 22 - [Responsive Embed](https://getbootstrap.com/components/#responsive-embed) 22 23 - [Panels](https://getbootstrap.com/components/#panels) 23 24 - [Wells](https://getbootstrap.com/components/#wells) 24 25 25 All widgets are configurable (choose from `primary`, `succ cess`, `info`, etc).26 All widgets are configurable (choose from `primary`, `success`, `info`, etc). 26 27 27 28 == Installation == … … 33 34 == Changelog == 34 35 36 = 0.2 = 37 * Add navbar widget support, with brand name, logo and color. 38 * Better organization of assets files. 39 * Add CSS file for the front end layer. 40 * Add width and height attributes for image widget. 41 35 42 = 0.1 = 36 43 Initial release -
wp-bootstrap-widgets/trunk/widgets/image.php
r1445949 r1447317 5 5 * 6 6 * @author Junior Grossi <@jgrossi> 7 * @todo Add set dimensions8 7 */ 9 8 class WPBW_Widget_Image extends WP_Widget { … … 22 21 ) 23 22 ); 24 add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );25 }26 27 public function admin_scripts() {28 wp_enqueue_media();29 wp_enqueue_script( $this->name, plugin_dir_url( __FILE__ ) . '../js/image.js', array( 'jquery' ) );30 23 } 31 24 … … 58 51 $this->form_field_url( $instance ); 59 52 $this->form_field_alt( $instance ); 53 $this->form_field_dimensions( $instance ); 60 54 $this->form_field_responsive( $instance ); 61 55 $this->form_field_shape( $instance ); … … 84 78 */ 85 79 public function form_field_alt( $instance ) { 86 $id = $this->get_field_id( 'alt' );87 $name = $this->get_field_name( 'alt' );88 $value = isset( $instance['alt'] ) ? $instance['alt'] : '';80 $id = $this->get_field_id( 'alt' ); 81 $name = $this->get_field_name( 'alt' ); 82 $value = isset( $instance['alt'] ) ? $instance['alt'] : ''; 89 83 $placeholder = 'eg. Photo of cat pouncing'; 90 84 wpbw_field_text( $name, __( 'Descriptive Text (alt):' ), compact( 'id', 'placeholder' ), $value ); 85 } 86 87 /** 88 * The image width and height attributes 89 * 90 * @param $instance 91 */ 92 public function form_field_dimensions( $instance ) { 93 $id = $this->get_field_id( 'width' ); 94 $name = $this->get_field_name( 'width' ); 95 $value = isset( $instance['width'] ) ? $instance['width'] : ''; 96 $placeholder = 'eg. 640 or 50%'; 97 wpbw_field_text( $name, __( 'Width (pixels or %):' ), compact( 'id', 'placeholder' ), $value ); 98 $id = $this->get_field_id( 'height' ); 99 $name = $this->get_field_name( 'height' ); 100 $value = isset( $instance['height'] ) ? $instance['height'] : ''; 101 $placeholder = 'eg. 480 or 30%'; 102 wpbw_field_text( $name, __( 'Height (pixels or %):' ), compact( 'id', 'placeholder' ), $value ); 91 103 } 92 104 -
wp-bootstrap-widgets/trunk/wp-bootstrap-widgets.php
r1445301 r1447317 14 14 15 15 define( 'WPBW_NAME', 'WP Bootstrap Widgets' ); 16 define( 'WPBW_SLUG', 'wp-bootstrap-widgets' ); 17 define( 'WPBW_URL', plugin_dir_url( __FILE__ ) ); 16 18 define( 'WPBW_REQUIRED_PHP_VERSION', '5.2' ); 17 19 define( 'WPBW_REQUIRED_WP_VERSION', '3.0' ); … … 50 52 register_widget( 'WPBW_Widget_Embed' ); 51 53 register_widget( 'WPBW_Widget_Image' ); 54 register_widget( 'WPBW_Widget_NavigationBar' ); 52 55 register_widget( 'WPBW_Widget_Panel' ); 53 56 register_widget( 'WPBW_Widget_Well' ); … … 74 77 } 75 78 79 /** 80 * Register the plugin CSS and JS files for admin panel 81 */ 82 function wpbw_assets_admin() { 83 wp_enqueue_media(); // Media Library 84 wp_enqueue_script( WPBW_SLUG, WPBW_URL . 'assets/scripts-admin.js', array( 'jquery' ) ); 85 wp_enqueue_style( WPBW_SLUG, WPBW_URL . 'assets/styles-admin.css' ); 86 } 87 88 /** 89 * Register the CSS and JS files for frontend layer 90 */ 91 function wpbw_assets_front() { 92 wp_enqueue_style( WPBW_SLUG, WPBW_URL . 'assets/styles-front.css' ); 93 wp_enqueue_script( 94 'bootstrap', 95 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js', 96 array( 'jquery' ) 97 ); 98 } 99 76 100 /* 77 101 * Check requirements and load main class … … 80 104 if ( wpbw_requirements_met() ) { 81 105 require_once( dirname( __FILE__ ) . '/form-fields.php' ); 106 require_once( dirname( __FILE__ ) . '/include/navigation-bar-walker.php' ); 82 107 require_once( dirname( __FILE__ ) . '/widgets/alert.php' ); 83 108 require_once( dirname( __FILE__ ) . '/widgets/button.php' ); 84 109 require_once( dirname( __FILE__ ) . '/widgets/embed.php' ); 85 110 require_once( dirname( __FILE__ ) . '/widgets/image.php' ); 111 require_once( dirname( __FILE__ ) . '/widgets/navigation-bar.php' ); 86 112 require_once( dirname( __FILE__ ) . '/widgets/panel.php' ); 87 113 require_once( dirname( __FILE__ ) . '/widgets/well.php' ); 88 114 89 115 add_action( 'widgets_init', 'wpbw_widgets_init' ); 116 add_action( 'admin_enqueue_scripts', 'wpbw_assets_admin' ); 117 add_action( 'wp_enqueue_scripts', 'wpbw_assets_front' ); 90 118 // Site Origin Page Builder Plugin 91 119 if ( has_filter( 'siteorigin_panels_widget_dialog_tabs' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.