Plugin Directory

Changeset 2152002


Ignore:
Timestamp:
09/05/2019 09:52:56 PM (6 years ago)
Author:
narrative
Message:

adding version 1.0.3

Location:
narrative-so/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • narrative-so/trunk/assets/admin-script.js

    r2061865 r2152002  
    88    });
    99
     10    if (!$wrap.find('#access_key').val()) {
     11        $wrap.find('#access_key').addClass('empty');
     12    }
     13
    1014    $wrap.find('[name="submit"]').on('click', function () {
     15
     16        if ( $wrap.find('#access_key').hasClass('empty') ) {
     17            return true;
     18        }
    1119
    1220        if (!window.confirm($('#access_key').data('notice'))) {
  • narrative-so/trunk/includes/class-admin.php

    r2061865 r2152002  
    3535        add_action( 'init', array( &$this, 'add_tiny_plugin' ) );
    3636
    37         add_action( 'admin_print_styles', array( &$this, 'admin_print_styles' ) );
    38         add_action( 'admin_print_styles', array( &$this, 'admin_print_script' ) );
     37        add_action( 'admin_print_styles',
     38            array( &$this, 'admin_print_styles' ) );
     39        add_action( 'admin_print_styles',
     40            array( &$this, 'admin_print_script' ) );
    3941
    4042        add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue' ) );
    4143
    42         add_action(
    43             'edit_form_after_title',
    44             array(
    45                 &$this,
    46                 'do_meta_boxes',
    47             ),
    48             100
    49         );
    50 
    51         add_filter( 'tiny_mce_before_init', array( &$this, 'fb_change_mce_options' ) );
     44        add_action( 'edit_form_after_title', array(
     45            &$this,
     46            'do_meta_boxes',
     47        ), 100 );
     48
     49        add_filter( 'tiny_mce_before_init',
     50            array( &$this, 'fb_change_mce_options' ) );
     51
     52        add_filter( 'pre_update_option_narrative_options',
     53            array( &$this, 'update_option' ) );
     54        add_action( 'admin_notices', array( &$this, 'admin_notices' ) );
    5255    }
    5356
     
    5760    public function add_tiny_plugin() {
    5861
    59         add_filter(
    60             'mce_external_plugins',
    61             function ( $plugin_array ) {
    62                 $plugin_array['narrative'] = plugins_url( 'assets/tiny-plugin.js', dirname( __FILE__ ) );
    63 
    64                 return $plugin_array;
    65             }
    66         );
    67 
    68         add_filter(
    69             'mce_buttons',
    70             function ( $buttons ) {
    71                 array_push(
    72                     $buttons,
    73                     'dropcap',
    74                     'showrecent'
    75                 );
    76 
    77                 return $buttons;
    78             }
    79         );
     62        add_filter( 'mce_external_plugins', function ( $plugin_array ) {
     63            $plugin_array['narrative'] = plugins_url( 'assets/tiny-plugin.js',
     64                dirname( __FILE__ ) );
     65
     66            return $plugin_array;
     67        } );
     68
     69        add_filter( 'mce_buttons', function ( $buttons ) {
     70            array_push( $buttons, 'dropcap', 'showrecent' );
     71
     72            return $buttons;
     73        } );
    8074    }
    8175
     
    8579    public function add_menu_items() {
    8680
    87         add_menu_page(
    88             esc_html__( 'Narrative', 'narrative-publisher' ),
    89             esc_html__( 'Narrative', 'narrative-publisher' ),
    90             'manage_options',
    91             'narrative',
    92             array(
     81        add_menu_page( esc_html__( 'Narrative', 'narrative-publisher' ),
     82            esc_html__( 'Narrative', 'narrative-publisher' ), 'manage_options',
     83            'narrative', array(
    9384                $this,
    9485                'setting_page',
    95             ),
    96             plugins_url( 'narrative-publisher/assets/narrative-brand-m.svg' ),
    97             99
    98         );
     86            ), plugins_url( 'narrative-so/assets/narrative-brand-m.svg' ), 99 );
    9987
    10088    }
     
    156144        $get_post = sanitize_text_field( $_GET['post'] );
    157145
    158         $post_script = get_post_meta(
    159             $get_post,
    160             'narrative_post_script',
    161             true
    162         );
     146        $post_script = get_post_meta( $get_post, 'narrative_post_script',
     147            TRUE );
    163148
    164149        if ( empty( $post_script ) ) {
     
    181166
    182167        if ( ! current_user_can( 'manage_options' ) ) {
    183             wp_die(
    184                 esc_html__( 'You do not have sufficient permissions to access this page.', 'narrative-publisher' )
    185             );
     168            wp_die( esc_html__( 'You do not have sufficient permissions to access this page.',
     169                'narrative-publisher' ) );
    186170        }
    187171
     
    225209            return;
    226210        }
    227         wp_enqueue_script(
    228             'moment',
     211        wp_enqueue_script( 'moment',
    229212            plugins_url( 'assets/moment.min.js', dirname( __FILE__ ) ),
    230             array( 'jquery' ),
    231             filemtime( plugin_dir_path( dirname( __FILE__ ) ) . 'assets/moment.min.js' ),
    232             true
    233         );
    234 
    235         wp_enqueue_script(
    236             'narrative-admin-script',
    237             plugins_url( 'assets/admin-script.js', dirname( __FILE__ ) ),
    238             array(
     213            array( 'jquery' ), filemtime( plugin_dir_path( dirname( __FILE__ ) )
     214                                          . 'assets/moment.min.js' ), TRUE );
     215
     216        wp_enqueue_script( 'narrative-admin-script',
     217            plugins_url( 'assets/admin-script.js', dirname( __FILE__ ) ), array(
    239218                'jquery',
    240219                'moment',
    241                 'tinymce',
    242             ),
    243             filemtime( plugin_dir_path( dirname( __FILE__ ) ) . 'assets/admin-script.js' ),
    244             true
    245         );
     220            ), filemtime( plugin_dir_path( dirname( __FILE__ ) )
     221                          . 'assets/admin-script.js' ), TRUE );
    246222
    247223    }
     
    285261    }
    286262
     263    /**
     264     * Update option hook
     265     */
     266    public function update_option( $value ) {
     267        if ( ! empty( $_POST['narrative_options']['secret'] ) ) {
     268            set_transient( 'narratibe_update_secret', 'true' );
     269        }
     270
     271        return $value;
     272    }
     273
     274    /**
     275     * Admin notices
     276     */
     277    public function admin_notices() {
     278
     279        if ( get_transient( 'narratibe_update_secret' ) ) {
     280            delete_transient( 'narratibe_update_secret' );
     281            ?>
     282            <div class="notice notice-success is-dismissible">
     283                <p><?php _e( 'Access Key added, please return to Narrative to publish your post',
     284                        'narrative-publisher' ); ?></p>
     285            </div>
     286            <?php
     287        }
     288    }
     289
    287290}
  • narrative-so/trunk/includes/class-autoloader.php

    r2061865 r2152002  
    127127            // replace namespace separators with directory separators
    128128            // in the relative class name, append with .php.
    129             $file = $base_dir . str_replace( '\\', '/', $relative_class ) . '.php';
     129            $file = $base_dir . strtolower( str_replace( '\\', '/', $relative_class ) ) . '.php';
    130130            // if the mapped file exists, require it.
    131             if ( $this->require_file( strtolower( $file ) ) ) {
     131            if ( $this->require_file( $file ) ) {
    132132                // yes, we're done.
    133133                return $file;
  • narrative-so/trunk/narrative-publisher.php

    r2061870 r2152002  
    44Plugin URI:
    55Description:  This plugin connects your website with your Narrative account allowing you to publish your Narrative posts directly to your website. Please contact [email protected] for any help.
    6 Version: 1.0.0
     6Version: 1.0.3
    77Author: Narrative
    88Author URI: https://narrative.so/
  • narrative-so/trunk/readme.txt

    r2061865 r2152002  
    33Tags: narrative, narrative-app, narrative-publisher, narrative-blog-builder
    44Requires at least: 4.7.0
    5 Tested up to: 5.1
     5Tested up to: 5.2
    66Requires PHP: 5.3
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.3
    88License: GPLv2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2323###Installation Video
    2424
    25 Please click [here](https://help.narrative.so/publishing-to-your-website/narrative-and-wordpress/how-to-publish-to-wordpress) for Narrative's installation video.
     25Please click [here](https://help.narrative.so/articles/2766715-how-to-publish-to-wordpress) for Narrative's installation video.
    2626
    2727###From within WordPress
     
    31313. Activate Narrative Publisher from your Plugins page.
    32324. Return to Narrative and input your activation key.
    33 For any issues see this article [here](https://help.narrative.so/publishing-to-your-website/narrative-and-wordpress/how-to-publish-to-wordpress)
     33For any issues see this article [here](https://help.narrative.so/articles/2766715-how-to-publish-to-wordpress)
    3434
    35 ### Manually 
     35### Manually
    3636
    37371. Upload the narrative-publisher.zip to the `/wp-content/plugins/` directory
    38382. Activate the Narrative Publish plugin through the 'Plugins' menu in WordPress
    39393. Return to Narrative and input your activation key.
    40 For any issues see this article [here](https://help.narrative.so/publishing-to-your-website/narrative-and-wordpress/how-to-publish-to-wordpress)
     40For any issues see this article [here](https://help.narrative.so/articles/2766715-how-to-publish-to-wordpress)
    4141
    4242
     
    4646
    4747== Frequently Asked Questions ==
    48 Please see our support docs [here](https://help.narrative.so/publishing-to-your-website/narrative-and-wordpress/how-to-publish-to-wordpress) for help.
     48Please see our support docs [here](https://help.narrative.so/articles/2766715-how-to-publish-to-wordpress) for help.
    4949
    5050
  • narrative-so/trunk/tmpl/admin.php

    r2061865 r2152002  
    4444            <?php if ( ! empty( get_option( 'narrative_last_request' ) ) && is_numeric( get_option( 'narrative_last_request' ) ) ): ?>
    4545                <tr>
    46                     <td colspan="2">
     46                    <td width="150">
    4747                        <?php esc_html_e( 'Last connected', 'narrative-publisher' ); ?>:
    48                         <span class="nar-last-last-request"
    49                               data-val="<?php echo esc_attr( get_option( 'narrative_last_request' ) ); ?>"></span>
     48                    </td>
     49                    <td class="field">
     50                        <?php if ( empty( $admin->general_options( 'secret' ) ) ) : ?>
     51                            <b style="color: red;font-size: 14px;"><?php esc_html_e( 'Not connected. Please paste your access key from your Narrative app', 'narrative-publisher' ); ?></b>
     52                        <?php else: ?>
     53                            <span class="nar-last-last-request"
     54                                  data-val="<?php echo esc_attr( get_option( 'narrative_last_request' ) ); ?>">
     55                            </span>
     56                        <?php endif; ?>
     57
    5058                    </td>
    5159                </tr>
    5260            <?php endif; ?>
     61
     62            <tr>
     63                <td>
     64                    <a target="_blank" href="<?php echo esc_url( 'https://help.narrative.so/articles/2866370-narrative-wordpress-plugin' ); ?>">
     65                        <?php esc_html_e( 'I need help', 'narrative-publisher' ); ?>
     66                    </a>
     67                </td>
     68            </tr>
    5369            </tbody>
    5470        </table>
    5571
     72        <?php
     73        settings_fields( 'narrative_settings' );
     74        submit_button( '', 'button-hero', 'submit', true, '' );
     75
     76        ?>
     77
    5678        <hr>
    57         <?php
    58         settings_fields( 'narrative_settings' );
    59         submit_button( '', 'button-hero', 'submit', true, '' );
    6079
    61         ?>
    62         <a target="_blank"
    63            href="https://help.narrative.so/using-narrative/narrative-wordpress-plugin"><?php esc_html_e( 'Support & documentation', 'narrative-publisher' ); ?></a>
     80        <p style="font-size: 14px;padding-top: 10px;">
     81            <b><?php esc_html_e( 'This WordPress plugin integrates with Narrative\'s desktop app', 'narrative-publisher' ); ?></b>
     82            <br>
     83            <a target="_blank" href="<?php echo esc_url( 'https://my.narrative.so/#/free-trial', 'narrative-publisher' ); ?>">
     84                <?php esc_html_e( 'Click here to sign up', 'narrative-publisher' ); ?>
     85            </a>
     86        </p>
     87
     88
    6489    </form>
    65 </div> 
     90</div>
Note: See TracChangeset for help on using the changeset viewer.