Plugin Directory

Changeset 933166


Ignore:
Timestamp:
06/16/2014 05:44:34 PM (11 years ago)
Author:
jimmywb
Message:

Fixed bug that limited the list to 9 items

Location:
simple-link-list-widget
Files:
12 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • simple-link-list-widget/trunk/js/sllw-sort.js

    r904231 r933166  
    5353        var item = sllw.find('.simple-link-list .list-item:last-child').clone();
    5454        var item_id = item.attr('id');
    55         item.attr('id',item_id.substring(0,item_id.length-1)+num);
     55        item.attr('id',increment_last_num(item_id));
    5656
    5757        $('.toggled-off',item).removeClass('toggled-off');
     
    6161        $('label',item).each(function() {
    6262            var for_val = $(this).attr('for');
    63             $(this).attr('for',for_val.substring(0,for_val.length-1)+num);
     63            $(this).attr('for',increment_last_num(for_val));
    6464        });
    6565       
     
    6767            var id_val = $(this).attr('id');
    6868            var name_val = $(this).attr('name');
    69             $(this).attr('id',id_val.substring(0,id_val.length-1)+num);
    70             $(this).attr('name',name_val.substring(0,name_val.length-2)+num+"]");
     69            $(this).attr('id',increment_last_num(id_val));
     70            $(this).attr('name',increment_last_num(name_val));
    7171            if($(':checked',this)){
    7272               $(this).removeAttr('checked');
     
    8484}
    8585
     86function increment_last_num(v) {
     87    return v.replace(/[0-9]+(?!.*[0-9])/, function(match) {
     88        return parseInt(match, 10)+1;
     89    });
     90}
     91
    8692function updateOrder(self){
    8793    var sllw = self.parents(".widget-content");
  • simple-link-list-widget/trunk/readme.txt

    r905001 r933166  
    44Requires at least: 2.8
    55Tested up to: 3.9
    6 Stable tag: 0.3
     6Stable tag: 0.3.1
    77
    88This plugin makes a widget available which allows you to add a simple link list (bulleted or numbered) to a sidebar.
     
    1414The plugin then needs to be activated before it can be used.
    1515
    16 To use, simply drag the 'Simple Link List' widget into a sidebar. To use the widget, your theme must be widget-enabled.
     16To use, simply drag the 'List' widget into a sidebar. To use the widget, your theme must be widget-enabled.
    1717
    1818== Frequently Asked Questions ==
     
    3636
    3737== Changelog ==
     38= 0.3.1 =
     39* Fixed bug that limited the number of items to 9
     40
    3841= 0.3 =
    3942* Added drag and drop support
  • simple-link-list-widget/trunk/simple-link-list-widget.php

    r904231 r933166  
    55Author: James Bowles
    66Author URI: http://thebowles.org
    7 Version: 0.3
     7Version: 0.3.1
    88*/
    99
     
    9090            $order = explode(',',$new_instance['order']);
    9191            foreach($order as $key => $order_str){
    92                 $order[$key] = substr($order_str,-1);
     92                $num = strrpos($order_str,'-');
     93                if($num !== false){
     94                    $order[$key] = substr($order_str,$num+1);
     95                }
    9396            }
    9497        }
Note: See TracChangeset for help on using the changeset viewer.