文件操作 - __package-name__.js.template
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/atom/resources/app/apm/templates/package-javascript/lib/__package-name__.js.template
编辑文件内容
'use babel'; import __PackageName__View from './__package-name__-view'; import { CompositeDisposable } from 'atom'; export default { __packageName__View: null, modalPanel: null, subscriptions: null, activate(state) { this.__packageName__View = new __PackageName__View(state.__packageName__ViewState); this.modalPanel = atom.workspace.addModalPanel({ item: this.__packageName__View.getElement(), visible: false }); // Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable this.subscriptions = new CompositeDisposable(); // Register command that toggles this view this.subscriptions.add(atom.commands.add('atom-workspace', { '__package-name__:toggle': () => this.toggle() })); }, deactivate() { this.modalPanel.destroy(); this.subscriptions.dispose(); this.__packageName__View.destroy(); }, serialize() { return { __packageName__ViewState: this.__packageName__View.serialize() }; }, toggle() { console.log('__PackageName__ was toggled!'); return ( this.modalPanel.isVisible() ? this.modalPanel.hide() : this.modalPanel.show() ); } };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件