Plugin Directory

Changeset 771164


Ignore:
Timestamp:
09/12/2013 09:31:36 PM (13 years ago)
Author:
barcinc
Message:

added option to put barc chat above/below the content

Location:
barc-chat
Files:
4 edited
8 copied

Legend:

Unmodified
Added
Removed
  • barc-chat/tags/0.5.4/barc.php

    r769424 r771164  
    44Plugin URI: http://barc.com
    55Description: Barc Chat provides a simple yet feature rich chat room for your whole community to interact in real-time directly on your site. You can have an unlimited number of users chatting simultaneously, it's completely free and there are no ads!
    6 Version: 0.5.3
     6Version: 0.5.4
    77Author: Barc Inc.
    88Author URI: http://barc.com
     
    1616
    1717  // version of the plugin, must be updated with header version
    18   const version = '0.5.3';
     18  const version = '0.5.4';
    1919
    2020  // activation URL, should be changed to live version
     
    111111    add_option(__class__.'_activated', 0);
    112112    add_option(__class__.'_page', 0);
     113    add_option(__class__.'_position', 0);
    113114  }
    114115
     
    119120    delete_option(__class__.'_activated');
    120121    delete_option(__class__.'_page');
     122    delete_option(__class__.'_position');
    121123  }
    122124
     
    185187    $activated = get_option(__class__.'_activated', false);
    186188    $username = self::strip(get_option(__class__.'_code', ''));
     189    $position = get_option(__class__.'_position', 0);
    187190
    188191    require_once $this->plugin_path.'/options.php';
     
    200203      case 'save_page':
    201204        update_option(__class__.'_page', isset($_POST['post_id'])?$_POST['post_id']:0);
     205        break;
     206
     207      case 'save_position':
     208        update_option(__class__.'_position', isset($_POST['position'])?$_POST['position']:0);
    202209        break;
    203210
     
    261268      return $content;
    262269
    263     return self::barc_div.self::barc_js;
     270    $position = get_option(__class__.'_position', 0);
     271
     272    return ($position == 1?$content:'').self::barc_div.self::barc_js.($position == 0?$content:'');
    264273  }
    265274
  • barc-chat/tags/0.5.4/options.js

    r769424 r771164  
    44    $select_post = $('select[name=barc_post_id]'),
    55    $button_settings = $('.button-barc-settings'),
    6     $verified_username = $('.verified-username');
     6    $verified_username = $('.verified-username'),
     7    $content_position = $('input[name=content_position]');
    78
    89  var showMessage = function($message)
     
    2223      $select_post.attr('disabled', false);
    2324      $button_settings.attr('disabled', false);
     25      $content_position.attr('disabled', false);
    2426    }
    2527    else
     
    2830      $select_post.attr('disabled', true);
    2931      $button_settings.attr('disabled', true);
     32      $content_position.attr('disabled', true);
    3033    }
    3134  }
     
    8992  });
    9093
     94  $content_position.bind('change', function()
     95  {
     96    var $loader = $('#select_page_loader').show(),
     97      v = $content_position.filter(':checked').val();
     98
     99    $.post(Barc.action_url, {
     100      a: 'save_position',
     101      position: v
     102    }, function(r)
     103    {
     104      $loader.hide();
     105
     106    }).error(function()
     107    {
     108      $loader.hide();
     109      alert(Barc.text.ajax_error);
     110    });
     111  });
     112
    91113});
  • barc-chat/tags/0.5.4/options.php

    r769286 r771164  
    5050                </select>
    5151                <span class="spinner barc-loader" id="select_page_loader"></span>
    52                 <br class="clear" />
     52                <br class="clear" /><br />
     53                <label for="content_position_1"><input type="radio" id="content_position_1"<?php echo $position == 0?' checked':''; ?> name="content_position" value="0" /> <?php _e('Show above the content', self::ld); ?></label><br />
     54                <label for="content_position_2"><input type="radio" id="content_position_2"<?php echo $position == 1?' checked':''; ?> name="content_position" value="1" /> <?php _e('Show below the content', self::ld); ?></label>
    5355            </div>
    5456        </div>
  • barc-chat/tags/0.5.4/readme.txt

    r769424 r771164  
    55Requires at least: 3.1
    66Tested up to: 3.6
    7 Stable tag: 0.5.3
     7Stable tag: 0.5.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050== Changelog ==
     51
     52= 0.5.4 =
     53- Added option to put Barc above/below content
    5154
    5255= 0.5.3 =
  • barc-chat/trunk/barc.php

    r769424 r771164  
    44Plugin URI: http://barc.com
    55Description: Barc Chat provides a simple yet feature rich chat room for your whole community to interact in real-time directly on your site. You can have an unlimited number of users chatting simultaneously, it's completely free and there are no ads!
    6 Version: 0.5.3
     6Version: 0.5.4
    77Author: Barc Inc.
    88Author URI: http://barc.com
     
    1616
    1717  // version of the plugin, must be updated with header version
    18   const version = '0.5.3';
     18  const version = '0.5.4';
    1919
    2020  // activation URL, should be changed to live version
     
    111111    add_option(__class__.'_activated', 0);
    112112    add_option(__class__.'_page', 0);
     113    add_option(__class__.'_position', 0);
    113114  }
    114115
     
    119120    delete_option(__class__.'_activated');
    120121    delete_option(__class__.'_page');
     122    delete_option(__class__.'_position');
    121123  }
    122124
     
    185187    $activated = get_option(__class__.'_activated', false);
    186188    $username = self::strip(get_option(__class__.'_code', ''));
     189    $position = get_option(__class__.'_position', 0);
    187190
    188191    require_once $this->plugin_path.'/options.php';
     
    200203      case 'save_page':
    201204        update_option(__class__.'_page', isset($_POST['post_id'])?$_POST['post_id']:0);
     205        break;
     206
     207      case 'save_position':
     208        update_option(__class__.'_position', isset($_POST['position'])?$_POST['position']:0);
    202209        break;
    203210
     
    261268      return $content;
    262269
    263     return self::barc_div.self::barc_js;
     270    $position = get_option(__class__.'_position', 0);
     271
     272    return ($position == 1?$content:'').self::barc_div.self::barc_js.($position == 0?$content:'');
    264273  }
    265274
  • barc-chat/trunk/options.js

    r769424 r771164  
    44    $select_post = $('select[name=barc_post_id]'),
    55    $button_settings = $('.button-barc-settings'),
    6     $verified_username = $('.verified-username');
     6    $verified_username = $('.verified-username'),
     7    $content_position = $('input[name=content_position]');
    78
    89  var showMessage = function($message)
     
    2223      $select_post.attr('disabled', false);
    2324      $button_settings.attr('disabled', false);
     25      $content_position.attr('disabled', false);
    2426    }
    2527    else
     
    2830      $select_post.attr('disabled', true);
    2931      $button_settings.attr('disabled', true);
     32      $content_position.attr('disabled', true);
    3033    }
    3134  }
     
    8992  });
    9093
     94  $content_position.bind('change', function()
     95  {
     96    var $loader = $('#select_page_loader').show(),
     97      v = $content_position.filter(':checked').val();
     98
     99    $.post(Barc.action_url, {
     100      a: 'save_position',
     101      position: v
     102    }, function(r)
     103    {
     104      $loader.hide();
     105
     106    }).error(function()
     107    {
     108      $loader.hide();
     109      alert(Barc.text.ajax_error);
     110    });
     111  });
     112
    91113});
  • barc-chat/trunk/options.php

    r769286 r771164  
    5050                </select>
    5151                <span class="spinner barc-loader" id="select_page_loader"></span>
    52                 <br class="clear" />
     52                <br class="clear" /><br />
     53                <label for="content_position_1"><input type="radio" id="content_position_1"<?php echo $position == 0?' checked':''; ?> name="content_position" value="0" /> <?php _e('Show above the content', self::ld); ?></label><br />
     54                <label for="content_position_2"><input type="radio" id="content_position_2"<?php echo $position == 1?' checked':''; ?> name="content_position" value="1" /> <?php _e('Show below the content', self::ld); ?></label>
    5355            </div>
    5456        </div>
  • barc-chat/trunk/readme.txt

    r769424 r771164  
    55Requires at least: 3.1
    66Tested up to: 3.6
    7 Stable tag: 0.5.3
     7Stable tag: 0.5.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050== Changelog ==
     51
     52= 0.5.4 =
     53- Added option to put Barc above/below content
    5154
    5255= 0.5.3 =
Note: See TracChangeset for help on using the changeset viewer.