Plugin Directory

Changeset 769999


Ignore:
Timestamp:
09/11/2013 12:02:11 AM (12 years ago)
Author:
wpkuf
Message:

new plugin version 1.0.4 has been released

Location:
wp-js-detect/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-js-detect/trunk/readme.txt

    r769575 r769999  
    55Requires at least: 3.5
    66Tested up to: 3.6
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv2
    99
     
    6767= 1.0.3 =
    6868* NEW : Plugin option tabs has been added.
     69= 1.0.4 =
     70* NEW : Ability to customize pop-up window from the backend has been added.
  • wp-js-detect/trunk/wp-js-detect.php

    r769576 r769999  
    99Plugin URI:  https://github.com/git-kuf/wp-js-detect
    1010Description: This plugin is used to display a notification message if the browser's Javascript is disabled.
    11 Version: 1.0.3
     11Version: 1.0.4
    1212Author: Kuflievskiy Alex <[email protected]>
    1313Author URI: https://github.com/git-kuf/
     
    4444    public function wp_non_js_notification();
    4545    public function plugin_settings_link($links);
     46    public function paypal_donate_button();
    4647}
    4748
     
    8283        $wp_non_js_notification_text = __('For full functionality of this site it is necessary to enable JavaScript. Here are the <a href="http://www.enable-javascript.com/" target="_blank"> instructions how to enable JavaScript in your web browser</a>.');
    8384        add_option('wp_non_js_notification_text', $wp_non_js_notification_text, '', 'yes');
     85       
     86        $plugin_path = get_bloginfo('url') . '/wp-content/plugins/wp-js-detect/';
     87        $wp_non_js_notification_css = "
     88        /*no JS message*/
     89            #jsDisabled {
     90                position: fixed;
     91                width: 100%;
     92                height: 100%;
     93                background: url(".$plugin_path."images/dark-bg.png) repeat;
     94                z-index: 2000;
     95            }
     96            #jsDisabled p {
     97                position: absolute;
     98                top: 50%;
     99                left: 50%;
     100                width: 100%;
     101                width: 500px;
     102                margin-left: -323px;
     103                margin-top: -75px;
     104                border-radius: 5px;
     105                box-shadow: 0 0 10px #000;
     106                padding: 30px 30px 30px 120px;
     107                background: #fef5f2 url(".$plugin_path."images/symbol_error.png) 30px 50% no-repeat;
     108                font-size: 20px;
     109                text-align: left;
     110                color: #333;
     111                line-height: 26px;
     112            }
     113            #jsDisabled p a {
     114                color: #d13131;
     115            }
     116        ";
     117        add_option('wp_non_js_notification_css', $wp_non_js_notification_css, '', 'yes');
    84118    }
    85119
     
    95129    {
    96130        delete_option('wp_non_js_notification_text');
     131        delete_option('wp_non_js_notification_css');       
    97132    }
    98133
     
    121156    {
    122157
    123         if (isset($_POST['wp_non_js_notification_text'])) {
     158        if (isset($_POST['wp_non_js_notification_text']))
     159        {
    124160            update_option('wp_non_js_notification_text', $_POST['wp_non_js_notification_text']);
    125161        }
     
    128164            <div id="icon-tools" class="icon32"><br/></div>
    129165            <h2>Js Detect Settings</h2>
    130             <a class="nav-tab " href="/wp-admin/admin.php?page=js-detect-settings">Plugin Settings</a>
    131             <a class="nav-tab " href="/wp-admin/admin.php?page=js-detect-settings&tab=contact">Contacts</a>
     166            <a class="nav-tab <?php echo ($_GET['tab'] == '') ? 'nav-tab-active' : ''; ?>" href="/wp-admin/admin.php?page=js-detect-settings">Plugin Settings</a>
     167            <a class="nav-tab <?php echo ($_GET['tab'] == 'css') ? 'nav-tab-active' : ''; ?>" href="/wp-admin/admin.php?page=js-detect-settings&tab=css">Plugin CSS</a>         
     168            <a class="nav-tab <?php echo ($_GET['tab'] == 'contact') ? 'nav-tab-active' : ''; ?>" href="/wp-admin/admin.php?page=js-detect-settings&tab=contact">Contacts Me</a>
    132169            <?php if($_GET['tab'] === 'contact'): ?>
    133170                <table cellspacing="0" class="widefat post fixed" style="width: 100%">
     
    152189                        </tbody>
    153190                </table>
    154 
     191            <?php elseif($_GET['tab'] === 'css'): ?>
     192                <table cellspacing="0" class="widefat post fixed" style="width: 100%">
     193                    <thead>
     194                    <tr>
     195                        <th style="width:200px;" class="manage-column"></th>
     196                        <th></th>
     197                    </tr>
     198                    </thead>
     199                    <tfoot>
     200                    <tr>
     201                        <th class="manage-column"></th>
     202                        <th></th>
     203                    </tr>
     204                    </tfoot>
     205                    <tbody>
     206                    <tr>
     207                        <td class="column">
     208                            <label for="wp_non_js_notification_css">No Js Notification CSS:</label>
     209                        </td>
     210                        <td align="right" class="column">
     211                            <form action="#" method="post">
     212                                <textarea rows="50" class="large-text code" id="wp_non_js_notification_css"
     213                                          name="wp_non_js_notification_css"><?php echo get_option('wp_non_js_notification_css'); ?></textarea>
     214                                <input type="submit" value="<?php _e('Update'); ?>"
     215                                       class="button button-primary button-large">
     216                            </form>
     217                        </td>
     218                    </tr>
     219                    <tr>
     220                        <td colspan="2" class="column">
     221                            <?php echo $this->paypal_donate_button(); ?>
     222                        </td>
     223                    </tr>
     224                    </tbody>
     225                </table>           
    155226            <?php else: ?>
    156227                <table cellspacing="0" class="widefat post fixed" style="width: 100%">
    157228                    <thead>
    158229                    <tr>
    159                         <th style="width:200px;" class="manage-column">
    160                         </th>
     230                        <th style="width:200px;" class="manage-column"></th>
    161231                        <th></th>
    162232                    </tr>
     
    184254                    <tr>
    185255                        <td colspan="2" class="column">
    186                             <p>Donate to support further development.</p>
    187 
    188                             <p>I’m glad that you like my wordpress plugin and that you want to show your appreciation by
    189                                 donating. With your help I can make these plugins even better!</p>
    190 
    191                             <p>You can donate money using the PayPal-button below (any amount makes me happy!)</p>
    192 
    193                             <p>
    194                                 <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]&item_name=Donation+for+Wp+Js+Detect"
    195                                    target="_blank" title="Make a Donation for Wp Js Detect Plugin">
    196                                     <img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" alt=""/>
    197                                 </a>
    198                             </p>
     256                            <?php echo $this->paypal_donate_button(); ?>
    199257                        </td>
    200258                    </tr>
     
    213271    public function wp_non_js_notification()
    214272    {
    215         $plugin_path = get_bloginfo('url') . '/wp-content/plugins/wp-js-detect/';
    216273        ?>
    217274        <div id="jsDisabled"><p><?php echo get_option('wp_non_js_notification_text'); ?></p></div>
     
    223280        </script>
    224281        <style>
    225             /*no JS message*/
    226             #jsDisabled {
    227                 position: fixed;
    228                 width: 100%;
    229                 height: 100%;
    230                 background: url(<?php echo $plugin_path; ?>images/dark-bg.png) repeat;
    231                 z-index: 2000;
    232             }
    233             #jsDisabled p {
    234                 position: absolute;
    235                 top: 50%;
    236                 left: 50%;
    237                 width: 100%;
    238                 width: 500px;
    239                 margin-left: -323px;
    240                 margin-top: -75px;
    241                 border-radius: 5px;
    242                 box-shadow: 0 0 10px #000;
    243                 padding: 30px 30px 30px 120px;
    244                 background: #fef5f2 url(<?php echo $plugin_path; ?>images/symbol_error.png) 30px 50% no-repeat;
    245                 font-size: 20px;
    246                 text-align: left;
    247                 color: #333;
    248                 line-height: 26px;
    249             }
    250             #jsDisabled p a {
    251                 color: #d13131;
    252             }
     282            <?php echo get_option('wp_non_js_notification_css'); ?>
    253283        </style>
    254284    <?php
     
    262292     *
    263293     */
    264     public function plugin_settings_link($links) {
     294    public function plugin_settings_link($links)
     295    {
    265296
    266297      array_unshift($links, '<a target="_blank" href="/wp-admin/admin.php?page=js-detect-settings">Settings</a>');
     
    270301      return $links;
    271302    }   
     303   
     304    /**
     305     *  Function paypal_donate_button
     306     *  This function is used to output paypal donate button.
     307     *
     308    */
     309    public function paypal_donate_button()
     310    {
     311        ?>
     312        <p><?php _e('Donate to support further development.'); ?></p>
     313        <p><?php _e('I’m glad that you like my wordpress plugin and that you want to show your appreciation by
     314            donating. With your help I can make these plugins even better!'); ?></p>
     315        <p><?php _e('You can donate money using the PayPal-button below (any amount makes me happy!)'); ?></p>
     316        <p>
     317            <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]&item_name=Donation+for+Wp+Js+Detect"
     318               target="_blank" title="Make a Donation for Wp Js Detect Plugin">
     319                <img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" alt=""/>
     320            </a>
     321        </p>       
     322        <?php
     323    }
    272324}
    273325
Note: See TracChangeset for help on using the changeset viewer.