Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote branch 'origin/two-alpha'

Conflicts:
	CollegeFootball.wdgt.zip
	CollegeFootball/Back.png
	build.sh
  • Loading branch information...
commit da11cdaf5c67008b786c56ee4eb5ddcd6ca74fdc 2 parents 2703902 + b8455a7
@smith authored
View
BIN  CollegeFootball.wdgt.zip
Binary file not shown
View
300 CollegeFootball.wdgt/data.json
@@ -0,0 +1,300 @@
+{
+"ACC": {
+ "103" : {"name":"Boston College", "id":103, "color":"111111"},
+ "228" : {"name":"Clemson", "id":228, "color":"f35b0f"},
+ "150" : {"name":"Duke", "id":150, "color":"004a7b"},
+ "52" : {"name":"Florida State", "id":52, "color":"b72931"},
+ "59" : {"name":"Georgia Tech", "id":59, "color":"000000"},
+ "120" : {"name":"Maryland", "id":120, "color":"d60039"},
+ "2390": {"name":"Miami", "id":2390, "color":"004325"},
+ "153" : {"name":"North Carolina", "id":153, "color":"002942"},
+ "152" : {"name":"N.C. State", "id":152, "color":"d60039"},
+ "258" : {"name":"Virginia", "id":258, "color":"000066"},
+ "259" : {"name":"Virginia Tech", "id":259, "color":"7b2129"},
+ "154" : {"name":"Wake Forest", "id":154, "color":"000000"}
+},
+"Big 12": {
+ "239" : {"name":"Baylor", "id":239, "color":"00844a"},
+ "66" : {"name":"Iowa State", "id":66, "color":"d62949"},
+ "2305": {"name":"Kansas", "id":2305, "color":"0337b4"},
+ "2306": {"name":"Kansas State", "id":2306, "color":"633194"},
+ "142" : {"name":"Missouri", "id":142, "color":"000000"},
+ "201" : {"name":"Oklahoma", "id":201, "color":"7b0000"},
+ "197" : {"name":"Oklahoma State", "id":197, "color":"ff7300"},
+ "251" : {"name":"Texas", "id":251, "color":"ef7321"},
+ "245" : {"name":"Texas A&M", "id":245, "color":"6A3333"},
+ "2641": {"name":"Texas Tech", "id":2641, "color":"d60039"}
+},
+"Big East": {
+ "2312": {"name":"Cincinnati", "id":2132, "color":"000000"},
+ "41" : {"name":"Connecticut", "id":41, "color":"0A1E5B"},
+ "97" : {"name":"Louisville", "id":97, "color":"de0018"},
+ "221" : {"name":"Pittsburgh", "id":221, "color":"313169"},
+ "164" : {"name":"Rutgers", "id":164, "color":"000000"},
+ "58" : {"name":"South Florida", "id":58, "color":"004231"},
+ "183" : {"name":"Syracuse", "id":183, "color":"1A3E86"},
+ "277" : {"name":"West Virginia", "id":277, "color":"395ab5"}
+},
+"Big Ten": {
+ "2294": {"name":"Iowa", "id":2294, "color":"000000"},
+ "130" : {"name":"Michigan", "id":130, "color":"292942"},
+ "127" : {"name":"Michigan State", "id":127, "color":"226b31"},
+ "135" : {"name":"Minnesota", "id":135, "color":"752132"},
+ "158" : {"name":"Nebraska", "id":158, "color":"fe0d04"},
+ "77" : {"name":"Northwestern", "id":77, "color":"372286"},
+ "356" : {"name":"Illinois", "id":356, "color":"f77329"},
+ "84" : {"name":"Indiana", "id":84, "color":"580000"},
+ "194" : {"name":"Ohio State", "id":194, "color":"de3129"},
+ "213" : {"name":"Penn State", "id":213, "color":"29294a"},
+ "2509": {"name":"Purdue", "id":2509, "color":"211818"},
+ "275" : {"name":"Wisconsin", "id":275, "color":"c32122"}
+},
+"Conference USA": {
+ "151" : {"name":"East Carolina", "id":151, "color":"4b1869"},
+ "276" : {"name":"Marshall", "id":276, "color":"186329"},
+ "235" : {"name":"Memphis", "id":235, "color":"29299c"},
+ "2572": {"name":"Southern Miss", "id":2572, "color":"FFAA3C"},
+ "5" : {"name":"UAB", "id":5, "color":"000000"},
+ "2116": {"name":"Central Florida", "id":2116, "color":"000000"},
+ "248" : {"name":"Houston", "id":248, "color":"e73139"},
+ "242" : {"name":"Rice", "id":242, "color":"00315a"},
+ "2567": {"name":"SMU", "id":2567, "color":"e73139"},
+ "2655": {"name":"Tulane", "id":2655, "color":"084a38"},
+ "202" : {"name":"Tulsa", "id":202, "color":"004273"},
+ "2638": {"name":"UTEP", "id":2638, "color":"ff7339"}
+},
+"IA Independents": {
+ "349 ": {"name":"Army", "id":349, "color":"ce9c00"},
+ "252" : {"name":"BYU", "id":252, "color":"002942"},
+ "2426": {"name":"Navy", "id":2426, "color":"0f1021"},
+ "87" : {"name":"Notre Dame", "id":87, "color":"313a98"}
+},
+"Mid-American": {
+ "2006": {"name":"Akron", "id":2006, "color":"0A1E5B"},
+ "189" : {"name":"Bowling Green", "id":189, "color":"663300"},
+ "2084": {"name":"Buffalo", "id":2084, "color":"004a84"},
+ "2309": {"name":"Kent State", "id":2309, "color":"212142"},
+ "193" : {"name":"Miami (OHIO)", "id":193, "color":"ce2229"},
+ "195" : {"name":"Ohio", "id":195, "color":"006342"},
+ "218" : {"name":"Temple", "id":218, "color":"bc0138"},
+ "2050": {"name":"Ball State", "id":2050, "color":"de0000"},
+ "2117": {"name":"Central Michigan", "id":2117, "color":"7b0000"},
+ "2199": {"name":"Eastern Michigan", "id":2199, "color":"217038"},
+ "2459": {"name":"Northern Illinois", "id":2459, "color":"e73139"},
+ "2649": {"name":"Toledo", "id":2649, "color":"00275D"},
+ "2711": {"name":"Western Michigan", "id":2711, "color":"825229"}
+},
+"Mountain West": {
+ "2005": {"name":"Air Force", "id":2005, "color":"004a7b"},
+ "68" : {"name":"Boise State", "id":68, "color":"29299c"},
+ "36" : {"name":"Colorado State", "id":36, "color":"008c73"},
+ "167" : {"name":"New Mexico", "id":167, "color":"000000"},
+ "21" : {"name":"San Diego State", "id":21, "color":"d60039"},
+ "2628": {"name":"TCU", "id":2628, "color":"201852"},
+ "2439": {"name":"UNLV", "id":2439, "color":"000000"},
+ "2751": {"name":"Wyoming", "id":2751, "color":"523921"}
+},
+"Pacific-12": {
+ "25" : {"name":"California", "id":25, "color":"002942"},
+ "2483": {"name":"Oregon", "id":2483, "color":"044520"},
+ "204" : {"name":"Oregon State", "id":204, "color":"000000"},
+ "24" : {"name":"Stanford", "id":24, "color":"b72931"},
+ "264" : {"name":"Washington", "id":264, "color":"3E3468"},
+ "265" : {"name":"Washington State", "id":265, "color":"94022a"},
+ "12" : {"name":"Arizona", "id":12, "color":"102142"},
+ "9" : {"name":"Arizona State", "id":9, "color":"942139"},
+ "38" : {"name":"Colorado", "id":38, "color":"bd9c00"},
+ "26" : {"name":"UCLA", "id":26, "color":"005a94"},
+ "30" : {"name":"USC", "id":30, "color":"a50010"},
+ "254" : {"name":"Utah", "id":254, "color":"ce4242"}
+},
+"SEC": {
+ "57" : {"name":"Florida", "id":57, "color":"2a42ce"},
+ "61" : {"name":"Georgia", "id":61, "color":"d60022"},
+ "96" : {"name":"Kentucky", "id":96, "color":"003399"},
+ "2579": {"name":"South Carolina", "id":2579, "color":"000000"},
+ "2633": {"name":"Tennessee", "id":2633, "color":"EE9627"},
+ "238" : {"name":"Vanderbilt", "id":238, "color":"000000"},
+ "333" : {"name":"Alabama", "id":333, "color":"a42d47"},
+ "8" : {"name":"Arkansas", "id":8, "color":"9c1831"},
+ "2" : {"name":"Auburn", "id":2, "color":"182942"},
+ "99" : {"name":"LSU", "id":99, "color":"2B0D57"},
+ "344" : {"name":"Mississippi State", "id":344, "color":"531122"},
+ "145" : {"name":"Mississippi", "id":145, "color":"101894"}
+},
+"Sun Belt": {
+ "2032": {"name":"Arkansas State", "id":2032, "color":"e81018"},
+ "2226": {"name":"Fla Atlantic", "id":2226, "color":"000099"},
+ "2229": {"name":"Florida Intl", "id":2229, "color":"091731"},
+ "309" : {"name":"La Lafayette", "id":309, "color":"ce2842"},
+ "2433": {"name":"Louisiana Monroe", "id":2433, "color":"000000"},
+ "2393": {"name":"Middle Tennessee State", "id":2393, "color":"1842d6"},
+ "249" : {"name":"North Texas", "id":249, "color":"006342"},
+ "2653": {"name":"Troy", "id":2653, "color":"843131"},
+ "98" : {"name":"Western Kentucky", "id":98, "color":"000000"}
+},
+"WAC": {
+ "278": {"name":"Fresno State", "id":278, "color":"e73139"},
+ "62": {"name":"Hawaii", "id":62, "color":"004231"},
+ "70": {"name":"Idaho", "id":70, "color":"000000"},
+ "2348": {"name":"Louisiana Tech", "id":2348, "color":"3129e7"},
+ "2440": {"name":"Nevada", "id":2440, "color":"084a73"},
+ "166": {"name":"New Mexico State", "id":166, "color":"730000"},
+ "23": {"name":"San Jose State", "id":23, "color":"005a94"},
+ "328": {"name":"Utah State", "id":328, "color":"020767"}
+},
+"Big Sky": {
+ "331": {"name":"Eastern Wash.", "id":331, "color":"d72d35"},
+ "304": {"name":"Idaho State", "id":304, "color":"ef8c00"},
+ "149": {"name":"Montana", "id":149, "color":"63104a"},
+ "147": {"name":"Montana State", "id":147, "color":"010670"},
+ "2464": {"name":"Northern Arizona", "id":2464, "color":"001894"},
+ "2458": {"name":"Northern Colorado", "id":2458, "color":"003399"},
+ "2502": {"name":"Portland State", "id":2502, "color":"005e60"},
+ "16": {"name":"Sacramento State", "id":16, "color":"145f52"},
+ "2692": {"name":"Weber State", "id":2692, "color":"18005a"}
+},
+"Big South": {
+ "2127": {"name":"Charleston Southern", "id":2127, "color":"2e3192"},
+ "324": {"name":"Coastal Carolina", "id":324, "color":"59a0a0"},
+ "2241": {"name":"Gardner Webb", "id":2241, "color":"CF0000"},
+ "2335": {"name":"Liberty", "id":2335, "color":"000073"},
+ "2506": {"name":"Presbyterian", "id":2506, "color":"003372"},
+ "2619": {"name":"Stony Brook", "id":2619, "color":"003559"},
+ "2678": {"name":"Virginia Military Institue", "id":2678, "color":"000000"}
+},
+"CAA": {
+ "48": {"name":"Delaware", "id":48, "color":"285998"},
+ "256": {"name":"James Madison", "id":256, "color":"0f1358"},
+ "311": {"name":"Maine", "id":311, "color":"000000"},
+ "113": {"name":"Massachusetts", "id":113, "color":"ac0d1e"},
+ "160": {"name":"New Hampshire", "id":160, "color":"004371"},
+ "295" : {"name":"Old Dominion", "id":295, "color":"003665"},
+ "227": {"name":"Rhode Island", "id":227, "color":"003366"},
+ "257": {"name":"Richmond", "id":257, "color":"004371"},
+ "119": {"name":"Towson", "id":119, "color":"F3AE22"},
+ "222": {"name":"Villanova", "id":222, "color":"006699"},
+ "2729": {"name":"William & Mary", "id":2729, "color":"00423e"}
+},
+"Great West": {
+ "13": {"name":"Cal Poly", "id":13, "color":"083808"},
+ "155" : {"name":"North Dakota", "id":155, "color":"702D07"},
+ "233" : {"name":"South Dakota", "id":233, "color":"702D07"},
+ "253": {"name":"Southern Utah", "id":253, "color":"d10000"},
+ "302": {"name":"UC Davis", "id":302, "color":"103670"}
+},
+"IAA Independents": {
+ "2247": {"name": "Georgia State", "id":2247, "color":"1E539A"},
+ "2636": {"name": "Texas-San Antonio", "id":2636, "color":"113B7D"}
+},
+"Ivy": {
+ "225": {"name":"Brown", "id":225, "color":"54413a"},
+ "171": {"name":"Columbia", "id":171, "color":"00295a"},
+ "172": {"name":"Cornell", "id":172, "color":"d60027"},
+ "159": {"name":"Dartmouth", "id":159, "color":"005730"},
+ "108": {"name":"Harvard", "id":108, "color":"990000"},
+ "219": {"name":"Pennsylvania", "id":219, "color":"B10021"},
+ "163": {"name":"Princeton", "id":163, "color":"ff9408"},
+ "43": {"name":"Yale", "id":43, "color":"004a81"}
+},
+"MEAC": {
+ "2065": {"name":"Bethune-Cookman", "id":2065, "color":"7b1831"},
+ "2169": {"name":"Delaware State", "id":2169, "color":"FF3630"},
+ "50": {"name":"Florida A&M", "id":50, "color":"ff7329"},
+ "2261": {"name":"Hampton", "id":2261, "color":"0067AC"},
+ "47": {"name":"Howard", "id":47, "color":"9e0b0e"},
+ "2415": {"name":"Morgan State", "id":2415, "color":"0505aa"},
+ "2450": {"name":"Norfolk State", "id":2450, "color":"08614f"},
+ "2448": {"name":"North Carolina A&T", "id":2448, "color":"0505aa"},
+ "2428": {"name":"North Carolina Central", "id":2428, "color":"860016"},
+ "2542": {"name":"Savannah State", "id":2542, "color":"330099"},
+ "2569": {"name":"South Carolina State", "id":2569, "color":"7d1315"}
+},
+"Missouri Valley": {
+ "2287": {"name":"Illinois State", "id":2287, "color":"d72d35"},
+ "282": {"name":"Indiana State", "id":282, "color":"00669a"},
+ "2623": {"name":"Missouri State", "id":2623, "color":"4a0010"},
+ "2449": {"name":"North Dakota State", "id":2449, "color":"006421"},
+ "2460": {"name":"Northern Iowa", "id":2460, "color":"130671"},
+ "2571": {"name":"South Dakota State", "id":2571, "color":"00256f"},
+ "79": {"name":"Southern Illinois", "id":79, "color":"85283D"},
+ "2710": {"name":"Western Illinois", "id":2710, "color":"4e1e8a"},
+ "2754": {"name":"Youngstown State", "id":2754, "color":"961f22"}
+},
+"Northeast": {
+ "399": {"name":"Albany", "id":399, "color":"56438E"},
+ "2803": {"name":"Bryant University", "id":2803, "color":"702D07"},
+ "2115": {"name":"Central Connecticut State", "id":2115, "color":"1e489c"},
+ "2184": {"name":"Duquesne", "id":2184, "color":"283a61"},
+ "2405": {"name":"Monmouth", "id":2405, "color":"0d217b"},
+ "2523": {"name":"Robert Morris", "id":2523, "color":"3d4262"},
+ "2529": {"name":"Sacred Heart", "id":2529, "color":"bb003a"},
+ "2598": {"name":"St. Francis (PA)", "id":2598, "color":"a20012"},
+ "2681": {"name":"Wagner", "id":2681, "color":"003e22"}
+},
+"Ohio Valley": {
+ "2046": {"name":"Austin Peay", "id":2046, "color":"8e0b0b"},
+ "2197": {"name":"Eastern Illinois", "id":2197, "color":"000000"},
+ "2198": {"name":"Eastern Kentucky", "id":2198, "color":"800000"},
+ "55": {"name":"Jacksonville State", "id":55, "color":"c61018"},
+ "93": {"name":"Murray State", "id":93, "color":"182356"},
+ "2546": {"name":"Southeast Missouri State", "id":2546, "color":"cc0000"},
+ "2634": {"name":"Tennessee State", "id":2634, "color":"21398c"},
+ "2635": {"name":"Tennessee Tech", "id":2635, "color":"440e62"},
+ "2630": {"name":"Tennessee-Martin", "id":2630, "color":"000099"}
+},
+"Patriot League": {
+ "2083": {"name":"Bucknell", "id":2083, "color":"000060"},
+ "2142": {"name":"Colgate", "id":2142, "color":"910028"},
+ "2230": {"name":"Fordham", "id":2230, "color":"a50019"},
+ "46" : {"name":"Georgetown", "id":46, "color":"001B50"},
+ "107": {"name":"Holy Cross", "id":107, "color":"0a0a0a"},
+ "322": {"name":"Lafayette", "id":322, "color":"790000"},
+ "2329": {"name":"Lehigh", "id":2329, "color":"6c2b2a"}
+},
+"Pioneer": {
+ "2086": {"name":"Butler", "id":2086, "color":"0d1361"},
+ "2097": {"name":"Campbell", "id":2097, "color":"000000"},
+ "2166": {"name":"Davidson", "id":2166, "color":"000000"},
+ "2168": {"name":"Dayton", "id":2168, "color":"e50b0d"},
+ "2181": {"name":"Drake", "id":2181, "color":"0d1361"},
+ "294": {"name":"Jacksonville", "id":294, "color":"008568"},
+ "2368": {"name":"Marist", "id":2368, "color":"e53730"},
+ "2413": {"name":"Morehead State", "id":2413, "color":"29109c"},
+ "301": {"name":"San Diego", "id":301, "color":"0d1361"},
+ "2674": {"name":"Valparaiso", "id":2674, "color":"000000"}
+},
+"Southern": {
+ "2026": {"name":"Appalachian State", "id":2026, "color":"000000"},
+ "236": {"name":"Chattanooga", "id":236, "color":"253b81"},
+ "2643": {"name":"Citadel", "id":2643, "color":"000000"},
+ "2210": {"name":"Elon", "id":2210, "color":"020303"},
+ "231": {"name":"Furman", "id":231, "color":"4A2184"},
+ "290": {"name":"Georgia Southern", "id":290, "color":"0a3861"},
+ "2535": {"name":"Samford", "id":2535, "color":"005485"},
+ "2717": {"name":"Western Carolina", "id":2717, "color":"6e268b"},
+ "2747": {"name":"Wofford", "id":2747, "color":"000000"}
+},
+"Southland": {
+ "2110": {"name":"Central Arkansas", "id":2110, "color":"A7A9AC"},
+ "2320": {"name":"Lamar", "id":2320, "color":"0000"},
+ "2377": {"name":"McNeese State", "id":2377, "color":"003366"},
+ "2447": {"name":"Nicholls State", "id":2447, "color":"2a5074"},
+ "2466": {"name":"Northwestern State", "id":2466, "color":"68565f"},
+ "2534": {"name":"Sam Houston State", "id":2534, "color":"FF7800"},
+ "2545": {"name":"Southeastern Louisiana", "id":2545, "color":"205228"},
+ "2617": {"name":"Stephen F. Austin", "id":2617, "color":"230d3c"}
+},
+"SWAC": {
+ "2010": {"name":"Alabama A&M", "id":2010, "color":"790000"},
+ "2011": {"name":"Alabama State", "id":2011, "color":"603913"},
+ "2016": {"name":"Alcorn State", "id":2016, "color":"C1B881"},
+ "2296": {"name":"Jackson State", "id":2296, "color":"123297"},
+ "2400": {"name":"Mississippi Valley State", "id":2400, "color":"054105"},
+ "2029": {"name":"Arkansas-Pine Bluff", "id":2029, "color":"000000"},
+ "2755": {"name":"Grambling State", "id":2755, "color":"ee8601"},
+ "2504": {"name":"Prairie View A&M", "id":2504, "color":"4d0960"},
+ "2582": {"name":"Southern University", "id":2582, "color":"291b4c"},
+ "2640": {"name":"Texas Southern", "id":2640, "color":"680100"}
+}
+}
View
BIN  CollegeFootball.wdgt/images/backgroundTile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  CollegeFootball.wdgt/images/blank.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
39 CollegeFootball.wdgt/index.html
@@ -0,0 +1,39 @@
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>College Football Widget</title>
+
+ <meta name="HandheldFriendly" content="True"/>
+ <meta name="MobileOptimized" content="320"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+ <meta name="apple-mobile-web-app-capable" content="yes" />
+
+ <link rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <div id="front">
+ <ul>
+ <li><a id="stats" target="_blank" href="">Stats</a></li>
+ <li><a id="news" target="_blank" href="">News</a></li>
+ </ul>
+ <header>
+ <img id="logo" src="images/blank.png" />
+ <h1></h1>
+ </header>
+ <table></table>
+ <div class="flipper" style="display:none"><a href="#">i</a></div>
+ </div>
+ <div id="back">
+ <h1>College Football</h1>
+ <form>
+ <label for="conferences">Conference</label>
+ <select id="conferences"></select>
+ <label for="teams">Team</label>
+ <select id="teams"></select>
+ <button>Done</button>
+ </form>
+ <a target="_blank" href="http://nlsmith.com/projects/college-football">nlsmith.com</a>
+ </div>
+ <script src="js/require-jquery.js" data-main="js/main"></script>
+ </body>
+</html>
View
145 CollegeFootball.wdgt/js/date.js
@@ -0,0 +1,145 @@
+/**
+ * @version: 1.0 Alpha-1
+ * @author: Coolite Inc. http://www.coolite.com/
+ * @date: 2008-05-13
+ * @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All rights reserved.
+ * @license: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/.
+ * @website: http://www.datejs.com/
+ */
+Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[{name:"UTC",offset:"-000"},{name:"GMT",offset:"-000"},{name:"EST",offset:"-0500"},{name:"EDT",offset:"-0400"},{name:"CST",offset:"-0600"},{name:"CDT",offset:"-0500"},{name:"MST",offset:"-0700"},{name:"MDT",offset:"-0600"},{name:"PST",offset:"-0800"},{name:"PDT",offset:"-0700"}]};
+(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,p=function(s,l){if(!l){l=2;}
+return("000"+s).slice(l*-1);};$P.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};$P.setTimeToNow=function(){var n=new Date();this.setHours(n.getHours());this.setMinutes(n.getMinutes());this.setSeconds(n.getSeconds());this.setMilliseconds(n.getMilliseconds());return this;};$D.today=function(){return new Date().clearTime();};$D.compare=function(date1,date2){if(isNaN(date1)||isNaN(date2)){throw new Error(date1+" - "+date2);}else if(date1 instanceof Date&&date2 instanceof Date){return(date1<date2)?-1:(date1>date2)?1:0;}else{throw new TypeError(date1+" - "+date2);}};$D.equals=function(date1,date2){return(date1.compareTo(date2)===0);};$D.getDayNumberFromName=function(name){var n=$C.dayNames,m=$C.abbreviatedDayNames,o=$C.shortestDayNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s||o[i].toLowerCase()==s){return i;}}
+return-1;};$D.getMonthNumberFromName=function(name){var n=$C.monthNames,m=$C.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
+return-1;};$D.isLeapYear=function(year){return((year%4===0&&year%100!==0)||year%400===0);};$D.getDaysInMonth=function(year,month){return[31,($D.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month];};$D.getTimezoneAbbreviation=function(offset){var z=$C.timezones,p;for(var i=0;i<z.length;i++){if(z[i].offset===offset){return z[i].name;}}
+return null;};$D.getTimezoneOffset=function(name){var z=$C.timezones,p;for(var i=0;i<z.length;i++){if(z[i].name===name.toUpperCase()){return z[i].offset;}}
+return null;};$P.clone=function(){return new Date(this.getTime());};$P.compareTo=function(date){return Date.compare(this,date);};$P.equals=function(date){return Date.equals(this,date||new Date());};$P.between=function(start,end){return this.getTime()>=start.getTime()&&this.getTime()<=end.getTime();};$P.isAfter=function(date){return this.compareTo(date||new Date())===1;};$P.isBefore=function(date){return(this.compareTo(date||new Date())===-1);};$P.isToday=function(){return this.isSameDay(new Date());};$P.isSameDay=function(date){return this.clone().clearTime().equals(date.clone().clearTime());};$P.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};$P.addSeconds=function(value){return this.addMilliseconds(value*1000);};$P.addMinutes=function(value){return this.addMilliseconds(value*60000);};$P.addHours=function(value){return this.addMilliseconds(value*3600000);};$P.addDays=function(value){this.setDate(this.getDate()+value);return this;};$P.addWeeks=function(value){return this.addDays(value*7);};$P.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,$D.getDaysInMonth(this.getFullYear(),this.getMonth())));return this;};$P.addYears=function(value){return this.addMonths(value*12);};$P.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
+var x=config;if(x.milliseconds){this.addMilliseconds(x.milliseconds);}
+if(x.seconds){this.addSeconds(x.seconds);}
+if(x.minutes){this.addMinutes(x.minutes);}
+if(x.hours){this.addHours(x.hours);}
+if(x.weeks){this.addWeeks(x.weeks);}
+if(x.months){this.addMonths(x.months);}
+if(x.years){this.addYears(x.years);}
+if(x.days){this.addDays(x.days);}
+return this;};var $y,$m,$d;$P.getWeek=function(){var a,b,c,d,e,f,g,n,s,w;$y=(!$y)?this.getFullYear():$y;$m=(!$m)?this.getMonth()+1:$m;$d=(!$d)?this.getDate():$d;if($m<=2){a=$y-1;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=0;f=$d-1+(31*($m-1));}else{a=$y;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=s+1;f=$d+((153*($m-3)+2)/5)+58+s;}
+g=(a+b)%7;d=(f+g-e)%7;n=(f+3-d)|0;if(n<0){w=53-((g-s)/5|0);}else if(n>364+s){w=1;}else{w=(n/7|0)+1;}
+$y=$m=$d=null;return w;};$P.getISOWeek=function(){$y=this.getUTCFullYear();$m=this.getUTCMonth()+1;$d=this.getUTCDate();return p(this.getWeek());};$P.setWeek=function(n){return this.moveToDayOfWeek(1).addWeeks(n-this.getWeek());};$D._validate=function(n,min,max,name){if(typeof n=="undefined"){return false;}else if(typeof n!="number"){throw new TypeError(n+" is not a Number.");}else if(n<min||n>max){throw new RangeError(n+" is not a valid value for "+name+".");}
+return true;};$D.validateMillisecond=function(value){return $D._validate(value,0,999,"millisecond");};$D.validateSecond=function(value){return $D._validate(value,0,59,"second");};$D.validateMinute=function(value){return $D._validate(value,0,59,"minute");};$D.validateHour=function(value){return $D._validate(value,0,23,"hour");};$D.validateDay=function(value,year,month){return $D._validate(value,1,$D.getDaysInMonth(year,month),"day");};$D.validateMonth=function(value){return $D._validate(value,0,11,"month");};$D.validateYear=function(value){return $D._validate(value,0,9999,"year");};$P.set=function(config){if($D.validateMillisecond(config.millisecond)){this.addMilliseconds(config.millisecond-this.getMilliseconds());}
+if($D.validateSecond(config.second)){this.addSeconds(config.second-this.getSeconds());}
+if($D.validateMinute(config.minute)){this.addMinutes(config.minute-this.getMinutes());}
+if($D.validateHour(config.hour)){this.addHours(config.hour-this.getHours());}
+if($D.validateMonth(config.month)){this.addMonths(config.month-this.getMonth());}
+if($D.validateYear(config.year)){this.addYears(config.year-this.getFullYear());}
+if($D.validateDay(config.day,this.getFullYear(),this.getMonth())){this.addDays(config.day-this.getDate());}
+if(config.timezone){this.setTimezone(config.timezone);}
+if(config.timezoneOffset){this.setTimezoneOffset(config.timezoneOffset);}
+if(config.week&&$D._validate(config.week,0,53,"week")){this.setWeek(config.week);}
+return this;};$P.moveToFirstDayOfMonth=function(){return this.set({day:1});};$P.moveToLastDayOfMonth=function(){return this.set({day:$D.getDaysInMonth(this.getFullYear(),this.getMonth())});};$P.moveToNthOccurrence=function(dayOfWeek,occurrence){var shift=0;if(occurrence>0){shift=occurrence-1;}
+else if(occurrence===-1){this.moveToLastDayOfMonth();if(this.getDay()!==dayOfWeek){this.moveToDayOfWeek(dayOfWeek,-1);}
+return this;}
+return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(dayOfWeek,+1).addWeeks(shift);};$P.moveToDayOfWeek=function(dayOfWeek,orient){var diff=(dayOfWeek-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};$P.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};$P.getOrdinalNumber=function(){return Math.ceil((this.clone().clearTime()-new Date(this.getFullYear(),0,1))/86400000)+1;};$P.getTimezone=function(){return $D.getTimezoneAbbreviation(this.getUTCOffset());};$P.setTimezoneOffset=function(offset){var here=this.getTimezoneOffset(),there=Number(offset)*-6/10;return this.addMinutes(there-here);};$P.setTimezone=function(offset){return this.setTimezoneOffset($D.getTimezoneOffset(offset));};$P.hasDaylightSavingTime=function(){return(Date.today().set({month:0,day:1}).getTimezoneOffset()!==Date.today().set({month:6,day:1}).getTimezoneOffset());};$P.isDaylightSavingTime=function(){return(this.hasDaylightSavingTime()&&new Date().getTimezoneOffset()===Date.today().set({month:6,day:1}).getTimezoneOffset());};$P.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r.charAt(0)+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};$P.getElapsed=function(date){return(date||new Date())-this;};if(!$P.toISOString){$P.toISOString=function(){function f(n){return n<10?'0'+n:n;}
+return'"'+this.getUTCFullYear()+'-'+
+f(this.getUTCMonth()+1)+'-'+
+f(this.getUTCDate())+'T'+
+f(this.getUTCHours())+':'+
+f(this.getUTCMinutes())+':'+
+f(this.getUTCSeconds())+'Z"';};}
+$P._toString=$P.toString;$P.toString=function(format){var x=this;if(format&&format.length==1){var c=$C.formatPatterns;x.t=x.toString;switch(format){case"d":return x.t(c.shortDate);case"D":return x.t(c.longDate);case"F":return x.t(c.fullDateTime);case"m":return x.t(c.monthDay);case"r":return x.t(c.rfc1123);case"s":return x.t(c.sortableDateTime);case"t":return x.t(c.shortTime);case"T":return x.t(c.longTime);case"u":return x.t(c.universalSortableDateTime);case"y":return x.t(c.yearMonth);}}
+var ord=function(n){switch(n*1){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};return format?format.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g,function(m){if(m.charAt(0)==="\\"){return m.replace("\\","");}
+x.h=x.getHours;switch(m){case"hh":return p(x.h()<13?(x.h()===0?12:x.h()):(x.h()-12));case"h":return x.h()<13?(x.h()===0?12:x.h()):(x.h()-12);case"HH":return p(x.h());case"H":return x.h();case"mm":return p(x.getMinutes());case"m":return x.getMinutes();case"ss":return p(x.getSeconds());case"s":return x.getSeconds();case"yyyy":return p(x.getFullYear(),4);case"yy":return p(x.getFullYear());case"dddd":return $C.dayNames[x.getDay()];case"ddd":return $C.abbreviatedDayNames[x.getDay()];case"dd":return p(x.getDate());case"d":return x.getDate();case"MMMM":return $C.monthNames[x.getMonth()];case"MMM":return $C.abbreviatedMonthNames[x.getMonth()];case"MM":return p((x.getMonth()+1));case"M":return x.getMonth()+1;case"t":return x.h()<12?$C.amDesignator.substring(0,1):$C.pmDesignator.substring(0,1);case"tt":return x.h()<12?$C.amDesignator:$C.pmDesignator;case"S":return ord(x.getDate());default:return m;}}):this._toString();};}());
+(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,$N=Number.prototype;$P._orient=+1;$P._nth=null;$P._is=false;$P._same=false;$P._isSecond=false;$N._dateElement="day";$P.next=function(){this._orient=+1;return this;};$D.next=function(){return $D.today().next();};$P.last=$P.prev=$P.previous=function(){this._orient=-1;return this;};$D.last=$D.prev=$D.previous=function(){return $D.today().last();};$P.is=function(){this._is=true;return this;};$P.same=function(){this._same=true;this._isSecond=false;return this;};$P.today=function(){return this.same().day();};$P.weekday=function(){if(this._is){this._is=false;return(!this.is().sat()&&!this.is().sun());}
+return false;};$P.at=function(time){return(typeof time==="string")?$D.parse(this.toString("d")+" "+time):this.set(time);};$N.fromNow=$N.after=function(date){var c={};c[this._dateElement]=this;return((!date)?new Date():date.clone()).add(c);};$N.ago=$N.before=function(date){var c={};c[this._dateElement]=this*-1;return((!date)?new Date():date.clone()).add(c);};var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),pxf=("Milliseconds Seconds Minutes Hours Date Week Month FullYear").split(/\s/),nth=("final first second third fourth fifth").split(/\s/),de;$P.toObject=function(){var o={};for(var i=0;i<px.length;i++){o[px[i].toLowerCase()]=this["get"+pxf[i]]();}
+return o;};$D.fromObject=function(config){config.week=null;return Date.today().set(config);};var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;}
+if(this._nth!==null){if(this._isSecond){this.addSeconds(this._orient*-1);}
+this._isSecond=false;var ntemp=this._nth;this._nth=null;var temp=this.clone().moveToLastDayOfMonth();this.moveToNthOccurrence(n,ntemp);if(this>temp){throw new RangeError($D.getDayName(n)+" does not occur "+ntemp+" times in the month of "+$D.getMonthName(temp.getMonth())+" "+temp.getFullYear()+".");}
+return this;}
+return this.moveToDayOfWeek(n,this._orient);};};var sdf=function(n){return function(){var t=$D.today(),shift=n-t.getDay();if(n===0&&$C.firstDayOfWeek===1&&t.getDay()!==0){shift=shift+7;}
+return t.addDays(shift);};};for(var i=0;i<dx.length;i++){$D[dx[i].toUpperCase()]=$D[dx[i].toUpperCase().substring(0,3)]=i;$D[dx[i]]=$D[dx[i].substring(0,3)]=sdf(i);$P[dx[i]]=$P[dx[i].substring(0,3)]=df(i);}
+var mf=function(n){return function(){if(this._is){this._is=false;return this.getMonth()===n;}
+return this.moveToMonth(n,this._orient);};};var smf=function(n){return function(){return $D.today().set({month:n,day:1});};};for(var j=0;j<mx.length;j++){$D[mx[j].toUpperCase()]=$D[mx[j].toUpperCase().substring(0,3)]=j;$D[mx[j]]=$D[mx[j].substring(0,3)]=smf(j);$P[mx[j]]=$P[mx[j].substring(0,3)]=mf(j);}
+var ef=function(j){return function(){if(this._isSecond){this._isSecond=false;return this;}
+if(this._same){this._same=this._is=false;var o1=this.toObject(),o2=(arguments[0]||new Date()).toObject(),v="",k=j.toLowerCase();for(var m=(px.length-1);m>-1;m--){v=px[m].toLowerCase();if(o1[v]!=o2[v]){return false;}
+if(k==v){break;}}
+return true;}
+if(j.substring(j.length-1)!="s"){j+="s";}
+return this["add"+j](this._orient);};};var nf=function(n){return function(){this._dateElement=n;return this;};};for(var k=0;k<px.length;k++){de=px[k].toLowerCase();$P[de]=$P[de+"s"]=ef(px[k]);$N[de]=$N[de+"s"]=nf(de);}
+$P._ss=ef("Second");var nthfn=function(n){return function(dayOfWeek){if(this._same){return this._ss(arguments[0]);}
+if(dayOfWeek||dayOfWeek===0){return this.moveToNthOccurrence(dayOfWeek,n);}
+this._nth=n;if(n===2&&(dayOfWeek===undefined||dayOfWeek===null)){this._isSecond=true;return this.addSeconds(this._orient);}
+return this;};};for(var l=0;l<nth.length;l++){$P[nth[l]]=(l===0)?nthfn(-1):nthfn(l);}}());
+(function(){Date.Parsing={Exception:function(s){this.message="Parse error at '"+s.substring(0,10)+" ...'";}};var $P=Date.Parsing;var _=$P.Operators={rtoken:function(r){return function(s){var mx=s.match(r);if(mx){return([mx[0],s.substring(mx[0].length)]);}else{throw new $P.Exception(s);}};},token:function(s){return function(s){return _.rtoken(new RegExp("^\s*"+s+"\s*"))(s);};},stoken:function(s){return _.rtoken(new RegExp("^"+s));},until:function(p){return function(s){var qx=[],rx=null;while(s.length){try{rx=p.call(this,s);}catch(e){qx.push(rx[0]);s=rx[1];continue;}
+break;}
+return[qx,s];};},many:function(p){return function(s){var rx=[],r=null;while(s.length){try{r=p.call(this,s);}catch(e){return[rx,s];}
+rx.push(r[0]);s=r[1];}
+return[rx,s];};},optional:function(p){return function(s){var r=null;try{r=p.call(this,s);}catch(e){return[null,s];}
+return[r[0],r[1]];};},not:function(p){return function(s){try{p.call(this,s);}catch(e){return[null,s];}
+throw new $P.Exception(s);};},ignore:function(p){return p?function(s){var r=null;r=p.call(this,s);return[null,r[1]];}:null;},product:function(){var px=arguments[0],qx=Array.prototype.slice.call(arguments,1),rx=[];for(var i=0;i<px.length;i++){rx.push(_.each(px[i],qx));}
+return rx;},cache:function(rule){var cache={},r=null;return function(s){try{r=cache[s]=(cache[s]||rule.call(this,s));}catch(e){r=cache[s]=e;}
+if(r instanceof $P.Exception){throw r;}else{return r;}};},any:function(){var px=arguments;return function(s){var r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
+try{r=(px[i].call(this,s));}catch(e){r=null;}
+if(r){return r;}}
+throw new $P.Exception(s);};},each:function(){var px=arguments;return function(s){var rx=[],r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
+try{r=(px[i].call(this,s));}catch(e){throw new $P.Exception(s);}
+rx.push(r[0]);s=r[1];}
+return[rx,s];};},all:function(){var px=arguments,_=_;return _.each(_.optional(px));},sequence:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;if(px.length==1){return px[0];}
+return function(s){var r=null,q=null;var rx=[];for(var i=0;i<px.length;i++){try{r=px[i].call(this,s);}catch(e){break;}
+rx.push(r[0]);try{q=d.call(this,r[1]);}catch(ex){q=null;break;}
+s=q[1];}
+if(!r){throw new $P.Exception(s);}
+if(q){throw new $P.Exception(q[1]);}
+if(c){try{r=c.call(this,r[1]);}catch(ey){throw new $P.Exception(r[1]);}}
+return[rx,(r?r[1]:s)];};},between:function(d1,p,d2){d2=d2||d1;var _fn=_.each(_.ignore(d1),p,_.ignore(d2));return function(s){var rx=_fn.call(this,s);return[[rx[0][0],r[0][2]],rx[1]];};},list:function(p,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return(p instanceof Array?_.each(_.product(p.slice(0,-1),_.ignore(d)),p.slice(-1),_.ignore(c)):_.each(_.many(_.each(p,_.ignore(d))),px,_.ignore(c)));},set:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return function(s){var r=null,p=null,q=null,rx=null,best=[[],s],last=false;for(var i=0;i<px.length;i++){q=null;p=null;r=null;last=(px.length==1);try{r=px[i].call(this,s);}catch(e){continue;}
+rx=[[r[0]],r[1]];if(r[1].length>0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
+if(!last&&q[1].length===0){last=true;}
+if(!last){var qx=[];for(var j=0;j<px.length;j++){if(i!=j){qx.push(px[j]);}}
+p=_.set(qx,d).call(this,q[1]);if(p[0].length>0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
+if(rx[1].length<best[1].length){best=rx;}
+if(best[1].length===0){break;}}
+if(best[0].length===0){return best;}
+if(c){try{q=c.call(this,best[1]);}catch(ey){throw new $P.Exception(best[1]);}
+best[1]=q[1];}
+return best;};},forward:function(gr,fname){return function(s){return gr[fname].call(this,s);};},replace:function(rule,repl){return function(s){var r=rule.call(this,s);return[repl,r[1]];};},process:function(rule,fn){return function(s){var r=rule.call(this,s);return[fn.call(this,r[0]),r[1]];};},min:function(min,rule){return function(s){var rx=rule.call(this,s);if(rx[0].length<min){throw new $P.Exception(s);}
+return rx;};}};var _generator=function(op){return function(){var args=null,rx=[];if(arguments.length>1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
+if(args){for(var i=0,px=args.shift();i<px.length;i++){args.unshift(px[i]);rx.push(op.apply(null,args));args.shift();return rx;}}else{return op.apply(null,arguments);}};};var gx="optional not ignore cache".split(/\s/);for(var i=0;i<gx.length;i++){_[gx[i]]=_generator(_[gx[i]]);}
+var _vector=function(op){return function(){if(arguments[0]instanceof Array){return op.apply(null,arguments[0]);}else{return op.apply(null,arguments);}};};var vx="each any all".split(/\s/);for(var j=0;j<vx.length;j++){_[vx[j]]=_vector(_[vx[j]]);}}());(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo;var flattenAndCompact=function(ax){var rx=[];for(var i=0;i<ax.length;i++){if(ax[i]instanceof Array){rx=rx.concat(flattenAndCompact(ax[i]));}else{if(ax[i]){rx.push(ax[i]);}}}
+return rx;};$D.Grammar={};$D.Translator={hour:function(s){return function(){this.hour=Number(s);};},minute:function(s){return function(){this.minute=Number(s);};},second:function(s){return function(){this.second=Number(s);};},meridian:function(s){return function(){this.meridian=s.slice(0,1).toLowerCase();};},timezone:function(s){return function(){var n=s.replace(/[^\d\+\-]/g,"");if(n.length){this.timezoneOffset=Number(n);}else{this.timezone=s.toLowerCase();}};},day:function(x){var s=x[0];return function(){this.day=Number(s.match(/\d+/)[0]);};},month:function(s){return function(){this.month=(s.length==3)?"jan feb mar apr may jun jul aug sep oct nov dec".indexOf(s)/4:Number(s)-1;};},year:function(s){return function(){var n=Number(s);this.year=((s.length>2)?n:(n+(((n+2000)<$C.twoDigitYearMax)?2000:1900)));};},rday:function(s){return function(){switch(s){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break;}};},finishExact:function(x){x=(x instanceof Array)?x:[x];for(var i=0;i<x.length;i++){if(x[i]){x[i].call(this);}}
+var now=new Date();if((this.hour||this.minute)&&(!this.month&&!this.year&&!this.day)){this.day=now.getDate();}
+if(!this.year){this.year=now.getFullYear();}
+if(!this.month&&this.month!==0){this.month=now.getMonth();}
+if(!this.day){this.day=1;}
+if(!this.hour){this.hour=0;}
+if(!this.minute){this.minute=0;}
+if(!this.second){this.second=0;}
+if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12;}else if(this.meridian=="a"&&this.hour==12){this.hour=0;}}
+if(this.day>$D.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");}
+var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
+return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
+for(var i=0;i<x.length;i++){if(typeof x[i]=="function"){x[i].call(this);}}
+var today=$D.today();if(this.now&&!this.unit&&!this.operator){return new Date();}else if(this.now){today=new Date();}
+var expression=!!(this.days&&this.days!==null||this.orient||this.operator);var gap,mod,orient;orient=((this.orient=="past"||this.operator=="subtract")?-1:1);if(!this.now&&"hour minute second".indexOf(this.unit)!=-1){today.setTimeToNow();}
+if(this.month||this.month===0){if("year day hour minute second".indexOf(this.unit)!=-1){this.value=this.month+1;this.month=null;expression=true;}}
+if(!expression&&this.weekday&&!this.day&&!this.days){var temp=Date[this.weekday]();this.day=temp.getDate();if(!this.month){this.month=temp.getMonth();}
+this.year=temp.getFullYear();}
+if(expression&&this.weekday&&this.unit!="month"){this.unit="day";gap=($D.getDayNumberFromName(this.weekday)-today.getDay());mod=7;this.days=gap?((gap+(orient*mod))%mod):(orient*mod);}
+if(this.month&&this.unit=="day"&&this.operator){this.value=(this.month+1);this.month=null;}
+if(this.value!=null&&this.month!=null&&this.year!=null){this.day=this.value*1;}
+if(this.month&&!this.day&&this.value){today.set({day:this.value*1});if(!expression){this.day=this.value*1;}}
+if(!this.month&&this.value&&this.unit=="month"&&!this.now){this.month=this.value;expression=true;}
+if(expression&&(this.month||this.month===0)&&this.unit!="year"){this.unit="month";gap=(this.month-today.getMonth());mod=12;this.months=gap?((gap+(orient*mod))%mod):(orient*mod);this.month=null;}
+if(!this.unit){this.unit="day";}
+if(!this.value&&this.operator&&this.operator!==null&&this[this.unit+"s"]&&this[this.unit+"s"]!==null){this[this.unit+"s"]=this[this.unit+"s"]+((this.operator=="add")?1:-1)+(this.value||0)*orient;}else if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1;}
+this[this.unit+"s"]=this.value*orient;}
+if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12;}else if(this.meridian=="a"&&this.hour==12){this.hour=0;}}
+if(this.weekday&&!this.day&&!this.days){var temp=Date[this.weekday]();this.day=temp.getDate();if(temp.getMonth()!==today.getMonth()){this.month=temp.getMonth();}}
+if((this.month||this.month===0)&&!this.day){this.day=1;}
+if(!this.orient&&!this.operator&&this.unit=="week"&&this.value&&!this.day&&!this.month){return Date.today().setWeek(this.value);}
+if(expression&&this.timezone&&this.day&&this.days){this.day=this.days;}
+return(expression)?today.add(this):today.set(this);}};var _=$D.Parsing.Operators,g=$D.Grammar,t=$D.Translator,_fn;g.datePartDelimiter=_.rtoken(/^([\s\-\.\,\/\x27]+)/);g.timePartDelimiter=_.stoken(":");g.whiteSpace=_.rtoken(/^\s*/);g.generalDelimiter=_.rtoken(/^(([\s\,]|at|@|on)+)/);var _C={};g.ctoken=function(keys){var fn=_C[keys];if(!fn){var c=$C.regexPatterns;var kx=keys.split(/\s+/),px=[];for(var i=0;i<kx.length;i++){px.push(_.replace(_.rtoken(c[kx[i]]),kx[i]));}
+fn=_C[keys]=_.any.apply(null,px);}
+return fn;};g.ctoken2=function(key){return _.rtoken($C.regexPatterns[key]);};g.h=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),t.hour));g.hh=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/),t.hour));g.H=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),t.hour));g.HH=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/),t.hour));g.m=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.minute));g.mm=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.minute));g.s=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.second));g.ss=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.second));g.hms=_.cache(_.sequence([g.H,g.m,g.s],g.timePartDelimiter));g.t=_.cache(_.process(g.ctoken2("shortMeridian"),t.meridian));g.tt=_.cache(_.process(g.ctoken2("longMeridian"),t.meridian));g.z=_.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),t.timezone));g.zz=_.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),t.timezone));g.zzz=_.cache(_.process(g.ctoken2("timezone"),t.timezone));g.timeSuffix=_.each(_.ignore(g.whiteSpace),_.set([g.tt,g.zzz]));g.time=_.each(_.optional(_.ignore(_.stoken("T"))),g.hms,g.timeSuffix);g.d=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.dd=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.ddd=g.dddd=_.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"),function(s){return function(){this.weekday=s;};}));g.M=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/),t.month));g.MM=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/),t.month));g.MMM=g.MMMM=_.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),t.month));g.y=_.cache(_.process(_.rtoken(/^(\d\d?)/),t.year));g.yy=_.cache(_.process(_.rtoken(/^(\d\d)/),t.year));g.yyy=_.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/),t.year));g.yyyy=_.cache(_.process(_.rtoken(/^(\d\d\d\d)/),t.year));_fn=function(){return _.each(_.any.apply(null,arguments),_.not(g.ctoken2("timeContext")));};g.day=_fn(g.d,g.dd);g.month=_fn(g.M,g.MMM);g.year=_fn(g.yyyy,g.yy);g.orientation=_.process(g.ctoken("past future"),function(s){return function(){this.orient=s;};});g.operator=_.process(g.ctoken("add subtract"),function(s){return function(){this.operator=s;};});g.rday=_.process(g.ctoken("yesterday tomorrow today now"),t.rday);g.unit=_.process(g.ctoken("second minute hour day week month year"),function(s){return function(){this.unit=s;};});g.value=_.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/),function(s){return function(){this.value=s.replace(/\D/g,"");};});g.expression=_.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);_fn=function(){return _.set(arguments,g.datePartDelimiter);};g.mdy=_fn(g.ddd,g.month,g.day,g.year);g.ymd=_fn(g.ddd,g.year,g.month,g.day);g.dmy=_fn(g.ddd,g.day,g.month,g.year);g.date=function(s){return((g[$C.dateElementOrder]||g.mdy).call(this,s));};g.format=_.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(fmt){if(g[fmt]){return g[fmt];}else{throw $D.Parsing.Exception(fmt);}}),_.process(_.rtoken(/^[^dMyhHmstz]+/),function(s){return _.ignore(_.stoken(s));}))),function(rules){return _.process(_.each.apply(null,rules),t.finishExact);});var _F={};var _get=function(f){return _F[f]=(_F[f]||g.format(f)[0]);};g.formats=function(fx){if(fx instanceof Array){var rx=[];for(var i=0;i<fx.length;i++){rx.push(_get(fx[i]));}
+return _.any.apply(null,rx);}else{return _get(fx);}};g._formats=g.formats(["\"yyyy-MM-ddTHH:mm:ssZ\"","yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy","ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]);g._start=_.process(_.set([g.date,g.time,g.expression],g.generalDelimiter,g.whiteSpace),t.finish);g.start=function(s){try{var r=g._formats.call({},s);if(r[1].length===0){return r;}}catch(e){}
+return g._start.call({},s);};$D._parse=$D.parse;$D.parse=function(s){var r=null;if(!s){return null;}
+if(s instanceof Date){return s;}
+try{r=$D.Grammar.start.call({},s.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1"));}catch(e){return null;}
+return((r[1].length===0)?r[0]:null);};$D.getParseFunction=function(fx){var fn=$D.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
+return((r[1].length===0)?r[0]:null);};};$D.parseExact=function(s,fx){return $D.getParseFunction(fx)(s);};}());
View
75 CollegeFootball.wdgt/js/jquery.xdomainajax.js
@@ -0,0 +1,75 @@
+/**
+ * jQuery.ajax mid - CROSS DOMAIN AJAX
+ * ---
+ * @author James Padolsey (http://james.padolsey.com)
+ * @version 0.11
+ * @updated 12-JAN-10
+ * ---
+ * Note: Read the README!
+ * ---
+ * @info http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/
+ */
+
+jQuery.ajax = (function(_ajax){
+
+ var protocol = location.protocol,
+ hostname = location.hostname,
+ exRegex = RegExp(protocol + '//' + hostname),
+ YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?',
+ query = 'select * from html where url="{URL}" and xpath="*"';
+
+ function isExternal(url) {
+ return !exRegex.test(url) && /:\/\//.test(url);
+ }
+
+ return function(o) {
+
+ var url = o.url;
+
+ if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) {
+
+ // Manipulate options so that JSONP-x request is made to YQL
+
+ o.url = YQL;
+ o.dataType = 'json';
+
+ o.data = {
+ q: query.replace(
+ '{URL}',
+ url + (o.data ?
+ (/\?/.test(url) ? '&' : '?') + jQuery.param(o.data)
+ : '')
+ ),
+ format: 'xml'
+ };
+
+ // Since it's a JSONP request
+ // complete === success
+ if (!o.success && o.complete) {
+ o.success = o.complete;
+ delete o.complete;
+ }
+
+ o.success = (function(_success){
+ return function(data) {
+
+ if (_success) {
+ // Fake XHR callback.
+ _success.call(this, {
+ responseText: data.results[0]
+ // YQL screws with <script>s
+ // Get rid of them
+ .replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
+ }, 'success');
+ }
+
+ };
+ })(o.success);
+
+ }
+
+ return _ajax.apply(this, arguments);
+
+ };
+
+})(jQuery.ajax);
View
3  CollegeFootball.wdgt/js/main.js
@@ -0,0 +1,3 @@
+require(["./ui", "./widget"], function (ui) {
+ ui.load();
+});
View
47 CollegeFootball.wdgt/js/pref.js
@@ -0,0 +1,47 @@
+// Get or set preferences, using either localStorage or Dashboard prefs
+define(function (require, exports) {
+ var w = window.widget, engine, prefs = {}; // fallback
+
+ function supportsLocalStorage() {
+ try {
+ return 'localStorage' in window && window['localStorage'] !== null;
+ } catch (e) {
+ return false;
+ }
+ }
+
+ // Determine storage method
+ if (w) { engine = "widget"; }
+ else if (supportsLocalStorage()) { engine = "localStorage"; }
+
+ exports.get = function (pref) {
+ var v;
+ switch (engine) {
+ case "localStorage":
+ v = localStorage.getItem(pref);
+ break;
+ case "widget":
+ v = w.preferenceForKey(pref);
+ break;
+ default:
+ v = prefs[pref];
+ break;
+ }
+ return v;
+ };
+
+ exports.set = function (pref, value) {
+ switch (engine) {
+ case "localStorage":
+ localStorage.setItem(pref, value);
+ break;
+ case "widget":
+ w.setPreferenceForKey(pref, value);
+ prefs[pref] = value;
+ break;
+ default:
+ prefs[pref] = value;
+ break;
+ }
+ };
+});
View
10,998 CollegeFootball.wdgt/js/require-jquery.js
10,998 additions, 0 deletions not shown
View
71 CollegeFootball.wdgt/js/schedule.js
@@ -0,0 +1,71 @@
+define(["require", "exports", "jquery", "./date"], function (require, exports, $) {
+ var cellMethods;
+
+ function convertTZ(time) {
+ // TODO
+ return time;
+ }
+
+ function row(i, r) {
+ var cells = $(r).find("td"),
+ o = {},
+ cols = ["date", "opponent", "resultTime", "recordTickets"]
+
+ cells.each(function (i, c) {
+ cellMethods[cols[i]]($(c), o);
+ });
+
+ return o;
+ }
+
+ function process(html) {
+ var table = $(html).find("div.mod-content table:first"),
+ rows = table.find("tr.oddrow, tr.evenrow");
+ return rows.map(row);
+ }
+
+ cellMethods = {
+ date: function (cell, o) {
+ var d = Date.parse(cell.find("p").html());
+ o.date = [d.getMonth() + 1, d.getDate()].join("/");
+ },
+ opponent: function (cell, o) {
+ var team = cell.find(".team-name a").html(),
+ away = cell.find("p").html() === "@";
+ o.opponent = (away ? "at " : "") + team;
+ },
+ resultTime: function (cell, o) {
+ var rt = o.resultTime = cell.find("p").text();
+ // If there's " ET " (eastern time)
+ if (/\sET\s?/.test(rt)) {
+ // Remove everything after the "ET "
+ rt = rt.replace(/\sET\s?(.*)$/, "");
+ rt = convertTZ(rt);
+ }
+ o.resultTime = rt;
+ },
+ recordTickets: function (cell, o) {}
+ };
+
+ exports.create = function (html) {
+ var s = {};
+
+ s.games = process(html);
+
+ s.toHtml = function () {
+ var t = $("<table />"),
+ fields = ["date", "opponent", "resultTime"];
+
+ s.games.each(function (i, game) {
+ var row = $("<tr />");
+ fields.forEach(function (f) {
+ row.append($("<td />").html(game[f]));
+ });
+ t.append(row);
+ });
+ return t.html();
+ };
+
+ return s;
+ };
+});
View
295 CollegeFootball.wdgt/js/spin.js
@@ -0,0 +1,295 @@
+//fgnass.github.com/spin.js
+(function(window, document, undefined) {
+
+/**
+ * Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
+ * Licensed under the MIT license
+ *
+ * Unfortunately uglify.js doesn't provide an option to de-duplicate strings
+ * or to use string-based property access. Hence we have to manually define
+ * some string constants in order to keep file-size below our 3K limit, as
+ * one of the design goals was to create a script that is smaller than an
+ * animated GIF.
+ */
+
+ var width = 'width',
+ length = 'length',
+ radius = 'radius',
+ lines = 'lines',
+ trail = 'trail',
+ color = 'color',
+ opacity = 'opacity',
+ speed = 'speed',
+ shadow = 'shadow',
+ style = 'style',
+ height = 'height',
+ left = 'left',
+ top = 'top',
+ px = 'px',
+ childNodes = 'childNodes',
+ firstChild = 'firstChild',
+ parentNode = 'parentNode',
+ position = 'position',
+ relative = 'relative',
+ absolute = 'absolute',
+ animation = 'animation',
+ transform = 'transform',
+ Origin = 'Origin',
+ Timeout = 'Timeout',
+ coord = 'coord',
+ black = '#000',
+ styleSheets = style + 'Sheets',
+ prefixes = "webkit0Moz0ms0O".split(0), /* Vendor prefixes, separated by zeros */
+ animations = {}, /* Animation rules keyed by their name */
+ useCssAnimations;
+
+ /**
+ *
+ */
+ function eachPair(args, it) {
+ var end = ~~((args[length]-1)/2);
+ for (var i = 1; i <= end; i++) {
+ it(args[i*2-1], args[i*2]);
+ }
+ }
+
+ /**
+ * Utility function to create elements. If no tag name is given, a DIV is created.
+ */
+ function createEl(tag) {
+ var el = document.createElement(tag || 'div');
+ eachPair(arguments, function(prop, val) {
+ el[prop] = val;
+ });
+ return el;
+ }
+
+ function ins(parent, child1, child2) {
+ if(child2 && !child2[parentNode]) ins(parent, child2);
+ parent.insertBefore(child1, child2||null);
+ return parent;
+ }
+
+ /**
+ * Insert a new stylesheet to hold the @keyframe or VML rules.
+ */
+ ins(document.getElementsByTagName('head')[0], createEl(style));
+ var sheet = document[styleSheets][document[styleSheets][length] - 1];
+
+ /**
+ * Creates an opacity keyframe animation rule.
+ */
+ function addAnimation(to, end) {
+ var name = [opacity, end, ~~(to*100)].join('-'),
+ dest = '{' + opacity + ':' + to + '}',
+ i;
+
+ if (!animations[name]) {
+ for (i=0; i<prefixes[length]; i++) {
+ try {
+ sheet.insertRule('@' +
+ (prefixes[i] && '-'+prefixes[i].toLowerCase() +'-' || '') +
+ 'keyframes ' + name + '{0%{' + opacity + ':1}' +
+ end + '%' + dest + 'to' + dest + '}', sheet.cssRules[length]);
+ }
+ catch (err) {
+ }
+ }
+ animations[name] = 1;
+ }
+ return name;
+ }
+
+ /**
+ * Tries various vendor prefixes and returns the first supported property.
+ **/
+ function vendor(el, prop) {
+ var s = el[style],
+ pp,
+ i;
+
+ if(s[prop] !== undefined) return prop;
+ prop = prop.charAt(0).toUpperCase() + prop.slice(1);
+ for(i=0; i<prefixes[length]; i++) {
+ pp = prefixes[i]+prop;
+ if(s[pp] !== undefined) return pp;
+ }
+ }
+
+ /**
+ * Sets multiple style properties at once.
+ */
+ function css(el) {
+ eachPair(arguments, function(n, val) {
+ el[style][vendor(el, n)||n] = val;
+ });
+ return el;
+ }
+
+ /**
+ * Fills in default values. The values are passed as argument pairs rather
+ * than as object in order to save some extra bytes.
+ */
+ function defaults(obj) {
+ eachPair(arguments, function(prop, val) {
+ if (obj[prop] === undefined) obj[prop] = val;
+ });
+ return obj;
+ }
+
+ /** The constructor */
+ var Spinner = function Spinner(o) {
+ this.opts = defaults(o || {},
+ lines, 12,
+ trail, 100,
+ length, 7,
+ width, 5,
+ radius, 10,
+ color, black,
+ opacity, 1/4,
+ speed, 1);
+ },
+ proto = Spinner.prototype = {
+ spin: function(target) {
+ var self = this,
+ el = self.el = self[lines](self.opts);
+
+ if (target) {
+ ins(target, css(el,
+ left, ~~(target.offsetWidth/2) + px,
+ top, ~~(target.offsetHeight/2) + px
+ ), target[firstChild]);
+ }
+ if (!useCssAnimations) {
+ // No CSS animation support, use setTimeout() instead
+ var o = self.opts,
+ i = 0,
+ f = 20/o[speed],
+ ostep = (1-o[opacity])/(f*o[trail] / 100),
+ astep = f/o[lines];
+
+ (function anim() {
+ i++;
+ for (var s=o[lines]; s; s--) {
+ var alpha = Math.max(1-(i+s*astep)%f * ostep, o[opacity]);
+ self[opacity](el, o[lines]-s, alpha, o);
+ }
+ self[Timeout] = self.el && window['set'+Timeout](anim, 50);
+ })();
+ }
+ return self;
+ },
+ stop: function() {
+ var self = this,
+ el = self.el;
+
+ window['clear'+Timeout](self[Timeout]);
+ if (el[parentNode]) el[parentNode].removeChild(el);
+ self.el = undefined;
+ return self;
+ }
+ };
+ proto[lines] = function(o) {
+ var el = css(createEl(), position, relative),
+ animationName = addAnimation(o[opacity], o[trail]),
+ i = 0,
+ seg;
+
+ function fill(color, shadow) {
+ return css(createEl(),
+ position, absolute,
+ width, (o[length]+o[width]) + px,
+ height, o[width] + px,
+ 'background', color,
+ 'boxShadow', shadow,
+ transform + Origin, left,
+ transform, 'rotate(' + ~~(360/o[lines]*i) + 'deg) translate(' + o[radius]+px +',0)',
+ 'borderRadius', '100em'
+ );
+ }
+ for (; i < o[lines]; i++) {
+ seg = css(createEl(),
+ position, absolute,
+ top, 1+~(o[width]/2) + px,
+ transform, 'translate3d(0,0,0)',
+ animation, animationName + ' ' + 1/o[speed] + 's linear infinite ' + (1/o[lines]/o[speed]*i - 1/o[speed]) + 's'
+ );
+ if (o[shadow]) ins(seg, css(fill(black, '0 0 4px ' + black), top, 2+px));
+ ins(el, ins(seg, fill(o[color], '0 0 1px rgba(0,0,0,.1)')));
+ }
+ return el;
+ };
+ proto[opacity] = function(el, i, val) {
+ el[childNodes][i][style][opacity] = val;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // VML rendering for IE
+ ///////////////////////////////////////////////////////////////////////////////
+
+ var behavior = 'behavior',
+ URL_VML = 'url(#default#VML)',
+ tag = 'group0roundrect0fill0stroke'.split(0);
+
+ /**
+ * Check and init VML support
+ */
+ (function() {
+ var s = css(createEl(tag[0]), behavior, URL_VML),
+ i;
+
+ if (!vendor(s, transform) && s.adj) {
+ // VML support detected. Insert CSS rules for group, shape and stroke.
+ for (i=0; i < tag[length]; i++) {
+ sheet.addRule(tag[i], behavior + ':' + URL_VML);
+ }
+ proto[lines] = function() {
+ var o = this.opts,
+ r = o[length]+o[width],
+ s = 2*r;
+
+ function grp() {
+ return css(createEl(tag[0], coord+'size', s +' '+s, coord+Origin, -r + ' ' + -r), width, s, height, s);
+ }
+
+ var g = grp(),
+ margin = ~(o[length]+o[radius]+o[width])+px,
+ i;
+
+ function seg(i, dx, filter) {
+ ins(g,
+ ins(css(grp(), 'rotation', 360 / o[lines] * i + 'deg', left, ~~dx),
+ ins(css(createEl(tag[1], 'arcsize', 1), width, r, height, o[width], left, o[radius], top, -o[width]/2, 'filter', filter),
+ createEl(tag[2], color, o[color], opacity, o[opacity]),
+ createEl(tag[3], opacity, 0) // transparent stroke to fix color bleeding upon opacity change
+ )
+ )
+ );
+ }
+
+ if (o[shadow]) {
+ for (i = 1; i <= o[lines]; i++) {
+ seg(i, -2, 'progid:DXImage'+transform+'.Microsoft.Blur(pixel'+radius+'=2,make'+shadow+'=1,'+shadow+opacity+'=.3)');
+ }
+ }
+ for (i = 1; i <= o[lines]; i++) {
+ seg(i);
+ }
+ return ins(css(createEl(),
+ 'margin', margin + ' 0 0 ' + margin,
+ position, relative
+ ), g);
+ };
+ proto[opacity] = function(el, i, val, o) {
+ o = o[shadow] && o[lines] || 0;
+ el[firstChild][childNodes][i+o][firstChild][firstChild][opacity] = val;
+ };
+ }
+ else {
+ useCssAnimations = vendor(s, animation);
+ }
+ })();
+
+ window.Spinner = Spinner;
+
+})(window, document);
View
18 CollegeFootball.wdgt/js/team.js
@@ -0,0 +1,18 @@
+define(["require", "exports", "jquery", "schedule", "jquery.xdomainajax"],
+ function (require, exports, $, schedule) {
+ exports.create = function (team) {
+ team = team || {};
+
+ team.getSchedule = function () {
+ var d = $.Deferred();
+ $.get("http://espn.go.com/college-football/team/_/id/" + team.id,
+ function (data) {
+ var s = team.schedule = schedule.create(data.responseText);
+ d.resolve(s.toHtml());
+ });
+ return d;
+ };
+
+ return team;
+ };
+});
View
103 CollegeFootball.wdgt/js/ui.js
@@ -0,0 +1,103 @@
+define( ["require", "exports", "jquery", "./team", "./ui/flip", "./pref", "./ui/spinner"],
+function (require, exports, $, team, flip, pref, spinner) {
+ var prefixes = {
+ logo: "http://a2.espncdn.com/prod/assets/clubhouses/2010/ncaa/logos/",
+ stats: "http://espn.go.com/college-football/team/stats/_/id/",
+ news: "http://espn.go.com/ncf/local/team?id="
+ },
+ data = $.getJSON("data.json"),
+ conferencesSelect = $("#conferences"),
+ teamsSelect = $("#teams"),
+ front = $("#front"),
+ back = $("#back");
+
+ function loadConferences(conference) {
+ var d = $.Deferred();
+ $.when(data).then(function (data) {
+ var s = $("<select />");
+ Object.keys(data).forEach(function (item) {
+ s.append($("<option />").val(item).text(item));
+ });
+ conferencesSelect.html(s.html()).val(conference);
+ d.resolve(conference);
+ });
+ return d;
+ }
+
+ function loadTeams(conference) {
+ $.when(data).then(function (d) {
+ var s = $("<select />"),
+ teams = d[conference];
+ Object.keys(teams).forEach(function (id) {
+ s.append($("<option />").val(id).text(teams[id].name));
+ });
+ teamsSelect.html(s.html());
+ });
+ }
+
+ function conferenceChange(event) {
+ loadTeams($(this).val());
+ }
+
+ function doFlip(event) {
+ spinner.toggle(front);
+ return flip.perform(front, back, event);
+ }
+
+ function doneClick(event) {
+ $.when(data).then(function (d) {
+ exports.setTeam(team.create(
+ d[conferencesSelect.val()][teamsSelect.val()]
+ ));
+ doFlip();
+ });
+ return false;
+
+ }
+
+ // Save a preference
+ function save(event) {
+ pref.set("conference", conferencesSelect.val());
+ pref.set("team", teamsSelect.val());
+ return false;
+ }
+
+ exports.setTeam = function (team) {
+ var t = $("table");
+ front.css("backgroundColor", team.color || "black");
+ $("#logo").attr("src", prefixes.logo + team.id + ".png");
+ front.find("h1").html(team.name);
+ $("#stats").attr("href", prefixes.stats + team.id);
+ $("#news").attr("href", prefixes.news + team.id);
+
+ t.hide();
+ team.getSchedule().then(function (html) {
+ spinner.toggle(front);
+ t.html(html).show();
+ });
+ };
+
+ exports.load = function () {
+ // Default team and conference
+ var t = pref.get("team") || 2294,
+ c = pref.get("conference") || "Big Ten",
+ flipper = $(".flipper");
+
+ spinner.toggle(front);
+
+ $.when(data, loadConferences(c), loadTeams(c)).then(function (d) {
+ conferencesSelect.val(c);
+ teamsSelect.val(t);
+ exports.setTeam(team.create(d[0][c][t]));
+ });
+ conferencesSelect.live("change", conferenceChange);
+ $("button").live("click", doneClick).live("click", save);
+ flipper.live("click", doFlip);
+ flipper.find("a").live("click", doFlip);
+ back.hide();
+
+ front.bind("mouseenter", function (event) { flipper.fadeIn(); });
+ front.bind("mouseleave", function (event) { flipper.fadeOut(); });
+
+ };
+});
View
28 CollegeFootball.wdgt/js/ui/flip.js
@@ -0,0 +1,28 @@
+// Provides an abstraction for flipping the widget over on the Mac Dashboard or
+// a web context
+define(function () {
+ return {
+ perform: function (front, back, event) {
+ var toSide, w = window.widget;
+ if (w) {
+ toSide = front.is(":visible") ? "ToBack" : "ToFront";
+ w.prepareForTransition(toSide);
+ if (toSide === "ToFront") {
+ front.height(back.height());
+ back.hide();
+ front.show();
+ } else {
+ // Normalize height
+ back.height(front.height());
+ front.hide();
+ back.show();
+ }
+ setTimeout(function () { w.performTransition(); }, 0);
+ } else {
+ front.toggle();
+ back.toggle();
+ }
+ return false;
+ }
+ };
+});
View
25 CollegeFootball.wdgt/js/ui/spinner.js
@@ -0,0 +1,25 @@
+// Make the spinner spin
+define(["jquery", "../spin"], function ($) {
+ var s = new Spinner({
+ lines: 12,
+ length: 12,
+ width: 2,
+ radius: 12,
+ trail: 32,
+ speed: 2,
+ color: "#fff" }).spin(),
+ present = false;
+
+
+ return {
+ toggle: function (el) {
+ var sel = $(s.el).css({ left: "50%", top: "40%" });
+ if (!present) {
+ el.append(sel);
+ present = true;
+ sel.toggle();
+ }
+ sel.toggle();
+ }
+ };
+});
View
16 CollegeFootball.wdgt/js/widget.js
@@ -0,0 +1,16 @@
+// Shims for dashboard widget
+define(["jquery"], function ($) {
+ var div, i, front, w = window.widget;
+
+ if (w) {
+ // Put a dashboard class on the body for css
+ $("body").addClass("dashboard");
+
+ // Use the openURL method on links
+ $("a").live("click", function (event) {
+ w.openURL($(this).attr("href"));
+ return false;
+ });
+
+ }
+});
View
111 CollegeFootball.wdgt/style.css
@@ -0,0 +1,111 @@
+
+body {
+ color: white;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 10px;
+ margin: 0;
+}
+
+
+a { color: white; text-decoration: none; }
+a:hover { border-bottom: 1px dotted; }
+
+.dashboard #front, .dashboard #back {
+ border-radius: 10px;
+}
+
+/* Front */
+.dashboard #front {
+ border: 3px solid rgba(255, 255, 255, 0.1);
+}
+
+img { width: 75px; height: 60px; }
+ul { display: inline; auto; float: right; list-style: none; margin: 0; text-align: right; }
+ul li { display: inline; }
+ul li a { text-align: center; font-size: 12px; margin: 12px; border-bottom: 1px solid transparent; }
+header { white-space: nowrap; }
+table { width: 100%; margin-top: 18px 0; font-size: 12px; }
+tr:last-child td { border-bottom: none; }
+td { width: 33%; border-bottom: 1px dotted; padding: 4px 0; white-space: nowrap; }
+
+#front {
+ background: black;
+ padding: 10px;
+ min-height: 377px;
+ position: relative;
+}
+
+#front h1 {
+ font-size: 175%;
+ position: relative;
+ left: 24px;
+ top: 24px;
+ display: inline;
+ margin: 0;
+ padding: 0;
+ font-weight: normal;
+ vertical-align: top;
+ white-space: nowrap;
+}
+
+.flipper {
+ position: absolute;
+ bottom: 3px;
+ right: 3px;
+ text-align: center;
+ display: inline;
+ width: 16px;
+ font-size: 14px;
+ font-style: italic;
+ font-weight: bold;
+ font-family: "Baskerville", "Times New Roman", serif;
+ margin: auto;
+}
+
+.flipper:hover {
+ border-radius: 18px;
+ -moz-border-radius: 18px;
+ -webkit-border-radius: 8px;
+ background-color: rgba(255, 255, 255, 0.3);
+ cursor: pointer;
+}
+
+.flipper a:hover {
+ border: none;
+}
+
+/* Back */
+#back { display: none; background: url(images/backgroundTile.png); font-size: 12px; padding: 12px; }
+.dashboard #back {
+ border: 3px solid rgba(0, 0, 0, 0.3);
+}
+#back h1 {
+ font-family: Rockwell, "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-weight: normal;
+}
+#back a { float: right; }
+label { display: block; margin-top: 16px; }
+select { width: 200px; }
+/* Thanks Marino! */
+button {
+ display: block;
+ margin-top: 16px;
+ color: white;
+ font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ width: auto;
+ line-height: 1;
+ height: auto;
+ padding: 4px 10px 5px;
+ margin: 16px;
+ border: 1px solid rgba(0,0,0,0.1);
+ border-radius: 4px;
+ background: rgba(0,0,0,0.25);
+ box-shadow:
+ 0 1px 1px rgba(0,0,0,0.25),
+ inset 0 1px rgba(255,255,255,0.3),
+ inset 0 2px 0 rgba(255,255,255,0.10),
+ inset 0 7px 2px rgba(255,255,255,0.1),
+ inset 0 2px 5px rgba(255,255,255,0.25),
+ inset 0 0px 5px rgba(0,0,0,0.3);
+}
View
BIN  CollegeFootball/Back.png
Deleted file not rendered
View
BIN  CollegeFootball/Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 CollegeFootball/Info.plist
@@ -15,7 +15,7 @@
<key>AllowNetworkAccess</key>
<true/>
<key>AllowSystem</key>
- <true/>
+ <false/>
<key>CFBundleDisplayName</key>
<string>College Football</string>
<key>CFBundleIdentifier</key>
@@ -23,12 +23,12 @@
<key>CFBundleName</key>
<string>College Football</string>
<key>CFBundleVersion</key>
- <string>1.3.5</string>
+ <string>2.0.0b0</string>
<key>CloseBoxInsetX</key>
- <integer>12</integer>
+ <integer>3</integer>
<key>CloseBoxInsetY</key>
- <integer>12</integer>
+ <integer>3</integer>
<key>MainHTML</key>
- <string>CollegeFootball.html</string>
+ <string>index.html</string>
</dict>
</plist>
View
11 TODO
@@ -0,0 +1,11 @@
+* widget publish
+
+* transparent blank.png
+* mobile styles
+* error handler
+* hosting
+* build
+* querystring save
+* touch icon
+* widget gradient
+* publish
View
8 build.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# Zip up widget for distribution.
+
+PROJ=CollegeFootball.wdgt
+
+echo "Creating archive..."
+zip -r $PROJ.zip $PROJ
+echo "Created $ZIPFILE. Done."
Please sign in to comment.
Something went wrong with that request. Please try again.