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/collection_view.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection_view_fields;
get_collection_view_fields = function() {
return collection_info().fields || [];
};
Template._houston_collection_view.events({
"click a.home": function(e) {
return Meteor.go("/houston/");
},
"click a.sort": function(e) ... | get_collection_view_fields = -> collection_info().fields or []
Template._houston_collection_view.events
"click a.home": (e) ->
Meteor.go("/houston/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('_houston_sort_key') == this.toString())
Session.set('_houston_sort_order', Sessio... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/collection_view.coffee | 64 | 113 |
gterrono/houston:client/collection_view.coffee:8:completion | completion | get_collection_view_fields = -> collection_info().fields or []
Template._houston_collection_view.events
"click a.home": (e) ->
Meteor.go("/houston/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('_houston_sort_key') == this.toString())
Session.set('_houston_sort_order', Sessio... | $this = $(e.currentTarget)
$this.removeClass('collection-field')
$this.html "<input type='text' value='#{$this.text()}'>"
$this.find('input').select()
$this.find('input').on 'blur', ->
updated_val = $this.find('input').val()
$this.html updated_val
$this.addClass('collection-field')
... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/collection_view.coffee | 64 | 113 |
gterrono/houston:client/collection_view.coffee:9:raw_corpus | raw_corpus | id = $(e.currentTarget).data('id')
Meteor.call "_houston_#{Session.get('_houston_collection_name')}_delete", id
'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
# Unflatten the field na... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/collection_view.coffee | 114 | 140 | ||
gterrono/houston:client/collection_view.coffee:9:completion | completion | id = $(e.currentTarget).data('id')
Meteor.call "_houston_#{Session.get('_houston_collection_name')}_delete", id
'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
# Unflatten the field na... | for key in keys
doc_iter[key] = {} unless doc_iter[key]
doc_iter = doc_iter[key]
doc_iter[final_key] = field.value
field.value = ''
Meteor.call "_houston_#{Session.get('_houston_collection_name')}_insert", new_doc
'click #admin-load-more': (e) ->
Houston._paginated_subscription.... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/collection_view.coffee | 114 | 140 |
gterrono/houston:client/collection_view.coffee:8:raw_corpus | raw_corpus | get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Router.go 'home'
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
else
... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/collection_view.coffee | 65 | 114 | ||
gterrono/houston:client/collection_view.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Router.go 'home'
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('... | var get_collection_view_fields;
get_collection_view_fields = function() {
return collection_info().fields || [];
};
Template.collection_view.events({
"click a.home": function(e) {
return Router.go('home');
},
"click a.sort": function(e) {
e.preventDefault();
if (Session.get('key') === this.toStrin... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/collection_view.coffee | 65 | 114 |
gterrono/houston:client/collection_view.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection_view_fields;
get_collection_view_fields = function() {
return collection_info().fields || [];
};
Template.collection_view.events({
"click a.home": function(e) {
return Router.go('home');
},
"click a.sort": function(e) {
e.preven... | get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Router.go 'home'
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
else
... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/collection_view.coffee | 65 | 114 |
gterrono/houston:client/collection_view.coffee:8:completion | completion | get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Router.go 'home'
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
else
... | $this = $(e.currentTarget)
$this.removeClass('collection-field')
$this.html "<input type='text' value='#{$this.text()}'>"
$this.find('input').select()
$this.find('input').on 'blur', ->
updated_val = $this.find('input').val()
$this.html updated_val
$this.addClass('collection-field')
... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 7b86a3cad0f174c6831402310466a5c189f7ba83 | 802 | https://github.com/gterrono/houston/blob/7b86a3cad0f174c6831402310466a5c189f7ba83/client/collection_view.coffee | 65 | 114 |
gterrono/houston:client/collection_view.coffee:8:raw_corpus | raw_corpus | get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Meteor.Router.to("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 7cce4b29f5b59e631855fdc915e97958ec3693b7 | 802 | https://github.com/gterrono/houston/blob/7cce4b29f5b59e631855fdc915e97958ec3693b7/client/collection_view.coffee | 65 | 114 | ||
gterrono/houston:client/collection_view.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Meteor.Router.to("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Se... | var get_collection_view_fields;
get_collection_view_fields = function() {
return collection_info().fields || [];
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.Router.to("/admin/");
},
"click a.sort": function(e) {
e.preventDefault();
if (Session.get('key') === th... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 7cce4b29f5b59e631855fdc915e97958ec3693b7 | 802 | https://github.com/gterrono/houston/blob/7cce4b29f5b59e631855fdc915e97958ec3693b7/client/collection_view.coffee | 65 | 114 |
gterrono/houston:client/collection_view.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection_view_fields;
get_collection_view_fields = function() {
return collection_info().fields || [];
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.Router.to("/admin/");
},
"click a.sort": function(e) {
... | get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Meteor.Router.to("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 7cce4b29f5b59e631855fdc915e97958ec3693b7 | 802 | https://github.com/gterrono/houston/blob/7cce4b29f5b59e631855fdc915e97958ec3693b7/client/collection_view.coffee | 65 | 114 |
gterrono/houston:client/collection_view.coffee:8:completion | completion | get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Meteor.Router.to("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
... | $this = $(e.currentTarget)
$this.removeClass('collection-field')
$this.html "<input type='text' value='#{$this.text()}'>"
$this.find('input').select()
$this.find('input').on 'blur', ->
updated_val = $this.find('input').val()
$this.html updated_val
$this.addClass('collection-field')
... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 7cce4b29f5b59e631855fdc915e97958ec3693b7 | 802 | https://github.com/gterrono/houston/blob/7cce4b29f5b59e631855fdc915e97958ec3693b7/client/collection_view.coffee | 65 | 114 |
gterrono/houston:client/collection_view.coffee:8:raw_corpus | raw_corpus | get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
e... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 0191c5e36cb38096d9ebbc53ad07954c2dc1e77f | 802 | https://github.com/gterrono/houston/blob/0191c5e36cb38096d9ebbc53ad07954c2dc1e77f/client/collection_view.coffee | 65 | 114 | ||
gterrono/houston:client/collection_view.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.s... | var get_collection_view_fields;
get_collection_view_fields = function() {
return collection_info().fields || [];
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"click a.sort": function(e) {
e.preventDefault();
if (Session.get('key') === this.toSt... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 0191c5e36cb38096d9ebbc53ad07954c2dc1e77f | 802 | https://github.com/gterrono/houston/blob/0191c5e36cb38096d9ebbc53ad07954c2dc1e77f/client/collection_view.coffee | 65 | 114 |
gterrono/houston:client/collection_view.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection_view_fields;
get_collection_view_fields = function() {
return collection_info().fields || [];
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"click a.sort": function(e) {
e.pre... | get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
e... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 0191c5e36cb38096d9ebbc53ad07954c2dc1e77f | 802 | https://github.com/gterrono/houston/blob/0191c5e36cb38096d9ebbc53ad07954c2dc1e77f/client/collection_view.coffee | 65 | 114 |
gterrono/houston:client/collection_view.coffee:8:completion | completion | get_collection_view_fields = -> collection_info().fields or []
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
e... | $this = $(e.currentTarget)
$this.removeClass('collection-field')
$this.html "<input type='text' value='#{$this.text()}'>"
$this.find('input').select()
$this.find('input').on 'blur', ->
updated_val = $this.find('input').val()
$this.html updated_val
$this.addClass('collection-field')
... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 0191c5e36cb38096d9ebbc53ad07954c2dc1e77f | 802 | https://github.com/gterrono/houston/blob/0191c5e36cb38096d9ebbc53ad07954c2dc1e77f/client/collection_view.coffee | 65 | 114 |
gterrono/houston:client/collection_view.coffee:9:raw_corpus | raw_corpus | id = $(e.currentTarget).data('id')
Meteor.call "admin_#{Session.get('collection_name')}_delete", id
'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 0191c5e36cb38096d9ebbc53ad07954c2dc1e77f | 802 | https://github.com/gterrono/houston/blob/0191c5e36cb38096d9ebbc53ad07954c2dc1e77f/client/collection_view.coffee | 115 | 131 | ||
gterrono/houston:client/collection_view.coffee:9:completion | completion | id = $(e.currentTarget).data('id')
Meteor.call "admin_#{Session.get('collection_name')}_delete", id
'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]') | new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc
'click #admin-load-more': (e) ->
window.inspector_subscription.loadNextPage()
'submit form': (e) ->
e.preventDefault() | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 0191c5e36cb38096d9ebbc53ad07954c2dc1e77f | 802 | https://github.com/gterrono/houston/blob/0191c5e36cb38096d9ebbc53ad07954c2dc1e77f/client/collection_view.coffee | 115 | 131 |
gterrono/houston:client/collection_view.coffee:2:raw_corpus | raw_corpus | get_collection_view_fields = -> get_fields(get_current_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get(... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 66bbd1f0419f6033d3b2a73633dc3a249c35d555 | 802 | https://github.com/gterrono/houston/blob/66bbd1f0419f6033d3b2a73633dc3a249c35d555/client/collection_view.coffee | 36 | 85 | ||
gterrono/houston:client/collection_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
get_collection_view_fields = -> get_fields(get_current_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == ... | var get_collection_view_fields;
get_collection_view_fields = function() {
return get_fields(get_current_collection().find({}, {
limit: 50
}).fetch());
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"click a.sort": function(e) {
e.preventDefault... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 66bbd1f0419f6033d3b2a73633dc3a249c35d555 | 802 | https://github.com/gterrono/houston/blob/66bbd1f0419f6033d3b2a73633dc3a249c35d555/client/collection_view.coffee | 36 | 85 |
gterrono/houston:client/collection_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection_view_fields;
get_collection_view_fields = function() {
return get_fields(get_current_collection().find({}, {
limit: 50
}).fetch());
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
... | get_collection_view_fields = -> get_fields(get_current_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get(... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 66bbd1f0419f6033d3b2a73633dc3a249c35d555 | 802 | https://github.com/gterrono/houston/blob/66bbd1f0419f6033d3b2a73633dc3a249c35d555/client/collection_view.coffee | 36 | 85 |
gterrono/houston:client/collection_view.coffee:2:completion | completion | get_collection_view_fields = -> get_fields(get_current_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get(... | $this.find('input').on 'blur', ->
updated_val = $this.find('input').val()
$this.html updated_val
$this.addClass('collection-field')
id = $('td:first-child a', $this.parents('tr')).html()
field_name = $this.data('field')
update_dict = {}
update_dict[field_name] = updated_val
... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 66bbd1f0419f6033d3b2a73633dc3a249c35d555 | 802 | https://github.com/gterrono/houston/blob/66bbd1f0419f6033d3b2a73633dc3a249c35d555/client/collection_view.coffee | 36 | 85 |
gterrono/houston:client/collection_view.coffee:3:raw_corpus | raw_corpus | $create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
# Unflatten the field names (e.g. foods.app -> {foods: {app:}})
keys = field.name.split('.')
final_key = keys.pop()
doc_iter = new_doc
for key in keys
doc_iter[key] = {} u... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 66bbd1f0419f6033d3b2a73633dc3a249c35d555 | 802 | https://github.com/gterrono/houston/blob/66bbd1f0419f6033d3b2a73633dc3a249c35d555/client/collection_view.coffee | 86 | 101 | ||
gterrono/houston:client/collection_view.coffee:3:completion | completion | $create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
# Unflatten the field names (e.g. foods.app -> {foods: {app:}})
keys = field.name.split('.')
final_key = keys.pop()
doc_iter = new_doc | for key in keys
doc_iter[key] = {} unless doc_iter[key]
doc_iter = doc_iter[key]
doc_iter[final_key] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 66bbd1f0419f6033d3b2a73633dc3a249c35d555 | 802 | https://github.com/gterrono/houston/blob/66bbd1f0419f6033d3b2a73633dc3a249c35d555/client/collection_view.coffee | 86 | 101 |
gterrono/houston:client/collection_view.coffee:2:raw_corpus | raw_corpus | get_filter_query = ->
query = {}
fill_query_with_regex = (session_key) ->
return unless Session.get(session_key)?
for key, val of Session.get(session_key)
# From http://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special-characters-using-javascript#answer-9310752
query[k... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 6 | 15 | ||
gterrono/houston:client/collection_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
get_filter_query = ->
query = {}
fill_query_with_regex = (session_key) ->
return unless Session.get(session_key)?
for key, val of Session.get(session_key)
# From http://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special... | var get_filter_query;
get_filter_query = function() {
var fill_query_with_regex, query;
query = {};
fill_query_with_regex = function(session_key) {
var key, ref, results, val;
if (Session.get(session_key) == null) {
return;
}
ref = Session.get(session_key);
results = [];
for (key in... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 6 | 15 |
gterrono/houston:client/collection_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_filter_query;
get_filter_query = function() {
var fill_query_with_regex, query;
query = {};
fill_query_with_regex = function(session_key) {
var key, ref, results, val;
if (Session.get(session_key) == null) {
return;
}
ref = Sess... | get_filter_query = ->
query = {}
fill_query_with_regex = (session_key) ->
return unless Session.get(session_key)?
for key, val of Session.get(session_key)
# From http://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special-characters-using-javascript#answer-9310752
query[k... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 6 | 15 |
gterrono/houston:client/collection_view.coffee:2:completion | completion | get_filter_query = ->
query = {}
fill_query_with_regex = (session_key) ->
return unless Session.get(session_key)?
for key, val of Session.get(session_key) | # From http://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special-characters-using-javascript#answer-9310752
query[key] = $regex: val.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")
fill_query_with_regex('top_selector')
fill_query_with_regex('field_selectors')
return query | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 6 | 15 |
gterrono/houston:client/collection_view.coffee:3:raw_corpus | raw_corpus | resubscribe = ->
COLLECTION_STORAGE = window # TODO find a better global object
subscription_name = "admin_#{Session.get('collection_name')}"
COLLECTION_STORAGE.inspector_subscription.stop()
COLLECTION_STORAGE.inspector_subscription =
Meteor.subscribeWithPagination subscription_name,
get_sort_by(), ge... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 17 | 24 | ||
gterrono/houston:client/collection_view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
resubscribe = ->
COLLECTION_STORAGE = window # TODO find a better global object
subscription_name = "admin_#{Session.get('collection_name')}"
COLLECTION_STORAGE.inspector_subscription.stop()
COLLECTION_STORAGE.inspector_subscription =
Meteor.subscribe... | var resubscribe;
resubscribe = function() {
var COLLECTION_STORAGE, subscription_name;
COLLECTION_STORAGE = window; // TODO find a better global object
subscription_name = `admin_${Session.get('collection_name')}`;
COLLECTION_STORAGE.inspector_subscription.stop();
return COLLECTION_STORAGE.inspector_subscrip... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 17 | 24 |
gterrono/houston:client/collection_view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var resubscribe;
resubscribe = function() {
var COLLECTION_STORAGE, subscription_name;
COLLECTION_STORAGE = window; // TODO find a better global object
subscription_name = `admin_${Session.get('collection_name')}`;
COLLECTION_STORAGE.inspector_subscription... | resubscribe = ->
COLLECTION_STORAGE = window # TODO find a better global object
subscription_name = "admin_#{Session.get('collection_name')}"
COLLECTION_STORAGE.inspector_subscription.stop()
COLLECTION_STORAGE.inspector_subscription =
Meteor.subscribeWithPagination subscription_name,
get_sort_by(), ge... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 17 | 24 |
gterrono/houston:client/collection_view.coffee:3:completion | completion | resubscribe = ->
COLLECTION_STORAGE = window # TODO find a better global object
subscription_name = "admin_#{Session.get('collection_name')}"
COLLECTION_STORAGE.inspector_subscription.stop() | COLLECTION_STORAGE.inspector_subscription =
Meteor.subscribeWithPagination subscription_name,
get_sort_by(), get_filter_query(),
COLLECTION_STORAGE.admin_page_length | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 17 | 24 |
gterrono/houston:client/collection_view.coffee:8:raw_corpus | raw_corpus | id = $(e.currentTarget).data('id')
Meteor.call "admin_#{Session.get('collection_name')}_delete", id
'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 105 | 127 | ||
gterrono/houston:client/collection_view.coffee:8:completion | completion | id = $(e.currentTarget).data('id')
Meteor.call "admin_#{Session.get('collection_name')}_delete", id
'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
... | 'click #admin-load-more': (e) ->
window.inspector_subscription.loadNextPage()
'mousewheel': (e) ->
$win = $(window)
if $win.scrollTop() + 300 > $(document).height() - $win.height() and
window.inspector_subscription.limit() < collection_count()
window.inspector_subscription.loadNextPage()
... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 945b173c1fa363439cedabc4101fc52e22a519e6 | 802 | https://github.com/gterrono/houston/blob/945b173c1fa363439cedabc4101fc52e22a519e6/client/collection_view.coffee | 105 | 127 |
gterrono/houston:client/collection_view.coffee:7:raw_corpus | raw_corpus | get_collection_view_fields = -> collection_info().fields
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
else
... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 3100fa1dc6400b701d528c78a54050b3cc8af877 | 802 | https://github.com/gterrono/houston/blob/3100fa1dc6400b701d528c78a54050b3cc8af877/client/collection_view.coffee | 55 | 104 | ||
gterrono/houston:client/collection_view.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
get_collection_view_fields = -> collection_info().fields
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('so... | var get_collection_view_fields;
get_collection_view_fields = function() {
return collection_info().fields;
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"click a.sort": function(e) {
e.preventDefault();
if (Session.get('key') === this.toString()... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 3100fa1dc6400b701d528c78a54050b3cc8af877 | 802 | https://github.com/gterrono/houston/blob/3100fa1dc6400b701d528c78a54050b3cc8af877/client/collection_view.coffee | 55 | 104 |
gterrono/houston:client/collection_view.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection_view_fields;
get_collection_view_fields = function() {
return collection_info().fields;
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"click a.sort": function(e) {
e.preventDe... | get_collection_view_fields = -> collection_info().fields
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
else
... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 3100fa1dc6400b701d528c78a54050b3cc8af877 | 802 | https://github.com/gterrono/houston/blob/3100fa1dc6400b701d528c78a54050b3cc8af877/client/collection_view.coffee | 55 | 104 |
gterrono/houston:client/collection_view.coffee:7:completion | completion | get_collection_view_fields = -> collection_info().fields
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.toString())
Session.set('sort_order', Session.get('sort_order') * - 1)
else
... | $this = $(e.currentTarget)
$this.removeClass('collection-field')
$this.html "<input type='text' value='#{$this.text()}'>"
$this.find('input').select()
$this.find('input').on 'blur', ->
updated_val = $this.find('input').val()
$this.html updated_val
$this.addClass('collection-field')
... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 3100fa1dc6400b701d528c78a54050b3cc8af877 | 802 | https://github.com/gterrono/houston/blob/3100fa1dc6400b701d528c78a54050b3cc8af877/client/collection_view.coffee | 55 | 104 |
gterrono/houston:client/collection_view.coffee:4:raw_corpus | raw_corpus | collection_count = -> Collections.findOne(name: Session.get('collection_name')).count
Template.collection_view.helpers
headers: -> get_collection_view_fields()
nonid_headers: -> get_collection_view_fields()[1..]
collection_name: -> "#{Session.get('collection_name')}"
document_url: -> "/admin/#{Session.get('col... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 26 | 50 | ||
gterrono/houston:client/collection_view.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
collection_count = -> Collections.findOne(name: Session.get('collection_name')).count
Template.collection_view.helpers
headers: -> get_collection_view_fields()
nonid_headers: -> get_collection_view_fields()[1..]
collection_name: -> "#{Session.get('collecti... | var collection_count;
collection_count = function() {
return Collections.findOne({
name: Session.get('collection_name')
}).count;
};
Template.collection_view.helpers({
headers: function() {
return get_collection_view_fields();
},
nonid_headers: function() {
return get_collection_view_fields().sl... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 26 | 50 |
gterrono/houston:client/collection_view.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var collection_count;
collection_count = function() {
return Collections.findOne({
name: Session.get('collection_name')
}).count;
};
Template.collection_view.helpers({
headers: function() {
return get_collection_view_fields();
},
nonid_headers: ... | collection_count = -> Collections.findOne(name: Session.get('collection_name')).count
Template.collection_view.helpers
headers: -> get_collection_view_fields()
nonid_headers: -> get_collection_view_fields()[1..]
collection_name: -> "#{Session.get('collection_name')}"
document_url: -> "/admin/#{Session.get('col... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 26 | 50 |
gterrono/houston:client/collection_view.coffee:4:completion | completion | collection_count = -> Collections.findOne(name: Session.get('collection_name')).count
Template.collection_view.helpers
headers: -> get_collection_view_fields()
nonid_headers: -> get_collection_view_fields()[1..]
collection_name: -> "#{Session.get('collection_name')}"
document_url: -> "/admin/#{Session.get('col... | get_current_collection()?.find(get_filter_query(), {sort: get_sort_by()}).fetch()
values_in_order: ->
fields_in_order = _.pluck(get_collection_view_fields(), 'name')
names_in_order = _.clone fields_in_order
values = (lookup(@, field_name) for field_name in fields_in_order[1..]) # skip _id
({value, na... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 26 | 50 |
gterrono/houston:client/collection_view.coffee:6:raw_corpus | raw_corpus | get_collection_view_fields = -> get_fields(get_current_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get(... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 53 | 102 | ||
gterrono/houston:client/collection_view.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
get_collection_view_fields = -> get_fields(get_current_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == ... | var get_collection_view_fields;
get_collection_view_fields = function() {
return get_fields(get_current_collection().find({}, {
limit: 50
}).fetch());
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"click a.sort": function(e) {
e.preventDefault... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 53 | 102 |
gterrono/houston:client/collection_view.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection_view_fields;
get_collection_view_fields = function() {
return get_fields(get_current_collection().find({}, {
limit: 50
}).fetch());
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
... | get_collection_view_fields = -> get_fields(get_current_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get(... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 53 | 102 |
gterrono/houston:client/collection_view.coffee:6:completion | completion | get_collection_view_fields = -> get_fields(get_current_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get(... | $this.html "<input type='text' value='#{$this.text()}'>"
$this.find('input').select()
$this.find('input').on 'blur', ->
updated_val = $this.find('input').val()
$this.html updated_val
$this.addClass('collection-field')
id = $('td:first-child a', $this.parents('tr')).html()
field_nam... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 53 | 102 |
gterrono/houston:client/collection_view.coffee:7:raw_corpus | raw_corpus | 'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc
'click #a... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 103 | 119 | ||
gterrono/houston:client/collection_view.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Sess... | ({
'click .admin-create-doc': function(e) {
var $create_row, field, i, len, new_doc, ref;
e.preventDefault();
$create_row = $('#admin-create-row');
new_doc = {};
ref = $create_row.find('input[type="text"]');
for (i = 0, len = ref.length; i < len; i++) {
field = ref[i];
new_doc[fiel... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 103 | 119 |
gterrono/houston:client/collection_view.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
'click .admin-create-doc': function(e) {
var $create_row, field, i, len, new_doc, ref;
e.preventDefault();
$create_row = $('#admin-create-row');
new_doc = {};
ref = $create_row.find('input[type="text"]');
for (i = 0, len = ref.length; i... | 'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc
'click #a... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 103 | 119 |
gterrono/houston:client/collection_view.coffee:7:completion | completion | 'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc | 'click #admin-load-more': (e) ->
window.inspector_subscription.loadNextPage()
'mousewheel': (e) ->
$win = $(window)
if $win.scrollTop() + 300 > $(document).height() - $win.height() and
window.inspector_subscription.limit() < collection_count()
window.inspector_subscription.loadNextPage() | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | a962936d195a609ad2cc573291390e4dda53929b | 802 | https://github.com/gterrono/houston/blob/a962936d195a609ad2cc573291390e4dda53929b/client/collection_view.coffee | 103 | 119 |
gterrono/houston:client/collection_view.coffee:3:raw_corpus | raw_corpus | resubscribe = ->
COLLECTION_STORAGE = window # TODO find a better global object
subscription_name = "admin_#{Session.get('collection_name')}"
COLLECTION_STORAGE.inspector_subscription.stop()
COLLECTION_STORAGE.inspector_subscription =
Meteor.subscribeWithPagination subscription_name,
get_sort_by(), ge... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 37bd8594794d78f9e34e6e5159099d388d86502e | 802 | https://github.com/gterrono/houston/blob/37bd8594794d78f9e34e6e5159099d388d86502e/client/collection_view.coffee | 17 | 48 | ||
gterrono/houston:client/collection_view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
resubscribe = ->
COLLECTION_STORAGE = window # TODO find a better global object
subscription_name = "admin_#{Session.get('collection_name')}"
COLLECTION_STORAGE.inspector_subscription.stop()
COLLECTION_STORAGE.inspector_subscription =
Meteor.subscribe... | var resubscribe;
resubscribe = function() {
var COLLECTION_STORAGE, subscription_name;
COLLECTION_STORAGE = window; // TODO find a better global object
subscription_name = `admin_${Session.get('collection_name')}`;
COLLECTION_STORAGE.inspector_subscription.stop();
return COLLECTION_STORAGE.inspector_subscrip... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 37bd8594794d78f9e34e6e5159099d388d86502e | 802 | https://github.com/gterrono/houston/blob/37bd8594794d78f9e34e6e5159099d388d86502e/client/collection_view.coffee | 17 | 48 |
gterrono/houston:client/collection_view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var resubscribe;
resubscribe = function() {
var COLLECTION_STORAGE, subscription_name;
COLLECTION_STORAGE = window; // TODO find a better global object
subscription_name = `admin_${Session.get('collection_name')}`;
COLLECTION_STORAGE.inspector_subscription... | resubscribe = ->
COLLECTION_STORAGE = window # TODO find a better global object
subscription_name = "admin_#{Session.get('collection_name')}"
COLLECTION_STORAGE.inspector_subscription.stop()
COLLECTION_STORAGE.inspector_subscription =
Meteor.subscribeWithPagination subscription_name,
get_sort_by(), ge... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 37bd8594794d78f9e34e6e5159099d388d86502e | 802 | https://github.com/gterrono/houston/blob/37bd8594794d78f9e34e6e5159099d388d86502e/client/collection_view.coffee | 17 | 48 |
gterrono/houston:client/collection_view.coffee:3:completion | completion | resubscribe = ->
COLLECTION_STORAGE = window # TODO find a better global object
subscription_name = "admin_#{Session.get('collection_name')}"
COLLECTION_STORAGE.inspector_subscription.stop()
COLLECTION_STORAGE.inspector_subscription =
Meteor.subscribeWithPagination subscription_name,
get_sort_by(), ge... | get_current_collection().find().count() or "no"
pluralize: -> 's' unless get_current_collection().find().count() == 1
rows: ->
get_current_collection()?.find(get_filter_query(), {sort: get_sort_by()}).fetch()
values_in_order: ->
fields_in_order = _.pluck(get_collection_view_fields(), 'name')
names_in_... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 37bd8594794d78f9e34e6e5159099d388d86502e | 802 | https://github.com/gterrono/houston/blob/37bd8594794d78f9e34e6e5159099d388d86502e/client/collection_view.coffee | 17 | 48 |
gterrono/houston:client/collection_view.coffee:6:raw_corpus | raw_corpus | 'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc
'click #a... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 37bd8594794d78f9e34e6e5159099d388d86502e | 802 | https://github.com/gterrono/houston/blob/37bd8594794d78f9e34e6e5159099d388d86502e/client/collection_view.coffee | 101 | 111 | ||
gterrono/houston:client/collection_view.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Sess... | ({
'click .admin-create-doc': function(e) {
var $create_row, field, i, len, new_doc, ref;
e.preventDefault();
$create_row = $('#admin-create-row');
new_doc = {};
ref = $create_row.find('input[type="text"]');
for (i = 0, len = ref.length; i < len; i++) {
field = ref[i];
new_doc[fiel... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 37bd8594794d78f9e34e6e5159099d388d86502e | 802 | https://github.com/gterrono/houston/blob/37bd8594794d78f9e34e6e5159099d388d86502e/client/collection_view.coffee | 101 | 111 |
gterrono/houston:client/collection_view.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
'click .admin-create-doc': function(e) {
var $create_row, field, i, len, new_doc, ref;
e.preventDefault();
$create_row = $('#admin-create-row');
new_doc = {};
ref = $create_row.find('input[type="text"]');
for (i = 0, len = ref.length; i... | 'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc
'click #a... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 37bd8594794d78f9e34e6e5159099d388d86502e | 802 | https://github.com/gterrono/houston/blob/37bd8594794d78f9e34e6e5159099d388d86502e/client/collection_view.coffee | 101 | 111 |
gterrono/houston:client/collection_view.coffee:6:completion | completion | 'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]') | new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc
'click #admin-load-more': (e) ->
window.inspector_subscription.loadNextPage() | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 37bd8594794d78f9e34e6e5159099d388d86502e | 802 | https://github.com/gterrono/houston/blob/37bd8594794d78f9e34e6e5159099d388d86502e/client/collection_view.coffee | 101 | 111 |
gterrono/houston:client/collection_view.coffee:3:raw_corpus | raw_corpus | $create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc
'click #admin-load-more': (e) ->
window.inspector_subscription.loa... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | eb1016772c4e7ce8bb8698aad6c7d891e869155c | 802 | https://github.com/gterrono/houston/blob/eb1016772c4e7ce8bb8698aad6c7d891e869155c/client/collection_view.coffee | 86 | 94 | ||
gterrono/houston:client/collection_view.coffee:3:completion | completion | $create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value | field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc
'click #admin-load-more': (e) ->
window.inspector_subscription.loadNextPage() | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | eb1016772c4e7ce8bb8698aad6c7d891e869155c | 802 | https://github.com/gterrono/houston/blob/eb1016772c4e7ce8bb8698aad6c7d891e869155c/client/collection_view.coffee | 86 | 94 |
gterrono/houston:client/collection_view.coffee:3:raw_corpus | raw_corpus | $create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]')
new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | addd34774de8046c1acf403fb4af96b42a09c192 | 802 | https://github.com/gterrono/houston/blob/addd34774de8046c1acf403fb4af96b42a09c192/client/collection_view.coffee | 86 | 91 | ||
gterrono/houston:client/collection_view.coffee:3:completion | completion | $create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('input[type="text"]') | new_doc[field.name] = field.value
field.value = ''
Meteor.call "admin_#{Session.get('collection_name')}_insert", new_doc | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | addd34774de8046c1acf403fb4af96b42a09c192 | 802 | https://github.com/gterrono/houston/blob/addd34774de8046c1acf403fb4af96b42a09c192/client/collection_view.coffee | 86 | 91 |
gterrono/houston:client/collection_view.coffee:2:raw_corpus | raw_corpus | get_collection_view_fields = -> get_fields(get_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get('sort_or... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 244cee76ddaccc6186d1e96eea23f8b99f5efc23 | 802 | https://github.com/gterrono/houston/blob/244cee76ddaccc6186d1e96eea23f8b99f5efc23/client/collection_view.coffee | 35 | 84 | ||
gterrono/houston:client/collection_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
get_collection_view_fields = -> get_fields(get_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.nam... | var get_collection_view_fields;
get_collection_view_fields = function() {
return get_fields(get_collection().find({}, {
limit: 50
}).fetch());
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"click a.sort": function(e) {
e.preventDefault();
... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 244cee76ddaccc6186d1e96eea23f8b99f5efc23 | 802 | https://github.com/gterrono/houston/blob/244cee76ddaccc6186d1e96eea23f8b99f5efc23/client/collection_view.coffee | 35 | 84 |
gterrono/houston:client/collection_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection_view_fields;
get_collection_view_fields = function() {
return get_fields(get_collection().find({}, {
limit: 50
}).fetch());
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"cl... | get_collection_view_fields = -> get_fields(get_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get('sort_or... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 244cee76ddaccc6186d1e96eea23f8b99f5efc23 | 802 | https://github.com/gterrono/houston/blob/244cee76ddaccc6186d1e96eea23f8b99f5efc23/client/collection_view.coffee | 35 | 84 |
gterrono/houston:client/collection_view.coffee:2:completion | completion | get_collection_view_fields = -> get_fields(get_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get('sort_or... | $this.find('input').on 'blur', ->
updated_val = $this.find('input').val()
$this.html updated_val
$this.addClass('collection-field')
id = $('td:first-child a', $this.parents('tr')).html()
field_name = $this.data('field')
update_dict = {}
update_dict[field_name] = updated_val
... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 244cee76ddaccc6186d1e96eea23f8b99f5efc23 | 802 | https://github.com/gterrono/houston/blob/244cee76ddaccc6186d1e96eea23f8b99f5efc23/client/collection_view.coffee | 35 | 84 |
gterrono/houston:client/collection_view.coffee:2:raw_corpus | raw_corpus | get_collection_view_fields = -> get_fields(get_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get('sort_or... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | c9850c13ce13c620d454610ed082e55ddf0eca9c | 802 | https://github.com/gterrono/houston/blob/c9850c13ce13c620d454610ed082e55ddf0eca9c/client/collection_view.coffee | 27 | 76 | ||
gterrono/houston:client/collection_view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
get_collection_view_fields = -> get_fields(get_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.nam... | var get_collection_view_fields;
get_collection_view_fields = function() {
return get_fields(get_collection().find({}, {
limit: 50
}).fetch());
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"click a.sort": function(e) {
e.preventDefault();
... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | c9850c13ce13c620d454610ed082e55ddf0eca9c | 802 | https://github.com/gterrono/houston/blob/c9850c13ce13c620d454610ed082e55ddf0eca9c/client/collection_view.coffee | 27 | 76 |
gterrono/houston:client/collection_view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection_view_fields;
get_collection_view_fields = function() {
return get_fields(get_collection().find({}, {
limit: 50
}).fetch());
};
Template.collection_view.events({
"click a.home": function(e) {
return Meteor.go("/admin/");
},
"cl... | get_collection_view_fields = -> get_fields(get_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get('sort_or... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | c9850c13ce13c620d454610ed082e55ddf0eca9c | 802 | https://github.com/gterrono/houston/blob/c9850c13ce13c620d454610ed082e55ddf0eca9c/client/collection_view.coffee | 27 | 76 |
gterrono/houston:client/collection_view.coffee:2:completion | completion | get_collection_view_fields = -> get_fields(get_collection().find({}, limit: 50).fetch())
Template.collection_view.events
"click a.home": (e) ->
Meteor.go("/admin/")
"click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get('sort_or... | $this.find('input').on 'blur', ->
updated_val = $this.find('input').val()
$this.html updated_val
$this.addClass('collection-field')
id = $('td:first-child a', $this.parents('tr')).html()
field_name = $this.data('field')
update_dict = {}
update_dict[field_name] = updated_val
... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | c9850c13ce13c620d454610ed082e55ddf0eca9c | 802 | https://github.com/gterrono/houston/blob/c9850c13ce13c620d454610ed082e55ddf0eca9c/client/collection_view.coffee | 27 | 76 |
gterrono/houston:client/collection_view.coffee:1:raw_corpus | raw_corpus | Template.collection_view.helpers
headers: -> get_collection_view_fields()
nonid_headers: -> get_collection_view_fields()[1..]
collection_name: -> "#{Session.get('collection_name')}"
document_url: -> "/admin/#{Session.get('collection_name')}/#{@_id}"
document_id: -> @_id + ""
rows: ->
sort_by = {}
so... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 4c3e56e067727181359ec68c6173c33c2cfd89eb | 802 | https://github.com/gterrono/houston/blob/4c3e56e067727181359ec68c6173c33c2cfd89eb/client/collection_view.coffee | 1 | 50 | ||
gterrono/houston:client/collection_view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Template.collection_view.helpers
headers: -> get_collection_view_fields()
nonid_headers: -> get_collection_view_fields()[1..]
collection_name: -> "#{Session.get('collection_name')}"
document_url: -> "/admin/#{Session.get('collection_name')}/#{@_id}"
doc... | var get_collection, get_collection_view_fields;
Template.collection_view.helpers({
headers: function() {
return get_collection_view_fields();
},
nonid_headers: function() {
return get_collection_view_fields().slice(1);
},
collection_name: function() {
return `${Session.get('collection_name')}`;
... | CoffeeScript | JavaScript | gterrono/houston | client/collection_view.coffee | MIT | 4c3e56e067727181359ec68c6173c33c2cfd89eb | 802 | https://github.com/gterrono/houston/blob/4c3e56e067727181359ec68c6173c33c2cfd89eb/client/collection_view.coffee | 1 | 50 |
gterrono/houston:client/collection_view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var get_collection, get_collection_view_fields;
Template.collection_view.helpers({
headers: function() {
return get_collection_view_fields();
},
nonid_headers: function() {
return get_collection_view_fields().slice(1);
},
collection_name: functio... | Template.collection_view.helpers
headers: -> get_collection_view_fields()
nonid_headers: -> get_collection_view_fields()[1..]
collection_name: -> "#{Session.get('collection_name')}"
document_url: -> "/admin/#{Session.get('collection_name')}/#{@_id}"
document_id: -> @_id + ""
rows: ->
sort_by = {}
so... | JavaScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 4c3e56e067727181359ec68c6173c33c2cfd89eb | 802 | https://github.com/gterrono/houston/blob/4c3e56e067727181359ec68c6173c33c2cfd89eb/client/collection_view.coffee | 1 | 50 |
gterrono/houston:client/collection_view.coffee:1:completion | completion | Template.collection_view.helpers
headers: -> get_collection_view_fields()
nonid_headers: -> get_collection_view_fields()[1..]
collection_name: -> "#{Session.get('collection_name')}"
document_url: -> "/admin/#{Session.get('collection_name')}/#{@_id}"
document_id: -> @_id + ""
rows: ->
sort_by = {}
so... | "click a.sort": (e) ->
e.preventDefault()
if (Session.get('key') == this.name)
Session.set('sort_order', Session.get('sort_order') * - 1)
else
Session.set('key', this.name)
Session.set('sort_order', 1)
'keyup #filter_selector': (event) ->
return unless event.keyCode is 13... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 4c3e56e067727181359ec68c6173c33c2cfd89eb | 802 | https://github.com/gterrono/houston/blob/4c3e56e067727181359ec68c6173c33c2cfd89eb/client/collection_view.coffee | 1 | 50 |
gterrono/houston:client/collection_view.coffee:2:raw_corpus | raw_corpus | update_dict = {}
update_dict[field_name] = updated_val
Meteor.call("admin_#{Session.get('collection_name')}_update",
id, $set: update_dict)
'change .column_filter': (event...) ->
field_selectors = {}
$('.column_filter').each (idx, item) ->
if item.value
field_selectors[item.... | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 4c3e56e067727181359ec68c6173c33c2cfd89eb | 802 | https://github.com/gterrono/houston/blob/4c3e56e067727181359ec68c6173c33c2cfd89eb/client/collection_view.coffee | 51 | 75 | ||
gterrono/houston:client/collection_view.coffee:2:completion | completion | update_dict = {}
update_dict[field_name] = updated_val
Meteor.call("admin_#{Session.get('collection_name')}_update",
id, $set: update_dict)
'change .column_filter': (event...) ->
field_selectors = {}
$('.column_filter').each (idx, item) ->
if item.value
field_selectors[item.... | 'click .admin-delete-doc': (e) ->
e.preventDefault()
id = $(e.currentTarget).data('id')
Meteor.call "admin_#{Session.get('collection_name')}_delete", id
'click .admin-create-doc': (e) ->
e.preventDefault()
$create_row = $('#admin-create-row')
new_doc = {}
for field in $create_row.find('in... | CoffeeScript | CoffeeScript | gterrono/houston | client/collection_view.coffee | MIT | 4c3e56e067727181359ec68c6173c33c2cfd89eb | 802 | https://github.com/gterrono/houston/blob/4c3e56e067727181359ec68c6173c33c2cfd89eb/client/collection_view.coffee | 51 | 75 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2018 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2018 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | text = $location.absUrl()
# Override the widget feature of exporting data, since there is no data
$scope.widgetContext.allowExport = false
else
text = _.compile($scope.widget.text, row)
$scope.options = {
text: text
maxSize: _.compile($scope.... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:2:raw_corpus | raw_corpus | # Data Source (re)loaded
$scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
return unless eventData.version > $scope.dataVersion
$scope.dataVersion = eventData.version
$scope.widgetContext.dataSourceError = false
$scope.widgetContext.da... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 45 | 82 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:2:completion | completion | # Data Source (re)loaded
$scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
return unless eventData.version > $scope.dataVersion
$scope.dataVersion = eventData.version
$scope.widgetContext.dataSourceError = false
$scope.widgetContext.da... | $scope.widgetContext.dataSourceError = true
$scope.widgetContext.dataSourceErrorMessage = data.error
$scope.widgetContext.nodata = null
$scope.widgetContext.loading = false
# Data Source loading
$scope.$on 'dataSource:' + dsDefinition.name + ':loading', ->
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 45 | 82 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2016 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2016 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2016 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2016 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2016 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2016 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | text = $location.absUrl()
# Override the widget feature of exporting data, since there is no data
$scope.widgetContext.allowExport = false
else
text = _.compile($scope.widget.text, row)
$scope.options = {
text: text
maxSize: _.compile($scope.... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2016 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2016 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2016 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2016 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2016 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2016 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | # Compiles the QR code options
$scope.compileCode = (row) ->
if $scope.widget.useUrl == true
text = $location.absUrl()
else
text = _.compile($scope.widget.text, row)
$scope.options = {
text: text
maxSize: _.compile($scope.widget.maxSize, row)
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:2:raw_corpus | raw_corpus | # Data Source (re)loaded
$scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
return unless eventData.version > $scope.dataVersion
$scope.dataVersion = eventData.version
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 45 | 83 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Data Source (re)loaded
$scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
return unless eventData.version > $scope.dataVersion
$scope.dataVersion = eventData.version
$scope.dataSourceError ... | // Data Source (re)loaded
$scope.$on('dataSource:' + dsDefinition.name + ':data', function(event, eventData) {
var data;
if (!(eventData.version > $scope.dataVersion)) {
return;
}
$scope.dataVersion = eventData.version;
$scope.dataSourceError = false;
$scope.dataSourceErrorMessage = null;
data = event... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 45 | 83 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Data Source (re)loaded
$scope.$on('dataSource:' + dsDefinition.name + ':data', function(event, eventData) {
var data;
if (!(eventData.version > $scope.dataVersion)) {
return;
}
$scope.dataVersion = eventData.version;
$scope.dataSourceError = false;... | # Data Source (re)loaded
$scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
return unless eventData.version > $scope.dataVersion
$scope.dataVersion = eventData.version
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 45 | 83 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:2:completion | completion | # Data Source (re)loaded
$scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
return unless eventData.version > $scope.dataVersion
$scope.dataVersion = eventData.version
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
... | if _.isEmpty(data) && $scope.widget.noData?
$scope.nodata = _.jsExec($scope.widget.noData)
else
$scope.nodata = null
# Compile QR Code with the first row
$scope.compileCode data[0]
$scope.loading = false
# Data Source err... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 45 | 83 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:3:raw_corpus | raw_corpus | # Initialize the Data Source
$scope.dataSource.init dsDefinition
else if $scope.widget.useUrl == true
$scope.$watch (-> $location.absUrl()), ->
$scope.compileCode {}
else
# Compile QR Code options with no data source
$scope.compileCode {} | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 85 | 93 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee:3:completion | completion | # Initialize the Data Source
$scope.dataSource.init dsDefinition
else if $scope.widget.useUrl == true | $scope.$watch (-> $location.absUrl()), ->
$scope.compileCode {}
else
# Compile QR Code options with no data source
$scope.compileCode {} | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/widgets/qrcode/qrcodeWidget.coffee | 85 | 93 |
jianliaoim/talk-os:talk-api2x/server/schemas/constructors/search-message.coffee:1:raw_corpus | raw_corpus | # Search message schema
{Schema} = require 'mongoose'
_ = require 'lodash'
lexer = require 'talk-lexer'
Promise = require 'bluebird'
util = require '../../util'
module.exports = SearchMessageSchemaConstructor = ->
SearchMessageSchema = new Schema
_creatorId:
type: Schema.Types.ObjectId
es_index: 'no... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/constructors/search-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/constructors/search-message.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-api2x/server/schemas/constructors/search-message.coffee:1:completion | completion | # Search message schema
{Schema} = require 'mongoose'
_ = require 'lodash'
lexer = require 'talk-lexer'
Promise = require 'bluebird'
util = require '../../util'
module.exports = SearchMessageSchemaConstructor = ->
SearchMessageSchema = new Schema
_creatorId:
type: Schema.Types.ObjectId
es_index: 'no... | body:
type: String
set: lexer.stringify
es_term_vector: "with_positions_offsets"
es_analyzer: "ik_max_word"
attachments: [
category:
type: String
es_index: 'not_analyzed'
data:
category:
type: String
es_index: 'not_analyzed'
tit... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/constructors/search-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/constructors/search-message.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLAttribute.coffee:1:raw_corpus | raw_corpus | NodeType = require './NodeType'
XMLNode = require './XMLNode'
# Represents an attribute
module.exports = class XMLAttribute
# Initializes a new instance of `XMLAttribute`
#
# `parent` the parent node
# `name` attribute target
# `value` attribute value
constructor: (@parent, name, value) ->
if @parent... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLAttribute.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLAttribute.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLAttribute.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
NodeType = require './NodeType'
XMLNode = require './XMLNode'
# Represents an attribute
module.exports = class XMLAttribute
# Initializes a new instance of `XMLAttribute`
#
# `parent` the parent node
# `name` attribute target
# `value` attribute valu... | var NodeType, XMLAttribute, XMLNode;
NodeType = require('./NodeType');
XMLNode = require('./XMLNode');
// Represents an attribute
module.exports = XMLAttribute = (function() {
class XMLAttribute {
// Initializes a new instance of `XMLAttribute`
// `parent` the parent node
// `name` attribute target
... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLAttribute.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLAttribute.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.