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
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
if reverse rightRevHash = revHash else leftRevHash = revHash # order by created asc [leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHash, @_onRevisionClose) @timeplot.setRevisions(leftRevH...
_onRevisionClose: => rightRevHash = leftRevHash = null @timeplot.setRevisions(leftRevHash, rightRevHash) _orderRevHashes: (revHashA, revHashB) -> unorderedRevs = [revHashA, revHashB] return unorderedRevs unless @commits?.length > 0 orderedRevs = [] for rev in @commits if rev.id in uno...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
2d2adcc4c8d3095653098d677e55020f71b2e4a1
1,111
https://github.com/littlebee/git-time-machine/blob/2d2adcc4c8d3095653098d677e55020f71b2e4a1/lib/git-time-machine-view.coffee
164
197
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:raw_corpus
raw_corpus
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @lastActivatedEdi...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor)...
var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor(options.editor); this.render(); } this._...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor...
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @lastActivatedEdi...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:completion
completion
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @lastActivatedEdi...
unless @commits? @_renderPlaceholder() else @$element.text("") @_renderCloseHandle() @_renderTimeplot(@commits) @_renderStats(@commits) return @$element # Returns an object that can be retrieved when package is activated serialize: -> return null # Tear down any stat...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus
raw_corpus
show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> return null unless editor? if editor.__gitTimeMachine?.sourceEditor? editor = editor.__gitTimeMachine.sourceEditor file = editor?.getPath() return null unless file? ...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> return null unless editor? if editor.__gitTimeMachine?.sourceEditor? editor = editor.__gitTimeMachine.sourceEditor ...
({ show: function() { var ref; return (ref = this.timeplot) != null ? ref.show() : void 0; }, getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.lastActivatedEditor) { var commits, e, file, ref; if (editor == null) { return null; } ...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ show: function() { var ref; return (ref = this.timeplot) != null ? ref.show() : void 0; }, getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.lastActivatedEditor) { var commits, e, file, re...
show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> return null unless editor? if editor.__gitTimeMachine?.sourceEditor? editor = editor.__gitTimeMachine.sourceEditor file = editor?.getPath() return null unless file? ...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion
completion
show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> return null unless editor? if editor.__gitTimeMachine?.sourceEditor? editor = editor.__gitTimeMachine.sourceEditor file = editor?.getPath() return null unless file? ...
console.error e return null return commits; _bindWindowEvents: () -> $(window).on 'resize', @_onEditorResize _unbindWindowEvents: () -> $(window).off 'resize', @_onEditorResize _renderPlaceholder: () -> @$element.html("<div class='placeholder'>Select a file in the git repo to see time...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
e.stopPropagation() # why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element, @_onZoom) @timeplot.render(commits, @_onViewRevision) lef...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
e.stopPropagation() # why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element, @_onZoom) @timeplot.render(commits, @_onViewRevision) lef...
_renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)) timeSpan = moment.duration(durationIn...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
rightRevHash = revHash else leftRevHash = revHash # order by created asc [leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHash, @_onRevisionClose) @timeplot.setRevisions(leftRevHash, rightRevHash...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
164
199
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion
completion
rightRevHash = revHash else leftRevHash = revHash # order by created asc [leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHash, @_onRevisionClose) @timeplot.setRevisions(leftRevHash, rightRevHash...
_onRevisionClose: => rightRevHash = leftRevHash = null @timeplot.setRevisions(leftRevHash, rightRevHash, false) _orderRevHashes: (revHashA, revHashB) -> unorderedRevs = [revHashA, revHashB] return unorderedRevs unless @commits?.length > 0 orderedRevs = [] for rev in @commits if rev.id...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
abf837260db8ffd2b3715d278e7a40e7594cd7bd
1,111
https://github.com/littlebee/git-time-machine/blob/abf837260db8ffd2b3715d278e7a40e7594cd7bd/lib/git-time-machine-view.coffee
164
199
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
e.stopPropagation() # why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) leftRevHash = ...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
b93a14ba7286941929440b1a31014814aed6631a
1,111
https://github.com/littlebee/git-time-machine/blob/b93a14ba7286941929440b1a31014814aed6631a/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
e.stopPropagation() # why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) leftRevHash = ...
byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)) timeSpan = moment.duration(durationInMs).humanize() content = "<span class='total-commits'>#{commits.length...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
b93a14ba7286941929440b1a31014814aed6631a
1,111
https://github.com/littlebee/git-time-machine/blob/b93a14ba7286941929440b1a31014814aed6631a/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
# order by created asc [leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHash, @_onRevisionClose) @timeplot.setRevisions(leftRevHash, rightRevHash) _onEditorResize: => @render() _onRevisionClose: =>...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
b93a14ba7286941929440b1a31014814aed6631a
1,111
https://github.com/littlebee/git-time-machine/blob/b93a14ba7286941929440b1a31014814aed6631a/lib/git-time-machine-view.coffee
164
191
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion
completion
# order by created asc [leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHash, @_onRevisionClose) @timeplot.setRevisions(leftRevHash, rightRevHash) _onEditorResize: => @render() _onRevisionClose: =>...
@timeplot.setRevisions(leftRevHash, rightRevHash) _orderRevHashes: (revHashA, revHashB) -> unorderedRevs = [revHashA, revHashB] return unorderedRevs unless @commits?.length > 0 orderedRevs = [] for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.pus...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
b93a14ba7286941929440b1a31014814aed6631a
1,111
https://github.com/littlebee/git-time-machine/blob/b93a14ba7286941929440b1a31014814aed6631a/lib/git-time-machine-view.coffee
164
191
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
# order by created asc [leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHash) @timeplot.setRevisions(leftRevHash, rightRevHash) _onEditorResize: => @render() _orderRevHashes: (revHashA, revHashB) -...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
12f31c73de7a73089a2202ae7fcb9bb761f791b5
1,111
https://github.com/littlebee/git-time-machine/blob/12f31c73de7a73089a2202ae7fcb9bb761f791b5/lib/git-time-machine-view.coffee
164
186
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion
completion
# order by created asc [leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHash) @timeplot.setRevisions(leftRevHash, rightRevHash) _onEditorResize: => @render()
_orderRevHashes: (revHashA, revHashB) -> unorderedRevs = [revHashA, revHashB] return unorderedRevs unless @commits?.length > 0 orderedRevs = [] for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 ...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
12f31c73de7a73089a2202ae7fcb9bb761f791b5
1,111
https://github.com/littlebee/git-time-machine/blob/12f31c73de7a73089a2202ae7fcb9bb761f791b5/lib/git-time-machine-view.coffee
164
186
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
e.stopPropagation() # why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _ren...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
843862a9fb12e55a2e2c2eb6e5be701012045094
1,111
https://github.com/littlebee/git-time-machine/blob/843862a9fb12e55a2e2c2eb6e5be701012045094/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
e.stopPropagation() # why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _ren...
_onViewRevision: (revHash, reverse) => leftRevHash = null rightRevHash = null if @lastActivatedEditor.__gitTimeMachine? leftRevHash = @lastActivatedEditor.__gitTimeMachine.revisions?[0]?.revHash ? null rightRevHash = @lastActivatedEditor.__gitTimeMachine.revisions?[1]?.revHash ? null if re...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
843862a9fb12e55a2e2c2eb6e5be701012045094
1,111
https://github.com/littlebee/git-time-machine/blob/843862a9fb12e55a2e2c2eb6e5be701012045094/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
_orderRevHashes: (revHashA, revHashB) -> unorderedRevs = [revHashA, revHashB] return unorderedRevs unless @commits?.length > 0 orderedRevs = [] for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 ...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
843862a9fb12e55a2e2c2eb6e5be701012045094
1,111
https://github.com/littlebee/git-time-machine/blob/843862a9fb12e55a2e2c2eb6e5be701012045094/lib/git-time-machine-view.coffee
164
176
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript _orderRevHashes: (revHashA, revHashB) -> unorderedRevs = [revHashA, revHashB] return unorderedRevs unless @commits?.length > 0 orderedRevs = [] for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs....
var indexOf = [].indexOf; ({ _orderRevHashes: function(revHashA, revHashB) { var i, len, orderedRevs, ref, ref1, ref2, ref3, rev, unorderedRevs; unorderedRevs = [revHashA, revHashB]; if (!(((ref = this.commits) != null ? ref.length : void 0) > 0)) { return unorderedRevs; } orderedRevs = [];...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
843862a9fb12e55a2e2c2eb6e5be701012045094
1,111
https://github.com/littlebee/git-time-machine/blob/843862a9fb12e55a2e2c2eb6e5be701012045094/lib/git-time-machine-view.coffee
164
176
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var indexOf = [].indexOf; ({ _orderRevHashes: function(revHashA, revHashB) { var i, len, orderedRevs, ref, ref1, ref2, ref3, rev, unorderedRevs; unorderedRevs = [revHashA, revHashB]; if (!(((ref = this.commits) != null ? ref.length : void 0) > 0)) { ...
_orderRevHashes: (revHashA, revHashB) -> unorderedRevs = [revHashA, revHashB] return unorderedRevs unless @commits?.length > 0 orderedRevs = [] for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 ...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
843862a9fb12e55a2e2c2eb6e5be701012045094
1,111
https://github.com/littlebee/git-time-machine/blob/843862a9fb12e55a2e2c2eb6e5be701012045094/lib/git-time-machine-view.coffee
164
176
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion
completion
_orderRevHashes: (revHashA, revHashB) -> unorderedRevs = [revHashA, revHashB] return unorderedRevs unless @commits?.length > 0 orderedRevs = []
for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 return orderedRevs.reverse()
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
843862a9fb12e55a2e2c2eb6e5be701012045094
1,111
https://github.com/littlebee/git-time-machine/blob/843862a9fb12e55a2e2c2eb6e5be701012045094/lib/git-time-machine-view.coffee
164
176
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
e.stopPropagation() # why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _ren...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
ce56d8db5ca23c699193bd028a9159b75de63ce2
1,111
https://github.com/littlebee/git-time-machine/blob/ce56d8db5ca23c699193bd028a9159b75de63ce2/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
e.stopPropagation() # why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _ren...
_onViewRevision: (revHash, reverse) => [leftRevHash, rightRevHash] = if reverse [@leftRevHash, revHash] else [revHash, @rightRevHash] # order by created asc [@leftRevHash, @rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, @l...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
ce56d8db5ca23c699193bd028a9159b75de63ce2
1,111
https://github.com/littlebee/git-time-machine/blob/ce56d8db5ca23c699193bd028a9159b75de63ce2/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 return orderedRevs.reverse()
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
ce56d8db5ca23c699193bd028a9159b75de63ce2
1,111
https://github.com/littlebee/git-time-machine/blob/ce56d8db5ca23c699193bd028a9159b75de63ce2/lib/git-time-machine-view.coffee
164
169
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 return orderedRevs.reverse() ```
var i, len, ref, ref1, ref2, rev, indexOf = [].indexOf; ref = this.commits; for (i = 0, len = ref.length; i < len; i++) { rev = ref[i]; if ((ref1 = rev.id, indexOf.call(unorderedRevs, ref1) >= 0) || (ref2 = rev.hash, indexOf.call(unorderedRevs, ref2) >= 0)) { orderedRevs.push(rev.hash); if (orderedRevs.l...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
ce56d8db5ca23c699193bd028a9159b75de63ce2
1,111
https://github.com/littlebee/git-time-machine/blob/ce56d8db5ca23c699193bd028a9159b75de63ce2/lib/git-time-machine-view.coffee
164
169
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var i, len, ref, ref1, ref2, rev, indexOf = [].indexOf; ref = this.commits; for (i = 0, len = ref.length; i < len; i++) { rev = ref[i]; if ((ref1 = rev.id, indexOf.call(unorderedRevs, ref1) >= 0) || (ref2 = rev.hash, indexOf.call(unorderedRevs, ref2) >= 0)) ...
for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 return orderedRevs.reverse()
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
ce56d8db5ca23c699193bd028a9159b75de63ce2
1,111
https://github.com/littlebee/git-time-machine/blob/ce56d8db5ca23c699193bd028a9159b75de63ce2/lib/git-time-machine-view.coffee
164
169
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion
completion
for rev in @commits if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash
break if orderedRevs.length >= 2 return orderedRevs.reverse()
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
ce56d8db5ca23c699193bd028a9159b75de63ce2
1,111
https://github.com/littlebee/git-time-machine/blob/ce56d8db5ca23c699193bd028a9159b75de63ce2/lib/git-time-machine-view.coffee
164
169
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:raw_corpus
raw_corpus
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return unless editor != @editor file = editor...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor)...
var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor(options.editor); this.render(); } this._...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor...
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return unless editor != @editor file = editor...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:completion
completion
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return unless editor != @editor file = editor...
@_renderCloseHandle() @_renderStats(commits) @_renderTimeline(commits) return @$element # Returns an object that can be retrieved when package is activated serialize: -> return null # Tear down any state and detach destroy: -> @_unbindWindowEvents() @$element.remove() hide: ...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus
raw_corpus
getElement: -> return @$element.get(0) gitCommitHistory: (file=@file)-> return null unless file? try commits = GitLog.getCommitHistory file catch e if e.message? if str.weaklyHas(e.message, NOT_GIT_ERRORS) console.warn "#{file} not in a git repository" return ...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript getElement: -> return @$element.get(0) gitCommitHistory: (file=@file)-> return null unless file? try commits = GitLog.getCommitHistory file catch e if e.message? if str.weaklyHas(e.message, NOT_GIT_ERRORS) console...
({ getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(file = this.file) { var commits, e; if (file == null) { return null; } try { commits = GitLog.getCommitHistory(file); } catch (error) { e = error; if (e.message != null) { ...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(file = this.file) { var commits, e; if (file == null) { return null; } try { commits = GitLog.getCommitHistory(file); } catch (error) { ...
getElement: -> return @$element.get(0) gitCommitHistory: (file=@file)-> return null unless file? try commits = GitLog.getCommitHistory file catch e if e.message? if str.weaklyHas(e.message, NOT_GIT_ERRORS) console.warn "#{file} not in a git repository" return ...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion
completion
getElement: -> return @$element.get(0) gitCommitHistory: (file=@file)-> return null unless file? try commits = GitLog.getCommitHistory file catch e if e.message? if str.weaklyHas(e.message, NOT_GIT_ERRORS) console.warn "#{file} not in a git repository" return ...
_unbindWindowEvents: () -> $(window).off 'resize', @_onEditorResize _renderPlaceholder: () -> @$element.html("<div class='placeholder'>Select a file in the git repo to see timeline</div>") return _renderCloseHandle: () -> $closeHandle = $("<i class='close-handle icon icon-x clickable'></i>") ...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
@timeplot ||= new GitTimeplot(@$element) @timeplot.render(@editor, commits) return _renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].a...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
114
136
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
@timeplot ||= new GitTimeplot(@$element) @timeplot.render(@editor, commits) return _renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].a...
timeSpan = moment.duration(durationInMs).humanize() content = "<span class='total-commits'>#{commits.length}</span> commits by #{authorCount} authors spanning #{timeSpan}" @$element.append """ <div class='stats'> #{content} </div> """ return _onEditorResize: => @render()
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3ee3d20bc97a2be5e62949573c95aef6c0876909
1,111
https://github.com/littlebee/git-time-machine/blob/3ee3d20bc97a2be5e62949573c95aef6c0876909/lib/git-time-machine-view.coffee
114
136
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus
raw_corpus
show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> file = editor?.getPath() return null unless file? try commits = GitLog.getCommitHistory file catch e if e.message? if str.weaklyHas(e.message, NOT_GIT_...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
26d622c3b733558476aa8ee25c92d58bde6749c5
1,111
https://github.com/littlebee/git-time-machine/blob/26d622c3b733558476aa8ee25c92d58bde6749c5/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> file = editor?.getPath() return null unless file? try commits = GitLog.getCommitHistory file catch e i...
({ show: function() { var ref; return (ref = this.timeplot) != null ? ref.show() : void 0; }, getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.lastActivatedEditor) { var commits, e, file; file = editor != null ? editor.getPath() : void 0; ...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
26d622c3b733558476aa8ee25c92d58bde6749c5
1,111
https://github.com/littlebee/git-time-machine/blob/26d622c3b733558476aa8ee25c92d58bde6749c5/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ show: function() { var ref; return (ref = this.timeplot) != null ? ref.show() : void 0; }, getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.lastActivatedEditor) { var commits, e, file; ...
show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> file = editor?.getPath() return null unless file? try commits = GitLog.getCommitHistory file catch e if e.message? if str.weaklyHas(e.message, NOT_GIT_...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
26d622c3b733558476aa8ee25c92d58bde6749c5
1,111
https://github.com/littlebee/git-time-machine/blob/26d622c3b733558476aa8ee25c92d58bde6749c5/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion
completion
show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> file = editor?.getPath() return null unless file? try commits = GitLog.getCommitHistory file catch e if e.message? if str.weaklyHas(e.message, NOT_GIT_...
return commits; _bindWindowEvents: () -> $(window).on 'resize', @_onEditorResize _unbindWindowEvents: () -> $(window).off 'resize', @_onEditorResize _renderPlaceholder: () -> @$element.html("<div class='placeholder'>Select a file in the git repo to see timeline</div>") return _renderClos...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
26d622c3b733558476aa8ee25c92d58bde6749c5
1,111
https://github.com/littlebee/git-time-machine/blob/26d622c3b733558476aa8ee25c92d58bde6749c5/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
_renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs ...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
26d622c3b733558476aa8ee25c92d58bde6749c5
1,111
https://github.com/littlebee/git-time-machine/blob/26d622c3b733558476aa8ee25c92d58bde6749c5/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' ...
var indexOf = [].indexOf; ({ _renderTimeplot: function(commits) { this.timeplot || (this.timeplot = new GitTimeplot(this.$element)); this.timeplot.render(commits, this._onViewRevision); }, _renderStats: function(commits) { var authorCount, byAuthor, content, durationInMs, timeSpan; content = ""; ...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
26d622c3b733558476aa8ee25c92d58bde6749c5
1,111
https://github.com/littlebee/git-time-machine/blob/26d622c3b733558476aa8ee25c92d58bde6749c5/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var indexOf = [].indexOf; ({ _renderTimeplot: function(commits) { this.timeplot || (this.timeplot = new GitTimeplot(this.$element)); this.timeplot.render(commits, this._onViewRevision); }, _renderStats: function(commits) { var authorCount, byAuth...
_renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs ...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
26d622c3b733558476aa8ee25c92d58bde6749c5
1,111
https://github.com/littlebee/git-time-machine/blob/26d622c3b733558476aa8ee25c92d58bde6749c5/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
_renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs ...
[@leftRevHash, revHash] else [revHash, @rightRevHash] # order by created asc [@leftRevHash, @rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, @leftRevHash, @rightRevHash) @timeplot.setRevisions(@leftRevHash, @rightRevHash) _o...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
26d622c3b733558476aa8ee25c92d58bde6749c5
1,111
https://github.com/littlebee/git-time-machine/blob/26d622c3b733558476aa8ee25c92d58bde6749c5/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:raw_corpus
raw_corpus
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @lastActivatedEdi...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor)...
var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor(options.editor); this.render(); } this._...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor...
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @lastActivatedEdi...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:completion
completion
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @lastActivatedEdi...
unless @commits? @_renderPlaceholder() else @$element.text("") @_renderCloseHandle() @_renderTimeplot(@commits) @_renderStats(@commits) return @$element # Returns an object that can be retrieved when package is activated serialize: -> return null # Tear down any stat...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus
raw_corpus
show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() return null unless file? ...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath(...
({ show: function() { var ref; return (ref = this.timeplot) != null ? ref.show() : void 0; }, getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.lastActivatedEditor) { var commits, e, file, ref, ref1; // get the file name of the original file ...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ show: function() { var ref; return (ref = this.timeplot) != null ? ref.show() : void 0; }, getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.lastActivatedEditor) { var commits, e, file, re...
show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() return null unless file? ...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion
completion
show: -> @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() return null unless file? ...
return commits; loadExistingRevForEditor: (editor=@lastActivatedEditor) -> return unless editor.__gitTimeMachine? _.defer => return unless editor.__gitTimeMachine? sourceEditor = editor.__gitTimeMachine.sourceEditor @activateTimeMachineEditorForEditor(sourceEditor) unless editor.isDestro...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
revEditors = _.filter [leftRevEditor, rightRevEditor], (e) -> e != sourceEditor && !e.isDestroyed() revEditor.destroy() for revEditor in revEditors # editor should be the source editor activateTimeMachineEditorForEditor: (sourceEditor) -> return unless sourceEditor.__gitTimeMachine? leftRe...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript revEditors = _.filter [leftRevEditor, rightRevEditor], (e) -> e != sourceEditor && !e.isDestroyed() revEditor.destroy() for revEditor in revEditors # editor should be the source editor activateTimeMachineEditorForEditor: (sourceEditor) -> ...
var i, len, revEditor, revEditors; revEditors = _.filter([leftRevEditor, rightRevEditor], function(e) { return e !== sourceEditor && !e.isDestroyed(); }); for (i = 0, len = revEditors.length; i < len; i++) { revEditor = revEditors[i]; revEditor.destroy(); } ({ // editor should be the source editor activate...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var i, len, revEditor, revEditors; revEditors = _.filter([leftRevEditor, rightRevEditor], function(e) { return e !== sourceEditor && !e.isDestroyed(); }); for (i = 0, len = revEditors.length; i < len; i++) { revEditor = revEditors[i]; revEditor.destroy(); }...
revEditors = _.filter [leftRevEditor, rightRevEditor], (e) -> e != sourceEditor && !e.isDestroyed() revEditor.destroy() for revEditor in revEditors # editor should be the source editor activateTimeMachineEditorForEditor: (sourceEditor) -> return unless sourceEditor.__gitTimeMachine? leftRe...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
revEditors = _.filter [leftRevEditor, rightRevEditor], (e) -> e != sourceEditor && !e.isDestroyed() revEditor.destroy() for revEditor in revEditors # editor should be the source editor activateTimeMachineEditorForEditor: (sourceEditor) -> return unless sourceEditor.__gitTimeMachine? leftRe...
_unbindWindowEvents: () -> $(window).off 'resize', @_onEditorResize _renderPlaceholder: () -> @$element.html("<div class='placeholder'>Select a file in the git repo to see timeline</div>") return _renderCloseHandle: () -> $closeHandle = $("<div class='close-handle'>X</div>") @$element.append...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
_renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)) timeSpan = moment.duration(durationIn...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
164
209
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript _renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0]...
var indexOf = [].indexOf; ({ _renderStats: function(commits) { var authorCount, byAuthor, content, durationInMs, timeSpan; content = ""; if (commits.length > 0) { byAuthor = _.indexBy(commits, 'authorName'); authorCount = _.keys(byAuthor).length; durationInMs = moment.unix(commits[commi...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
164
209
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var indexOf = [].indexOf; ({ _renderStats: function(commits) { var authorCount, byAuthor, content, durationInMs, timeSpan; content = ""; if (commits.length > 0) { byAuthor = _.indexBy(commits, 'authorName'); authorCount = _.keys(byAuthor)...
_renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)) timeSpan = moment.duration(durationIn...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
164
209
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion
completion
_renderStats: (commits) -> content = "" if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)) timeSpan = moment.duration(durationIn...
# order by created asc [@leftRevHash, @rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, @leftRevHash, @rightRevHash) @timeplot.setRevisions(@leftRevHash, @rightRevHash) _onEditorResize: => @render() _orderRevHashes: (revHashA, revHa...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
06e84ea9f4fb753547323df29913a4014992bd0d
1,111
https://github.com/littlebee/git-time-machine/blob/06e84ea9f4fb753547323df29913a4014992bd0d/lib/git-time-machine-view.coffee
164
209
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:raw_corpus
raw_corpus
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @lastActivatedEdi...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor)...
var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor(options.editor); this.render(); } this._...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor...
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @lastActivatedEdi...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:completion
completion
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @lastActivatedEdi...
else @$element.text("") @_renderCloseHandle() @_renderTimeplot(@commits) @_renderStats(@commits) return @$element # Returns an object that can be retrieved when package is activated serialize: -> return null # Tear down any state and detach destroy: -> @_unbindWindowEven...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus
raw_corpus
@timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() return null unless file? try com...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?....
var ref; if ((ref = this.timeplot) != null) { ref.show()({ getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.lastActivatedEditor) { var commits, e, file, ref1, ref2; // get the file name of the original file if on a timemachine editor ...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var ref; if ((ref = this.timeplot) != null) { ref.show()({ getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.lastActivatedEditor) { var commits, e, file, ref1, ref2; // get the file na...
@timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() return null unless file? try com...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion
completion
@timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@lastActivatedEditor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() return null unless file? try com...
return commits; loadExistingRevForEditor: (editor=@lastActivatedEditor) -> return unless editor.__gitTimeMachine? _.defer => return unless editor.__gitTimeMachine? sourceEditor = editor.__gitTimeMachine.sourceEditor @activateTimeMachineEditorForEditor(sourceEditor) unless editor.isDestro...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
revEditors = _.filter [leftRevEditor, rightRevEditor], (e) -> e != sourceEditor revEditor.destroy() for revEditor in revEditors # editor should be the source editor activateTimeMachineEditorForEditor: (sourceEditor) -> return unless sourceEditor.__gitTimeMachine? leftRevEditor = sourceEditor.__gitT...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
revEditors = _.filter [leftRevEditor, rightRevEditor], (e) -> e != sourceEditor revEditor.destroy() for revEditor in revEditors # editor should be the source editor activateTimeMachineEditorForEditor: (sourceEditor) -> return unless sourceEditor.__gitTimeMachine? leftRevEditor = sourceEditor.__gitT...
_renderPlaceholder: () -> @$element.html("<div class='placeholder'>Select a file in the git repo to see timeline</div>") return _renderCloseHandle: () -> $closeHandle = $("<div class='close-handle'>X</div>") @$element.append $closeHandle $closeHandle.on 'mousedown', (e)-> e.preventDefault(...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)) timeSpan = moment.duration(durationInMs).humanize() content = "<span class='tot...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
164
206
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)) timeSpan = moment.duration(d...
var authorCount, byAuthor, content, durationInMs, timeSpan, indexOf = [].indexOf; if (commits.length > 0) { byAuthor = _.indexBy(commits, 'authorName'); authorCount = _.keys(byAuthor).length; durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)); timeSpan...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
164
206
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var authorCount, byAuthor, content, durationInMs, timeSpan, indexOf = [].indexOf; if (commits.length > 0) { byAuthor = _.indexBy(commits, 'authorName'); authorCount = _.keys(byAuthor).length; durationInMs = moment.unix(commits[commits.length - 1].authorDat...
if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)) timeSpan = moment.duration(durationInMs).humanize() content = "<span class='tot...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
164
206
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion
completion
if commits.length > 0 byAuthor = _.indexBy commits, 'authorName' authorCount = _.keys(byAuthor).length durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate)) timeSpan = moment.duration(durationInMs).humanize() content = "<span class='tot...
[@leftRevHash, @rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@lastActivatedEditor, @leftRevHash, @rightRevHash) @timeplot.setRevisions(@leftRevHash, @rightRevHash) _onEditorResize: => @render() _orderRevHashes: (revHashA, revHashB) -> unorderedRevs =...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
75703b677ee79cf71272c8a0ce661914bc18be6a
1,111
https://github.com/littlebee/git-time-machine/blob/75703b677ee79cf71272c8a0ce661914bc18be6a/lib/git-time-machine-view.coffee
164
206
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:raw_corpus
raw_corpus
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @editor || GitRev...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor)...
var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor(options.editor); this.render(); } this._...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var GitTimeMachineView; GitTimeMachineView = class GitTimeMachineView { constructor(serializedState, options = {}) { if (!this.$element) { this.$element = $("<div class='git-time-machine'>"); } if (options.editor != null) { this.setEditor...
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @editor || GitRev...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:completion
completion
class GitTimeMachineView constructor: (serializedState, options={}) -> @$element = $("<div class='git-time-machine'>") unless @$element if options.editor? @setEditor(options.editor) @render() @_bindWindowEvents() setEditor: (editor) -> return if !editor? || editor == @editor || GitRev...
else @$element.text("") @_renderCloseHandle() @_renderTimeplot(@commits) @_renderStats(@commits) return @$element # Returns an object that can be retrieved when package is activated serialize: -> return null # Tear down any state and detach destroy: -> @_unbindWindowEven...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
14
63
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus
raw_corpus
@timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@editor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() return null unless file? try commits = GitLog...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript @timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@editor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() ...
var ref; if ((ref = this.timeplot) != null) { ref.show()({ getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.editor) { var commits, e, file, ref1, ref2; // get the file name of the original file if on a timemachine editor file = (edi...
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var ref; if ((ref = this.timeplot) != null) { ref.show()({ getElement: function() { return this.$element.get(0); }, gitCommitHistory: function(editor = this.editor) { var commits, e, file, ref1, ref2; // get the file name of the ori...
@timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@editor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() return null unless file? try commits = GitLog...
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion
completion
@timeplot?.show() getElement: -> return @$element.get(0) gitCommitHistory: (editor=@editor)-> # get the file name of the original file if on a timemachine editor file = editor?.__gitTimeMachine?.sourceEditor?.getPath() || editor?.getPath() return null unless file? try commits = GitLog...
loadExistingRevForEditor: (editor=@editor) -> return unless editor.__gitTimeMachine? _.defer => return unless editor.__gitTimeMachine? [sourceEditor, revEditor] = [editor.__gitTimeMachine.sourceEditor, editor.__gitTimeMachine.leftRevEditor] unless sourceEditor.isDestroyed() || revEditor.isDe...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
64
113
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
else if @editor.__gitTimeMachine? [sourceEditor, revEditor] = [@editor.__gitTimeMachine.sourceEditor, @editor.__gitTimeMachine.leftRevEditor] GitRevisionView.splitDiff(sourceEditor, revEditor) GitRevisionView.syncScroll(sourceEditor, revEditor) # search the pane left of the curent edi...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
else if @editor.__gitTimeMachine? [sourceEditor, revEditor] = [@editor.__gitTimeMachine.sourceEditor, @editor.__gitTimeMachine.leftRevEditor] GitRevisionView.splitDiff(sourceEditor, revEditor) GitRevisionView.syncScroll(sourceEditor, revEditor) # search the pane left of the curent edi...
otherEditor = if sourceEditor == editor then leftRevEditor else sourceEditor return otherEditor _bindWindowEvents: () -> $(window).on 'resize', @_onEditorResize _unbindWindowEvents: () -> $(window).off 'resize', @_onEditorResize _renderPlaceholder: () -> @$element.html("<div class='placehol...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
# why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _renderStats: (commits) -> ...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
164
213
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion
completion
# why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _renderStats: (commits) -> ...
_onViewRevision: (revHash, reverse) => [leftRevHash, rightRevHash] = if reverse [@leftRevHash, revHash] else [revHash, @rightRevHash] # order by created asc [@leftRevHash, @rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash) GitRevisionView.showRevision(@editor, @leftRevHash, @...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
164
213
littlebee/git-time-machine:lib/git-time-machine-view.coffee:6:raw_corpus
raw_corpus
if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 return orderedRevs.reverse()
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
214
218
littlebee/git-time-machine:lib/git-time-machine-view.coffee:6:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 return orderedRevs.reverse() ```
var ref, ref1, indexOf = [].indexOf; if ((ref = rev.id, indexOf.call(unorderedRevs, ref) >= 0) || (ref1 = rev.hash, indexOf.call(unorderedRevs, ref1) >= 0)) { orderedRevs.push(rev.hash); if (orderedRevs.length >= 2) { break; } } return orderedRevs.reverse();
CoffeeScript
JavaScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
214
218
littlebee/git-time-machine:lib/git-time-machine-view.coffee:6:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var ref, ref1, indexOf = [].indexOf; if ((ref = rev.id, indexOf.call(unorderedRevs, ref) >= 0) || (ref1 = rev.hash, indexOf.call(unorderedRevs, ref1) >= 0)) { orderedRevs.push(rev.hash); if (orderedRevs.length >= 2) { break; } } return orderedRevs.rev...
if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash break if orderedRevs.length >= 2 return orderedRevs.reverse()
JavaScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
214
218
littlebee/git-time-machine:lib/git-time-machine-view.coffee:6:completion
completion
if rev.id in unorderedRevs || rev.hash in unorderedRevs orderedRevs.push rev.hash
break if orderedRevs.length >= 2 return orderedRevs.reverse()
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
f13cb57977b603e055344770bbf572fd9a1bedef
1,111
https://github.com/littlebee/git-time-machine/blob/f13cb57977b603e055344770bbf572fd9a1bedef/lib/git-time-machine-view.coffee
214
218
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
# why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _renderStats: (commits) -> ...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
fa90747a794320d3fefb247b8ef8ec28c07dc20c
1,111
https://github.com/littlebee/git-time-machine/blob/fa90747a794320d3fefb247b8ef8ec28c07dc20c/lib/git-time-machine-view.coffee
164
197
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion
completion
# why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(commits, @_onViewRevision) return _renderStats: (commits) -> ...
content = "<span class='total-commits'>#{commits.length}</span> commits by #{authorCount} authors spanning #{timeSpan}" @$element.append """ <div class='stats'> #{content} </div> """ return _onViewRevision: (@leftRevHash, reverse) => GitRevisionView.showRevision(@editor, @leftRev...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
fa90747a794320d3fefb247b8ef8ec28c07dc20c
1,111
https://github.com/littlebee/git-time-machine/blob/fa90747a794320d3fefb247b8ef8ec28c07dc20c/lib/git-time-machine-view.coffee
164
197
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus
raw_corpus
else if @editor.__gitTimeMachine? [sourceEditor, revEditor] = [@editor.__gitTimeMachine.sourceEditor, @editor.__gitTimeMachine.leftRevEditor] GitRevisionView.splitDiff(sourceEditor, revEditor) GitRevisionView.syncScroll(sourceEditor, revEditor) # search the pane left of the curent edi...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3c041fdbd85f4bd8ed4a2f8a024e41d6719c3402
1,111
https://github.com/littlebee/git-time-machine/blob/3c041fdbd85f4bd8ed4a2f8a024e41d6719c3402/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion
completion
else if @editor.__gitTimeMachine? [sourceEditor, revEditor] = [@editor.__gitTimeMachine.sourceEditor, @editor.__gitTimeMachine.leftRevEditor] GitRevisionView.splitDiff(sourceEditor, revEditor) GitRevisionView.syncScroll(sourceEditor, revEditor) # search the pane left of the curent edi...
otherEditor = if sourceEditor == editor then leftRevEditor else sourceEditor return otherEditor _bindWindowEvents: () -> $(window).on 'resize', @_onEditorResize _unbindWindowEvents: () -> $(window).off 'resize', @_onEditorResize _renderPlaceholder: () -> @$element.html("<div class='placehol...
CoffeeScript
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3c041fdbd85f4bd8ed4a2f8a024e41d6719c3402
1,111
https://github.com/littlebee/git-time-machine/blob/3c041fdbd85f4bd8ed4a2f8a024e41d6719c3402/lib/git-time-machine-view.coffee
114
163
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus
raw_corpus
# why not? instead of adding callback, our own event... atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle") _renderTimeplot: (commits) -> @timeplot ||= new GitTimeplot(@$element) @timeplot.render(@editor, commits, @_onViewRevision) return _renderStats: (commit...
CoffeeScript
littlebee/git-time-machine
lib/git-time-machine-view.coffee
MIT
3c041fdbd85f4bd8ed4a2f8a024e41d6719c3402
1,111
https://github.com/littlebee/git-time-machine/blob/3c041fdbd85f4bd8ed4a2f8a024e41d6719c3402/lib/git-time-machine-view.coffee
164
196