Plugin Directory

Changeset 811834


Ignore:
Timestamp:
11/28/2013 12:17:17 PM (12 years ago)
Author:
Catapult
Message:

Committing 1.2

Location:
wp-slide-out-tab/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wp-slide-out-tab/trunk/output.php

    r805843 r811834  
    88
    99    <div id="slide-out-tab-content">
    10         <?php echo do_shortcode (  get_option ( "wp_slide_out_content" ) ); ?>
     10        <?php echo wpautop ( do_shortcode (  get_option ( "wp_slide_out_content" ) ) ); ?>
    1111
    1212    </div><!-- #slide-out-tab-content -->
  • wp-slide-out-tab/trunk/readme.txt

    r805843 r811834  
    44Requires at least: 3.7
    55Tested up to: 3.7.1
    6 Stable tag: 1.1
     6Stable tag: 1.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4141== Changelog ==
    4242
     43= 1.2 =
     44Added auto-show setting
     45Minor style updates
     46Added auto paragraphing to tab content
     47
    4348= 1.1 =
    4449Content now correctly displays shortcodes
  • wp-slide-out-tab/trunk/settings.php

    r802739 r811834  
    6464
    6565        </table>
     66       
     67        <h3>Options</h3>
     68
     69        <table class="form-table">
     70
     71            <tr valign="top">
     72                <th scope="row"><label for="wp_slide_out_auto">Auto show on first page?</label></th>
     73                <td><input type="checkbox" id="wp_slide_out_auto" name="wp_slide_out_auto" value="1" <?php checked ( get_option ( 'wp_slide_out_auto' ), 1, true ); ?> /></td>
     74            </tr>
     75           
     76            <tr valign="top">
     77                <th scope="row"><label for="wp_slide_out_delay">Auto show delay</label></th>
     78                <td><input size="5" value="<?php echo absint ( get_option ( 'wp_slide_out_delay', '500' ) ); ?>" name="wp_slide_out_delay" id="wp_slide_out_delay" type="text" /> ms</td>
     79            </tr>
     80
     81        </table>
    6682
    6783        <script>
  • wp-slide-out-tab/trunk/slide-out-tab-script.js

    r805843 r811834  
    11// Scripts for Modal Alert
    2 
     2var auto = slide_out_vars.auto;
     3var delay = slide_out_vars.delay;
    34
    45jQuery(document).ready(function($){
     
    67    $('#slide-out-tab-wrap').fadeIn(150);
    78    // Set the position based on height of tab
    8     tabheight=$('#slide-out-tab-tab').height() + 12;
    9     contentheight=$('#slide-out-tab-content').height() + 17;
     9    tabheight=$('#slide-out-tab-tab').height() + 26;
     10    contentheight=$('#slide-out-tab-content').height() + 31;
    1011    console.log('asdf' + tabheight);
    1112    $('#slide-out-tab-wrap').css('bottom',tabheight+'px');
    1213    // On click, slide the tab up and down
    13 
    1414    $('#slide-out-tab-tab').on('click',function(){
     15        slide_out_tab();
     16    });
     17    // If auto is set, slide up
     18    if ( auto == 1 ) {
     19       
     20        if(typeof(Storage)!=="undefined") { // We'll just register that the message has auto-displayed
     21            var autoDisplay = sessionStorage.autoDisplay;
     22            if ( autoDisplay != 1 ) { // If it hasn't displayed, then display it
     23                timeout = setTimeout ( function(){
     24                    slide_out_tab();
     25                }, delay );
     26                sessionStorage.autoDisplay = 1;
     27            }
     28        } else { // If it's an old browser, it'll just display
     29            timeout = setTimeout ( function(){
     30                slide_out_tab();
     31            }, delay );
     32        }
     33    }
     34    // This is the function to slide up and down
     35    function slide_out_tab() {
    1536        position = $('#slide-out-tab-wrap').css('bottom');
    1637        newposition=0;
     
    2344            bottom: newposition+'px'
    2445        },150);
    25     });
     46        clearTimeout(timeout);
     47    }
     48});
    2649
    27 });
     50
  • wp-slide-out-tab/trunk/slide-out-tab.php

    r805843 r811834  
    11<?php
     2
    23/**
    34Plugin Name: Slide Out Tab
    45Plugin URI: http://catapultdesign.co.uk
    56Description: A slide out tab that can be used for marketing and promotional offers
    6 Version: 1.1
     7Version: 1.2
    78Author: Catapult
    89Author URI: http://catapultdesign.co.uk
    910License: GPL2
    1011
    11 Copyright 2013 Catapult  (email : [email protected])
    12 
    13 This program is free software; you can redistribute it and/or modify
    14 it under the terms of the GNU General Public License, version 2, as
    15 published by the Free Software Foundation.
    16 
    17 
    18 This program is distributed in the hope that it will be useful,
    19 but WITHOUT ANY WARRANTY; without even the implied warranty of
    20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    21 GNU General Public License for more details.
    22 
    23 
    24 You should have received a copy of the GNU General Public License
    25 along with this program; if not, write to the Free Software
    26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2712*/
    2813
     
    8570            register_setting ( 'wp_slide_out_tab-group', 'wp_slide_out_border_color' );
    8671            register_setting ( 'wp_slide_out_tab-group', 'wp_slide_out_text_color' );
     72            register_setting ( 'wp_slide_out_tab-group', 'wp_slide_out_auto' );
     73            register_setting ( 'wp_slide_out_tab-group', 'wp_slide_out_delay' );
    8774
    8875        }
     
    120107        public function enqueue_scripts() {
    121108            if ( get_option ( 'wp_slide_out_enable' ) == 1 ) { // Only enqueue scripts if the tab is enabled
    122 
    123109                wp_enqueue_script( 'slide-out-tab-script', plugins_url ( 'slide-out-tab-script.js', __FILE__ ), array ( 'jquery' ), false, true );
    124 
     110                // Pass some dynamic data to the JavaScript
     111                wp_localize_script ( 'slide-out-tab-script', 'slide_out_vars',
     112                    array (
     113                        'auto' => get_option ( 'wp_slide_out_auto', 0 ),
     114                        'delay' => get_option ( 'wp_slide_out_delay', 500 )
     115                    )
     116                );
    125117                wp_enqueue_style( 'slide-out-tab-style', plugins_url ( 'style.css', __FILE__ ) );
    126118            }
     
    137129                ?>
    138130                <style>
     131                    #slide-out-tab-wrap {
     132                        width: <?php echo get_option ( 'wp_slide_out_width', '400' ); ?>px;
     133                    }
    139134                    #slide-out-tab-tab {
    140135                        color: <?php echo $tab_color; ?>;
  • wp-slide-out-tab/trunk/style.css

    r802739 r811834  
    1919    background-color: #f1f1f1;
    2020    font-weight: bold;
    21     height: 24px;
    22     padding: 6px 14px 2px;
    23     -webkit-border-top-left-radius: 4px;
    24     -webkit-border-top-right-radius: 4px;
    25     -moz-border-radius-topleft: 4px;
    26     -moz-border-radius-topright: 4px;
    27     border-top-left-radius: 4px;
    28     border-top-right-radius: 4px;
    29     border-top: 5px solid #fff;
    30     border-right: 5px solid #fff;
    31     border-left: 5px solid #fff;
     21    height: 25px;
     22    padding: 15px 14px 6px;
     23    -webkit-border-top-left-radius: 8px;
     24    -webkit-border-top-right-radius: 8px;
     25    -moz-border-radius-topleft: 8px;
     26    -moz-border-radius-topright: 8px;
     27    border-top-left-radius: 8px;
     28    border-top-right-radius: 8px;
     29    border-top: 7px solid #fff;
     30    border-right: 7px solid #fff;
     31    border-left: 7px solid #fff;
    3232    box-shadow: 0 -2px 6px -2px rgba(0,0,0,0.3);
    3333}
    3434#slide-out-tab-content {
    3535    position: absolute;
    36     top: 32px;
     36    top: 46px;
    3737    left: 0;
    3838    background-color: #f1f1f1;
    39     padding: 8px 14px;
    40     -webkit-border-top-right-radius: 4px;
    41     -moz-border-radius-topright: 4px;
    42     border-top-right-radius: 4px;
    43     border-top: 5px solid #fff;
    44     border-right: 5px solid #fff;
    45     border-left: 5px solid #fff;
     39    padding: 18px 14px 36px;
     40    -webkit-border-top-right-radius: 8px;
     41    -moz-border-radius-topright: 8px;
     42    border-top-right-radius: 8px;
     43    border-top: 7px solid #fff;
     44    border-right: 7px solid #fff;
     45    border-left: 7px solid #fff;
    4646    box-shadow: 0 -2px 6px -2px rgba(0,0,0,0.3);
    4747}
Note: See TracChangeset for help on using the changeset viewer.