From: David Schoonover Date: Mon, 16 Jul 2012 21:41:47 +0000 (-0700) Subject: Removes *-main.co files. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=e34e694ff1933348e8f33cf7065f9a69fb925bb3;p=limn.git Removes *-main.co files. --- diff --git a/README.md b/README.md index c7ae1e5..befe80d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,6 @@ You should now have a server running on 8081. - data/graphs/ - saved graph configurations. - lib/ - [Coco][coco] files. Application logic lives here. - lib/{chart,dashboard,dataset,graph}/ - Models and View Classes -- lib/main-*.co - These files get included from the main [Jade][jade] views in www/. They act like client side controllers. They are responsible for setting up data and rendering views. - lib/template/ - client side [Jade][jade] views. These are included and rendered by View classes. - lib/server/ - Server side [Coco][coco] files. - lib/server/server.co - [Express][expressjs] server setup. Routing is done here. diff --git a/src/limn.co b/src/limn.co index b0c7880..84e301d 100644 --- a/src/limn.co +++ b/src/limn.co @@ -57,6 +57,14 @@ LimnApp = limn.LimnApp = Backbone.Router.extend do # {{{ # Helper for setting up models processData: (id, data={}) -> + ### If we got querystring args, apply them as overrides to the data + # loc = String root.location + # if loc.split '?' .1 + # data = _.uncollapseObject _.fromKV that.replace('#', '%23') + # data.parents = JSON.parse that if data.parents + # data.options = _.synthesize do + # data.options or {} + # (v, k) -> [ k, dyglib.parseOption(k,v) ] unless id and _ <[ edit new ]> .contains id data.id = data.slug = id data diff --git a/src/main-dashboard.co b/src/main-dashboard.co deleted file mode 100644 index 74d7b3e..0000000 --- a/src/main-dashboard.co +++ /dev/null @@ -1,37 +0,0 @@ -Seq = require 'seq' -Backbone = require 'backbone' - -{ _, op, -} = require 'limn/util' -{ AppView, -} = require 'limn/app' -{ BaseView, BaseModel, BaseList, -} = require 'limn/base' -{ ChartType, DygraphsChartType, -} = require 'limn/chart' -{ Graph, GraphList, GraphDisplayView, -} = require 'limn/graph' -{ DashboardView, Dashboard, -} = require 'limn/dashboard' - - -root = this - - -# Create the Graph Scaffold -main = -> - # Process URL - loc = String root.location - data = {} - if match = /\/dashboards\/([^\/?]+)/i.exec loc - id = match[1] - data.id = data.slug = id unless _ <[ edit new ]> .contains id - - # Instantiate model & view - root.app = new AppView -> - @model = root.dashboard = new Dashboard data, {+parse} - @view = root.view = new DashboardView {@model} - - -jQuery main - diff --git a/src/main-display.co b/src/main-display.co deleted file mode 100644 index b435b62..0000000 --- a/src/main-display.co +++ /dev/null @@ -1,53 +0,0 @@ -Seq = require 'seq' -Backbone = require 'backbone' - -{ _, op, -} = require 'limn/util' -{ AppView, -} = require 'limn/app' -{ BaseView, BaseModel, BaseList, -} = require 'limn/base' -{ ChartType, DygraphsChartType, -} = require 'limn/chart' -{ Graph, GraphList, GraphDisplayView, -} = require 'limn/graph' - - -root = this -CHART_OPTIONS_SPEC = [] -CHART_DEFAULT_OPTIONS = {} - - -# Create the Graph Scaffold -main = -> - # Bind to URL changes - History.Adapter.bind window, 'statechange', -> - # console.log 'StateChange!\n\n', String(root.location), '\n\n' - - - - # Process URL - loc = String root.location - data = {} - - # If we got querystring args, apply them to the graph - # if loc.split '?' .1 - # data = _.uncollapseObject _.fromKV that.replace('#', '%23') - # data.parents = JSON.parse that if data.parents - # data.options = _.synthesize do - # data.options or {} - # (v, k) -> [ k, dyglib.parseOption(k,v) ] - - # Extract id from URL - if match = /\/graphs\/([^\/?]+)/i.exec loc - id = match[1] - data.id = data.slug = id unless _ <[ edit new ]> .contains id - - # _.dump _.clone(data.options), 'data.options' - - # Instantiate model & view - root.app = new AppView -> - @model = root.graph = new Graph data, {+parse} - @view = root.view = new GraphDisplayView {@model} - -jQuery main diff --git a/src/main-edit.co b/src/main-edit.co deleted file mode 100644 index 6c52fac..0000000 --- a/src/main-edit.co +++ /dev/null @@ -1,53 +0,0 @@ -Seq = require 'seq' -Backbone = require 'backbone' - -{ _, op, -} = require 'limn/util' -{ AppView, -} = require 'limn/app' -{ BaseView, BaseModel, BaseList, -} = require 'limn/base' -{ ChartType, -} = require 'limn/chart' -{ DataSource, DataSourceList, -} = require 'limn/data' -{ Graph, GraphList, GraphEditView, -} = require 'limn/graph' - - -root = this -CHART_OPTIONS_SPEC = [] -CHART_DEFAULT_OPTIONS = {} - -main = -> - # Bind to URL changes - History.Adapter.bind window, 'statechange', -> - # console.log 'StateChange!\n\n', String(root.location), '\n\n' - - - - # Process URL - loc = String root.location - data = {} - - # If we got querystring args, apply them to the graph - # if loc.split '?' .1 - # data = _.uncollapseObject _.fromKV that.replace('#', '%23') - # data.parents = JSON.parse that if data.parents - # data.options = _.synthesize do - # data.options or {} - # (v, k) -> [ k, dyglib.parseOption(k,v) ] - - # Extract id from URL - if match = /\/graphs\/([^\/?]+)/i.exec loc - id = match[1] - data.id = data.slug = id unless _ <[ edit new ]> .contains id - - # _.dump _.clone(data.options), 'data.options' - - # Instantiate app with model & view - root.app = new AppView -> - @model = root.graph = new Graph data, {+parse} - @view = root.view = new GraphEditView {@model} - -jQuery main diff --git a/src/main-graph-list.co b/src/main-graph-list.co deleted file mode 100644 index af32459..0000000 --- a/src/main-graph-list.co +++ /dev/null @@ -1,32 +0,0 @@ -{ _, op, -} = require 'limn/util' -{ BaseView, BaseModel, BaseList, -} = require 'limn/base' -{ Graph, GraphList, GraphListView -} = require 'limn/graph' - -root = do -> this - -# instantiates a new GraphListView with the -# passed in JSON graph_list_data, and then -# appends the rendered view to the DOM. -main = (graph_list_data) -> - # graphs = root.graphs = new GraphList graph_list_data - # view = root.view = new GraphListView { 'collection': graphs } - view = root.view = new GraphListView - graphs = root.graphs = view.collection - $ '#content .inner' .append view.el - -# URL to query for saved graph JSON data. -# graph_list_url = '/graphs.json' -# -# jQuery.ajax do -# url : graph_list_url -# dataType : 'json' -# success : (res) -> -# # result will be the returned JSON -# # data of all of the saved graphs -# jQuery main.bind this, res -# error : (err) -> console.error err - -jQuery main \ No newline at end of file diff --git a/www/dashboard/view.jade b/www/dashboard/view.jade index 05ff780..81044d9 100644 --- a/www/dashboard/view.jade +++ b/www/dashboard/view.jade @@ -13,7 +13,3 @@ append styles mixin css('dashboard.css', media='print') -block main-scripts - script - var limn = require('limn/limn'); - //- script(src="/js/limn/main-dashboard.js?"+version) diff --git a/www/graph/edit.jade b/www/graph/edit.jade index c525a23..d683291 100644 --- a/www/graph/edit.jade +++ b/www/graph/edit.jade @@ -11,7 +11,3 @@ append styles mixin css('isotope.css') -block main-scripts - script - var limn = require('limn/limn'); - //- script(src="/js/limn/main-edit.js?"+version) diff --git a/www/graph/index.jade b/www/graph/index.jade index bc02be3..d633c7a 100644 --- a/www/graph/index.jade +++ b/www/graph/index.jade @@ -3,7 +3,3 @@ extends ../layout block title title Browse Graphs | Limn -block main-scripts - script - var limn = require('limn/limn'); - //- script(src="/js/limn/main-graph-list.js?"+version) diff --git a/www/graph/view.jade b/www/graph/view.jade index 49f2ba4..fbdf369 100644 --- a/www/graph/view.jade +++ b/www/graph/view.jade @@ -6,7 +6,3 @@ block title append styles mixin css('graph-display.css') -block main-scripts - script - var limn = require('limn/limn'); - //- script(src="/js/limn/main-display.js?"+version) diff --git a/www/layout.jade b/www/layout.jade index 9478e86..a307357 100644 --- a/www/layout.jade +++ b/www/layout.jade @@ -131,6 +131,8 @@ html(lang="en", dir="ltr") script(src=src+"?"+version) block page-scripts + script + var limn = require('limn/limn'); block main-scripts block addenda