Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit c8a1670

Browse files
1 parent 08a3374 commit c8a1670

File tree

4 files changed

+12
-34
lines changed

4 files changed

+12
-34
lines changed

languages/marker-animation-ja.mo

-148 Bytes
Binary file not shown.

languages/marker-animation-ja.po

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: marker-animation\n"
44
"POT-Creation-Date: 2018-07-01 17:47+0900\n"
5-
"PO-Revision-Date: 2019-03-18 02:26+0900\n"
5+
"PO-Revision-Date: 2019-03-21 05:22+0900\n"
66
"Last-Translator: \n"
77
"Language-Team: \n"
88
"MIME-Version: 1.0\n"
@@ -22,18 +22,9 @@ msgstr "マーカーアニメーション"
2222
msgid "This plugin will add \"Marker animation\" function"
2323
msgstr "このプラグインは「マーカーアニメーション」機能を追加します"
2424

25-
msgid "Dashboard"
26-
msgstr "ダッシュボード"
27-
2825
msgid "Detail Settings"
2926
msgstr "詳細設定"
3027

31-
msgid "Settings updated."
32-
msgstr "設定を更新しました。"
33-
34-
msgid "Reset"
35-
msgstr "リセット"
36-
3728
msgid "validity"
3829
msgstr "有効かどうか"
3930

src/classes/controllers/admin/dashboard.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,19 @@ public function get_page_title() {
4747
protected function post_action() {
4848
/** @var \Marker_Animation\Classes\Models\Assets $assets */
4949
$assets = \Marker_Animation\Classes\Models\Assets::get_instance( $this->app );
50-
foreach ( $assets->get_setting_keys() as $key => $form ) {
51-
$this->update_setting( $key );
50+
if ( $this->app->input->post( 'update' ) ) {
51+
foreach ( $assets->get_setting_details( 'dashboard' ) as $name => $setting ) {
52+
$this->update_setting( $name );
53+
}
54+
$this->app->add_message( 'Settings have been updated.', 'setting' );
55+
} else {
56+
foreach ( $assets->get_setting_details( 'dashboard' ) as $name => $setting ) {
57+
$this->app->option->delete( $this->get_filter_prefix() . $name );
58+
$this->delete_hook_cache( $name );
59+
}
60+
$this->app->add_message( 'Settings have been reset.', 'setting' );
5261
}
5362
$assets->clear_options_cache();
54-
$this->app->add_message( 'Settings updated.', 'setting' );
5563
}
5664

5765
/**

src/views/admin/script/dashboard.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,10 @@
5252
});
5353
$('.marker-setting-preview span').markerAnimation(options);
5454
};
55-
const reset_options = function () {
56-
$target.each(function () {
57-
const name = $(this).attr('name');
58-
if (name && name.match(/^<?php $instance->h( preg_quote( $name_prefix, '/' ) );?>/)) {
59-
let option_value = $(this).data('default');
60-
if ('checkbox' === $(this).attr('type')) {
61-
$(this).prop('checked', option_value);
62-
} else {
63-
$(this).val(option_value);
64-
if ($(this).hasClass('<?php $instance->h( $instance->get_color_picker_class() );?>')) {
65-
$(this).wpColorPicker('color', option_value);
66-
}
67-
}
68-
}
69-
});
70-
setup_options();
71-
};
7255

7356
$target.on('change <?php $instance->h( $instance->app->slug_name . '-' );?>cleared', function () {
7457
setup_options();
7558
});
76-
$('[name="reset"]').on('click', function () {
77-
reset_options();
78-
return false;
79-
});
8059
setup_options();
8160
})(jQuery);
8261
</script>

0 commit comments

Comments
 (0)