Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: alexeykuzmin/benua-helper
base: cd1b152af4
...
head fork: alexeykuzmin/benua-helper
compare: 15df7287de
  • 7 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
40 src/background.js
@@ -15,39 +15,39 @@
var schedules = {
benua_lenina:
[
- [7, [40]],
- [8, [0, 20, 30, 40, 50]],
- [9, [0, 10, 20, 30, 40, 50]],
- [10, [0, 10, 20, 30, 40, 50]],
- [11, [0, 10, 20, 30, 40, 50]],
- [12, [0, 10, 20, 30, 40, 50]],
+ [7, [40, 48, 56]],
+ [8, [4, 12, 20, 28, 36, 44, 52]],
+ [9, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [10, [4, 12, 20, 28, 36, 44, 52]],
+ [11, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [12, [4, 12, 20, 40]],
[13, [0, 20, 40]],
[14, [0, 20, 40]],
[15, [0, 20, 40]],
[16, [0, 20, 40]],
- [17, [0, 10, 20, 30, 40, 50]],
- [18, [0, 10, 20, 30, 40, 50]],
- [19, [0, 10, 20, 30, 40, 50]],
- [20, [0, 10, 20, 40]],
+ [17, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [18, [4, 12, 20, 28, 36, 44, 52]],
+ [19, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [20, [4, 12, 20, 40]],
[21, [0, 20, 40]],
[22, [20]],
[23, [0]]
],
lenina_benua:
[
- [7, [20, 40]],
- [8, [0, 10, 20, 30, 40, 50]],
- [9, [0, 10, 20, 30, 40, 50]],
- [10, [0, 10, 20, 30, 40, 50]],
- [11, [0, 10, 20, 30, 40, 50]],
- [12, [0, 10, 20, 30, 40]],
+ [7, [20, 28, 36, 44, 52]],
+ [8, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [9, [4, 12, 20, 28, 36, 44, 52]],
+ [10, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [11, [4, 12, 20, 28, 36, 44, 52]],
+ [12, [0, 20, 40]],
[13, [0, 20, 40]],
[14, [0, 20, 40]],
[15, [0, 20, 40]],
[16, [0, 20, 40]],
- [17, [0, 20, 30, 40, 50]],
- [18, [0, 10, 20, 30, 40, 50]],
- [19, [0, 10, 20, 30, 40, 50]],
+ [17, [0, 20, 28, 36, 44, 52]],
+ [18, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [19, [4, 12, 20, 28, 36, 44, 52]],
[20, [0, 20, 40]],
[21, [0, 20]],
[22, [0, 40]]
@@ -167,5 +167,5 @@
return window.localStorage.getItem("rasp");
}
- window.setInterval(refreshSchedule, 100);
+ window.setInterval(refreshSchedule, 10000);
})(window, chrome);
View
2  src/manifest.json
@@ -1,6 +1,6 @@
{
"name": "Benua Helper",
- "version": "2.3.5",
+ "version": "2.3.8",
"description": "Autobus schedules for business-center Benua",
"manifest_version": 2,
View
224 www/autobus.html
@@ -0,0 +1,224 @@
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Расписание шаттлов "БЦ Бенуа — пл. Ленина"</title>
+ <link href="autobus.png" rel="shortcut icon" type="image/png" />
+ <style>
+ * {
+ font-family: Tahoma, serif;
+ }
+
+ #wrap_a {
+ position: absolute;
+ left: 150px;
+ top: 50px;
+ font-size: 30px;
+ }
+
+ #time_a {
+ font-size: 150px;
+ background-color: #eee;
+ text-align: center;
+ padding: 0 20px;
+ margin: 10px 0;
+ }
+
+ .red #time_a {
+ background-color: #fcc;
+ }
+
+ #wrap_a.red {
+ color: #f00;
+ }
+
+ #after_a {
+ text-align: right;
+ font-size: 50px;
+ }
+
+ #wrap_b {
+ position: absolute;
+ right: 150px;
+ top: 65px;
+ font-size: 20px;
+ }
+
+ #time_b, #time_c, #time_d {
+ font-size: 80px;
+ background-color: #eee;
+ text-align: center;
+ padding: 0 10px;
+ margin: 5px 0;
+ }
+
+ #after_b, #after_c, #after_d {
+ text-align: right;
+ font-size: 25px;
+ margin-bottom: 30px;
+ }
+ </style>
+</head>
+<body>
+
+<div id="wrap_a">
+ <div style="height: 40px">Ближайший автобус будет в</div>
+ <div id="time_a"></div>
+ <div id="after_a">через <b id="min_a"></b>'</div>
+</div>
+
+<div id="wrap_b">
+ <div style="height: 30px">Затем автобусы будут в</div>
+ <div id="time_b"></div>
+ <div id="after_b">через <b id="min_b"></b>'</div>
+
+ <div id="time_c"></div>
+ <div id="after_c">через <b id="min_c"></b>'</div>
+
+ <div id="time_d"></div>
+ <div id="after_d">через <b id="min_d"></b>'</div>
+</div>
+
+<script language="JavaScript" type="text/javascript">
+ (function () {
+ var config = {
+ needed_autobuses_number: 4
+ };
+
+ var schedule = {
+ data: [
+ [7, [40, 48, 56]],
+ [8, [4, 12, 20, 28, 36, 44, 52]],
+ [9, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [10, [4, 12, 20, 28, 36, 44, 52]],
+ [11, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [12, [4, 12, 20, 40]],
+ [13, [0, 20, 40]],
+ [14, [0, 20, 40]],
+ [15, [0, 20, 40]],
+ [16, [0, 20, 40]],
+ [17, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [18, [4, 12, 20, 28, 36, 44, 52]],
+ [19, [0, 8, 16, 24, 32, 40, 48, 56]],
+ [20, [4, 12, 20, 40]],
+ [21, [0, 20, 40]],
+ [22, [20]],
+ [23, [0]]
+ ],
+ reorganized: [],
+ reorganize: function () {
+ for (var i = 0; i < this.data.length; ++i) {
+ for (var j = 0; j < this.data[i][1].length; ++j) {
+ this.reorganized.push([this.data[i][0], this.data[i][1][j]]);
+ }
+ }
+ },
+ after: function (h, m) {
+ var found = [], i, autobus;
+ for (i = 0; i < this.reorganized.length && found.length < config.needed_autobuses_number; ++i) {
+ autobus = this.reorganized[i];
+ if (autobus[0] == h && autobus[1] >= m || autobus[0] > h) {
+ found.push(autobus);
+ }
+ }
+ if (found.length < config.needed_autobuses_number) {
+ for (i = 0; found.length < config.needed_autobuses_number; ++i) {
+ autobus = this.reorganized[i];
+ found.push(autobus);
+ }
+ }
+ return found;
+ }
+ };
+
+ function format(h, m) {
+ var s = (new Date()).getSeconds();
+ return (h < 10 ? "0" + h : h) + "<span style=\"color: " + (s % 2 ? "auto" : "transparent") + "\">:</span>" + (m < 10 ? "0" + m : m);
+ }
+
+ function distance(h1, m1, h2, m2) {
+ var dh = h2 - h1, dm = m2 - m1;
+ if (dh < 0) {
+ dh += 24;
+ }
+ var dist = dh * 60 + dm;
+ if (dist > 100) {
+ return "много";
+ }
+ return dist;
+ }
+
+ schedule.reorganize();
+
+ function refresh() {
+ var d = new Date(), h = d.getHours(), m = d.getMinutes();
+ var found = schedule.after(h, m);
+
+ document.getElementById('time_a').innerHTML = format(found[0][0], found[0][1]);
+ var dist = distance(h, m, found[0][0], found[0][1]);
+ document.getElementById('min_a').innerHTML = dist;
+ if (dist <= 5) {
+ document.getElementById('wrap_a').className = 'red';
+ } else {
+ document.getElementById('wrap_a').className = '';
+ }
+
+ document.getElementById('time_b').innerHTML = format(found[1][0], found[1][1]);
+ document.getElementById('min_b').innerHTML = distance(h, m, found[1][0], found[1][1]);
+
+ document.getElementById('time_c').innerHTML = format(found[2][0], found[2][1]);
+ document.getElementById('min_c').innerHTML = distance(h, m, found[2][0], found[2][1]);
+
+ document.getElementById('time_d').innerHTML = format(found[3][0], found[3][1]);
+ document.getElementById('min_d').innerHTML = distance(h, m, found[3][0], found[3][1]);
+ }
+
+ setInterval(refresh, 1000);
+ })();
+</script>
+
+
+<!-- Yandex.Metrika counter -->
+<script type="text/javascript">
+(function (d, w, c) {
+ (w[c] = w[c] || []).push(function() {
+ try {
+ w.yaCounter18673294 = new Ya.Metrika({id:6527575,
+ trackLinks:true,
+ accurateTrackBounce:true});
+ } catch(e) { }
+ });
+
+ var n = d.getElementsByTagName("script")[0],
+ s = d.createElement("script"),
+ f = function () { n.parentNode.insertBefore(s, n); };
+ s.type = "text/javascript";
+ s.async = true;
+ s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
+
+ if (w.opera == "[object Opera]") {
+ d.addEventListener("DOMContentLoaded", f, false);
+ } else { f(); }
+})(document, window, "yandex_metrika_callbacks");
+</script>
+<noscript><div><img src="//mc.yandex.ru/watch/18673294" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
+<!-- /Yandex.Metrika counter -->
+
+<!-- Google Analytics -->
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-37797734-1']);
+ _gaq.push(['_setDomainName', 'grigoriev.me']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script>
+<!-- /Google Analytics -->
+
+</body>
+</html>
View
BIN  www/autobus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  www/bus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
106 www/index.html
@@ -0,0 +1,106 @@
+<html>
+<head>
+ <title>Benua Helper</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <style>
+ #crx {
+ width: 256px;
+ height: 256px;
+ background: url('bus.png') center center no-repeat;
+ position: absolute;
+ left: 50%;
+ top: 200px;
+ margin-left: -128px;
+ }
+
+ #download {
+ position: absolute;
+ z-index: 2;
+ left: 50%;
+ top: 420px;
+ border-radius: 5px;
+ padding: 5px;
+
+ background-image: linear-gradient(bottom, rgb(166,46,46) 49%, rgb(201,141,76) 75%, rgb(242,151,109) 88%);
+ background-image: -o-linear-gradient(bottom, rgb(166,46,46) 49%, rgb(201,141,76) 75%, rgb(242,151,109) 88%);
+ background-image: -moz-linear-gradient(bottom, rgb(166,46,46) 49%, rgb(201,141,76) 75%, rgb(242,151,109) 88%);
+ background-image: -webkit-linear-gradient(bottom, rgb(166,46,46) 49%, rgb(201,141,76) 75%, rgb(242,151,109) 88%);
+ background-image: -ms-linear-gradient(bottom, rgb(166,46,46) 49%, rgb(201,141,76) 75%, rgb(242,151,109) 88%);
+ background-image: -webkit-gradient(
+ linear,
+ left bottom,
+ left top,
+ color-stop(0.49, rgb(166,46,46)),
+ color-stop(0.75, rgb(201,141,76)),
+ color-stop(0.88, rgb(242,151,109))
+ );
+ }
+
+ a {
+ color: #ffffff;
+ font-size: 2em;
+ font-family: Tahoma;
+ }
+
+ a.link {
+ color: #000099;
+
+ }
+ </style>
+</head>
+<body>
+ <a href="https://chrome.google.com/webstore/detail/benua-helper/fnegkdpbolaklgedhapmecddppgbonph">
+ <div id="crx"></div>
+ <div id="download">DOWNLOAD</div>
+ </a>
+
+ <center>
+ <a class="link" href="autobus.html">Расписание на сайте</a>
+ </center>
+
+<!-- Yandex.Metrika counter -->
+<script type="text/javascript">
+(function (d, w, c) {
+ (w[c] = w[c] || []).push(function() {
+ try {
+ w.yaCounter6527575 = new Ya.Metrika({id:6527575,
+ clickmap:true,
+ trackLinks:true,
+ accurateTrackBounce:true});
+ } catch(e) { }
+ });
+
+ var n = d.getElementsByTagName("script")[0],
+ s = d.createElement("script"),
+ f = function () { n.parentNode.insertBefore(s, n); };
+ s.type = "text/javascript";
+ s.async = true;
+ s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
+
+ if (w.opera == "[object Opera]") {
+ d.addEventListener("DOMContentLoaded", f, false);
+ } else { f(); }
+})(document, window, "yandex_metrika_callbacks");
+</script>
+<noscript><div><img src="//mc.yandex.ru/watch/6527575" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
+<!-- /Yandex.Metrika counter -->
+
+<!-- Google Analytics -->
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-37797734-1']);
+ _gaq.push(['_setDomainName', 'grigoriev.me']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script>
+<!-- /Google Analytics -->
+
+</body>
+</html>

No commit comments for this range

Something went wrong with that request. Please try again.