Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #28 from atom/wl-cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
Wliu authored Nov 4, 2017
2 parents 5aadd57 + 153de76 commit 57b44ef
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
15 changes: 10 additions & 5 deletions lib/cache-panel-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ export default class CachePanelView {
<div className='panel-body padded'>
<div className='timing'>
<span className='inline-block'>CoffeeScript files compiled</span>
<span className='inline-block highlight-info' ref='coffeeCompileCount'>0</span>
<span className='inline-block' ref='coffeeCompileCount'>Loading…</span>
</div>

<div className='timing'>
<span className='inline-block'>Babel files compiled</span>
<span className='inline-block highlight-info' ref='babelCompileCount' />
<span className='inline-block' ref='babelCompileCount'>Loading…</span>
</div>

<div className='timing'>
<span className='inline-block'>Typescript files compiled</span>
<span className='inline-block highlight-info' ref='typescriptCompileCount' />
<span className='inline-block' ref='typescriptCompileCount'>Loading…</span>
</div>

<div className='timing'>
<span className='inline-block'>CSON files compiled</span>
<span className='inline-block highlight-info' ref='csonCompileCount' />
<span className='inline-block' ref='csonCompileCount'>Loading…</span>
</div>

<div className='timing'>
<span className='inline-block'>Less files compiled</span>
<span className='inline-block highlight-info' ref='lessCompileCount' />
<span className='inline-block' ref='lessCompileCount'>Loading…</span>
</div>
</div>
</div>
Expand All @@ -54,12 +54,17 @@ export default class CachePanelView {
populate () {
const compileCacheStats = this.getCompileCacheStats()
if (compileCacheStats) {
this.refs.coffeeCompileCount.classList.add('highlight-info')
this.refs.coffeeCompileCount.textContent = compileCacheStats['.coffee'].misses
this.refs.babelCompileCount.classList.add('highlight-info')
this.refs.babelCompileCount.textContent = compileCacheStats['.js'].misses
this.refs.typescriptCompileCount.classList.add('highlight-info')
this.refs.typescriptCompileCount.textContent = compileCacheStats['.ts'].misses
}

this.refs.csonCompileCount.classList.add('highlight-info')
this.refs.csonCompileCount.textContent = this.getCsonCompiles()
this.refs.lessCompileCount.classList.add('highlight-info')
this.refs.lessCompileCount.textContent = this.getLessCompiles()
}

Expand Down
2 changes: 1 addition & 1 deletion lib/package-panel-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class PackagePanelView {
<div className='inset-panel'>
<div className='panel-heading'>{this.title}</div>
<div className='panel-body padded'>
<div className='text-info' ref='summary' />
<div className='text-info' ref='summary'>Loading…</div>
<ul className='list-group' ref='list' />
</div>
</div>
Expand Down
14 changes: 2 additions & 12 deletions lib/timecop-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import _ from 'underscore-plus'
import dedent from 'dedent'
import {Disposable} from 'atom'
import etch from 'etch'
import CachePanelView from './cache-panel-view'
import PackagePanelView from './package-panel-view'
Expand All @@ -13,11 +12,10 @@ export default class TimecopView {
constructor ({uri}) {
this.uri = uri
etch.initialize(this)
if (atom.packages.getActivePackages().length > 0) {
if (atom.packages.hasActivatedInitialPackages()) {
this.populateViews()
} else {
// Render on next tick so packages have been activated
setImmediate(() => { this.populateViews() })
atom.packages.onDidActivateInitialPackages(() => this.populateViews())
}
}

Expand Down Expand Up @@ -127,12 +125,4 @@ export default class TimecopView {
getIconName () {
return 'dashboard'
}

onDidChangeTitle () {
return new Disposable(function () {})
}

onDidChangeModified () {
return new Disposable(function () {})
}
}
10 changes: 5 additions & 5 deletions lib/window-panel-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@ export default class WindowPanelView {
<div className='panel-body padded'>
<div className='timing' ref='windowTiming'>
<span className='inline-block'>Window load time</span>
<span className='inline-block' ref='windowLoadTime' />
<span className='inline-block' ref='windowLoadTime'>Loading…</span>
</div>

<div className='timing' ref='shellTiming'>
<span className='inline-block'>Shell load time</span>
<span className='inline-block' ref='shellLoadTime' />
<span className='inline-block' ref='shellLoadTime'>Loading…</span>
</div>

<div ref='deserializeTimings'>
<div className='timing' ref='workspaceTiming'>
<span className='inline-block'>Workspace load time</span>
<span className='inline-block' ref='workspaceLoadTime' />
<span className='inline-block' ref='workspaceLoadTime'>Loading…</span>
</div>

<div className='timing' ref='projectTiming'>
<span className='inline-block'>Project load time</span>
<span className='inline-block' ref='projectLoadTime' />
<span className='inline-block' ref='projectLoadTime'>Loading…</span>
</div>

<div className='timing' ref='atomTiming'>
<span className='inline-block'>Window state load time</span>
<span className='inline-block' ref='atomLoadTime' />
<span className='inline-block' ref='atomLoadTime'>Loading…</span>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions spec/timecop-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe('Timecop', () => {

spyOn(atom.packages, 'getLoadedPackages').andReturn(packages)
spyOn(atom.packages, 'getActivePackages').andReturn(packages)
spyOn(atom.packages, 'hasActivatedInitialPackages').andReturn(true)

timecopView = await atom.workspace.open('atom://timecop')
})
Expand Down

0 comments on commit 57b44ef

Please sign in to comment.