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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ichord/At.js:src/view.coffee:2:completion | completion | next: ->
cur = @$el.find('.cur').removeClass('cur')
next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: -... | if isNaN(time)
@context.reset_rect()
@$el.hide()
@context.trigger 'hidden', [e]
else
callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hi... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 219de3d20ca71d0391e9c55b793f55e1eb184daf | 5,250 | https://github.com/ichord/At.js/blob/219de3d20ca71d0391e9c55b793f55e1eb184daf/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0 | 5,250 | https://github.com/ichord/At.js/blob/ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.a... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM of list view if it does not exist
this.context.$el... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0 | 5,250 | https://github.com/ichord/At.js/blob/ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0 | 5,250 | https://github.com/ichord/At.js/blob/ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | # Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
choose: (e) ->
if ($li = @$el.find ".cur").length
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_insert").call(@context, content, $li), $li
@context.trigger "inserted... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0 | 5,250 | https://github.com/ichord/At.js/blob/ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @stop_showing
@stop_showing = false
ret... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0 | 5,250 | https://github.com/ichord/At.js/blob/ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0/src/view.coffee | 53 | 102 | ||
ichord/At.js:src/view.coffee:2:completion | completion | next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @stop_showing
@stop_showing = false
ret... | @context.trigger 'hidden', [e]
else
callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find(... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0 | 5,250 | https://github.com/ichord/At.js/blob/ce60958d2719f8fb5deb1bb1d2589fdc34a55fd0/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 1f13a168bb7b5dbf19f2159d7839a0d11448b75e | 5,250 | https://github.com/ichord/At.js/blob/1f13a168bb7b5dbf19f2159d7839a0d11448b75e/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.a... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM of list view if it does not exist
this.context.$el... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | 1f13a168bb7b5dbf19f2159d7839a0d11448b75e | 5,250 | https://github.com/ichord/At.js/blob/1f13a168bb7b5dbf19f2159d7839a0d11448b75e/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 1f13a168bb7b5dbf19f2159d7839a0d11448b75e | 5,250 | https://github.com/ichord/At.js/blob/1f13a168bb7b5dbf19f2159d7839a0d11448b75e/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | # Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
choose: (e) ->
if ($li = @$el.find ".cur").length
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_insert").call(@context, content, $li), $li
@context.trigger "inserted... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 1f13a168bb7b5dbf19f2159d7839a0d11448b75e | 5,250 | https://github.com/ichord/At.js/blob/1f13a168bb7b5dbf19f2159d7839a0d11448b75e/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | d9bbb2ab46b710d7036bb3801f0883990bbeadfd | 5,250 | https://github.com/ichord/At.js/blob/d9bbb2ab46b710d7036bb3801f0883990bbeadfd/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.a... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM of list view if it does not exist
this.context.$el... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | d9bbb2ab46b710d7036bb3801f0883990bbeadfd | 5,250 | https://github.com/ichord/At.js/blob/d9bbb2ab46b710d7036bb3801f0883990bbeadfd/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | d9bbb2ab46b710d7036bb3801f0883990bbeadfd | 5,250 | https://github.com/ichord/At.js/blob/d9bbb2ab46b710d7036bb3801f0883990bbeadfd/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | # Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
choose: (e) ->
if ($li = @$el.find ".cur").length
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_insert").call(@context, content, $li), $li
@context.trigger "inserted... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | d9bbb2ab46b710d7036bb3801f0883990bbeadfd | 5,250 | https://github.com/ichord/At.js/blob/d9bbb2ab46b710d7036bb3801f0883990bbeadfd/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
@choosing = false
return
@context.mark_range()
... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | d9bbb2ab46b710d7036bb3801f0883990bbeadfd | 5,250 | https://github.com/ichord/At.js/blob/d9bbb2ab46b710d7036bb3801f0883990bbeadfd/src/view.coffee | 53 | 102 | ||
ichord/At.js:src/view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
... | var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:last');
}
return prev.addClass('cur');
},
s... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | d9bbb2ab46b710d7036bb3801f0883990bbeadfd | 5,250 | https://github.com/ichord/At.js/blob/d9bbb2ab46b710d7036bb3801f0883990bbeadfd/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:... | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
@choosing = false
return
@context.mark_range()
... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | d9bbb2ab46b710d7036bb3801f0883990bbeadfd | 5,250 | https://github.com/ichord/At.js/blob/d9bbb2ab46b710d7036bb3801f0883990bbeadfd/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:2:completion | completion | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
@choosing = false
return
@context.mark_range()
... | @hide_event = undefined
else
callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find('ul')
... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | d9bbb2ab46b710d7036bb3801f0883990bbeadfd | 5,250 | https://github.com/ichord/At.js/blob/d9bbb2ab46b710d7036bb3801f0883990bbeadfd/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.a... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM of list view if it does not exist
this.context.$el... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | this.choose()
e.preventDefault()
# Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
choose: (e) ->
if e?
@hide_event = e
if ($li = @$el.find ".cur").length
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_i... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next: ->
cur = @$el.find('.cur').removeClass('cur')
next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: -... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 53 | 102 | ||
ichord/At.js:src/view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
next: ->
cur = @$el.find('.cur').removeClass('cur')
next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:las... | ({
next: function() {
var cur, next;
cur = this.$el.find('.cur').removeClass('cur');
next = cur.next();
if (!next.length) {
next = this.$el.find('li:first');
}
return next.addClass('cur');
},
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
next: function() {
var cur, next;
cur = this.$el.find('.cur').removeClass('cur');
next = cur.next();
if (!next.length) {
next = this.$el.find('li:first');
}
return next.addClass('cur');
},
prev: function() {
var cur, prev;... | next: ->
cur = @$el.find('.cur').removeClass('cur')
next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: -... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:2:completion | completion | next: ->
cur = @$el.find('.cur').removeClass('cur')
next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: -... | return if not this.visible()
if isNaN(time)
@context.reset_rect()
@$el.hide()
@context.trigger 'hidden', [@hide_event]
@hide_event = undefined
else
callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render:... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:3:raw_corpus | raw_corpus | $li.data("item-data", item)
$ul.append $li
this.show()
$ul.find("li:first").addClass "cur" if @context.get_opt('highlight_first') | CoffeeScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 103 | 107 | ||
ichord/At.js:src/view.coffee:3:completion | completion | $li.data("item-data", item)
$ul.append $li | this.show()
$ul.find("li:first").addClass "cur" if @context.get_opt('highlight_first') | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | bd50679e04e4658a1be74f2e20d26ce4c6ff30ca | 5,250 | https://github.com/ichord/At.js/blob/bd50679e04e4658a1be74f2e20d26ce4c6ff30ca/src/view.coffee | 103 | 107 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb | 5,250 | https://github.com/ichord/At.js/blob/ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | e.preventDefault()
# Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
choose: (e) ->
@hide_event = e if e?
if ($li = @$el.find ".cur").length
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_insert").call(@context, cont... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb | 5,250 | https://github.com/ichord/At.js/blob/ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | cur = @$el.find('.cur').removeClass('cur')
next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @cho... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb | 5,250 | https://github.com/ichord/At.js/blob/ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb/src/view.coffee | 53 | 102 | ||
ichord/At.js:src/view.coffee:2:completion | completion | cur = @$el.find('.cur').removeClass('cur')
next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @cho... | if isNaN(time)
@context.reset_rect()
@$el.hide()
@context.trigger 'hidden', [@hide_event]
@hide_event = undefined
else
callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb | 5,250 | https://github.com/ichord/At.js/blob/ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:3:raw_corpus | raw_corpus | $ul.append $li
this.show()
$ul.find("li:first").addClass "cur" if @context.get_opt('highlight_first') | CoffeeScript | ichord/At.js | src/view.coffee | MIT | ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb | 5,250 | https://github.com/ichord/At.js/blob/ca238d9a4d3e5c5a965ee4af88ce90a4c3b644bb/src/view.coffee | 103 | 106 | ||
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | eeafab1c705042959291c89c4ed5babe6dbb9d64 | 5,250 | https://github.com/ichord/At.js/blob/eeafab1c705042959291c89c4ed5babe6dbb9d64/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.a... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM of list view if it does not exist
this.context.$el... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | eeafab1c705042959291c89c4ed5babe6dbb9d64 | 5,250 | https://github.com/ichord/At.js/blob/eeafab1c705042959291c89c4ed5babe6dbb9d64/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | eeafab1c705042959291c89c4ed5babe6dbb9d64 | 5,250 | https://github.com/ichord/At.js/blob/eeafab1c705042959291c89c4ed5babe6dbb9d64/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | e.preventDefault()
# Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
choose: ->
if ($li = @$el.find ".cur").length
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_insert").call(@context, content, $li), $li
@context... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | eeafab1c705042959291c89c4ed5babe6dbb9d64 | 5,250 | https://github.com/ichord/At.js/blob/eeafab1c705042959291c89c4ed5babe6dbb9d64/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
@choosing = false
return
... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | eeafab1c705042959291c89c4ed5babe6dbb9d64 | 5,250 | https://github.com/ichord/At.js/blob/eeafab1c705042959291c89c4ed5babe6dbb9d64/src/view.coffee | 53 | 102 | ||
ichord/At.js:src/view.coffee:2:completion | completion | next = cur.next()
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
@choosing = false
return
... | @context.trigger 'hidden', [@click_event]
@click_event = undefined
else
callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | eeafab1c705042959291c89c4ed5babe6dbb9d64 | 5,250 | https://github.com/ichord/At.js/blob/eeafab1c705042959291c89c4ed5babe6dbb9d64/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | fb1f1535c43a073c0b4c177018ae8929a7e6bf25 | 5,250 | https://github.com/ichord/At.js/blob/fb1f1535c43a073c0b4c177018ae8929a7e6bf25/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.a... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM of list view if it does not exist
this.context.$el... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | fb1f1535c43a073c0b4c177018ae8929a7e6bf25 | 5,250 | https://github.com/ichord/At.js/blob/fb1f1535c43a073c0b4c177018ae8929a7e6bf25/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | fb1f1535c43a073c0b4c177018ae8929a7e6bf25 | 5,250 | https://github.com/ichord/At.js/blob/fb1f1535c43a073c0b4c177018ae8929a7e6bf25/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | # Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
choose: ->
if ($li = @$el.find ".cur").length
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_insert").call(@context, content, $li), $li
@context.trigger "inserted", [... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | fb1f1535c43a073c0b4c177018ae8929a7e6bf25 | 5,250 | https://github.com/ichord/At.js/blob/fb1f1535c43a073c0b4c177018ae8929a7e6bf25/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
@choosing = false
return
@context.mark_range()
... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | fb1f1535c43a073c0b4c177018ae8929a7e6bf25 | 5,250 | https://github.com/ichord/At.js/blob/fb1f1535c43a073c0b4c177018ae8929a7e6bf25/src/view.coffee | 53 | 100 | ||
ichord/At.js:src/view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
... | var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:last');
}
return prev.addClass('cur');
},
s... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | fb1f1535c43a073c0b4c177018ae8929a7e6bf25 | 5,250 | https://github.com/ichord/At.js/blob/fb1f1535c43a073c0b4c177018ae8929a7e6bf25/src/view.coffee | 53 | 100 |
ichord/At.js:src/view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:... | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
@choosing = false
return
@context.mark_range()
... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | fb1f1535c43a073c0b4c177018ae8929a7e6bf25 | 5,250 | https://github.com/ichord/At.js/blob/fb1f1535c43a073c0b4c177018ae8929a7e6bf25/src/view.coffee | 53 | 100 |
ichord/At.js:src/view.coffee:2:completion | completion | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
if @choosing
@choosing = false
return
@context.mark_range()
... | else
callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find('ul')
tpl = @context.get_opt('t... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | fb1f1535c43a073c0b4c177018ae8929a7e6bf25 | 5,250 | https://github.com/ichord/At.js/blob/fb1f1535c43a073c0b4c177018ae8929a7e6bf25/src/view.coffee | 53 | 100 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@con... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 4ca01d57bda0a9b148efcb2dd6aa94f73523fd1a | 5,250 | https://github.com/ichord/At.js/blob/4ca01d57bda0a9b148efcb2dd6aa94f73523fd1a/src/view.coffee | 53 | 97 | ||
ichord/At.js:src/view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range... | var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:last');
}
return prev.addClass('cur');
},
s... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | 4ca01d57bda0a9b148efcb2dd6aa94f73523fd1a | 5,250 | https://github.com/ichord/At.js/blob/4ca01d57bda0a9b148efcb2dd6aa94f73523fd1a/src/view.coffee | 53 | 97 |
ichord/At.js:src/view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:... | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@con... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 4ca01d57bda0a9b148efcb2dd6aa94f73523fd1a | 5,250 | https://github.com/ichord/At.js/blob/4ca01d57bda0a9b148efcb2dd6aa94f73523fd1a/src/view.coffee | 53 | 97 |
ichord/At.js:src/view.coffee:2:completion | completion | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@con... | callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find('ul')
tpl = @context.get_opt('tpl')
f... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 4ca01d57bda0a9b148efcb2dd6aa94f73523fd1a | 5,250 | https://github.com/ichord/At.js/blob/4ca01d57bda0a9b148efcb2dd6aa94f73523fd1a/src/view.coffee | 53 | 97 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 2fba41b12812207e180f7c3d1e11bf65f49e639f | 5,250 | https://github.com/ichord/At.js/blob/2fba41b12812207e180f7c3d1e11bf65f49e639f/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.a... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM of list view if it does not exist
this.context.$el... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | 2fba41b12812207e180f7c3d1e11bf65f49e639f | 5,250 | https://github.com/ichord/At.js/blob/2fba41b12812207e180f7c3d1e11bf65f49e639f/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 2fba41b12812207e180f7c3d1e11bf65f49e639f | 5,250 | https://github.com/ichord/At.js/blob/2fba41b12812207e180f7c3d1e11bf65f49e639f/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | # Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
choose: ->
$li = @$el.find ".cur"
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_insert").call(@context, content, $li), $li
@context.trigger "inserted", [$li]
this.hide... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 2fba41b12812207e180f7c3d1e11bf65f49e639f | 5,250 | https://github.com/ichord/At.js/blob/2fba41b12812207e180f7c3d1e11bf65f49e639f/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@con... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 7b043859239f8c78bb4927d076e1eda533aa087c | 5,250 | https://github.com/ichord/At.js/blob/7b043859239f8c78bb4927d076e1eda533aa087c/src/view.coffee | 53 | 97 | ||
ichord/At.js:src/view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range... | var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:last');
}
return prev.addClass('cur');
},
s... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | 7b043859239f8c78bb4927d076e1eda533aa087c | 5,250 | https://github.com/ichord/At.js/blob/7b043859239f8c78bb4927d076e1eda533aa087c/src/view.coffee | 53 | 97 |
ichord/At.js:src/view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:... | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@con... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 7b043859239f8c78bb4927d076e1eda533aa087c | 5,250 | https://github.com/ichord/At.js/blob/7b043859239f8c78bb4927d076e1eda533aa087c/src/view.coffee | 53 | 97 |
ichord/At.js:src/view.coffee:2:completion | completion | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@con... | callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find('ul')
tpl = @context.get_opt('tpl')
f... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 7b043859239f8c78bb4927d076e1eda533aa087c | 5,250 | https://github.com/ichord/At.js/blob/7b043859239f8c78bb4927d076e1eda533aa087c/src/view.coffee | 53 | 97 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@con... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 52a41f551d3f7952c06b64e3f6f4485affe160ec | 5,250 | https://github.com/ichord/At.js/blob/52a41f551d3f7952c06b64e3f6f4485affe160ec/src/view.coffee | 53 | 97 | ||
ichord/At.js:src/view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range... | var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:last');
}
return prev.addClass('cur');
},
s... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | 52a41f551d3f7952c06b64e3f6f4485affe160ec | 5,250 | https://github.com/ichord/At.js/blob/52a41f551d3f7952c06b64e3f6f4485affe160ec/src/view.coffee | 53 | 97 |
ichord/At.js:src/view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var next;
next = this.$el.find('li:first')(!next.length ? next.addClass('cur') : void 0);
({
prev: function() {
var cur, prev;
cur = this.$el.find('.cur').removeClass('cur');
prev = cur.prev();
if (!prev.length) {
prev = this.$el.find('li:... | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@con... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 52a41f551d3f7952c06b64e3f6f4485affe160ec | 5,250 | https://github.com/ichord/At.js/blob/52a41f551d3f7952c06b64e3f6f4485affe160ec/src/view.coffee | 53 | 97 |
ichord/At.js:src/view.coffee:2:completion | completion | next = @$el.find('li:first') if not next.length
next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@con... | callback = => this.hide()
clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find('ul')
tpl = @context.get_opt('tpl')
f... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 52a41f551d3f7952c06b64e3f6f4485affe160ec | 5,250 | https://github.com/ichord/At.js/blob/52a41f551d3f7952c06b64e3f6f4485affe160ec/src/view.coffee | 53 | 97 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9a9462463991817f1946fdc3f761d3fb8e0d27da | 5,250 | https://github.com/ichord/At.js/blob/9a9462463991817f1946fdc3f761d3fb8e0d27da/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.a... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM of list view if it does not exist
this.context.$el... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | 9a9462463991817f1946fdc3f761d3fb8e0d27da | 5,250 | https://github.com/ichord/At.js/blob/9a9462463991817f1946fdc3f761d3fb8e0d27da/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9a9462463991817f1946fdc3f761d3fb8e0d27da | 5,250 | https://github.com/ichord/At.js/blob/9a9462463991817f1946fdc3f761d3fb8e0d27da/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | # Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
choose: ->
$li = @$el.find ".cur"
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_insert").call(@context, content, $li), $li
@context.trigger "inserted", [$li]
this.hide... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9a9462463991817f1946fdc3f761d3fb8e0d27da | 5,250 | https://github.com/ichord/At.js/blob/9a9462463991817f1946fdc3f761d3fb8e0d27da/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@context.trigger 'shown'
this.reposition(rect) if re... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9a9462463991817f1946fdc3f761d3fb8e0d27da | 5,250 | https://github.com/ichord/At.js/blob/9a9462463991817f1946fdc3f761d3fb8e0d27da/src/view.coffee | 53 | 96 | ||
ichord/At.js:src/view.coffee:2:completion | completion | next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
if not this.visible()
@$el.show()
@context.trigger 'shown'
this.reposition(rect) if re... | clearTimeout @timeout_id
@timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find('ul')
tpl = @context.get_opt('tpl')
for item in list
item = $.e... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9a9462463991817f1946fdc3f761d3fb8e0d27da | 5,250 | https://github.com/ichord/At.js/blob/9a9462463991817f1946fdc3f761d3fb8e0d27da/src/view.coffee | 53 | 96 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
@$el.show() if not this.visible()
this.reposition(rect) if rect = @context.rect()
hide: (time) ... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | f3e706542de650f6dd1f103d9826c37f032a6ed4 | 5,250 | https://github.com/ichord/At.js/blob/f3e706542de650f6dd1f103d9826c37f032a6ed4/src/view.coffee | 53 | 93 | ||
ichord/At.js:src/view.coffee:2:completion | completion | next.addClass 'cur'
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
@$el.show() if not this.visible()
this.reposition(rect) if rect = @context.rect()
hide: (time) ... | @timeout_id = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find('ul')
tpl = @context.get_opt('tpl')
for item in list
item = $.extend {}, item, {'atwho-at': @c... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | f3e706542de650f6dd1f103d9826c37f032a6ed4 | 5,250 | https://github.com/ichord/At.js/blob/f3e706542de650f6dd1f103d9826c37f032a6ed4/src/view.coffee | 53 | 93 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.a... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM of list view if it does not exist
this.context.$el... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.timeout_id = null;
// create HTML DOM... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeout_id = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bind_event()
init: ->
id = @c... | # @return [Boolean]
visible: ->
@$el.is(":visible")
choose: ->
$li = @$el.find ".cur"
content = @context.insert_content_for $li
@context.insert @context.callbacks("before_insert").call(@context, content, $li), $li
@context.trigger "inserted", [$li]
this.hide()
reposition: (rect) ->
i... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
@$el.show() if not this.visible()
this.reposition(rect) if rect = @context.rect()
hide: (time) ->
if isNaN time and this.visibl... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/view.coffee | 53 | 90 | ||
ichord/At.js:src/view.coffee:2:completion | completion | cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.length
prev.addClass 'cur'
show: ->
@context.mark_range()
@$el.show() if not this.visible()
this.reposition(rect) if rect = @context.rect()
hide: (time) ->
if isNaN time and this.visibl... | # render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find('ul')
tpl = @context.get_opt('tpl')
for item in list
item = $.extend {}, item, {'atwho-at': @context.at}
li = @context.callbacks("t... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/view.coffee | 53 | 90 |
mojs/mojs:src/shapes/polygon.coffee:1:raw_corpus | raw_corpus | # ignore coffescript sudo code
h = require 'src/h'
Bit = require('./bit').default
class Polygon extends Bit
###
Method to declare defaults.
@overrides @ Bit
###
_declareDefaults:->
super()
this._defaults.tag = 'path'
this._defaults.points = 3
###
Method to draw the shape.
@ove... | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/polygon.coffee | 1 | 50 | ||
mojs/mojs:src/shapes/polygon.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# ignore coffescript sudo code
h = require 'src/h'
Bit = require('./bit').default
class Polygon extends Bit
###
Method to declare defaults.
@overrides @ Bit
###
_declareDefaults:->
super()
this._defaults.tag = 'path'
this._default... | // ignore coffescript sudo code
var Bit, Polygon, h;
h = require('src/h');
Bit = require('./bit').default;
Polygon = class Polygon extends Bit {
/*
Method to declare defaults.
@overrides @ Bit
*/
_declareDefaults() {
super._declareDefaults();
this._defaults.tag = 'path';
return this._defaul... | CoffeeScript | JavaScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/polygon.coffee | 1 | 50 |
mojs/mojs:src/shapes/polygon.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// ignore coffescript sudo code
var Bit, Polygon, h;
h = require('src/h');
Bit = require('./bit').default;
Polygon = class Polygon extends Bit {
/*
Method to declare defaults.
@overrides @ Bit
*/
_declareDefaults() {
super._declareDefaults();
... | # ignore coffescript sudo code
h = require 'src/h'
Bit = require('./bit').default
class Polygon extends Bit
###
Method to declare defaults.
@overrides @ Bit
###
_declareDefaults:->
super()
this._defaults.tag = 'path'
this._defaults.points = 3
###
Method to draw the shape.
@ove... | JavaScript | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/polygon.coffee | 1 | 50 |
mojs/mojs:src/shapes/polygon.coffee:1:completion | completion | # ignore coffescript sudo code
h = require 'src/h'
Bit = require('./bit').default
class Polygon extends Bit
###
Method to declare defaults.
@overrides @ Bit
###
_declareDefaults:->
super()
this._defaults.tag = 'path'
this._defaults.points = 3
###
Method to draw the shape.
@ove... | isRadiusY = radiusY is @_prevRadiusY
isPoints = p.points is @_prevPoints
# skip if nothing changed
if ( !( isRadiusX and isRadiusY and isPoints) )
step = 360/(@_props.points)
# reuse radial points buffer
if !@_radialPoints? then @_radialPoints = []
else @_radialPoints.length = 0
... | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/polygon.coffee | 1 | 50 |
mojs/mojs:src/shapes/polygon.coffee:2:raw_corpus | raw_corpus | @_prevRadiusX = radiusX
@_prevRadiusY = radiusY
@el.setAttribute 'd', (d += 'z')
super()
###
Method to get length of the shape.
@overrides @ Bit
###
_getLength:-> @_getPointsPerimiter( @_radialPoints );
module.exports = Polygon | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/polygon.coffee | 51 | 63 | ||
mojs/mojs:src/shapes/polygon.coffee:2:completion | completion | @_prevRadiusX = radiusX
@_prevRadiusY = radiusY
@el.setAttribute 'd', (d += 'z')
super() | ###
Method to get length of the shape.
@overrides @ Bit
###
_getLength:-> @_getPointsPerimiter( @_radialPoints );
module.exports = Polygon | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/polygon.coffee | 51 | 63 |
mojs/mojs:src/shapes/polygon.coffee:1:raw_corpus | raw_corpus | # ignore coffescript sudo code
h = require 'src/h'
Bit = require('./bit').default
class Polygon extends Bit
###
Method to declare defaults.
@overrides @ Bit
###
_declareDefaults:->
super
this._defaults.tag = 'path'
this._defaults.points = 3
###
Method to draw the shape.
@overr... | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 7c34e766d9b361898a59adbc753862fa95de182a | 18,698 | https://github.com/mojs/mojs/blob/7c34e766d9b361898a59adbc753862fa95de182a/src/shapes/polygon.coffee | 1 | 50 | ||
mojs/mojs:src/shapes/polygon.coffee:1:completion | completion | # ignore coffescript sudo code
h = require 'src/h'
Bit = require('./bit').default
class Polygon extends Bit
###
Method to declare defaults.
@overrides @ Bit
###
_declareDefaults:->
super
this._defaults.tag = 'path'
this._defaults.points = 3
###
Method to draw the shape.
@overr... | isRadiusY = radiusY is @_prevRadiusY
isPoints = p.points is @_prevPoints
# skip if nothing changed
if ( !( isRadiusX and isRadiusY and isPoints) )
step = 360/(@_props.points)
# reuse radial points buffer
if !@_radialPoints? then @_radialPoints = []
else @_radialPoints.length = 0
... | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 7c34e766d9b361898a59adbc753862fa95de182a | 18,698 | https://github.com/mojs/mojs/blob/7c34e766d9b361898a59adbc753862fa95de182a/src/shapes/polygon.coffee | 1 | 50 |
mojs/mojs:src/shapes/polygon.coffee:2:raw_corpus | raw_corpus | @_prevRadiusX = radiusX
@_prevRadiusY = radiusY
@el.setAttribute 'd', (d += 'z')
super
###
Method to get length of the shape.
@overrides @ Bit
###
_getLength:-> @_getPointsPerimiter( @_radialPoints );
module.exports = Polygon | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 7c34e766d9b361898a59adbc753862fa95de182a | 18,698 | https://github.com/mojs/mojs/blob/7c34e766d9b361898a59adbc753862fa95de182a/src/shapes/polygon.coffee | 51 | 63 | ||
mojs/mojs:src/shapes/polygon.coffee:2:completion | completion | @_prevRadiusX = radiusX
@_prevRadiusY = radiusY
@el.setAttribute 'd', (d += 'z')
super | ###
Method to get length of the shape.
@overrides @ Bit
###
_getLength:-> @_getPointsPerimiter( @_radialPoints );
module.exports = Polygon | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 7c34e766d9b361898a59adbc753862fa95de182a | 18,698 | https://github.com/mojs/mojs/blob/7c34e766d9b361898a59adbc753862fa95de182a/src/shapes/polygon.coffee | 51 | 63 |
mojs/mojs:src/shapes/polygon.coffee:1:raw_corpus | raw_corpus | # ignore coffescript sudo code
h = require 'src/h'
Bit = require('./bit').default or require('./bit');
class Polygon extends Bit
###
Method to declare defaults.
@overrides @ Bit
###
_declareDefaults:->
super
this._defaults.tag = 'path'
this._defaults.points = 3
###
Method to draw ... | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 768850a20165488e3098a3003b153e905266dac8 | 18,698 | https://github.com/mojs/mojs/blob/768850a20165488e3098a3003b153e905266dac8/src/shapes/polygon.coffee | 1 | 50 | ||
mojs/mojs:src/shapes/polygon.coffee:1:completion | completion | # ignore coffescript sudo code
h = require 'src/h'
Bit = require('./bit').default or require('./bit');
class Polygon extends Bit
###
Method to declare defaults.
@overrides @ Bit
###
_declareDefaults:->
super
this._defaults.tag = 'path'
this._defaults.points = 3
###
Method to draw ... | isRadiusY = radiusY is @_prevRadiusY
isPoints = p.points is @_prevPoints
# skip if nothing changed
if ( !( isRadiusX and isRadiusY and isPoints) )
step = 360/(@_props.points)
# reuse radial points buffer
if !@_radialPoints? then @_radialPoints = []
else @_radialPoints.length = 0
... | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/polygon.coffee | MIT | 768850a20165488e3098a3003b153e905266dac8 | 18,698 | https://github.com/mojs/mojs/blob/768850a20165488e3098a3003b153e905266dac8/src/shapes/polygon.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma-ng1.0.config.coffee:1:raw_corpus | raw_corpus | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/lib/angularjs/angular.1.0.8.min.js'
'test/lib... | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.0.config.coffee | MIT | 931e100813846ed1776ec67e7e873d85a8554843 | 600 | https://github.com/kelp404/angular-form-builder/blob/931e100813846ed1776ec67e7e873d85a8554843/test/karma-ng1.0.config.coffee | 1 | 50 | ||
kelp404/angular-form-builder:test/karma-ng1.0.config.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/... | module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/angularjs/angular.1.0.8.min.js', 'test/lib/angularjs/angular-mocks.1.0... | CoffeeScript | JavaScript | kelp404/angular-form-builder | test/karma-ng1.0.config.coffee | MIT | 931e100813846ed1776ec67e7e873d85a8554843 | 600 | https://github.com/kelp404/angular-form-builder/blob/931e100813846ed1776ec67e7e873d85a8554843/test/karma-ng1.0.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma-ng1.0.config.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/angularjs/angul... | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/lib/angularjs/angular.1.0.8.min.js'
'test/lib... | JavaScript | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.0.config.coffee | MIT | 931e100813846ed1776ec67e7e873d85a8554843 | 600 | https://github.com/kelp404/angular-form-builder/blob/931e100813846ed1776ec67e7e873d85a8554843/test/karma-ng1.0.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma-ng1.0.config.coffee:2:raw_corpus | raw_corpus | # If browser does not capture in given timeout [ms], kill it
# CLI --capture-timeout 5000
captureTimeout: 20000
# Auto run tests on start (when browsers are captured) and exit
# CLI --single-run --no-single-run
singleRun: true
# report which specs are slower than 500ms
... | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.0.config.coffee | MIT | 931e100813846ed1776ec67e7e873d85a8554843 | 600 | https://github.com/kelp404/angular-form-builder/blob/931e100813846ed1776ec67e7e873d85a8554843/test/karma-ng1.0.config.coffee | 51 | 62 | ||
kelp404/angular-form-builder:test/karma-ng1.0.config.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# If browser does not capture in given timeout [ms], kill it
# CLI --capture-timeout 5000
captureTimeout: 20000
# Auto run tests on start (when browsers are captured) and exit
# CLI --single-run --no-single-run
singleRun: ... | // If browser does not capture in given timeout [ms], kill it
// CLI --capture-timeout 5000
({
captureTimeout: 20000,
// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: true,
// report which specs are slower than 500ms
// CLI --report-slower-than ... | CoffeeScript | JavaScript | kelp404/angular-form-builder | test/karma-ng1.0.config.coffee | MIT | 931e100813846ed1776ec67e7e873d85a8554843 | 600 | https://github.com/kelp404/angular-form-builder/blob/931e100813846ed1776ec67e7e873d85a8554843/test/karma-ng1.0.config.coffee | 51 | 62 |
kelp404/angular-form-builder:test/karma-ng1.0.config.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// If browser does not capture in given timeout [ms], kill it
// CLI --capture-timeout 5000
({
captureTimeout: 20000,
// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: true,
// report which spe... | # If browser does not capture in given timeout [ms], kill it
# CLI --capture-timeout 5000
captureTimeout: 20000
# Auto run tests on start (when browsers are captured) and exit
# CLI --single-run --no-single-run
singleRun: true
# report which specs are slower than 500ms
... | JavaScript | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.0.config.coffee | MIT | 931e100813846ed1776ec67e7e873d85a8554843 | 600 | https://github.com/kelp404/angular-form-builder/blob/931e100813846ed1776ec67e7e873d85a8554843/test/karma-ng1.0.config.coffee | 51 | 62 |
jashkenas/coffeescript:test/numbers.coffee:1:raw_corpus | raw_corpus | # Number Literals
# ---------------
# * Decimal Integer Literals
# * Octal Integer Literals
# * Hexadecimal Integer Literals
# * Scientific Notation Integer Literals
# * Scientific Notation Non-Integer Literals
# * Non-Integer Literals
# * Binary Integer Literals
# Binary Integer Literals
# Binary notation is unders... | CoffeeScript | jashkenas/coffeescript | test/numbers.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/numbers.coffee | 1 | 42 | ||
jashkenas/coffeescript:test/numbers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Number Literals
# ---------------
# * Decimal Integer Literals
# * Octal Integer Literals
# * Hexadecimal Integer Literals
# * Scientific Notation Integer Literals
# * Scientific Notation Non-Integer Literals
# * Non-Integer Literals
# * Binary Integer Literal... | // Number Literals
// ---------------
// * Decimal Integer Literals
// * Octal Integer Literals
// * Hexadecimal Integer Literals
// * Scientific Notation Integer Literals
// * Scientific Notation Non-Integer Literals
// * Non-Integer Literals
// * Binary Integer Literals
// Binary Integer Literals
// Binary notation... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/numbers.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/numbers.coffee | 1 | 42 |
jashkenas/coffeescript:test/numbers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Number Literals
// ---------------
// * Decimal Integer Literals
// * Octal Integer Literals
// * Hexadecimal Integer Literals
// * Scientific Notation Integer Literals
// * Scientific Notation Non-Integer Literals
// * Non-Integer Literals
// * Binary Integer ... | # Number Literals
# ---------------
# * Decimal Integer Literals
# * Octal Integer Literals
# * Hexadecimal Integer Literals
# * Scientific Notation Integer Literals
# * Scientific Notation Non-Integer Literals
# * Non-Integer Literals
# * Binary Integer Literals
# Binary Integer Literals
# Binary notation is unders... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/numbers.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/numbers.coffee | 1 | 42 |
jashkenas/coffeescript:test/numbers.coffee:1:completion | completion | # Number Literals
# ---------------
# * Decimal Integer Literals
# * Octal Integer Literals
# * Hexadecimal Integer Literals
# * Scientific Notation Integer Literals
# * Scientific Notation Non-Integer Literals
# * Non-Integer Literals
# * Binary Integer Literals
# Binary Integer Literals
# Binary notation is unders... | eq 4, 4.valueOf()
eq '11', 4.toString 3
eq '1000', 1_000.toString()
eq -1, 3 -4
#764: Numbers should be indexable
eq Number::toString, 42['toString']
eq Number::toString, 42.toString
eq Number::toString, 2e308['toString'] # Infinity
# Non-Integer Literals
# Decimal number literals.
value = .25 + .75
ok value... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/numbers.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/numbers.coffee | 1 | 42 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.