Plugin Directory

Changeset 714378


Ignore:
Timestamp:
05/17/2013 01:37:16 PM (13 years ago)
Author:
Skyree
Message:
  • Version 1.0.2 - see changelog
  • Replacing screenshot-1.jpg
Location:
section-page
Files:
18 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • section-page/trunk/assets/base.css

    r709968 r714378  
    11.owc-section-page {
    2     overflow: hidden;
    3     border-bottom: 1px solid #ccc;
     2  overflow: hidden;
     3  border-bottom: 1px solid #ccc;
    44}
    55.owc-section-page .owc-sp-open {
    6     overflow: hidden;
    7     cursor: pointer;
     6  overflow: hidden;
     7  cursor: pointer;
    88}
    99.owc-section-page .owc-sp-open .owc-sp-toggle-arrow {
    10     vertical-align: bottom;
     10  vertical-align: bottom;
    1111}
    1212.owc-section-page .owc-sp-content {
    13     display: none;
     13  display: none;
    1414}
  • section-page/trunk/owc-section-page-admin.php

    r709968 r714378  
    3131                <th><?php _e( 'HTML classes for section title', 'owc_sp' ); ?></th>
    3232                <td>
     33                    <input type="text" name="owc_sp_class_title_elm" id="owc_sp_class_title_elm" value="<?php echo $options['owc_sp_class_title_elm']; ?>" />
     34                </td>
     35            </tr>
     36            <tr valign="top">
     37                <th><?php _e( 'HTML classes for section title wrapper', 'owc_sp' ); ?></th>
     38                <td>
    3339                    <input type="text" name="owc_sp_class_title" id="owc_sp_class_title" value="<?php echo $options['owc_sp_class_title']; ?>" />
    3440                </td>
     
    4147            </tr>
    4248            <tr valign="top">
    43                 <th><?php _e( 'Use a char before section title', 'owc' ); ?></th>
     49                <th><?php _e( 'Use a char before section title', 'owc_sp' ); ?></th>
    4450                <td>
    4551                    <input type="checkbox" name="owc_sp_use_char"<?php echo $options['owc_sp_use_char']?' checked="checked"':''; ?> />
     
    5864                </td>
    5965            </tr>
     66            <tr valign="top">
     67                <th><?php _e( 'Use animation', 'owc_sp' ); ?></th>
     68                <td>
     69                    <input type="checkbox" name="owc_sp_use_animation"<?php echo $options['owc_sp_use_animation']?' checked="checked"':''; ?> />
     70                </td>
     71            </tr>
     72            <tr valign="top">
     73                <th><?php _e( 'Custom CSS', 'owc_sp' ); ?></th>
     74                <td>
     75                    <textarea rows="6" cols="80" id="owc_sp_css" name="owc_sp_css"><?php echo $options['owc_sp_css']; ?></textarea>
     76                </td>
     77            </tr>
    6078        </table>
    61         <p class="submit"><input type="submit" name="owc_section_page_submit" id="owc_section_page_submit" class="button button-primary" value="<?php _e( 'Save Changes', 'owc' ); ?>"></p>
     79        <p class="submit"><input type="submit" name="owc_section_page_submit" id="owc_section_page_submit" class="button button-primary" value="<?php _e( 'Save Changes', 'owc_sp' ); ?>"></p>
    6280    </form>
    6381</div>
  • section-page/trunk/owc-section-page.php

    r710788 r714378  
    33Plugin Name: Section Page
    44Plugin URI: http://wordpress.org/extend/plugins/section-page/
    5 Description: Section Page is a simple wordpress plugin allowing you to divide a page into sliding sections
    6 Version: 1.0.1
     5Description: Section Page is a simple plugin allowing you to insert dropdown sections in your wordpress pages and posts.
     6Version: 1.0.2
    77Author: <a href="https://github.com/Skyree">Loïc B. Florin</a>
    88Author URI: Loïc B. Florin
     
    4040        // Admin menu
    4141        function adminMenu() {
    42             add_options_page( __( 'Section Page', 'owc_sp' ), __( 'Section Page', 'owc_sp' ), 'manage_options', 'section-page', array(&$this, 'adminPage') );
     42            $plugin_page = add_options_page( __( 'Section Page', 'owc_sp' ), __( 'Section Page', 'owc_sp' ), 'manage_options', 'section-page', array(&$this, 'adminPage') );
     43            add_action( 'admin_head-'. $plugin_page, array( &$this, 'adminEnqueues' ) );
    4344        }
    4445       
     
    4647        function frontEnqueues() {
    4748            $options = $this->getAdminOptions();
    48             echo '<script type="text/javascript">
    49             ';
    50             echo 'var owc_sp_use_char = '.($options['owc_sp_use_char']?'true':'false').';
    51             ';
    52             echo '</script>';
     49           
     50            ?>
     51            <script type="text/javascript">
     52                var owc_sp_use_char = <?php echo ($options['owc_sp_use_char']?'true':'false'); ?>;
     53                var owc_sp_use_animation = <?php echo ($options['owc_sp_use_animation']?'true':'false'); ?>;
     54            </script>
     55            <?php
    5356            wp_enqueue_script( 'jquery' );
    54             wp_enqueue_script( 'owc_section_page', plugins_url( 'assets/actions.js.php', __FILE__ ), array( 'jquery' ) );
     57            wp_enqueue_script( 'owc_section_page', plugins_url( 'assets/actions.js', __FILE__ ), array( 'jquery' ) );
    5558            echo '<link type="text/css" rel="stylesheet" href="' . plugins_url( 'assets/base.css', __FILE__ ) . '" />';
     59            if($options['owc_sp_css']) {
     60                ?>
     61                    <style type="text/css">
     62                        <?php echo $options['owc_sp_css']; ?>
     63                    </style>
     64                <?php
     65            }
     66        }
     67       
     68        // Scripts and styles loading in admin head
     69        function adminEnqueues() {
     70            wp_enqueue_script( 'codemirrorjs', plugins_url( 'assets/codemirror.js', __FILE__ ), array() );
     71            wp_enqueue_style( 'codemirrorcss', plugins_url( 'assets/codemirror.css', __FILE__ ), array() );
     72            wp_enqueue_script( 'codemirrorcssjs', plugins_url( 'assets/css.js', __FILE__ ), array() );
     73            wp_enqueue_script( 'codemirroruse', plugins_url( 'assets/codemirror_use.js', __FILE__ ), array('codemirrorjs', 'codemirrorcssjs') );
     74            ?>
     75            <style type="text/css">
     76                .CodeMirror {
     77                    width: 500px;
     78                    border: 1px solid #ddd;
     79                    -webkit-border-radius: 5px;
     80                       -moz-border-radius: 5px;
     81                            border-radius: 5px;
     82                }
     83            </style>
     84            <?php
    5685        }
    5786       
     
    6089       
    6190            $options = $this->getAdminOptions();
    62             $content = preg_replace( '#(\[section\=)(.*?)(\])(.*?)(\[endsection\])#si', '<div class="owc-section-page '.$options['owc_sp_class'].'" data-up="'.$options['owc_sp_close_char'].'" data-down="'.$options['owc_sp_open_char'].'"><div class="owc-sp-open '.$options['owc_sp_class_title'].'"><'.$options['owc_sp_title'].'>'.($options['owc_sp_use_char']?'<span class="owc-sp-toggle-arrow">'.$options['owc_sp_close_char'].'</span> ':'').'$2</'.$options['owc_sp_title'].'></div><div class="owc-sp-content '.$options['owc_sp_class_content'].'">$4</div></div>', $content );
     91            $owc_sp = '<div class="owc-section-page '.$options['owc_sp_class'].'" data-up="'.$options['owc_sp_close_char'].'" data-down="'.$options['owc_sp_open_char'].'">';
     92            $owc_sp_open = '<div class="owc-sp-open '.$options['owc_sp_class_title'].'">';
     93            $owc_sp_elm = '<'.$options['owc_sp_title'].($options['owc_sp_class_title_elm']?' class="'.$options['owc_sp_class_title_elm'].'"':'').'>'.($options['owc_sp_use_char']?'<span class="owc-sp-toggle-arrow">'.$options['owc_sp_close_char'].'</span> ':'').'$2</'.$options['owc_sp_title'].'></div>';
     94            $owc_sp_content = '<div class="owc-sp-content '.$options['owc_sp_class_content'].'">$4</div>';
     95           
     96            $content = preg_replace( '#(\[section\=)(.*?)(\])(.*?)(\[endsection\])#si', $owc_sp.$owc_sp_open.$owc_sp_elm.$owc_sp_content.'</div>', $content );
    6397            return $content;
    6498        }
     
    69103                    'owc_sp_title' => 'h2',
    70104                    'owc_sp_class' => '',
     105                    'owc_sp_class_title_elm' => '',
    71106                    'owc_sp_class_title' => '',
    72107                    'owc_sp_class_content' => '',
    73108                    'owc_sp_use_char' => true,
    74109                    'owc_sp_close_char' => '&#9658;',
    75                     'owc_sp_open_char' => '&#9660;'
     110                    'owc_sp_open_char' => '&#9660;',
     111                    'owc_sp_use_animation' => true,
     112                    'owc_sp_css' => ''
    76113                );
    77114            $owc_section_pageCurrentAdminOptions = get_option($this->adminOptionsName);
  • section-page/trunk/readme.txt

    r710788 r714378  
    22Contributors: Skyree
    33Donate link:
    4 Tags: content, shortcode, section, dropdown
     4Tags: content, shortcode, section, dropdown, post, posts, page, pages
    55Requires at least: 3.0
    66Tested up to: 3.5.1
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6060== Changelog ==
    6161
     62= 1.0.2 =
     63* New option `Use animation` *Smooth or instant dropdown*
     64* Modified option : `HTML classes for section title` *Now targets the title tag*
     65* New option `HTML classes for section title wrapper`  *Previously "Html classes for section title"*
     66* New option `Custom css` *Enter your custom css here*
     67
    6268= 1.0.1 =
    6369* Bug fix on `HTML classes for section title` and `HTML classes for section content`. Please upgrade if you want to use your own classes on these elements. Else you can use `owc-sp-open` and `owc-sp-content` which are the default classes.
Note: See TracChangeset for help on using the changeset viewer.