summaryrefslogtreecommitdiff
path: root/src/templates/index.html
blob: 92bea582a5361e1bd38446033762de7521d35cfe (plain)
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
<%
  var settings = require("ep_etherpad-lite/node/utils/Settings");
%>
<!doctype html>
<html>

        <title><%=settings.title%></title>
    <script>
      /*
      |@licstart  The following is the entire license notice for the
      JavaScript code in this page.|

      Copyright 2011 Peter Martischka, Primary Technology.

      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

      |@licend  The above is the entire license notice
      for the JavaScript code in this page.|
      */
    </script>

        <meta charset="utf-8">
        <meta name="referrer" content="no-referrer">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
        <link rel="shortcut icon" href="<%=settings.favicon%>">

        <link rel="localizations" type="application/l10n+json" href="locales.json">
        <script type="text/javascript" src="static/js/html10n.js"></script>
        <script type="text/javascript" src="static/js/l10n.js"></script>

        <style>
            html, body {
              height: 100%;
            }
            body {
              margin: 0;
              color: #333;
              font: 14px helvetica, sans-serif;
              background: #ddd;
              background: -webkit-radial-gradient(circle,#aaa,#eee 60%) center fixed;
              background: -moz-radial-gradient(circle,#aaa,#eee 60%) center fixed;
              background: -ms-radial-gradient(circle,#aaa,#eee 60%) center fixed;
              background: -o-radial-gradient(circle,#aaa,#eee 60%) center fixed;
              border-top: 8px solid rgba(51,51,51,.8);
            }
            #wrapper {
              border-top: 1px solid #999;
              margin-top: 160px;
              padding: 15px;
              background: #eee;
              background: -webkit-linear-gradient(#fff,#ccc);
              background: -moz-linear-gradient(#fff,#ccc);
              background: -ms-linear-gradient(#fff,#ccc);
              background: -o-linear-gradient(#fff,#ccc);
              box-shadow: 0px 1px 8px rgba(0,0,0,0.3);
            }
            #inner {
              position:relative;
              max-width: 300px;
              margin: 0 auto;
            }
            #button {
              margin: 0 auto;
              text-align: center;
              font: 36px verdana,arial,sans-serif;
              width:300px;
              border:none;
              color: white;
              text-shadow: 0 -1px 0 rgba(0,0,0,.8);
              height: 70px;
              line-height: 70px;
              background: #555;
              background: -webkit-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
              background: -moz-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
              background: -ms-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
              background: -o-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
              box-shadow: inset 0 1px 3px rgba(0,0,0,0.9);
            }
            #button:hover {
              cursor: pointer;
              background: #666;
              background: -webkit-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
              background: -moz-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
              background: -ms-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
              background: -o-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
            }
            #button:active {
              box-shadow: inset 0 1px 12px rgba(0,0,0,0.9);
              background: #444;
            }
            #label {
              text-align: left;
              text-shadow: 0 1px 1px #fff;
              margin: 16px auto 0;
              display:block;
            }
            #padname{
              height:38px;
              max-width:280px;
            }
            form {
              height: 38px;
              background: #fff;
              border: 1px solid #bbb;
              border-radius: 3px;
              position: relative;
            }
            button, input {
              font-weight: bold;
              font-size: 15px;
            }
            input[type="text"] {
              border-radius: 3px;
              box-sizing: border-box;
              -moz-box-sizing: border-box;
              line-height:36px; /* IE8 hack */
              padding: 0px 45px 0 10px;
              *padding: 0; /* IE7 hack */
              width: 100%;
              height: 100%;
              outline: none;
              border: none;
              position: absolute;
            }
            button[type="submit"] {
              position: absolute;
              left:253px;
              width: 45px;
              height: 38px;
            }
            @media only screen and (min-device-width: 320px) and (max-device-width: 720px) {
              body {
                background: #bbb;
                background: -webkit-linear-gradient(#aaa,#eee 60%) center fixed;
                background: -moz-linear-gradient(#aaa,#eee 60%) center fixed;
                background: -ms-linear-gradient(#aaa,#eee 60%) center fixed;
              }
              #wrapper {
                margin-top: 0;
              }
              #inner {
                width: 95%;
              }
              #label {
                text-align: center;
              }
            }
        </style>
        <link href="static/custom/index.css" rel="stylesheet">

        <div id="wrapper">
        <% e.begin_block("indexWrapper"); %>
            <div id="inner">
                <button id="button" onclick="go2Random()" data-l10n-id="index.newPad"></button>
                <label id="label" for="padname" data-l10n-id="index.createOpenPad"></label>
                <form action="#" onsubmit="go2Name();return false;">
                    <input type="text" id="padname" maxlength="50" autofocus x-webkit-speech>
                    <button type="submit">OK</button>
                </form>
            </div>
        <% e.end_block(); %>
        </div>

        <script src="static/custom/index.js"></script>
        <script>
            // @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt
            function go2Name()
            {
                var padname = document.getElementById("padname").value;
                padname.length > 0 ? window.location = "p/" + padname : alert("Please enter a name")
            }

            function go2Random()
            {
                window.location = "p/" + randomPadName();
            }

            function randomPadName()
            {
                var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
                var string_length = 10;
                var randomstring = '';
                for (var i = 0; i < string_length; i++)
                {
                    var rnum = Math.floor(Math.random() * chars.length);
                    randomstring += chars.substring(rnum, rnum + 1);
                }
                return randomstring;
            }

            // start the custom js
            if (typeof customStart == "function") customStart();
            // @license-end
        </script>
        <div style="display:none"><a href="/javascript" data-jslicense="1">JavaScript license information</a></div>
</html>