Changeset 2237995
- Timestamp:
- 02/03/2020 10:31:21 PM (6 years ago)
- Location:
- narrative-so/trunk
- Files:
-
- 5 edited
-
assets/blocks.js (modified) (6 diffs)
-
includes/class-api.php (modified) (3 diffs)
-
includes/class-handlers.php (modified) (1 diff)
-
narrative-publisher.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
narrative-so/trunk/assets/blocks.js
r2061865 r2237995 8 8 */ 9 9 10 11 10 (function (blocks, editor, i18n, element, components, _) { 12 13 11 14 12 var InspectorControls = wp.editor.InspectorControls; … … 17 15 var Fragment = wp.element.Fragment; 18 16 var __ = i18n.__; 17 var $ = jQuery; 19 18 20 19 var iconEl = el('svg', { width: 18, height: 18 }, 21 el('path', { fill: "#9D9D9D", d: " M15,18 L8,18 L5,18 L5,5 L8,5 L8,15 L15,15 L15,0 L18,0 L18,18 L15,18 Z M10,3 L3,3 L3,18 L0,18 L0,0 L3,0 L13,0 L13,3 L13,13 L10,13 L10,3 Z\" id=\"narrative-colour-25x25"} )20 el('path', { fill: "#9D9D9D", d: "m15,18l-7,0l-3,0l0,-13l3,0l0,10l7,0l0,-15l3,0l0,18l-3,0zm-5,-15l-7,0l0,15l-3,0l0,-18l3,0l10,0l0,3l0,10l-3,0l0,-13",'id':'narrative-colour-25x25' } ) 22 21 ); 23 22 … … 40 39 blocks.registerBlockType('narrative/block', { 41 40 title: __('Narrative', 'narrative-publisher'), 42 //icon: 'welcome-widgets-menus',43 41 icon: iconEl, 44 42 attributes: { … … 52 50 supports: { 53 51 className: false, 54 customClassName: false,55 inserter: false,52 customClassName: true, 53 inserter: true, 56 54 }, 57 55 edit: function (props) { 58 56 59 varattributes = props.attributes;57 let attributes = props.attributes; 60 58 59 if ( ! attributes.narrative_script ){ 60 return el( 61 'b', 62 null, 63 __('It\'s not a narrative post', 'narrative-publisher') 64 ); 65 } 61 66 try { 62 67 … … 65 70 } catch (err) { 66 71 67 console. log('Narrative error: ' + e.name + ":" + e.message + "\n" + e.stack);72 console.error('Narrative error: ' + err.name + ":" + err.message + "\n" + err.stack); 68 73 69 74 } … … 103 108 ) 104 109 ); 105 106 110 return output; 107 111 -
narrative-so/trunk/includes/class-api.php
r2061865 r2237995 22 22 public function __construct() { 23 23 24 add_action( ' parse_query', array( $this, 'init_narrative_rewrite' ), 10, 0 );24 add_action( 'init', array( $this, 'init_narrative_rewrite' ), 10, 0 ); 25 25 add_filter( 'query_vars', array( $this, 'add_query_vars' ), 10, 1 ); 26 26 … … 32 32 public function init_narrative_rewrite() { 33 33 34 global $wp_rewrite;35 34 add_rewrite_rule( '^narrative/?$', 'index.php?narrative=/', 'top' ); 36 35 add_rewrite_rule( '^narrative/info/?$', 'index.php?narrative=info', 'top' ); … … 38 37 add_rewrite_rule( '^narrative/post/([0-9]{1,})/?$', 'index.php?narrative=post&post_id=$matches[1]', 'top' ); 39 38 39 global $wp_rewrite; 40 40 $wp_rewrite->flush_rules( true ); 41 flush_rewrite_rules(); 41 42 42 43 } -
narrative-so/trunk/includes/class-handlers.php
r2061865 r2237995 160 160 */ 161 161 private function set_post( $json_params, $post_id = '' ) { 162 163 $decoded_params = '';164 162 165 163 if ( empty( $json_params ) ) { -
narrative-so/trunk/narrative-publisher.php
r2152002 r2237995 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. 36 Version: 1.0.4 7 7 Author: Narrative 8 8 Author URI: https://narrative.so/ … … 19 19 include_once ABSPATH . 'wp-admin/includes/plugin.php'; 20 20 include_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin.php'; 21 -
narrative-so/trunk/readme.txt
r2152002 r2237995 5 5 Tested up to: 5.2 6 6 Requires PHP: 5.3 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.