Plugin Directory

Changeset 2461152

Timestamp:
01/22/2021 07:55:50 PM (4 years ago)
Author:
h71
Message:

version-1.2.0

Location:
super-reactions
Files:
58 added
14 edited

Legend:

Unmodified
Added
Removed
  • super-reactions/trunk/admin/assets/dist/css/srea-admin.css

    r2457492 r2461152  
    1212}
    1313
    14 .srea-admin-wrapper select, .srea-admin-wrapper input {
     14.srea-admin-wrapper select,
     15.srea-admin-wrapper input {
    1516  border-radius: 0;
    1617}
     
    3334.srea-admin-main {
    3435  padding: 20px;
     36
     37
    3538}
    3639
    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;
    4143}
    4244
    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 {
    4462  display: flex;
    4563  align-items: center;
    46   flex-grow: 1;
    47   flex-basis: 33%;
    4864}
    4965
    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;
    5382}
    5483
  • 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  
    44  var nonce = document.getElementById('_wpnonce');
    55  var $selects = document.querySelectorAll('select');
     6
     7
     8
     9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
    622  $selects.forEach(function (element) {
    723    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  
    22
    33namespace SREA\Admin;
    4 
    5 use SREA\Includes\Functions;
    64
    75class Init {
     
    3937            'manage_options',
    4038            'super-reactions',
    41             array( $this, 'renbder_settings_page' ),
     39            array( , 'renbder_settings_page' ),
    4240            'dashicons-smiley',
    4341            28
     
    4543    }
    4644
    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         <?php
    67     }
    68 
    69     public function template_selector() {
    70         ?>
    71         <div class="srea-settings-wrapper">
    72         <?php
    73         $args = array(
    74             'public' => true,
    75         );
    76 
    77         $post_types = get_post_types( $args );
    78 
    79         // remove attachment from the list
    80         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         <?php
    89     }
    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         <?php
    106     }
    107 
    10845}
  • super-reactions/trunk/constants.php

    r2457501 r2461152  
    66define( 'SREA_URL', plugin_dir_url( __FILE__ ) );
    77
    8 define( 'SREA_VERSION', '1.1.1' );
     8define( 'SREA_VERSION', '1.' );
    99define( 'SREA_SLUG', 'super_reactions' );
    1010
  • super-reactions/trunk/includes/ajax.php

    r2457492 r2461152  
    11<?php
    22
    3 namespace SREA\Includes;
    4 
    5 use SREA\Includes\Functions;
    63use SREA\Includes\DB;
    74
    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' );
     5add_action( 'wp_ajax_srea_handle_post_reactions', 'srea_handle_post_reactions' );
     6add_action( 'wp_ajax_nopriv_srea_handle_post_reactions', 'srea_handle_post_reactions' );
    107
    118function srea_handle_post_reactions() {
  • super-reactions/trunk/includes/hooks.php

    r2457492 r2461152  
    11<?php
    22
    3 namespace SREA\Includes;
    4 
    5 use SREA\Includes\Functions;
    6 
    7 add_action( 'the_content', 'SREA\Includes\srea_add_reaction_buttons' );
     3add_action( 'the_content', 'srea_add_reaction_buttons' );
    84
    95function srea_add_reaction_buttons( $content ) {
  • super-reactions/trunk/languages/super-reactions.pot

    r2457492 r2461152  
    2424msgstr ""
    2525
    26 #: admin/class-init.php:37, admin/class-init.php:55
     26#: admin/class-init.php:3
    2727msgid "Super Reactions"
    2828msgstr ""
    2929
    30 #: admin/class-init.php:38
     30#: admin/class-init.php:3
    3131msgid "Reactions"
    3232msgstr ""
    3333
    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
    3935msgid "Disable"
    4036msgstr ""
    4137
    42 #: includes/ajax.php:15
     38#: includes/ajax.php:1
    4339msgid "Cheatin’ uh?"
    4440msgstr ""
    4541
    46 #: includes/ajax.php:27
     42#: includes/ajax.php:2
    4743msgid "Reaction is not set!"
    4844msgstr ""
    4945
    50 #: includes/ajax.php:59
     46#: includes/ajax.php:5
    5147msgid "Reaction successfully added!"
    5248msgstr ""
  • super-reactions/trunk/readme.txt

    r2457501 r2461152  
    66Tested up to: 5.6
    77Requires PHP: 7.0
    8 Stable tag: 1.1.1
     8Stable tag: 1.
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1616Show like button, heart, dislike, and more to get user reactions about your post and page content.
    1717
    18 Next Update will includes:
    19 WooCommerce support,
    20 Code improvements,
    21 More reaction templates
    2218
    2319== Installation ==
     
    2622
    2723== Changelog ==
     24
     25
     26
     27
     28
    2829
    2930= 1.1.0 =
  • super-reactions/trunk/super-reactions.php

    r2457501 r2461152  
    44 * Plugin Name: Super Reactions
    55 * Description: Get meaningful reactions from users.
    6  * Version:     1.1.1
     6 * Version:     1.
    77 * Author:      Super Reactions Team
    88 * Text Domain: super-reactions
  • super-reactions/trunk/vendor/composer/autoload_classmap.php

    r2457501 r2461152  
    99    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    1010    'SREA\\Admin\\Init' => $baseDir . '/admin/class-init.php',
     11
    1112    'SREA\\Front\\Init' => $baseDir . '/front/class-init.php',
    1213    'SREA\\Includes\\Assets' => $baseDir . '/includes/class-assets.php',
  • super-reactions/trunk/vendor/composer/autoload_files.php

    r2457492 r2461152  
    99    'd7087685a66a9bc40ee207a689b61d6b' => $baseDir . '/constants.php',
    1010    '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',
    1413    '77480ddb9859d9f3c791246cfc990e2e' => $baseDir . '/includes/hooks.php',
    1514    '3426d36287fe85bae7001c4d7404d49d' => $baseDir . '/includes/ajax.php',
  • super-reactions/trunk/vendor/composer/autoload_static.php

    r2457501 r2461152  
    1010        'd7087685a66a9bc40ee207a689b61d6b' => __DIR__ . '/../..' . '/constants.php',
    1111        '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',
    1514        '77480ddb9859d9f3c791246cfc990e2e' => __DIR__ . '/../..' . '/includes/hooks.php',
    1615        '3426d36287fe85bae7001c4d7404d49d' => __DIR__ . '/../..' . '/includes/ajax.php',
     
    2120        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    2221        'SREA\\Admin\\Init' => __DIR__ . '/../..' . '/admin/class-init.php',
     22
    2323        'SREA\\Front\\Init' => __DIR__ . '/../..' . '/front/class-init.php',
    2424        'SREA\\Includes\\Assets' => __DIR__ . '/../..' . '/includes/class-assets.php',
Note: See TracChangeset for help on using the changeset viewer.