forked from wyllhyw/jig
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·207 lines (161 loc) · 6.1 KB
/
Copy pathindex.html
File metadata and controls
executable file
·207 lines (161 loc) · 6.1 KB
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
---
layout: default
title: Teh Jigz Up
---
<script type="text/javascript">
$incoming_sheet = getUrlVar('sheet');
$use_sheet = "";
if($incoming_sheet != '')
{
$use_sheet = $incoming_sheet;
}
$google_sheet = '{{ site.google_sheet }}';
var $key_array = $google_sheet.split("/");
key = $key_array[5];
$(document).ready( function() {
Tabletop.init( { key: key,
callback: showInfo,
debug: true } )
})
function showInfo(data, tabletop) {
$products = new Array();
$sheets = tabletop.foundSheetNames;
$.each($sheets, function(s, $sheetname) {
$.each(tabletop.sheets(), function(i, sheet) {
if(i == $sheetname)
{
$title = i;
$title = titleCase($title);
$title = $title.replace("-", " ");
$entry_link = '<li><a href="{{ site.baseurl }}/?sheet=' + i + '">' + $title + '</a></li>';
$('#story-entries').append($entry_link);
}
});
});
$previous = 1;
$next = 0;
$sheets = tabletop.foundSheetNames;
$.each($sheets, function(s, $sheetname) {
$.each(tabletop.sheets(), function(i, sheet) {
// Not sure why I have to do this, but sort was not dependable.
if(i == $sheetname)
{
if($previous==1)
{
$previous_sheet = i;
if($previous_sheet!=$use_sheet)
{
$previous_link = '<a href="{{ site.baseurl }}?sheet=' + $previous_sheet + '" class="icon-arrow-left hide-for-small">Previous</a>';
$('#jig-previous-top').html($previous_link);
$('#jig-previous-bottom').html($previous_link);
//console.log($previous_link);
}
}
if($next==1)
{
$next_sheet = i;
if($next_sheet!=$use_sheet)
{
$next_link = '<a href="{{ site.baseurl }}?sheet=' + $next_sheet + '" class="hide-for-small">Next<span class="icon-arrow-right"></span></a>';
$('#jig-next-top').html($next_link);
$('#jig-next-bottom').html($next_link);
//console.log($next_link);
}
$next = 0;
}
if(i == $use_sheet || $use_sheet == '')
{
$use_sheet = i;
$title = 'teh jigz up: ' + i;
$title = titleCase($title);
$title = $title.replace("-", " ");
$('#jig-title').html($title);
// Stop looking for previous
$previous = 0;
// Grab the next sheet as next sheet
$next = 1;
$product = tabletop.sheets($use_sheet).all();
$count = 1;
$column_count = 1;
$total_count = $product.length;
$row = '<tr>';
$.each( tabletop.sheets($use_sheet).all(), function(i, service) {
// Grab the values from the sheet
console.log($title);
$title = service['Title'];
$text = service['Text'];
$text_style = service['Text Style'];
$image = service['Image'];
$image_width = service['Image Width'];
$image_style = service['Image Style'];
$background_color = service['Background Color'];
$background_image = service['Background Image'];
$row = $row + "<td";
// Set The Title
$row = $row + ' title="' + $title + '"';
// Set the Background Color
if($background_color!='')
{
$row = $row + ' bgcolor="' + $background_color + '"';
}
else
{
$row = $row + ' bgcolor="#FFF"';
}
// Set the Background Image
if($background_image!='')
{
$row = $row + ' style="background-image:url(' + $background_image + ');"';
}
$row = $row + '>';
// Add Text
$add_text = '<div style="' + $text_style + '">' + $text + '</div>';
$row = $row + $add_text;
// Add Image
if($image!='')
{
$add_image = '<img src=' + $image + ' width="' + $image_width + '" style="' + $image_style + '" />';
$row = $row + $add_image;
}
$row = $row + '</td>';
$count++;
if($column_count==3)
{
$column_count = 1;
$row = $row + '</tr>';
$('#strip-table').append($row);
console.log($row);
$row = '<tr>';
}
else
{
$column_count++;
}
});
}
}
});
});
}
</script>
<div style="width: 80%;">
<div style="border: 1px solid #272727; width: 100%; padding: 0px;">
<article class="columns small-14 large-offset-1 large-10 comic-page" style="width: 100%; padding: 0px;">
<nav class="comic-nav">
<nav class="previous-comic" id="jig-previous-top"></nav>
<nav class="first-comic" id="jig-title" style="color: #FFF;"></nav>
<nav class="comic-next" id="jig-next-top"></nav>
</nav>
<div style="width: 100%; background-color:#272727;">
<table id="strip-table" class="strip"></table>
</div>
<nav class="comic-nav">
<nav class="previous-comic" id="jig-previous-bottom"></nav>
<nav class="first-comic">
<a href="/{{ site.github_repo }}/all/" class="hide-for-small">All<span class="icon-arrow-down"></span></a>
</nav>
<nav class="comic-next" id="jig-next-bottom"></nav>
</nav>
</article>
</div>
</div>