Plugin Directory

Changeset 564151


Ignore:
Timestamp:
06/26/2012 05:32:35 PM (14 years ago)
Author:
kankod
Message:
  • Added support for the Bootstrap Javascript library
  • Added support for the Jquery dependencies, if site is missing the jquery library needed to run bootstrap.
  • enhanced admin menu.
  • bug fixes.
Location:
bootstrap-for-wordpress/trunk/bootstrapForWordpress
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • bootstrap-for-wordpress/trunk/bootstrapForWordpress/bootstrap.php

    r563609 r564151  
    44Plugin URI: http://www.kankod.com/bootstrapWP
    55Description: Bootstrap for wordpress plugin enables the Twitter bootstrap library for your wordpress site
    6 Version: 0.1
     6Version: 0.11
    77Author: kankod.com
    88*/
     
    1414
    1515function bootstrap_filter_footer() {
     16    $bootstrapJS = get_option('bootstrapJS');
     17    $bootstrapJQ = get_option('bootstrapJQ');
    1618    $bootstrapUrl = get_option('bootstrapURL');
    1719    $bootstrap_enabled = get_option('bootstrapEN');
     
    2527        wp_enqueue_style( 'bootstrap' );
    2628    }
     29
     30    if ($bootstrapJQ) {
     31            wp_enqueue_script('btJQ', plugins_url('js/bsjq.js', __FILE__), false, false, true );       
     32    }
     33   
     34    if ($bootstrapJS) {
     35            wp_enqueue_script('btJS', plugins_url('js/bs.js', __FILE__), false, false, true );     
     36    }
    2737}
    2838
     
    3444    $bootstrapCssUrl = get_option('bootstrapURL');
    3545    $bootstrap_enabled = get_option('bootstrapEN');
     46    $bootstrapJQ = get_option('bootstrapJQ');
     47    $bootstrapJS = get_option('bootstrapJS');
    3648    if ( isset($_POST['submit']) ) {
    3749        if (isset($_POST['bootstrap_enabled']))
     
    5163        }
    5264       
     65        if (isset($_POST['bootstrapJQ']))
     66        {
     67            if ($_POST['bootstrapJQ'] == 'on')
     68            {
     69                $bootstrapJQ = 1;
     70            }
     71            else
     72            {
     73                $bootstrapJQ = 0;
     74            }
     75        }
     76
     77        else
     78        {
     79            $bootstrapJQ = 0;
     80        }       
     81       
     82        if (isset($_POST['bootstrapJS']))
     83        {
     84            if ($_POST['bootstrapJS'] == 'on')
     85            {
     86                $bootstrapJS = 1;
     87            }
     88            else
     89            {
     90                $bootstrapJS = 0;
     91            }
     92        }
     93       
     94        else
     95        {
     96            $bootstrapJS = 0;
     97        }       
     98       
    5399        $bootstrapCssUrl = $_POST['bootstrapCssUrl'];
     100       
     101        update_option('bootstrapJS', $bootstrapJS);
     102        update_option('bootstrapJQ', $bootstrapJQ);
    54103        update_option('bootstrapEN', $bootstrap_enabled);
    55104        update_option('bootstrapURL', $bootstrapCssUrl);
     
    60109    }
    61110    ?>
    62     <div class="wrap">
     111    <div class="wrap" style="width:99%;">
    63112        <h2>Bootstrap for WordPress Configuration</h2>
    64         <div class="postbox-container">
     113        <div class="postbox-container" style="width:100%;">
    65114            <div class="metabox-holder">   
    66115                <div class="meta-box-sortables">
     
    71120                        <div class="inside">
    72121                            <table class="form-table">
    73                                 <tr><th valign="top" scrope="row">Bootstrap On/Off:</th>
    74                                 <td valign="top"><input type="checkbox" id="" name="bootstrap_enabled" <?php echo ($bootstrap_enabled ? 'checked="checked"' : ''); ?> /> <label for="enabled">Enable or disable Bootstrap</label><br/></td></tr>
    75                                 <tr><th valign="top" scrope="row"><label for="toolbarpath">bootstrap Path:</label></th>
     122                                <tr><th valign="top" scrope="row">Bootstrap CSS On/Off:</th>
     123                                <td valign="top"><input type="checkbox" id="" name="bootstrap_enabled" <?php echo ($bootstrap_enabled ? 'checked="checked"' : ''); ?> /> <label for="enabled">Enable or disable Bootstrap CSS</label><br/></td></tr>
     124
     125                                <tr><th valign="top" scrope="row"><label for="toolbarpath">Custom bootstrap CSS URL (optional):</label></th>
    76126                                <td valign="top"><input id="bootstrapCssUrl" name="bootstrapCssUrl" type="text" size="20" value="<?php echo $bootstrapCssUrl; ?>"/></td></tr>
     127                               
     128                                <tr><th valign="top" scrope="row">Bootstrap JS On/Off:</th>
     129                                <td valign="top"><input type="checkbox" id="" name="bootstrapJS" <?php echo ($bootstrapJS ? 'checked="checked"' : ''); ?> /> <label for="enabled">Enable or disable Bootstrap JS</label><br/></td></tr>
     130                               
     131                                <tr><th valign="top" scrope="row">Include jQuery</th>
     132                                <td valign="top"><input type="checkbox" id="" name="bootstrapJQ" <?php echo ($bootstrapJQ ? 'checked="checked"' : ''); ?> /> <label for="enabled">Include jQuery</label><br/></td></tr>
    77133
    78134                            </table>
  • bootstrap-for-wordpress/trunk/bootstrapForWordpress/readme.txt

    r563614 r564151  
    1414== Description ==
    1515
    16 Boost your site with the Twitter Bootstrap CSS library.
    17 Use the latest stable version or set your own CSS version using a custom URL.
     16Boost your site with the Twitter Bootstrap Javascript and CSS library.
     17
     18-- Use the latest stable version or set your own custom CSS. --
     19-- Includes the Javascript bootstrap APIS  --
     20-- Includes the jQuery dependencies file (incase your site does not have jQuery installed) --
    1821
    1922
    20 What is Twitter bootstrap ?
    2123
    22 From Twitter Bootstrap:
     24---------------------- What is Twitter bootstrap ? ----------------------
     25
     26
     27
     28
     29------- From Twitter Bootstrap:
    2330
    2431"Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites.
     
    2835
    2936
    30 Why Bootstrap?
     37------- Why Bootstrap?
    3138
    3239Designed for everyone, everywhere.
     
    69762. Activate the plugin through the 'Plugins' menu in WordPress
    70773. Under your 'Themes' Menu choose Bootstrap
    71 4. Check the 'Enable Bootstrap' box
    72 5. To load custom bootstrap theme using a different url Replace 'Bootstrap Path' with your Bootstrap css URL.
     784. customize your bootstrap from the Bootstrap for wordpress admin interface.
Note: See TracChangeset for help on using the changeset viewer.