Changeset 2152002
- Timestamp:
- 09/05/2019 09:52:56 PM (6 years ago)
- Location:
- narrative-so/trunk
- Files:
-
- 6 edited
-
assets/admin-script.js (modified) (1 diff)
-
includes/class-admin.php (modified) (7 diffs)
-
includes/class-autoloader.php (modified) (1 diff)
-
narrative-publisher.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
tmpl/admin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
narrative-so/trunk/assets/admin-script.js
r2061865 r2152002 8 8 }); 9 9 10 if (!$wrap.find('#access_key').val()) { 11 $wrap.find('#access_key').addClass('empty'); 12 } 13 10 14 $wrap.find('[name="submit"]').on('click', function () { 15 16 if ( $wrap.find('#access_key').hasClass('empty') ) { 17 return true; 18 } 11 19 12 20 if (!window.confirm($('#access_key').data('notice'))) { -
narrative-so/trunk/includes/class-admin.php
r2061865 r2152002 35 35 add_action( 'init', array( &$this, 'add_tiny_plugin' ) ); 36 36 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' ) ); 39 41 40 42 add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue' ) ); 41 43 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' ) ); 52 55 } 53 56 … … 57 60 public function add_tiny_plugin() { 58 61 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 } ); 80 74 } 81 75 … … 85 79 public function add_menu_items() { 86 80 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( 93 84 $this, 94 85 '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 ); 99 87 100 88 } … … 156 144 $get_post = sanitize_text_field( $_GET['post'] ); 157 145 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 ); 163 148 164 149 if ( empty( $post_script ) ) { … … 181 166 182 167 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' ) ); 186 170 } 187 171 … … 225 209 return; 226 210 } 227 wp_enqueue_script( 228 'moment', 211 wp_enqueue_script( 'moment', 229 212 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( 239 218 'jquery', 240 219 '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 ); 246 222 247 223 } … … 285 261 } 286 262 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 287 290 } -
narrative-so/trunk/includes/class-autoloader.php
r2061865 r2152002 127 127 // replace namespace separators with directory separators 128 128 // 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'; 130 130 // if the mapped file exists, require it. 131 if ( $this->require_file( strtolower( $file )) ) {131 if ( $this->require_file( $file ) ) { 132 132 // yes, we're done. 133 133 return $file; -
narrative-so/trunk/narrative-publisher.php
r2061870 r2152002 4 4 Plugin URI: 5 5 Description: 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. 06 Version: 1.0.3 7 7 Author: Narrative 8 8 Author URI: https://narrative.so/ -
narrative-so/trunk/readme.txt
r2061865 r2152002 3 3 Tags: narrative, narrative-app, narrative-publisher, narrative-blog-builder 4 4 Requires at least: 4.7.0 5 Tested up to: 5. 15 Tested up to: 5.2 6 6 Requires PHP: 5.3 7 Stable tag: 1.0. 07 Stable tag: 1.0.3 8 8 License: GPLv2 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 23 23 ###Installation Video 24 24 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.25 Please click [here](https://help.narrative.so/articles/2766715-how-to-publish-to-wordpress) for Narrative's installation video. 26 26 27 27 ###From within WordPress … … 31 31 3. Activate Narrative Publisher from your Plugins page. 32 32 4. 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)33 For any issues see this article [here](https://help.narrative.so/articles/2766715-how-to-publish-to-wordpress) 34 34 35 ### Manually 35 ### Manually 36 36 37 37 1. Upload the narrative-publisher.zip to the `/wp-content/plugins/` directory 38 38 2. Activate the Narrative Publish plugin through the 'Plugins' menu in WordPress 39 39 3. 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)40 For any issues see this article [here](https://help.narrative.so/articles/2766715-how-to-publish-to-wordpress) 41 41 42 42 … … 46 46 47 47 == 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.48 Please see our support docs [here](https://help.narrative.so/articles/2766715-how-to-publish-to-wordpress) for help. 49 49 50 50 -
narrative-so/trunk/tmpl/admin.php
r2061865 r2152002 44 44 <?php if ( ! empty( get_option( 'narrative_last_request' ) ) && is_numeric( get_option( 'narrative_last_request' ) ) ): ?> 45 45 <tr> 46 <td colspan="2">46 <td width="150"> 47 47 <?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 50 58 </td> 51 59 </tr> 52 60 <?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> 53 69 </tbody> 54 70 </table> 55 71 72 <?php 73 settings_fields( 'narrative_settings' ); 74 submit_button( '', 'button-hero', 'submit', true, '' ); 75 76 ?> 77 56 78 <hr> 57 <?php58 settings_fields( 'narrative_settings' );59 submit_button( '', 'button-hero', 'submit', true, '' );60 79 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 64 89 </form> 65 </div> 90 </div>
Note: See TracChangeset
for help on using the changeset viewer.