1(function($) { 2 $.fn.ipaginate = function(options) { 3 var opts = $.extend({}, $.fn.ipaginate.defaults, options); 4 5 return this.each(function() { 6 $this = $(this); 7 8 //ç¢çGridè³æååé å¨ 9 $.fn.getPaginationData(opts.page, opts, $this); 10 }); 11 }; 12 13 $.fn.paginate.defaults = { 14 page: 1,//è¦é¡¯ç¤ºç¬¬å¹¾é è³æ 15 pageSize: 10,//æ¯é 顯示幾çè³æ 16 url: null,//ç´¢åè³æURL 17 gridSelection: null,//æ¾ç½®gridè³ætbodyçé¸æå¨ 18 gridColumns: null//gridæ¬ä½å稱 19 }; 20 21 //便å®çURLè·ä¼ºæå¨åå¾ç¸½é æ¸ä»¥ååé è³æ 22 $.fn.getPaginationData = function(page, opts, selectedObj) { 23 $.getJSON(opts.url, 24 { 25 page: page, 26 pageSize: opts.pageSize 27 }, 28 function(jsonData) { 29 if(jsonData) { 30 $.fn.createGrid(jsonData, opts);//ç¢çGridåå¡ 31 $.fn.createPagination(page, jsonData.pageCount, opts, selectedObj);//ç¢çåé å¨åå¡ 32 } 33 }); 34 } 35 36 //使ç¨jquery.paginateä¾ç¢çåé å¨åå¡ 37 $.fn.createPagination = function(page, pageCount, opts, selectedObj) { 38 //selectedObj.paginate({ 39 $("div#pagination").paginate({ 40 count : pageCount, 41 start : page, 42 display : 10, 43 border : true, 44 border_color : '#BEF8B8', 45 text_color : '#68BA64', 46 background_color : '#E3F2E1', 47 border_hover_color : '#68BA64', 48 text_hover_color : 'black', 49 background_hover_color : '#CAE6C6', 50 rotate : false, 51 images : false, 52 mouse : 'press', 53 onChange : function(page){ 54 $.fn.getPaginationData(page, opts, selectedObj);//黿åé å¨å¾ï¼éæ°ç¢çGridè³æä»¥ååé å¨ 55 } 56 }); 57 } 58 59 //ç¢çGridåå¡ 60 $.fn.createGrid = function(jsonData, opts) { 61 var insetViewData = ""; 62 var aaData = jsonData.aaData; 63 $.each(aaData, function(index, items) { 64 insetViewData += $.fn.createTR(items, opts); 65 }); 66 67 $(opts.gridSelection).html(insetViewData); 68 } 69 70 //ç¢çGridåå¡å §å®è¡è³æï¼ä¸åçGridæå çºé¡¯ç¤ºçæ¬ä½å稱ä¸åèææèª¿æ´ 71 $.fn.createTR = function(obj, opts){ 72 var tr = "<tr>"; 73 $.each(opts.gridColumns, function(i, columnName) { 74 tr += "<td class=\""+ columnName +"\">" + obj[columnName] + "</td>"; 75 76 }); 77 tr += "</tr>"; 78 return tr; 79 } 80})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.