Plugin Directory

Changeset 1720418


Ignore:
Timestamp:
08/28/2017 09:13:28 AM (9 years ago)
Author:
PluginlySpeaking
Message:

Version 3.0

Location:
floating-div
Files:
9 added
4 edited

Legend:

Unmodified
Added
Removed
  • floating-div/trunk/css/psfd.css

    r1608680 r1720418  
     1.exp_floatdiv_container_pro {
     2    cursor: pointer;
     3    z-index:100;
     4    position:fixed;
     5    min-height:50px;
     6    min-width:50px;
     7    background-repeat: no-repeat;
     8    background-position: center center;
     9    background-size:100% 100%;
     10}
     11
    112.exp_floatdiv_content_pro {
    213    position:fixed;
    3     padding:10px;
    414    z-index:100;
    515    background-repeat: no-repeat;
    616    background-position: center center;
    717    background-size:100% 100%;
     18}
     19
     20.exp_floatdiv_content_padding_pro {
     21    padding:10px;
     22}
     23
     24.exp_floatdiv_content_coll_pro {
     25    position:fixed;
     26    z-index:100;
     27    background-repeat: no-repeat;
     28    background-position: center center;
     29    background-size:100% 100%;
     30}
     31
     32.exp_floatdiv_content_coll_padding_pro {
     33    padding:10px;
     34}
     35
     36.exp_floatdiv_container_inside_pro {
     37    height:25px;
     38    width:25px;
     39    cursor: pointer;
     40    z-index:100;
     41    float:right;
     42}
     43
     44.exp_floatdiv_content_pro.psts_font_not_force {
     45    font-family:"Trebuchet MS",Verdana,sans-serif;
     46}
     47
     48.exp_floatdiv_content_coll_pro.psts_font_not_force {
    849    font-family:"Trebuchet MS",Verdana,sans-serif;
    950}
     
    1253@media only screen and (min-width : 769px) {
    1354
    14     .psfd_width_160px{
     55  .psfd_no_desktop{display:none !important;}
     56 
     57  .psfd_width_160px{
    1558        width:160px;
    1659    }
     
    3679/* Small Devices, Tablets */
    3780@media only screen and (min-width : 481px) and (max-width : 768px) {
    38     .exp_floatdiv_content_pro {
     81   
     82  .psfd_no_tablet{display:none !important;}
     83 
     84  .exp_floatdiv_content_pro {
    3985        font-size:80%;
    4086    }
     
    65111@media only screen and (max-width : 480px) {
    66112   
    67     .exp_floatdiv_content_pro {
     113  .psfd_no_mobile{display:none !important;}
     114 
     115  .exp_floatdiv_content_pro {
    68116        font-size:60%;
    69117    }
     
    78126
    79127    .psfd_width_260px{
    80         width:110px;
     128        width:120px;
    81129    }
    82130
    83131    .psfd_width_310px{
    84         width:130px;
     132        width:150px;
    85133    }
    86134
    87135    .psfd_width_360px{
    88         width:160px;
     136        width:210px;
    89137    }
    90138
  • floating-div/trunk/css/psfd_admin.css

    r1608680 r1720418  
    1 #psfd_content {
     1.psfd_radio_pleft {
     2    margin-left:15px !important;
     3}
     4
     5.psfd_radio_pright {
     6    margin-right:5px !important;
     7}
     8
     9.psfd_input_align_right {
     10    text-align:right;
     11}
     12
     13.psfd_input_small_width {
     14    width:60px;
     15}
     16
     17
     18.psfd_if_appearing_active{
     19    display:none;
     20}
     21
     22.psfd_if_disappearing_active{
     23    display:none;
     24}
     25
     26.psfd_start_hidden{
     27    display:none;
     28}
     29
     30#psfd_collapsible_settings {
     31    display:none;
     32}
     33
     34#psfdp_content {
    235    height:250px;
    336}
     
    740}
    841
    9 .psfd_select_150p{
    10     width:150px;
     42.psfd_select_125p{
     43    width:125px;
    1144}
    1245
     
    2053}
    2154
    22 .psfd_table_100 td{
     55.psfd_table_100_label{
    2356    vertical-align:middle;
    24     width:50%;
    2557    height:60px;
     58    width:240px;
     59}
     60
     61.psfd_table_100_input{
     62    vertical-align:middle;
     63    height:60px;
     64    width:200px;
    2665}
    2766
     
    3473}
    3574
     75.psfd_table_settings td{
     76    height:60px;
     77}
     78
    3679.psfd_label_margins {
    37     width:100px;
    3880    display: block;
    39     float:left;
    40     padding-top:4px;
     81    line-height:30px;
     82}
     83
     84.psfd_back_image {
     85    margin-top:-12px;
     86    display:inline-block;
    4187}
    4288
     
    54100}
    55101
    56 #psfd_content_metabox h2 {
     102#psfdp_content_metabox h2 {
    57103    font-size: 17px;
    58104    color: #0073aa;
     
    72118}
    73119
    74 #psfd_settings_metabox h2 {
     120#psfdp_settings_metabox h2 {
    75121    font-size: 17px;
    76122    color: #0073aa;
  • floating-div/trunk/pluginlyspeaking-floatingdiv.php

    r1710933 r1720418  
    33 * Plugin Name: PluginlySpeaking FloatingDiv
    44 * Plugin URI: http://pluginlyspeaking.com/plugins/floating-div/
    5  * Description: Create a simple div, floating up and down when the user is scrolling
     5 * Description: Sticky container, Floating Div is arguably the simplest way to show any type of content on a side of the screen that will remain visible as the user scrolls
    66 * Author: PluginlySpeaking
    7  * Version: 2.1
     7 * Version: 3.0
    88 * Author URI: http://www.pluginlyspeaking.com
    99 * License: GPL2
    1010 */
    1111
    12 // Check for the PRO version
    13 add_action( 'admin_init', 'psfd_free_pro_check' );
    14 function psfd_free_pro_check() {
    15     if (is_plugin_active('pluginlyspeaking-floatingdiv-pro/pluginlyspeaking-floatingdiv-pro.php')) {
    16 
    17         function my_admin_notice(){
    18         echo '<div class="updated">
    19                 <p>Floating Div <strong>PRO</strong> version is activated.</p>
    20                 <p>Floating Div <strong>FREE</strong> version is desactivated.</p>
    21               </div>';
    22         }
    23         add_action('admin_notices', 'my_admin_notice');
    24 
    25         deactivate_plugins(__FILE__);
    26     }
    27 }
    28 
    2912 add_action( 'wp_enqueue_scripts', 'psfd_add_script' );
    3013
     
    3215    wp_enqueue_style( 'psfd_css', plugins_url('css/psfd.css', __FILE__));
    3316    wp_enqueue_script('jquery');   
     17    wp_enqueue_script('jquery-effects-fold');
     18    wp_enqueue_script('jquery-effects-slide');
     19    wp_enqueue_script('jquery-effects-fade');
     20    wp_enqueue_script('jquery-effects-explode');
     21    wp_enqueue_script('jquery-effects-clip');
    3422}
    3523
     
    9179   
    9280    $prefix = '_floating_div_';
     81   
    9382    $width = get_post_meta($post->ID, $prefix.'width',true);
    94     if ($width == "")
     83    if($width == '')
    9584        $width = "260px";
     85
     86    $all_pages  = get_post_meta($post->ID, $prefix.'all_pages',true);       
    9687    ?>
    97     <table class="pspt_table">
     88    <table class="psfd_table_settings">
    9889        <tr>
    9990            <td colspan="2"><label for="width">Width of content : </label>
     
    10798            </td>
    10899        </tr>
    109     </table>
    110    
     100        <tr>
     101            <td><label for="all_pages">Show on all pages : </label></td>
     102            <td><input type="radio" id="all_pages_yes" name="all_pages" value="yes" <?php echo (empty($all_pages)) ? '' : psfd_check($all_pages,'yes'); ?>> Yes <input type="radio" id="all_pages_no" name="all_pages" value="no" <?php echo (empty($all_pages)) ? 'checked="checked"' : psfd_check($all_pages,'no'); ?>> No<br></td>
     103        </tr>
     104    </table>   
    111105    <?php
    112106   
     
    124118    <ul style="list-style-type:disc;padding-left:20px;">
    125119        <li>Get a collapsible content</li>
     120        <li>Reveal your div after some time</li>
     121        <li>Hide your div after some time</li>
     122        <li>Fix your div after scrolling</li>
    126123        <li>Container location</li>
    127124        <li>Use your theme's font</li>
     
    138135}
    139136
    140 
    141137add_action('add_meta_boxes','psfd_init_content_metabox');
    142138
     
    153149    $margin_bottom = get_post_meta($post->ID, $prefix.'margin_bottom',true);
    154150    $margin_right = get_post_meta($post->ID, $prefix.'margin_right',true);
     151    $margin_left = get_post_meta($post->ID, $prefix.'margin_left',true);
    155152    $borders = get_post_meta($post->ID, $prefix.'borders',true);   
    156153    $border_color = get_post_meta($post->ID, $prefix.'border_color',true); 
     
    169166        <table class="psfd_table_100">
    170167            <tr>
     168                <td class="psfd_table_100_label">
     169                    <label for="position">Choose your floating div position : </label>
     170                </td>
     171                <td class="psfd_table_100_input">   
     172                    <select name="position" class="psfd_select_125p">
     173                        <option <?php selected( $position, "top_right"); ?> id="psfd_position_top_right" value="top_right">Top Right</option>
     174                        <option <?php selected( $position, "top");  ?> id="psfd_position_top" value="top">Top</option>
     175                        <option <?php selected( $position, "top_left"); ?> id="psfd_position_top_left" value="top_left">Top Left</option>
     176                        <option <?php selected( $position, "bottom_right");  ?> id="psfd_position_bottom_right" value="bottom_right">Bottom Right</option>
     177                        <option <?php selected( $position, "bottom");  ?> id="psfd_position_bottom" value="bottom">Bottom</option>
     178                        <option <?php selected( $position, "bottom_left");  ?> id="psfd_position_bottom_left" value="bottom_left">Bottom Left</option>
     179                    </select>
     180                </td>
     181                <td class="psfd_table_100_label">
     182                    <div class="psfd_div_margins psfd_div_margin_top">
     183                        <label for="margin_top" class="psfd_label_margins" >Specify a margin Top : </label>
     184                    </div>
     185                    <div class="psfd_div_margins psfd_div_margin_bottom">
     186                        <label for="margin_bottom" class="psfd_label_margins" >Specify a margin Bottom : </label>
     187                    </div>
     188                    <div class="psfd_div_margins psfd_div_margin_right">
     189                        <label for="margin_right" class="psfd_label_margins" >Specify a margin Right : </label>
     190                    </div>
     191                    <div class="psfd_div_margins psfd_div_margin_left">
     192                        <label for="margin_left" class="psfd_label_margins" >Specify a margin Left : </label>
     193                    </div>
     194                </td>
     195                <td class="psfd_table_100_input">
     196                    <div class="psfd_div_margins psfd_div_margin_top">
     197                        <input type="text" id="psfd_margin_top" class="psfd_input_align_right psfd_input_small_width" name="margin_top" value="<?php echo $margin_top; ?>" /> px
     198                    </div>
     199                    <div class="psfd_div_margins psfd_div_margin_bottom">
     200                        <input type="text" id="psfd_margin_bottom" class="psfd_input_align_right psfd_input_small_width" name="margin_bottom" value="<?php echo $margin_bottom; ?>" /> px
     201                    </div>
     202                    <div class="psfd_div_margins psfd_div_margin_right">
     203                        <input type="text" id="psfd_margin_right" class="psfd_input_align_right psfd_input_small_width" name="margin_right" value="<?php echo $margin_right; ?>" /> px
     204                    </div>
     205                    <div class="psfd_div_margins psfd_div_margin_left">
     206                        <input type="text" id="psfd_margin_left" class="psfd_input_align_right psfd_input_small_width" name="margin_left" value="<?php echo $margin_left; ?>" /> px
     207                    </div>
     208                </td>
    171209                <td>
    172                     <label for="position">Choose your content position : </label>
    173                    
    174                     <select name="position" class="psfd_select_150p">
    175                         <option <?php selected( $position, "top_right"); ?> id="psfd_position_top_right" value="top_right">Top Right</option>
    176                         <option <?php selected( $position, "bottom_right");  ?> id="psfd_position_bottom_right" value="bottom_right">Bottom Right</option>
    177                     </select>
    178                 </td>
    179                 <td>
    180                     <div id="psfd_div_margin_top" class="psfd_div_margins">
    181                         <label for="margin_top" class="psfd_label_margins" >Margin Top : </label>
    182                         <input type="text" id="psfd_margin_top" name="margin_top" placeholder="(in px) ex : 10 for 10px" value="<?php echo $margin_top; ?>" />
    183                     </div>
    184                     <div id="psfd_div_margin_bottom" class="psfd_div_margins">
    185                         <label for="margin_bottom" class="psfd_label_margins" >Margin Bottom : </label>
    186                         <input type="text" id="psfd_margin_bottom" name="margin_bottom" placeholder="(in px) ex : 10 for 10px" value="<?php echo $margin_bottom; ?>" />
    187                     </div>
    188                     <div id="psfd_div_margin_right" class="psfd_div_margins">
    189                         <label for="margin_right" class="psfd_label_margins" >Margin Right : </label>
    190                         <input type="text" id="psfd_margin_right" name="margin_right" placeholder="(in px) ex : 10 for 10px" value="<?php echo $margin_right; ?>" />
    191                     </div>
    192210                </td>
    193211            </tr>
     
    196214       
    197215
    198         <table class="psfd_table_100_3td">
     216        <table class="psfd_table_100">
    199217            <tr>
    200                 <td class="psfd_td_label">
     218                <td class="psfd_table_100_label">
    201219                    <label for="corners">Do you want rounded corners ? </label>
    202220                </td>
    203                 <td class="psfd_td_thin">
    204                     <input type="radio" id="corners_yes" name="corners" value="25px" <?php echo (empty($corners)) ? '' : psfd_check($corners,'25px'); ?>> Yes
    205                     <input type="radio" id="corners_no" name="corners" value="2px" <?php echo (empty($corners)) ? 'checked="checked"' : psfd_check($corners,'2px'); ?>> No 
     221                <td class="psfd_table_100_input">
     222                    <input type="radio" id="corners_yes" name="corners" class="psfd_radio_pright" value="25px" <?php echo (empty($corners)) ? '' : psfd_check($corners,'25px'); ?>> Yes
     223                    <input type="radio" id="corners_no" name="corners" class="psfd_radio_pright psfd_radio_pleft" value="2px" <?php echo (empty($corners)) ? 'checked="checked"' : psfd_check($corners,'2px'); ?>> No   
     224                </td>
     225                <td>
     226                </td>
     227                <td>
    206228                </td>
    207229                <td>
     
    209231            </tr>
    210232            <tr>
    211                 <td class="psfd_td_label">
     233                <td class="psfd_table_100_label">
    212234                    <label for="borders">Do you want a border ? </label>
    213235                </td>
    214                 <td class="psfd_td_thin">
    215                     <input type="radio" id="psfd_borders_yes" name="borders" value="yes" <?php echo (empty($borders)) ? 'checked="checked"' : psfd_check($borders,'yes'); ?>> Yes
    216                     <input type="radio" id="psfd_borders_no" name="borders" value="no" <?php echo (empty($borders)) ? '' : psfd_check($borders,'no'); ?>> No
     236                <td class="psfd_table_100_input">
     237                    <input type="radio" id="psfd_borders_yes" name="borders" class="psfd_radio_pright" value="yes" <?php echo (empty($borders)) ? 'checked="checked"' : psfd_check($borders,'yes'); ?>> Yes
     238                    <input type="radio" id="psfd_borders_no" name="borders" class="psfd_radio_pright psfd_radio_pleft" value="no" <?php echo (empty($borders)) ? '' : psfd_check($borders,'no'); ?>> No
     239                </td>
     240                <td class="psfd_table_100_label">
     241                    <div class="psfd_border_color">
     242                        <label for="border_color" class="psfd_label_colorpicker" >Choose your Border Color : </label>
     243                    </div>
     244                </td>
     245                <td class="psfd_table_100_input">
     246                    <div class="psfd_border_color">
     247                        <input id="border_color" name="border_color" type="text" value="<?php echo (empty($border_color)) ? '#000000' : $border_color; ?>" class="psfd_colorpicker" />
     248                    </div>
    217249                </td>
    218250                <td>
    219                     <div id="psfd_border_color">
    220                         <label for="border_color" class="psts_table_31_l" >Border Color : </label>
    221                         <input id="border_color" name="border_color" type="text" value="<?php echo (empty($border_color)) ? '#000000' : $border_color; ?>" class="psfd_colorpicker" />
    222                     </div>
    223251                </td>
    224252            </tr>
    225253            <tr>
    226                 <td class="psfd_td_label" >
     254                <td class="psfd_table_100_label" >
    227255                    <label for="background">Choose your background type : </label>
    228256                </td>
    229                 <td class="psfd_td_thin">
    230                     <select name="background" class="psfd_select_150p">
     257                <td class="psfd_table_100_input">
     258                    <select name="background" class="psfd_select_125p">
    231259                        <option <?php selected( $background, "color"); ?> id="psfd_background_color" value="color">Color</option>
    232260                        <option <?php selected( $background, "image");  ?> id="psfd_background_image" value="image">Image</option>
    233261                    </select>
    234262                </td>
    235                 <td>
    236                     <div id="psfd_div_background_color">
    237                         <label for="background_color" class="psfd_label_colorpicker">Background Color : </label>
     263                <td class="psfd_table_100_label">
     264                    <div class="psfd_div_background_color">
     265                        <label for="background_color" class="psfd_label_colorpicker">Choose your Background Color : </label>
     266                    </div>                 
     267                    <div class="psfd_div_background_image">
     268                        <label for="image" class="psfd_back_image">Choose your Background Image : </label>
     269                    </div>
     270                </td>
     271                <td class="psfd_table_100_input">
     272                    <div class="psfd_div_background_color">
    238273                        <input id="background_color" name="background_color" type="text" value="<?php echo (empty($background_color)) ? '#FFFFFF' : $background_color; ?>" class="psfd_colorpicker" />
    239                     </div>
    240                    
    241                     <div id="psfd_div_background_image">
    242                         <label for="image">Background Image : </label>
     274                    </div>                 
     275                    <div class="psfd_div_background_image">
    243276                        <input type="text" name="image" id="psfd_media_background_image" value="<?php echo $image; ?>" />
    244277                        <input type="button" class="button background-image-button" value="Choose an image" />
    245278                    </div>
    246279                </td>
     280                <td>
     281                </td>
    247282            </tr>
    248         </table>
    249    
     283        </table>   
    250284   
    251285    <script type="text/javascript">
    252286        $=jQuery.noConflict();
    253287        jQuery(document).ready( function($) {
     288           
    254289            if($('#psfd_position_top_right').is(':selected')) {
    255                 $('#psfd_div_margin_top').show();
    256                 $('#psfd_div_margin_bottom').hide();
    257                 $('#psfd_div_margin_right').show();
     290                $('.psfd_div_margin_top').show();
     291                $('.psfd_div_margin_bottom').hide();
     292                $('.psfd_div_margin_right').show();
     293                $('.psfd_div_margin_left').hide();
     294            }
     295            if($('#psfd_position_top').is(':selected')) {
     296                $('.psfd_div_margin_top').show();
     297                $('.psfd_div_margin_bottom').hide();
     298                $('.psfd_div_margin_right').hide();
     299                $('.psfd_div_margin_left').hide();
     300            }
     301            if($('#psfd_position_top_left').is(':selected')) {
     302                $('.psfd_div_margin_top').show();
     303                $('.psfd_div_margin_bottom').hide();
     304                $('.psfd_div_margin_right').hide();
     305                $('.psfd_div_margin_left').show();
    258306            }
    259307            if($('#psfd_position_bottom_right').is(':selected')) {
    260                 $('#psfd_div_margin_top').hide();
    261                 $('#psfd_div_margin_bottom').show();
    262                 $('#psfd_div_margin_right').show();
     308                $('.psfd_div_margin_top').hide();
     309                $('.psfd_div_margin_bottom').show();
     310                $('.psfd_div_margin_right').show();
     311                $('.psfd_div_margin_left').hide();
     312            }
     313            if($('#psfd_position_bottom').is(':selected')) {
     314                $('.psfd_div_margin_top').hide();
     315                $('.psfd_div_margin_bottom').show();
     316                $('.psfd_div_margin_right').hide();
     317                $('.psfd_div_margin_left').hide();
     318            }
     319            if($('#psfd_position_bottom_left').is(':selected')) {
     320                $('.psfd_div_margin_top').hide();
     321                $('.psfd_div_margin_bottom').show();
     322                $('.psfd_div_margin_right').hide();
     323                $('.psfd_div_margin_left').show();
    263324            }
    264325           
    265326            $('select[name=position]').live('change', function(){
    266327                if($('#psfd_position_top_right').is(':selected')) {
    267                     $('#psfd_div_margin_top').show();
    268                     $('#psfd_div_margin_bottom').hide();
    269                     $('#psfd_div_margin_right').show();
     328                    $('.psfd_div_margin_top').show();
     329                    $('.psfd_div_margin_bottom').hide();
     330                    $('.psfd_div_margin_right').show();
     331                    $('.psfd_div_margin_left').hide();
     332                }
     333                if($('#psfd_position_top').is(':selected')) {
     334                    $('.psfd_div_margin_top').show();
     335                    $('.psfd_div_margin_bottom').hide();
     336                    $('.psfd_div_margin_right').hide();
     337                    $('.psfd_div_margin_left').hide();
     338                }
     339                if($('#psfd_position_top_left').is(':selected')) {
     340                    $('.psfd_div_margin_top').show();
     341                    $('.psfd_div_margin_bottom').hide();
     342                    $('.psfd_div_margin_right').hide();
     343                    $('.psfd_div_margin_left').show();
    270344                }
    271345                if($('#psfd_position_bottom_right').is(':selected')) {
    272                     $('#psfd_div_margin_top').hide();
    273                     $('#psfd_div_margin_bottom').show();
    274                     $('#psfd_div_margin_right').show();
    275                 }
    276             });
     346                    $('.psfd_div_margin_top').hide();
     347                    $('.psfd_div_margin_bottom').show();
     348                    $('.psfd_div_margin_right').show();
     349                    $('.psfd_div_margin_left').hide();
     350                }
     351                if($('#psfd_position_bottom').is(':selected')) {
     352                    $('.psfd_div_margin_top').hide();
     353                    $('.psfd_div_margin_bottom').show();
     354                    $('.psfd_div_margin_right').hide();
     355                    $('.psfd_div_margin_left').hide();
     356                }
     357                if($('#psfd_position_bottom_left').is(':selected')) {
     358                    $('.psfd_div_margin_top').hide();
     359                    $('.psfd_div_margin_bottom').show();
     360                    $('.psfd_div_margin_right').hide();
     361                    $('.psfd_div_margin_left').show();
     362                }
     363            });                     
    277364           
    278365            if($('#psfd_background_color').is(':selected')) {
    279                 $('#psfd_div_background_color').show();
    280                 $('#psfd_div_background_image').hide();
     366                $('.psfd_div_background_color').show();
     367                $('.psfd_div_background_image').hide();
    281368            }
    282369            if($('#psfd_background_image').is(':selected')) {
    283                 $('#psfd_div_background_color').hide();
    284                 $('#psfd_div_background_image').show();
     370                $('.psfd_div_background_color').hide();
     371                $('.psfd_div_background_image').show();
    285372            }
    286373           
    287374            $('select[name=background]').live('change', function(){
    288375                if($('#psfd_background_color').is(':selected')) {
    289                     $('#psfd_div_background_color').show();
    290                     $('#psfd_div_background_image').hide();
     376                    $('.psfd_div_background_color').show();
     377                    $('.psfd_div_background_image').hide();
    291378                }
    292379                if($('#psfd_background_image').is(':selected')) {
    293                     $('#psfd_div_background_color').hide();
    294                     $('#psfd_div_background_image').show();
     380                    $('.psfd_div_background_color').hide();
     381                    $('.psfd_div_background_image').show();
    295382                }
    296383            });
    297384           
    298385            if($('#psfd_borders_yes').is(':checked')) {
    299                 $('#psfd_border_color').show();
     386                $('.psfd_border_color').show();
    300387            }
    301388            if($('#psfd_borders_no').is(':checked')) {
    302                 $('#psfd_border_color').hide();
     389                $('.psfd_border_color').hide();
    303390            }
    304391           
    305392            $('input[name=borders]').live('change', function(){
    306393                if($('#psfd_borders_yes').is(':checked')) {
    307                     $('#psfd_border_color').show();
     394                    $('.psfd_border_color').show();
    308395                }
    309396                if($('#psfd_borders_no').is(':checked')) {
    310                     $('#psfd_border_color').hide();
     397                    $('.psfd_border_color').hide();
    311398                }
    312399            });
     
    315402   
    316403    <?php
     404
    317405
    318406}
     
    344432    }
    345433}
     434
    346435add_action('save_post','psfd_save_metabox');
    347436function psfd_save_metabox($post_id){
     
    349438    $prefix = '_floating_div_';
    350439   
     440    //Metabox Settings
    351441    if(isset($_POST['width'])){
    352442        update_post_meta($post_id, $prefix.'width', sanitize_text_field($_POST['width']));
     443    }
     444    if(isset($_POST['all_pages'])){
     445        update_post_meta($post_id, $prefix.'all_pages', sanitize_text_field($_POST['all_pages']));
    353446    }
    354447
     
    364457    if(isset($_POST['margin_bottom'])){
    365458        update_post_meta($post_id, $prefix.'margin_bottom', sanitize_text_field($_POST['margin_bottom']));
     459    }
     460    if(isset($_POST['margin_left'])){
     461        update_post_meta($post_id, $prefix.'margin_left', sanitize_text_field($_POST['margin_left']));
    366462    }
    367463    if(isset($_POST['margin_right'])){
     
    438534    {
    439535    $prefix = '_floating_div_';
    440     $div_content = get_post_meta( get_the_id(), $prefix . 'content', true );
    441     $div_width = get_post_meta( get_the_id(), $prefix . 'width', true );
    442     if ($div_width == '')
    443         $div_width = '260px';
    444     $div_width_class = "psfd_width_".$div_width;
    445 
    446     $div_corners = get_post_meta( get_the_id(), $prefix . 'corners', true );
    447     $div_position = get_post_meta( get_the_id(), $prefix . 'position', true );
    448     if ($div_position == '')
    449         $div_position = 'top_right';
    450    
    451     if ($div_position == 'top_right')
     536    $all_pages = get_post_meta( get_the_id(), $prefix.'all_pages',true);
     537    if ($all_pages == '')
     538        $all_pages = 'no';
     539   
     540    if($all_pages == "no")
    452541    {
    453         $div_margin_top = get_post_meta( get_the_id(), $prefix . 'margin_top', true );
    454         if ($div_margin_top == "")
    455             $div_margin_top = 0;
    456     }
    457     if ($div_position == 'bottom_right')
    458     {
    459         $div_margin_bottom = get_post_meta( get_the_id(), $prefix . 'margin_bottom', true );
    460         if ($div_margin_bottom == "")
    461             $div_margin_bottom = 0;
    462     }   
    463 
    464     $div_margin_right = get_post_meta( get_the_id(), $prefix . 'margin_right', true );
    465     if ($div_margin_right == "")
    466         $div_margin_right = 0;
    467    
    468     $div_borders = get_post_meta( get_the_id(), $prefix.'borders',true);
    469     $div_border_color = get_post_meta( get_the_id(), $prefix . 'border_color', true );
    470    
    471     if($div_borders == "yes" || $div_borders == "")
    472         $border_class = 'border:2px solid '.$div_border_color.';';
    473     if($div_borders == "no")
    474         $border_class = 'border-style: none;';
    475 
    476     $div_background = get_post_meta( get_the_id(), $prefix . 'background', true );
    477 
    478     if ($div_background == '')
    479         $div_background = 'color';
    480     $background = 'background:#FFFFFF';
    481     if ($div_background == 'color')
    482     {
    483         $div_background_color = get_post_meta( get_the_id(), $prefix . 'background_color', true );
    484         $background = 'background:'.$div_background_color.'';
    485     }
    486    
    487     if ($div_background == 'image')
    488     {
    489         $div_image = get_post_meta( get_the_id(), $prefix.'image',true);
    490         $background = 'background-image:url('.esc_attr($div_image).')';
    491     }
    492        
    493     $postid = get_the_ID();
    494    
    495     $css_position = '';
    496     switch ($div_position) {
    497     case 'top_right':
    498         $css_position .= 'right:'.$div_margin_right.'px;';   
    499         $css_position .= 'top:'.$div_margin_top.'px;'; 
    500         break;
    501     case 'bottom_right':
    502         $css_position .= 'right:'.$div_margin_right.'px;';   
    503         $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 
    504         break;
    505     default:
    506         $css_position .= 'right:10px;';   
    507         $css_position .= 'top:10px;'; 
    508     }
    509    
    510     $output = '';
    511 
    512     $output .= '<div id="floatdiv_'.$postid.'" class="exp_floatdiv_content_pro '.$div_width_class.'" style="'.$css_position.';'.$border_class.'border-radius:'.esc_attr( $div_corners).';'.$background.';">';
    513     $output .= ''. psfd_get_wysiwyg_output_pro( $prefix . 'content', get_the_ID() )  .'';
    514     $output .= '</div>';
    515    
     542        $div_content = get_post_meta( get_the_id(), $prefix . 'content', true );
     543        $div_width = get_post_meta( get_the_id(), $prefix . 'width', true );
     544        if ($div_width == '')
     545            $div_width = '260px';
     546        $div_width_class = "psfd_width_".$div_width;
     547
     548        $div_corners = get_post_meta( get_the_id(), $prefix . 'corners', true );
     549        $div_position = get_post_meta( get_the_id(), $prefix . 'position', true );
     550        if ($div_position == '')
     551            $div_position = 'top_right';
     552        if (in_array($div_position, array('top_right', 'top', 'top_left'), true))
     553        {
     554            $div_margin_top = get_post_meta( get_the_id(), $prefix . 'margin_top', true );
     555            if ($div_margin_top == "")
     556                $div_margin_top = 0;
     557        }
     558        if (in_array($div_position, array('top_right', 'bottom_right'), true))
     559        {
     560            $div_margin_right = get_post_meta( get_the_id(), $prefix . 'margin_right', true );
     561            if ($div_margin_right == "")
     562                $div_margin_right = 0;
     563        }
     564        if (in_array($div_position, array('top_left', 'bottom_left'), true))
     565        {
     566            $div_margin_left = get_post_meta( get_the_id(), $prefix . 'margin_left', true );
     567            if ($div_margin_left == "")
     568                $div_margin_left = 0;
     569        }
     570        if (in_array($div_position, array('bottom_right', 'bottom', 'bottom_left'), true))
     571        {
     572            $div_margin_bottom = get_post_meta( get_the_id(), $prefix . 'margin_bottom', true );
     573            if ($div_margin_bottom == "")
     574                $div_margin_bottom = 0;
     575        }
     576       
     577        $div_borders = get_post_meta( get_the_id(), $prefix.'borders',true);
     578        $div_border_color = get_post_meta( get_the_id(), $prefix . 'border_color', true );
     579        if($div_border_color == "")
     580            $div_border_color = '#000000';
     581       
     582        if($div_borders == "yes" || $div_borders == "")
     583            $border_class = 'border:2px solid '.$div_border_color.'';
     584       
     585        if($div_borders == "no")
     586            $border_class = "border-style:none";
     587
     588        $div_background = get_post_meta( get_the_id(), $prefix . 'background', true );
     589
     590        if ($div_background == '')
     591            $div_background = 'color';
     592        $background = 'background:#FFFFFF';
     593        if ($div_background == 'color')
     594        {
     595            $div_background_color = get_post_meta( get_the_id(), $prefix . 'background_color', true );
     596            if($div_background_color == "")
     597                $div_background_color = '#FFFFFF';
     598            $background = 'background:'.$div_background_color.'';
     599        }
     600       
     601        if ($div_background == 'image')
     602        {
     603            $div_image = get_post_meta( get_the_id(), $prefix.'image',true);
     604            $background = 'background-image:url('.esc_attr($div_image).')';
     605        }
     606           
     607        $postid = get_the_ID();
     608       
     609        $css_position = '';
     610        switch ($div_position) {
     611        case 'top_right':
     612            $css_position .= 'right:'.$div_margin_right.'px;';   
     613            $css_position .= 'top:'.$div_margin_top.'px;'; 
     614            break;
     615        case 'top':
     616            $css_position .= 'top:'.$div_margin_top.'px;'; 
     617            $css_position .= 'left:50%;margin-left:-'. $div_width / 2 . 'px;';
     618            break;
     619        case 'top_left':
     620            $css_position .= 'left:'.$div_margin_left.'px;'; 
     621            $css_position .= 'top:'.$div_margin_top.'px;'; 
     622            break;
     623        case 'bottom_right':
     624            $css_position .= 'right:'.$div_margin_right.'px;';   
     625            $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 
     626            break;
     627        case 'bottom':
     628            $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 
     629            $css_position .= 'left:50%;margin-left:-'. $div_width / 2 . 'px;';
     630            break;
     631        case 'bottom_left':
     632            $css_position .= 'left:'.$div_margin_left.'px;';   
     633            $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 
     634            break;
     635        default:
     636            $css_position .= 'right:10px;';   
     637            $css_position .= 'top:10px;'; 
     638        }
     639        $output = '';
     640       
     641        $output .= '<div id="floatdiv_'.$postid.'" class="exp_floatdiv_content_pro '.$device_restrict_no_tablet.' '.$device_restrict_no_desktop.' '.$device_restrict_no_mobile.' '.$force_font_class.' '.$div_width_class.'" style="'.$css_position.';border-radius:'.esc_attr( $div_corners).';'.$background.';">';
     642        $output .= '<div class="exp_floatdiv_content_padding_pro" style="'.$border_class.';border-radius:'.esc_attr( $div_corners).';">';
     643        $output .= ''. psfd_get_wysiwyg_output_pro( $prefix . 'content', get_the_ID() )  .'';
     644        $output .= '</div>';
     645        $output .= '</div>';
     646       
     647        $output .= '<script type="text/javascript">';
     648        $output .= '$j=jQuery.noConflict();';
     649        $output .= '$j(document).ready(function()';
     650        $output .= '{';                 
     651        $output .= '$j("#floatdiv_'.$postid.'").appendTo("body");';
     652        $output .= 'var height = $j("#floatdiv_'.$postid.'").height();';
     653        $output .= '$j("#floatdiv_'.$postid.'").height(height);';       
     654        $output .= '})';   
     655        $output .= '</script>';
     656    }
     657   
    516658    }
    517659    endforeach; wp_reset_query();
     
    520662add_shortcode( 'floating_div_ps', 'psfd_shortcode' );
    521663
     664function psfd_footer() {
     665    global $post;
     666    $args = array('post_type' => 'floating_div_ps', 'numberposts'=>-1);
     667    $custom_posts = get_posts($args);
     668    $output = '';
     669    foreach($custom_posts as $post) : setup_postdata($post);
     670
     671    $prefix = '_floating_div_';
     672    $all_pages = get_post_meta( get_the_id(), $prefix.'all_pages',true);
     673    if ($all_pages == '')
     674        $all_pages = 'no';
     675   
     676    if($all_pages == "yes")
     677    {
     678        $div_content = get_post_meta( get_the_id(), $prefix . 'content', true );
     679        $div_width = get_post_meta( get_the_id(), $prefix . 'width', true );
     680        if ($div_width == '')
     681            $div_width = '260px';
     682        $div_width_class = "psfd_width_".$div_width;
     683
     684        $div_corners = get_post_meta( get_the_id(), $prefix . 'corners', true );
     685        $div_position = get_post_meta( get_the_id(), $prefix . 'position', true );
     686        if ($div_position == '')
     687            $div_position = 'top_right';
     688        if (in_array($div_position, array('top_right', 'top', 'top_left'), true))
     689        {
     690            $div_margin_top = get_post_meta( get_the_id(), $prefix . 'margin_top', true );
     691            if ($div_margin_top == "")
     692                $div_margin_top = 0;
     693        }
     694        if (in_array($div_position, array('top_right', 'bottom_right'), true))
     695        {
     696            $div_margin_right = get_post_meta( get_the_id(), $prefix . 'margin_right', true );
     697            if ($div_margin_right == "")
     698                $div_margin_right = 0;
     699        }
     700        if (in_array($div_position, array('top_left', 'bottom_left'), true))
     701        {
     702            $div_margin_left = get_post_meta( get_the_id(), $prefix . 'margin_left', true );
     703            if ($div_margin_left == "")
     704                $div_margin_left = 0;
     705        }
     706        if (in_array($div_position, array('bottom_right', 'bottom', 'bottom_left'), true))
     707        {
     708            $div_margin_bottom = get_post_meta( get_the_id(), $prefix . 'margin_bottom', true );
     709            if ($div_margin_bottom == "")
     710                $div_margin_bottom = 0;
     711        }   
     712       
     713        $div_borders = get_post_meta( get_the_id(), $prefix.'borders',true);
     714        $div_border_color = get_post_meta( get_the_id(), $prefix . 'border_color', true );
     715        if($div_border_color == "")
     716            $div_border_color = '#000000';
     717       
     718        if($div_borders == "yes" || $div_borders == "")
     719            $border_class = 'border:2px solid '.$div_border_color.'';
     720       
     721        if($div_borders == "no")
     722            $border_class = "border-style:none";
     723
     724        $div_background = get_post_meta( get_the_id(), $prefix . 'background', true );
     725
     726        if ($div_background == '')
     727            $div_background = 'color';
     728        $background = 'background:#FFFFFF';
     729        if ($div_background == 'color')
     730        {
     731            $div_background_color = get_post_meta( get_the_id(), $prefix . 'background_color', true );
     732            if($div_background_color == "")
     733                $div_background_color = '#FFFFFF';
     734            $background = 'background:'.$div_background_color.'';
     735        }
     736       
     737        if ($div_background == 'image')
     738        {
     739            $div_image = get_post_meta( get_the_id(), $prefix.'image',true);
     740            $background = 'background-image:url('.esc_attr($div_image).')';
     741        }
     742           
     743        $postid = get_the_ID();
     744       
     745        $css_position = '';
     746        switch ($div_position) {
     747        case 'top_right':
     748            $css_position .= 'right:'.$div_margin_right.'px;';   
     749            $css_position .= 'top:'.$div_margin_top.'px;'; 
     750            break;
     751        case 'top':
     752            $css_position .= 'top:'.$div_margin_top.'px;'; 
     753            $css_position .= 'left:50%;margin-left:-'. $div_width / 2 . 'px;';
     754            break;
     755        case 'top_left':
     756            $css_position .= 'left:'.$div_margin_left.'px;'; 
     757            $css_position .= 'top:'.$div_margin_top.'px;'; 
     758            break;
     759        case 'bottom_right':
     760            $css_position .= 'right:'.$div_margin_right.'px;';   
     761            $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 
     762            break;
     763        case 'bottom':
     764            $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 
     765            $css_position .= 'left:50%;margin-left:-'. $div_width / 2 . 'px;';
     766            break;
     767        case 'bottom_left':
     768            $css_position .= 'left:'.$div_margin_left.'px;';   
     769            $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 
     770            break;
     771        default:
     772            $css_position .= 'right:10px;';   
     773            $css_position .= 'top:10px;'; 
     774        }
     775
     776        $output = '';
     777       
     778        $output .= '<div id="floatdiv_'.$postid.'" class="exp_floatdiv_content_pro '.$device_restrict_no_tablet.' '.$device_restrict_no_desktop.' '.$device_restrict_no_mobile.' '.$force_font_class.' '.$div_width_class.'" style="'.$css_position.';border-radius:'.esc_attr( $div_corners).';'.$background.';">';
     779        $output .= '<div class="exp_floatdiv_content_padding_pro" style="'.$border_class.';border-radius:'.esc_attr( $div_corners).';">';
     780        $output .= ''. psfd_get_wysiwyg_output_pro( $prefix . 'content', get_the_ID() )  .'';
     781        $output .= '</div>';
     782        $output .= '</div>';
     783       
     784        $output .= '<script type="text/javascript">';
     785        $output .= '$j=jQuery.noConflict();';
     786        $output .= '$j(document).ready(function()';
     787        $output .= '{';                 
     788        $output .= '$j("#floatdiv_'.$postid.'").appendTo("body");';
     789        $output .= 'var height = $j("#floatdiv_'.$postid.'").height();';
     790        $output .= '$j("#floatdiv_'.$postid.'").height(height);';
     791       
     792        $output .= '})';   
     793        $output .= '</script>';
     794
     795    }
     796   
     797    endforeach; wp_reset_query();
     798    echo $output;
     799}
     800add_action( 'wp_footer', 'psfd_footer' );
     801
    522802
    523803   
  • floating-div/trunk/readme.txt

    r1710932 r1720418  
    44Requires at least: 3.6
    55Tested up to: 4.8.1
    6 Stable tag: 2.1
     6Stable tag: 3.0
    77License: GPL2
    88License URI: http://www.gnu.org/licenses/gpl.html
     
    4242
    43431. Make your div collapsible.
    44 2. There will be different location for the div (top right, bottom, etc…).
    45 3. Use your own theme font.
    46 4. Show/hide the table for different types of devices (desktop computer, tablets, smartphones).
    47 5. Choose who sees what. Only allow Guest/Logged In users to see the table.
    48 6. A Technical support for setting up and implementing the plugin.
    49 7. That's where you will find the [PRO version](http://pluginlyspeaking.com/plugins/floating-div/)
     442. Reveal your div after some time.
     453. Hide your div after some time.
     464. There will be different location for the div (top right, bottom, etc…).
     475. Use your own theme font.
     486. Show/hide the floating div for different types of devices (desktop computer, tablets, smartphones).
     497. Choose who sees what. Only allow Guest/Logged In users to see the floating div.
     508. A Technical support for setting up and implementing the plugin.
     519. That's where you will find the [PRO version](http://pluginlyspeaking.com/plugins/floating-div/)
    5052
    5153= Here is an example of the possible uses : =
     
    7880== Changelog ==
    7981
     82= 3.0 =
     83* Show on all pages feature
     84* Minors css updates
     85
    8086= 2.0.1 =
    8187* Minors css updates
Note: See TracChangeset for help on using the changeset viewer.