Changeset 933166
- Timestamp:
- 06/16/2014 05:44:34 PM (11 years ago)
- 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 53 53 var item = sllw.find('.simple-link-list .list-item:last-child').clone(); 54 54 var item_id = item.attr('id'); 55 item.attr('id',i tem_id.substring(0,item_id.length-1)+num);55 item.attr('id',increment_last_num(item_id)); 56 56 57 57 $('.toggled-off',item).removeClass('toggled-off'); … … 61 61 $('label',item).each(function() { 62 62 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)); 64 64 }); 65 65 … … 67 67 var id_val = $(this).attr('id'); 68 68 var name_val = $(this).attr('name'); 69 $(this).attr('id',i d_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)); 71 71 if($(':checked',this)){ 72 72 $(this).removeAttr('checked'); … … 84 84 } 85 85 86 function increment_last_num(v) { 87 return v.replace(/[0-9]+(?!.*[0-9])/, function(match) { 88 return parseInt(match, 10)+1; 89 }); 90 } 91 86 92 function updateOrder(self){ 87 93 var sllw = self.parents(".widget-content"); -
simple-link-list-widget/trunk/readme.txt
r905001 r933166 4 4 Requires at least: 2.8 5 5 Tested up to: 3.9 6 Stable tag: 0.3 6 Stable tag: 0.3.1 7 7 8 8 This plugin makes a widget available which allows you to add a simple link list (bulleted or numbered) to a sidebar. … … 14 14 The plugin then needs to be activated before it can be used. 15 15 16 To use, simply drag the ' Simple LinkList' widget into a sidebar. To use the widget, your theme must be widget-enabled.16 To use, simply drag the 'List' widget into a sidebar. To use the widget, your theme must be widget-enabled. 17 17 18 18 == Frequently Asked Questions == … … 36 36 37 37 == Changelog == 38 = 0.3.1 = 39 * Fixed bug that limited the number of items to 9 40 38 41 = 0.3 = 39 42 * Added drag and drop support -
simple-link-list-widget/trunk/simple-link-list-widget.php
r904231 r933166 5 5 Author: James Bowles 6 6 Author URI: http://thebowles.org 7 Version: 0.3 7 Version: 0.3.1 8 8 */ 9 9 … … 90 90 $order = explode(',',$new_instance['order']); 91 91 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 } 93 96 } 94 97 }
Note: See TracChangeset
for help on using the changeset viewer.