forked from geordanr/xwing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.haml
217 lines (188 loc) · 9.37 KB
/
index.haml
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
!!!
%html
%head
%title (Yet Another) X-Wing Miniatures Squad Builder
%meta{:charset => "utf-8"}
%link{:rel => "stylesheet", :href => "bootstrap/css/bootstrap.min.css?#{Time.now.to_i}"}
%link{:rel => "stylesheet", :href => "fontawesome/css/font-awesome.min.css?#{Time.now.to_i}"}
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"}
%link{:href => "bootstrap/css/bootstrap-responsive.css?#{Time.now.to_i}", :rel =>"stylesheet", :media => "screen"}
%link{:rel => "stylesheet", :href => "select2-3.4.0/select2.css?#{Time.now.to_i}"}
%link{:rel => "stylesheet", :href => "stylesheets/xwing.css?#{Time.now.to_i}"}
%link{:rel => "stylesheet", :href => "stylesheets/xwing-screen.css?#{Time.now.to_i}", :media => "screen,handheld"}
%link{:rel => "stylesheet", :href => "stylesheets/xwing-print.css?#{Time.now.to_i}", :media => "print"}
%link{:rel => "stylesheet", :href => "stylesheets/backgrounds.css?#{Time.now.to_i}", :media => "screen,handheld"}
%body
-# body layout
:javascript
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-43758422-1', 'geordanr.github.io');
.tabbable.hidden-print
%ul.nav.nav-pills
%li
%a#rebelTab{'data-toggle' => "tab", :href => '#rebelContent'} Rebel Alliance
%li
%a#empireTab{'data-toggle' => "tab", :href => '#empireContent'} Galactic Empire
%li
%a#scumTab{'data-toggle' => "tab", :href => '#scumContent'} Scum and Villainy
%li
%a#browserTab{'data-toggle' => "tab", :href => '#browserContent'} Card Browser
%li
%a#aboutTab{'data-toggle' => "tab", :href => '#aboutContent'} About
%li.dropdown.language-picker
%a.dropdown-toggle{'data-toggle' => 'dropdown', :href => '#'}
%span.language-placeholder
%b.caret
%ul.dropdown-menu
%li
%a#auth-status{:href => '#'}
%i.icon-spinner.icon-spin
%span.payload
%li
%a#login-logout.hidden{:href => '#'}
%span.hide-authenticated
%i.icon-signin.hidden-phone.hidden-tablet
Log In
%span.show-authenticated
%i.icon-signout.hidden-phone.hidden-tablet
Log Out
%li
%a{:href => 'https://github.com/geordanr/xwing/issues/new', :target => '_blank'} Submit Bug/Feature Request
.tab-content
.tab-pane#rebelContent
#rebel-builder
.tab-pane#empireContent
#empire-builder
.tab-pane#scumContent
#scum-builder
.tab-pane#browserContent
#card-browser
.tab-pane#aboutContent
.container-fluid
.row-fluid
.span8
%h2 (Yet Another) X-Wing Miniatures Squad Builder
%p
:markdown
This is a simple, fast, no-frills squad builder for [X-Wing Miniatures](http://www.fantasyflightgames.com/edge_minisite.asp?eidm=174&enmi=X-Wing) by [Fantasy Flight Games](http://www.fantasyflightgames.com/index.asp). It is pure HTML, JavaScript, and CSS and requires no backend, and can be dropped into place on any website (with maybe a few CSS tweaks).
Icons and fonts courtesy GeckoTH's excellent PSD, available on [A Few Maneuvers](http://www.afewmaneuvers.com/forums/viewtopic.php?f=28&t=183).
X-Wing symbols font courtesy [Hinny](https://github.com/Hinny).
Fancy printout design inspired by TheKestrel on the FFG forums.
German translation by [failgod](https://github.com/failgod-marcus) and [strikegun](https://github.com/strikegun) from FFG Forums.
Spanish translation by [evil_wins Solo](http://boardgamegeek.com/user/sebaslocox) from BoardGameGeek forums and [negroscuro](https://github.com/negroscuro).
French translation by [pejuaxel](https://github.com/pejuaxel).
Maneuver dial functionality by [hpanderson](https://github.com/hpanderson).
Interested in playing with the source or contributing features or bug fixes? [Fork it on GitHub](http://github.com/geordanr/xwing). (Issues can also be filed via GitHub.)
A backend is available if the ability to save squadrons is needed; it can be [forked on GitHub here](http://github.com/geordanr/xwing-backend). You can view the privacy policy [here](privacy.html).
.footer
.msie8-hax
#printable.visible-print
.printable-header
.printable-body
.printable-footer
Created at
%strong.site-placeholder
-# JS linkages
%script{:src => "bower_components/jquery/dist/jquery.min.js?#{Time.now.to_i}"}
-# %script{:src => "http://code.jquery.com/jquery-migrate-1.2.1.js"}
%script{:src => "javascripts/jquery.xdomainrequest.min.js?#{Time.now.to_i}"}
%script{:src => "bootstrap/js/bootstrap.min.js?#{Time.now.to_i}"}
%script{:src => "select2-3.4.0/select2.min.js?#{Time.now.to_i}"}
%script{:src => "bower_components/jquery-qrcode/jquery.qrcode.min.js?#{Time.now.to_i}"}
%script{:src => "bower_components/pako/dist/pako.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/xwing.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/cards-common.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/cards-en.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/cards-de.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/cards-es.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/cards-fr.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/manifest.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/backend.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/browser.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/translate.min.js?#{Time.now.to_i}"}
%script{:src => "javascripts/xws.min.js?#{Time.now.to_i}"}
:coffee
$(document).ready ->
window.setupTranslationSupport()
$('.site-placeholder').text """http://\#{window.location.host}\#{window.location.pathname}"""
$('#rebelTab').click (e) ->
ga 'send', 'pageview',
page: '/rebels'
title: 'Rebel Alliance'
$('#empireTab').click (e) ->
ga 'send', 'pageview',
page: '/empire'
title: 'Galactic Empire'
$('#scumTab').click (e) ->
ga 'send', 'pageview',
page: '/scum'
title: 'Scum and Villainy'
$('#browserTab').click (e) ->
ga 'send', 'pageview',
page: '/browser'
title: 'Card Browser'
$('#aboutTab').click (e) ->
ga 'send', 'pageview',
page: '/about'
title: 'About'
window.rebel_sb = new window.SquadBuilder
tab: '#rebelTab'
faction: 'Rebel Alliance'
container: '#rebel-builder'
printable_container: '#printable'
window.registerBuilderForTranslation window.rebel_sb
window.empire_sb = new window.SquadBuilder
tab: '#empireTab'
faction: 'Galactic Empire'
container: '#empire-builder'
printable_container: '#printable'
window.registerBuilderForTranslation window.empire_sb
window.scum_sb = new window.SquadBuilder
tab: '#scumTab'
faction: 'Scum and Villainy'
container: '#scum-builder'
printable_container: '#printable'
window.registerBuilderForTranslation window.scum_sb
switch $.getParameterByName 'f'
when 'Rebel Alliance'
$('#rebelTab').tab 'show'
when 'Galactic Empire'
$('#empireTab').tab 'show'
when 'Scum and Villainy'
$('#scumTab').tab 'show'
else
$('#rebelTab').tab 'show'
window.backend = new SquadBuilderBackend
server: 'https://yasb-backend.herokuapp.com'
builders: [
window.rebel_sb
window.empire_sb
window.scum_sb
]
login_logout_button: '#login-logout'
auth_status: '#auth-status'
window.browser = new CardBrowser
container: '#card-browser'
window.backend.getLanguagePreference (language) ->
$(window).trigger 'xwing:languageChanged', language
window.setupTranslationUI window.backend
window.xws = new XWSManager
container: '#xws'
if (window.location.href.indexOf('https:') != 0) and ((navigator.userAgent.indexOf('MSIE 8') > -1) or (navigator.userAgent.indexOf('MSIE 9') > -1))
$('.msie8-hax').html '''
Trouble logging in? Try clicking <a href="#">here</a> first.
'''
$('.msie8-hax a').click (e) ->
e.preventDefault()
window.location.href = window.location.href.replace(/^http:/, 'https:')
#xws
.font-hax
%span{:style => "font-family: BankGothicHD"}
%span{:style => "font-family: kimberley"}
%span{:style => "font-family: XWing"}