summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/offline_load.html
blob: 06bc4c865d0c316f5fd2ea748e80dd97289a9592 (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
<!DOCTYPE html>
<html id="template_root" i18n-values="dir:textdirection">
<head>
<title i18n-content="title">
</title>
<style>
html {
  height: 100%;
}
body {
  color: #000;
  font-family: arial, sans-serif;
  background-image: -webkit-linear-gradient(white 50%, rgb(236, 244, 255));
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-box-align: stretch;
  visibility: hidden;
  -webkit-user-select: none;
}

.upper {
  position: relative;
  width: 100%;
  -webkit-box-flex: 0.8;
}

#lower {
  position: relative;
  margin-top: 0;
  width: 100%;
  -webkit-box-flex: 1;
  background-image: -webkit-gradient(radial, 50% -20%, 700, 50% -70%, 0, from(#FFF), color-stop(.7, #EEE), to(#EEE));
}

.icon {
  float: left;
  margin: 15px;
  overflow: visible;
}

.h3 {
  float: left;
  height: 10%;
  width: 80%;
  font-family: Sans-serif;
  font-size: 120%;
  font-weight: bold;
  padding: 3px;
}

.message {
  float: left;
  margin-top: 10px;
}

.link {
  float: left;
  clear: both;
  padding: 3px;
  font-weight: bold;
}

.offline_message {
  position: absolute;
  width: 600px;
  height: 49%;
  top: 50%;
  left: 50%;
  margin-left: -300px;
  margin-top: -20%;
}

.activation_message {
  position: absolute;
  width: 500px;
  top: 0;
  margin-top: 0;
  left: 50%;
  margin-left: -250px;
  min-height: 380px;
}

#carrierPage {
  padding-top: 10px;
  width: 500px;
  height: 380px;
  overflow-x: none;
  overflow-y: none;
}

.hidden {
  display: none;
}

.splitter {
  border-top: 1px solid #DDD;
  height: 1px;
}
</style>
<script src="shared/js/local_strings.js"></script>

<script>
var localStrings = new LocalStrings();

function sendCommand(cmd) {
  window.domAutomationController.setAutomationId(1);
  window.domAutomationController.send(cmd);
}

// Show the offline page.
function showPage() {
  document.body.style.visibility = 'visible';
}

document.addEventListener('DOMContentLoaded', function() {
  var time_to_wait = localStrings.getString('time_to_wait');
  var show_activation = localStrings.getString('show_activation') == 'true';
  window.setTimeout(showPage, time_to_wait);
  var lower = document.getElementById('lower');
  if (show_activation)
    lower.style.display = 'block';
});
</script>

<body oncontextmenu="return false;">
  <div class="upper" i18n-values=".title:url">
    <div class="offline_message">
      <div class="icon" i18n-values=".src:icon;.style.display:display_icon"></div>
      <h3 i18n-content="heading"></h3>
      <div class="message" i18n-values=".innerHTML:msg"></div>
      <div class="link"><a href="chrome://settings/internet"
           onclick="sendCommand('proceed')"
           i18n-content="try_loading"></a> 
      </div>
      <div class="link"><a href="chrome://settings/internet"
           onclick="sendCommand('open_network_settings')"
           i18n-content="network_settings"></a>
      </div>
    </div>
  </div>
  <div id="lower" class="hidden">
    <div class="activation_message">
      <div class="splitter"></div>
      <iframe src="chrome-extension://iadeocfgjdjdmpenejdbfeaocpbikmab/activation_in_offline.html"
              id="carrierPage" frameborder="0"></iframe>
    </div>
  </div>
</body>
</html>