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: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(@editor, commits, @_onViewRevision)
return
_renderStats: (commit... | 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
_onViewRevision: (@leftRevHash, reve... | 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 | 164 | 196 |
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 | b1281e798dab23ff821fd5846246180b5eb51ce2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/b1281e798dab23ff821fd5846246180b5eb51ce2/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 =>
[sourceEditor, revEditor] = [editor.__gitTimeMachine.sourceEditor, editor.__gitTimeMachine.leftRevEditor]
unless sourceEditor.isDestroyed() || revEditor.isDestroyed()
@activateTimeMachineEditorFo... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | b1281e798dab23ff821fd5846246180b5eb51ce2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/b1281e798dab23ff821fd5846246180b5eb51ce2/lib/git-time-machine-view.coffee | 64 | 113 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus | raw_corpus | [sourceEditor, revEditor] = [@editor.__gitTimeMachine.sourceEditor, @editor.__gitTimeMachine.leftRevEditor]
GitRevisionView.splitDiff(sourceEditor, revEditor)
GitRevisionView.syncScroll(sourceEditor, revEditor)
# search the pane left of the curent editor for a time machine rev editor
activateTime... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | b1281e798dab23ff821fd5846246180b5eb51ce2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/b1281e798dab23ff821fd5846246180b5eb51ce2/lib/git-time-machine-view.coffee | 114 | 163 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion | completion | [sourceEditor, revEditor] = [@editor.__gitTimeMachine.sourceEditor, @editor.__gitTimeMachine.leftRevEditor]
GitRevisionView.splitDiff(sourceEditor, revEditor)
GitRevisionView.syncScroll(sourceEditor, revEditor)
# search the pane left of the curent editor for a time machine rev editor
activateTime... | return otherEditor
_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
_renderC... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | b1281e798dab23ff821fd5846246180b5eb51ce2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/b1281e798dab23ff821fd5846246180b5eb51ce2/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus | raw_corpus | _renderTimeplot: (commits) ->
@timeplot ||= new GitTimeplot(@$element)
@timeplot.render(@editor, commits, @_onViewRevision)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
authorCount = _.keys(byAuthor).length
dura... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | b1281e798dab23ff821fd5846246180b5eb51ce2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/b1281e798dab23ff821fd5846246180b5eb51ce2/lib/git-time-machine-view.coffee | 164 | 194 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_renderTimeplot: (commits) ->
@timeplot ||= new GitTimeplot(@$element)
@timeplot.render(@editor, commits, @_onViewRevision)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorNam... | ({
_renderTimeplot: function(commits) {
this.timeplot || (this.timeplot = new GitTimeplot(this.$element));
this.timeplot.render(this.editor, commits, this._onViewRevision);
},
_renderStats: function(commits) {
var authorCount, byAuthor, content, durationInMs, timeSpan;
content = "";
if (commit... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | b1281e798dab23ff821fd5846246180b5eb51ce2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/b1281e798dab23ff821fd5846246180b5eb51ce2/lib/git-time-machine-view.coffee | 164 | 194 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_renderTimeplot: function(commits) {
this.timeplot || (this.timeplot = new GitTimeplot(this.$element));
this.timeplot.render(this.editor, commits, this._onViewRevision);
},
_renderStats: function(commits) {
var authorCount, byAuthor, content, d... | _renderTimeplot: (commits) ->
@timeplot ||= new GitTimeplot(@$element)
@timeplot.render(@editor, commits, @_onViewRevision)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
authorCount = _.keys(byAuthor).length
dura... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | b1281e798dab23ff821fd5846246180b5eb51ce2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/b1281e798dab23ff821fd5846246180b5eb51ce2/lib/git-time-machine-view.coffee | 164 | 194 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion | completion | _renderTimeplot: (commits) ->
@timeplot ||= new GitTimeplot(@$element)
@timeplot.render(@editor, commits, @_onViewRevision)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
authorCount = _.keys(byAuthor).length
dura... | @$element.append """
<div class='stats'>
#{content}
</div>
"""
return
_onViewRevision: (@leftRevHash, reverse) =>
GitRevisionView.showRevision(@editor, @leftRevHash, {reverse: reverse})
_onEditorResize: =>
@render() | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | b1281e798dab23ff821fd5846246180b5eb51ce2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/b1281e798dab23ff821fd5846246180b5eb51ce2/lib/git-time-machine-view.coffee | 164 | 194 |
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
file ... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/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 | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/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
file ... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/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
file ... | 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 | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/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.g... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/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()
r... | 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 = ((re... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/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.g... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/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.g... | loadExistingRevForEditor: (editor=@editor) ->
tmEditor = @activateTimeMachineEditorForEditor(editor)
return false unless tmEditor?
GitRevisionView.splitDiff(editor, tmEditor)
GitRevisionView.syncScroll(editor, tmEditor)
# search the pane left of the curent editor for a time machine rev editor
acti... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/lib/git-time-machine-view.coffee | 64 | 113 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus | raw_corpus | 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 | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/lib/git-time-machine-view.coffee | 114 | 163 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion | completion | 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... | 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(@editor, commits, @_onViewRevision)
return... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:raw_corpus | raw_corpus | _onViewRevision: (@leftRevHash, reverse) =>
GitRevisionView.showRevision(@editor, @leftRevHash, {reverse: reverse})
_onEditorResize: =>
@render() | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/lib/git-time-machine-view.coffee | 164 | 172 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_onViewRevision: (@leftRevHash, reverse) =>
GitRevisionView.showRevision(@editor, @leftRevHash, {reverse: reverse})
_onEditorResize: =>
@render()
``` | ({
_onViewRevision: (leftRevHash, reverse) => {
this.leftRevHash = leftRevHash;
return GitRevisionView.showRevision(this.editor, this.leftRevHash, {
reverse: reverse
});
},
_onEditorResize: () => {
return this.render();
}
}); | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/lib/git-time-machine-view.coffee | 164 | 172 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_onViewRevision: (leftRevHash, reverse) => {
this.leftRevHash = leftRevHash;
return GitRevisionView.showRevision(this.editor, this.leftRevHash, {
reverse: reverse
});
},
_onEditorResize: () => {
return this.render();
}
});
``` | _onViewRevision: (@leftRevHash, reverse) =>
GitRevisionView.showRevision(@editor, @leftRevHash, {reverse: reverse})
_onEditorResize: =>
@render() | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/lib/git-time-machine-view.coffee | 164 | 172 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:5:completion | completion | _onViewRevision: (@leftRevHash, reverse) =>
GitRevisionView.showRevision(@editor, @leftRevHash, {reverse: reverse}) | _onEditorResize: =>
@render() | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0 | 1,111 | https://github.com/littlebee/git-time-machine/blob/badfd2cd7ac47c693c9aaac12df6a2be5d2d2ec0/lib/git-time-machine-view.coffee | 164 | 172 |
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
file ... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/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 | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/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
file ... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/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
file ... | @$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: ->
@_unbindWindowEvents()
@$... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/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 | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/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 | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/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 | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/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 ... | GitRevisionView.splitDiff(editor, tmEditor)
GitRevisionView.syncScroll(editor, tmEditor)
# search the pane left of the curent editor for a time machine rev editor
activateTimeMachineEditorForEditor: (editor=@editor) ->
# null unless in a Time Machine - ... tab
fileName = editor.getFileName?()
tmRe... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/lib/git-time-machine-view.coffee | 64 | 113 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus | raw_corpus | itemBaseName = path.basename(itemFileName)
if itemBaseName.match(tmRevFileName)
tmEditor = item
unless searchPane.getActiveItem() == tmEditor
searchPane.activateItem(tmEditor) # bring it forward and stay on it
searchPane.activate()
break
else
t... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/lib/git-time-machine-view.coffee | 114 | 163 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion | completion | itemBaseName = path.basename(itemFileName)
if itemBaseName.match(tmRevFileName)
tmEditor = item
unless searchPane.getActiveItem() == tmEditor
searchPane.activateItem(tmEditor) # bring it forward and stay on it
searchPane.activate()
break
else
t... | _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 | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/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 | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/lib/git-time-machine-view.coffee | 164 | 184 | ||
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;
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(durat... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/lib/git-time-machine-view.coffee | 164 | 184 |
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;
if (commits.length > 0) {
byAuthor = _.indexBy(commits, 'authorName');
authorCount = _.keys(byAuthor).length;
durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(comm... | 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 | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/lib/git-time-machine-view.coffee | 164 | 184 |
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... | """
return
_onViewRevision: (revHash, reverse) =>
GitRevisionView.showRevision(@editor, revHash, {reverse: reverse})
_onEditorResize: =>
@render() | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e89e6fd9f76d566d583c4163f4ed58a56da74f71 | 1,111 | https://github.com/littlebee/git-time-machine/blob/e89e6fd9f76d566d583c4163f4ed58a56da74f71/lib/git-time-machine-view.coffee | 164 | 184 |
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 | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/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 | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/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 | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/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... | @$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: ->
@_unbindWindowEvents()
@$... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/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 | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/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 | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/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 | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/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 = $("<div class='close-handle'>X</div>")
@$element.append... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/lib/git-time-machine-view.coffee | 64 | 113 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus | raw_corpus | @timeplot.render(@editor, commits, @_onViewRevision)
return
_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... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/lib/git-time-machine-view.coffee | 114 | 139 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion | completion | @timeplot.render(@editor, commits, @_onViewRevision)
return
_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... | <div class='stats'>
#{content}
</div>
"""
return
_onViewRevision: (revHash, reverse) =>
GitRevisionView.showRevision(@editor, revHash, {reverse: reverse})
_onEditorResize: =>
@render() | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | ec0b167fb79c1ba3d94d57308bdb843281b6ceb3 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ec0b167fb79c1ba3d94d57308bdb843281b6ceb3/lib/git-time-machine-view.coffee | 114 | 139 |
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 | 77d37bbd6109f15a2b0ff38da96bff10cac77e47 | 1,111 | https://github.com/littlebee/git-time-machine/blob/77d37bbd6109f15a2b0ff38da96bff10cac77e47/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 | 77d37bbd6109f15a2b0ff38da96bff10cac77e47 | 1,111 | https://github.com/littlebee/git-time-machine/blob/77d37bbd6109f15a2b0ff38da96bff10cac77e47/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 | 77d37bbd6109f15a2b0ff38da96bff10cac77e47 | 1,111 | https://github.com/littlebee/git-time-machine/blob/77d37bbd6109f15a2b0ff38da96bff10cac77e47/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 ... | _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
_renderCloseHandle: () ->
$... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 77d37bbd6109f15a2b0ff38da96bff10cac77e47 | 1,111 | https://github.com/littlebee/git-time-machine/blob/77d37bbd6109f15a2b0ff38da96bff10cac77e47/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(@editor, commits, @_onViewRevision)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
authorCount = _.keys(byAuthor).length
dura... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 77d37bbd6109f15a2b0ff38da96bff10cac77e47 | 1,111 | https://github.com/littlebee/git-time-machine/blob/77d37bbd6109f15a2b0ff38da96bff10cac77e47/lib/git-time-machine-view.coffee | 114 | 145 | ||
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(@editor, commits, @_onViewRevision)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorNam... | ({
_renderTimeplot: function(commits) {
this.timeplot || (this.timeplot = new GitTimeplot(this.$element));
this.timeplot.render(this.editor, commits, this._onViewRevision);
},
_renderStats: function(commits) {
var authorCount, byAuthor, content, durationInMs, timeSpan;
content = "";
if (commit... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 77d37bbd6109f15a2b0ff38da96bff10cac77e47 | 1,111 | https://github.com/littlebee/git-time-machine/blob/77d37bbd6109f15a2b0ff38da96bff10cac77e47/lib/git-time-machine-view.coffee | 114 | 145 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_renderTimeplot: function(commits) {
this.timeplot || (this.timeplot = new GitTimeplot(this.$element));
this.timeplot.render(this.editor, commits, this._onViewRevision);
},
_renderStats: function(commits) {
var authorCount, byAuthor, content, d... | _renderTimeplot: (commits) ->
@timeplot ||= new GitTimeplot(@$element)
@timeplot.render(@editor, commits, @_onViewRevision)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
authorCount = _.keys(byAuthor).length
dura... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 77d37bbd6109f15a2b0ff38da96bff10cac77e47 | 1,111 | https://github.com/littlebee/git-time-machine/blob/77d37bbd6109f15a2b0ff38da96bff10cac77e47/lib/git-time-machine-view.coffee | 114 | 145 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion | completion | _renderTimeplot: (commits) ->
@timeplot ||= new GitTimeplot(@$element)
@timeplot.render(@editor, commits, @_onViewRevision)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
authorCount = _.keys(byAuthor).length
dura... | #{content}
</div>
"""
return
_onViewRevision: (revHash) =>
GitRevisionView.showRevision(@editor, revHash)
_onEditorResize: =>
@render() | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 77d37bbd6109f15a2b0ff38da96bff10cac77e47 | 1,111 | https://github.com/littlebee/git-time-machine/blob/77d37bbd6109f15a2b0ff38da96bff10cac77e47/lib/git-time-machine-view.coffee | 114 | 145 |
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 | 820c8466c0e34cbd8985716368a9b54ae27b16cd | 1,111 | https://github.com/littlebee/git-time-machine/blob/820c8466c0e34cbd8985716368a9b54ae27b16cd/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 | 820c8466c0e34cbd8985716368a9b54ae27b16cd | 1,111 | https://github.com/littlebee/git-time-machine/blob/820c8466c0e34cbd8985716368a9b54ae27b16cd/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 | 820c8466c0e34cbd8985716368a9b54ae27b16cd | 1,111 | https://github.com/littlebee/git-time-machine/blob/820c8466c0e34cbd8985716368a9b54ae27b16cd/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 = $("<div class='close-handle'>X</div>")
@$element.append... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 820c8466c0e34cbd8985716368a9b54ae27b16cd | 1,111 | https://github.com/littlebee/git-time-machine/blob/820c8466c0e34cbd8985716368a9b54ae27b16cd/lib/git-time-machine-view.coffee | 64 | 113 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus | raw_corpus | @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].authorDate).diff(moment.unix(commits[0].author... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 820c8466c0e34cbd8985716368a9b54ae27b16cd | 1,111 | https://github.com/littlebee/git-time-machine/blob/820c8466c0e34cbd8985716368a9b54ae27b16cd/lib/git-time-machine-view.coffee | 114 | 135 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion | completion | @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].authorDate).diff(moment.unix(commits[0].author... | 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 | 820c8466c0e34cbd8985716368a9b54ae27b16cd | 1,111 | https://github.com/littlebee/git-time-machine/blob/820c8466c0e34cbd8985716368a9b54ae27b16cd/lib/git-time-machine-view.coffee | 114 | 135 |
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()
setEditor: (editor) ->
return unless editor != @editor
file = editor?.getPath()
return unl... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b | 1,111 | https://github.com/littlebee/git-time-machine/blob/e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b/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()
setEditor: (editor) ->
return unless edit... | 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();
}
}
set... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b | 1,111 | https://github.com/littlebee/git-time-machine/blob/e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b/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()
setEditor: (editor) ->
return unless editor != @editor
file = editor?.getPath()
return unl... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b | 1,111 | https://github.com/littlebee/git-time-machine/blob/e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b/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()
setEditor: (editor) ->
return unless editor != @editor
file = editor?.getPath()
return unl... | @_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: ->
return @$element.remove()
hide: ->
@timeplot?.hide() # so it knows to hide the popup
show: ->
@... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b | 1,111 | https://github.com/littlebee/git-time-machine/blob/e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b/lib/git-time-machine-view.coffee | 14 | 63 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | 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 null
atom.notifications.addError String ... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b | 1,111 | https://github.com/littlebee/git-time-machine/blob/e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b/lib/git-time-machine-view.coffee | 64 | 113 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion | completion | 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 null
atom.notifications.addError String ... | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
_renderTimeline: (commits) ->
@timep... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b | 1,111 | https://github.com/littlebee/git-time-machine/blob/e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b/lib/git-time-machine-view.coffee | 64 | 113 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus | raw_corpus | #{content}
</div>
"""
return | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b | 1,111 | https://github.com/littlebee/git-time-machine/blob/e7e874e5aa9c5e38e249bbd1fb93fd5f21d5966b/lib/git-time-machine-view.coffee | 114 | 117 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?
if e.message.match('File not a git repository') || str.weaklyHas(e.message, "is outside repository")
atom.notifications.addError "Error: Not in a git repos... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | f6de733dc17ac33133ee2b01b7337d882797b643 | 1,111 | https://github.com/littlebee/git-time-machine/blob/f6de733dc17ac33133ee2b01b7337d882797b643/lib/git-time-machine-view.coffee | 62 | 111 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion | completion | gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?
if e.message.match('File not a git repository') || str.weaklyHas(e.message, "is outside repository")
atom.notifications.addError "Error: Not in a git repos... | e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
_renderTimeline: (commits) ->
@timeplot ||= new GitTimeplot(@$element)
@timeplot.render(@editor, c... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | f6de733dc17ac33133ee2b01b7337d882797b643 | 1,111 | https://github.com/littlebee/git-time-machine/blob/f6de733dc17ac33133ee2b01b7337d882797b643/lib/git-time-machine-view.coffee | 62 | 111 |
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()
setEditor: (editor) ->
file = editor?.getPath()
return unless file? && !str.startsWith(path.ba... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 992d13a942be9ddccace3aafbbd0ffc818630843 | 1,111 | https://github.com/littlebee/git-time-machine/blob/992d13a942be9ddccace3aafbbd0ffc818630843/lib/git-time-machine-view.coffee | 12 | 61 | ||
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()
setEditor: (editor) ->
file = editor?.get... | 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();
}
}
set... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 992d13a942be9ddccace3aafbbd0ffc818630843 | 1,111 | https://github.com/littlebee/git-time-machine/blob/992d13a942be9ddccace3aafbbd0ffc818630843/lib/git-time-machine-view.coffee | 12 | 61 |
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()
setEditor: (editor) ->
file = editor?.getPath()
return unless file? && !str.startsWith(path.ba... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 992d13a942be9ddccace3aafbbd0ffc818630843 | 1,111 | https://github.com/littlebee/git-time-machine/blob/992d13a942be9ddccace3aafbbd0ffc818630843/lib/git-time-machine-view.coffee | 12 | 61 |
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()
setEditor: (editor) ->
file = editor?.getPath()
return unless file? && !str.startsWith(path.ba... | return @$element
# Returns an object that can be retrieved when package is activated
serialize: ->
return null
# Tear down any state and detach
destroy: ->
return @$element.remove()
hide: ->
@timeplot?.hide() # so it knows to hide the popup
show: ->
@timeplot?.show()
getElement... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 992d13a942be9ddccace3aafbbd0ffc818630843 | 1,111 | https://github.com/littlebee/git-time-machine/blob/992d13a942be9ddccace3aafbbd0ffc818630843/lib/git-time-machine-view.coffee | 12 | 61 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?
if e.message.match('File not a git repository') || str.weaklyHas(e.message, "is outside repository")
atom.notifications.addError "Error: Not in a git repos... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 992d13a942be9ddccace3aafbbd0ffc818630843 | 1,111 | https://github.com/littlebee/git-time-machine/blob/992d13a942be9ddccace3aafbbd0ffc818630843/lib/git-time-machine-view.coffee | 62 | 111 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?
if e.message.match('File not a git repository') || str.weaklyHas(e.message, "is outside repository")
... | ({
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) {
if (e.message.match('File not a git repository') || str.weaklyHa... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 992d13a942be9ddccace3aafbbd0ffc818630843 | 1,111 | https://github.com/littlebee/git-time-machine/blob/992d13a942be9ddccace3aafbbd0ffc818630843/lib/git-time-machine-view.coffee | 62 | 111 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
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) {
if (e.mes... | gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?
if e.message.match('File not a git repository') || str.weaklyHas(e.message, "is outside repository")
atom.notifications.addError "Error: Not in a git repos... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 992d13a942be9ddccace3aafbbd0ffc818630843 | 1,111 | https://github.com/littlebee/git-time-machine/blob/992d13a942be9ddccace3aafbbd0ffc818630843/lib/git-time-machine-view.coffee | 62 | 111 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion | completion | gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?
if e.message.match('File not a git repository') || str.weaklyHas(e.message, "is outside repository")
atom.notifications.addError "Error: Not in a git repos... | e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
_renderTimeline: (commits) ->
@timeplot ||= new GitTimeplot(@$element)
@timeplot.render(@editor, commits)
return
_renderStats... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 992d13a942be9ddccace3aafbbd0ffc818630843 | 1,111 | https://github.com/littlebee/git-time-machine/blob/992d13a942be9ddccace3aafbbd0ffc818630843/lib/git-time-machine-view.coffee | 62 | 111 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?.match 'Not a git repository'
atom.notifications.addError "Error: Not in a git repository"
return null
atom.notifications.addError String e
return... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 31cbbbb0e8b206f8800a49fa98700025ff962f34 | 1,111 | https://github.com/littlebee/git-time-machine/blob/31cbbbb0e8b206f8800a49fa98700025ff962f34/lib/git-time-machine-view.coffee | 62 | 111 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?.match 'Not a git repository'
atom.notifications.addError "Error: Not in a git repository"
return nul... | ({
gitCommitHistory: function(file = this.file) {
var commits, e, ref;
if (file == null) {
return null;
}
try {
commits = GitLog.getCommitHistory(file);
} catch (error) {
e = error;
if ((ref = e.message) != null ? ref.match('Not a git repository') : void 0) {
atom.n... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 31cbbbb0e8b206f8800a49fa98700025ff962f34 | 1,111 | https://github.com/littlebee/git-time-machine/blob/31cbbbb0e8b206f8800a49fa98700025ff962f34/lib/git-time-machine-view.coffee | 62 | 111 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
gitCommitHistory: function(file = this.file) {
var commits, e, ref;
if (file == null) {
return null;
}
try {
commits = GitLog.getCommitHistory(file);
} catch (error) {
e = error;
if ((ref = e.message) != null ? ref.m... | gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?.match 'Not a git repository'
atom.notifications.addError "Error: Not in a git repository"
return null
atom.notifications.addError String e
return... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 31cbbbb0e8b206f8800a49fa98700025ff962f34 | 1,111 | https://github.com/littlebee/git-time-machine/blob/31cbbbb0e8b206f8800a49fa98700025ff962f34/lib/git-time-machine-view.coffee | 62 | 111 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion | completion | gitCommitHistory: (file=@file)->
return null unless file?
try
commits = GitLog.getCommitHistory file
catch e
if e.message?.match 'Not a git repository'
atom.notifications.addError "Error: Not in a git repository"
return null
atom.notifications.addError String e
return... | # why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
_renderTimeline: (commits) ->
@timeplot ||= new GitTimeplot(@$element)
@timeplot.render(@editor, commits)
return
_renderStats: (commits) ->
content... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 31cbbbb0e8b206f8800a49fa98700025ff962f34 | 1,111 | https://github.com/littlebee/git-time-machine/blob/31cbbbb0e8b206f8800a49fa98700025ff962f34/lib/git-time-machine-view.coffee | 62 | 111 |
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()
setEditor: (editor) ->
file = editor?.getPath()
return unless file? && !str.startsWith(path.ba... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2/lib/git-time-machine-view.coffee | 12 | 61 | ||
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()
setEditor: (editor) ->
file = editor?.get... | 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();
}
}
set... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2/lib/git-time-machine-view.coffee | 12 | 61 |
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()
setEditor: (editor) ->
file = editor?.getPath()
return unless file? && !str.startsWith(path.ba... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2/lib/git-time-machine-view.coffee | 12 | 61 |
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()
setEditor: (editor) ->
file = editor?.getPath()
return unless file? && !str.startsWith(path.ba... | # Returns an object that can be retrieved when package is activated
serialize: ->
return null
# Tear down any state and detach
destroy: ->
return @$element.remove()
hide: ->
@timeplot?.hide() # so it knows to hide the popup
show: ->
@timeplot?.show()
getElement: ->
return @$ele... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2/lib/git-time-machine-view.coffee | 12 | 61 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | _renderTimeline: () ->
@timeplot ||= new GitTimeplot(@$element)
try
commits = GitLog.getCommitHistory @file
catch e
if e.message?.match 'Not a git repository'
atom.notifications.addError "Error: Not in a git repository"
return
atom.notifications.addError String e
retu... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2/lib/git-time-machine-view.coffee | 62 | 92 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_renderTimeline: () ->
@timeplot ||= new GitTimeplot(@$element)
try
commits = GitLog.getCommitHistory @file
catch e
if e.message?.match 'Not a git repository'
atom.notifications.addError "Error: Not in a git repository"
ret... | ({
_renderTimeline: function() {
var commits, e, ref;
this.timeplot || (this.timeplot = new GitTimeplot(this.$element));
try {
commits = GitLog.getCommitHistory(this.file);
} catch (error) {
e = error;
if ((ref = e.message) != null ? ref.match('Not a git repository') : void 0) {
... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2/lib/git-time-machine-view.coffee | 62 | 92 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_renderTimeline: function() {
var commits, e, ref;
this.timeplot || (this.timeplot = new GitTimeplot(this.$element));
try {
commits = GitLog.getCommitHistory(this.file);
} catch (error) {
e = error;
if ((ref = e.message) != nu... | _renderTimeline: () ->
@timeplot ||= new GitTimeplot(@$element)
try
commits = GitLog.getCommitHistory @file
catch e
if e.message?.match 'Not a git repository'
atom.notifications.addError "Error: Not in a git repository"
return
atom.notifications.addError String e
retu... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2/lib/git-time-machine-view.coffee | 62 | 92 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion | completion | _renderTimeline: () ->
@timeplot ||= new GitTimeplot(@$element)
try
commits = GitLog.getCommitHistory @file
catch e
if e.message?.match 'Not a git repository'
atom.notifications.addError "Error: Not in a git repository"
return
atom.notifications.addError String e
retu... | _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 | dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2 | 1,111 | https://github.com/littlebee/git-time-machine/blob/dbec7e329762e6f5bc0b1ccc37b8e97bff796ad2/lib/git-time-machine-view.coffee | 62 | 92 |
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()
setEditor: (editor) ->
file = editor?.getPath()
return unless file? && !str.startsWith(path.ba... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 8f2ee64fa394d54b9a33be25c5cc5ad2499535e8 | 1,111 | https://github.com/littlebee/git-time-machine/blob/8f2ee64fa394d54b9a33be25c5cc5ad2499535e8/lib/git-time-machine-view.coffee | 12 | 61 | ||
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()
setEditor: (editor) ->
file = editor?.get... | 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();
}
}
set... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 8f2ee64fa394d54b9a33be25c5cc5ad2499535e8 | 1,111 | https://github.com/littlebee/git-time-machine/blob/8f2ee64fa394d54b9a33be25c5cc5ad2499535e8/lib/git-time-machine-view.coffee | 12 | 61 |
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()
setEditor: (editor) ->
file = editor?.getPath()
return unless file? && !str.startsWith(path.ba... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 8f2ee64fa394d54b9a33be25c5cc5ad2499535e8 | 1,111 | https://github.com/littlebee/git-time-machine/blob/8f2ee64fa394d54b9a33be25c5cc5ad2499535e8/lib/git-time-machine-view.coffee | 12 | 61 |
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()
setEditor: (editor) ->
file = editor?.getPath()
return unless file? && !str.startsWith(path.ba... | return @$element
# Returns an object that can be retrieved when package is activated
serialize: ->
return null
# Tear down any state and detach
destroy: ->
return @$element.remove()
hide: ->
@timeplot?.hide() # so it knows to hide the popup
show: ->
@timeplot?.show()
getElement... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 8f2ee64fa394d54b9a33be25c5cc5ad2499535e8 | 1,111 | https://github.com/littlebee/git-time-machine/blob/8f2ee64fa394d54b9a33be25c5cc5ad2499535e8/lib/git-time-machine-view.coffee | 12 | 61 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | _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 | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 8f2ee64fa394d54b9a33be25c5cc5ad2499535e8 | 1,111 | https://github.com/littlebee/git-time-machine/blob/8f2ee64fa394d54b9a33be25c5cc5ad2499535e8/lib/git-time-machine-view.coffee | 62 | 98 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_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
$... | ({
_renderPlaceholder: function() {
this.$element.html("<div class='placeholder'>Select a file in the git repo to see timeline</div>");
},
_renderCloseHandle: function() {
var $closeHandle;
$closeHandle = $("<div class='close-handle'>X</div>");
this.$element.append($closeHandle);
return $close... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 8f2ee64fa394d54b9a33be25c5cc5ad2499535e8 | 1,111 | https://github.com/littlebee/git-time-machine/blob/8f2ee64fa394d54b9a33be25c5cc5ad2499535e8/lib/git-time-machine-view.coffee | 62 | 98 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_renderPlaceholder: function() {
this.$element.html("<div class='placeholder'>Select a file in the git repo to see timeline</div>");
},
_renderCloseHandle: function() {
var $closeHandle;
$closeHandle = $("<div class='close-handle'>X</div>");
... | _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(... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 8f2ee64fa394d54b9a33be25c5cc5ad2499535e8 | 1,111 | https://github.com/littlebee/git-time-machine/blob/8f2ee64fa394d54b9a33be25c5cc5ad2499535e8/lib/git-time-machine-view.coffee | 62 | 98 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion | completion | _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(... | @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 | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 8f2ee64fa394d54b9a33be25c5cc5ad2499535e8 | 1,111 | https://github.com/littlebee/git-time-machine/blob/8f2ee64fa394d54b9a33be25c5cc5ad2499535e8/lib/git-time-machine-view.coffee | 62 | 98 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | _renderTimeline: () ->
@timeplot ||= new GitTimeplot(@$element)
commits = GitLog.getCommitHistory @file
@timeplot.render(@editor, commits)
@_renderStats(commits)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
au... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 98b864ebf66d473e0c559fbc6004982c7fc378cb | 1,111 | https://github.com/littlebee/git-time-machine/blob/98b864ebf66d473e0c559fbc6004982c7fc378cb/lib/git-time-machine-view.coffee | 62 | 84 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_renderTimeline: () ->
@timeplot ||= new GitTimeplot(@$element)
commits = GitLog.getCommitHistory @file
@timeplot.render(@editor, commits)
@_renderStats(commits)
return
_renderStats: (commits) ->
content = ""
if commits.length > 0
... | ({
_renderTimeline: function() {
var commits;
this.timeplot || (this.timeplot = new GitTimeplot(this.$element));
commits = GitLog.getCommitHistory(this.file);
this.timeplot.render(this.editor, commits);
this._renderStats(commits);
},
_renderStats: function(commits) {
var authorCount, byAut... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 98b864ebf66d473e0c559fbc6004982c7fc378cb | 1,111 | https://github.com/littlebee/git-time-machine/blob/98b864ebf66d473e0c559fbc6004982c7fc378cb/lib/git-time-machine-view.coffee | 62 | 84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.