Plugin Directory

Changeset 2100104


Ignore:
Timestamp:
06/04/2019 02:18:15 AM (7 years ago)
Author:
kmix39
Message:

1.1.0 bug fix

Location:
notwiz-ruby-text/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • notwiz-ruby-text/trunk/App/Common/Text_Domain.php

    r2065446 r2100104  
    1717            $_settings_plugin->text_domain,
    1818            false,
    19             $_settings_plugin->plugin_dir_path . $_settings_plugin->domain_path
     19            basename( $_settings_plugin->dir_path ) . $_settings_plugin->domain_path
    2020        );
    21        
    2221    }
    2322
    24     public static function _load_textdomain_mofile( $_mofile, $_domain ) {
     23    public static function _load_textdomain_mofile( $_mo_file, $_domain ) {
    2524        $_settings_plugin = Settings\Plugin::_instance();
    2625        if ( $_settings_plugin->text_domain === $_domain ) {
    27             $_mofilename   = basename( $_mofile );
    28             $_local_mofile = $_settings_plugin->plugin_dir_path . $_settings_plugin->domain_path . '/' . $_mofilename;
    29             if ( file_exists( $_local_mofile ) ) {
    30                 return $_local_mofile;
     26            $_mo_file_name   = basename( $_mo_file );
     27            $_local_mo_file = $_settings_plugin->dir_path . $_settings_plugin->domain_path . '/' . $_mo_file_name;
     28            if ( is_file( $_local_mo_file ) ) {
     29                return $_local_mo_file;
    3130            }
    3231        }
    33         return $_mofile;
     32        return $_mo_file;
    3433    }
    3534
  • notwiz-ruby-text/trunk/App/Controller/Editor.php

    r2065446 r2100104  
    22namespace NotWiz_Ruby_Text\App\Controller;
    33
    4 use NotWiz_Ruby_Text\App\Common;
    54use NotWiz_Ruby_Text\App\Settings;
    65
     
    87
    98    function __construct() {
    10         add_action( 'enqueue_block_editor_assets', [ __CLASS__, '_enqueue_block_editor_assets' ] );
     9        add_action(
     10            'enqueue_block_editor_assets',
     11            [ __CLASS__, '_enqueue_block_editor_assets' ]
     12        );
    1113    }
    1214
     
    1517        wp_enqueue_script(
    1618            'notwiz-ruby-text-editor',
    17             $_settings_plugin->plugin_dir_url . '/dist/js/notwiz-ruby-text-build.js',
     19            $_settings_plugin->dir_url . '/build/js/notwiz-ruby-text.min.js',
    1820            [
    1921                'wp-blocks',
     
    2123                'wp-i18n',
    2224            ],
    23             filemtime( $_settings_plugin->plugin_dir_path . '/dist/js/notwiz-ruby-text-build.js' ),
     25            $_settings_plugin->version,
    2426            true
    2527        );
    2628        wp_enqueue_style(
    2729            'notwiz-ruby-text-editor',
    28             $_settings_plugin->plugin_dir_url . '/dist/css/notwiz-ruby-text.min.css',
     30            $_settings_plugin->dir_url . '/build/css/notwiz-ruby-text.min.css',
    2931            [
    3032            ],
    31             filemtime( $_settings_plugin->plugin_dir_path . '/dist/css/notwiz-ruby-text.min.css' )
     33            $_settings_plugin->version
    3234        );
    33         if ( function_exists( 'wp_set_script_translations' ) ) {
    34             wp_set_script_translations(
    35                 'notwiz-ruby-text-editor',
    36                 $_settings_plugin->text_domain,
    37                 $_settings_plugin->plugin_dir_path . $_settings_plugin->domain_path
    38             );
    39         } elseif ( function_exists( 'gutenberg_get_jed_locale_data' ) ) {
    40             $_locale  = gutenberg_get_jed_locale_data( $_settings_plugin->text_domain );
    41             $_content = 'wp.i18n.setLocaleData( ' . json_encode( $_locale ) . ', "' . $_settings_plugin->text_domain . '" );';
    42             wp_add_inline_script(
    43                 'notwiz-ruby-text-editor',
    44                 'data',
    45                 $_content
    46             );
    47         }
     35        wp_set_script_translations(
     36            'notwiz-ruby-text-editor',
     37            $_settings_plugin->text_domain,
     38            $_settings_plugin->dir_path . $_settings_plugin->domain_path
     39        );
    4840    }
    4941
  • notwiz-ruby-text/trunk/App/Settings/Plugin.php

    r2065446 r2100104  
    2727
    2828    function _init_settings( $_info_settings = [] ) {
    29         $this->plugin_root_file = $_info_settings[ 'root_file' ];
    30         $this->plugin_dir_url  = untrailingslashit( plugin_dir_url( $_info_settings[ 'root_file' ] ) );
    31         $this->plugin_dir_path = untrailingslashit( plugin_dir_path( $_info_settings[ 'root_file' ] ) );
    32 
    33         $this->plugin_name = $_info_settings[ 'plugin_name' ];
    34         $this->version = $_info_settings[ 'version' ];
     29        $this->root_file = $_info_settings[ 'root_file' ];
     30        $this->dir_url   = untrailingslashit( plugin_dir_url( $_info_settings[ 'root_file' ] ) );
     31        $this->dir_path = untrailingslashit( plugin_dir_path( $_info_settings[ 'root_file' ] ) );
     32        $this->name        = $_info_settings[ 'plugin_name' ];
     33        $this->description = $_info_settings[ 'description' ];
     34        $this->version     = $_info_settings[ 'version' ];
    3535        $this->php_version = $_info_settings[ 'php_version' ];
    3636        $this->text_domain = $_info_settings[ 'text_domain' ];
    3737        $this->domain_path = $_info_settings[ 'domain_path' ];
     38        $this->author      = $_info_settings[ 'author' ];
     39        $this->author_uri  = $_info_settings[ 'author_uri' ];
     40        $this->license     = $_info_settings[ 'license' ];
     41        $this->license_uri = $_info_settings[ 'license_uri' ];
    3842    }
    3943
  • notwiz-ruby-text/trunk/Readme.txt

    r2065446 r2100104  
    22Contributors: kmix39
    33Tags: gutenberg, block, blocks, editor, gutenberg blocks, Ruby Text, RichText
    4 Requires at least: 5.1
    5 Tested up to: 5.1.1
    6 Stable tag: 0.1.1
     4Requires at least: 5.2
     5Tested up to: 5.2.1
     6Stable tag: 1.1.0
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4646== Changelog ==
    4747
     48= 1.1.0 =
     49* Bug fix.
     50
    4851= 0.1.1 =
    4952* Initial release.
  • notwiz-ruby-text/trunk/languages/notwiz-ruby-text-ja-notwiz-ruby-text-editor.json

    r2065446 r2100104  
    1 {"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja_JP"},"Ruby Parentheses":["ルビの括弧"],"Ruby Text":["ルビのテキスト"],"Ruby":["ルビ"],"Choose a string to decorate ruby text":["ルビテキストを装飾する文字列を選択してください"],"Can not select the last character in the text to decorate ruby text":["テキストの最終文字は、ルビテキストの装飾に選択できません"],"The decoration may have already been removed":["装飾は既に削除されている可能性があります"],"Ruby text has not been entered":["ルビテキストが入力されていません"],"Enter ruby text":["ルビのテキストを入力"],"Apply":["適用"],"Warning":["警告"],"NotWiz Ruby Text":["NotWiz Ruby Text"],"Ruby Text for Gutenberg Block Editor":["ブロックエディター用のルビテキスト"],"kmix39":["kmix39"],"https://not-wiz.net/":["https://not-wiz.net/"]}}}
     1{"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja_JP"},"Ruby Parentheses":["ルビの括弧"],"Ruby Text":["ルビのテキスト"],"Ruby":["ルビ"],"Choose a string to decorate ruby text":["ルビテキストを装飾する文字列を選択してください"],"Can not select the last character in the text to decorate ruby text":["現在のバージョンでは、ルビテキストの装飾にテキストの最終文字を選択できません"],"The decoration may have already been removed":["装飾は既に削除されている可能性があります"],"Enter ruby text":["ルビのテキストを入力"],"Apply":["適用"],"Warning":["警告"],"NotWiz Ruby Text":["NotWiz Ruby Text"],"Ruby Text for Block Editor(Gutenberg)":["ブロックエディター(Gutenberg)用のルビテキスト"],"kmix39":["kmix39"],"https://not-wiz.net":["https://not-wiz.net"]}}}
  • notwiz-ruby-text/trunk/notwiz-ruby-text.php

    r2065446 r2100104  
    22/**
    33 * Plugin Name: NotWiz Ruby Text
    4  * Description: Ruby Text for Gutenberg Block Editor
    5  * Version: 0.1.1
     4 * Description: Ruby Text for Block Editor(Gutenberg)
     5 * Version: 1.1.0
    66 * PHP Version: 7.0.0
    77 * Text Domain: notwiz-ruby-text
    88 * Domain Path: /languages
    99 * Author: kmix39
    10  * Author URI: https://not-wiz.net/
     10 * Author URI: https://not-wiz.net
    1111 * License: GPLv2 or later
    1212 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3434            [
    3535                'plugin_name' => 'Plugin Name',
     36                'description' => 'Description',
    3637                'version'     => 'Version',
    3738                'php_version' => 'PHP Version',
    3839                'text_domain' => 'Text Domain',
    3940                'domain_path' => 'Domain Path',
     41                'author'      => 'Author',
     42                'author_uri'  => 'Author URI',
     43                'license'     => 'License',
     44                'license_uri' => 'License URI',
    4045            ]
    4146        );
     
    5257}
    5358
    54 require_once( __DIR__ . '/App/Common/Editor.php' );
    5559require_once( __DIR__ . '/App/Common/Text_Domain.php' );
    5660require_once( __DIR__ . '/App/Controller/Editor.php' );
Note: See TracChangeset for help on using the changeset viewer.