Plugin Directory

Changeset 2018853


Ignore:
Timestamp:
01/25/2019 05:56:37 AM (7 years ago)
Author:
namncn
Message:

add color option

Location:
hotline-phone-ring/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • hotline-phone-ring/trunk/assets/css/style-1.css

    r1997649 r2018853  
    4343    width: 55px;
    4444  height: 55px;
    45   top: 26px;
    46   left: 26px;
     45  top: 25px;
     46  left: 25px;
    4747  position: absolute;
    4848  background-color: rgba(230, 8, 8, 0.7);
     
    9494.hotline-bar {
    9595  position: absolute;
    96   background: #E88A25;
    97   background: -webkit-linear-gradient(left, #e88a25, #d40000);
    98   background: -o-linear-gradient(right, #e88a25, #d40000);
    99   background: -moz-linear-gradient(right, #e88a25, #d40000);
    100   background: linear-gradient(to right, #e88a25, #d40000);
     96  background: rgba(230, 8, 8, 0.75);
    10197  height: 40px;
    10298  width: 200px;
     
    111107  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.1);
    112108  border-radius: 50px !important;
    113   border: 2px solid white;
    114109  /* width: 175px !important; */
    115110  left: 33px;
     
    125120  display: block;
    126121  letter-spacing: 1px;
    127   line-height: 38px;
     122  line-height: 40px;
    128123  font-family: Arial;
    129124}
  • hotline-phone-ring/trunk/hotline-phone-ring.php

    r1997649 r2018853  
    44 * Plugin URI: https://namncn.com/plugins/hotline-phone-ring/
    55 * Description: Fixed Hotline on the screen.
    6  * Version: 2.0.2
     6 * Version: 2.0.3
    77 * Author: Nam Truong
    88 * Author URI: https://namncn.com
     
    1919
    2020// Define.
    21 define( 'HPR_VERSION', '2.0.2' );
     21define( 'HPR_VERSION', '2.0.3' );
    2222define( 'HPR_FILE', __FILE__ );
    2323define( 'HPR_PATH', plugin_dir_path( HPR_FILE ) );
  • hotline-phone-ring/trunk/includes/backend.php

    r1987961 r2018853  
    2424                    </th>
    2525                    <td>
    26                         <input id=hpr_phone" name="hpr_options[phone]" type="text" class="regular-text" value="<?php esc_attr_e( $data['phone'] ); ?>" />
     26                        <input id=hpr_phone" name="hpr_options[phone]" type="text" class="regular-text" value="<?php echo esc_attr( $data['phone'] ); ?>" />
    2727                    </td>
    2828                </tr>
    2929                <tr valign="top">
    3030                    <th scope="row" valign="top">
    31                         <?php esc_html_e('Select style', 'hotline-phone-ring'); ?>
     31                        <?php esc_html_e( 'Select style', 'hotline-phone-ring' ); ?>
    3232                    </th>
    3333                    <td>
     
    4242                <tr valign="top">
    4343                    <th scope="row" valign="top">
    44                         <?php esc_html_e('Hide Hotline Bar', 'hotline-phone-ring'); ?>
     44                        <?php esc_html_e( 'Color', 'hotline-phone-ring' ); ?>
     45                    </th>
     46                    <td>
     47                        <label for="hpr_color">
     48                            <input id="hpr_color" name="hpr_options[color]" type="text" value="<?php echo esc_attr( $data['color'] ); ?>" class="hpr-color-picker" />
     49                        </label>
     50                    </td>
     51                </tr>
     52                <tr valign="top">
     53                    <th scope="row" valign="top">
     54                        <?php esc_html_e( 'Hide Hotline Bar', 'hotline-phone-ring' ); ?>
    4555                    </th>
    4656                    <td>
  • hotline-phone-ring/trunk/includes/class-hotline-phone-ring.php

    r1987961 r2018853  
    4848        add_action( 'admin_menu', array( $this, 'menu' ) );
    4949        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
     50        add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
     51        add_action( 'wp_head', array( $this, 'frontend_custom_style' ) );
    5052        add_action( 'wp_footer', array( $this, 'frontend' ) );
    5153        add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 500 );
    5254
    5355        if ( isset( $_REQUEST['page'] ) && 'hotline-phone-ring' == $_REQUEST['page'] ) {
    54             // Only admins can save settings.
    55             if ( ! current_user_can('manage_options') ) {
    56                 return;
    57             }
    58 
    5956            $this->save();
    6057        }
     
    6259
    6360    /**
    64      * Registers Widget.
     61     * Enqueue frontend styles & scripts.
    6562     */
    6663    public function enqueue_scripts() {
     
    7471
    7572    /**
    76      * Renders the admin settings menu.
     73     * Enqueue admin styles & scripts.
     74     */
     75    public function admin_enqueue_scripts() {
     76        wp_enqueue_style( 'wp-color-picker' );
     77        wp_enqueue_script( 'hpr-admin-script', HPR_ASSETS_URL . 'js/admin.js', array( 'jquery', 'wp-color-picker' ), HPR_VERSION, true );
     78    }
     79
     80    /**
     81     * Register admin settings menu.
    7782     *
    7883     * @since 1.0.0
     
    105110            'phone'       => '',
    106111            'style'       => 'style1',
     112            'color'       => '',
    107113            'hotline_bar' => '',
    108114        );
     
    141147
    142148    /**
    143      * Hotline phone ring front-end template.
     149     * Hotline phone ring frontend template.
    144150     * @return [type] [description]
    145151     */
     
    238244        $data['phone']       = isset( $_POST['hpr_options']['phone'] ) ? sanitize_text_field( $_POST['hpr_options']['phone'] ) : '';
    239245        $data['style']       = isset( $_POST['hpr_options']['style'] ) ? sanitize_text_field( $_POST['hpr_options']['style'] ) : 'style1';
     246        $data['color']       = isset( $_POST['hpr_options']['color'] ) ? sanitize_text_field( $_POST['hpr_options']['color'] ) : '';
    240247        $data['hotline_bar'] = isset( $_POST['hpr_options']['hotline_bar'] ) ? 'on' : 'off';
    241248
     
    267274        return $footer_text;
    268275    }
     276
     277    /**
     278     * Frontend custom style.
     279     */
     280    public function frontend_custom_style() {
     281        $data = $this->data();
     282
     283        if ( $data['color'] ) { ?>
     284        <style>
     285            .hotline-phone-ring-circle {
     286                border-color: <?php echo $data['color'] ?>;
     287            }
     288            .hotline-phone-ring-circle-fill, .hotline-phone-ring-img-circle, .hotline-bar {
     289                background-color: <?php echo $data['color'] ?>;
     290            }
     291        </style>
     292
     293        <?php if ( 'style1' == $data['style'] ) {
     294            $hex = $data['color'];
     295            ( strlen( $hex ) === 4 ) ? list( $r, $g, $b ) = sscanf( $hex, '#%1x%1x%1x' ) : list( $r, $g, $b ) = sscanf( $hex, '#%2x%2x%2x' );
     296            $hotlinebar_bg = "rgb( $r, $g, $b, .7 )";
     297        ?>
     298        <style>
     299            .hotline-bar {
     300                background: <?php echo $hotlinebar_bg ?>;
     301            }
     302        </style>
     303        <?php } ?>
     304
     305        <?php }
     306    }
    269307}
  • hotline-phone-ring/trunk/languages/hotline-phone-ring-vi.po

    r1988006 r2018853  
    33"Project-Id-Version: Hotline Phone Ring\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2018-12-07 15:04+0000\n"
    6 "PO-Revision-Date: 2018-12-07 15:05+0000\n"
     5"POT-Creation-Date: 2019-01-25 05:52+0000\n"
     6"PO-Revision-Date: 2019-01-25 05:52+0000\n"
    77"Last-Translator: phoenixdigi <quantri@phoenixdigi.vn>\n"
    88"Language-Team: Tiếng Việt\n"
     
    1818msgstr "Cài đặt nút gọi rung"
    1919
    20 #: includes/backend.php:23 includes/class-hotline-phone-ring.php:172
     20#: includes/backend.php:23 includes/class-hotline-phone-ring.php:178
    2121msgid "Hotline"
    2222msgstr "Số điện thoại"
     
    3535
    3636#: includes/backend.php:44
     37msgid "Color"
     38msgstr "Màu sắc"
     39
     40#: includes/backend.php:54
    3741msgid "Hide Hotline Bar"
    3842msgstr "Ẩn thanh chứa số điện thoại"
    3943
    40 #: includes/backend.php:62
     44#: includes/backend.php:72
    4145msgid "Support"
    4246msgstr "Hỗ trợ"
    4347
    44 #: includes/backend.php:64
     48#: includes/backend.php:74
    4549msgid ""
    4650"For submitting any support queries, feedback, bug reports or feature "
     
    5660"này</a>."
    5761
    58 #: includes/class-hotline-phone-ring.php:85
     62#: includes/class-hotline-phone-ring.php:90
    5963msgid "HPR Options"
    6064msgstr "HPR Options"
    6165
    62 #: includes/class-hotline-phone-ring.php:129
     66#: includes/class-hotline-phone-ring.php:135
    6367msgid "Settings updated!"
    6468msgstr "Cập nhật các cài đặt thành công!"
    6569
    66 #: includes/class-hotline-phone-ring.php:264
     70#: includes/class-hotline-phone-ring.php:271
    6771msgid ""
    6872" Enjoyed <strong>Hotline Phone Ring</strong>? Please leave us a <a "
     
    9094#. Author of the plugin
    9195msgid "Nam Truong"
    92 msgstr ""
     96msgstr "Nam Trương"
    9397
    9498#. Author URI of the plugin
  • hotline-phone-ring/trunk/languages/hotline-phone-ring.pot

    r1988006 r2018853  
    44"Project-Id-Version: Hotline Phone Ring\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2018-12-07 15:04+0000\n"
     6"POT-Creation-Date: 2019-01-25 05:52+0000\n"
    77"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    88"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1919msgstr ""
    2020
    21 #: includes/backend.php:23 includes/class-hotline-phone-ring.php:172
     21#: includes/backend.php:23 includes/class-hotline-phone-ring.php:178
    2222msgid "Hotline"
    2323msgstr ""
     
    3636
    3737#: includes/backend.php:44
     38msgid "Color"
     39msgstr ""
     40
     41#: includes/backend.php:54
    3842msgid "Hide Hotline Bar"
    3943msgstr ""
    4044
    41 #: includes/backend.php:62
     45#: includes/backend.php:72
    4246msgid "Support"
    4347msgstr ""
    4448
    45 #: includes/backend.php:64
     49#: includes/backend.php:74
    4650msgid ""
    4751"For submitting any support queries, feedback, bug reports or feature "
     
    5256msgstr ""
    5357
    54 #: includes/class-hotline-phone-ring.php:85
     58#: includes/class-hotline-phone-ring.php:90
    5559msgid "HPR Options"
    5660msgstr ""
    5761
    58 #: includes/class-hotline-phone-ring.php:129
     62#: includes/class-hotline-phone-ring.php:135
    5963msgid "Settings updated!"
    6064msgstr ""
    6165
    62 #: includes/class-hotline-phone-ring.php:264
     66#: includes/class-hotline-phone-ring.php:271
    6367msgid ""
    6468" Enjoyed <strong>Hotline Phone Ring</strong>? Please leave us a <a "
  • hotline-phone-ring/trunk/readme.txt

    r1997649 r2018853  
    55License URI: http://www.gnu.org/licenses/gpl.html
    66Tags: hotline, phone, fixed, wp phonering, dien thoai rung
    7 Tested up to: 5.0.0
     7Tested up to: 5.0.3
    88Requires PHP: 5.6.3
    99
     
    3636== Changelog ==
    3737
    38 = 1.0.0 =
    39 * First release.
     38= 2.0.3 =
     39* Color option.
    4040
    41 = 1.0.1 =
    42 * Update settings.
     41= 2.0.2 =
     42* Fix z-index.
    4343
    44 = 1.0.2 =
    45 * Update Css default.
     44= 2.0.1 =
     45* Update translate.
    4646
    47 = 1.0.3 =
    48 * Fixed option.
     47= 2.0.0 =
     48* Add new style.
    4949
    50 = 1.0.4 =
    51 * Update admin settings.
     50= 1.0.8 =
     51* Add new contributor.
    5252
    53 = 1.0.5 =
     53= 1.0.7 =
    5454* Fix bug.
    5555
     
    5757* Vietnamese language support.
    5858
    59 = 1.0.7 =
     59= 1.0.5 =
    6060* Fix bug.
    6161
    62 = 1.0.8 =
    63 * Add new contributor.
     62= 1.0.4 =
     63* Update admin settings.
    6464
    65 = 2.0.0 =
    66 * Add new style.
     65= 1.0.3 =
     66* Fixed option.
    6767
    68 = 2.0.1 =
    69 * Update translate.
     68= 1.0.2 =
     69* Update Css default.
    7070
    71 = 2.0.2 =
    72 * Fix z-index.
     71= 1.0.1 =
     72* Update settings.
     73
     74= 1.0.0 =
     75* First release.
Note: See TracChangeset for help on using the changeset viewer.