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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Nedomas/databound:src/godfather.coffee:15:raw_corpus | raw_corpus | Godfather::withComputedProps = (record) ->
if @computed
_.extend record, @computed(record)
else
record | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 526413f35811a6ec0b5caaa579e69536f6de9bd6 | 452 | https://github.com/Nedomas/databound/blob/526413f35811a6ec0b5caaa579e69536f6de9bd6/src/godfather.coffee | 135 | 139 | ||
Nedomas/databound:src/godfather.coffee:15:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::withComputedProps = (record) ->
if @computed
_.extend record, @computed(record)
else
record
``` | Godfather.prototype.withComputedProps = function(record) {
if (this.computed) {
return _.extend(record, this.computed(record));
} else {
return record;
}
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 526413f35811a6ec0b5caaa579e69536f6de9bd6 | 452 | https://github.com/Nedomas/databound/blob/526413f35811a6ec0b5caaa579e69536f6de9bd6/src/godfather.coffee | 135 | 139 |
Nedomas/databound:src/godfather.coffee:15:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.withComputedProps = function(record) {
if (this.computed) {
return _.extend(record, this.computed(record));
} else {
return record;
}
};
``` | Godfather::withComputedProps = (record) ->
if @computed
_.extend record, @computed(record)
else
record | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 526413f35811a6ec0b5caaa579e69536f6de9bd6 | 452 | https://github.com/Nedomas/databound/blob/526413f35811a6ec0b5caaa579e69536f6de9bd6/src/godfather.coffee | 135 | 139 |
Nedomas/databound:src/godfather.coffee:15:completion | completion | Godfather::withComputedProps = (record) ->
if @computed | _.extend record, @computed(record)
else
record | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 526413f35811a6ec0b5caaa579e69536f6de9bd6 | 452 | https://github.com/Nedomas/databound/blob/526413f35811a6ec0b5caaa579e69536f6de9bd6/src/godfather.coffee | 135 | 139 |
Nedomas/databound:src/godfather.coffee:17:raw_corpus | raw_corpus | Godfather::data = (params) ->
scope: JSON.stringify(@scope)
extra_find_scopes: JSON.stringify(@extra_find_scopes)
data: JSON.stringify(params) | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 526413f35811a6ec0b5caaa579e69536f6de9bd6 | 452 | https://github.com/Nedomas/databound/blob/526413f35811a6ec0b5caaa579e69536f6de9bd6/src/godfather.coffee | 144 | 147 | ||
Nedomas/databound:src/godfather.coffee:17:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::data = (params) ->
scope: JSON.stringify(@scope)
extra_find_scopes: JSON.stringify(@extra_find_scopes)
data: JSON.stringify(params)
``` | Godfather.prototype.data = function(params) {
return {
scope: JSON.stringify(this.scope),
extra_find_scopes: JSON.stringify(this.extra_find_scopes),
data: JSON.stringify(params)
};
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 526413f35811a6ec0b5caaa579e69536f6de9bd6 | 452 | https://github.com/Nedomas/databound/blob/526413f35811a6ec0b5caaa579e69536f6de9bd6/src/godfather.coffee | 144 | 147 |
Nedomas/databound:src/godfather.coffee:17:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.data = function(params) {
return {
scope: JSON.stringify(this.scope),
extra_find_scopes: JSON.stringify(this.extra_find_scopes),
data: JSON.stringify(params)
};
};
``` | Godfather::data = (params) ->
scope: JSON.stringify(@scope)
extra_find_scopes: JSON.stringify(@extra_find_scopes)
data: JSON.stringify(params) | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 526413f35811a6ec0b5caaa579e69536f6de9bd6 | 452 | https://github.com/Nedomas/databound/blob/526413f35811a6ec0b5caaa579e69536f6de9bd6/src/godfather.coffee | 144 | 147 |
Nedomas/databound:src/godfather.coffee:17:completion | completion | Godfather::data = (params) ->
scope: JSON.stringify(@scope) | extra_find_scopes: JSON.stringify(@extra_find_scopes)
data: JSON.stringify(params) | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 526413f35811a6ec0b5caaa579e69536f6de9bd6 | 452 | https://github.com/Nedomas/databound/blob/526413f35811a6ec0b5caaa579e69536f6de9bd6/src/godfather.coffee | 144 | 147 |
Nedomas/databound:src/godfather.coffee:14:raw_corpus | raw_corpus | Godfather::requestAndRefresh = (action, params) ->
_this = @
# backend responds with { success: true, id: record.id }
@request(action, params).then (resp) ->
throw new Error 'Error in the backend' unless resp.success
_this.where().then ->
if resp.id
_this.promise _this.take(resp.id)
... | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 9b6d7905a7d007eb0b2257a4b68b825db49b5b76 | 452 | https://github.com/Nedomas/databound/blob/9b6d7905a7d007eb0b2257a4b68b825db49b5b76/src/godfather.coffee | 122 | 133 | ||
Nedomas/databound:src/godfather.coffee:14:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::requestAndRefresh = (action, params) ->
_this = @
# backend responds with { success: true, id: record.id }
@request(action, params).then (resp) ->
throw new Error 'Error in the backend' unless resp.success
_this.where().then ->
if... | Godfather.prototype.requestAndRefresh = function(action, params) {
var _this;
_this = this;
// backend responds with { success: true, id: record.id }
return this.request(action, params).then(function(resp) {
if (!resp.success) {
throw new Error('Error in the backend');
}
return _this.where().t... | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 9b6d7905a7d007eb0b2257a4b68b825db49b5b76 | 452 | https://github.com/Nedomas/databound/blob/9b6d7905a7d007eb0b2257a4b68b825db49b5b76/src/godfather.coffee | 122 | 133 |
Nedomas/databound:src/godfather.coffee:14:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.requestAndRefresh = function(action, params) {
var _this;
_this = this;
// backend responds with { success: true, id: record.id }
return this.request(action, params).then(function(resp) {
if (!resp.success) {
throw new Error('E... | Godfather::requestAndRefresh = (action, params) ->
_this = @
# backend responds with { success: true, id: record.id }
@request(action, params).then (resp) ->
throw new Error 'Error in the backend' unless resp.success
_this.where().then ->
if resp.id
_this.promise _this.take(resp.id)
... | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 9b6d7905a7d007eb0b2257a4b68b825db49b5b76 | 452 | https://github.com/Nedomas/databound/blob/9b6d7905a7d007eb0b2257a4b68b825db49b5b76/src/godfather.coffee | 122 | 133 |
Nedomas/databound:src/godfather.coffee:14:completion | completion | Godfather::requestAndRefresh = (action, params) ->
_this = @
# backend responds with { success: true, id: record.id }
@request(action, params).then (resp) ->
throw new Error 'Error in the backend' unless resp.success | _this.where().then ->
if resp.id
_this.promise _this.take(resp.id)
else
_this.promise resp.success | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 9b6d7905a7d007eb0b2257a4b68b825db49b5b76 | 452 | https://github.com/Nedomas/databound/blob/9b6d7905a7d007eb0b2257a4b68b825db49b5b76/src/godfather.coffee | 122 | 133 |
Nedomas/databound:src/godfather.coffee:14:raw_corpus | raw_corpus | Godfather::requestAndRefresh = (action, params) ->
_this = @
@request(action, params).then (resp) ->
_this.where().then ->
_this.promise resp | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | e971063540b0a40ebfb8342eabb12b800945fa10 | 452 | https://github.com/Nedomas/databound/blob/e971063540b0a40ebfb8342eabb12b800945fa10/src/godfather.coffee | 122 | 127 | ||
Nedomas/databound:src/godfather.coffee:14:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::requestAndRefresh = (action, params) ->
_this = @
@request(action, params).then (resp) ->
_this.where().then ->
_this.promise resp
``` | Godfather.prototype.requestAndRefresh = function(action, params) {
var _this;
_this = this;
return this.request(action, params).then(function(resp) {
return _this.where().then(function() {
return _this.promise(resp);
});
});
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | e971063540b0a40ebfb8342eabb12b800945fa10 | 452 | https://github.com/Nedomas/databound/blob/e971063540b0a40ebfb8342eabb12b800945fa10/src/godfather.coffee | 122 | 127 |
Nedomas/databound:src/godfather.coffee:14:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.requestAndRefresh = function(action, params) {
var _this;
_this = this;
return this.request(action, params).then(function(resp) {
return _this.where().then(function() {
return _this.promise(resp);
});
});
};
``` | Godfather::requestAndRefresh = (action, params) ->
_this = @
@request(action, params).then (resp) ->
_this.where().then ->
_this.promise resp | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | e971063540b0a40ebfb8342eabb12b800945fa10 | 452 | https://github.com/Nedomas/databound/blob/e971063540b0a40ebfb8342eabb12b800945fa10/src/godfather.coffee | 122 | 127 |
Nedomas/databound:src/godfather.coffee:14:completion | completion | Godfather::requestAndRefresh = (action, params) ->
_this = @ | @request(action, params).then (resp) ->
_this.where().then ->
_this.promise resp | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | e971063540b0a40ebfb8342eabb12b800945fa10 | 452 | https://github.com/Nedomas/databound/blob/e971063540b0a40ebfb8342eabb12b800945fa10/src/godfather.coffee | 122 | 127 |
Nedomas/databound:src/godfather.coffee:1:raw_corpus | raw_corpus | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
# todo: rename to extra_where_scopes
@extra_find_scopes = @options.extra_find_scopes or []
@records = []
@seeds = []
@properties = []
return
Godfather.API_URL = ""
# overritable; must be POST | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 1 | 13 | ||
Nedomas/databound:src/godfather.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
# todo: rename to extra_where_scopes
@extra_find_scopes = @options.extra_find_scopes or []
@records = []
@seeds = []
@properties = []
re... | var Godfather;
Godfather = function(endpoint, scope, options) {
this.endpoint = endpoint;
this.scope = scope || {};
this.options = options || {};
// todo: rename to extra_where_scopes
this.extra_find_scopes = this.options.extra_find_scopes || [];
this.records = [];
this.seeds = [];
this.properties = []... | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 1 | 13 |
Nedomas/databound:src/godfather.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Godfather;
Godfather = function(endpoint, scope, options) {
this.endpoint = endpoint;
this.scope = scope || {};
this.options = options || {};
// todo: rename to extra_where_scopes
this.extra_find_scopes = this.options.extra_find_scopes || [];
this.... | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
# todo: rename to extra_where_scopes
@extra_find_scopes = @options.extra_find_scopes or []
@records = []
@seeds = []
@properties = []
return
Godfather.API_URL = ""
# overritable; must be POST | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 1 | 13 |
Nedomas/databound:src/godfather.coffee:1:completion | completion | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
# todo: rename to extra_where_scopes
@extra_find_scopes = @options.extra_find_scopes or [] | @records = []
@seeds = []
@properties = []
return
Godfather.API_URL = ""
# overritable; must be POST | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 1 | 13 |
Nedomas/databound:src/godfather.coffee:2:raw_corpus | raw_corpus | Godfather::request = (action, params) ->
$j.post @url(action), @data(params), 'json'
# overritable | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 14 | 17 | ||
Nedomas/databound:src/godfather.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::request = (action, params) ->
$j.post @url(action), @data(params), 'json'
# overritable
``` | Godfather.prototype.request = function(action, params) {
return $j.post(this.url(action), this.data(params), 'json');
};
// overritable | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 14 | 17 |
Nedomas/databound:src/godfather.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.request = function(action, params) {
return $j.post(this.url(action), this.data(params), 'json');
};
// overritable
``` | Godfather::request = (action, params) ->
$j.post @url(action), @data(params), 'json'
# overritable | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 14 | 17 |
Nedomas/databound:src/godfather.coffee:4:raw_corpus | raw_corpus | Godfather::where = (params) ->
_this = @
@request('where', params).then (records) ->
records = records.concat(_this.seeds)
computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(computed_records, 'id')
... | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 23 | 33 | ||
Nedomas/databound:src/godfather.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::where = (params) ->
_this = @
@request('where', params).then (records) ->
records = records.concat(_this.seeds)
computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[... | Godfather.prototype.where = function(params) {
var _this;
_this = this;
return this.request('where', params).then(function(records) {
var computed_records;
records = records.concat(_this.seeds);
computed_records = _.map(records, function(record) {
return _this.withComputedProps(record);
});
... | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 23 | 33 |
Nedomas/databound:src/godfather.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.where = function(params) {
var _this;
_this = this;
return this.request('where', params).then(function(records) {
var computed_records;
records = records.concat(_this.seeds);
computed_records = _.map(records, function(record) {... | Godfather::where = (params) ->
_this = @
@request('where', params).then (records) ->
records = records.concat(_this.seeds)
computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(computed_records, 'id')
... | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 23 | 33 |
Nedomas/databound:src/godfather.coffee:4:completion | completion | Godfather::where = (params) ->
_this = @
@request('where', params).then (records) ->
records = records.concat(_this.seeds) | computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(computed_records, 'id')
_this.promise _this.records | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 23 | 33 |
Nedomas/databound:src/godfather.coffee:9:raw_corpus | raw_corpus | Godfather::find = (id) ->
_this = @
@where(id: id).then ->
_this.promise _this.take(id) | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 51 | 55 | ||
Nedomas/databound:src/godfather.coffee:9:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::find = (id) ->
_this = @
@where(id: id).then ->
_this.promise _this.take(id)
``` | Godfather.prototype.find = function(id) {
var _this;
_this = this;
return this.where({
id: id
}).then(function() {
return _this.promise(_this.take(id));
});
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 51 | 55 |
Nedomas/databound:src/godfather.coffee:9:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.find = function(id) {
var _this;
_this = this;
return this.where({
id: id
}).then(function() {
return _this.promise(_this.take(id));
});
};
``` | Godfather::find = (id) ->
_this = @
@where(id: id).then ->
_this.promise _this.take(id) | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 51 | 55 |
Nedomas/databound:src/godfather.coffee:9:completion | completion | Godfather::find = (id) ->
_this = @ | @where(id: id).then ->
_this.promise _this.take(id) | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 621e75e81835291428f9dc6731297e0d413d9f42 | 452 | https://github.com/Nedomas/databound/blob/621e75e81835291428f9dc6731297e0d413d9f42/src/godfather.coffee | 51 | 55 |
Nedomas/databound:src/godfather.coffee:1:raw_corpus | raw_corpus | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = []
@seeds = []
@properties = []
return
Godfather.API_URL = ""
# overritable; must be POST | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a3352b7cd5962790c44a07d6c8158cabb284c6b4 | 452 | https://github.com/Nedomas/databound/blob/a3352b7cd5962790c44a07d6c8158cabb284c6b4/src/godfather.coffee | 1 | 12 | ||
Nedomas/databound:src/godfather.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = []
@seeds = []
@properties = []
return
Godfather.API_URL = ""
# overrita... | var Godfather;
Godfather = function(endpoint, scope, options) {
this.endpoint = endpoint;
this.scope = scope || {};
this.options = options || {};
this.extra_find_scopes = this.options.extra_find_scopes || [];
this.records = [];
this.seeds = [];
this.properties = [];
};
Godfather.API_URL = "";
// overri... | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | a3352b7cd5962790c44a07d6c8158cabb284c6b4 | 452 | https://github.com/Nedomas/databound/blob/a3352b7cd5962790c44a07d6c8158cabb284c6b4/src/godfather.coffee | 1 | 12 |
Nedomas/databound:src/godfather.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Godfather;
Godfather = function(endpoint, scope, options) {
this.endpoint = endpoint;
this.scope = scope || {};
this.options = options || {};
this.extra_find_scopes = this.options.extra_find_scopes || [];
this.records = [];
this.seeds = [];
this.... | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = []
@seeds = []
@properties = []
return
Godfather.API_URL = ""
# overritable; must be POST | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a3352b7cd5962790c44a07d6c8158cabb284c6b4 | 452 | https://github.com/Nedomas/databound/blob/a3352b7cd5962790c44a07d6c8158cabb284c6b4/src/godfather.coffee | 1 | 12 |
Nedomas/databound:src/godfather.coffee:1:completion | completion | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = [] | @seeds = []
@properties = []
return
Godfather.API_URL = ""
# overritable; must be POST | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a3352b7cd5962790c44a07d6c8158cabb284c6b4 | 452 | https://github.com/Nedomas/databound/blob/a3352b7cd5962790c44a07d6c8158cabb284c6b4/src/godfather.coffee | 1 | 12 |
Nedomas/databound:src/godfather.coffee:14:raw_corpus | raw_corpus | Godfather::refresh = ->
_this = @
@where().then (resp) ->
_this.records = _.clone(_this.seeds)
_.extend _this.records, resp
_this.promise _this.records | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a3352b7cd5962790c44a07d6c8158cabb284c6b4 | 452 | https://github.com/Nedomas/databound/blob/a3352b7cd5962790c44a07d6c8158cabb284c6b4/src/godfather.coffee | 76 | 82 | ||
Nedomas/databound:src/godfather.coffee:14:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::refresh = ->
_this = @
@where().then (resp) ->
_this.records = _.clone(_this.seeds)
_.extend _this.records, resp
_this.promise _this.records
``` | Godfather.prototype.refresh = function() {
var _this;
_this = this;
return this.where().then(function(resp) {
_this.records = _.clone(_this.seeds);
_.extend(_this.records, resp);
return _this.promise(_this.records);
});
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | a3352b7cd5962790c44a07d6c8158cabb284c6b4 | 452 | https://github.com/Nedomas/databound/blob/a3352b7cd5962790c44a07d6c8158cabb284c6b4/src/godfather.coffee | 76 | 82 |
Nedomas/databound:src/godfather.coffee:14:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.refresh = function() {
var _this;
_this = this;
return this.where().then(function(resp) {
_this.records = _.clone(_this.seeds);
_.extend(_this.records, resp);
return _this.promise(_this.records);
});
};
``` | Godfather::refresh = ->
_this = @
@where().then (resp) ->
_this.records = _.clone(_this.seeds)
_.extend _this.records, resp
_this.promise _this.records | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a3352b7cd5962790c44a07d6c8158cabb284c6b4 | 452 | https://github.com/Nedomas/databound/blob/a3352b7cd5962790c44a07d6c8158cabb284c6b4/src/godfather.coffee | 76 | 82 |
Nedomas/databound:src/godfather.coffee:14:completion | completion | Godfather::refresh = ->
_this = @ | @where().then (resp) ->
_this.records = _.clone(_this.seeds)
_.extend _this.records, resp
_this.promise _this.records | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a3352b7cd5962790c44a07d6c8158cabb284c6b4 | 452 | https://github.com/Nedomas/databound/blob/a3352b7cd5962790c44a07d6c8158cabb284c6b4/src/godfather.coffee | 76 | 82 |
Nedomas/databound:src/godfather.coffee:1:raw_corpus | raw_corpus | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = {}
@seeds = {}
@properties = []
return
Godfather.API_URL = ""
# overritable; must be POST | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 1 | 12 | ||
Nedomas/databound:src/godfather.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = {}
@seeds = {}
@properties = []
return
Godfather.API_URL = ""
# overrita... | var Godfather;
Godfather = function(endpoint, scope, options) {
this.endpoint = endpoint;
this.scope = scope || {};
this.options = options || {};
this.extra_find_scopes = this.options.extra_find_scopes || [];
this.records = {};
this.seeds = {};
this.properties = [];
};
Godfather.API_URL = "";
// overri... | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 1 | 12 |
Nedomas/databound:src/godfather.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Godfather;
Godfather = function(endpoint, scope, options) {
this.endpoint = endpoint;
this.scope = scope || {};
this.options = options || {};
this.extra_find_scopes = this.options.extra_find_scopes || [];
this.records = {};
this.seeds = {};
this.... | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = {}
@seeds = {}
@properties = []
return
Godfather.API_URL = ""
# overritable; must be POST | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 1 | 12 |
Nedomas/databound:src/godfather.coffee:1:completion | completion | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = {} | @seeds = {}
@properties = []
return
Godfather.API_URL = ""
# overritable; must be POST | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 1 | 12 |
Nedomas/databound:src/godfather.coffee:2:raw_corpus | raw_corpus | Godfather::request = (action, params) ->
$j.post @url(action), @data(params)
# overritable | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 13 | 16 | ||
Nedomas/databound:src/godfather.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::request = (action, params) ->
$j.post @url(action), @data(params)
# overritable
``` | Godfather.prototype.request = function(action, params) {
return $j.post(this.url(action), this.data(params));
};
// overritable | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 13 | 16 |
Nedomas/databound:src/godfather.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.request = function(action, params) {
return $j.post(this.url(action), this.data(params));
};
// overritable
``` | Godfather::request = (action, params) ->
$j.post @url(action), @data(params)
# overritable | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 13 | 16 |
Nedomas/databound:src/godfather.coffee:4:raw_corpus | raw_corpus | Godfather::where = (params) ->
_this = this
@request("where", params).then (records) ->
computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(computed_records, 'id')
_this.pristine_records = _.cloneDee... | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 22 | 32 | ||
Nedomas/databound:src/godfather.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::where = (params) ->
_this = this
@request("where", params).then (records) ->
computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(comput... | Godfather.prototype.where = function(params) {
var _this;
_this = this;
return this.request("where", params).then(function(records) {
var computed_records;
computed_records = _.map(records, function(record) {
return _this.withComputedProps(record);
});
_this.properties = _.keys(records[0]);
... | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 22 | 32 |
Nedomas/databound:src/godfather.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.where = function(params) {
var _this;
_this = this;
return this.request("where", params).then(function(records) {
var computed_records;
computed_records = _.map(records, function(record) {
return _this.withComputedProps(recor... | Godfather::where = (params) ->
_this = this
@request("where", params).then (records) ->
computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(computed_records, 'id')
_this.pristine_records = _.cloneDee... | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 22 | 32 |
Nedomas/databound:src/godfather.coffee:4:completion | completion | Godfather::where = (params) ->
_this = this
@request("where", params).then (records) ->
computed_records = _.map(records, (record) -> | _this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(computed_records, 'id')
_this.pristine_records = _.cloneDeep(_this.records)
_this.promise _this.records | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 22 | 32 |
Nedomas/databound:src/godfather.coffee:9:raw_corpus | raw_corpus | Godfather::find = (id) ->
_this = this
@refresh().then ->
_this.promise _this.take(id) | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 46 | 50 | ||
Nedomas/databound:src/godfather.coffee:9:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::find = (id) ->
_this = this
@refresh().then ->
_this.promise _this.take(id)
``` | Godfather.prototype.find = function(id) {
var _this;
_this = this;
return this.refresh().then(function() {
return _this.promise(_this.take(id));
});
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 46 | 50 |
Nedomas/databound:src/godfather.coffee:9:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.find = function(id) {
var _this;
_this = this;
return this.refresh().then(function() {
return _this.promise(_this.take(id));
});
};
``` | Godfather::find = (id) ->
_this = this
@refresh().then ->
_this.promise _this.take(id) | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 46 | 50 |
Nedomas/databound:src/godfather.coffee:9:completion | completion | Godfather::find = (id) ->
_this = this | @refresh().then ->
_this.promise _this.take(id) | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 46 | 50 |
Nedomas/databound:src/godfather.coffee:12:raw_corpus | raw_corpus | Godfather::requestAndRefresh = (action, params) ->
_this = @
@request(action, params).then (resp) ->
_this.refresh().then ->
_this.promise resp | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 60 | 65 | ||
Nedomas/databound:src/godfather.coffee:12:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::requestAndRefresh = (action, params) ->
_this = @
@request(action, params).then (resp) ->
_this.refresh().then ->
_this.promise resp
``` | Godfather.prototype.requestAndRefresh = function(action, params) {
var _this;
_this = this;
return this.request(action, params).then(function(resp) {
return _this.refresh().then(function() {
return _this.promise(resp);
});
});
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 60 | 65 |
Nedomas/databound:src/godfather.coffee:12:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.requestAndRefresh = function(action, params) {
var _this;
_this = this;
return this.request(action, params).then(function(resp) {
return _this.refresh().then(function() {
return _this.promise(resp);
});
});
};
``` | Godfather::requestAndRefresh = (action, params) ->
_this = @
@request(action, params).then (resp) ->
_this.refresh().then ->
_this.promise resp | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 60 | 65 |
Nedomas/databound:src/godfather.coffee:12:completion | completion | Godfather::requestAndRefresh = (action, params) ->
_this = @ | @request(action, params).then (resp) ->
_this.refresh().then ->
_this.promise resp | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 60 | 65 |
Nedomas/databound:src/godfather.coffee:14:raw_corpus | raw_corpus | Godfather::take = (id) ->
_.detect @records, (record) ->
record.id is id | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 75 | 77 | ||
Nedomas/databound:src/godfather.coffee:14:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::take = (id) ->
_.detect @records, (record) ->
record.id is id
``` | Godfather.prototype.take = function(id) {
return _.detect(this.records, function(record) {
return record.id === id;
});
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 75 | 77 |
Nedomas/databound:src/godfather.coffee:14:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.take = function(id) {
return _.detect(this.records, function(record) {
return record.id === id;
});
};
``` | Godfather::take = (id) ->
_.detect @records, (record) ->
record.id is id | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4 | 452 | https://github.com/Nedomas/databound/blob/a717bcfb6ac7f22fac89e725b1f0b4c94df6a7f4/src/godfather.coffee | 75 | 77 |
Nedomas/databound:src/godfather.coffee:1:raw_corpus | raw_corpus | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = {}
@seeds = {}
@properties = []
return
Godfather.API_URL = "" | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 1 | 11 | ||
Nedomas/databound:src/godfather.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = {}
@seeds = {}
@properties = []
return
Godfather.API_URL = ""
``` | var Godfather;
Godfather = function(endpoint, scope, options) {
this.endpoint = endpoint;
this.scope = scope || {};
this.options = options || {};
this.extra_find_scopes = this.options.extra_find_scopes || [];
this.records = {};
this.seeds = {};
this.properties = [];
};
Godfather.API_URL = ""; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 1 | 11 |
Nedomas/databound:src/godfather.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Godfather;
Godfather = function(endpoint, scope, options) {
this.endpoint = endpoint;
this.scope = scope || {};
this.options = options || {};
this.extra_find_scopes = this.options.extra_find_scopes || [];
this.records = {};
this.seeds = {};
this.... | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or []
@records = {}
@seeds = {}
@properties = []
return
Godfather.API_URL = "" | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 1 | 11 |
Nedomas/databound:src/godfather.coffee:1:completion | completion | Godfather = (endpoint, scope, options) ->
@endpoint = endpoint
@scope = scope or {}
@options = options or {}
@extra_find_scopes = @options.extra_find_scopes or [] | @records = {}
@seeds = {}
@properties = []
return
Godfather.API_URL = "" | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 1 | 11 |
Nedomas/databound:src/godfather.coffee:2:raw_corpus | raw_corpus | Godfather::where = (params) ->
_this = this
@request("where", params).then (records) ->
computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(computed_records, "id")
_this.pristine_records = _.cloneDeep... | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 12 | 21 | ||
Nedomas/databound:src/godfather.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::where = (params) ->
_this = this
@request("where", params).then (records) ->
computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(compute... | Godfather.prototype.where = function(params) {
var _this;
_this = this;
return this.request("where", params).then(function(records) {
var computed_records;
computed_records = _.map(records, function(record) {
return _this.withComputedProps(record);
});
_this.properties = _.keys(records[0]);
... | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 12 | 21 |
Nedomas/databound:src/godfather.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.where = function(params) {
var _this;
_this = this;
return this.request("where", params).then(function(records) {
var computed_records;
computed_records = _.map(records, function(record) {
return _this.withComputedProps(recor... | Godfather::where = (params) ->
_this = this
@request("where", params).then (records) ->
computed_records = _.map(records, (record) ->
_this.withComputedProps record
)
_this.properties = _.keys(records[0])
_this.records = _.sortBy(computed_records, "id")
_this.pristine_records = _.cloneDeep... | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 12 | 21 |
Nedomas/databound:src/godfather.coffee:2:completion | completion | Godfather::where = (params) ->
_this = this
@request("where", params).then (records) ->
computed_records = _.map(records, (record) ->
_this.withComputedProps record | )
_this.properties = _.keys(records[0])
_this.records = _.sortBy(computed_records, "id")
_this.pristine_records = _.cloneDeep(_this.records)
_this.promise _this.records | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 12 | 21 |
Nedomas/databound:src/godfather.coffee:3:raw_corpus | raw_corpus | Godfather::syncDiff = (new_records, old_records) ->
_this = this
dirty_records = _.select(new_records, (new_record) ->
record_with_same_id = _.detect(old_records, (old_record) ->
new_record.id is old_record.id
)
JSON.stringify(_.pick(record_with_same_id, _this.properties)) isnt JSON.stringify(_.pi... | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 24 | 36 | ||
Nedomas/databound:src/godfather.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::syncDiff = (new_records, old_records) ->
_this = this
dirty_records = _.select(new_records, (new_record) ->
record_with_same_id = _.detect(old_records, (old_record) ->
new_record.id is old_record.id
)
JSON.stringify(_.pick(record_... | Godfather.prototype.syncDiff = function(new_records, old_records) {
var _this, dirty_records;
_this = this;
dirty_records = _.select(new_records, function(new_record) {
var record_with_same_id;
record_with_same_id = _.detect(old_records, function(old_record) {
return new_record.id === old_record.id;... | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 24 | 36 |
Nedomas/databound:src/godfather.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.syncDiff = function(new_records, old_records) {
var _this, dirty_records;
_this = this;
dirty_records = _.select(new_records, function(new_record) {
var record_with_same_id;
record_with_same_id = _.detect(old_records, function(old_... | Godfather::syncDiff = (new_records, old_records) ->
_this = this
dirty_records = _.select(new_records, (new_record) ->
record_with_same_id = _.detect(old_records, (old_record) ->
new_record.id is old_record.id
)
JSON.stringify(_.pick(record_with_same_id, _this.properties)) isnt JSON.stringify(_.pi... | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 24 | 36 |
Nedomas/databound:src/godfather.coffee:3:completion | completion | Godfather::syncDiff = (new_records, old_records) ->
_this = this
dirty_records = _.select(new_records, (new_record) ->
record_with_same_id = _.detect(old_records, (old_record) ->
new_record.id is old_record.id
) | JSON.stringify(_.pick(record_with_same_id, _this.properties)) isnt JSON.stringify(_.pick(new_record, _this.properties))
)
_.each dirty_records, (record) ->
_this.update record
return
return | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 24 | 36 |
Nedomas/databound:src/godfather.coffee:10:raw_corpus | raw_corpus | Godfather::data = (params) ->
scope: JSON.stringify(@scope)
extra_find_scopes: JSON.stringify(@extra_find_scopes)
data: JSON.stringify(params)
# overritable; must be POST | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 59 | 65 | ||
Nedomas/databound:src/godfather.coffee:10:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::data = (params) ->
scope: JSON.stringify(@scope)
extra_find_scopes: JSON.stringify(@extra_find_scopes)
data: JSON.stringify(params)
# overritable; must be POST
``` | Godfather.prototype.data = function(params) {
return {
scope: JSON.stringify(this.scope),
extra_find_scopes: JSON.stringify(this.extra_find_scopes),
data: JSON.stringify(params)
};
};
// overritable; must be POST | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 59 | 65 |
Nedomas/databound:src/godfather.coffee:10:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.data = function(params) {
return {
scope: JSON.stringify(this.scope),
extra_find_scopes: JSON.stringify(this.extra_find_scopes),
data: JSON.stringify(params)
};
};
// overritable; must be POST
``` | Godfather::data = (params) ->
scope: JSON.stringify(@scope)
extra_find_scopes: JSON.stringify(@extra_find_scopes)
data: JSON.stringify(params)
# overritable; must be POST | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 59 | 65 |
Nedomas/databound:src/godfather.coffee:10:completion | completion | Godfather::data = (params) ->
scope: JSON.stringify(@scope)
extra_find_scopes: JSON.stringify(@extra_find_scopes) | data: JSON.stringify(params)
# overritable; must be POST | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 59 | 65 |
Nedomas/databound:src/godfather.coffee:12:raw_corpus | raw_corpus | Godfather::requestAndRefresh = (action, params) ->
_this = this
@request(action, params).then (resp) ->
_this.refresh().then ->
_this.promise resp | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 69 | 73 | ||
Nedomas/databound:src/godfather.coffee:12:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::requestAndRefresh = (action, params) ->
_this = this
@request(action, params).then (resp) ->
_this.refresh().then ->
_this.promise resp
``` | Godfather.prototype.requestAndRefresh = function(action, params) {
var _this;
_this = this;
return this.request(action, params).then(function(resp) {
return _this.refresh().then(function() {
return _this.promise(resp);
});
});
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 69 | 73 |
Nedomas/databound:src/godfather.coffee:12:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.requestAndRefresh = function(action, params) {
var _this;
_this = this;
return this.request(action, params).then(function(resp) {
return _this.refresh().then(function() {
return _this.promise(resp);
});
});
};
``` | Godfather::requestAndRefresh = (action, params) ->
_this = this
@request(action, params).then (resp) ->
_this.refresh().then ->
_this.promise resp | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 69 | 73 |
Nedomas/databound:src/godfather.coffee:12:completion | completion | Godfather::requestAndRefresh = (action, params) ->
_this = this | @request(action, params).then (resp) ->
_this.refresh().then ->
_this.promise resp | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 69 | 73 |
Nedomas/databound:src/godfather.coffee:13:raw_corpus | raw_corpus | Godfather::refresh = ->
_this = this
@where().then (resp) ->
_this.records = _.clone(_this.seeds)
_.extend _this.records, resp
_this.promise _this.records | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 77 | 82 | ||
Nedomas/databound:src/godfather.coffee:13:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::refresh = ->
_this = this
@where().then (resp) ->
_this.records = _.clone(_this.seeds)
_.extend _this.records, resp
_this.promise _this.records
``` | Godfather.prototype.refresh = function() {
var _this;
_this = this;
return this.where().then(function(resp) {
_this.records = _.clone(_this.seeds);
_.extend(_this.records, resp);
return _this.promise(_this.records);
});
}; | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 77 | 82 |
Nedomas/databound:src/godfather.coffee:13:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.refresh = function() {
var _this;
_this = this;
return this.where().then(function(resp) {
_this.records = _.clone(_this.seeds);
_.extend(_this.records, resp);
return _this.promise(_this.records);
});
};
``` | Godfather::refresh = ->
_this = this
@where().then (resp) ->
_this.records = _.clone(_this.seeds)
_.extend _this.records, resp
_this.promise _this.records | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 77 | 82 |
Nedomas/databound:src/godfather.coffee:13:completion | completion | Godfather::refresh = ->
_this = this
@where().then (resp) -> | _this.records = _.clone(_this.seeds)
_.extend _this.records, resp
_this.promise _this.records | CoffeeScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 77 | 82 |
Nedomas/databound:src/godfather.coffee:16:raw_corpus | raw_corpus | Godfather::injectSeedRecords = (records) ->
@seeds = records
return
# overritable | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 93 | 98 | ||
Nedomas/databound:src/godfather.coffee:16:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Godfather::injectSeedRecords = (records) ->
@seeds = records
return
# overritable
``` | Godfather.prototype.injectSeedRecords = function(records) {
this.seeds = records;
};
// overritable | CoffeeScript | JavaScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 93 | 98 |
Nedomas/databound:src/godfather.coffee:16:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Godfather.prototype.injectSeedRecords = function(records) {
this.seeds = records;
};
// overritable
``` | Godfather::injectSeedRecords = (records) ->
@seeds = records
return
# overritable | JavaScript | CoffeeScript | Nedomas/databound | src/godfather.coffee | MIT | 29af8d582e27a7ff71c0d38463073104e9cd4177 | 452 | https://github.com/Nedomas/databound/blob/29af8d582e27a7ff71c0d38463073104e9cd4177/src/godfather.coffee | 93 | 98 |
jianliaoim/talk-os:talk-account/client/app/succeed-binding.coffee:1:raw_corpus | raw_corpus | React = require 'react'
Immutable = require 'immutable'
detect = require '../util/detect'
locales = require '../locales'
controllers = require '../controllers'
Space = React.createFactory require 'react-lite-space'
{div, input, span, a} = React.DOM
# without window.opener, JavaScript is not able to close a window
i... | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/succeed-binding.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/succeed-binding.coffee | 1 | 39 | ||
jianliaoim/talk-os:talk-account/client/app/succeed-binding.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
Immutable = require 'immutable'
detect = require '../util/detect'
locales = require '../locales'
controllers = require '../controllers'
Space = React.createFactory require 'react-lite-space'
{div, input, span, a} = React.DOM
# without ... | var Immutable, React, Space, a, controllers, detect, div, input, isThereAnOpener, locales, span;
React = require('react');
Immutable = require('immutable');
detect = require('../util/detect');
locales = require('../locales');
controllers = require('../controllers');
Space = React.createFactory(require('react-lite... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/client/app/succeed-binding.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/succeed-binding.coffee | 1 | 39 |
jianliaoim/talk-os:talk-account/client/app/succeed-binding.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, React, Space, a, controllers, detect, div, input, isThereAnOpener, locales, span;
React = require('react');
Immutable = require('immutable');
detect = require('../util/detect');
locales = require('../locales');
controllers = require('../controll... | React = require 'react'
Immutable = require 'immutable'
detect = require '../util/detect'
locales = require '../locales'
controllers = require '../controllers'
Space = React.createFactory require 'react-lite-space'
{div, input, span, a} = React.DOM
# without window.opener, JavaScript is not able to close a window
i... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/succeed-binding.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/succeed-binding.coffee | 1 | 39 |
jianliaoim/talk-os:talk-account/client/app/succeed-binding.coffee:1:completion | completion | React = require 'react'
Immutable = require 'immutable'
detect = require '../util/detect'
locales = require '../locales'
controllers = require '../controllers'
Space = React.createFactory require 'react-lite-space'
{div, input, span, a} = React.DOM
# without window.opener, JavaScript is not able to close a window
i... | propTypes:
store: React.PropTypes.instanceOf(Immutable.Map).isRequired
getAccount: ->
@props.store.getIn(['client', 'account'])
getLanguage: ->
@props.store.getIn(['client', 'language'])
render: ->
guideText = switch
when isThereAnOpener
locales.get('boundAndClosing', @getLanguage... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/succeed-binding.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/succeed-binding.coffee | 1 | 39 |
jnordberg/wintersmith:src/plugins/markdown-page.coffee:3:raw_corpus | raw_corpus | parseMarkdownSync = (content, baseUrl) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content
for token in tokens
switch token.type
when 'code'
try
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown-page.coffee | MIT | 8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5/src/plugins/markdown-page.coffee | 18 | 38 | ||
jnordberg/wintersmith:src/plugins/markdown-page.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseMarkdownSync = (content, baseUrl) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content
for token in tok... | var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl) {
var error, i, len, token, tokens;
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return url.resolve(baseUrl, uri);
};
tokens = marked.lexer(... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown-page.coffee | MIT | 8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5/src/plugins/markdown-page.coffee | 18 | 38 |
jnordberg/wintersmith:src/plugins/markdown-page.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl) {
var error, i, len, token, tokens;
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return u... | parseMarkdownSync = (content, baseUrl) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content
for token in tokens
switch token.type
when 'code'
try
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown-page.coffee | MIT | 8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5/src/plugins/markdown-page.coffee | 18 | 38 |
jnordberg/wintersmith:src/plugins/markdown-page.coffee:3:completion | completion | parseMarkdownSync = (content, baseUrl) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content
for token in tokens
switch token.type | when 'code'
try
if token.lang?
token.text = hljs.highlight(token.lang, token.text).value
else
token.text = hljs.highlightAuto(token.text).value
token.escaped = true
catch error
# hljs.highlight fails if lang is unknown
return marked.pars... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown-page.coffee | MIT | 8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5/src/plugins/markdown-page.coffee | 18 | 38 |
jnordberg/wintersmith:src/plugins/markdown-page.coffee:4:raw_corpus | raw_corpus | class MarkdownPage extends Page
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base) ->
### parse @markdown and return html. also resolves any relative urls to absolute ones ###
@_html ?= parseMarkdownSync @_content, @getLocation(base) # cache html
retu... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown-page.coffee | MIT | 8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5/src/plugins/markdown-page.coffee | 40 | 49 | ||
jnordberg/wintersmith:src/plugins/markdown-page.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class MarkdownPage extends Page
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base) ->
### parse @markdown and return html. also resolves any relative urls to absolute ones ###
@_html ?= parseMarkdow... | var MarkdownPage;
MarkdownPage = class MarkdownPage extends Page {
getLocation(base) {
var uri;
uri = this.getUrl(base);
return uri.slice(0, +(uri.lastIndexOf('/')) + 1 || 9e9);
}
getHtml(base) {
/* parse @markdown and return html. also resolves any relative urls to absolute ones */
if (this... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown-page.coffee | MIT | 8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5/src/plugins/markdown-page.coffee | 40 | 49 |
jnordberg/wintersmith:src/plugins/markdown-page.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MarkdownPage;
MarkdownPage = class MarkdownPage extends Page {
getLocation(base) {
var uri;
uri = this.getUrl(base);
return uri.slice(0, +(uri.lastIndexOf('/')) + 1 || 9e9);
}
getHtml(base) {
/* parse @markdown and return html. also reso... | class MarkdownPage extends Page
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base) ->
### parse @markdown and return html. also resolves any relative urls to absolute ones ###
@_html ?= parseMarkdownSync @_content, @getLocation(base) # cache html
retu... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown-page.coffee | MIT | 8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5/src/plugins/markdown-page.coffee | 40 | 49 |
jnordberg/wintersmith:src/plugins/markdown-page.coffee:4:completion | completion | class MarkdownPage extends Page
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')] | getHtml: (base) ->
### parse @markdown and return html. also resolves any relative urls to absolute ones ###
@_html ?= parseMarkdownSync @_content, @getLocation(base) # cache html
return @_html | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown-page.coffee | MIT | 8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/8ea4fef1ec1200537f0cc3fff1c3a1228ab338a5/src/plugins/markdown-page.coffee | 40 | 49 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.