sports_db 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. data/app/assets/javascripts/clients/android/client.js +53 -0
  2. data/app/assets/javascripts/clients/ios/client.js +58 -0
  3. data/app/assets/javascripts/core/Application.js +173 -0
  4. data/app/assets/javascripts/core/BaseView.js +117 -0
  5. data/app/assets/javascripts/core/History.js +45 -0
  6. data/app/assets/javascripts/core/Mock.js +90 -0
  7. data/app/assets/javascripts/core/Timer.js +18 -0
  8. data/app/assets/javascripts/core/View.js +56 -0
  9. data/app/assets/javascripts/core/utilities.js +81 -0
  10. data/app/assets/javascripts/libs/SimpleInheritance.js +53 -0
  11. data/app/assets/javascripts/libs/microjungle.zepto.js +45 -0
  12. data/app/assets/javascripts/libs/zepto-v1.0rc1/ajax.js +279 -0
  13. data/app/assets/javascripts/libs/zepto-v1.0rc1/assets.js +21 -0
  14. data/app/assets/javascripts/libs/zepto-v1.0rc1/data.js +66 -0
  15. data/app/assets/javascripts/libs/zepto-v1.0rc1/detect.js +40 -0
  16. data/app/assets/javascripts/libs/zepto-v1.0rc1/event.js +224 -0
  17. data/app/assets/javascripts/libs/zepto-v1.0rc1/form.js +40 -0
  18. data/app/assets/javascripts/libs/zepto-v1.0rc1/fx.js +91 -0
  19. data/app/assets/javascripts/libs/zepto-v1.0rc1/fx_methods.js +72 -0
  20. data/app/assets/javascripts/libs/zepto-v1.0rc1/gesture.js +35 -0
  21. data/app/assets/javascripts/libs/zepto-v1.0rc1/polyfill.js +36 -0
  22. data/app/assets/javascripts/libs/zepto-v1.0rc1/selector.js +70 -0
  23. data/app/assets/javascripts/libs/zepto-v1.0rc1/stack.js +22 -0
  24. data/app/assets/javascripts/libs/zepto-v1.0rc1/touch.js +85 -0
  25. data/app/assets/javascripts/libs/zepto-v1.0rc1/zepto.js +591 -0
  26. data/app/assets/javascripts/libs/zepto_0.8.js +1213 -0
  27. data/app/assets/javascripts/plugins/assert.js +11 -0
  28. data/app/assets/javascripts/plugins/calnav.js +18 -0
  29. data/app/assets/javascripts/plugins/detect.js +16 -0
  30. data/app/assets/javascripts/plugins/filterable.js +12 -0
  31. data/app/assets/javascripts/plugins/flash.js +15 -0
  32. data/app/assets/javascripts/plugins/jquery.zumobi-0.2.js +57 -0
  33. data/app/assets/javascripts/plugins/loading.js +47 -0
  34. data/app/assets/javascripts/plugins/params.js +27 -0
  35. data/app/assets/javascripts/plugins/resizeable.js +40 -0
  36. data/app/assets/stylesheets/_base.css.scss +42 -0
  37. data/app/assets/stylesheets/_filterable.css.scss +19 -0
  38. data/app/assets/stylesheets/_flash.css.scss +9 -0
  39. data/app/assets/stylesheets/_loading.css.scss +28 -0
  40. data/app/assets/stylesheets/_play.css.scss +38 -0
  41. data/app/assets/stylesheets/_reset.css.scss +33 -0
  42. data/app/assets/stylesheets/_table_base.scss +121 -0
  43. data/app/assets/stylesheets/mock.css.scss +52 -0
  44. data/app/controllers/application_controller.rb +39 -0
  45. data/app/views/application/load.html.erb +1 -0
  46. data/app/views/layouts/application.html.erb +27 -0
  47. data/lib/sports_db/version.rb +1 -1
  48. metadata +90 -5
@@ -0,0 +1,11 @@
1
+ // Test for truthiness. And log falsiness.
2
+ (function($){
3
+ $.assert = function(test, error, flash_msg) {
4
+ if (!test) {
5
+ if (flash_msg) {
6
+ $.flash(flash_msg);
7
+ }
8
+ throw new Error(error);
9
+ }
10
+ }
11
+ })(Zepto);
@@ -0,0 +1,18 @@
1
+ // Behavior for calendar (schedule) navigation.
2
+ (function($){
3
+ $.calnav = function(){
4
+ $('calnav item')
5
+ .unbind()
6
+ .bind('click', function(e) {
7
+ var el = $(e.target)
8
+ if (!el.attr('href')) {
9
+ el = el.closest('item');
10
+ }
11
+ if (!el.attr('href')) return ;
12
+ Application.showView(
13
+ el.attr('href').toParameters()
14
+ );
15
+ })
16
+ .pressable();
17
+ }
18
+ })(Zepto);
@@ -0,0 +1,16 @@
1
+ // Rather than analyze user agents strings, the client places query params in the url:
2
+ // - client
3
+ // - version (ex: 1.2)
4
+ (function($){
5
+ var q = $.queryStrToObj();
6
+
7
+ $.assert(q.client, "`client` param is required.");
8
+ $.assert(q.version, "`version` param is required.");
9
+
10
+ $.client = {};
11
+ $.client[q.client] = true;
12
+ $.client.version_major = q.version.split('.')[0];
13
+ $.client.version_minor = q.version.split('.')[1];
14
+
15
+ $(document.body).addClass(q.client);
16
+ })(Zepto);
@@ -0,0 +1,12 @@
1
+ // ### Allows a view to retrieve a new view via a `<select>`.
2
+ (function($){
3
+ $.fn.filterable = function() {
4
+ this
5
+ .unbind()
6
+ .bind('change', function(e) {
7
+ // Prevents history from being created
8
+ Application.showView( e.target.value.substring(1).toParameters() );
9
+ })
10
+ .pressable();
11
+ };
12
+ })(Zepto);
@@ -0,0 +1,15 @@
1
+ (function($){
2
+ $.flash = function(msg, params, force) {
3
+ params = params || {};
4
+ if (force) params.flashed = false;
5
+
6
+ if (!params.flashed) {
7
+ $('#flash').html(msg);
8
+ $('#flash').show();
9
+ setTimeout(function() {
10
+ $('#flash').hide();
11
+ }, 5000);
12
+ params.flashed = true;
13
+ }
14
+ };
15
+ })(Zepto);
@@ -0,0 +1,57 @@
1
+ // This was taken from //webclient.
2
+
3
+ /**
4
+ * jQuery plug-in.
5
+ */
6
+ (function($) {
7
+
8
+ /**
9
+ * IE9 does not support touch events, only mouse events. We need to adjust appropriately.
10
+ * Also, some methods for getting the right target and right coordinates of the event.
11
+ */
12
+ var touch = ("ontouchstart" in document.body);
13
+ $.touchEvents = {
14
+ isTouch: touch,
15
+ start: (touch) ? "touchstart" : "mousedown",
16
+ move: (touch) ? "touchmove" : "mousemove",
17
+ end: (touch) ? "touchend" : "mouseup mouseout",
18
+ endOnly:(touch) ? "touchend touchcancel" : "mouseup",
19
+ cancel: (touch) ? "touchend touchcancel touchmove" : "mouseup mousemove mouseout",
20
+ getTarget: function(e) {
21
+ return touch ?
22
+ $(e.originalEvent.touches[0].target) :
23
+ $(e.target);
24
+ },
25
+ getCoord: function(e) {
26
+ // e.originalEvent is necessary because you are using jQuery.
27
+ return touch ?
28
+ {x: e.originalEvent.touches[0].pageX, y: e.originalEvent.touches[0].pageY} :
29
+ {x: e.pageX, y: e.pageY};
30
+ }
31
+ };
32
+
33
+ /**
34
+ * Make the provided elements "pressable" (give them a press state when touched). If
35
+ * the element has a class token of "disabled", then the press effect will not
36
+ * be applied.
37
+ *
38
+ * DO NOT use pressable() to emulate list selection behavior. It won't work when
39
+ * you then try and embed an actionable control within the list (e.g. a play button
40
+ * for a video, or a favoriting star). Instead, use the List mixin behavior.
41
+ *
42
+ */
43
+ // Modified from //webclient version. Simplified.
44
+ $.fn.pressable = function() {
45
+ var HL_CLASS = 'hl';
46
+ return this
47
+ .on($.touchEvents.start, function(e) {
48
+ var $this = $(this);
49
+ if (!$this.hasClass("disabled")) {
50
+ $this.addClass(HL_CLASS);
51
+ }
52
+ })
53
+ .on($.touchEvents.cancel, function(e) {
54
+ $(this).removeClass(HL_CLASS);
55
+ });
56
+ };
57
+ }(Zepto));
@@ -0,0 +1,47 @@
1
+ (function($){
2
+ var load_timer;
3
+ var LOADING_TEXT = 'Loading&hellip;';
4
+ function prevent(e) {
5
+ e.preventDefault();
6
+ }
7
+ function freeze() {
8
+ $(document.body).bind("touchmove", prevent);
9
+ }
10
+ function thaw() {
11
+ $(document.body).unbind('touchmove', prevent);
12
+ }
13
+ function showLoaderNow() {
14
+ $('#app_load_loader').remove();
15
+ freeze();
16
+ loading_text = LOADING_TEXT;
17
+ if (Application.currentView && Application.currentView.params.loading_text) {
18
+ loading_text = Application.currentView.params.loading_text;
19
+ }
20
+ $('#loading_text').html(loading_text);
21
+
22
+ $('#loading').css({'height': document.documentElement.clientHeight + 'px'});
23
+ $.alignLoader();
24
+
25
+ $('#loading').show();
26
+ }
27
+ $.alignLoader = function() {
28
+ $('#loading').css({'top': window.scrollY + 'px'});
29
+ };
30
+ $.showLoader = function(loader_text) {
31
+ if (load_timer) {
32
+ load_timer.stop();
33
+ load_timer = undefined;
34
+ }
35
+ load_timer = new Timer(showLoaderNow, 222);
36
+ load_timer.start();
37
+ };
38
+ $.hideLoader = function() {
39
+ load_timer.stop();
40
+ thaw();
41
+ $('#loading').hide();
42
+ $('#app_load_loader').remove();
43
+ if (Application.currentView && Application.currentView.params.loading_text) {
44
+ Application.currentView.params.loading_text = LOADING_TEXT;
45
+ }
46
+ };
47
+ })(Zepto);
@@ -0,0 +1,27 @@
1
+ ;(function($){
2
+ $.strToObj = function(str) {
3
+ var obj = {};
4
+ str.split("&").forEach(
5
+ function(p) {
6
+ var s = p.split("=");
7
+ obj[s[0].replace(/^\?/, '')] = decodeURIComponent(s[1]);
8
+ }
9
+ );
10
+ return obj;
11
+ };
12
+ $.objToQueryStr = function(obj) {
13
+ var arr = [];
14
+ for (var prop in obj) {
15
+ if (typeof obj[prop] !== "function") {
16
+ arr.push( encodeURIComponent(prop) +"="+ encodeURIComponent(obj[prop]) );
17
+ }
18
+ }
19
+ return arr.join("&")+'';
20
+ };
21
+ $.queryStrToObj = function() {
22
+ return $.strToObj( window.location.search.substring(1) );
23
+ };
24
+ $.hashStrToObj = function() {
25
+ return $.strToObj( window.location.hash.substring(1) );
26
+ };
27
+ })(Zepto);
@@ -0,0 +1,40 @@
1
+ ;(function($){
2
+ var MIN = 13;
3
+ var MAX = 17;
4
+ var DEFAULT = 15;
5
+ var p = Application.params.font_size;
6
+ var pi = parseInt(p);
7
+ var size = ((!isNaN(p) && pi <= MAX && pi >= MIN)) ? pi : DEFAULT;
8
+
9
+ $.fn.resizeable = function() {
10
+ function set(size, notify) {
11
+ // set size
12
+ $('.resizeable_text').css('font-size', get_px(size) + "px");
13
+
14
+ // reset disabled state
15
+ $('.resizeable').removeClass('disabled');
16
+ // set disabled state
17
+ if (size === MIN) $('.resizeable.down').addClass('disabled');
18
+ if (size === MAX) $('.resizeable.up').addClass('disabled');
19
+
20
+ // notify the client of the size
21
+ if (notify) Client.notify({ 'font_size': size });
22
+ return size;
23
+ }
24
+ function handlers(el) {
25
+ el
26
+ .unbind("click")
27
+ .bind("click", function() {
28
+ var new_size = size + parseInt($(this).data('dir'), 10);
29
+ if (new_size <= MAX && new_size >= MIN) {
30
+ size = set(new_size, true);
31
+ }
32
+ });
33
+ }
34
+
35
+ set(size, false);
36
+ handlers(this);
37
+
38
+ return this;
39
+ };
40
+ })(Zepto);
@@ -0,0 +1,42 @@
1
+ html,body {
2
+ height: 100%;
3
+ background-color: $page_bg;
4
+ }
5
+ * {
6
+ -webkit-box-sizing: border-box;
7
+ box-sizing: border-box;
8
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
9
+ -webkit-user-select: none;
10
+ -webkit-user-modify: read-only;
11
+ -webkit-touch-callout: none;
12
+ background-repeat: no-repeat;
13
+ }
14
+ html { font-size: 10px; }
15
+ @media (min-width: 460px) and (-webkit-min-device-pixel-ratio: 1.5) {
16
+ html { font-size: 15px; }
17
+ }
18
+ @media (min-width: 520px) and (-webkit-min-device-pixel-ratio: 1.5) {
19
+ html { font-size: 16.8px; }
20
+ }
21
+ @media (min-width: 580px) and (-webkit-min-device-pixel-ratio: 1.5) {
22
+ html { font-size: 18.7px; }
23
+ }
24
+ @media (min-width: 700px) and (-webkit-min-device-pixel-ratio: 1.5) {
25
+ html { font-size: 22.4px; }
26
+ }
27
+ @media (min-device-width: 760px) {
28
+ html { font-size: 10px; }
29
+ }
30
+
31
+ body {
32
+ font-size: $default_font_size;
33
+ color: $txt_gray;
34
+ margin: 0 auto;
35
+ }
36
+ body.ios {
37
+ font-family: helvetica, sans-serif;
38
+ text-rendering: optimizeLegibility;
39
+ }
40
+ body.android {
41
+ font-family: sans-serif;
42
+ }
@@ -0,0 +1,19 @@
1
+ #filter {
2
+ -webkit-appearance: button;
3
+ display: block;
4
+ width: 31rem;
5
+ height: 4.8rem;
6
+ -webkit-background-size: 31rem 19.2rem;
7
+ font-weight: bold;
8
+ border: 0;
9
+ padding-left: 1rem;
10
+ color: #666;
11
+ margin: 0 auto .5rem;
12
+ font-size: 1.8rem;
13
+
14
+ background-image: url(#{$imghost}dropdown_sprite@2x.png);
15
+
16
+ &.hl {
17
+ background-position: 0 -4.8rem;
18
+ }
19
+ }
@@ -0,0 +1,9 @@
1
+ #flash {
2
+ background-color: #666;
3
+ color: #fff;
4
+ line-height: 2.4rem;
5
+ font-size: 1.4rem;
6
+ padding: 0 1rem;
7
+ text-align: center;
8
+ height: 2.4rem;
9
+ }
@@ -0,0 +1,28 @@
1
+ loading{
2
+ display: block;
3
+ z-index:99999;
4
+ position:absolute;
5
+ top:0;
6
+ left:0;
7
+ right:0;
8
+ bottom: 0;
9
+ text-align: center;
10
+ background-color:rgba(20,20,20,.1);
11
+ color:#fff;
12
+ }
13
+ loading_text{
14
+ padding: .4rem 1rem;
15
+ display: inline-block;
16
+ border: .1rem solid #777;
17
+ margin-top: 8rem;
18
+ text-align: center;
19
+ font-size: 1.8rem;
20
+ line-height: 1;
21
+ font-family: "Helvetica Neue",Helvetica,sans-serif;
22
+ color: #fff;
23
+ background-color:rgba(10,10,10,.8);
24
+ -webkit-border-radius: .4rem;
25
+ -webkit-background-clip: padding-box;
26
+ -webkit-box-shadow: .1rem .1rem .5rem #000;
27
+ -webkit-user-select: none;
28
+ }
@@ -0,0 +1,38 @@
1
+ .play {
2
+ @extend .overlay;
3
+
4
+ // ## Play Button
5
+ //
6
+ // - the image is centered
7
+ // - and the height is 40% of the parent elem height
8
+ // - the width is set by the browser automatically
9
+ // - because the height is set to a percentage of the parent elem,
10
+ // the parent elem height must match if you want the play button
11
+ // size to match.
12
+ // - NOTE the .play class is added to a parent element of the <img>,
13
+ // not the <img> itself, because <img>s do not allow psuedo elements.
14
+ &::after {
15
+ // This url will not work from an app autogen/ file.
16
+ background: transparent url(#{$imghost}playbutton@2x.png) no-repeat center;
17
+ -webkit-background-size: auto 50%;
18
+ background-size: auto 50%;
19
+ }
20
+ // Add a class of `tl, tr, bl, br` to position the play btn in the top left, etc.
21
+ // The image will also be sized at 30% of the height instead of 40%.
22
+ &.tl::after, &.tr::after, &.bl::after, &.br::after {
23
+ -webkit-background-size: auto 30%;
24
+ background-size: auto 30%;
25
+ }
26
+ &.tl::after {
27
+ background-position: 10% 10%;
28
+ }
29
+ &.tr::after {
30
+ background-position: 90% 10%;
31
+ }
32
+ &.bl::after {
33
+ background-position: 10% 90%;
34
+ }
35
+ &.br::after {
36
+ background-position: 90% 90%;
37
+ }
38
+ }
@@ -0,0 +1,33 @@
1
+ /*
2
+ Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
+ Code licensed under the BSD License:
4
+ http://developer.yahoo.com/yui/license.html
5
+ version: 3.2.0
6
+ build: 2676
7
+ */
8
+ html{color:#000;background:#FFF;}
9
+ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
10
+ table{border-collapse:collapse;border-spacing:0;}
11
+ fieldset,img{border:0;}
12
+ address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
13
+ li{list-style:none;}
14
+ caption,th{text-align:left;}
15
+ h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
16
+ q:before,q:after{content:'';}
17
+ abbr,acronym{border:0;font-variant:normal;}
18
+ sup{vertical-align:text-top;}
19
+ sub{vertical-align:text-bottom;}
20
+ input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}
21
+ input,textarea,select{*font-size:100%;}
22
+ legend{color:#000;}
23
+
24
+ /* MODIFICATIONS */
25
+ item,news,summaries,summary,tabs,tab_content {
26
+ display: block;
27
+ }
28
+ a {
29
+ text-decoration: none;
30
+ }
31
+ strong,b {
32
+ font-weight: bold;
33
+ }
@@ -0,0 +1,121 @@
1
+ .base_table {
2
+ width: 100%;
3
+ margin: 0 auto;
4
+ background-color: $zebra_strip_odd;
5
+ border-collapse: collapse;
6
+
7
+ &.nested_table {
8
+ background-color: transparent;
9
+ }
10
+ &.wrapper_table {
11
+ > tbody > tr > td {
12
+ padding: 0 !important;
13
+ }
14
+ }
15
+ &.centered_table {
16
+ th, td { text-align: center; }
17
+ }
18
+ th, td {
19
+ &.left {
20
+ text-align: left;
21
+ }
22
+ }
23
+ th, td {
24
+ &.stat {
25
+ width: 3rem;
26
+ }
27
+ }
28
+
29
+ tbody tr.hl td {
30
+ background-color: #ccc !important;
31
+ }
32
+
33
+ td.has_logo { padding-left: .5rem; padding-right: .5rem; }
34
+ td.has_logo.size_65x65 { width: 6.5rem; }
35
+ td.has_logo.size_45x45 { width: 4.5rem; }
36
+ td.has_logo.size_25x25 { width: 2.5rem; }
37
+ thead th {
38
+ padding-top: .5rem !important;
39
+ padding-bottom: .4rem !important;
40
+ text-align: left;
41
+ vertical-align: top;
42
+ font-size: 1.2rem;
43
+ font-weight: bold;
44
+ background-color: $zebra_strip_even;
45
+ }
46
+ thead.has_gradient th {
47
+ @extend .primary_gradient;
48
+ @extend .txt_shadow;
49
+ color: #fff;
50
+ }
51
+ thead.has_dark_bg th {
52
+ background-color: $txt_gray;
53
+ color: #fff;
54
+ text-shadow: $h3_bg;
55
+ }
56
+ tbody {
57
+ tr.winning_team td { font-weight: bold; }
58
+ tr.winning_team td[rowspan] { font-weight: normal; }
59
+ td { vertical-align: middle; }
60
+ p { margin-bottom: .4rem; }
61
+ }
62
+ tbody td,
63
+ thead th {
64
+ padding: .7rem .2rem .7rem 0;
65
+ }
66
+ thead th.upcase {
67
+ text-transform: uppercase;
68
+ }
69
+ tbody td:first-child,
70
+ thead th:first-child {
71
+ padding-left: .5rem;
72
+ }
73
+ td.goto {
74
+ background: transparent url(#{$imghost}disclosureIndicator@2x.png) no-repeat center center;
75
+ -webkit-background-size: .8rem 1.2rem;
76
+ background-size: .8rem 1.2rem;
77
+ width: 1.6rem;
78
+ padding-right: 2.8rem;
79
+ }
80
+ td[rowspan] { vertical-align: middle; }
81
+ tfoot td.spacer {
82
+ height: .8rem;
83
+ line-height: 1;
84
+ background-color: #f2f2f2;
85
+ }
86
+ }
87
+ .base_table.has_stripes {
88
+ > tbody > tr:nth-of-type(2n) td {
89
+ background-color: $zebra_strip_even;
90
+ }
91
+ > tbody > tr > td {
92
+ border: .1rem solid #DDD;
93
+ border-width: .1rem 0;
94
+ }
95
+ }
96
+ //.clip {
97
+ // text-overflow: ellipsis;
98
+ // overflow: hidden;
99
+ // white-space: nowrap;
100
+ //}
101
+ body.android .base_table {
102
+ tbody td,
103
+ thead th {
104
+ padding-top: 1rem;
105
+ padding-bottom: 1rem;
106
+ }
107
+ }
108
+ .base_table {
109
+ &.scoreboard_table {
110
+ td,th {
111
+ text-align: center;
112
+ }
113
+ .team_name,.has_logo {
114
+ text-align: left;
115
+ }
116
+ tbody td {
117
+ padding-top: .4rem;
118
+ padding-bottom: .4rem;
119
+ }
120
+ }
121
+ }
@@ -0,0 +1,52 @@
1
+ $txt_shadow: .1rem .1rem 0 rgba(10, 10, 10, .2);
2
+
3
+ #mock-toolbar-container {
4
+ -webkit-user-select: none;
5
+ margin:0;
6
+ padding:0;
7
+ width: auto;
8
+ overflow: hidden;
9
+ position: relative;
10
+ }
11
+ #mock-toolbar {
12
+ font-weight: bold;
13
+ background-color: #111;
14
+ color: white !important;
15
+ margin: 0;
16
+ height: 4.4rem;
17
+ -webkit-box-sizing: border-box;
18
+ border-collapse: collapse;
19
+ border:0.1rem solid #111;
20
+ background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #2a2a2a),color-stop(1, #0a0a0a));
21
+ }
22
+ #mock-center {
23
+ text-align: center;
24
+ color:#fff;
25
+ font-size: 1.8rem;
26
+ font-weight: bold;
27
+ line-height: 2.3;
28
+ text-shadow: $txt_shadow;
29
+ }
30
+ #mock-left, #mock-right {
31
+ display: block;
32
+ position: absolute;
33
+ top: .3rem;
34
+ }
35
+ #mock-left {
36
+ left: .8rem;
37
+ }
38
+ #mock-right {
39
+ right: .8rem;
40
+ }
41
+ action {
42
+ display: block;
43
+ float: left;
44
+ padding: .6rem .8rem;
45
+ cursor: pointer;
46
+ border: .1rem solid #111;
47
+ border-color:#111 #222 #1a1a1a #111;
48
+ -webkit-border-radius: .4rem;
49
+ font-size: 1.6rem;
50
+ background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #555),color-stop(.05, #444),color-stop(1, #111));
51
+ color: #fff;
52
+ }
@@ -0,0 +1,39 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+
4
+ helper :all
5
+ before_filter :translate_entity_keys
6
+ layout 'application', :only => :load
7
+
8
+ caches_page :load, :client_notify
9
+
10
+ def load
11
+
12
+ end
13
+
14
+ # this should not make it to the server, but if it does, don't throw an error.
15
+ # this makes Jonas happy.
16
+ def client_notify
17
+ render :text => 'say yah to da up, eh?'
18
+ end
19
+
20
+ # http://www.treyconnell.com/automatically-raise-recordnotfound-exceptions-rails/
21
+ # any time we get a RecordNotFound Exception we're going to rescue from it and throw a 404
22
+ # rescue_from ActiveRecord::RecordNotFound, :with => :not_found
23
+
24
+ # Used to take the user to a 404 page
25
+ # def throw_404
26
+ # @browser_title = "Page Not Found"
27
+ # render_optional_error_file("404")
28
+ # true
29
+ # end
30
+
31
+ protected
32
+
33
+ # TSN's entity keys contain periods which confuse Rails' page caching system. These are converted
34
+ # on the client to underscores and translated here, back into periods, so that they match the
35
+ # TSN IDs. For example, l_nfl_com-t_9 is converted back to l.nfl.com-t.9.
36
+ def translate_entity_keys
37
+ params[:key].gsub!(/_/, ".") if params[:key]
38
+ end
39
+ end
@@ -0,0 +1 @@
1
+ <loading id="app_load_loader"><loading_text>Loading&hellip;</loading_text></loading>
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= CONFIG.app_path.downcase %></title>
5
+ <meta id="meta_viewport" name="viewport" content="user-scalable=no, initial-scale=1, target-densityDpi=device-dpi">
6
+ <%= stylesheet_link_tag "index" %>
7
+ </head>
8
+ <body>
9
+ <%= yield %>
10
+ <loading id="loading" style="display: none;"><loading_text id="loading_text">Loading&hellip;</loading_text></loading>
11
+ <div id="flash" style="display: none;"></div>
12
+ <div id="buffer" style="display: none;"></div>
13
+ <div id="tmp" style="display: none;"></div>
14
+ <%= javascript_include_tag "index" %>
15
+ <%# Allows us to use mock on test or production without screwing up caching of page. %>
16
+ <script>
17
+ if (Application.params.mock) {
18
+ document.write("<link rel='stylesheet' href='/<%= CONFIG.app_path %>/assets/mock.css'>");
19
+ document.write("<script src='/<%= CONFIG.app_path %>/assets/core/Mock.js'><\/script>");
20
+ }
21
+ </script>
22
+ <% if request.host == 'localhost' %>
23
+ <link rel='stylesheet' href='/<%= CONFIG.app_path %>/assets/mock.css'>
24
+ <script src='/<%= CONFIG.app_path %>/assets/core/Mock.js'></script>
25
+ <% end %>
26
+ </body>
27
+ </html>
@@ -1,3 +1,3 @@
1
1
  module SportsDb
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end