|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2009 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module containing some HTML resources. |
|
8 """ |
|
9 |
|
10 notFoundPage_html = """\ |
|
11 <html> |
|
12 <head> |
|
13 <title>{0}</title> |
|
14 <style> |
|
15 body { |
|
16 padding: 3em 0em; |
|
17 background: #eeeeee; |
|
18 } |
|
19 hr { |
|
20 color: lightgray; |
|
21 width: 100%; |
|
22 } |
|
23 img { |
|
24 float: left; |
|
25 opacity: .8; |
|
26 } |
|
27 #box { |
|
28 background: white; |
|
29 border: 1px solid lightgray; |
|
30 width: 600px; |
|
31 padding: 60px; |
|
32 margin: auto; |
|
33 } |
|
34 h1 { |
|
35 font-size: 130%; |
|
36 font-weight: bold; |
|
37 border-bottom: 1px solid lightgray; |
|
38 margin-left: 48px; |
|
39 } |
|
40 h2 { |
|
41 font-size: 100%; |
|
42 font-weight: normal; |
|
43 border-bottom: 1px solid lightgray; |
|
44 margin-left: 48px; |
|
45 } |
|
46 ul { |
|
47 font-size: 80%; |
|
48 padding-left: 48px; |
|
49 margin: 5px 0; |
|
50 } |
|
51 #reloadButton { |
|
52 padding-left: 48px; |
|
53 } |
|
54 </style> |
|
55 </head> |
|
56 <body> |
|
57 <div id="box"> |
|
58 <img src="data:image/png;base64,IMAGE_BINARY_DATA_HERE" width="32" height="32"/> |
|
59 <h1>{1}</h1> |
|
60 <h2>{2}</h2> |
|
61 <ul> |
|
62 <li>{3}</li> |
|
63 <li>{4}</li> |
|
64 <li>{5}</li> |
|
65 </ul> |
|
66 </div> |
|
67 </body> |
|
68 </html> |
|
69 """ |
|
70 |
|
71 ########################################################################################## |
|
72 |
|
73 startPage_html = """\ |
|
74 <?xml version="1.0" encoding="UTF-8" ?> |
|
75 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
|
76 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
77 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
|
78 <head> |
|
79 <title></title> |
|
80 <style> |
|
81 * { |
|
82 margin: 0; |
|
83 padding: 0; |
|
84 font-family: "DejaVu Sans"; |
|
85 } |
|
86 |
|
87 body { |
|
88 background: -webkit-gradient(linear, left top, left bottom, from(#85784A), to(#FDFDFD), color-stop(0.5, #FDFDFD)); |
|
89 background-repeat: repeat-x; |
|
90 margin-top: 200px; |
|
91 } |
|
92 |
|
93 #header, #search, #footer { |
|
94 width: 600px; |
|
95 margin: 10px auto; |
|
96 } |
|
97 |
|
98 #header, #search { |
|
99 -webkit-border-radius: 0.8em; |
|
100 padding: 25px; |
|
101 } |
|
102 |
|
103 #header { |
|
104 background: -webkit-gradient(linear, left top, left bottom, from(#D57E3E), to(#D57E3E), color-stop(0.5, #FFBA89)); |
|
105 height: 25px; |
|
106 } |
|
107 |
|
108 #header h1 { |
|
109 display: inline; |
|
110 font-size: 1.7em; |
|
111 font-weight: bold; |
|
112 } |
|
113 |
|
114 #header img { |
|
115 display: inline; |
|
116 float: right; |
|
117 margin-top: -5px; |
|
118 } |
|
119 |
|
120 #search { |
|
121 background: -webkit-gradient(linear, left top, right top, from(#85784A), to(#85784A), color-stop(0.5, #C8C2AE)); |
|
122 height: 50px; |
|
123 color: #000; |
|
124 text-align: center; |
|
125 padding-top: 40px !important; |
|
126 } |
|
127 |
|
128 #search fieldset { |
|
129 border: 0; |
|
130 } |
|
131 |
|
132 #search input[type=text] { |
|
133 width: 65%; |
|
134 } |
|
135 |
|
136 #search input[type=submit] { |
|
137 width: 25%; |
|
138 } |
|
139 |
|
140 #footer { |
|
141 text-align: center; |
|
142 color: #999; |
|
143 } |
|
144 |
|
145 #footer a { |
|
146 color: #555; |
|
147 text-decoration: none; |
|
148 } |
|
149 |
|
150 #footer a:hover { |
|
151 text-decoration: underline; |
|
152 } |
|
153 </style> |
|
154 <script type="text/javascript"> |
|
155 function update() |
|
156 { |
|
157 document.title = window.eric.translate('Welcome to Eric Web Browser!'); |
|
158 document.getElementById('headerTitle').innerHTML = window.eric.translate('Eric Web Browser'); |
|
159 document.getElementById('searchButton').value = window.eric.translate('Search!'); |
|
160 document.getElementById('footer').innerHTML = window.eric.providerString() |
|
161 + ' | ' + '<a href="http://eric-ide.python-projects.org/">' |
|
162 + window.eric.translate('About Eric') + '</a>'; |
|
163 document.getElementById('lineEdit').placeholder = window.eric.providerString(); |
|
164 |
|
165 // Try to change the direction of the page: |
|
166 |
|
167 var newDir = window.eric.translate('QT_LAYOUT_DIRECTION'); |
|
168 newDir = newDir.toLowerCase(); |
|
169 if ((newDir != 'ltr') && (newDir != 'rtl')) |
|
170 newDir = 'ltr'; |
|
171 document.getElementsByTagName('body')[0].setAttribute('dir', newDir); |
|
172 } |
|
173 |
|
174 function formSubmitted() |
|
175 { |
|
176 var string = lineEdit.value; |
|
177 |
|
178 if (string.length == 0) |
|
179 return; |
|
180 |
|
181 var url = window.eric.searchUrl(string); |
|
182 window.location.href = url; |
|
183 } |
|
184 </script> |
|
185 </head> |
|
186 <body onload="document.forms[0].lineEdit.select(); update();"> |
|
187 <div id="header"> |
|
188 <h1 id="headerTitle"></h1> |
|
189 <img src="data:image/png;base64,IMAGE_BINARY_DATA_HERE" width="32" height="32"/> |
|
190 </div> |
|
191 <div id="search"> |
|
192 <form action="javascript:formSubmitted();"> |
|
193 <fieldset> |
|
194 <input id="lineEdit" name="lineEdit" type="text" /> |
|
195 <input id="searchButton" type="submit" /> |
|
196 </fieldset> |
|
197 </form> |
|
198 </div> |
|
199 <div id="footer"></div> |
|
200 </body> |
|
201 </html> |
|
202 """ |