-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlatest.html
More file actions
219 lines (196 loc) · 9.29 KB
/
Copy pathlatest.html
File metadata and controls
219 lines (196 loc) · 9.29 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
208
209
210
211
212
213
214
215
216
217
218
219
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Show Box Web App | New Releases</title>
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicons/favicon-16x16.png">
<link rel="manifest" href="assets/favicons/site.webmanifest">
<link rel="mask-icon" href="assets/favicons/safari-pinned-tab.svg" color="#ffb400">
<link rel="shortcut icon" href="assets/favicons/favicon.ico">
<meta name="msapplication-TileColor" content="#ffc40d">
<meta name="msapplication-config" content="assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#303030">
<!-- css & js -->
<link href="https://bootswatch.com/4/darkly/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="assets/styles/main.css" rel="stylesheet" type="text/css" />
<script src="https://bootswatch.com/_vendor/jquery/dist/jquery.min.js"></script>
<script src="https://bootswatch.com/_vendor/popper.js/dist/umd/popper.min.js"></script>
<script src="https://bootswatch.com/_vendor/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- other scripts -->
<script src="assets/scripts/global.js"></script>
<style>
</style>
</head>
<body>
<!-- Appbar -->
<nav class="navbar fixed-top navbar-expand-md navbar-dark bg-dark">
<a class="navbar-brand" href="/">Show Box</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">News</a>
</li>
<li class="nav-item">
<a class="nav-link" href="tv-list.html">TV Shows</a>
</li>
<li class="nav-item">
<a class="nav-link" href="movies-list.html">Movies</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="latest.html">New Releases <span class="sr-only">(current)</span></a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0" action="tv-search.html" method="get">
<input class="form-control mr-sm-2" type="text" name="query" placeholder="Search shows..." required>
<button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<svg class="feather sm"><use xlink:href="assets/feather/feather-sprite.svg#settings"/></svg>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item cursor" data-toggle="modal" data-target="#settingsModal">Settings</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="https://github.com/Bunnbuns/Show-Box-Web-App" target="_blank">GitHub</a>
<a class="dropdown-item" href="about.html">About</a>
</div>
</li>
</ul>
</div>
</nav>
<!-- End appbar -->
<div style="height:90px;"></div>
<!-- Modal -->
<div class="modal fade" id="settingsModal" tabindex="-1" role="dialog" aria-labelledby="modalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="settingsModal">Settings</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="imageProxySelect">Image Proxy</label>
<select class="form-control" id="imageProxySelect" aria-describedby="imageProxyHelpBlock">
<option>ON</option>
<option>OFF</option>
</select>
<small id="imageProxyHelpBlock" class="form-text text-muted">
Turn on to have images go through the API proxy used by the app.
</small>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-warning" onclick="saveSettings('imageProxySelect')">Save changes</button>
</div>
</div>
</div>
</div>
<!-- content -->
<div class="container">
<ul class="nav nav-tabs" id="tabs">
<li class="nav-item">
<a class="nav-link active" href="?type=tv" id="tv-tab">Shows</a>
</li>
<li class="nav-item">
<a class="nav-link" href="?type=movie" id=movie-tab>Movies</a>
</li>
<!--
<li class="nav-item">
<a class="nav-link disabled" tabindex="-1" aria-disabled="true" href="?type=my">My</a>
</li>
-->
</ul>
<br />
<div id="list"></div>
</div>
<br />
<!-- End of page -->
<script>
//lasest.js
// --- Set vars --- //
var type = getAllUrlParams().type;
if(type == null){
console.log("type not set");
location.href = "latest.html?type=tv";
}
window.onload = function() {
//window is loaded, send requests
if(imageProxy != null){
document.getElementById("imageProxySelect").value = imageProxy;
}
if(type == 'tv'){ // tv tab is selected //
var tab = document.getElementById("movie-tab");
tab.classList.remove("active");
var tab = document.getElementById("tv-tab");
tab.classList.add("active");
// request //
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.status == 200 || this.status == 302) {
//go ahead and do stuff:
document.getElementById("list").innerHTML = "";
var tmp = JSON.parse(xhttp.responseText);
for (var i = 0; i < tmp.tv.length; i++){
var imageURL = tmp.tv[i].poster;
if(imageProxy == 'ON'){ imageURL = 'https://dev.benworld.net/sb/local/ssl-proxy/'+tmp.tv[i].poster.replace(/https:\/\/|http:\/\//g, ""); }
document.getElementById("list").innerHTML = document.getElementById("list").innerHTML.concat('<article class="sb-card" title="'+tmp.tv[i].title+'"> <a href="tv-show.html?id='+tmp.tv[i].id+'" class="card__link"> <span class="highlight"></span> <img src="'+imageURL+'" alt="" class="card__image" /> </a> <h2 class="card__title">'+tmp.tv[i].title+'</h2> </article>');
}
}
};
xhttp.open("GET", "https://dev.benworld.net/sbrapi.cc/api/serials/updates/?", true);
xhttp.send();
}else if(type == 'movie'){ // movie tab is selected //
var tab = document.getElementById("tv-tab");
tab.classList.remove("active");
var tab = document.getElementById("movie-tab");
tab.classList.add("active");
// request //
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.status == 200 || this.status == 302) {
//go ahead and do stuff:
document.getElementById("list").innerHTML = "";
var tmp = JSON.parse(xhttp.responseText);
for (var i = 0; i < tmp.movie.length; i++){
var imageURL = tmp.movie[i].poster;
if(imageProxy == 'ON'){ imageURL = 'https://dev.benworld.net/sb/local/ssl-proxy/'+tmp.movie[i].poster.replace(/https:\/\/|http:\/\//g, ""); }
document.getElementById("list").innerHTML = document.getElementById("list").innerHTML.concat('<article class="sb-card" title="'+tmp.movie[i].title+'"> <a href="'+tmp.movie[i].id+'" class="card__link"> <span class="highlight"></span> <img src="'+imageURL+'" alt="" class="card__image" /> </a> <h2 class="card__title">'+tmp.movie[i].title+'</h2> </article>');
}
}
};
xhttp.open("GET", "https://dev.benworld.net/sbrapi.cc/api/serials/updates/?", true);
xhttp.send();
}
}
// var more = new XMLHttpRequest();
// more.onreadystatechange = function() {
// if (this.status == 200 || this.status == 302) {
// //go ahead and do stuff:
// var tmp = JSON.parse(more.responseText);
// document.getElementById("list").innerHTML = "";
// for (var i = 0; i < tmp.length; i++){
// document.getElementById("list").innerHTML += '<a href="https://dev.benworld.net/sbrapi.cc/local/tv_show.html?id='+tmp[i].id+'"><div class="movie"><h5>'+tmp[i].title+'</h5><img id="poster" style="max-width:100%;" src="'+tmp[i].poster+'"></div></a>';
// }
// }
// };
// more.open("GET", "https://dev.benworld.net/sbrapi.cc/api/serials/tv_list/", true);
// // --- Functions --- //
// function loadMore(){
// document.getElementById("list").innerHTML = '<h1>Loading...</h1>';
// more.send();
// }
</script>
</body>
</html>