forked from kgilbert-cmu/basketball-gm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
294 lines (264 loc) · 17.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Basketball GM</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/ico/apple-touch-icon-57-precomposed.png">
<script type="text/javascript">
function loadCSS(filename){
var el = document.createElement("link");
el.setAttribute("rel", "stylesheet");
el.setAttribute("href", filename);
document.getElementsByTagName("head")[0].appendChild(el);
}
if (localStorage.debug === "debug") {
loadCSS("/css/bootstrap.css");
loadCSS("/css/bbgm.css");
loadCSS("/css/DT_bootstrap.css");
} else {
loadCSS("/gen/bbgm.css");
}
window.enableLogging = location.host.indexOf("basketball-gm.com") >= 0 && location.pathname.indexOf("/test") === -1;
if (enableLogging) {
// Errorception
/*(function(_,e,rr,s){_errs=[s];var c=_.onerror;_.onerror=function(){var a=arguments;_errs.push(a);
c&&c.apply(this,a)};var b=function(){var c=e.createElement(rr),b=e.getElementsByTagName(rr)[0];
c.src="//beacon.errorception.com/"+s+".js";c.async=!0;b.parentNode.insertBefore(c,b)};
_.addEventListener?_.addEventListener("load",b,!1):_.attachEvent("onload",b)})
(window,document,"script","51e61cf1dcbfc1595e000462");*/
// Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-38759330-1']);
_gaq.push(['_setDomainName', 'basketball-gm.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
// Stupid error logging
window.onerror = function(message, file, line, column) {
_gaq.push(['_trackEvent', 'JS Error', file + ':' + line + ':' + column + ' ' + message]);
};
// Muscula
/*window.Muscula = { settings:{
logId:"aa381ce5-fafe-4fc8-a215-9e353c569e35", suppressErrors: false, branding: 'none'
}};
(function () {
var m = document.createElement('script'); m.type = 'text/javascript'; m.async = true;
m.src = (window.location.protocol == 'https:' ? 'https:' : 'http:') +
'//musculahq.appspot.com/Muscula.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(m, s);
window.Muscula.run=function(c){eval(c);window.Muscula.run=function(){};};
window.Muscula.errors=[];window.onerror=function(){window.Muscula.errors.push(arguments);
return window.Muscula.settings.suppressErrors===undefined;}
})();*/
}
</script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" id="top-menu">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><img src="/ico/logo.png" width="18" height="18"><span class="hidden-md hidden-sm hidden-xs">Basketball GM</span><span class="visible-md visible-sm visible-xs" data-bind="if: lid() === undefined">Basketball GM</span></a>
<ul class="nav navbar-nav-no-collapse" id="play-menu" data-no-collapse="true" data-bind="visible: lid() !== undefined" style="display: none">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="play-button-link" class="play-button">Play <b class="caret"></b></a>
<ul class="dropdown-menu" data-bind="foreach: options">
<li><a data-bind="attr: {href: url, id: id}, text: label"></a></li>
</ul>
</li>
</ul>
<p class="navbar-text-two-line-no-collapse" data-no-collapse="true" data-bind="visible: lid() !== undefined" style="display: none">
<span data-bind="text: phaseText"></span><br />
<span data-bind="text: statusText"></span>
</p>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse" id="top-menu-collapse">
<ul class="nav navbar-nav navbar-right" id="nav-primary">
<li data-bind="visible: lid() !== undefined" style="display: none"><a data-bind="attrLeagueUrl: {href: []}">Dashboard</a></li>
<li class="dropdown" data-bind="visible: lid() !== undefined" style="display: none">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="hidden-sm">League <b class="caret"></b></span><span class="visible-sm">L <b class="caret"></b></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header visible-sm">League</li>
<li><a data-bind="attrLeagueUrl: {href: ['standings']}">Standings</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['playoffs']}">Playoffs</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['league_finances']}">Finances</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['history']}">History</a></li>
</ul>
</li>
<li class="dropdown" data-bind="visible: lid() !== undefined" style="display: none">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="hidden-sm">Team <b class="caret"></b></span><span class="visible-sm">T <b class="caret"></b></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header visible-sm">Team</li>
<li><a data-bind="attrLeagueUrl: {href: ['roster']}">Roster</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['schedule']}">Schedule</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['team_finances']}">Finances</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['team_history']}">History</a></li>
</ul>
</li>
<li class="dropdown" data-bind="visible: lid() !== undefined" style="display: none">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="hidden-sm">Players <b class="caret"></b></span><span class="visible-sm">P <b class="caret"></b></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header visible-sm">Players</li>
<li><a data-bind="attrLeagueUrl: {href: ['free_agents']}">Free Agents</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['trade']}">Trade</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['trading_block']}">Trading Block</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['draft']}">Draft</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['hall_of_fame']}">Hall of Fame</a></li>
</ul>
</li>
<li class="dropdown" data-bind="visible: lid() !== undefined" style="display: none">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="hidden-sm">Stats <b class="caret"></b></span><span class="visible-sm">S <b class="caret"></b></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header visible-sm">Stats</li>
<li><a data-bind="attrLeagueUrl: {href: ['game_log']}">Game Log</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['leaders']}">League Leaders</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['player_ratings']}">Player Ratings</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['player_stats']}">Player Stats</a></li>
<li><a data-bind="attrLeagueUrl: {href: ['team_stats']}">Team Stats</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="hidden-sm">Tools <b class="caret"></b></span><span class="visible-sm">X <b class="caret"></b></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header visible-sm">Tools</li>
<li data-bind="visible: lid() !== undefined" style="display: none"><a data-bind="attrLeagueUrl: {href: ['edit_team_info']}">Edit Team Info</a></li>
<li data-bind="visible: lid() !== undefined" style="display: none"><a data-bind="attrLeagueUrl: {href: ['export_rosters']}">Export Rosters</a></li>
<li data-bind="visible: lid() !== undefined" style="display: none"><a data-bind="attrLeagueUrl: {href: ['fantasy_draft']}">Fantasy Draft</a></li>
<li data-bind="visible: lid() !== undefined" style="display: none" role="presentation" class="divider"></li>
<li role="presentation" class="dropdown-header">Use at your own risk!</li>
<li data-bind="visible: lid() !== undefined" style="display: none"><a href="javascript:(function () { g = require('globals'); season = require('core/season'); season.newPhase(g.PHASE.PLAYOFFS); }())">Skip To Playoffs</a></li>
<li data-bind="visible: lid() !== undefined" style="display: none"><a href="javascript:(function () { g = require('globals'); season = require('core/season'); season.newPhase(g.PHASE.BEFORE_DRAFT); }())">Skip To Before Draft</a></li>
<li data-bind="visible: lid() !== undefined" style="display: none"><a href="javascript:(function () { g = require('globals'); season = require('core/season'); season.newPhase(g.PHASE.AFTER_DRAFT); }())">Skip To After Draft</a></li>
<li data-bind="visible: lid() !== undefined" style="display: none"><a href="javascript:(function () { g = require('globals'); season = require('core/season'); season.newPhase(g.PHASE.PRESEASON); }())">Skip To Preseason</a></li>
<li><a href="javascript:toggleDebugMode()" id="toggle-debug-mode">Toggle Debug Mode</a></li>
<li><a href="javascript:resetDb()">Reset DB</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="hidden-sm">Help <b class="caret"></b></span><span class="visible-sm">? <b class="caret"></b></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header visible-sm">Help</li>
<li><a href="/manual">Overview</a></li>
<li><a href="/manual/custom_rosters">Custom Rosters</a></li>
<li><a href="javascript:manualDebugging()">Debugging</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div id="content" data-id-loading="" data-id-loaded="">
<h1>Loading...</h1>
<p>This should only take a couple seconds on a fast connection.</p>
</div>
<p style="clear: both;"></p>
<hr>
<footer>
<p>Basketball GM 3.2.0 is available under the <a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU Affero General Public License</a>. <a href="https://github.com/jdscheff/basketball-gm">Fork it on GitHub!</a></p>
</footer>
</div>
<div class="slide-out" id="share">
<button class="slide-out-handle btn btn-danger">Share</button>
<p>Basketball GM is an <a href="https://github.com/jdscheff/basketball-gm">open source</a>, volunteer-driven project. More publicity will lead to a better game.</p>
<a href="https://twitter.com/basketball_gm" class="twitter-follow-button" data-show-count="true">Follow @basketball_gm</a>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.basketball-gm.com/" data-text="Free basketball management simulation game" data-via="basketball_gm">Tweet</a>
<div id="fb-root"></div>
<div class="fb-like" data-href="http://www.basketball-gm.com/" data-send="false" data-layout="button_count" data-width="90" data-show-faces="false"></div>
<br>
<div class="g-plusone" data-size="medium" data-href="http://www.basketball-gm.com/"></div>
<br>
<iframe src="http://ghbtns.com/github-btn.html?user=jdscheff&repo=basketball-gm&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
<br>
</div>
<div class="slide-out" id="feedback">
<button class="slide-out-handle btn btn-danger">Feedback</button>
<p><a href="https://twitter.com/basketball_gm">Tweet</a>, <a href="mailto:commissioner@basketball-gm.com">send an email</a> (commissioner@basketball-gm.com), <a href="https://github.com/jdscheff/basketball-gm/issues">submit an issue on GitHub</a>, or <a href="http://www.reddit.com/r/BasketballGM/">join the discussion on Reddit</a>.</p>
<p>All thoughts, comments, and suggestions are appreciated!</p>
</div>
<iframe style="display: none;" src="/manifest_hack"></iframe>
<script>
// This is so the "Debugging" manual entry can be read even if IndexedDB doesn't load
function manualDebugging() {
document.getElementById("content").innerHTML = '<h1>Debugging</h1>' +
'<h2>Reporting a bug</h2>' +
'<p>If you found a bug and you want to help fix it, click "Feedback" in the bottom right corner of your screen and follow the instructions there to get in contact with developer. Please include as much detail as possible, including your browser version, operating system, and specific steps one can take to reproduce your problem.</p>' +
'<p>Additionally, if you want to be extra helpful, try to report the specific error message that occurs. To do this, first switch to "debug mode" by clicking "Tools > Enable Debug Mode" in the menu at the top of this page. Then, <a href="http://webmasters.stackexchange.com/q/8525">open the JavaScript console of your web browser</a> and see if any error message gets displayed there when you observe a bug. For example, if the draft won\'t start when you press the "Start Draft" button, then enable debug mode, open the JavaScript console, and try pressing it again. You will probably see an error message that will be very helpful to a developer trying to fix the bug.</p>' +
'<h2>Hard Reset</h2>' +
'<p>Sometimes things just get stuck and you never get past the "Loading..." screen. If this happens, you can completely reset the game (and lose all your previous data) by doing this:</p>' +
'<ol>' +
'<li>Close your browser</li>' +
'<li>Open your browser profile folder (Google for how to do this in Firefox and Chrome for your OS)</li>' +
'<li>Within your profile folder, there is another folder called "indexedDB" or "IndexedDB". Open that</li>' +
'<li>Within that folder, there will be some other folder with "basketball-gm" in the name. Delete that folder</li>' +
'<li>Open your browser again. The game should now work (although any previous game data will be gone)</li>' +
'</ol>';
}
// Tools > Reset DB
function resetDb() {
var db;
if (window.confirm("Are you sure you want to reset the database? This will delete all your current saved games.")) {
db = require("db");
db.reset();
}
}
// Tools > Toggle Debug Mode
if (localStorage.debug === "debug") {
document.getElementById("toggle-debug-mode").innerHTML = "Disable Debug Mode";
} else {
document.getElementById("toggle-debug-mode").innerHTML = "Enable Debug Mode";
}
function toggleDebugMode() {
if (localStorage.debug === "debug") {
localStorage.debug = "";
} else {
localStorage.debug = "debug";
}
location.reload();
}
// Load either compiled script or RequireJS loader
var body = document.getElementsByTagName('body').item(0);
var script = document.createElement('script');
script.type = 'text/javascript';
if (localStorage.debug === "debug") {
console.log("If you want better performance, click Tools > Disable Debug Mode.");
script.src = "/js/lib/require.js";
script.dataset.main = "/js/app.js";
} else {
console.log("If you want to see accurate error messages, click Tools > Enable Debug Mode.");
script.src = "/gen/app.js";
}
body.appendChild(script);
</script>
<script>
// Delayed loading of Share buttons so they don't fuck with shit.
setTimeout(function () {
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
}, 1500);
</script>
</body>
</html>