id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Template._houston_document_view.helpers({
showSaved: function() {
return Houston._session('show_saved');
},
fields: function() {
var field, fields, i, len, result, value;
fields = Houston._get_fields([this.document], {
exclude_id: true
}... | Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document], exclude_id: true)
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field.name)
result.push(name: "#{field.name} (#{typeof v... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/document_view.coffee | 1 | 40 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document], exclude_id: true)
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field.name)
result.push(name: "#{field.name} (#{typeof v... | for field in $('.houston-field')
field_name = field.name.split(' ')[0]
unless field_name is '_id'
update_dict[field_name] = Houston._convert_to_correct_type(field_name, field.value, @collection)
Houston._call("#{@name}_update",
@document._id, $set: update_dict)
Houston._session('show_s... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/document_view.coffee | 1 | 40 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document], exclude_id: true)
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field.name)
result.push(name: "#{field.name} (#{typeof v... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | d3c3ae922935e2dc560f16f86fc1d18a96d705f8 | 802 | https://github.com/gterrono/houston/blob/d3c3ae922935e2dc560f16f86fc1d18a96d705f8/client/document_view.coffee | 1 | 40 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document], exclude_id: true)
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field... | Template._houston_document_view.helpers({
showSaved: function() {
return Houston._session('show_saved');
},
fields: function() {
var field, fields, i, len, result, value;
fields = Houston._get_fields([this.document], {
exclude_id: true
});
result = [];
for (i = 0, len = fields.length... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | d3c3ae922935e2dc560f16f86fc1d18a96d705f8 | 802 | https://github.com/gterrono/houston/blob/d3c3ae922935e2dc560f16f86fc1d18a96d705f8/client/document_view.coffee | 1 | 40 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Template._houston_document_view.helpers({
showSaved: function() {
return Houston._session('show_saved');
},
fields: function() {
var field, fields, i, len, result, value;
fields = Houston._get_fields([this.document], {
exclude_id: true
}... | Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document], exclude_id: true)
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field.name)
result.push(name: "#{field.name} (#{typeof v... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | d3c3ae922935e2dc560f16f86fc1d18a96d705f8 | 802 | https://github.com/gterrono/houston/blob/d3c3ae922935e2dc560f16f86fc1d18a96d705f8/client/document_view.coffee | 1 | 40 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document], exclude_id: true)
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field.name)
result.push(name: "#{field.name} (#{typeof v... | for field in $('.houston-field')
field_name = field.name.split(' ')[0]
unless field_name is '_id'
update_dict[field_name] = Houston._convert_to_correct_type(field_name, field.value, @collection)
Houston._call("#{@name}_update",
@document._id, $set: update_dict)
Houston._session('show_s... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | d3c3ae922935e2dc560f16f86fc1d18a96d705f8 | 802 | https://github.com/gterrono/houston/blob/d3c3ae922935e2dc560f16f86fc1d18a96d705f8/client/document_view.coffee | 1 | 40 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document])
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field.name)
result.push(name: "#{field.name} (#{typeof value})", name_id: ... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | ab493c6114ebd8a2068d6df0207651a20c21799e | 802 | https://github.com/gterrono/houston/blob/ab493c6114ebd8a2068d6df0207651a20c21799e/client/document_view.coffee | 1 | 41 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document])
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field.name)
resul... | Template._houston_document_view.helpers({
showSaved: function() {
return Houston._session('show_saved');
},
fields: function() {
var field, fields, i, len, result, value;
fields = Houston._get_fields([this.document]);
result = [];
for (i = 0, len = fields.length; i < len; i++) {
field = ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | ab493c6114ebd8a2068d6df0207651a20c21799e | 802 | https://github.com/gterrono/houston/blob/ab493c6114ebd8a2068d6df0207651a20c21799e/client/document_view.coffee | 1 | 41 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Template._houston_document_view.helpers({
showSaved: function() {
return Houston._session('show_saved');
},
fields: function() {
var field, fields, i, len, result, value;
fields = Houston._get_fields([this.document]);
result = [];
for (i =... | Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document])
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field.name)
result.push(name: "#{field.name} (#{typeof value})", name_id: ... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | ab493c6114ebd8a2068d6df0207651a20c21799e | 802 | https://github.com/gterrono/houston/blob/ab493c6114ebd8a2068d6df0207651a20c21799e/client/document_view.coffee | 1 | 41 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
showSaved: -> Houston._session('show_saved')
fields: ->
fields = Houston._get_fields([@document])
result = []
for field in fields
value = Houston._nested_field_lookup(@document, field.name)
result.push(name: "#{field.name} (#{typeof value})", name_id: ... | update_dict = {}
for field in $('.houston-field')
field_name = field.name.split(' ')[0]
unless field_name is '_id'
update_dict[field_name] = Houston._convert_to_correct_type(field_name, field.value, @collection)
Houston._call("#{@name}_update",
@document._id, $set: update_dict)
Hou... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | ab493c6114ebd8a2068d6df0207651a20c21799e | 802 | https://github.com/gterrono/houston/blob/ab493c6114ebd8a2068d6df0207651a20c21799e/client/document_view.coffee | 1 | 41 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
showSaved: -> Houston._session('show_saved')
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collection().findOne _id: new Me... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | a22cf312afd9080cc83a3529fae2f6ee0ed41015 | 802 | https://github.com/gterrono/houston/blob/a22cf312afd9080cc83a3529fae2f6ee0ed41015/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
showSaved: -> Houston._session('show_saved')
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
tr... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
showSaved: function() {
return Houston._session('show_saved');
},
fields: function() {
var document, error, field, fields, i, len, result, value;
document... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | a22cf312afd9080cc83a3529fae2f6ee0ed41015 | 802 | https://github.com/gterrono/houston/blob/a22cf312afd9080cc83a3529fae2f6ee0ed41015/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
showSaved: function() {
return Houston._session('show_saved');
},
fields: function() {
var document, er... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
showSaved: -> Houston._session('show_saved')
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collection().findOne _id: new Me... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | a22cf312afd9080cc83a3529fae2f6ee0ed41015 | 802 | https://github.com/gterrono/houston/blob/a22cf312afd9080cc83a3529fae2f6ee0ed41015/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
showSaved: -> Houston._session('show_saved')
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collection().findOne _id: new Me... | Template._houston_document_view.events
'click #houston-save': (e) ->
e.preventDefault()
update_dict = {}
for field in $('.houston-field')
field_name = field.name.split(' ')[0]
unless field_name is '_id'
update_dict[field_name] = Houston._convert_to_correct_type(field_name, field.value,... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | a22cf312afd9080cc83a3529fae2f6ee0ed41015 | 802 | https://github.com/gterrono/houston/blob/a22cf312afd9080cc83a3529fae2f6ee0ed41015/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 566208c2c8bd6fc97073076974a0c544afa9721a | 802 | https://github.com/gterrono/houston/blob/566208c2c8bd6fc97073076974a0c544afa9721a/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 566208c2c8bd6fc97073076974a0c544afa9721a | 802 | https://github.com/gterrono/houston/blob/566208c2c8bd6fc97073076974a0c544afa9721a/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 566208c2c8bd6fc97073076974a0c544afa9721a | 802 | https://github.com/gterrono/houston/blob/566208c2c8bd6fc97073076974a0c544afa9721a/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | Template._houston_document_view.events
'click #houston-save': (e) ->
e.preventDefault()
update_dict = {}
for field in $('.houston-field')
field_name = field.name.split(' ')[0]
unless field_name is '_id'
update_dict[field_name] = Houston._convert_to_correct_type(field_name, field.value,... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 566208c2c8bd6fc97073076974a0c544afa9721a | 802 | https://github.com/gterrono/houston/blob/566208c2c8bd6fc97073076974a0c544afa9721a/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | @type is 'checkbox'
input_type: ->
{
number: 'number'
string: 'text'
boolean: 'checkbox'
}[@type]
get_collection = -> Houston._get_collection(Houston._session('collection_name'))
Template._houston_document_view.events
'click #houston-save': (e) ->
e.preventDefault()
update_dict =... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:2:raw_corpus | raw_corpus | 'click #houston-delete': (e) ->
e.preventDefault()
id = Houston._session('document_id')
if confirm("Are you sure you want to delete the document with _id #{id}?")
Houston._call("#{Houston._session('collection_name')}_delete", id)
Houston._go 'collection', name: Houston._session('collection_name'... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/document_view.coffee | 51 | 59 | ||
gterrono/houston:client/document_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'click #houston-delete': (e) ->
e.preventDefault()
id = Houston._session('document_id')
if confirm("Are you sure you want to delete the document with _id #{id}?")
Houston._call("#{Houston._session('collection_name')}_delete", id)
Houston._... | ({
'click #houston-delete': function(e) {
var id;
e.preventDefault();
id = Houston._session('document_id');
if (confirm(`Are you sure you want to delete the document with _id ${id}?`)) {
Houston._call(`${Houston._session('collection_name')}_delete`, id);
return Houston._go('collection', {
... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/document_view.coffee | 51 | 59 |
gterrono/houston:client/document_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
'click #houston-delete': function(e) {
var id;
e.preventDefault();
id = Houston._session('document_id');
if (confirm(`Are you sure you want to delete the document with _id ${id}?`)) {
Houston._call(`${Houston._session('collection_name')}_... | 'click #houston-delete': (e) ->
e.preventDefault()
id = Houston._session('document_id')
if confirm("Are you sure you want to delete the document with _id #{id}?")
Houston._call("#{Houston._session('collection_name')}_delete", id)
Houston._go 'collection', name: Houston._session('collection_name'... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/document_view.coffee | 51 | 59 |
gterrono/houston:client/document_view.coffee:2:completion | completion | 'click #houston-delete': (e) ->
e.preventDefault()
id = Houston._session('document_id')
if confirm("Are you sure you want to delete the document with _id #{id}?") | Houston._call("#{Houston._session('collection_name')}_delete", id)
Houston._go 'collection', name: Houston._session('collection_name')
Template._houston_document_view.rendered = ->
$(window).unbind('scroll') | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/document_view.coffee | 51 | 59 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 91d8fb0d012edf4f987be454abbca03630d8e5b1 | 802 | https://github.com/gterrono/houston/blob/91d8fb0d012edf4f987be454abbca03630d8e5b1/client/document_view.coffee | 1 | 49 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 91d8fb0d012edf4f987be454abbca03630d8e5b1 | 802 | https://github.com/gterrono/houston/blob/91d8fb0d012edf4f987be454abbca03630d8e5b1/client/document_view.coffee | 1 | 49 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 91d8fb0d012edf4f987be454abbca03630d8e5b1 | 802 | https://github.com/gterrono/houston/blob/91d8fb0d012edf4f987be454abbca03630d8e5b1/client/document_view.coffee | 1 | 49 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | Template._houston_document_view.events
'click .houston-save': (e) ->
e.preventDefault()
update_dict = {}
for field in $('.houston-field')
field_name = field.name.split(' ')[0]
unless field_name is '_id'
update_dict[field_name] = Houston._convert_to_correct_type(field_name, field.value,... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 91d8fb0d012edf4f987be454abbca03630d8e5b1 | 802 | https://github.com/gterrono/houston/blob/91d8fb0d012edf4f987be454abbca03630d8e5b1/client/document_view.coffee | 1 | 49 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | cbbf311aeeb7dbec68c3b47ae058c641936bce63 | 802 | https://github.com/gterrono/houston/blob/cbbf311aeeb7dbec68c3b47ae058c641936bce63/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | cbbf311aeeb7dbec68c3b47ae058c641936bce63 | 802 | https://github.com/gterrono/houston/blob/cbbf311aeeb7dbec68c3b47ae058c641936bce63/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | cbbf311aeeb7dbec68c3b47ae058c641936bce63 | 802 | https://github.com/gterrono/houston/blob/cbbf311aeeb7dbec68c3b47ae058c641936bce63/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | 'click .houston-save': (e) ->
e.preventDefault()
old_object = get_collection().findOne _id: Houston._session('document_id')
unless old_object
try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Houston._session('document_id'))
catch error
console.log err... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | cbbf311aeeb7dbec68c3b47ae058c641936bce63 | 802 | https://github.com/gterrono/houston/blob/cbbf311aeeb7dbec68c3b47ae058c641936bce63/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:2:raw_corpus | raw_corpus | e.preventDefault()
id = Houston._session('document_id')
if confirm("Are you sure you want to delete the document with _id #{id}?")
Houston._call("#{Houston._session('collection_name')}_delete", id)
Houston._go 'collection', name: Houston._session('collection_name')
Template._houston_document_view.r... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | cbbf311aeeb7dbec68c3b47ae058c641936bce63 | 802 | https://github.com/gterrono/houston/blob/cbbf311aeeb7dbec68c3b47ae058c641936bce63/client/document_view.coffee | 51 | 58 | ||
gterrono/houston:client/document_view.coffee:2:completion | completion | e.preventDefault()
id = Houston._session('document_id')
if confirm("Are you sure you want to delete the document with _id #{id}?")
Houston._call("#{Houston._session('collection_name')}_delete", id) | Houston._go 'collection', name: Houston._session('collection_name')
Template._houston_document_view.rendered = ->
$(window).unbind('scroll') | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | cbbf311aeeb7dbec68c3b47ae058c641936bce63 | 802 | https://github.com/gterrono/houston/blob/cbbf311aeeb7dbec68c3b47ae058c641936bce63/client/document_view.coffee | 51 | 58 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | d3b7ccf5dbd13b2ef5c84220727d4eb62439d2fc | 802 | https://github.com/gterrono/houston/blob/d3b7ccf5dbd13b2ef5c84220727d4eb62439d2fc/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | d3b7ccf5dbd13b2ef5c84220727d4eb62439d2fc | 802 | https://github.com/gterrono/houston/blob/d3b7ccf5dbd13b2ef5c84220727d4eb62439d2fc/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | d3b7ccf5dbd13b2ef5c84220727d4eb62439d2fc | 802 | https://github.com/gterrono/houston/blob/d3b7ccf5dbd13b2ef5c84220727d4eb62439d2fc/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | unless old_object
try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Houston._session('document_id'))
catch error
console.log error
update_dict = {}
for field in $('.houston-field')
unless field.name is '_id'
update_dict[field.name] = if typeo... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | d3b7ccf5dbd13b2ef5c84220727d4eb62439d2fc | 802 | https://github.com/gterrono/houston/blob/d3b7ccf5dbd13b2ef5c84220727d4eb62439d2fc/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 66f4cd87f19211f41a82dd0dfc5c99778f4ef0ed | 802 | https://github.com/gterrono/houston/blob/66f4cd87f19211f41a82dd0dfc5c99778f4ef0ed/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 66f4cd87f19211f41a82dd0dfc5c99778f4ef0ed | 802 | https://github.com/gterrono/houston/blob/66f4cd87f19211f41a82dd0dfc5c99778f4ef0ed/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 66f4cd87f19211f41a82dd0dfc5c99778f4ef0ed | 802 | https://github.com/gterrono/houston/blob/66f4cd87f19211f41a82dd0dfc5c99778f4ef0ed/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | unless old_object
try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Houston._session('document_id'))
catch error
console.log error
update_dict = {}
for field in $('.houston-field')
unless field.name is '_id'
update_dict[field.name] = if typeo... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 66f4cd87f19211f41a82dd0dfc5c99778f4ef0ed | 802 | https://github.com/gterrono/houston/blob/66f4cd87f19211f41a82dd0dfc5c99778f4ef0ed/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 2f5df39aa93e3d2b90a064a980cfc53dc5d55574 | 802 | https://github.com/gterrono/houston/blob/2f5df39aa93e3d2b90a064a980cfc53dc5d55574/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 2f5df39aa93e3d2b90a064a980cfc53dc5d55574 | 802 | https://github.com/gterrono/houston/blob/2f5df39aa93e3d2b90a064a980cfc53dc5d55574/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 2f5df39aa93e3d2b90a064a980cfc53dc5d55574 | 802 | https://github.com/gterrono/houston/blob/2f5df39aa93e3d2b90a064a980cfc53dc5d55574/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Houston._session('document_id'))
catch error
console.log error
update_dict = {}
for field in $('.houston-field')
unless field.name is '_id'
update_dict[field.name] = if typeof(old_object[field.name]... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 2f5df39aa93e3d2b90a064a980cfc53dc5d55574 | 802 | https://github.com/gterrono/houston/blob/2f5df39aa93e3d2b90a064a980cfc53dc5d55574/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | c64d37df458f49f3aec190bdf793fa665473895a | 802 | https://github.com/gterrono/houston/blob/c64d37df458f49f3aec190bdf793fa665473895a/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | c64d37df458f49f3aec190bdf793fa665473895a | 802 | https://github.com/gterrono/houston/blob/c64d37df458f49f3aec190bdf793fa665473895a/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | c64d37df458f49f3aec190bdf793fa665473895a | 802 | https://github.com/gterrono/houston/blob/c64d37df458f49f3aec190bdf793fa665473895a/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Houston._session('document_id'))
catch error
console.log error
update_dict = {}
for field in $('.houston-field')
unless field.name is '_id'
update_dict[field.name] = if typeof(old_object[field.name]... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | c64d37df458f49f3aec190bdf793fa665473895a | 802 | https://github.com/gterrono/houston/blob/c64d37df458f49f3aec190bdf793fa665473895a/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:2:raw_corpus | raw_corpus | Template._houston_document_view.rendered = ->
$('textarea.houston-field').autosize()
$(window).unbind('scroll') | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | c64d37df458f49f3aec190bdf793fa665473895a | 802 | https://github.com/gterrono/houston/blob/c64d37df458f49f3aec190bdf793fa665473895a/client/document_view.coffee | 51 | 54 | ||
gterrono/houston:client/document_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.rendered = ->
$('textarea.houston-field').autosize()
$(window).unbind('scroll')
``` | Template._houston_document_view.rendered = function() {
$('textarea.houston-field').autosize();
return $(window).unbind('scroll');
}; | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | c64d37df458f49f3aec190bdf793fa665473895a | 802 | https://github.com/gterrono/houston/blob/c64d37df458f49f3aec190bdf793fa665473895a/client/document_view.coffee | 51 | 54 |
gterrono/houston:client/document_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Template._houston_document_view.rendered = function() {
$('textarea.houston-field').autosize();
return $(window).unbind('scroll');
};
``` | Template._houston_document_view.rendered = ->
$('textarea.houston-field').autosize()
$(window).unbind('scroll') | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | c64d37df458f49f3aec190bdf793fa665473895a | 802 | https://github.com/gterrono/houston/blob/c64d37df458f49f3aec190bdf793fa665473895a/client/document_view.coffee | 51 | 54 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 3fa4b927aee4e23c39e194ee4e97fadbf627c39c | 802 | https://github.com/gterrono/houston/blob/3fa4b927aee4e23c39e194ee4e97fadbf627c39c/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 3fa4b927aee4e23c39e194ee4e97fadbf627c39c | 802 | https://github.com/gterrono/houston/blob/3fa4b927aee4e23c39e194ee4e97fadbf627c39c/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 3fa4b927aee4e23c39e194ee4e97fadbf627c39c | 802 | https://github.com/gterrono/houston/blob/3fa4b927aee4e23c39e194ee4e97fadbf627c39c/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Houston._session('document_id'))
catch error
console.log error
update_dict = {}
for field in $('.houston-field')
unless field.name is '_id'
update_dict[field.name] = if typeof(old_object[field.name]... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 3fa4b927aee4e23c39e194ee4e97fadbf627c39c | 802 | https://github.com/gterrono/houston/blob/3fa4b927aee4e23c39e194ee4e97fadbf627c39c/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 16ea359dbf8dfec50191fb5cf8c98d6c81120457 | 802 | https://github.com/gterrono/houston/blob/16ea359dbf8dfec50191fb5cf8c98d6c81120457/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 16ea359dbf8dfec50191fb5cf8c98d6c81120457 | 802 | https://github.com/gterrono/houston/blob/16ea359dbf8dfec50191fb5cf8c98d6c81120457/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Houston._session('collection_name');
},
adminHide: function() {
if (Houston._session('should_show')) {
return '';
} else {
return 'hide... | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 16ea359dbf8dfec50191fb5cf8c98d6c81120457 | 802 | https://github.com/gterrono/houston/blob/16ea359dbf8dfec50191fb5cf8c98d6c81120457/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Houston._session('collection_name')
adminHide: -> if Houston._session('should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Houston._session('document_id')
unless document
try
document = get_collecti... | try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Houston._session('document_id'))
catch error
console.log error
update_dict = {}
for field in $('.houston-field')
unless field.name is '_id'
update_dict[field.name] = if typeof(old_object[field.name]... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 16ea359dbf8dfec50191fb5cf8c98d6c81120457 | 802 | https://github.com/gterrono/houston/blob/16ea359dbf8dfec50191fb5cf8c98d6c81120457/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Session.get('_houston_collection_name')
adminHide: -> if Session.get('_houston_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('_houston_document_id')
unless document
try
document = ... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 41054775b787b09d7539867351cc23eb0705b4c8 | 802 | https://github.com/gterrono/houston/blob/41054775b787b09d7539867351cc23eb0705b4c8/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Session.get('_houston_collection_name')
adminHide: -> if Session.get('_houston_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('_houston_docume... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Session.get('_houston_collection_name');
},
adminHide: function() {
if (Session.get('_houston_should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var do... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 41054775b787b09d7539867351cc23eb0705b4c8 | 802 | https://github.com/gterrono/houston/blob/41054775b787b09d7539867351cc23eb0705b4c8/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Session.get('_houston_collection_name');
},
adminHide: function() {
if (Session.get('_houston_should_show')) {
return '';
} else {
retu... | Template._houston_document_view.helpers
collection_name: -> Session.get('_houston_collection_name')
adminHide: -> if Session.get('_houston_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('_houston_document_id')
unless document
try
document = ... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 41054775b787b09d7539867351cc23eb0705b4c8 | 802 | https://github.com/gterrono/houston/blob/41054775b787b09d7539867351cc23eb0705b4c8/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Session.get('_houston_collection_name')
adminHide: -> if Session.get('_houston_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('_houston_document_id')
unless document
try
document = ... | old_object = get_collection().findOne _id: Session.get('_houston_document_id')
unless old_object
try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Session.get('_houston_document_id'))
catch error
console.log error
update_dict = {}
for field in $('.fiel... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 41054775b787b09d7539867351cc23eb0705b4c8 | 802 | https://github.com/gterrono/houston/blob/41054775b787b09d7539867351cc23eb0705b4c8/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:2:raw_corpus | raw_corpus | 'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize');
Template._houston_document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll') | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 41054775b787b09d7539867351cc23eb0705b4c8 | 802 | https://github.com/gterrono/houston/blob/41054775b787b09d7539867351cc23eb0705b4c8/client/document_view.coffee | 51 | 56 | ||
gterrono/houston:client/document_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize');
Template._houston_document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll')
``` | ({
'focus textarea.field': function(e) {
return $(e.target).closest('textarea').trigger('autosize.resize');
}
});
Template._houston_document_view.rendered = function() {
$('textarea.field').autosize();
return $(window).unbind('scroll');
}; | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 41054775b787b09d7539867351cc23eb0705b4c8 | 802 | https://github.com/gterrono/houston/blob/41054775b787b09d7539867351cc23eb0705b4c8/client/document_view.coffee | 51 | 56 |
gterrono/houston:client/document_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
'focus textarea.field': function(e) {
return $(e.target).closest('textarea').trigger('autosize.resize');
}
});
Template._houston_document_view.rendered = function() {
$('textarea.field').autosize();
return $(window).unbind('scroll');
};
``` | 'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize');
Template._houston_document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll') | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 41054775b787b09d7539867351cc23eb0705b4c8 | 802 | https://github.com/gterrono/houston/blob/41054775b787b09d7539867351cc23eb0705b4c8/client/document_view.coffee | 51 | 56 |
gterrono/houston:client/document_view.coffee:2:completion | completion | 'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize'); | Template._houston_document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll') | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 41054775b787b09d7539867351cc23eb0705b4c8 | 802 | https://github.com/gterrono/houston/blob/41054775b787b09d7539867351cc23eb0705b4c8/client/document_view.coffee | 51 | 56 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template._houston_document_view.helpers
collection_name: -> Session.get('_houston_collection_name')
adminHide: -> if Session.get('_houston_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('_houston_document_id')
unless document
try
document = ... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_document_view.helpers
collection_name: -> Session.get('_houston_collection_name')
adminHide: -> if Session.get('_houston_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('_houston_docume... | var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Session.get('_houston_collection_name');
},
adminHide: function() {
if (Session.get('_houston_should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var do... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template._houston_document_view.helpers({
collection_name: function() {
return Session.get('_houston_collection_name');
},
adminHide: function() {
if (Session.get('_houston_should_show')) {
return '';
} else {
retu... | Template._houston_document_view.helpers
collection_name: -> Session.get('_houston_collection_name')
adminHide: -> if Session.get('_houston_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('_houston_document_id')
unless document
try
document = ... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template._houston_document_view.helpers
collection_name: -> Session.get('_houston_collection_name')
adminHide: -> if Session.get('_houston_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('_houston_document_id')
unless document
try
document = ... | old_object = get_collection().findOne _id: Session.get('_houston_document_id')
unless old_object
try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Session.get('_houston_document_id'))
catch error
console.log error
update_dict = {}
for field in $('.fiel... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:2:raw_corpus | raw_corpus | "click a.home": (e) ->
Meteor.go("/houston/")
"click a.collection": (e) ->
Meteor.go("/houston/#{Session.get('_houston_collection_name')}")
'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize');
Template._houston_document_view.rendered = ->
$('textarea.field').auto... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/document_view.coffee | 51 | 60 | ||
gterrono/houston:client/document_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
"click a.home": (e) ->
Meteor.go("/houston/")
"click a.collection": (e) ->
Meteor.go("/houston/#{Session.get('_houston_collection_name')}")
'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize');
Template._houst... | ({
"click a.home": function(e) {
return Meteor.go("/houston/");
},
"click a.collection": function(e) {
return Meteor.go(`/houston/${Session.get('_houston_collection_name')}`);
},
'focus textarea.field': function(e) {
return $(e.target).closest('textarea').trigger('autosize.resize');
}
});
Templ... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/document_view.coffee | 51 | 60 |
gterrono/houston:client/document_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
"click a.home": function(e) {
return Meteor.go("/houston/");
},
"click a.collection": function(e) {
return Meteor.go(`/houston/${Session.get('_houston_collection_name')}`);
},
'focus textarea.field': function(e) {
return $(e.target).closest... | "click a.home": (e) ->
Meteor.go("/houston/")
"click a.collection": (e) ->
Meteor.go("/houston/#{Session.get('_houston_collection_name')}")
'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize');
Template._houston_document_view.rendered = ->
$('textarea.field').auto... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/document_view.coffee | 51 | 60 |
gterrono/houston:client/document_view.coffee:2:completion | completion | "click a.home": (e) ->
Meteor.go("/houston/")
"click a.collection": (e) ->
Meteor.go("/houston/#{Session.get('_houston_collection_name')}")
'focus textarea.field': (e) -> | $(e.target).closest('textarea').trigger('autosize.resize');
Template._houston_document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll') | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/document_view.coffee | 51 | 60 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3 | 802 | https://github.com/gterrono/houston/blob/68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
... | var get_collection;
Template.document_view.helpers({
collection_name: function() {
return Session.get('collection_name');
},
adminHide: function() {
if (Session.get('admin_should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, error, field,... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3 | 802 | https://github.com/gterrono/houston/blob/68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template.document_view.helpers({
collection_name: function() {
return Session.get('collection_name');
},
adminHide: function() {
if (Session.get('admin_should_show')) {
return '';
} else {
return 'hide';
}
},... | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3 | 802 | https://github.com/gterrono/houston/blob/68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | catch error
console.log error
update_dict = {}
for field in $('.field')
unless field.name is '_id'
update_dict[field.name] = if typeof(old_object[field.name]) == 'number'
parseFloat(field.value)
else
field.value
Meteor.call("admin_#{Session.get('collec... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3 | 802 | https://github.com/gterrono/houston/blob/68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:2:raw_corpus | raw_corpus | 'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize')
Template.document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll') | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3 | 802 | https://github.com/gterrono/houston/blob/68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3/client/document_view.coffee | 51 | 56 | ||
gterrono/houston:client/document_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize')
Template.document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll')
``` | ({
'focus textarea.field': function(e) {
return $(e.target).closest('textarea').trigger('autosize.resize');
}
});
Template.document_view.rendered = function() {
$('textarea.field').autosize();
return $(window).unbind('scroll');
}; | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3 | 802 | https://github.com/gterrono/houston/blob/68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3/client/document_view.coffee | 51 | 56 |
gterrono/houston:client/document_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
'focus textarea.field': function(e) {
return $(e.target).closest('textarea').trigger('autosize.resize');
}
});
Template.document_view.rendered = function() {
$('textarea.field').autosize();
return $(window).unbind('scroll');
};
``` | 'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize')
Template.document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll') | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3 | 802 | https://github.com/gterrono/houston/blob/68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3/client/document_view.coffee | 51 | 56 |
gterrono/houston:client/document_view.coffee:2:completion | completion | 'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize') | Template.document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll') | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3 | 802 | https://github.com/gterrono/houston/blob/68a77fa17bc160ef6f2b40d3e7d32a2ddddb9ba3/client/document_view.coffee | 51 | 56 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | d51b8aa98c32c536893d1834cbab489da7b808f1 | 802 | https://github.com/gterrono/houston/blob/d51b8aa98c32c536893d1834cbab489da7b808f1/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
... | var get_collection;
Template.document_view.helpers({
collection_name: function() {
return Session.get('collection_name');
},
adminHide: function() {
if (Session.get('admin_should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, error, field,... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | d51b8aa98c32c536893d1834cbab489da7b808f1 | 802 | https://github.com/gterrono/houston/blob/d51b8aa98c32c536893d1834cbab489da7b808f1/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template.document_view.helpers({
collection_name: function() {
return Session.get('collection_name');
},
adminHide: function() {
if (Session.get('admin_should_show')) {
return '';
} else {
return 'hide';
}
},... | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | d51b8aa98c32c536893d1834cbab489da7b808f1 | 802 | https://github.com/gterrono/houston/blob/d51b8aa98c32c536893d1834cbab489da7b808f1/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | catch error
console.log error
update_dict = {}
for field in $('.field')
unless field.name is '_id'
update_dict[field.name] = if typeof(old_object[field.name]) == 'number'
parseFloat(field.value)
else
field.value
Meteor.call("admin_#{Session.get('collec... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | d51b8aa98c32c536893d1834cbab489da7b808f1 | 802 | https://github.com/gterrono/houston/blob/d51b8aa98c32c536893d1834cbab489da7b808f1/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/document_view.coffee | 1 | 50 | ||
gterrono/houston:client/document_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
... | var get_collection;
Template.document_view.helpers({
collection_name: function() {
return Session.get('collection_name');
},
adminHide: function() {
if (Session.get('admin_should_show')) {
return '';
} else {
return 'hide';
}
},
fields: function() {
var document, error, field,... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection;
Template.document_view.helpers({
collection_name: function() {
return Session.get('collection_name');
},
adminHide: function() {
if (Session.get('admin_should_show')) {
return '';
} else {
return 'hide';
}
},... | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:1:completion | completion | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | old_object = get_collection().findOne _id: Session.get('document_id')
unless old_object
try
old_object = get_collection().findOne _id: new Meteor.Collection.ObjectID(Session.get('document_id'))
catch error
console.log error
update_dict = {}
for field in $('.field')
unless f... | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/document_view.coffee | 1 | 50 |
gterrono/houston:client/document_view.coffee:2:raw_corpus | raw_corpus | "click a.home": (e) ->
Router.go 'home'
"click a.collection": (e) ->
Router.go 'collection', collection: Session.get('collection_name')
'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize')
Template.document_view.rendered = ->
$('textarea.field').autosize()
$(win... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/document_view.coffee | 51 | 60 | ||
gterrono/houston:client/document_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
"click a.home": (e) ->
Router.go 'home'
"click a.collection": (e) ->
Router.go 'collection', collection: Session.get('collection_name')
'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize')
Template.document_vi... | ({
"click a.home": function(e) {
return Router.go('home');
},
"click a.collection": function(e) {
return Router.go('collection', {
collection: Session.get('collection_name')
});
},
'focus textarea.field': function(e) {
return $(e.target).closest('textarea').trigger('autosize.resize');
... | CoffeeScript | JavaScript | gterrono/houston | client/document_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/document_view.coffee | 51 | 60 |
gterrono/houston:client/document_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
"click a.home": function(e) {
return Router.go('home');
},
"click a.collection": function(e) {
return Router.go('collection', {
collection: Session.get('collection_name')
});
},
'focus textarea.field': function(e) {
return $(e.tar... | "click a.home": (e) ->
Router.go 'home'
"click a.collection": (e) ->
Router.go 'collection', collection: Session.get('collection_name')
'focus textarea.field': (e) ->
$(e.target).closest('textarea').trigger('autosize.resize')
Template.document_view.rendered = ->
$('textarea.field').autosize()
$(win... | JavaScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/document_view.coffee | 51 | 60 |
gterrono/houston:client/document_view.coffee:2:completion | completion | "click a.home": (e) ->
Router.go 'home'
"click a.collection": (e) ->
Router.go 'collection', collection: Session.get('collection_name')
'focus textarea.field': (e) -> | $(e.target).closest('textarea').trigger('autosize.resize')
Template.document_view.rendered = ->
$('textarea.field').autosize()
$(window).unbind('scroll') | CoffeeScript | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/document_view.coffee | 51 | 60 |
gterrono/houston:client/document_view.coffee:1:raw_corpus | raw_corpus | Template.document_view.helpers
collection_name: -> Session.get('collection_name')
adminHide: -> if Session.get('admin_should_show') then '' else 'hide'
fields: ->
document = get_collection().findOne _id: Session.get('document_id')
unless document
try
document = get_collection().findOne _id: ... | CoffeeScript | gterrono/houston | client/document_view.coffee | MIT | 7cce4b29f5b59e631855fdc915e97958ec3693b7 | 802 | https://github.com/gterrono/houston/blob/7cce4b29f5b59e631855fdc915e97958ec3693b7/client/document_view.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.