forked from Stremio/stremio-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddon-template.ejs
120 lines (107 loc) · 4.94 KB
/
addon-template.ejs
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
<!DOCTYPE html>
<head>
<link href="//fonts.googleapis.com/css?family=Lato:100,300,400,100italic,200italic,300italic" rel="stylesheet" type="text/css">
<title><%= addon.manifest.name %> - Stremio Addon</title>
<style>
body,html{
margin: 0px; padding: 0px;
font-family: Lato,'Open Sans',OpenSans,arial,sans-serif;
font-weight: 300; color: white;
cursor: default;
width: 100%; height: 100%;
}
h1, h2, h3, h4, h5, h6 { font-weight: 300; }
#addon {
width: 400px;
position: absolute;
left: 0px; right: 0px; top: 10%; bottom: auto;
margin: auto;
}
a { color: white; }
button {
border: 0px; outline: 0px;
color: white;
background: rgba(125,79,158,0.85);
padding: 13px 22px;
text-align: center;
font-size: 17px;
font-weight: 300;
cursor: pointer;
opacity: 0.9;
display: block;
}
a.activate-link {
text-decoration: none;
}
button:hover { opacity: 1; }
.logo { float: left; margin: 20px; }
.icon { float: left; width: 60px; height: 40px; margin: 20px; background-color: #eaeaea; -webkit-mask-repeat: no-repeat; -moz-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; -moz-mask-position: center; mask-position: center; -webkit-mask-size: contain; -moz-mask-size: contain; mask-size: contain; }
.name { float: left; }
.version { float: right; }
.provides, .gives, .description { clear: both; }
.best { margin-bottom: 30px; }
//h2 { text-align: center; }
//button { margin: 0px auto; }
.best img { width: 60px; }
<% if (addon.manifest.background) { %>
html { background-image: url(<%= addon.manifest.background %>); background-size: auto 100%; background-size: cover; background-repeat: no-repeat; }
body { background: rgba(0,0,0,0.65); }
<% } else { %>
html { background-image: url('http://www.strem.io/3.0/background-6.jpg'); background-size: auto 100%; background-size: cover; background-repeat: no-repeat; }
<% } %>
</style>
<body>
<div id="addon">
<% if (addon.manifest.logo) { %>
<img class="logo" src="<%= addon.manifest.logo %>">
<% } else if (addon.manifest.icon) { %>
<div class="icon" style="-webkit-mask-image: url(<%= addon.manifest.icon %>); -moz-mask-image: url(<%= addon.manifest.icon %>); mask-image: url(<%= addon.manifest.icon %>)"></div>
<% } else { %>
<h2 class="name"><%= addon.manifest.name %></h2>
<% } %>
<h3 class="version"><i><%= addon.manifest.version %></i></h3>
<h3 class="description"><%- addon.manifest.webDescription || addon.manifest.description %></h3>
<% if (stats.statsLabel) { %>
<h2 class="provides"><%= (stats.statsLabel || "") + stats.statsNum %></h2>
<% } %>
<% var mapType = function(t) { return ({ movie: "Movies", series: "Series", tv: "TV Channels", channel: "Channels" })[t] || t }; %>
<h2 class="gives">This add-on has:</h2>
<ul>
<% if (addon.methods["meta.find"]) { %>
<li>More <%= addon.manifest.types.map(mapType).join(", ") %> in Discover</li>
<% }; if (addon.methods["stream.find"]) { %>
<li>Watch <%= addon.manifest.types.map(mapType).join(", ") + addon.manifest.isFree ? 'for FREE' : '' %></li>
<% }; if (addon.methods["subtitles.get"]) { %>
<li> Subtitles for <%= addon.manifest.types.map(mapType).join(", ") %></li>
<% }; %>
</ul>
<div style="<%= top.length ? '' : 'display: none;' %>" class="best">
<h2>Best from this add-on: </h2>
<div class="posters">
<% top.filter(function(x) { return x.poster }).slice(0,5).forEach(function(item) { %>
<img src="<%= item.poster %>" title="<%= item.name+' ('+item.year+')' %>" alt="<%= item.name+' ('+item.year+')' %>">
<% }); %>
</div>
</div>
<h3 class="description"><%- addon.manifest.webDescription || addon.manifest.description %></h3>
<% if (endpoint) { %>
<a class="activate-link" href="<%= endpoint ? endpoint.replace(/^http(s?)/, 'stremio') : null %>"><button name="Install">Install Add-on</button></a>
<% } else { %>
<div>No valid end-point for this add-on</div>
<% } %>
<h3 class="contact">To contact add-on creator: <a href="mailto:<%- addon.manifest.email %>"><%- addon.manifest.email %></a></h3>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<% if (endpoint) { %>
<script>
$.get("http://localhost:11470/manifest").success(function() {
$("#addon").on("click", ".activate-link", function(e) {
e.preventDefault();
$.get("http://localhost:11470/info/"+encodeURIComponent("<%= endpoint.replace(new RegExp('^http(s?)://'), '') %>"))
return false;
});
}).error(function(e) { /* ignore */ })
</script>
<% } %>
</body>
</head>