Headlines
Videos
Social media

Baseball

April 20, 2016

Schedule/Results
There was a problem with a Velocity script
Page/scoreboard-slider-template
ErrorInvocation of method 'remove' in class java.util.ArrayList threw exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at q1jdajsbpvgm85a3/scoreboard-slider-template[line 94, column 35]
Page source:
1: #set ($ajax = false)
2: #if ($request.getParameter("ajax").equals("true"))
3:   #set ($ajax = true)
4:   $!request.setAttribute("decorator", "")
5: #end
6: 
7: ## TEAM LINKING
8: #set ($teamIDs = $page.teamIDs)
9: 
10: #set ($columnCount =4)
11: #if ($tool.math.toInteger($request.getParameter("columnCount")))
12:   #set ($columnCount = $tool.math.toInteger($request.getParameter("columnCount")))
13: #end
14: 
15: #set ($events = $schedule.events)
16: #set ($eventCount = $events.size())
17: #set ($slideCount = $tool.math.ceil($tool.math.div($eventCount, $columnCount)))
18: 
19: #set ($upcomingEvents = [])
20: #set ($pastEvents = [])
21: #set ($activeSlideEvents = [])
22: 
23: #set ($currentTime = $now.time)
24: 
25: ######################################################################
26: ##   STORE PAST, INPROGRESS AND UPCOMING EVENTS IN THEIR OWN ARRAYS ##
27: 
28: #set ($blocks = $eventCount / 100)
29: #foreach ($block in [0..$blocks])
30: 
31:   #set ($min = $block * 100)
32:   #set ($max = $block * 100 + 100)
33:   #if ($max > $eventCount)
34: 	#set ($max = $eventCount)
35:   #end
36: 
37:   #set ($eventsSubList = $events.subList($min, $max))
38: 
39:   #foreach ($event in $eventsSubList)
40:     #set ($eventTime = $event.date.time)
41:     #if ($currentTime > $eventTime && !$event.inProgress)
42:       #set ($bool = $pastEvents.add($event))
43:     #else
44:       #set ($bool = $upcomingEvents.add($event))
45:     #end
46:   #end
47: 
48: #end ## block loop
49: ########################################################################################################################
50: 
51: ## <!-- $pastEvents -->
52: ## <!-- $upcomingEvents -->
53: 
54: ## CREATE ACTIVE SLIDE WHICH IF POSSIBLE CONTAINS ${pastEventCountForActiveSlide} PAST EVENTS AND UPCOMING EVENTS DEPENDING ON THE COLUMN LIMIT
55: #if ($columnCount > 3)
56: 
57: #*
58: #if ($pastEvents.size() >= 2)
59:     #set ($pastEventCountForActiveSlide = 2)
60: #else
61:     #set ($pastEventCountForActiveSlide = 1)
62: #end
63: *#
64: 
65: #set ($pastEventCountForActiveSlide = 1)
66: 
67: #if ($upcomingEvents.size() == 1)
68:     #set ($pastEventCountForActiveSlide = 4)
69: #elseif ($upcomingEvents.size() == 2)
70:     #set ($pastEventCountForActiveSlide = 3)
71: #elseif ($upcomingEvents.size() == 3)
72:     #set ($pastEventCountForActiveSlide = 2)
73: #end
74: 
75: #set ($upcomingEventCountForActiveSlide = $tool.math.sub($columnCount, $pastEventCountForActiveSlide)) 
76: 
77: #if ($pastEvents.size() >= $pastEventCountForActiveSlide && $upcomingEvents.size() >= $upcomingEventCountForActiveSlide)
78: 
79:   #set ($pastEventsForActiveSlide = $pastEvents.subList($tool.math.sub($pastEvents.size(), $pastEventCountForActiveSlide), $pastEvents.size()))
80:   #set ($upcomingEventsForActiveSlide = $upcomingEvents.subList(0, $upcomingEventCountForActiveSlide))
81: 
82:   ## add the last two events into the activeSlide array
83:   #set ($bool = $activeSlideEvents.addAll($pastEventsForActiveSlide))
84: 
85:   ## remove the last two events from pastEvents array
86:   #foreach ($i in [1..$pastEventCountForActiveSlide])
87: 	#set ($bool = $!pastEvents.remove($tool.math.sub($pastEvents.size(), 1)))
88:   #end
89: 
90:   ## add the next upcoming events into the activeSlide array
91:   #set ($bool = $activeSlideEvents.addAll($upcomingEventsForActiveSlide))
92: 
93:   #foreach ($i in [1..$upcomingEventCountForActiveSlide])
94:     #set ($bool = $upcomingEvents.remove(0))
95:   #end
96: 
97: #end
98: #end ## columnCount > 3
99: ##############################################################################################################################
100: 
101: <!-- $pastEventCountForActiveSlide -->
102: <!-- $upcomingEventCountForActiveSlide -->
103: 
104: ## PRINT EVENT DETAILS
105: #macro (printEvent $event $class)
106: <div class="event-box ${class} clearfix">
107: 
108: #if ($event.date.time >= $currentTime)
109:   <div class="event-status">Upcoming</div>
110: #else 
111:   <div class="event-status">Results</div>
112: #end
113: 
114: ## DATE
115: <div class="date clearfix" title="$formatter.formatLongDate($event.date)">
116:   <span>$formatter.formatDate($event.date, "EEE")</span>
117:  <span>$formatter.formatDate($event.date, "MMM dd,yyyy")</span>
118: </div>
119: 
120: 
121: ## STATUS
122: #set ($status = $formatter.formatStatus($event))
123: #if ($status.length() > 0)
124:   <div class="status">$status</div>
125: #end
126: 
127: 
128: ## OPPONENT
129: <div class="opponent">
130: <div>
131:  ## RESULT
132:  #set ($result = "")
133:  #if ($event.inProgress) 
134:    #set ($result = $event.result)
135:  #elseif ($event.APResult.length() > 0)
136:    #set ($result = $event.APResult)
137:  #else
138:    #set ($result = $event.result)
139:  #end
140: 
141:  ## VS / AT
142:  #if ($event.neutralSite.length() > 0 || $event.home) 
143:    <span class="va">vs. </span> 
144:  #else 
145:    #if (!$event.home)<span class="va">at </span>#end 
146:  #end
147: 
148:  #if ($teamIDs.contains($event.opponent.teamId))
149:    <a href="$confmemberIDs.contains($event.opponent.teamId)" class="name">$event.opponent.name</a>
150:  #else
151:    <span class="name">$event.opponent.name</span>
152:  #end
153: 		  
154:  #if ($result.toString().length() > 0)
155:    <span class="result">$result</span>
156:  #end
157: </div>
158: #if ($event.opponent.teamId)
159: <span class="team-logo">
160: <img src="${website.teamLogo($event.opponent.teamId)}" alt="${teamName}" title="${teamName}" />
161: </span>
162: #else 
163: <span class="team-logo no-logo"></span> 
164: #end
165: 
166: </div>
167: 
168: ## SPORT NAME
169: #if ($event.sport)  
170:   <span class="sport">
171:     #if ($event.sport.contains("Women's"))
172:       $event.sport.replace("Women's","W")
173:     #elseif ($event.sport.contains("Men's"))
174:       $event.sport.replace("Men's","M")
175:     #else
176:       $event.sport
177:     #end
178:   </span> 
179:   #end
180: 
181: <div class="links">
182: #foreach ($link in $event.links)
183:    #if ($velocityCount > 1)<span>|</span>#end
184:    <a href="$link.url"><span>$link.name</span></a>
185: #end ## link loop
186: </div>
187: 
188: </div> ## event-box
189: #end ## macro printEvent
190: 
191: ##############################################################################################################################
192: 
193: ## PRINT EVENTS
194: #macro (printEvents $eventSet $printEmptyBoxes $emptyBoxesCount $emptyBoxesPosition $activeSlide)
195: 
196: #set ($blocks = $eventSet.size() / 100)
197: #set ($counter = 0)
198: #set ($colCount = 0)
199: 
200: #foreach ($block in [0..$blocks])
201: 
202: #set ($min = $block * 100)
203: #set ($max = $block * 100 + 100)
204: #if ($max > $eventSet.size())
205:   #set ($max = $eventSet.size())
206: #end
207: 
208: #set ($eventsSubList = $eventSet.subList($min, $max))
209: 
210: #foreach ($e in $eventsSubList)
211: 
212: #set ($counter = $counter + 1)
213: #set ($colCount = $colCount + 1)
214: 
215: #if ($colCount == 1)
216:   #if ($activeSlide)
217:      <div class="item active clearfix">
218:   #else
219:      <div class="item clearfix">
220:   #end
221: #end
222: 
223: ## PRINT EMPTY EVENT BOXES IF ANY
224: #if ($printEmptyBoxes && $emptyBoxesCount > 0 && $emptyBoxesPosition == "start" && $block == 0)
225:   #foreach ($k in [1..$emptyBoxesCount])
226:     <div class="event-box empty clearfix"></div>
227:     #set ($colCount = $colCount + 1)
228:   #end
229:   #set ($printEmptyBoxes = false)
230: #end
231: 
232: <!-- $e.inProgress -->
233: #if ($currentTime > $e.date.time && !$e.inProgress)
234:   #printEvent($e, "results")
235: #else
236:   #printEvent($e, "upcoming")
237: #end
238: 
239: #if ($colCount == $columnCount  || $counter == $eventSet.size())
240:   </div> ## item
241:   #set ($colCount = 0)
242: #end
243: 
244: #end ## subList loop
245: #end ## blocks
246: 
247: #end ## macro printEvents
248: 
249: ##############################################################################################################################
250: 
251: <div class="scoreboard-slider clearfix">
252: <div class="slider">
253: <div class="items clearfix">
254: 
255: #if ($eventCount == 0)
256: 
257: <div class="item no-events">No Events</div>
258: 
259: #else
260: 
261: #set ($printEmptyBoxes = false)
262: #if ($activeSlideEvents.size() > 0)
263:   #set ($printEmptyBoxes = true)
264: #end
265: 
266: #set ($pastEventsSlideCount = $tool.math.ceil($tool.math.div($pastEvents.size(), $columnCount)))
267: #set ($pastEventsEmptyCount = $tool.math.sub($tool.math.mul($pastEventsSlideCount, $columnCount), $pastEvents.size()))
268: 
269: #set ($upcomingEventsSlideCount = $tool.math.ceil($tool.math.div($upcomingEvents.size(), $columnCount)))
270: #set ($upcomingEventsEmptyCount = $tool.math.sub($tool.math.mul($upcomingEventsSlideCount, $columnCount), $upcomingEvents.size()))
271: 
272: #if ($pastEvents.size() > 0)
273:   #printEvents($pastEvents $printEmptyBoxes $pastEventsEmptyCount "start" false)
274: #end
275: 
276: #if ($activeSlideEvents.size() > 0)
277:   #printEvents($activeSlideEvents false 0 "" true)
278: #end
279: 
280: #if ($upcomingEvents.size() > 0)
281:   #printEvents($upcomingEvents $printEmptyBoxes $upcomingEventsEmptyCount "end" false)
282: #end
283: 
284: #end
285: 
286: </div>
287: </div> ## slider
288: 
289: <a class="prev">Previous</a>
290: <a class="pause pp">PP</a>
291: <a class="next">Next</a>
292: 
293: </div> ## scoreboard-slider
294: 
295: #if (!$ajax)
296: 
297: <script>
298: $(function() {
299: 
300: setTimeout(function() {
301: 
302: var scoreboardSlider = $('.scoreboard-slider').eq(0);
303: var scroller = scoreboardSlider.children('.slider').scrollable({ circular: false, touch:false }).data('scrollable');
304: 
305: var activeIndex = scoreboardSlider.find('.item.active').index();
306: if (activeIndex >= 0) {
307:   scroller.seekTo(activeIndex, 0);
308: }
309: 
310: scoreboardSlider.children('.pp').on('click', function(e) {
311:   e.preventDefault();
312: 
313:   if ($(this).hasClass('pause')) {
314: 
315:     $(this).removeClass('pause');
316:     $(this).addClass('play');
317:     scroller.stop();
318: 
319:   } else if ($(this).hasClass("play")) {
320: 
321:     $(this).removeClass('play');
322:     $(this).addClass('pause');
323:     scroller.play();
324: 
325:   }
326: });
327: 
328: }, 200);
329: 
330: });
331: </script>
332: 
333: #end ## !$ajax

Standings
Baseball
  • Baseball
  • Men's Basketball
  • Women's Basketball
  • Softball
  • Women's Volleyball