Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ jobs:
run: echo "RUNNING=" >> $GITHUB_ENV
if: "! env.GIT_DIFF"

- name: Switch PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v1
if: env.RUNNING
- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand Down Expand Up @@ -108,6 +114,11 @@ jobs:
run: echo "RUNNING=" >> $GITHUB_ENV
if: "! env.GIT_DIFF"

- name: Switch PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v1
- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
if: env.RUNNING1
with:
EXCLUDE_MERGED: 'true'
- name: Switch PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v1
- name: Update dependencies
if: env.RUNNING1
id: update_deps
Expand Down
2 changes: 1 addition & 1 deletion assets/js/src/gutenberg/utils/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const getPanelComponent = (setting, args, formatName, value, stripe) => {
}

// eslint-disable-next-line no-magic-numbers
if (stripe && ['duration', 'delay', 'function', 'repeat'].indexOf(setting.name) >= 0) {
if (stripe && ['duration', 'delay', 'function', 'repeat', 'rtl'].indexOf(setting.name) >= 0) {
return null;
}

Expand Down
6 changes: 6 additions & 0 deletions configs/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
'default' => null,
'comment' => 'repeat',
],
'is_rtl' => [
'type' => 'BIT(1)',
'unsigned' => true,
'default' => null,
'comment' => 'rtl',
],
'padding_bottom' => [
'type' => 'VARCHAR(32)',
'default' => '',
Expand Down
7 changes: 7 additions & 0 deletions configs/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
'type' => 'bool',
'default' => false,
],
'rtl' => [
'label' => 'rtl',
'type' => 'bool',
'default' => function () {
return is_rtl();
},
],
'padding_bottom' => [
'label' => 'padding bottom',
'default' => '.6em',
Expand Down
Binary file modified languages/marker-animation-ja.mo
Binary file not shown.
7 changes: 5 additions & 2 deletions languages/marker-animation-ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ msgid ""
msgstr ""
"Project-Id-Version: marker-animation\n"
"POT-Creation-Date: 2018-07-01 17:47+0900\n"
"PO-Revision-Date: 2019-07-04 02:52+0900\n"
"PO-Revision-Date: 2020-12-05 14:09+0900\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2.3\n"
"X-Generator: Poedit 2.2.4\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: ja\n"
Expand Down Expand Up @@ -67,6 +67,9 @@ msgstr "太文字にするかどうか"
msgid "repeat"
msgstr "繰り返すかどうか"

msgid "rtl"
msgstr "rtlかどうか"

msgid "padding bottom"
msgstr "マーカー位置の調整"

Expand Down
2 changes: 1 addition & 1 deletion src/classes/controllers/admin/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected function filter_detail(
) {
$detail['class'] = 'marker-animation-option';
$detail['attributes']['data-value'] = $this->app->array->get( $detail, 'value' );
$detail['attributes']['data-default'] = $this->app->array->get( $detail, 'default' );
$detail['attributes']['data-default'] = $this->app->utility->value( $this->app->array->get( $detail, 'default' ) );
if ( isset( $option['args']['attributes'] ) ) {
$detail['attributes'] = $option['args']['attributes'];
}
Expand Down
4 changes: 4 additions & 0 deletions src/classes/models/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ public function get_setting_keys() {
'form' => 'input/checkbox',
'nullable' => true,
],
'rtl' => [
'form' => 'input/checkbox',
'nullable' => true,
],
'padding_bottom' => 'input/text',
'is_valid_button_block_editor' => [
'form' => 'input/checkbox',
Expand Down
2 changes: 2 additions & 0 deletions src/classes/models/custom_post/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ private function get_setting_list() {
'is_font_bold' => 'bold',
'is_stripe' => 'stripe',
'is_repeat' => 'repeat',
'is_rtl' => 'rtl',
'padding_bottom' => 'padding_bottom',
'is_valid_button_block_editor' => 'is_valid_button_block_editor',
];
Expand Down Expand Up @@ -273,6 +274,7 @@ private function get_display_callback_target() {
'bold',
'stripe',
'repeat',
'rtl',
'padding_bottom',
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/admin/script/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

if ( 'stripe' === option_name ) {
const readonly = option_value && $( this ).val() !== '';
[ 'duration', 'delay', 'function', 'repeat' ].forEach( function( target ) {
[ 'duration', 'delay', 'function', 'repeat', 'rtl' ].forEach( function( target ) {
$( '#<?php $instance->h( $id_prefix );?>' + target ).prop( 'readonly', readonly ).attr( 'data-readonly', readonly ? 1 : '' );
} );
}
Expand Down
1 change: 1 addition & 0 deletions tests/controllers/admin/test-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public function test_presenter() {
$this->assertContains( 'id="marker_animation-bold"', $contents );
$this->assertContains( 'id="marker_animation-stripe"', $contents );
$this->assertContains( 'id="marker_animation-repeat"', $contents );
$this->assertContains( 'id="marker_animation-rtl"', $contents );
$this->assertContains( 'id="marker_animation-padding_bottom"', $contents );
$this->assertContains( 'name="update"', $contents );
$this->assertContains( 'name="reset"', $contents );
Expand Down
4 changes: 4 additions & 0 deletions tests/models/custom_post/test-setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public function test_output_edit_form() {
$this->assertContains( 'id="marker_animation-timing_function"', $contents );
$this->assertContains( 'id="marker_animation-is_font_bold"', $contents );
$this->assertContains( 'id="marker_animation-is_repeat"', $contents );
$this->assertContains( 'id="marker_animation-is_rtl"', $contents );
$this->assertContains( 'id="marker_animation-padding_bottom"', $contents );
$this->assertContains( 'id="marker_animation-is_stripe"', $contents );
$this->assertContains( 'id="marker_animation-priority"', $contents );
Expand Down Expand Up @@ -195,6 +196,7 @@ public function test_manage_posts_columns() {
$this->assertContains( '<th>stripe</th>', $contents );
$this->assertContains( '<td>default (No)</td>', $contents );
$this->assertContains( '<th>repeat</th>', $contents );
$this->assertContains( '<th>rtl</th>', $contents );
$this->assertContains( '<td>default (No)</td>', $contents );
$this->assertContains( '<th>padding bottom</th>', $contents );
$this->assertContains( '<td>default (.6em)</td>', $contents );
Expand Down Expand Up @@ -293,6 +295,7 @@ public function test_get_settings() {
$this->assertArrayHasKey( 'function', $settings[0]['options'] );
$this->assertArrayHasKey( 'stripe', $settings[0]['options'] );
$this->assertArrayHasKey( 'repeat', $settings[0]['options'] );
$this->assertArrayHasKey( 'rtl', $settings[0]['options'] );
$this->assertArrayHasKey( 'selector', $settings[0]['options'] );
$this->assertArrayHasKey( 'class', $settings[0]['options'] );
$this->assertArrayHasKey( 'fontWeight', $settings[0]['options'] );
Expand Down Expand Up @@ -374,6 +377,7 @@ private static function insert_settings() {
'color' => 'color2',
'delay' => 'delay2',
'is_repeat' => 1,
'is_rtl' => 1,
'is_valid_button_block_editor' => 0,
'priority' => 50,
],
Expand Down