· 6 years ago · Jul 26, 2019, 02:04 PM
1var processCount = 3;
2var testing = false;
3var players;
4
5// Data Initial Load Event
6function showModal() {
7 // Process all the API tasks
8 players();
9 playerLogs();
10 teamLogs();
11};
12
13var playersData;
14// get the Players Data
15function players() {
16 var reqURL = "/data/MySportFeeds/players.json"
17 if (testing == true ) {var reqURL = "https://cors-anywhere.herokuapp.com/https://www.sportssabermetrics.net/data/MySportFeeds/players.json"; }
18 var req = new XMLHttpRequest();
19 req.open("GET", reqURL);
20 req.responseType = "text";
21 req.send();
22
23 // parse data into rows
24 req.onload = function() {
25 // Raw string
26 playersData = req.response;
27
28 // Parse to JSON
29 playersData = JSON.parse(playersData).players;
30
31 // Verify data have been loaded then Render page
32 if(--processCount == 0) callback();
33 }
34}
35
36// get the Players Logs Data
37var playerLogs;
38function playerLogs() {
39 var reqURL = "/data/MySportFeeds/2018/player_gamelogs.json "
40 if (testing == true ) {var reqURL = "https://cors-anywhere.herokuapp.com/https://www.sportssabermetrics.net/data/MySportFeeds/2018/player_gamelogs.json "; }
41 var req = new XMLHttpRequest();
42 req.open("GET", reqURL);
43 req.responseType = "text";
44 req.send();
45
46 // parse data into rows
47 req.onload = function() {
48 // Raw string
49 playerLogs = req.response;
50
51 // Parse to JSON
52 playerLogs = JSON.parse(playerLogs).gamelogs;
53 //Sort
54 //console.log("Player Logs")
55 //console.log(playerLogs);
56 playerLogs.sort(function(a, b) {
57 return parseInt(a.game.week) - parseInt(b.game.week);
58 });
59
60 // Verify data have been loaded then Render page
61 if(--processCount == 0) callback();
62 }
63}
64
65var teamLogs;
66// get the Team Logs Data
67function teamLogs() {
68 var reqURL = "/data/MySportFeeds/2018/team_gamelogs.json"
69 if (testing == true ) {var reqURL = "https://cors-anywhere.herokuapp.com/https://www.sportssabermetrics.net/data/MySportFeeds/2018/team_gamelogs.json"; }
70 var req = new XMLHttpRequest();
71 req.open("GET", reqURL);
72 req.responseType = "text";
73 req.send();
74
75 // parse data into rows
76 req.onload = function() {
77 // Raw string
78 teamLogs = req.response;
79
80 // Parse to JSON
81 teamLogs = JSON.parse(teamLogs).gamelogs;
82 //console.log("Team Logs")
83 //console.log(teamLogs);
84
85 // Verify data have been loaded then Render page
86 if(--processCount == 0) callback();
87 }
88}
89
90// Search Bar Filter Logic
91function searchPlayers() {
92 var input, filter, ul, li, a, i;
93 input = document.getElementById("searchBarInput");
94 filter = input.value.toUpperCase().replace(".","");
95 div = document.getElementById("dropdownItems");
96 li = div.getElementsByTagName("li");
97
98 // remove all current items
99 for (i = li.length - 1; i > -1; i--) {
100 div.removeChild(li[i]);
101 }
102
103 // check for min length
104 if (filter.length < 3) {
105 $('#dropdownItems').append("<li><a>Please input at least 3 characters.</a></li>");
106 } else {
107 for (i = 0; i < playersData.length; i++) {
108 var p = playersData[i].player;
109 var team;
110 var name = p.firstName + " " + p.lastName;
111 if (name.toUpperCase().replace(".","").indexOf(filter) >= 0) {
112 if(!p.currentTeam) {
113 team = "UFA";
114 } else {
115 team = p.currentTeam.abbreviation;
116 }
117 // Add Players to List
118 $('#dropdownItems').append('<li><a onclick="loadPlayer(\'' + p.id + '\', \'' + team + '\')">' + name + " - " + p.primaryPosition + " (" + team + ")" + "</a></li>");
119 }
120 }
121 }
122}
123
124// disable input ENTER
125function stopEnterKey(evt) {
126 var evt = (evt) ? evt : ((event) ? event : null);
127 var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
128 if ((evt.keyCode == 13) && (node.type == "text")) { return false; }
129 }
130document.onkeypress = stopEnterKey;
131
132// Load Player
133function loadPlayer(currentId, teamID) {
134 // Show preloader
135 $('#status').show();
136 $('#preloader').delay(150).show();
137
138 //Find Player
139 var currentPlayer;
140 for (i = 0; i < playersData.length; i++) {
141 if (playersData[i].player.id == currentId) {
142 currentPlayer = JSON.parse(JSON.stringify(playersData[i]));
143 }
144 }
145
146 //Loop through game logs
147 var playerGames = [];
148 var opps = [];
149 for (i = 0; i < playerLogs.length; i++) {
150 var x = JSON.parse(JSON.stringify(playerLogs[i]));
151 if (x.player.id == currentId) {
152 playerGames.push(x);
153 }
154 }
155
156 //Points For/Against
157 var pointsFor = [];
158 for (i=0; i < teamLogs.length; i++) {
159
160 //Find Opposing team
161 var oppTeam;
162 if (teamLogs[i].game.awayTeamAbbreviation == teamLogs[i].team.abbreviation) {
163 oppTeam = teamLogs[i].game.homeTeamAbbreviation;
164 } else {
165 oppTeam = teamLogs[i].game.awayTeamAbbreviation;
166 }
167
168 // Find Opposing Team Game
169 var oppTeamInd = -1; // -1 if not found
170 for (var k = 0; k < teamLogs.length; ++k)
171 {
172 var element = teamLogs[k];
173 if (element.game.week === teamLogs[i].game.week && element.team.abbreviation === oppTeam)
174 {
175 oppTeamInd = k;
176 break;
177 }
178 }
179
180 // Create Points For/All Object
181 var x = JSON.parse(JSON.stringify(teamLogs[i]));
182 var curTeamId = pointsFor.findIndex(pointsFor => pointsFor.teamId == teamLogs[i].team.id);
183 if (curTeamId < 0) {
184 pointsFor.push(new Object());
185 pointsFor[pointsFor.length - 1].teamId = teamLogs[i].team.id;
186 pointsFor[pointsFor.length - 1].team = teamLogs[i].team.abbreviation;
187 pointsFor[pointsFor.length - 1].pointsFor = [];
188 pointsFor[pointsFor.length - 1].pointsAgainst = [];
189
190 pointsFor[pointsFor.length - 1].pointsFor.push(teamLogs[i]);
191 pointsFor[pointsFor.length - 1].pointsAgainst.push(teamLogs[oppTeamInd]);
192 } else {
193 pointsFor[curTeamId].pointsFor.push(teamLogs[i]);
194 pointsFor[curTeamId].pointsAgainst.push(teamLogs[oppTeamInd]);
195 }
196 }
197
198 for (i=0; i < pointsFor.length; i++) {
199 for (j=0; j < pointsFor[i].pointsAgainst.length; j++) {
200 var a, b, c;
201 a = pointsFor[i].pointsAgainst[0].stats.receiving.recYards;
202 b = pointsFor[i].pointsAgainst[0].stats.miscellaneous.offensePlays;
203 c = pointsFor[i].pointsAgainst[0].stats.rushing.rushYards;
204
205 if (j < 2) {
206 pointsFor[i].pointsAgainst[j].recAllowed = a;
207 pointsFor[i].pointsAgainst[j].playsAllowed = b;
208 pointsFor[i].pointsAgainst[j].rushAllowed = c;
209 } else if ( j == 2) {
210 a += pointsFor[i].pointsAgainst[1].stats.receiving.recYards;
211 b += pointsFor[i].pointsAgainst[1].stats.miscellaneous.offensePlays;
212 c += pointsFor[i].pointsAgainst[1].stats.rushing.rushYards;
213 pointsFor[i].pointsAgainst[j].recAllowed = Math.round(a/2);
214 pointsFor[i].pointsAgainst[j].playsAllowed = Math.round(b/2);
215 pointsFor[i].pointsAgainst[j].rushAllowed = Math.round(c/2);
216 } else {
217 a = pointsFor[i].pointsAgainst[j-3].stats.receiving.recYards;
218 b = pointsFor[i].pointsAgainst[j-3].stats.miscellaneous.offensePlays;
219 c = pointsFor[i].pointsAgainst[j-3].stats.rushing.rushYards;
220 a += pointsFor[i].pointsAgainst[j-2].stats.receiving.recYards;
221 b += pointsFor[i].pointsAgainst[j-2].stats.miscellaneous.offensePlays;
222 c += pointsFor[i].pointsAgainst[j-2].stats.rushing.rushYards;
223 a += pointsFor[i].pointsAgainst[j-1].stats.receiving.recYards;
224 b += pointsFor[i].pointsAgainst[j-1].stats.miscellaneous.offensePlays;
225 c += pointsFor[i].pointsAgainst[j-1].stats.rushing.rushYards;
226 pointsFor[i].pointsAgainst[j].recAllowed = Math.round(a/3);
227 pointsFor[i].pointsAgainst[j].playsAllowed = Math.round(b/3);
228 pointsFor[i].pointsAgainst[j].rushAllowed = Math.round(c/3);
229 }
230 }
231 }
232
233 console.log("Points For")
234 console.log(pointsFor);
235
236 // get player object and team
237 var p = currentPlayer.player;
238 var team;
239 if(!p.currentTeam) {
240 team = "UFA";
241 } else {
242 team = p.currentTeam.abbreviation;
243 }
244
245 //replace images
246 var pic = document.getElementById('pic');
247 pic.src = p.officialImageSrc;
248 var teamPic = document.getElementById('teamPic');
249 teamPic.src = "http://i.nflcdn.com/static/site/7.5/img/teams/" + team +"/" + team + "_logo-80x90.gif"
250
251 //replace Player Stats HTML
252 document.getElementById("name").innerHTML = p.firstName + " " + p.lastName + " - " + p.primaryPosition + " ( " + team + ")";
253 document.getElementById("teamH").innerHTML = "Current Team: " + team;
254 if (typeof p.height != 'undefined') {document.getElementById("height").innerHTML = "Height: " + p.height;}
255 if (typeof p.weight != 'undefined') {document.getElementById("weight").innerHTML = "Weight: " + p.weight;}
256 if (typeof p.age != 'undefined') {document.getElementById("age").innerHTML = "Age: " + p.age;}
257 if (typeof p.jerseyNumber != 'undefined') {document.getElementById("jersey").innerHTML = "#" + p.jerseyNumber;}
258 if (typeof p.college != 'undefined') {document.getElementById("college").innerHTML = "College: " + p.college;}
259
260
261 //Loop through player games
262 for (i = 0; i < playerGames.length; i++) {
263 if (playerGames[i].game.awayTeamAbbreviation == playerGames[i].team.abbreviation) {
264 playerGames[i].home = "Away";
265 playerGames[i].opp = playerGames[i].game.homeTeamAbbreviation;
266 } else {
267 playerGames[i].home = "Home";
268 playerGames[i].opp = playerGames[i].game.awayTeamAbbreviation;
269 }
270 }
271
272
273 //**********************************************************************
274 // Build gamelog Table
275
276 // Count current rows
277 var rowsCount = $('#gamelogs tr').length;
278
279 var gamelogString;
280
281 if (p.primaryPosition == 'QB'){
282 //QB
283 /*
284 <tr>
285 <th id="th1">passYards</th>
286 <th id="th2">rushYards</th>
287 <th id="th3">passTDs</th>
288 <th id="th4">passAtts</th>
289 <th id="th5">Completions</th>
290 <th id="th6">Interceptions</th>
291 </tr>
292 */
293
294 $('#th1').html('Pass Yards');
295 $('#th2').html('Rush Yards');
296 $('#th3').html('Pass TDs');
297 $('#th4').html('Pass Atts');
298 $('#th5').html('Completions');
299 $('#th6').html('Interceptions');
300
301 for (i = 0; i < playerGames.length; i++) {
302 var j = playerGames[i];
303
304 var oppTeamInd = pointsFor.findIndex(pointsFor => pointsFor.team == j.opp);
305 var oppTeamAllowed = pointsFor[oppTeamInd].pointsAgainst.findIndex( x => x.game.week == j.game.week);
306 var a = pointsFor[oppTeamInd].pointsAgainst[oppTeamAllowed].playsAllowed;
307 var b = pointsFor[oppTeamInd].pointsAgainst[oppTeamAllowed].rushAllowed;
308 var c = pointsFor[oppTeamInd].pointsAgainst[oppTeamAllowed].recAllowed;
309
310
311 gamelogString +='<tr><td>' + '2018' + '</td><td>' + j.game.week + '</td><td>' + j.opp + '</td><td>' + a + '</td><td>' + b + '</td><td>' + c + '</td><td>' + j.home + '</td><td>' + j.stats.passing.passYards + '</td><td>' + j.stats.rushing.rushYards + '</td><td>' + j.stats.passing.passTD + '</td><td>' + j.stats.passing.passAttempts + '</td><td>' + j.stats.passing.passCompletions + '</td><td>' + j.stats.passing.passInt + '</td></tr>';
312 }
313
314 } else {
315 //RB/WR/TE
316 /*
317 <tr>
318 <th id="th1">recYards</th>
319 <th id="th2">rushYards</th>
320 <th id="th3">totalYards</th>
321 <th id="th4">recTDs</th>
322 <th id="th5">rushTDs</th>
323 <th id="th6">receptions</th>
324 </tr>
325 */
326
327 $('#th1').html('Rec Yards');
328 $('#th2').html('Rush Yards');
329 $('#th3').html('Total Yards');
330 $('#th4').html('Rec TDs');
331 $('#th5').html('Rush TDs');
332 $('#th6').html('Receptions');
333
334 for (i = 0; i < playerGames.length; i++) {
335 var j = playerGames[i];
336
337 var oppTeamInd = pointsFor.findIndex(pointsFor => pointsFor.team == j.opp);
338 var oppTeamAllowed = pointsFor[oppTeamInd].pointsAgainst.findIndex( x => x.game.week == j.game.week);
339 var a = pointsFor[oppTeamInd].pointsAgainst[oppTeamAllowed].playsAllowed;
340 var b = pointsFor[oppTeamInd].pointsAgainst[oppTeamAllowed].rushAllowed;
341 var c = pointsFor[oppTeamInd].pointsAgainst[oppTeamAllowed].recAllowed;
342
343
344 gamelogString +='<tr><td>' + '2018' + '</td><td>' + j.game.week + '</td><td>' + j.opp + '</td><td>' + a + '</td><td>' + b + '</td><td>' + c + '</td><td>' + j.home + '</td><td>' + j.stats.receiving.recYards + '</td><td>' + j.stats.rushing.rushYards + '</td><td>' + (j.stats.receiving.recYards + j.stats.rushing.rushYards) + '</td><td>' + j.stats.receiving.recTD + '</td><td>' + j.stats.rushing.rushTD + '</td><td>' + j.stats.receiving.receptions + '</td></tr>';
345 }
346 };
347
348
349 // Update Players Table
350 $("#gamelogs").append(gamelogString);
351 var x = '#gamelogs tr:lt(' + rowsCount + ')';
352 $(x).remove();
353 $("table.tablesorter").trigger("update");
354
355 //**********************************************************************
356 // Build teamlog Table
357
358 // Count current rows
359 rowsCount = $('#teamlogs tr').length;
360 var passingRowsCount = $('#passingTable tr').length;
361 var rushingRowsCount = $('#rushingTable tr').length;
362 var marketShareRowsCount = $('#marketShare tr').length;
363
364 var teamlogString = "";
365 var passingTableString = "";
366 var rushingTableString = "";
367 var marketShareString = "";
368
369 // Find current team
370 var teamInd = pointsFor.findIndex(pointsFor => pointsFor.team == team);
371
372 // Loop through Points For object array
373 for (i = 0; i < pointsFor[teamInd].pointsFor.length; i++) {
374 var j = pointsFor[teamInd].pointsFor[i];
375 // Determine opponent and home status
376 if (j.game.awayTeamAbbreviation == team) {
377 j.opp = j.game.homeTeamAbbreviation;
378 j.home = "AWAY";
379 } else {
380 j.opp = j.game.awayTeamAbbreviation;
381 j.home = "HOME";
382 }
383
384 /* team logs
385 <tr>
386 <th>Year</th>
387 <th>Week</th>
388 <th>Opp</th>
389 <th>Home?</th>
390 <th>Points For</th>
391 <th>Points Against</th>
392 <th>Plays Run</th>
393 <th>Plays Allowed</th>
394 <th>Yards</th>
395 <th>TDs</th>
396 <th>AvgYards</th>
397 </tr>
398 */
399
400 teamlogString +='<tr><td>' + '2018' + '</td><td>' + j.game.week + '</td><td>' + j.opp + '</td><td>' + j.home + '</td><td>' + j.stats.standings.pointsFor + '</td><td>' + j.stats.standings.pointsAgainst + '</td><td>' + j.stats.miscellaneous.offensePlays + '</td><td>' + pointsFor[teamInd].pointsAgainst[i].stats.miscellaneous.offensePlays + '</td><td>' + j.stats.miscellaneous.offenseYds + '</td><td>' + j.stats.miscellaneous.totalTD + '</td><td>' + j.stats.miscellaneous.offenseAvgYds + '</td></tr>';
401
402 /* passing logs
403 <tr>
404 <th>Year</th>
405 <th>Week</th>
406 <th>Opp</th>
407 <th>Home?</th>
408 <th>Attempts</th>
409 <th>Completions</th>
410 <th>passYards</th>
411 <th>passTDs</th>
412 <th>Sacks</th>
413 <th>20+ Passes</th>
414 <th>QBR</th>
415 </tr>
416 */
417
418 passingTableString +='<tr><td>' + '2018' + '</td><td>' + j.game.week + '</td><td>' + j.opp + '</td><td>' + j.home + '</td><td>' + j.stats.passing.passAttempts + '</td><td>' + j.stats.passing.passCompletions + '</td><td>' + j.stats.passing.passGrossYards + '</td><td>' + j.stats.passing.passTD + '</td><td>' + j.stats.passing.passSacks + '</td><td>' + j.stats.passing.pass20Plus + '</td><td>' + j.stats.passing.qbRating + '</td></tr>';
419
420
421 /* rushing logs
422 <tr>
423 <th>Year</th>
424 <th>Week</th>
425 <th>Opp</th>
426 <th>Home?</th>
427 <th>rushAttempts</th>
428 <th>rushYards</th>
429 <th>rushTDs</th>
430 <th>1st Down Rushes</th>
431 <th>20+ Rushes</th>
432 <th>rushAverage</th>
433 </tr>
434 */
435
436 rushingTableString +='<tr><td>' + '2018' + '</td><td>' + j.game.week + '</td><td>' + j.opp + '</td><td>' + j.home + '</td><td>' + j.stats.rushing.rushAttempts + '</td><td>' + j.stats.rushing.rushYards + '</td><td>' + j.stats.rushing.rushTD + '</td><td>' + j.stats.rushing.rush1stDowns + '</td><td>' + j.stats.rushing.rush20Plus + '</td><td>' + j.stats.rushing.rushAverage + '</td></tr>';
437
438
439 /* marketshare logs
440 <tr>
441 <th>Year</th>
442 <th>Week</th>
443 <th>Opp</th>
444 <th>Home?</th>
445 <th>Points For</th>
446 <th>Points Against</th>
447 <th>Plays Run</th>
448 <th>Plays Allowed</th>
449 <th>Yards</th>
450 <th>TDs</th>
451 <th>AvgYards</th>
452 </tr>
453 */
454
455 marketShareString +='<tr><td>' + '2018' + '</td><td>' + j.game.week + '</td><td>' + j.opp + '</td><td>' + j.home + '</td><td>' + j.stats.standings.pointsFor + '</td><td>' + j.stats.standings.pointsAgainst + '</td><td>' + j.stats.miscellaneous.offensePlays + '</td><td>' + pointsFor[teamInd].pointsAgainst[i].stats.miscellaneous.offensePlays + '</td><td>' + j.stats.miscellaneous.offenseYds + '</td><td>' + j.stats.miscellaneous.totalTD + '</td><td>' + j.stats.miscellaneous.offenseAvgYds + '</td></tr>';
456
457
458 }
459
460
461 // Update Teams Table
462 $("#teamlogs").append(teamlogString);
463 x = '#teamlogs tr:lt(' + rowsCount + ')';
464 $(x).remove();
465
466 // Update Passing Table
467 $("#passingTable").append(passingTableString);
468 x = '#passingTable tr:lt(' + rowsCount + ')';
469 $(x).remove();
470
471 // Update Rushing Table
472 $("#rushingTable").append(rushingTableString);
473 x = '#rushingTable tr:lt(' + rowsCount + ')';
474 $(x).remove();
475
476 // Update Market Share Table
477 $("#marketShare").append(marketShareString);
478 x = '#marketShare tr:lt(' + rowsCount + ')';
479 $(x).remove();
480
481 $("table.tablesorter").trigger("update");
482
483 // remove all current search items
484 var input, filter, ul, li, a, i;
485 input = document.getElementById("searchBarInput");
486 div = document.getElementById("dropdownItems");
487 li = div.getElementsByTagName("li");
488
489 for (i = li.length - 1; i > -1; i--) {
490 div.removeChild(li[i]);
491 }
492
493 /* ***********************************************************************
494 Populate Player Prop tools
495 **************************************************************************/
496 // add props
497 var propsString;
498 if (p.primaryPosition == 'QB'){
499 propsString = '<a class="w3-bar-item w3-button">passYards</a>'
500 propsString += '<a class="w3-bar-item w3-button">rushYards</a>'
501 propsString += '<a class="w3-bar-item w3-button">rushTDs</a>'
502 propsString += '<a class="w3-bar-item w3-button">passAtts</a>'
503 propsString += '<a class="w3-bar-item w3-button">Completions</a>'
504 propsString += '<a class="w3-bar-item w3-button">Interceptions</a>'
505 } else {
506 propsString = '<a class="w3-bar-item w3-button">recYards</a>'
507 propsString += '<a class="w3-bar-item w3-button">rushYards</a>'
508 propsString += '<a class="w3-bar-item w3-button">totalYards</a>'
509 propsString += '<a class="w3-bar-item w3-button">recTDs</a>'
510 propsString += '<a class="w3-bar-item w3-button">rushTDs</a>'
511 propsString += '<a class="w3-bar-item w3-button">Receptions</a>'
512 }
513 $("#chooseStat").html(propsString);
514
515 // unfocus/clear search bar
516 $('#searchBarInput').blur()
517 document.getElementById("searchBarInput").value = ''
518
519 // Hide preloader
520 $('#status').fadeOut(); // will first fade out the loading animation
521 $('#preloader').delay(550).fadeOut('slow'); // will fade out the white DIV that covers the website.
522 $('body').delay(550).css({
523 'overflow': 'visible'
524 });
525}
526
527// Render the Page
528function callback() {
529 // Jared Goff, Eagles
530 loadPlayer(9919,54);
531
532 // hide preloader
533 $('#status').fadeOut(); // will first fade out the loading animation
534 $('#preloader').delay(550).fadeOut('slow'); // will fade out the white DIV that covers the website.
535 $('body').delay(550).css({
536 'overflow': 'visible'
537 });
538}
539
540// Initialize Players Table
541$("#teamlogsParent").tablesorter({
542
543 // *** APPEARANCE ***
544 // Add a theme - 'blackice', 'blue', 'dark', 'default', 'dropbox',
545 // 'green', 'grey' or 'ice' stylesheets have all been loaded
546 // to use 'bootstrap' or 'jui', you'll need to include "uitheme"
547 // in the widgets option - To modify the class names, extend from
548 // themes variable. Look for "$.extend($.tablesorter.themes.jui"
549 // at the bottom of this window
550 // this option only adds a table class name "tablesorter-{theme}"
551 //theme: 'metro',
552
553 // fix the column widths
554 widthFixed: false,
555
556 // Show an indeterminate timer icon in the header when the table
557 // is sorted or filtered
558 showProcessing: false,
559
560 // header layout template (HTML ok); {content} = innerHTML,
561 // {icon} = <i/> (class from cssIcon)
562 headerTemplate: '{content}{icon}',
563
564 // initialize zebra striping and filter widgets
565 widgets: ["zebra", "filter"],
566
567 ignoreCase: false,
568
569 widgetOptions : {
570 // filter_anyMatch options was removed in v2.15; it has been replaced by the filter_external option
571
572 // If there are child rows in the table (rows with class name from "cssChildRow" option)
573 // and this option is true and a match is found anywhere in the child row, then it will make that row
574 // visible; default is false
575 filter_childRows : false,
576
577 // if true, filter child row content by column; filter_childRows must also be true
578 filter_childByColumn : false,
579
580 // if true, include matching child row siblings
581 filter_childWithSibs : true,
582
583 // if true, a filter will be added to the top of each table column;
584 // disabled by using -> headers: { 1: { filter: false } } OR add class="filter-false"
585 // if you set this to false, make sure you perform a search using the second method below
586 filter_columnFilters : true,
587
588 // if true, allows using "#:{query}" in AnyMatch searches (column:query; added v2.20.0)
589 filter_columnAnyMatch: true,
590
591 // extra css class name (string or array) added to the filter element (input or select)
592 filter_cellFilter : '',
593
594 // extra css class name(s) applied to the table row containing the filters & the inputs within that row
595 // this option can either be a string (class applied to all filters) or an array (class applied to indexed filter)
596 filter_cssFilter : '', // or []
597
598 // add a default column filter type "~{query}" to make fuzzy searches default;
599 // "{q1} AND {q2}" to make all searches use a logical AND.
600 filter_defaultFilter : {},
601
602 // filters to exclude, per column
603 filter_excludeFilter : {},
604
605 // jQuery selector (or object) pointing to an input to be used to match the contents of any column
606 // please refer to the filter-any-match demo for limitations - new in v2.15
607 filter_external : '',
608
609 // class added to filtered rows (rows that are not showing); needed by pager plugin
610 filter_filteredRow : 'filtered',
611
612 // ARIA-label added to filter input/select; {{label}} is replaced by the column header
613 // "data-label" attribute, if it exists, or it uses the column header text
614 filter_filterLabel : 'Filter "{{label}}" column by...',
615
616 // add custom filter elements to the filter row
617 // see the filter formatter demos for more specifics
618 filter_formatter : null,
619
620 // add custom filter functions using this option
621 // see the filter widget custom demo for more specifics on how to use this option
622 filter_functions : null,
623
624 // hide filter row when table is empty
625 filter_hideEmpty : true,
626
627 // if true, filters are collapsed initially, but can be revealed by hovering over the grey bar immediately
628 // below the header row. Additionally, tabbing through the document will open the filter row when an input gets focus
629 // in v2.26.6, this option will also accept a function
630 filter_hideFilters : false,
631
632 // Set this option to false to make the searches case sensitive
633 filter_ignoreCase : true,
634
635 // if true, search column content while the user types (with a delay).
636 // In v2.27.3, this option can contain an
637 // object with column indexes or classnames; "fallback" is used
638 // for undefined columns
639 filter_liveSearch : true,
640
641 // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
642 filter_matchType : { 'input': 'exact', 'select': 'exact' },
643
644 // a header with a select dropdown & this class name will only show available (visible) options within that drop down.
645 filter_onlyAvail : 'filter-onlyAvail',
646
647 // default placeholder text (overridden by any header "data-placeholder" setting)
648 filter_placeholder : { search : '', select : '' },
649
650 // jQuery selector string of an element used to reset the filters
651 filter_reset : 'button.reset',
652
653 // Reset filter input when the user presses escape - normalized across browsers
654 filter_resetOnEsc : true,
655
656 // Use the $.tablesorter.storage utility to save the most recent filters (default setting is false)
657 filter_saveFilters : true,
658
659 // Delay in milliseconds before the filter widget starts searching; This option prevents searching for
660 // every character while typing and should make searching large tables faster.
661 filter_searchDelay : 300,
662
663 // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true
664 filter_searchFiltered: true,
665
666 // include a function to return an array of values to be added to the column filter select
667 filter_selectSource : null,
668
669 // if true, server-side filtering should be performed because client-side filtering will be disabled, but
670 // the ui and events will still be used.
671 filter_serversideFiltering : false,
672
673 // Set this option to true to use the filter to find text from the start of the column
674 // So typing in "a" will find "albert" but not "frank", both have a's; default is false
675 filter_startsWith : false,
676
677 // Filter using parsed content for ALL columns
678 // be careful on using this on date columns as the date is parsed and stored as time in seconds
679 filter_useParsedData : false,
680
681 // data attribute in the header cell that contains the default filter value
682 filter_defaultAttrib : 'data-value',
683
684 // filter_selectSource array text left of the separator is added to the option value, right into the option text
685 filter_selectSourceSeparator : '|'
686 }
687 });
688
689// Initialize Players Table
690$("#gamelogsParent").tablesorter({
691
692 // *** APPEARANCE ***
693 // Add a theme - 'blackice', 'blue', 'dark', 'default', 'dropbox',
694 // 'green', 'grey' or 'ice' stylesheets have all been loaded
695 // to use 'bootstrap' or 'jui', you'll need to include "uitheme"
696 // in the widgets option - To modify the class names, extend from
697 // themes variable. Look for "$.extend($.tablesorter.themes.jui"
698 // at the bottom of this window
699 // this option only adds a table class name "tablesorter-{theme}"
700 //theme: 'metro',
701
702 // fix the column widths
703 widthFixed: false,
704
705 // Show an indeterminate timer icon in the header when the table
706 // is sorted or filtered
707 showProcessing: false,
708
709 // header layout template (HTML ok); {content} = innerHTML,
710 // {icon} = <i/> (class from cssIcon)
711 headerTemplate: '{content}{icon}',
712
713 // initialize zebra striping and filter widgets
714 widgets: ["zebra", "filter"],
715
716 ignoreCase: false,
717
718 widgetOptions : {
719 // filter_anyMatch options was removed in v2.15; it has been replaced by the filter_external option
720
721 // If there are child rows in the table (rows with class name from "cssChildRow" option)
722 // and this option is true and a match is found anywhere in the child row, then it will make that row
723 // visible; default is false
724 filter_childRows : false,
725
726 // if true, filter child row content by column; filter_childRows must also be true
727 filter_childByColumn : false,
728
729 // if true, include matching child row siblings
730 filter_childWithSibs : true,
731
732 // if true, a filter will be added to the top of each table column;
733 // disabled by using -> headers: { 1: { filter: false } } OR add class="filter-false"
734 // if you set this to false, make sure you perform a search using the second method below
735 filter_columnFilters : true,
736
737 // if true, allows using "#:{query}" in AnyMatch searches (column:query; added v2.20.0)
738 filter_columnAnyMatch: true,
739
740 // extra css class name (string or array) added to the filter element (input or select)
741 filter_cellFilter : '',
742
743 // extra css class name(s) applied to the table row containing the filters & the inputs within that row
744 // this option can either be a string (class applied to all filters) or an array (class applied to indexed filter)
745 filter_cssFilter : '', // or []
746
747 // add a default column filter type "~{query}" to make fuzzy searches default;
748 // "{q1} AND {q2}" to make all searches use a logical AND.
749 filter_defaultFilter : {},
750
751 // filters to exclude, per column
752 filter_excludeFilter : {},
753
754 // jQuery selector (or object) pointing to an input to be used to match the contents of any column
755 // please refer to the filter-any-match demo for limitations - new in v2.15
756 filter_external : '',
757
758 // class added to filtered rows (rows that are not showing); needed by pager plugin
759 filter_filteredRow : 'filtered',
760
761 // ARIA-label added to filter input/select; {{label}} is replaced by the column header
762 // "data-label" attribute, if it exists, or it uses the column header text
763 filter_filterLabel : 'Filter "{{label}}" column by...',
764
765 // add custom filter elements to the filter row
766 // see the filter formatter demos for more specifics
767 filter_formatter : null,
768
769 // add custom filter functions using this option
770 // see the filter widget custom demo for more specifics on how to use this option
771 filter_functions : null,
772
773 // hide filter row when table is empty
774 filter_hideEmpty : true,
775
776 // if true, filters are collapsed initially, but can be revealed by hovering over the grey bar immediately
777 // below the header row. Additionally, tabbing through the document will open the filter row when an input gets focus
778 // in v2.26.6, this option will also accept a function
779 filter_hideFilters : false,
780
781 // Set this option to false to make the searches case sensitive
782 filter_ignoreCase : true,
783
784 // if true, search column content while the user types (with a delay).
785 // In v2.27.3, this option can contain an
786 // object with column indexes or classnames; "fallback" is used
787 // for undefined columns
788 filter_liveSearch : true,
789
790 // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
791 filter_matchType : { 'input': 'exact', 'select': 'exact' },
792
793 // a header with a select dropdown & this class name will only show available (visible) options within that drop down.
794 filter_onlyAvail : 'filter-onlyAvail',
795
796 // default placeholder text (overridden by any header "data-placeholder" setting)
797 filter_placeholder : { search : '', select : '' },
798
799 // jQuery selector string of an element used to reset the filters
800 filter_reset : 'button.reset',
801
802 // Reset filter input when the user presses escape - normalized across browsers
803 filter_resetOnEsc : true,
804
805 // Use the $.tablesorter.storage utility to save the most recent filters (default setting is false)
806 filter_saveFilters : true,
807
808 // Delay in milliseconds before the filter widget starts searching; This option prevents searching for
809 // every character while typing and should make searching large tables faster.
810 filter_searchDelay : 300,
811
812 // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true
813 filter_searchFiltered: true,
814
815 // include a function to return an array of values to be added to the column filter select
816 filter_selectSource : null,
817
818 // if true, server-side filtering should be performed because client-side filtering will be disabled, but
819 // the ui and events will still be used.
820 filter_serversideFiltering : false,
821
822 // Set this option to true to use the filter to find text from the start of the column
823 // So typing in "a" will find "albert" but not "frank", both have a's; default is false
824 filter_startsWith : false,
825
826 // Filter using parsed content for ALL columns
827 // be careful on using this on date columns as the date is parsed and stored as time in seconds
828 filter_useParsedData : false,
829
830 // data attribute in the header cell that contains the default filter value
831 filter_defaultAttrib : 'data-value',
832
833 // filter_selectSource array text left of the separator is added to the option value, right into the option text
834 filter_selectSourceSeparator : '|'
835 }
836 });
837
838// Initialize Players Table
839$("#passingTableParent").tablesorter({
840
841 // *** APPEARANCE ***
842 // Add a theme - 'blackice', 'blue', 'dark', 'default', 'dropbox',
843 // 'green', 'grey' or 'ice' stylesheets have all been loaded
844 // to use 'bootstrap' or 'jui', you'll need to include "uitheme"
845 // in the widgets option - To modify the class names, extend from
846 // themes variable. Look for "$.extend($.tablesorter.themes.jui"
847 // at the bottom of this window
848 // this option only adds a table class name "tablesorter-{theme}"
849 //theme: 'metro',
850
851 // fix the column widths
852 widthFixed: false,
853
854 // Show an indeterminate timer icon in the header when the table
855 // is sorted or filtered
856 showProcessing: false,
857
858 // header layout template (HTML ok); {content} = innerHTML,
859 // {icon} = <i/> (class from cssIcon)
860 headerTemplate: '{content}{icon}',
861
862 // initialize zebra striping and filter widgets
863 widgets: ["zebra", "filter"],
864
865 ignoreCase: false,
866
867 widgetOptions : {
868 // filter_anyMatch options was removed in v2.15; it has been replaced by the filter_external option
869
870 // If there are child rows in the table (rows with class name from "cssChildRow" option)
871 // and this option is true and a match is found anywhere in the child row, then it will make that row
872 // visible; default is false
873 filter_childRows : false,
874
875 // if true, filter child row content by column; filter_childRows must also be true
876 filter_childByColumn : false,
877
878 // if true, include matching child row siblings
879 filter_childWithSibs : true,
880
881 // if true, a filter will be added to the top of each table column;
882 // disabled by using -> headers: { 1: { filter: false } } OR add class="filter-false"
883 // if you set this to false, make sure you perform a search using the second method below
884 filter_columnFilters : true,
885
886 // if true, allows using "#:{query}" in AnyMatch searches (column:query; added v2.20.0)
887 filter_columnAnyMatch: true,
888
889 // extra css class name (string or array) added to the filter element (input or select)
890 filter_cellFilter : '',
891
892 // extra css class name(s) applied to the table row containing the filters & the inputs within that row
893 // this option can either be a string (class applied to all filters) or an array (class applied to indexed filter)
894 filter_cssFilter : '', // or []
895
896 // add a default column filter type "~{query}" to make fuzzy searches default;
897 // "{q1} AND {q2}" to make all searches use a logical AND.
898 filter_defaultFilter : {},
899
900 // filters to exclude, per column
901 filter_excludeFilter : {},
902
903 // jQuery selector (or object) pointing to an input to be used to match the contents of any column
904 // please refer to the filter-any-match demo for limitations - new in v2.15
905 filter_external : '',
906
907 // class added to filtered rows (rows that are not showing); needed by pager plugin
908 filter_filteredRow : 'filtered',
909
910 // ARIA-label added to filter input/select; {{label}} is replaced by the column header
911 // "data-label" attribute, if it exists, or it uses the column header text
912 filter_filterLabel : 'Filter "{{label}}" column by...',
913
914 // add custom filter elements to the filter row
915 // see the filter formatter demos for more specifics
916 filter_formatter : null,
917
918 // add custom filter functions using this option
919 // see the filter widget custom demo for more specifics on how to use this option
920 filter_functions : null,
921
922 // hide filter row when table is empty
923 filter_hideEmpty : true,
924
925 // if true, filters are collapsed initially, but can be revealed by hovering over the grey bar immediately
926 // below the header row. Additionally, tabbing through the document will open the filter row when an input gets focus
927 // in v2.26.6, this option will also accept a function
928 filter_hideFilters : false,
929
930 // Set this option to false to make the searches case sensitive
931 filter_ignoreCase : true,
932
933 // if true, search column content while the user types (with a delay).
934 // In v2.27.3, this option can contain an
935 // object with column indexes or classnames; "fallback" is used
936 // for undefined columns
937 filter_liveSearch : true,
938
939 // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
940 filter_matchType : { 'input': 'exact', 'select': 'exact' },
941
942 // a header with a select dropdown & this class name will only show available (visible) options within that drop down.
943 filter_onlyAvail : 'filter-onlyAvail',
944
945 // default placeholder text (overridden by any header "data-placeholder" setting)
946 filter_placeholder : { search : '', select : '' },
947
948 // jQuery selector string of an element used to reset the filters
949 filter_reset : 'button.reset',
950
951 // Reset filter input when the user presses escape - normalized across browsers
952 filter_resetOnEsc : true,
953
954 // Use the $.tablesorter.storage utility to save the most recent filters (default setting is false)
955 filter_saveFilters : true,
956
957 // Delay in milliseconds before the filter widget starts searching; This option prevents searching for
958 // every character while typing and should make searching large tables faster.
959 filter_searchDelay : 300,
960
961 // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true
962 filter_searchFiltered: true,
963
964 // include a function to return an array of values to be added to the column filter select
965 filter_selectSource : null,
966
967 // if true, server-side filtering should be performed because client-side filtering will be disabled, but
968 // the ui and events will still be used.
969 filter_serversideFiltering : false,
970
971 // Set this option to true to use the filter to find text from the start of the column
972 // So typing in "a" will find "albert" but not "frank", both have a's; default is false
973 filter_startsWith : false,
974
975 // Filter using parsed content for ALL columns
976 // be careful on using this on date columns as the date is parsed and stored as time in seconds
977 filter_useParsedData : false,
978
979 // data attribute in the header cell that contains the default filter value
980 filter_defaultAttrib : 'data-value',
981
982 // filter_selectSource array text left of the separator is added to the option value, right into the option text
983 filter_selectSourceSeparator : '|'
984 }
985 });
986
987// Initialize Players Table
988$("#rushingTableParent").tablesorter({
989
990 // *** APPEARANCE ***
991 // Add a theme - 'blackice', 'blue', 'dark', 'default', 'dropbox',
992 // 'green', 'grey' or 'ice' stylesheets have all been loaded
993 // to use 'bootstrap' or 'jui', you'll need to include "uitheme"
994 // in the widgets option - To modify the class names, extend from
995 // themes variable. Look for "$.extend($.tablesorter.themes.jui"
996 // at the bottom of this window
997 // this option only adds a table class name "tablesorter-{theme}"
998 //theme: 'metro',
999
1000 // fix the column widths
1001 widthFixed: false,
1002
1003 // Show an indeterminate timer icon in the header when the table
1004 // is sorted or filtered
1005 showProcessing: false,
1006
1007 // header layout template (HTML ok); {content} = innerHTML,
1008 // {icon} = <i/> (class from cssIcon)
1009 headerTemplate: '{content}{icon}',
1010
1011 // initialize zebra striping and filter widgets
1012 widgets: ["zebra", "filter"],
1013
1014 ignoreCase: false,
1015
1016 widgetOptions : {
1017 // filter_anyMatch options was removed in v2.15; it has been replaced by the filter_external option
1018
1019 // If there are child rows in the table (rows with class name from "cssChildRow" option)
1020 // and this option is true and a match is found anywhere in the child row, then it will make that row
1021 // visible; default is false
1022 filter_childRows : false,
1023
1024 // if true, filter child row content by column; filter_childRows must also be true
1025 filter_childByColumn : false,
1026
1027 // if true, include matching child row siblings
1028 filter_childWithSibs : true,
1029
1030 // if true, a filter will be added to the top of each table column;
1031 // disabled by using -> headers: { 1: { filter: false } } OR add class="filter-false"
1032 // if you set this to false, make sure you perform a search using the second method below
1033 filter_columnFilters : true,
1034
1035 // if true, allows using "#:{query}" in AnyMatch searches (column:query; added v2.20.0)
1036 filter_columnAnyMatch: true,
1037
1038 // extra css class name (string or array) added to the filter element (input or select)
1039 filter_cellFilter : '',
1040
1041 // extra css class name(s) applied to the table row containing the filters & the inputs within that row
1042 // this option can either be a string (class applied to all filters) or an array (class applied to indexed filter)
1043 filter_cssFilter : '', // or []
1044
1045 // add a default column filter type "~{query}" to make fuzzy searches default;
1046 // "{q1} AND {q2}" to make all searches use a logical AND.
1047 filter_defaultFilter : {},
1048
1049 // filters to exclude, per column
1050 filter_excludeFilter : {},
1051
1052 // jQuery selector (or object) pointing to an input to be used to match the contents of any column
1053 // please refer to the filter-any-match demo for limitations - new in v2.15
1054 filter_external : '',
1055
1056 // class added to filtered rows (rows that are not showing); needed by pager plugin
1057 filter_filteredRow : 'filtered',
1058
1059 // ARIA-label added to filter input/select; {{label}} is replaced by the column header
1060 // "data-label" attribute, if it exists, or it uses the column header text
1061 filter_filterLabel : 'Filter "{{label}}" column by...',
1062
1063 // add custom filter elements to the filter row
1064 // see the filter formatter demos for more specifics
1065 filter_formatter : null,
1066
1067 // add custom filter functions using this option
1068 // see the filter widget custom demo for more specifics on how to use this option
1069 filter_functions : null,
1070
1071 // hide filter row when table is empty
1072 filter_hideEmpty : true,
1073
1074 // if true, filters are collapsed initially, but can be revealed by hovering over the grey bar immediately
1075 // below the header row. Additionally, tabbing through the document will open the filter row when an input gets focus
1076 // in v2.26.6, this option will also accept a function
1077 filter_hideFilters : false,
1078
1079 // Set this option to false to make the searches case sensitive
1080 filter_ignoreCase : true,
1081
1082 // if true, search column content while the user types (with a delay).
1083 // In v2.27.3, this option can contain an
1084 // object with column indexes or classnames; "fallback" is used
1085 // for undefined columns
1086 filter_liveSearch : true,
1087
1088 // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
1089 filter_matchType : { 'input': 'exact', 'select': 'exact' },
1090
1091 // a header with a select dropdown & this class name will only show available (visible) options within that drop down.
1092 filter_onlyAvail : 'filter-onlyAvail',
1093
1094 // default placeholder text (overridden by any header "data-placeholder" setting)
1095 filter_placeholder : { search : '', select : '' },
1096
1097 // jQuery selector string of an element used to reset the filters
1098 filter_reset : 'button.reset',
1099
1100 // Reset filter input when the user presses escape - normalized across browsers
1101 filter_resetOnEsc : true,
1102
1103 // Use the $.tablesorter.storage utility to save the most recent filters (default setting is false)
1104 filter_saveFilters : true,
1105
1106 // Delay in milliseconds before the filter widget starts searching; This option prevents searching for
1107 // every character while typing and should make searching large tables faster.
1108 filter_searchDelay : 300,
1109
1110 // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true
1111 filter_searchFiltered: true,
1112
1113 // include a function to return an array of values to be added to the column filter select
1114 filter_selectSource : null,
1115
1116 // if true, server-side filtering should be performed because client-side filtering will be disabled, but
1117 // the ui and events will still be used.
1118 filter_serversideFiltering : false,
1119
1120 // Set this option to true to use the filter to find text from the start of the column
1121 // So typing in "a" will find "albert" but not "frank", both have a's; default is false
1122 filter_startsWith : false,
1123
1124 // Filter using parsed content for ALL columns
1125 // be careful on using this on date columns as the date is parsed and stored as time in seconds
1126 filter_useParsedData : false,
1127
1128 // data attribute in the header cell that contains the default filter value
1129 filter_defaultAttrib : 'data-value',
1130
1131 // filter_selectSource array text left of the separator is added to the option value, right into the option text
1132 filter_selectSourceSeparator : '|'
1133 }
1134 });
1135
1136// Initialize Players Table
1137$("#marketShareParent").tablesorter({
1138
1139 // *** APPEARANCE ***
1140 // Add a theme - 'blackice', 'blue', 'dark', 'default', 'dropbox',
1141 // 'green', 'grey' or 'ice' stylesheets have all been loaded
1142 // to use 'bootstrap' or 'jui', you'll need to include "uitheme"
1143 // in the widgets option - To modify the class names, extend from
1144 // themes variable. Look for "$.extend($.tablesorter.themes.jui"
1145 // at the bottom of this window
1146 // this option only adds a table class name "tablesorter-{theme}"
1147 //theme: 'metro',
1148
1149 // fix the column widths
1150 widthFixed: false,
1151
1152 // Show an indeterminate timer icon in the header when the table
1153 // is sorted or filtered
1154 showProcessing: false,
1155
1156 // header layout template (HTML ok); {content} = innerHTML,
1157 // {icon} = <i/> (class from cssIcon)
1158 headerTemplate: '{content}{icon}',
1159
1160 // initialize zebra striping and filter widgets
1161 widgets: ["zebra", "filter"],
1162
1163 ignoreCase: false,
1164
1165 widgetOptions : {
1166 // filter_anyMatch options was removed in v2.15; it has been replaced by the filter_external option
1167
1168 // If there are child rows in the table (rows with class name from "cssChildRow" option)
1169 // and this option is true and a match is found anywhere in the child row, then it will make that row
1170 // visible; default is false
1171 filter_childRows : false,
1172
1173 // if true, filter child row content by column; filter_childRows must also be true
1174 filter_childByColumn : false,
1175
1176 // if true, include matching child row siblings
1177 filter_childWithSibs : true,
1178
1179 // if true, a filter will be added to the top of each table column;
1180 // disabled by using -> headers: { 1: { filter: false } } OR add class="filter-false"
1181 // if you set this to false, make sure you perform a search using the second method below
1182 filter_columnFilters : true,
1183
1184 // if true, allows using "#:{query}" in AnyMatch searches (column:query; added v2.20.0)
1185 filter_columnAnyMatch: true,
1186
1187 // extra css class name (string or array) added to the filter element (input or select)
1188 filter_cellFilter : '',
1189
1190 // extra css class name(s) applied to the table row containing the filters & the inputs within that row
1191 // this option can either be a string (class applied to all filters) or an array (class applied to indexed filter)
1192 filter_cssFilter : '', // or []
1193
1194 // add a default column filter type "~{query}" to make fuzzy searches default;
1195 // "{q1} AND {q2}" to make all searches use a logical AND.
1196 filter_defaultFilter : {},
1197
1198 // filters to exclude, per column
1199 filter_excludeFilter : {},
1200
1201 // jQuery selector (or object) pointing to an input to be used to match the contents of any column
1202 // please refer to the filter-any-match demo for limitations - new in v2.15
1203 filter_external : '',
1204
1205 // class added to filtered rows (rows that are not showing); needed by pager plugin
1206 filter_filteredRow : 'filtered',
1207
1208 // ARIA-label added to filter input/select; {{label}} is replaced by the column header
1209 // "data-label" attribute, if it exists, or it uses the column header text
1210 filter_filterLabel : 'Filter "{{label}}" column by...',
1211
1212 // add custom filter elements to the filter row
1213 // see the filter formatter demos for more specifics
1214 filter_formatter : null,
1215
1216 // add custom filter functions using this option
1217 // see the filter widget custom demo for more specifics on how to use this option
1218 filter_functions : null,
1219
1220 // hide filter row when table is empty
1221 filter_hideEmpty : true,
1222
1223 // if true, filters are collapsed initially, but can be revealed by hovering over the grey bar immediately
1224 // below the header row. Additionally, tabbing through the document will open the filter row when an input gets focus
1225 // in v2.26.6, this option will also accept a function
1226 filter_hideFilters : false,
1227
1228 // Set this option to false to make the searches case sensitive
1229 filter_ignoreCase : true,
1230
1231 // if true, search column content while the user types (with a delay).
1232 // In v2.27.3, this option can contain an
1233 // object with column indexes or classnames; "fallback" is used
1234 // for undefined columns
1235 filter_liveSearch : true,
1236
1237 // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
1238 filter_matchType : { 'input': 'exact', 'select': 'exact' },
1239
1240 // a header with a select dropdown & this class name will only show available (visible) options within that drop down.
1241 filter_onlyAvail : 'filter-onlyAvail',
1242
1243 // default placeholder text (overridden by any header "data-placeholder" setting)
1244 filter_placeholder : { search : '', select : '' },
1245
1246 // jQuery selector string of an element used to reset the filters
1247 filter_reset : 'button.reset',
1248
1249 // Reset filter input when the user presses escape - normalized across browsers
1250 filter_resetOnEsc : true,
1251
1252 // Use the $.tablesorter.storage utility to save the most recent filters (default setting is false)
1253 filter_saveFilters : true,
1254
1255 // Delay in milliseconds before the filter widget starts searching; This option prevents searching for
1256 // every character while typing and should make searching large tables faster.
1257 filter_searchDelay : 300,
1258
1259 // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true
1260 filter_searchFiltered: true,
1261
1262 // include a function to return an array of values to be added to the column filter select
1263 filter_selectSource : null,
1264
1265 // if true, server-side filtering should be performed because client-side filtering will be disabled, but
1266 // the ui and events will still be used.
1267 filter_serversideFiltering : false,
1268
1269 // Set this option to true to use the filter to find text from the start of the column
1270 // So typing in "a" will find "albert" but not "frank", both have a's; default is false
1271 filter_startsWith : false,
1272
1273 // Filter using parsed content for ALL columns
1274 // be careful on using this on date columns as the date is parsed and stored as time in seconds
1275 filter_useParsedData : false,
1276
1277 // data attribute in the header cell that contains the default filter value
1278 filter_defaultAttrib : 'data-value',
1279
1280 // filter_selectSource array text left of the separator is added to the option value, right into the option text
1281 filter_selectSourceSeparator : '|'
1282 }
1283 });
1284
1285
1286//disable Enter key
1287$('.noEnterSubmit').bind('keypress', false);
1288
1289// Search Bar focus lost
1290$(document).on("focusout","#searchBarInput input",function(){
1291 var div = document.getElementById("dropdownItems");
1292 var li = div.getElementsByTagName("li");
1293
1294 // remove all current items
1295 for (i = li.length - 1; i > -1; i--) {
1296 div.removeChild(li[i]);
1297 }
1298});
1299
1300 // back to top
1301var offset = 300,
1302offset_opacity = 1200,
1303scroll_top_duration = 700,
1304$back_to_top = $('.cd-top');
1305
1306//hide or show the "back to top" link
1307$(window).scroll(function () {
1308 ($(this).scrollTop() > offset) ? $back_to_top.addClass('cd-is-visible'): $back_to_top.removeClass('cd-is-visible cd-fade-out');
1309 if ($(this).scrollTop() > offset_opacity) {
1310 $back_to_top.addClass('cd-fade-out');
1311 }
1312});
1313
1314//smooth scroll to top
1315$back_to_top.on('click', function (event) {
1316 event.preventDefault();
1317 $('body,html').animate({
1318 scrollTop: 0,
1319 }, scroll_top_duration);
1320});
1321
1322// Focus input box
1323$(".input-contact input, .textarea-contact textarea").focus(function () {
1324 $(this).next("span").addClass("active");
1325});
1326$(".input-contact input, .textarea-contact textarea").blur(function () {
1327 if ($(this).val() === "") {
1328 $(this).next("span").removeClass("active");
1329 }
1330});