Plugin Directory

Changeset 1053785


Ignore:
Timestamp:
12/25/2014 03:34:03 AM (11 years ago)
Author:
Chrgiga
Message:

Update main branch

Location:
css-file-selector/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • css-file-selector/trunk/cssfileselector.php

    r1053338 r1053785  
    3030{
    3131  // Recursive function for read directories and subdirectories
    32   function gil_read_directories($directory, &$files)
     32  function gil_read_css_directories($directory, &$files)
    3333  {
    3434  if (is_dir($directory)) {
     
    3838          // Verify if is directory or file
    3939          if (is_dir( $directory.'/'.$file)) {
    40             gil_read_directories($directory.'/'.$file , $files);
     40            gil_read_css_directories($directory.'/'.$file , $files);
    4141          } else {
    4242            // Ready File
     
    5555  $path_template = get_template_directory();
    5656  $files = array();
    57   gil_read_directories($path_template, $files);
     57  gil_read_css_directories($path_template, $files);
    5858  $select = '';
    5959
     
    9292  $cssfiles = get_post_meta($post->ID, 'gil_css_file_selector_file', true);
    9393  $cssrules = get_post_meta($post->ID, 'gil_css_file_selector_rules', true);
    94   echo '<div class="row"><label>Select CSS files</label><br />'.gil_get_css_file(explode(',', $cssfiles)).' <button type="button" class="add-select button button-primary button-large">Add other file</button></div>';
     94  echo '<div class="row"><label>Select CSS files</label><br />'.gil_get_css_file(explode(',', $cssfiles)).' <button type="button" class="add-select-css button button-primary button-large">Add other file</button><hr /></div>';
    9595  echo '<div class="row"><label for="css-file-selector-rules">Write your custom CSS rules</label><br /><textarea id="css-file-selector-rules" name="gil_css_file_selector_rules">'.esc_attr($cssrules).'</textarea></div>';
    9696  wp_enqueue_style('cssfileselector.css', plugins_url('inc/css/cssfileselector.css', __FILE__));
     
    164164  global $post;
    165165
    166   delete_post_meta($post->ID, 'gil_css_file_selector_file');
    167   delete_post_meta($post->ID, 'gil_css_file_selector_rules');
     166  if ('trash' == get_post_status($post_id)) {
     167    delete_post_meta($post->ID, 'gil_css_file_selector_file');
     168    delete_post_meta($post->ID, 'gil_css_file_selector_rules');
     169  }
    168170}
    169171
  • css-file-selector/trunk/inc/js/cssfileselector.js

    r1053338 r1053785  
    88        if (last_select.val() == '') {
    99            //If no option selected, we can't add other select element
    10             $('.add-select').prop('disabled', 'true').removeClass('button-primary').addClass('button-default');
     10            $('.add-select-css').prop('disabled', 'true').removeClass('button-primary').addClass('button-default');
    1111        }
    1212        last_select.change(function()
    1313        {
    1414            if ($(this).val() != '') {
    15                 $('.add-select').removeProp('disabled').removeClass('button-default').addClass('button-primary');
     15                $('.add-select-css').removeProp('disabled').removeClass('button-default').addClass('button-primary');
    1616            }
    1717        });
     
    2626    });
    2727
    28     $('.add-select').click(function(e) {
     28    $('.add-select-css').click(function(e) {
    2929        e.preventDefault();
    3030        if (!e.target.disabled) {
  • css-file-selector/trunk/readme.txt

    r1053401 r1053785  
    55Requires at least: 3.0.1
    66Tested up to: 4.1
    7 Stable tag: 1.0
     7Stable tag: 1.0.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2424== Frequently Asked Questions ==
    2525
     26= Are custom post types supported =
     27
     28Not yet.. stay tuned
    2629
    2730== Screenshots ==
    2831
    29 1. Sample post page with `Select CSS files and/or write your custom CSS rules` metabox screenshot-1.jpg.
     321. Sample post page with `Select CSS files and/or write your custom CSS rules` metabox screenshot.png.
    3033
    3134== Changelog ==
     35
     36= 1.0.1 =
     37* Fixed bug
    3238
    3339= 1.0 =
     
    3642== Upgrade Notice ==
    3743
    38 No upgrades at this time
     44= 1.0.1 =
     45Fixed bug that emptied the options of select field when the button `Preview Changes` was pressed
    3946
Note: See TracChangeset for help on using the changeset viewer.