Changeset 2180208
- Timestamp:
- 10/25/2019 04:02:22 PM (6 years ago)
- Location:
- slide/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
slide/trunk/index.js
r2179945 r2180208 20 20 const { useSelect, useDispatch, subscribe, select, dispatch } = data; 21 21 const { TextareaControl, ColorPicker, PanelBody, RangeControl, SelectControl, ToggleControl, Button, FocalPointPicker, ExternalLink, Notice, TextControl, RadioControl } = components; 22 const { MediaUpload, __experimentalGradientPickerControl, InnerBlocks, InspectorControls, RichTextToolbarButton } = blockEditor;22 const { MediaUpload, __experimentalGradientPickerControl, InnerBlocks, InspectorControls, RichTextToolbarButton, ColorPalette } = blockEditor; 23 23 const { addQueryArgs } = url; 24 24 const colorKey = 'presentation-color'; … … 44 44 const horizontalPaddingKey = 'presentation-horizontal-padding'; 45 45 const verticalPaddingKey = 'presentation-vertical-padding'; 46 const colorPaletteKey = 'presentation-color-palette'; 46 47 47 48 const CodeEditor = memo(({ onChange, ...props }) => { … … 412 413 }); 413 414 } 415 }) 416 ), 417 e( 418 PluginDocumentSettingPanel, 419 { 420 name: 'slide-palette', 421 title: __('Color Palette', 'slide'), 422 icon: 'art' 423 }, 424 e(TextareaControl, { 425 label: __('Comma separated list of color values. Please refresh the page to be able to use the palette.', 'slide'), 426 value: meta[colorPaletteKey], 427 onChange: (value) => updateMeta(value, colorPaletteKey) 414 428 }) 415 429 ), … … 583 597 initialOpen: false 584 598 }, 585 e(ColorPicker, { 586 disableAlpha: true, 599 e(ColorPalette, { 587 600 label: __('Color', 'slide'), 588 color: attributes.color,589 onChange Complete: ({ hex: color }) =>601 value: attributes.color, 602 onChange: (color) => 590 603 setAttributes({ color }) 591 604 }), … … 606 619 initialOpen: false 607 620 }, 608 e(ColorPicker, { 609 disableAlpha: true, 621 e(ColorPalette, { 610 622 label: __('Background Color', 'slide'), 611 color: attributes.backgroundColor,612 onChange Complete: ({ hex: backgroundColor }) =>623 value: attributes.backgroundColor, 624 onChange: (backgroundColor) => 613 625 setAttributes({ backgroundColor }) 614 626 }), -
slide/trunk/index.php
r2179945 r2180208 5 5 * Plugin URI: https://wordpress.org/plugins/slide/ 6 6 * Description: Allows you to create presentations with the block editor. 7 * Version: 0.0.1 77 * Version: 0.0.18 8 8 * Author: Ella van Durpe 9 9 * Author URI: https://ellavandurpe.com … … 205 205 remove_theme_support( 'editor-font-sizes' ); 206 206 add_theme_support( 'align-wide' ); 207 208 if ( ! isset( $_GET['post'] ) ) { 209 return; 210 } 211 212 $post = get_post( $_GET['post'] ); 213 214 if ( ! $post ) { 215 return; 216 } 217 218 $palette = get_post_meta( $post->ID, 'presentation-color-palette', true ); 219 $palette = explode( ',', $palette ); 220 $palette = array_map( 'sanitize_hex_color', $palette ); 221 $palette = array_map( function( $hex ) { 222 return array( 223 'name' => $hex, 224 'slug' => sanitize_title( $hex ), 225 'color' => $hex, 226 ); 227 }, $palette ); 228 229 if ( count( $palette ) ) { 230 add_theme_support( 'editor-color-palette', $palette ); 231 } 207 232 }, 99999 ); 208 233 } -
slide/trunk/readme.md
r2179945 r2180208 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.3 8 Stable tag: 0.0.1 78 Stable tag: 0.0.18 9 9 License: GPL-2.0-or-later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
slide/trunk/register.php
r2179945 r2180208 73 73 'horizontal-padding', 74 74 'vertical-padding', 75 'color-palette', 75 76 ) as $key ) { 76 77 register_post_meta( 'presentation', "presentation-$key", array(
Note: See TracChangeset
for help on using the changeset viewer.