Plugin Directory

Changeset 233405


Ignore:
Timestamp:
04/25/2010 11:04:00 AM (16 years ago)
Author:
hanok
Message:

Version 0.3 Live Preview

Location:
wp-facebook-like-button/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • wp-facebook-like-button/trunk/facebook-like-button.php

    r233192 r233405  
    44Plugin URI: http://www.dolcebita.com/wordpress/facebook-like-button/
    55Description: The Like button enables users to make connections to your pages and share content back to their friends on Facebook with one click.
    6 Version: 0.2
     6Version: 0.3
    77Author: Marcos Esperon
    88Author URI: http://www.dolcebita.com/
     
    3535  $colorscheme = (get_option('fl_colorscheme') == null) ? 'light' : get_option('fl_colorscheme');
    3636  $locale = (get_option('fl_locale') == null) ? '' : get_option('fl_locale');
     37  $style = (get_option('fl_style') == null) ? '' : get_option('fl_style');
    3738 
    38   $output = '<iframe src="http://www.facebook.com/plugins/like.php?href='.$url.'&amp;layout='.$layout.'&amp;show_faces='.$show_faces.'&amp;width='.$width.'&amp;action='.$action.'&amp;font='.$font.'&amp;colorscheme='.$colorscheme.'&amp;locale='.$locale.'" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:'.$width.'px; height:'.$height.'px"></iframe>';
     39  $output = '<div id="fb-like" style="'.$style.'"><iframe src="http://www.facebook.com/plugins/like.php?href='.$url.'&amp;layout='.$layout.'&amp;show_faces='.$show_faces.'&amp;width='.$width.'&amp;action='.$action.'&amp;font='.$font.'&amp;colorscheme='.$colorscheme.'&amp;locale='.$locale.'" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:'.$width.'px; height:'.$height.'px"></iframe></div>';
    3940 
    4041  return $output;
     
    99100            ?>
    100101            <input type="hidden" name="action" value="update" />
    101             <input type="hidden" name="page_options" value="fl_display_post,fl_display_page,fl_display_front,fl_where,fl_layout,fl_show_faces,fl_width,fl_height,fl_action,fl_font,fl_colorscheme,fl_locale" />
     102            <input type="hidden" name="page_options" value="fl_display_post,fl_display_page,fl_display_front,fl_where,fl_layout,fl_show_faces,fl_width,fl_height,fl_action,fl_font,fl_colorscheme,fl_locale,fl_style" />
    102103            <?php
    103104        }
    104105    ?>
    105         <p><em>If you have any problem or suggestion please leave your comment at <a href="http://www.dolcebita.com/wordpress/facebook-like-button/">dolcebita.com</a>.</em></p>
     106        <p><em>If you have any problem or suggestion please leave your comment at <a href="http://www.dolcebita.com/wordpress/facebook-like-button/">dolcebita.com</a> or visit <a href="http://developers.facebook.com/docs/reference/plugins/like">http://developers.facebook.com/docs/reference/plugins/like</a>.</em></p>
    106107        <h3>Options</h3>
    107108        <table class="form-table" cellspacing="2" cellpadding="5" width="100%">
     
    112113                    </th>
    113114                    <td>
    114                         <p>
    115                             <input type="checkbox" value="1" <?php if (get_option('fl_display_post') == '1') echo 'checked="checked"'; ?> name="fl_display_post" id="fl_display_post" group="fl_display"/>
    116                             <label for="fl_display_post">Display the URL on posts</label>
    117                         </p>
    118                       <p>
    119                             <input type="checkbox" value="1" <?php if (get_option('fl_display_page') == '1') echo 'checked="checked"'; ?> name="fl_display_page" id="fl_display_page" group="fl_display"/>
    120                             <label for="fl_display_page">Display the URL on pages</label>
    121                         </p>
    122                         <p>
    123                             <input type="checkbox" value="1" <?php if (get_option('fl_display_front') == '1') echo 'checked="checked"'; ?> name="fl_display_front" id="fl_display_front" group="fl_display"/>
    124                             <label for="fl_display_front">Display the URL on the front page (home)</label>
    125                         </p>
     115                        <input type="checkbox" value="1" <?php if (get_option('fl_display_post') == '1') echo 'checked="checked"'; ?> name="fl_display_post" id="fl_display_post" group="fl_display" onblur="preview();"/>
     116                        <label for="fl_display_post">Display the URL on posts</label>
     117                        <br />
     118                        <input type="checkbox" value="1" <?php if (get_option('fl_display_page') == '1') echo 'checked="checked"'; ?> name="fl_display_page" id="fl_display_page" group="fl_display" onblur="preview();"/>
     119                        <label for="fl_display_page">Display the URL on pages</label>
     120                        <br />
     121                        <input type="checkbox" value="1" <?php if (get_option('fl_display_front') == '1') echo 'checked="checked"'; ?> name="fl_display_front" id="fl_display_front" group="fl_display" onblur="preview();"/>
     122                        <label for="fl_display_front">Display the URL on the front page (home)</label>
    126123                    </td>
    127124                </tr>
     
    130127                </th>
    131128                <td>
    132                     <p>
    133                         <select name="fl_where">
    134                             <option <?php if (get_option('fl_where') == 'before') echo 'selected="selected"'; ?> value="before">Before</option>
    135                             <option <?php if (get_option('fl_where') == 'after') echo 'selected="selected"'; ?> value="after">After</option>
    136                             <option <?php if (get_option('fl_where') == 'beforeandafter') echo 'selected="selected"'; ?> value="beforeandafter">Before and After</option>
    137                         </select>
    138                     </p>
     129                  <select name="fl_where" id="fl_where" onchange="preview();">
     130                    <option <?php if (get_option('fl_where') == 'before') echo 'selected="selected"'; ?> value="before">Before</option>
     131                    <option <?php if (get_option('fl_where') == 'after') echo 'selected="selected"'; ?> value="after">After</option>
     132                    <option <?php if (get_option('fl_where') == 'beforeandafter') echo 'selected="selected"'; ?> value="beforeandafter">Before and After</option>
     133                  </select>
    139134                </td>
    140135            </tr>
     
    144139                </th>
    145140                <td>
    146                     <p>
    147                         <select name="fl_layout">
    148                             <option <?php if (get_option('fl_layout') == 'standard') echo 'selected="selected"'; ?> value="standard">Standard</option>
    149                             <option <?php if (get_option('fl_layout') == 'button_count') echo 'selected="selected"'; ?> value="button_count">Button Count</option>                         
    150                         </select>
    151                     </p>
     141                  <select name="fl_layout" id="fl_layout" onchange="preview();">
     142                    <option <?php if (get_option('fl_layout') == 'standard') echo 'selected="selected"'; ?> value="standard">Standard</option>
     143                    <option <?php if (get_option('fl_layout') == 'button_count') echo 'selected="selected"'; ?> value="button_count">Button Count</option>                         
     144                  </select>
    152145                </td>
    153146            </tr>             
     
    157150                </th>
    158151                <td>
    159                     <p>
    160                         <input type="checkbox" value="1" <?php if (get_option('fl_show_faces') == '1') echo 'checked="checked"'; ?> name="fl_show_faces" id="fl_show_faces" />                       
    161                     </p>
     152                    <input type="checkbox" value="1" <?php if (get_option('fl_show_faces') == '1') echo 'checked="checked"'; ?> name="fl_show_faces" id="fl_show_faces" onclick="preview();" />                       
    162153                </td>
    163154            </tr>
     
    167158                </th>
    168159                <td>
    169                     <p>
    170                         <input type="text" value="<?php echo get_option('fl_width'); ?>" name="fl_width" id="fl_width" size="5" /> px
    171                     </p>
     160                    <input type="text" value="<?php echo get_option('fl_width'); ?>" name="fl_width" id="fl_width" size="5" onblur="preview();" /> px
    172161                </td>
    173162            </tr>
     
    177166                </th>
    178167                <td>
    179                     <p>
    180                         <input type="text" value="<?php echo get_option('fl_height'); ?>" name="fl_height" id="fl_height" size="5" /> px
    181                     </p>
     168                    <input type="text" value="<?php echo get_option('fl_height'); ?>" name="fl_height" id="fl_height" size="5" onblur="preview();" /> px
    182169                </td>
    183170            </tr>
     
    186173                    Verb to Display
    187174                </th>
    188                 <td>
    189                     <p>
    190                         <select name="fl_action">
    191                             <option <?php if (get_option('fl_action') == 'like') echo 'selected="selected"'; ?> value="like">Like</option>
    192                             <option <?php if (get_option('fl_action') == 'recommend') echo 'selected="selected"'; ?> value="recommend">Recommend</option>                           
    193                         </select>
    194                     </p>
     175                <td>                   
     176                  <select name="fl_action" id="fl_action" onchange="preview();">
     177                    <option <?php if (get_option('fl_action') == 'like') echo 'selected="selected"'; ?> value="like">Like</option>
     178                    <option <?php if (get_option('fl_action') == 'recommend') echo 'selected="selected"'; ?> value="recommend">Recommend</option>                           
     179                  </select>
    195180                </td>
    196181            </tr>
     
    200185                </th>
    201186                <td>
    202                     <p>
    203                         <select name="fl_font">
    204                             <option <?php if (get_option('fl_font') == '') echo 'selected="selected"'; ?> value=""></option>
    205                             <option <?php if (get_option('fl_font') == 'arial') echo 'selected="selected"'; ?> value="arial">Arial</option>                         
    206                       <option <?php if (get_option('fl_font') == 'lucida grande') echo 'selected="selected"'; ?> value="lucida grande">Lucida Grande</option>
    207                             <option <?php if (get_option('fl_font') == 'segoe ui') echo 'selected="selected"'; ?> value="segoe ui">Segoe UI</option>                           
    208                       <option <?php if (get_option('fl_font') == 'tahoma') echo 'selected="selected"'; ?> value="tahoma">Tahoma</option>
    209                             <option <?php if (get_option('fl_font') == 'trebuchet+ms') echo 'selected="selected"'; ?> value="trebuchet+ms">Trebuchet MS</option>                           
    210                       <option <?php if (get_option('fl_font') == 'verdana') echo 'selected="selected"'; ?> value="verdana">Verdana</option>                         
    211                         </select>
    212                     </p>
     187                  <select name="fl_font" id="fl_font" onchange="preview();">
     188                    <option <?php if (get_option('fl_font') == '') echo 'selected="selected"'; ?> value=""></option>
     189                    <option <?php if (get_option('fl_font') == 'arial') echo 'selected="selected"'; ?> value="arial">Arial</option>                         
     190                    <option <?php if (get_option('fl_font') == 'lucida grande') echo 'selected="selected"'; ?> value="lucida grande">Lucida Grande</option>
     191                    <option <?php if (get_option('fl_font') == 'segoe ui') echo 'selected="selected"'; ?> value="segoe ui">Segoe UI</option>                           
     192                    <option <?php if (get_option('fl_font') == 'tahoma') echo 'selected="selected"'; ?> value="tahoma">Tahoma</option>
     193                    <option <?php if (get_option('fl_font') == 'trebuchet+ms') echo 'selected="selected"'; ?> value="trebuchet+ms">Trebuchet MS</option>                           
     194                    <option <?php if (get_option('fl_font') == 'verdana') echo 'selected="selected"'; ?> value="verdana">Verdana</option>                           
     195                  </select>
    213196                </td>
    214197            </tr>
     
    218201                </th>
    219202                <td>
    220                     <p>
    221                         <select name="fl_colorscheme">
    222                             <option <?php if (get_option('fl_colorscheme') == 'light') echo 'selected="selected"'; ?> value="light">Light</option>
    223                             <option <?php if (get_option('fl_colorscheme') == 'dark') echo 'selected="selected"'; ?> value="dark">Dark</option>                         
    224                         </select>
    225                     </p>
     203                  <select name="fl_colorscheme" id="fl_colorscheme" onchange="preview();">
     204                    <option <?php if (get_option('fl_colorscheme') == 'light') echo 'selected="selected"'; ?> value="light">Light</option>
     205                    <option <?php if (get_option('fl_colorscheme') == 'dark') echo 'selected="selected"'; ?> value="dark">Dark</option>                         
     206                  </select>
    226207                </td>
    227208            </tr>
     
    231212                </th>
    232213                <td>
    233                     <p>
    234                         <input type="text" value="<?php echo get_option('fl_locale'); ?>" name="fl_locale" id="fl_locale" size="5" /> (en_US, es_ES, gl_ES, it_IT, fr_FR...)
    235                     </p>
     214                    <input type="text" value="<?php echo get_option('fl_locale'); ?>" name="fl_locale" id="fl_locale" size="5" onblur="preview();" /> (en_US, es_ES, gl_ES, it_IT, fr_FR...)
     215                </td>
     216            </tr>
     217            <tr>
     218                <th scope="row">
     219                    CSS Style
     220                </th>
     221                <td>
     222                    <input type="text" value="<?php echo get_option('fl_style'); ?>" name="fl_style" id="fl_style" onblur="preview();" />
     223                    <span class="description">Add additional CSS style to the div.</span>
    236224                </td>
    237225            </tr>
     
    241229        </p>
    242230    </form>
     231    <h3>Preview</h3>
     232    <div id="fl_preview"></div>
    243233    </div>
    244234<?php
    245235}
     236
     237function fl_admin_head() { ?>
     238
     239<script type="text/javascript">
     240jQuery(document).ready(function() {     
     241    preview();
     242});
     243
     244function preview() {
     245    var style   = jQuery('#fl_style').val();
     246    var layout  = jQuery('#fl_layout').val();
     247    var faces   = jQuery('#fl_show_faces').is(':checked') ? true : false;
     248    var width   = jQuery('#fl_width').val();
     249    var height  = jQuery('#fl_height').val();
     250    var verb    = jQuery('#fl_action').val();
     251    var font    = jQuery('#fl_font').val();
     252    var color   = jQuery('#fl_colorscheme').val();
     253  var locale    = jQuery('#fl_locale').val();
     254   
     255    var output  = '<div class="fl-like" style="'+ style +'"><iframe src="http://www.facebook.com/plugins/like.php?href=&amp;layout='+ layout +'&amp;show_faces='+ faces +'&amp;width='+ width +'&amp;action='+ verb +'&amp;font='+ font +'&amp;colorscheme='+ color +'&amp;locale='+ locale +'" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:'+ width +'px; height:'+ height +'px"></iframe></div>';
     256   
     257    jQuery('#fl_preview').html(output);
     258}
     259</script>
     260   
     261<?php }
    246262
    247263function fl_init(){
     
    265281    add_action('admin_init', 'fl_init');
    266282    add_action('admin_menu', 'fl_option_page');
     283      add_action('admin_head', 'fl_admin_head');
    267284}
    268285
  • wp-facebook-like-button/trunk/readme.txt

    r233247 r233405  
    44Requires at least: 2.0.0
    55Tested up to: 2.9
    6 Stable tag: 0.2
     6Stable tag: 0.3
    77 
    88The Like button enables users to make connections to your pages and share content back to their friends on Facebook with one click.
     9
     10More info at: http://www.dolcebita.com/wordpress/facebook-like-button/
    911
    1012== Description ==
     
    2426
    2527== Screenshots ==
    26 1. Facebook Like Button
     281. Options
     29
     302. Facebook Like Button
    2731
    2832== Changelog == 
     33
     34= 0.3 = 
     35* Additional CSS support.
     36* Live preview in the Settings page.
    2937
    3038= 0.2 = 
Note: See TracChangeset for help on using the changeset viewer.