Changeset 2461152
- Timestamp:
- 01/22/2021 07:55:50 PM (4 years ago)
- Location:
- super-reactions
- Files:
-
- 58 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
super-reactions/trunk/admin/assets/dist/css/srea-admin.css
r2457492 r2461152 12 12 } 13 13 14 .srea-admin-wrapper select, .srea-admin-wrapper input { 14 .srea-admin-wrapper select, 15 .srea-admin-wrapper input { 15 16 border-radius: 0; 16 17 } … … 33 34 .srea-admin-main { 34 35 padding: 20px; 36 37 35 38 } 36 39 37 .srea-admin-main .srea-settings-wrapper { 38 display: flex; 39 justify-content: flex-start; 40 flex-wrap: wrap; 40 .srea-admin-main .srea-tabs { 41 border-top: 1px solid #ccc; 42 cursor: pointer; 41 43 } 42 44 43 .srea-admin-main .srea-settings-wrapper .srea-template-selector { 45 .srea-admin-main .srea-tabs .srea-tab { 46 padding: 20px; 47 border-bottom: 1px solid #ccc; 48 border-left: 1px solid #ccc; 49 } 50 51 .srea-admin-main .srea-tabs .srea-tab.active { 52 background-color: #d5edff; 53 font-weight: bold; 54 } 55 56 .srea-admin-main .srea-views { 57 border: 1px solid #ccc; 58 padding-left: 40px; 59 } 60 61 .srea-admin-main .srea-views .srea-template-selector { 44 62 display: flex; 45 63 align-items: center; 46 flex-grow: 1;47 flex-basis: 33%;48 64 } 49 65 50 .srea-admin-main .srea-settings-wrapper .srea-template-selector label { 51 font-weight: bold; 52 padding-right: 5px; 66 .srea-admin-main .srea-views .srea-template-selector label { 67 margin-right: 5px; 68 } 69 70 .srea-admin-main .srea-view.active { 71 display: flex; 72 flex-direction: column; 73 align-items: flex-start; 74 justify-content: space-evenly; 75 flex-wrap: wrap; 76 min-height: 130px; 77 height: 100%; 78 } 79 80 .srea-admin-main .srea-view:not(.active) { 81 display: none; 53 82 } 54 83 -
super-reactions/trunk/admin/assets/dist/css/srea-admin.min.css
r2457492 r2461152 1 #wpcontent{padding-left:0;padding-right:0}.srea-admin-wrapper{display:block;margin:0 auto;max-width:900px;height:100%;background-color:#fff}.srea-admin-wrapper input,.srea-admin-wrapper select{border-radius:0}.srea-admin-header{display:flex;flex-basis:50%;background-color:#fff;box-shadow:1px 1px 5px 2px #ccc;padding:10px;align-items:center}.srea-admin-header .srea-admin-title{text-align:center;flex:1 0 auto;justify-self:center}.srea-admin-main{padding:20px }.srea-admin-main .srea-settings-wrapper{display:flex;justify-content:flex-start;flex-wrap:wrap}.srea-admin-main .srea-settings-wrapper .srea-template-selector{display:flex;align-items:center;flex-grow:1;flex-basis:33%}.srea-admin-main .srea-settings-wrapper .srea-template-selector label{font-weight:700;padding-right:5px}.srea-admin-footer{display:flex;justify-content:flex-end;padding:20px}.srea-button{display:block;padding:10px;border:none}.srea-button.srea-button-primary{background-color:#4a91e2;color:#fff;font-weight:500}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.srea-loader{border:3px solid rgba(200,200,200,.7);border-top:3px solid rgba(66,66,66,.5);border-radius:50%;width:16px;height:16px;margin:3px;animation:spin 1s linear infinite}.srea-badge-success{background-color:#3c932c;color:#fff;padding:6px;text-align:center;line-height:10px;font-size:13px;margin:0 5px}1 #wpcontent{padding-left:0;padding-right:0}.srea-admin-wrapper{display:block;margin:0 auto;max-width:900px;height:100%;background-color:#fff}.srea-admin-wrapper input,.srea-admin-wrapper select{border-radius:0}.srea-admin-header{display:flex;flex-basis:50%;background-color:#fff;box-shadow:1px 1px 5px 2px #ccc;padding:10px;align-items:center}.srea-admin-header .srea-admin-title{text-align:center;flex:1 0 auto;justify-self:center}.srea-admin-main{padding:20px}.srea-admin-footer{display:flex;justify-content:flex-end;padding:20px}.srea-button{display:block;padding:10px;border:none}.srea-button.srea-button-primary{background-color:#4a91e2;color:#fff;font-weight:500}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.srea-loader{border:3px solid rgba(200,200,200,.7);border-top:3px solid rgba(66,66,66,.5);border-radius:50%;width:16px;height:16px;margin:3px;animation:spin 1s linear infinite}.srea-badge-success{background-color:#3c932c;color:#fff;padding:6px;text-align:center;line-height:10px;font-size:13px;margin:0 5px} -
super-reactions/trunk/admin/assets/dist/js/srea-admin.js
r2457492 r2461152 4 4 var nonce = document.getElementById('_wpnonce'); 5 5 var $selects = document.querySelectorAll('select'); 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 6 22 $selects.forEach(function (element) { 7 23 element.addEventListener('change', sreaSaveSettings); -
super-reactions/trunk/admin/assets/dist/js/srea-admin.min.js
r2457492 r2461152 1 "use strict";document.addEventListener("DOMContentLoaded",function(e){var n=document.getElementById("_wpnonce");function t(d){var e,o=((e=document.createElement("div")).className="srea-loader",e);d.target.insertAdjacentElement("afterend",o);var t=new FormData;t.append("action","srea_save_settings"),t.append("nonce",n.value),t.append("option",d.target.name),t.append("value",d.target.value),fetch(ajaxurl,{method:"POST",body:t}).then(function(e){return e.json()}).then(function(e){d.target.parentNode.removeChild(o);var t,n,a,r=(t=e.success,n=e.data.results,(a=document.createElement("div")).className=t?"srea-badge-success":"srea-badge-error",a.textContent=n,a);d.target.insertAdjacentElement("afterend",r),setTimeout(function(){d.target.parentNode.removeChild(r)},500)})}document.querySelectorAll("select").forEach(function(e){e.addEventListener("change",t)})});1 "use strict";document.addEventListener("DOMContentLoaded",function(e){var )})}); -
super-reactions/trunk/admin/class-init.php
r2457492 r2461152 2 2 3 3 namespace SREA\Admin; 4 5 use SREA\Includes\Functions;6 4 7 5 class Init { … … 39 37 'manage_options', 40 38 'super-reactions', 41 array( $this, 'renbder_settings_page' ),39 array( , 'renbder_settings_page' ), 42 40 'dashicons-smiley', 43 41 28 … … 45 43 } 46 44 47 public function renbder_settings_page() {48 ?>49 <div class="srea-admin-wrapper">50 <div class="srea-admin-header">51 <div class="srea-logo">52 <?php srea_logo( 100, 100 ); ?>53 </div>54 <div class="srea-admin-title">55 <h1><?php esc_html_e( 'Super Reactions', 'super-reactions' ); ?></h1>56 </div>57 </div>58 <div class="srea-admin-main">59 <section class="srea-settings">60 <h2><?php esc_html_e( 'Templates:', 'super-reactions' ); ?></h2>61 <?php $this->template_selector(); ?>62 <?php wp_nonce_field('srea_save_settings'); ?>63 </section>64 </div>65 </div>66 <?php67 }68 69 public function template_selector() {70 ?>71 <div class="srea-settings-wrapper">72 <?php73 $args = array(74 'public' => true,75 );76 77 $post_types = get_post_types( $args );78 79 // remove attachment from the list80 unset( $post_types['attachment'] );81 82 foreach ( $post_types as $post_type ) {83 $this->render_setting_row( $post_type );84 }85 86 ?>87 </div>88 <?php89 }90 91 private function render_setting_row( $post_type ) {92 $reactions = srea_reactions();93 ?>94 <div class="srea-template-selector">95 <label for="srea-template-selector-<?php echo esc_attr( $post_type ); ?>"><?php echo ucfirst( $post_type ) . ':'; ?></label>96 <select name="<?php echo esc_attr( $post_type ); ?>" id="srea-template-selector-<?php echo esc_attr( $post_type ); ?>">97 <option value="0"><?php esc_html_e( 'Disable', 'super-reactions' ); ?></option>98 <?php foreach ( $reactions as $slug => $reaction ) : ?>99 <?php $selected = srea_get_active_template_slug( $post_type ) === $slug ? 'selected' : ''; ?>100 <option value="<?php echo esc_attr( $slug ); ?>" <?php echo esc_attr( $selected ); ?> ><?php echo esc_html( $reaction['name'] ); ?></option>101 <?php endforeach; ?>102 </select>103 </div>104 105 <?php106 }107 108 45 } -
super-reactions/trunk/constants.php
r2457501 r2461152 6 6 define( 'SREA_URL', plugin_dir_url( __FILE__ ) ); 7 7 8 define( 'SREA_VERSION', '1. 1.1' );8 define( 'SREA_VERSION', '1.' ); 9 9 define( 'SREA_SLUG', 'super_reactions' ); 10 10 -
super-reactions/trunk/includes/ajax.php
r2457492 r2461152 1 1 <?php 2 2 3 namespace SREA\Includes;4 5 use SREA\Includes\Functions;6 3 use SREA\Includes\DB; 7 4 8 add_action( 'wp_ajax_srea_handle_post_reactions', ' SREA\Includes\srea_handle_post_reactions' );9 add_action( 'wp_ajax_nopriv_srea_handle_post_reactions', ' SREA\Includes\srea_handle_post_reactions' );5 add_action( 'wp_ajax_srea_handle_post_reactions', 'srea_handle_post_reactions' ); 6 add_action( 'wp_ajax_nopriv_srea_handle_post_reactions', 'srea_handle_post_reactions' ); 10 7 11 8 function srea_handle_post_reactions() { -
super-reactions/trunk/includes/hooks.php
r2457492 r2461152 1 1 <?php 2 2 3 namespace SREA\Includes; 4 5 use SREA\Includes\Functions; 6 7 add_action( 'the_content', 'SREA\Includes\srea_add_reaction_buttons' ); 3 add_action( 'the_content', 'srea_add_reaction_buttons' ); 8 4 9 5 function srea_add_reaction_buttons( $content ) { -
super-reactions/trunk/languages/super-reactions.pot
r2457492 r2461152 24 24 msgstr "" 25 25 26 #: admin/class-init.php:3 7, admin/class-init.php:5526 #: admin/class-init.php:3 27 27 msgid "Super Reactions" 28 28 msgstr "" 29 29 30 #: admin/class-init.php:3 830 #: admin/class-init.php:3 31 31 msgid "Reactions" 32 32 msgstr "" 33 33 34 #: admin/class-init.php:60 35 msgid "Templates:" 36 msgstr "" 37 38 #: admin/class-init.php:97 34 #: admin/class-settings-view.php:118 39 35 msgid "Disable" 40 36 msgstr "" 41 37 42 #: includes/ajax.php:1 538 #: includes/ajax.php:1 43 39 msgid "Cheatin’ uh?" 44 40 msgstr "" 45 41 46 #: includes/ajax.php:2 742 #: includes/ajax.php:2 47 43 msgid "Reaction is not set!" 48 44 msgstr "" 49 45 50 #: includes/ajax.php:5 946 #: includes/ajax.php:5 51 47 msgid "Reaction successfully added!" 52 48 msgstr "" -
super-reactions/trunk/readme.txt
r2457501 r2461152 6 6 Tested up to: 5.6 7 7 Requires PHP: 7.0 8 Stable tag: 1. 1.18 Stable tag: 1. 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 16 16 Show like button, heart, dislike, and more to get user reactions about your post and page content. 17 17 18 Next Update will includes:19 WooCommerce support,20 Code improvements,21 More reaction templates22 18 23 19 == Installation == … … 26 22 27 23 == Changelog == 24 25 26 27 28 28 29 29 30 = 1.1.0 = -
super-reactions/trunk/super-reactions.php
r2457501 r2461152 4 4 * Plugin Name: Super Reactions 5 5 * Description: Get meaningful reactions from users. 6 * Version: 1. 1.16 * Version: 1. 7 7 * Author: Super Reactions Team 8 8 * Text Domain: super-reactions -
super-reactions/trunk/vendor/composer/autoload_classmap.php
r2457501 r2461152 9 9 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 10 10 'SREA\\Admin\\Init' => $baseDir . '/admin/class-init.php', 11 11 12 'SREA\\Front\\Init' => $baseDir . '/front/class-init.php', 12 13 'SREA\\Includes\\Assets' => $baseDir . '/includes/class-assets.php', -
super-reactions/trunk/vendor/composer/autoload_files.php
r2457492 r2461152 9 9 'd7087685a66a9bc40ee207a689b61d6b' => $baseDir . '/constants.php', 10 10 '70a45127863dbbb616c2a8b70b9bc6f5' => $baseDir . '/admin/ajax.php', 11 '957270c1e830953d8ce3586b81de9f3a' => $baseDir . '/includes/functions/functions.php', 12 '4954a77bb950b640e6ac002ba8f822f6' => $baseDir . '/includes/functions/helpers.php', 13 'ffa574e6669511294870b99740f6e44d' => $baseDir . '/includes/functions/templates.php', 11 '462d07df95f71469646362e2e6f3dc43' => $baseDir . '/includes/functions.php', 12 '2714ac37e9e0bc82316f0c7b5450fe68' => $baseDir . '/includes/templates.php', 14 13 '77480ddb9859d9f3c791246cfc990e2e' => $baseDir . '/includes/hooks.php', 15 14 '3426d36287fe85bae7001c4d7404d49d' => $baseDir . '/includes/ajax.php', -
super-reactions/trunk/vendor/composer/autoload_static.php
r2457501 r2461152 10 10 'd7087685a66a9bc40ee207a689b61d6b' => __DIR__ . '/../..' . '/constants.php', 11 11 '70a45127863dbbb616c2a8b70b9bc6f5' => __DIR__ . '/../..' . '/admin/ajax.php', 12 '957270c1e830953d8ce3586b81de9f3a' => __DIR__ . '/../..' . '/includes/functions/functions.php', 13 '4954a77bb950b640e6ac002ba8f822f6' => __DIR__ . '/../..' . '/includes/functions/helpers.php', 14 'ffa574e6669511294870b99740f6e44d' => __DIR__ . '/../..' . '/includes/functions/templates.php', 12 '462d07df95f71469646362e2e6f3dc43' => __DIR__ . '/../..' . '/includes/functions.php', 13 '2714ac37e9e0bc82316f0c7b5450fe68' => __DIR__ . '/../..' . '/includes/templates.php', 15 14 '77480ddb9859d9f3c791246cfc990e2e' => __DIR__ . '/../..' . '/includes/hooks.php', 16 15 '3426d36287fe85bae7001c4d7404d49d' => __DIR__ . '/../..' . '/includes/ajax.php', … … 21 20 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 22 21 'SREA\\Admin\\Init' => __DIR__ . '/../..' . '/admin/class-init.php', 22 23 23 'SREA\\Front\\Init' => __DIR__ . '/../..' . '/front/class-init.php', 24 24 'SREA\\Includes\\Assets' => __DIR__ . '/../..' . '/includes/class-assets.php',
Note: See TracChangeset
for help on using the changeset viewer.