-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compile coffeescript and sync to _attachments
- Loading branch information
Showing
20 changed files
with
447 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
var deps, factory; | ||
|
||
deps = ['lib/superagent', 'lib/lodash', 'lib/react', 'lib/history', 'lib/today']; | ||
|
||
factory = function(request, _, React, History, today, require) { | ||
var ListComponent, Results, a, button, dd, div, dl, dt, fieldset, form, h1, h2, h3, hr, input, label, legend, p, span, style, table, td, textarea, th, tr, _ref; | ||
_ref = React.DOM, style = _ref.style, button = _ref.button, div = _ref.div, span = _ref.span, a = _ref.a, p = _ref.p, hr = _ref.hr, dl = _ref.dl, dt = _ref.dt, dd = _ref.dd, label = _ref.label, fieldset = _ref.fieldset, legend = _ref.legend, table = _ref.table, tr = _ref.tr, th = _ref.th, td = _ref.td, h1 = _ref.h1, h2 = _ref.h2, h3 = _ref.h3, form = _ref.form, input = _ref.input, textarea = _ref.textarea; | ||
ListComponent = React.createClass({ | ||
displayName: 'ListResults', | ||
getInitialState: function() { | ||
return { | ||
list: this.props.listOfSomeKindOfThing | ||
}; | ||
}, | ||
reload: function(viewparams, e) { | ||
var query, self; | ||
viewparams.include_docs = true; | ||
query = _.pairs(viewparams).map(function(pair) { | ||
return pair.join('='); | ||
}).join('&'); | ||
History.to("/someKindOfThing?" + query); | ||
self = this; | ||
request.get("/_list/standardListOfSomeKindOfThing/someKindOfThing").set('Accept', 'application/json').query(viewparams).end(function(res) { | ||
return self.setState({ | ||
list: res.body | ||
}); | ||
}); | ||
return e.preventDefault(); | ||
}, | ||
render: function() { | ||
return div({}, button({ | ||
onClick: this.reload.bind(this) | ||
}, { | ||
startkey: [2014, null] | ||
}, 'newer results'), button({ | ||
onClick: this.reload.bind(this) | ||
}, { | ||
endkey: [2013, {}] | ||
}, 'older results'), Results({ | ||
results: this.state.list | ||
})); | ||
} | ||
}); | ||
Results = React.createClass({ | ||
displayName: 'Results', | ||
showItem: function(thingid, e) { | ||
return ee.emit('showThing', thingid); | ||
}, | ||
render: function() { | ||
var thing; | ||
return table({}, h1({}, 'things of some kind'), ul({}, (function() { | ||
var _i, _len, _ref2, _results; | ||
_ref2 = this.props.results; | ||
_results = []; | ||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { | ||
thing = _ref2[_i]; | ||
_results.push(li({ | ||
ref: thing._id, | ||
onClick: this.showItem.bind(this, thing._id) | ||
}, thing.value)); | ||
} | ||
return _results; | ||
}).call(this))); | ||
} | ||
}); | ||
return ListComponent; | ||
}; | ||
|
||
if (typeof define === 'function' && define.amd) { | ||
define(deps, factory); | ||
} else if (typeof exports === 'object') { | ||
module.exports = factory.apply(this, deps.map(require)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var deps, factory; | ||
|
||
deps = ['lib/superagent', 'lib/lodash', 'lib/react']; | ||
|
||
factory = function(request, _, React, RadioField) { | ||
var Thing, a, button, dd, div, dl, dt, fieldset, form, h1, h2, h3, hr, input, label, legend, p, span, style, table, td, textarea, th, tr, _ref; | ||
_ref = React.DOM, style = _ref.style, button = _ref.button, div = _ref.div, span = _ref.span, a = _ref.a, p = _ref.p, hr = _ref.hr, dl = _ref.dl, dt = _ref.dt, dd = _ref.dd, label = _ref.label, fieldset = _ref.fieldset, legend = _ref.legend, table = _ref.table, tr = _ref.tr, th = _ref.th, td = _ref.td, h1 = _ref.h1, h2 = _ref.h2, h3 = _ref.h3, form = _ref.form, input = _ref.input, textarea = _ref.textarea; | ||
return Thing = React.createClass({ | ||
getInitialState: function() { | ||
return { | ||
thing: this.props.thing || {} | ||
}; | ||
}, | ||
componentDidMount: function() { | ||
var self; | ||
self = this; | ||
return ee.on('showThing', function(thingid) { | ||
request.get("/_shows/displayThing/" + thingid).set('Accept', 'application/json').end(function(res) { | ||
return self.setState({ | ||
thing: res.body | ||
}); | ||
}); | ||
self.setState({ | ||
thing: thing | ||
}); | ||
return History.to("/thing/" + thing._id); | ||
}); | ||
}, | ||
render: function() { | ||
var thing; | ||
thing = this.state.thing; | ||
if (thing._id) { | ||
return div({}, h2({}, thing.title), dt({}, 'Property'), dd({}, thing.property), dt({}, 'Kind'), dd({}, thing.kind), dt({}, 'Value'), dd({}, thing.value)); | ||
} else { | ||
return div({ | ||
style: 'display: none' | ||
}); | ||
} | ||
} | ||
}); | ||
}; | ||
|
||
if (typeof define === 'function' && define.amd) { | ||
define(deps, factory); | ||
} else if (typeof exports === 'object') { | ||
module.exports = factory.apply(this, deps.map(require)); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
var Despesas, Operacoes, React; | ||
var React, SomeFormOfDisplayOfSomeKindOfThing; | ||
|
||
React = require('lib/react'); | ||
|
||
Operacoes = require('components/Operações'); | ||
|
||
Despesas = require('components/Despesas'); | ||
SomeFormOfDisplayOfSomeKindOfThing = require('components/SomeFormOfDisplayOfSomeKindOfThing'); | ||
|
||
module.exports = function(browsercode, data) { | ||
return "<!DOCTYPE html>\n<html>\n <head>\n <title>Curitiba 942</title>\n <link rel=\"stylesheet\" href=\"/default.css\" type=\"text/css\">\n </head>\n <body>\n\n <div id=\"operacoes\">\n " + (React.renderComponentToString(Operacoes(data.operacoes))) + "\n </div>\n <div id=\"despesas\">\n " + (React.renderComponentToString(Despesas(data.despesas))) + "\n </div>\n\n </body>\n\n <script src=\"//cdnjs.cloudflare.com/ajax/libs/curl/0.7.3/curl/curl.min.js\"></script>\n <script>\n window.data = " + (toJSON(data)) + "\n " + browsercode + "\n </script>\n\n</html>"; | ||
return "<!DOCTYPE html>\n<html>\n <head>\n <title>Curitiba 942</title>\n <link rel=\"stylesheet\" href=\"/default.css\" type=\"text/css\">\n </head>\n <body>\n\n <div id=\"someKindOfThingList\">\n " + (React.renderComponentToString(SomeFormOfDisplayOfSomeKindOfThing(data))) + "\n </div>\n\n </body>\n\n <script src=\"//cdnjs.cloudflare.com/ajax/libs/curl/0.7.3/curl/curl.min.js\"></script>\n <script>\n window.data = " + (toJSON(data)) + "\n " + browsercode + "\n </script>\n\n</html>"; | ||
}; |
Oops, something went wrong.