Code updates for customizing clock/number
This commit is contained in:
parent
fcc3539892
commit
8649a7623c
@ -361,7 +361,8 @@ li[class^="icon-"].icon-large:before, li[class*=" icon-"].icon-large:before {
|
||||
opacity:0;
|
||||
}*/
|
||||
.widget-clock {
|
||||
background-color: #dc5945; }
|
||||
/* background-color: #dc5945; }*/
|
||||
background-color: #ff0000; }
|
||||
.widget-comments {
|
||||
background-color: #eb9c3c; }
|
||||
.widget-comments .title {
|
||||
|
@ -4,11 +4,19 @@ import random
|
||||
import collections
|
||||
|
||||
class SynergySampler(DashieSampler):
|
||||
def __init__(self, *args, **kwargs):
|
||||
DashieSampler.__init__(self, *args, **kwargs)
|
||||
self._last = 0
|
||||
|
||||
def name(self):
|
||||
return 'synergy'
|
||||
|
||||
def sample(self):
|
||||
return {'value': random.randint(0, 100)}
|
||||
s = {'value': random.randint(0, 100),
|
||||
'current': random.randint(0, 100),
|
||||
'last': self._last}
|
||||
self._last = s['current']
|
||||
return s
|
||||
|
||||
class BuzzwordsSampler(DashieSampler):
|
||||
def name(self):
|
||||
|
@ -29,6 +29,8 @@ def javascripts():
|
||||
'assets/javascripts/rickshaw.min.js',
|
||||
#'assets/javascripts/application.coffee',
|
||||
'assets/javascripts/app.js',
|
||||
'widgets/clock/clock.coffee',
|
||||
'widgets/number/number.coffee',
|
||||
]
|
||||
nizzle = True
|
||||
if not nizzle:
|
||||
|
@ -28,12 +28,16 @@
|
||||
<div data-id="synergy" data-view="Meter" data-title="Synergy" data-min="0" data-max="100"></div>
|
||||
</li>
|
||||
|
||||
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
|
||||
<div data-id="synergy" data-view="Number" data-title="NumSynergy"></div>
|
||||
</li>
|
||||
|
||||
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
|
||||
<div data-id="clock" data-view="Clock" data-title="Clock"></div>
|
||||
</li>
|
||||
|
||||
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
|
||||
<div data-id="comments" data-view="comments" data-title="Comments"></div>
|
||||
<div data-view="Image" data-image="/images/dashie.png"></div>
|
||||
</li>
|
||||
|
||||
<li data-row="1" data-col="1" data-sizex="1" data-sizey="2">
|
||||
@ -41,7 +45,7 @@
|
||||
</li>
|
||||
|
||||
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
|
||||
<div data-view="Image" data-image="/images/dashie.png"></div>
|
||||
<div data-id="comments" data-view="comments" data-title="Comments"></div>
|
||||
</li>
|
||||
|
||||
<li data-row="1" data-col="1" data-sizex="2" data-sizey="1">
|
||||
|
@ -15,4 +15,4 @@ class Dashing.Clock extends Dashing.Widget
|
||||
@set('date', today.toDateString())
|
||||
|
||||
formatTime: (i) ->
|
||||
if i < 10 then "z0" + i else i
|
||||
if i < 10 then "0" + i else i
|
||||
|
@ -1,2 +1,2 @@
|
||||
<h1 data-bind="date"></h1>
|
||||
<h2 data-bind="time"></h2>
|
||||
<h2 data-bind="time"></h2>
|
||||
|
@ -6,8 +6,8 @@ $background-color: #dc5945;
|
||||
// ----------------------------------------------------------------------------
|
||||
// Widget-clock styles
|
||||
// ----------------------------------------------------------------------------
|
||||
.widget-clock {
|
||||
.widget-clock {
|
||||
|
||||
background-color: $background-color;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,4 +11,4 @@ class Dashing.Meter extends Dashing.Widget
|
||||
meter = $(@node).find(".meter")
|
||||
meter.attr("data-bgcolor", meter.css("background-color"))
|
||||
meter.attr("data-fgcolor", meter.css("color"))
|
||||
meter.knob()
|
||||
meter.knob()
|
||||
|
@ -11,16 +11,16 @@ $meter-background: darken($background-color, 15%);
|
||||
// ----------------------------------------------------------------------------
|
||||
// Widget-meter styles
|
||||
// ----------------------------------------------------------------------------
|
||||
.widget-meter {
|
||||
.widget-meter {
|
||||
|
||||
background-color: $background-color;
|
||||
|
||||
input.meter {
|
||||
|
||||
input.meter {
|
||||
background-color: $meter-background;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.title {
|
||||
.title {
|
||||
color: $title-color;
|
||||
}
|
||||
|
||||
@ -31,5 +31,5 @@ $meter-background: darken($background-color, 15%);
|
||||
.updated-at {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,8 @@ class Dashing.Number extends Dashing.Widget
|
||||
|
||||
@accessor 'arrow', ->
|
||||
if @get('last')
|
||||
if parseInt(@get('current')) > parseInt(@get('last')) then 'icon-arrow-up' else 'icon-arrow-down'
|
||||
if parseInt(@get('current')) > parseInt(@get('last')) then '+' else '-'
|
||||
#if parseInt(@get('current')) > parseInt(@get('last')) then 'icon-arrow-up' else 'icon-arrow-down'
|
||||
|
||||
onData: (data) ->
|
||||
if data.status
|
||||
|
Loading…
x
Reference in New Issue
Block a user