Plugin Directory

Changeset 2173048


Ignore:
Timestamp:
10/14/2019 04:12:34 PM (6 years ago)
Author:
iseulde
Message:

v0.0.3

Location:
slide/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • slide/trunk/index.css

    r2171722 r2173048  
    4646div[data-type="slide/slide"] {
    4747    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"] {
    6248    width: 100% !important;
    6349    max-width: none !important;
     
    7359}
    7460
    75 .wp-block-slide-slide {
    76     width: 960px !important;
     61section.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;
    7769}
    7870
  • slide/trunk/index.js

    r2171838 r2173048  
    5858        e('style', null,
    5959`
    60 ${cssPrefix} > .block-editor-block-list__block-edit:before {
    61     outline: 1px solid black;
    62     background: ${meta[bgColorKey]};
    63 }
    64 
    6560${cssPrefix} section {
    6661    color: ${meta[colorKey]};
     62    background: ${meta[bgColorKey]};
    6763    font-size: ${meta[fontSizeKey] || '42'}px;
    6864    font-family: ${meta[fontFamilyKey] || 'Helvetica, sans-serif'};
     
    9288          }),
    9389          e(ColorPicker, {
     90            disableAlpha: true,
    9491            label: __('Color', 'slide'),
    9592            color: meta[colorKey],
     
    105102          },
    106103          e(ColorPicker, {
     104            disableAlpha: true,
    107105            label: __('Background Color', 'slide'),
    108106            color: meta[bgColorKey],
     
    185183      notes: {
    186184        type: 'string'
     185      },
     186      backgroundColor: {
     187        type: 'string'
    187188      }
    188189    },
    189190    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            })
    200216          )
    201217        ),
    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        )
    208228      ),
    209229    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      )
    215237  });
    216238
  • slide/trunk/index.php

    r2171838 r2173048  
    55 * Plugin URI:  https://wordpress.org/plugins/slide/
    66 * Description: Allows you to create presentations with the block editor.
    7  * Version:     0.0.2
     7 * Version:     0.0.3
    88 * Author:      Ella van Durpe
    99 * Author URI:  https://ellavandurpe.com
     
    6262
    6363    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(
    6471        'slide',
    6572        plugins_url( 'index.css', __FILE__ ),
     
    6774        filemtime( dirname( __FILE__ ) . '/index.css' )
    6875    );
    69 
    70     wp_enqueue_style(
    71         'slide-common',
    72         plugins_url( 'common.css', __FILE__ ),
    73         array(),
    74         filemtime( dirname( __FILE__ ) . '/common.css' )
    75     );
    7676} );
    7777
    7878add_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} );
    11981
    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     }
     82register_activation_hook( __FILE__, function() {
     83    require 'register.php';
     84    flush_rewrite_rules();
    13785} );
    13886
  • slide/trunk/readme.md

    r2171838 r2173048  
    66    Requires PHP:      5.6
    77    Tested up to:      5.2
    8     Stable tag:        0.0.2
     8    Stable tag:        0.0.3
    99    License:           GPL-2.0-or-later
    1010    License URI:       http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.