@categories = {}
- # reset: ->
- # FieldList::reset ...
- # console.log "#this.reset!"
- #
- # n = 0
- # cats = @categories
- # @forEach (field) ->
- # cat = field.get('tags', [])[0]
- # unless cats[cat]?
- # cats[cat] = n++
- # field.set 'category', "category_#{cats[cat]}", {+silent}
- #
- # setTimeout do
- # ~> _ _.pluck(@models, 'view') .invoke 'render'
- # 10
- # this
# }}}
'blur .value' : 'update'
'submit .value' : 'update'
'click .close' : 'toggleCollapsed'
- 'click' : 'onClick'
+ 'click h3' : 'toggleCollapsed'
+ 'click .collapsed' : 'onClick'
- # initialize: ->
- # console.log "#this.initialize!"
- # FieldView::initialize ...
- #
-
update: ->
val = @$el.find('.value').val()
current = @model.get 'value'
graph = root.graph = new GraphView {
graph_spec: CHART_OPTIONS_SPEC
}
- $ '#content' .append graph.el
+ $ '#content .inner' .append graph.el
jQuery.ajax do
### Scaffold Models
-class exports.Tags extends Array
+class exports.TagSet extends Array
tags : {}
(values=[]) ->
toString: -> "Tags(length=#{@length}, values=[\"#{@join '", "'}\"])"
-KNOWN_TAGS = exports.KNOWN_TAGS = new Tags()
+KNOWN_TAGS = exports.KNOWN_TAGS = new TagSet()
Field = exports.Field = Backbone.Model.extend do # {{{
ctorName : 'Field'
YAML_EXT_PAT = /\.ya?ml$/i
+/**
+ * Returns a JSON listing of the datasource metadata files.
+ */
app.get '/data/list', (req, res, next) ->
fs.readdir "#CWD/data", (err, files) ->
res.send do
include browser-helpers
-- var option_id = _.domize('option', id);
-- var value_id = _.domize('value', id);
-- var category_cls = _.domize('category', model.getCategoryIndex()) + ' ' + _.domize('category', model.getCategory());
-- var tags_cls = tags.map(_.domize('tag')).join(' ');
-- var type_cls = _.domize('type', type);
+- var option_id = _.domize('option', id)
+
+- var value_id = _.domize('value', id)
+- var type_cls = _.domize('type', type)
+
+- var category_cls = _.domize('category', model.getCategoryIndex()) + ' ' + _.domize('category', model.getCategory())
+- var tags_cls = tags.map(_.domize('tag')).join(' ')
+
.field.option(id=option_id, class="#{category_cls} #{tags_cls}")
- a.close ×
+ a.close(title="Click to collapse") ×
+ h3.shortname(title="Click to collapse") #{name}
//- h3.shortname #{_.shortname(name)}
- h3.shortname #{name}
+
label.name(for=value_id) #{name}
- input.value(type="text", id=value_id, name=name, class=type_cls, value=value)
+
+ if ( /object|array|function/i.test(type) )
+ textarea.value(id=value_id, name=name, class=type_cls) #{value}
+ else
+ - var input_type = (/boolean/i.test(type) ? 'checkbox' : 'text');
+ input.value(type=input_type, id=value_id, name=name, class=type_cls, value=value)
.type(class=type_cls) #{type}
.default(class=type_cls, title="Default: #{def} (#{type})") #{def}
-
.desc
!= jade.filters.markdown(desc)
@import 'nib'
section.graph
+ position relative
+
+ *
+ position relative
+
.graph-label
position relative
float left
z-index 3
padding 0.5em
- margin 0.5em
- width 200px
- min-height 2em
+ margin 0.4em
+ min-width 200px
+ max-width 250px
+ min-height 1.5em
+ line-height 1.5
overflow hidden
border-radius 5px
background-color #ccc
font-size 90%
- *
- position relative
- .close
- z-index 10
- // absolute top 0.5em right 0.5em
- absolute top 0.25em right 0.25em
+ h3
+ font-size 14px
+ line-height 1.3
cursor pointer
-
+
+ .close
+ absolute top right 0.1em
width 1em
height 1em
+ line-height 1.2em
text-align center
- // border-radius 50%
-
- // text-decoration none
- // border 1px solid #afafaf
- // background-color #ccc
-
- // opacity 1
- // color rgba(51,51,51, 0.4)
-
- // .close:hover
- // color rgba(51,51,51, 1)
- // border 1px solid #999
+ text-decoration none
+ z-index 10
+ cursor pointer
+ opacity 0.3
+ &:hover
+ opacity 0.6
.shortname
- // z-index -1
- // absolute bottom 0.5em right 0.5em
font-weight bold
color white
+ min-height 1.5em
.name
display none
font-weight bold
// line-height 1.5
// font-size 100%
- .value
- width auto
+ input.value
+ width 240px
font-family menlo, monospace
.type
&::before
z-index 2
width auto
min-width 50px
- min-height 2em
+ min-height 1.5em
+ line-height 1.5
- line-height 2em
- text-align center
cursor pointer
+ text-align center
*
display none
.shortname
- display inline
- position static
+ display inline-block
+ min-width 50px
+ min-height auto
- /* Category Colors {{{ */
+ /* Category/Tag Colors {{{ */
for i in 0...length($hilites)
$bg_color = $hilites[i]
$tag_color = $bg_color + contrast_direction($bg_color) * 50%
color $fg_color
background-color $bg_color
-
-
-
-
-
- // }}}
+ /* }}} */
background-color $page_bgcolor
box-shadow 0px 0px 6px 2px rgba(0,0,0,0.4)
+ & > .inner
+ position relative
+ width 80%
+ margin 0 auto
+
// .spacer offsets #content to pad for header
.spacer
font-size 250%
section#content
.spacer
-
- block content
+ .inner
+ block content
footer
block footer