Changeset 2173048
- Timestamp:
- 10/14/2019 04:12:34 PM (6 years ago)
- Location:
- slide/trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
slide/trunk/index.css
r2171722 r2173048 46 46 div[data-type="slide/slide"] { 47 47 margin-bottom: 60px !important; 48 }49 50 div[data-type="slide/slide"] > .block-editor-block-list__block-edit {51 height: 700px !important;52 display: flex;53 flex-direction: column;54 justify-content: center;55 }56 57 div[data-type="slide/slide"] > .block-editor-block-list__block-edit > *[data-block] {58 padding: 50px;59 }60 61 div[data-type="slide/slide"] {62 48 width: 100% !important; 63 49 max-width: none !important; … … 73 59 } 74 60 75 .wp-block-slide-slide { 76 width: 960px !important; 61 section.wp-block-slide-slide { 62 outline: 1px dashed currentColor; 63 width: 1060px !important; 64 height: 700px !important; 65 padding: calc( 50px + 0.2em ) !important; 66 display: flex; 67 flex-direction: column; 68 justify-content: center; 77 69 } 78 70 -
slide/trunk/index.js
r2171838 r2173048 58 58 e('style', null, 59 59 ` 60 ${cssPrefix} > .block-editor-block-list__block-edit:before {61 outline: 1px solid black;62 background: ${meta[bgColorKey]};63 }64 65 60 ${cssPrefix} section { 66 61 color: ${meta[colorKey]}; 62 background: ${meta[bgColorKey]}; 67 63 font-size: ${meta[fontSizeKey] || '42'}px; 68 64 font-family: ${meta[fontFamilyKey] || 'Helvetica, sans-serif'}; … … 92 88 }), 93 89 e(ColorPicker, { 90 disableAlpha: true, 94 91 label: __('Color', 'slide'), 95 92 color: meta[colorKey], … … 105 102 }, 106 103 e(ColorPicker, { 104 disableAlpha: true, 107 105 label: __('Background Color', 'slide'), 108 106 color: meta[bgColorKey], … … 185 183 notes: { 186 184 type: 'string' 185 }, 186 backgroundColor: { 187 type: 'string' 187 188 } 188 189 }, 189 190 edit: ({ attributes, setAttributes, className }) => 190 e(Fragment, null, 191 e(InspectorControls, null, 192 e(PanelBody, { 193 title: __('Slide Notes', 'slide') 194 }, 195 e(TextareaControl, { 196 label: __('Anything you want to remember.', 'slide'), 197 value: attributes.notes, 198 onChange: (notes) => setAttributes({ notes }) 199 }) 191 e( 192 Fragment, 193 null, 194 e( 195 InspectorControls, 196 null, 197 e( 198 PanelBody, 199 { title: __('Slide Notes', 'slide') }, 200 e(TextareaControl, { 201 label: __('Anything you want to remember.', 'slide'), 202 value: attributes.notes, 203 onChange: (notes) => setAttributes({ notes }) 204 }) 205 ), 206 e( 207 PanelBody, 208 { title: __('Background', 'slide') }, 209 e(ColorPicker, { 210 disableAlpha: true, 211 label: __('Background Color', 'slide'), 212 color: attributes.backgroundColor, 213 onChangeComplete: ({ hex: backgroundColor }) => 214 setAttributes({ backgroundColor }) 215 }) 200 216 ) 201 217 ), 202 e('section', { 203 className, 204 style: { 205 backgroundColor: attributes.backgroundColor 206 } 207 }, e(InnerBlocks)) 218 e( 219 'section', 220 { 221 className, 222 style: { 223 backgroundColor: attributes.backgroundColor 224 } 225 }, 226 e(InnerBlocks) 227 ) 208 228 ), 209 229 save: ({ attributes }) => 210 e('section', { 211 style: { 212 backgroundColor: attributes.backgroundColor 213 } 214 }, e(InnerBlocks.Content)) 230 e( 231 'section', 232 { 233 'data-background-color': attributes.backgroundColor 234 }, 235 e(InnerBlocks.Content) 236 ) 215 237 }); 216 238 -
slide/trunk/index.php
r2171838 r2173048 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. 27 * Version: 0.0.3 8 8 * Author: Ella van Durpe 9 9 * Author URI: https://ellavandurpe.com … … 62 62 63 63 wp_enqueue_style( 64 'slide-common', 65 plugins_url( 'common.css', __FILE__ ), 66 array(), 67 filemtime( dirname( __FILE__ ) . '/common.css' ) 68 ); 69 70 wp_enqueue_style( 64 71 'slide', 65 72 plugins_url( 'index.css', __FILE__ ), … … 67 74 filemtime( dirname( __FILE__ ) . '/index.css' ) 68 75 ); 69 70 wp_enqueue_style(71 'slide-common',72 plugins_url( 'common.css', __FILE__ ),73 array(),74 filemtime( dirname( __FILE__ ) . '/common.css' )75 );76 76 } ); 77 77 78 78 add_action( 'init', function() { 79 register_post_type( 'presentation', array( 80 'labels' => array( 81 'name' => _x( 'Presentations', 'Post type general name', 'slide' ), 82 'singular_name' => _x( 'Presentation', 'Post type singular name', 'slide' ), 83 'menu_name' => _x( 'Presentations', 'Admin Menu text', 'slide' ), 84 'name_admin_bar' => _x( 'Presentation', 'Add New on Toolbar', 'slide' ), 85 'add_new' => __( 'Add New', 'slide' ), 86 'add_new_item' => __( 'Add New Presentation', 'slide' ), 87 'new_item' => __( 'New Presentation', 'slide' ), 88 'edit_item' => __( 'Edit Presentation', 'slide' ), 89 'view_item' => __( 'View Presentation', 'slide' ), 90 'all_items' => __( 'All Presentations', 'slide' ), 91 'search_items' => __( 'Search Presentations', 'slide' ), 92 'parent_item_colon' => __( 'Parent Presentations:', 'slide' ), 93 'not_found' => __( 'No presentations found.', 'slide' ), 94 'not_found_in_trash' => __( 'No presentations found in Trash.', 'slide' ), 95 'featured_image' => _x( 'Presentation Cover Image', 'Overrides the “Featured Image” phrase for this post type. Added in 4.3', 'slide' ), 96 'set_featured_image' => _x( 'Set cover image', 'Overrides the “Set featured image” phrase for this post type. Added in 4.3', 'slide' ), 97 'remove_featured_image' => _x( 'Remove cover image', 'Overrides the “Remove featured image” phrase for this post type. Added in 4.3', 'slide' ), 98 'use_featured_image' => _x( 'Use as cover image', 'Overrides the “Use as featured image” phrase for this post type. Added in 4.3', 'slide' ), 99 'archives' => _x( 'Presentation archives', 'The post type archive label used in nav menus. Default “Post Archives”. Added in 4.4', 'slide' ), 100 'insert_into_item' => _x( 'Insert into presentation', 'Overrides the “Insert into post”/”Insert into page” phrase (used when inserting media into a post). Added in 4.4', 'slide' ), 101 'uploaded_to_this_item' => _x( 'Uploaded to this presentation', 'Overrides the “Uploaded to this post”/”Uploaded to this page” phrase (used when viewing media attached to a post). Added in 4.4', 'slide' ), 102 'filter_items_list' => _x( 'Filter presentations list', 'Screen reader text for the filter links heading on the post type listing screen. Default “Filter posts list”/”Filter pages list”. Added in 4.4', 'slide' ), 103 'items_list_navigation' => _x( 'Presentations list navigation', 'Screen reader text for the pagination heading on the post type listing screen. Default “Posts list navigation”/”Pages list navigation”. Added in 4.4', 'slide' ), 104 'items_list' => _x( 'Presentations list', 'Screen reader text for the items list heading on the post type listing screen. Default “Posts list”/”Pages list”. Added in 4.4', 'slide' ), 105 ), 106 'public' => true, 107 'publicly_queryable' => true, 108 'show_ui' => true, 109 'show_in_menu' => true, 110 'query_var' => true, 111 'rewrite' => array( 'slug' => 'presentation' ), 112 'capability_type' => 'post', 113 'has_archive' => true, 114 'hierarchical' => false, 115 'menu_position' => null, 116 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields' ), 117 'show_in_rest' => true, 118 ) ); 79 require 'register.php'; 80 } ); 119 81 120 foreach ( array( 121 'css', 122 'color', 123 'background-color', 124 'font-size', 125 'font-family', 126 'transition', 127 'transition-speed', 128 'controls', 129 'progress', 130 ) as $key ) { 131 register_post_meta( 'presentation', "presentation-$key", array( 132 'show_in_rest' => true, 133 'single' => true, 134 'type' => 'string', 135 ) ); 136 } 82 register_activation_hook( __FILE__, function() { 83 require 'register.php'; 84 flush_rewrite_rules(); 137 85 } ); 138 86 -
slide/trunk/readme.md
r2171838 r2173048 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.2 8 Stable tag: 0.0. 28 Stable tag: 0.0.3 9 9 License: GPL-2.0-or-later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.