Skip to content

Commit 5463f75

Browse files
author
Vinit Kumar
committed
Merge pull request #6 from vinitkumar/feature/latest-2.7.0
add latest code from webstore
2 parents 63c94fc + 0a2120d commit 5463f75

File tree

6 files changed

+40
-380
lines changed

6 files changed

+40
-380
lines changed

css/application.css

Lines changed: 1 addition & 360 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

images/icon96.png

-1.82 KB
Loading

index.html

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@
33
<head>
44
<title>New Tab</title>
55
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6-
76
<link href="css/application.css" rel="stylesheet">
8-
<link href="css/animations.css" rel="stylesheet">
9-
<link href="css/tipsy.css" rel="stylesheet">
10-
<link href="css/icons.css" rel="stylesheet">
11-
<link href="css/backgrounds.css" rel="stylesheet">
12-
<link href="css/weather.css" rel="stylesheet">
13-
<link href="css/options.css" rel="stylesheet">
14-
157
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
168

179
<!--
@@ -387,7 +379,7 @@ <h2>Geolib</h2>
387379
<line id="secondhand" x1="50" y1="50" x2="50" y2="16"/>
388380
</g>
389381
</svg>
390-
<div id="time" class="fadeInDown animated smooth"></div>
382+
<div id="time" class="fadeInDown animated smooth"><span class="hour"></span><span class="minute"></span><span class="second"></span></div>
391383
<p id="date" class="title"></p>
392384
<div id="weather">
393385
<div id="loader" class="status fadeInDown animated hidden">Y</div>
@@ -478,5 +470,6 @@ <h2>Geolib</h2>
478470
<script type="text/javascript" src="js/libs.js"></script>
479471
<script type="text/javascript" src="js/q.min.js"></script>
480472
<script type="text/javascript" src="js/geolib.min.js"></script>
473+
<script type="text/javascript" src="js/raven.js"></script>
481474
<script type="text/javascript" src="js/app.js"></script>
482475
</html>

js/app.js

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ var _gaq = _gaq || [];
33
_gaq.push(['_setAccount', 'UA-33402958-1']);
44
_gaq.push(['_trackPageview']);
55

6+
Raven.config('https://[email protected]/4859');
7+
window.onerror = Raven.process;
8+
69
function OSType() {
710
var OSName="Unknown OS";
811
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
@@ -809,25 +812,46 @@ var Clock = {
809812
return num;
810813
},
811814

815+
dateTemplate: function(parts){
816+
return parts.day + ", " + parts.month + " " + parts.date;
817+
},
818+
819+
transformTemplate: function(angle){
820+
return "rotate(" + angle + ",50,50)";
821+
},
822+
812823
refresh: function(options) {
813824
var parts = Clock.timeParts(options);
814-
Clock.$el.digital.date.html(parts.day + ', ' + parts.month + ' ' + parts.date);
815-
Clock.$el.digital.time.html("<span class='hour'>"+parts.hour+"</span>"+"<span class='minute'>"+parts.minute+"</span>"+"<span class='second'>"+parts.second+"</span");
825+
var oldParts = Clock._parts || {};
826+
827+
Clock.$el.digital.date.html(Clock.dateTemplate(parts));
816828

817-
Clock.$el.analog.second.attr("transform", "rotate(" + parts.secondAngle + ",50,50)");
818-
Clock.$el.analog.minute.attr("transform", "rotate(" + parts.minuteAngle + ",50,50)");
819-
Clock.$el.analog.hour.attr("transform", "rotate(" + parts.hourAngle + ",50,50)");
829+
_.each(['hour', 'minute', 'second'], function(unit){
830+
if( parts[unit] !== oldParts[unit] ){
831+
Clock.$el.digital.time.find('.' + unit).text(parts[unit]);
832+
Clock.$el.analog[unit].attr("transform", Clock.transformTemplate(parts[unit + 'Angle']));
833+
}
834+
});
835+
836+
Clock._parts = parts;
820837
},
821838

822839
start: function(options) {
823840
if (Clock._running) {
824841
clearInterval(Clock._running);
825842
}
826843

827-
Clock._running = setInterval(function() {
844+
function tick() {
845+
var delayTime = 500;
846+
828847
Clock.refresh(options);
829-
}, 1000);
830-
Clock.refresh(options);
848+
849+
Clock._running = setTimeout(function(){
850+
window.requestAnimationFrame( tick );
851+
}, delayTime);
852+
}
853+
854+
tick();
831855
}
832856
};
833857

@@ -1108,4 +1132,4 @@ var OptionsView = {
11081132
});
11091133
});
11101134
}
1111-
};
1135+
};

js/raven.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"name": "Currently",
1515
"options_page": "index.html#options",
1616
"permissions": [ "storage", "geolocation", "unlimitedStorage", "https://maps.googleapis.com/maps/api/", "http://api.wunderground.com/api", "https://ssl.google-analytics.com/", "https://s3.amazonaws.com/" ],
17-
"update_url": "http://clients2.google.com/service/update2/crx",
18-
"version": "2.6.0"
17+
"update_url": "https://clients2.google.com/service/update2/crx",
18+
"version": "2.7.0"
1919
}

0 commit comments

Comments
 (0)