Skip to content

Commit

Permalink
Remove Cloud9 warnings. Move time to the left.
Browse files Browse the repository at this point in the history
  • Loading branch information
depeele committed Jul 26, 2011
1 parent 71dbe37 commit f71ce78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions js/jquery.contextualClock.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ $.ContextualClock.prototype = {
ctx.fillText(str, 0, fontSize);

// Draw the month
var mFont = Math.floor(fontSize * .3);
var mFont = Math.floor(fontSize * 0.3);

ctx.fillStyle = 'rgba(255,255,255,0.8)';
ctx.font = 'bold '+ mFont +'px sans-serif';
Expand Down Expand Up @@ -351,7 +351,7 @@ $.ContextualClock.prototype = {
// Render the time
var hour = now.getHours();
var ap = 'am';
var apFont = Math.floor(fontSize * .25);
var apFont = Math.floor(fontSize * 0.25);

if (hour >= 12) { ap = 'pm'; hour -= (hour === 12 ? 0 : 12); }
else if (hour === 0) { hour = 12; }
Expand All @@ -378,7 +378,7 @@ $.ContextualClock.prototype = {

ctx.fillStyle = 'rgba(255,255,255,0.8)';
ctx.textAlign = 'right';
ctx.fillText( str, self.dim.year.width + 35, (fontSize * .75) );
ctx.fillText( str, self.dim.year.width + 35, (fontSize * 0.75) );

ctx.font = 'bold '+ apFont +'px sans-serif';
ctx.fillStyle = 'rgba(255,255,255,0.5)';
Expand All @@ -387,7 +387,7 @@ $.ContextualClock.prototype = {

ctx.fillText( ap,
self.dim.year.width + 40,
(fontSize * .75) + (apFont * .75) + 2);
(fontSize * 0.75) + (apFont * 0.75) + 2);
/*
self.dim.time.width + 2,
fontSize - (apFont / 2));
Expand Down Expand Up @@ -444,7 +444,7 @@ $.ContextualClock.prototype = {
// Render the textual time
ctx.save(); // {
ctx.globalAlpha = 1.0;
ctx.translate(self.dim.year.width - 2, 0); //(tFont * .25));
ctx.translate(self.dim.year.width - 4, 0); //(tFont * .25));

self.renderTime( now, tFont );

Expand Down
5 changes: 3 additions & 2 deletions js/jquery.contextualTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ $.ContextualTime.prototype = {
opts.longitude);
var rise = srss.sunriseLocalHours(offset);
var set = srss.sunsetLocalHours(offset);
var idex;

if (hourNow > set)
{
Expand Down Expand Up @@ -209,7 +210,7 @@ $.ContextualTime.prototype = {
ctx.beginPath();
//ctx.rotate(-(Math.PI / 2.4));
ctx.rotate( (PI2 / 24) + (PI2 / 4));
for (var idex = 0; idex < 24; idex++)
for (idex = 0; idex < 24; idex++)
{
var size = ((idex % 3)
? 0.5 //(idex / 12) + 0.1
Expand All @@ -229,7 +230,7 @@ $.ContextualTime.prototype = {
ctx.textAlign = 'center';
ctx.font = 'bold 17px sans-serif';

for (var idex = 0; idex < 24; idex += 3)
for (idex = 0; idex < 24; idex += 3)
{
var aTime = this.h2rad(idex);
var str = idex;
Expand Down

0 comments on commit f71ce78

Please sign in to comment.