This repository was archived by the owner on Aug 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +12
-34
lines changed
classes/controllers/admin Expand file tree Collapse file tree 4 files changed +12
-34
lines changed Original file line number Diff line number Diff line change 22msgstr ""
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 "マーカーアニメーション"
2222msgid "This plugin will add \" Marker animation\" function"
2323msgstr "このプラグインは「マーカーアニメーション」機能を追加します"
2424
25- msgid "Dashboard"
26- msgstr "ダッシュボード"
27-
2825msgid "Detail Settings"
2926msgstr "詳細設定"
3027
31- msgid "Settings updated."
32- msgstr "設定を更新しました。"
33-
34- msgid "Reset"
35- msgstr "リセット"
36-
3728msgid "validity"
3829msgstr "有効かどうか"
3930
Original file line number Diff line number Diff 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 /**
Original file line number Diff line number Diff line change 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>
You can’t perform that action at this time.
0 commit comments