Fixes GraphEditView classes and selectors to match others and defend against bleeding...
authordsc <dsc@less.ly>
Mon, 16 Apr 2012 22:35:52 +0000 (15:35 -0700)
committerdsc <dsc@less.ly>
Mon, 16 Apr 2012 22:35:52 +0000 (15:35 -0700)
data/graphs/kbye.json [new file with mode: 0644]
lib/chart/chart-option-view.co
lib/graph/graph-edit-view.co
lib/template/chart-option.jade
lib/template/chart-scaffold.jade
lib/template/graph-display.jade
lib/template/graph-edit.jade
www/css/graph-display.styl
www/css/graph.styl

diff --git a/data/graphs/kbye.json b/data/graphs/kbye.json
new file mode 100644 (file)
index 0000000..53ab844
--- /dev/null
@@ -0,0 +1 @@
+{"options":{"animatedZooms":true,"avoidMinZero":false,"axis":null,"axisLabelColor":"#666666","axisLabelFontSize":14,"axisLabelFormatter":null,"axisLabelWidth":50,"axisLineColor":"#AAAAAA","axisLineWidth":0.3,"axisTickSize":3,"colorSaturation":1,"colorValue":0.5,"colors":["#FF0097","#EF8158","#83BB32","#182B53","#4596FF","#553DC9","#AD3238","#00FFBC","#F1D950"],"connectSeparatedPoints":false,"customBars":false,"dateWindow":null,"delimiter":",","digitsAfterDecimal":2,"displayAnnotations":false,"drawPoints":false,"drawXAxis":true,"drawXGrid":true,"drawYAxis":true,"drawYGrid":true,"errorBars":false,"file":null,"fillAlpha":0.15,"fillGraph":false,"fractions":false,"gridLineColor":"#D8D8D8","gridLineWidth":0.3,"hideOverlayOnMouseOut":true,"highlightCircleSize":4,"includeZero":false,"interactionModel":null,"isZoomedIgnoreProgrammaticZoom":false,"labels":null,"labelsDiv":null,"labelsDivStyles":null,"labelsDivWidth":250,"labelsKMB":true,"labelsKMG2":false,"labelsSeparateLines":true,"labelsShowZeroValues":true,"legend":"always","logscale":true,"maxNumberWidth":30,"panEdgeFraction":null,"pixelsPerLabel":null,"pixelsPerXLabel":null,"pixelsPerYLabel":null,"pointSize":1,"rangeSelectorHeight":40,"rangeSelectorPlotFillColor":"#A7B1C4","rangeSelectorPlotStrokeColor":"#808FAB","rightGap":20,"rollPeriod":1,"showLabelsOnHighlight":true,"showRangeSelector":false,"showRoller":false,"sigFigs":null,"sigma":2,"stackedGraph":false,"stepPlot":false,"strokePattern":null,"strokeWidth":3,"ticker":null,"title":null,"titleHeight":18,"valueFormatter":null,"valueRange":null,"visibility":null,"wilsonInterval":true,"xAxisHeight":null,"xAxisLabelFormatter":null,"xAxisLabelWidth":55,"xLabelHeight":18,"xValueFormatter":null,"xValueParser":null,"xlabel":null,"y2label":null,"yAxisLabelFormatter":null,"yAxisLabelWidth":50,"yLabelWidth":18,"yValueFormatter":null,"ylabel":null},"slug":"kbye","name":"kbyeee~","desc":"a gorgeous test-graph.","notes":"","dataset":"/data/datasources/rc/rc_very_active_editors_count.csv","width":"auto","height":456,"chartType":"dygraphs","parents":["root"],"id":"kbye"}
\ No newline at end of file
index 369c198..8519ec4 100644 (file)
@@ -13,8 +13,8 @@ DEBOUNCE_RENDER = exports.DEBOUNCE_RENDER = 100ms
 ChartOptionView = exports.ChartOptionView = FieldView.extend do # {{{
     # __bind__  : <[ onClick ]>
     ctorName  : 'ChartOptionView'
-    tagName   : 'div'
-    className : 'field option'
+    tagName   : 'section'
+    className : 'chart-option field'
     template  : require 'kraken/template/chart-option'
     
     isCollapsed : true
@@ -59,7 +59,7 @@ ChartOptionView = exports.ChartOptionView = FieldView.extend do # {{{
 ChartOptionScaffold = exports.ChartOptionScaffold = Scaffold.extend do # {{{
     ctorName       : 'ChartOptionScaffold'
     tagName        : 'form'
-    className      : 'options scaffold'
+    className      : 'chart-options scaffold'
     template       : require 'kraken/template/chart-scaffold'
     collectionType : ChartOptionList
     subviewType    : ChartOptionView
@@ -83,10 +83,10 @@ ChartOptionScaffold = exports.ChartOptionScaffold = Scaffold.extend do # {{{
         container = if @fields then @$el.find @fields else @$el
         container
             .addClass 'isotope'
-            .find '.field.option' .addClass 'isotope-item'
+            .find '.chart-option.field' .addClass 'isotope-item'
         container.isotope do
             # itemPositionDataEnabled : true
-            itemSelector    : '.field.option'
+            itemSelector    : '.chart-option.field'
             layoutMode      : 'masonry'
             masonry         : columnWidth : 10
             getSortData :
index 33f4bab..af0a2bc 100644 (file)
@@ -34,7 +34,7 @@ GraphEditView = exports.GraphEditView = BaseView.extend do # {{{
     __debounce__: <[ render renderAll ]>
     ctorName  : 'GraphEditView'
     tagName   : 'section'
-    className : 'graph graph-edit'
+    className : 'graph-edit graph'
     template  : require 'kraken/template/graph-edit'
     
     events:
@@ -42,12 +42,12 @@ GraphEditView = exports.GraphEditView = BaseView.extend do # {{{
         'click    .load-button'                    : 'load'
         'click    .save-button'                    : 'save'
         'click    .done-button'                    : 'done'
-        'keypress form.details input[type="text"]' : 'onKeypress'
-        'keypress form.options .value'             : 'onKeypress'
-        'submit   form.details'                    : 'onDetailsSubmit'
-        'change   select'                          : 'onDetailsSubmit'
-        'submit   form.options'                    : 'onOptionsSubmit'
-        'change   input[type="checkbox"]'          : 'onOptionsSubmit'
+        'keypress .graph-details input[type="text"]'     : 'onKeypress'
+        'submit   .graph-details'                        : 'onDetailsSubmit'
+        'change   :not(.chart-options) select'           : 'onDetailsSubmit'
+        'keypress .chart-options .value'                 : 'onKeypress'
+        'submit   .chart-options'                        : 'onOptionsSubmit'
+        'change   .chart-options input[type="checkbox"]' : 'onOptionsSubmit'
     
     data  : {}
     ready : false
@@ -185,7 +185,7 @@ GraphEditView = exports.GraphEditView = BaseView.extend do # {{{
     
     # Repopulate UI from Model
     renderDetails: ->
-        form = @$el.find 'form.details'
+        form = @$el.find 'form.graph-details'
         for k, v in @model.attributes
             continue if k is 'options'
             txt = @model.serialize v
@@ -359,7 +359,7 @@ GraphEditView = exports.GraphEditView = BaseView.extend do # {{{
     onDetailsSubmit: ->
         console.log "#this.onDetailsSubmit!"
         data = _.synthesize do
-            @$el.find('form.details').serializeArray()
+            @$el.find('form.graph-details').serializeArray()
             -> [it.name, it.value]
         @model.set data
         false
index 08695bd..5fc5084 100644 (file)
@@ -8,7 +8,7 @@ include browser-helpers
 - var tags_cls     = tags.map(_.domize('tag')).join(' ')
 
 
-.field.option(id=option_id, class="#{category_cls} #{tags_cls}")
+section.chart-option.field(id=option_id, class="#{category_cls} #{tags_cls}")
     a.close(title="Click to collapse") &times;
     
     h3.shortname(title="Click to collapse") #{name}
index ba4d6a6..476e75b 100644 (file)
@@ -1,3 +1,3 @@
-form.options.scaffold
+form.chart-options.scaffold
     .fields.control-group
 
index 478e601..b552a8a 100644 (file)
@@ -1,6 +1,6 @@
 include browser-helpers
 - var graph_id = view.id
-section.graph.graph-display(id=view.id)
+section.graph-display.graph(id=view.id)
     
     .graph-name-row.page-header.row-fluid
         h2.graph-name 
@@ -17,8 +17,7 @@ section.graph.graph-display(id=view.id)
         .span8
             .graph-permalink 
                 input.span6(value="#{model.toPermalink()}", readonly="readonly")
-
-            //- 
+            
             .graph-notes
                 != jade.filters.markdown(notes)
-
+            
index ba1ae30..0ec5fbc 100644 (file)
@@ -1,6 +1,6 @@
 - var graph_id = view.id || model.id || model.cid
-section.graph.graph-edit(id=graph_id)
-    form.details.form-horizontal
+section.graph-edit.graph(id=graph_id)
+    form.graph-details.form-horizontal
         
         .name-row.row-fluid.control-group
             //- label.name.control-label(for="#{id}_name"): h3 Graph Name
index 29568bd..24fde9c 100644 (file)
@@ -1,7 +1,7 @@
 @import 'colors'
 @import 'nib'
 
-section.graph.graph-display
+section.graph-display.graph
     position relative
     max-width 900px
     margin 0 auto
@@ -87,7 +87,7 @@ section.graph.graph-display
     
     
     /* * * *  Graph Details  * * * {{{ */
-    form.details
+    form.graph-details
         position relative
         
         .name-row
@@ -116,10 +116,10 @@ section.graph.graph-display
     
     
     /* * * *  Chart Options  * * * {{{ */
-    .options fieldset
+    .chart-options fieldset
         border 0px
     
-    .field.option
+    .chart-option.field
         float left
         z-index 3
         padding 0.5em
index 627748c..7420b72 100644 (file)
@@ -86,7 +86,7 @@ section.graph
     
     
     /* * * *  Graph Details  * * * {{{ */
-    form.details
+    .graph-details
         position relative
         
         .name-row
@@ -115,10 +115,10 @@ section.graph
     
     
     /* * * *  Chart Options  * * * {{{ */
-    .options fieldset
+    .chart-options fieldset
         border 0px
     
-    .field.option
+    .chart-option.field
         float left
         z-index 3
         padding 0.5em