Changeset 280
- Timestamp:
- Jun 19, 2016, 11:54:39 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/webserver/js/players.js
r279 r280 5 5 6 6 function prettyDate(date){ 7 console.log (new Date());8 console.log (date);9 7 var diff = (((new Date()).getTime() - date.getTime()) / 1000), 10 8 day_diff = Math.floor(diff / 86400); … … 112 110 widgets: ['zebra', 'formatter', 'filter'], 113 111 widgetOptions: { 114 formatter_column: formatterSettings/*{ 115 116 '.emphasize' : function( text, data ) { 117 return '<strong>' + text + '</strong>'; 118 }, 119 '.supercar' : function( text, data ) { 120 if ( text === '' ) { return ''; } 121 // replace table cell with a link 122 return '<a href="https://www.google.com/search?tbm=isch&q=' + text.replace(/\s/g, '+') + '">' + text + '</a>'; 123 }, 124 '.date' : function( text, data ) { 125 var date = new Date( text ); 126 if ( date instanceof Date && isFinite( date ) ) { 127 data.$cell.attr( data.config.textAttribute, text ); 128 return '<em>' + prettyDate( date ) + '</em>'; 129 } 130 return text; 131 }, 132 '.duckify' : function( text, data ) { 133 if ( text === '' ) { return ''; } 134 // add text to data-attribute; this overrides the parser 135 data.$cell.attr( data.config.textAttribute, text ); 136 // replace table cell with a link 137 return '<a href="https://duckduckgo.com/?ia=images&q=' + text + '">Search The Duck</a>'; 138 }, 139 '.blue' : function( text, data ) { 140 return '<span class="blue">' + text + '</span>'; 141 } 142 143 }*/ 112 formatter_column: formatterSettings 144 113 } 145 114 })
Note:
See TracChangeset
for help on using the changeset viewer.