Romeves files that won't be used for now
This commit is contained in:
parent
7d4ad4f859
commit
a59b24af04
@ -1,11 +0,0 @@
|
|||||||
# Keybindings require three things to be fully defined: A selector that is
|
|
||||||
# matched against the focused element, the keystroke and the command to
|
|
||||||
# execute.
|
|
||||||
#
|
|
||||||
# Below is a basic keybinding which registers on all platforms by applying to
|
|
||||||
# the root workspace element.
|
|
||||||
|
|
||||||
# For more detailed documentation see
|
|
||||||
# https://atom.io/docs/latest/behind-atom-keymaps-in-depth
|
|
||||||
'atom-workspace':
|
|
||||||
'ctrl-alt-o': 'language-mzn:toggle'
|
|
@ -1,22 +0,0 @@
|
|||||||
module.exports =
|
|
||||||
class LanguageMznView
|
|
||||||
constructor: (serializedState) ->
|
|
||||||
# Create root element
|
|
||||||
@element = document.createElement('div')
|
|
||||||
@element.classList.add('language-mzn')
|
|
||||||
|
|
||||||
# Create message element
|
|
||||||
message = document.createElement('div')
|
|
||||||
message.textContent = "The LanguageMzn package is Alive! It's ALIVE!"
|
|
||||||
message.classList.add('message')
|
|
||||||
@element.appendChild(message)
|
|
||||||
|
|
||||||
# Returns an object that can be retrieved when package is activated
|
|
||||||
serialize: ->
|
|
||||||
|
|
||||||
# Tear down any state and detach
|
|
||||||
destroy: ->
|
|
||||||
@element.remove()
|
|
||||||
|
|
||||||
getElement: ->
|
|
||||||
@element
|
|
@ -1,33 +0,0 @@
|
|||||||
LanguageMznView = require './language-mzn-view'
|
|
||||||
{CompositeDisposable} = require 'atom'
|
|
||||||
|
|
||||||
module.exports = LanguageMzn =
|
|
||||||
languageMznView: null
|
|
||||||
modalPanel: null
|
|
||||||
subscriptions: null
|
|
||||||
|
|
||||||
activate: (state) ->
|
|
||||||
@languageMznView = new LanguageMznView(state.languageMznViewState)
|
|
||||||
@modalPanel = atom.workspace.addModalPanel(item: @languageMznView.getElement(), visible: false)
|
|
||||||
|
|
||||||
# Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable
|
|
||||||
@subscriptions = new CompositeDisposable
|
|
||||||
|
|
||||||
# Register command that toggles this view
|
|
||||||
@subscriptions.add atom.commands.add 'atom-workspace', 'language-mzn:toggle': => @toggle()
|
|
||||||
|
|
||||||
deactivate: ->
|
|
||||||
@modalPanel.destroy()
|
|
||||||
@subscriptions.dispose()
|
|
||||||
@languageMznView.destroy()
|
|
||||||
|
|
||||||
serialize: ->
|
|
||||||
languageMznViewState: @languageMznView.serialize()
|
|
||||||
|
|
||||||
toggle: ->
|
|
||||||
console.log 'LanguageMzn was toggled!'
|
|
||||||
|
|
||||||
if @modalPanel.isVisible()
|
|
||||||
@modalPanel.hide()
|
|
||||||
else
|
|
||||||
@modalPanel.show()
|
|
@ -1,22 +0,0 @@
|
|||||||
# See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details
|
|
||||||
'context-menu':
|
|
||||||
'atom-text-editor': [
|
|
||||||
{
|
|
||||||
'label': 'Toggle language-mzn'
|
|
||||||
'command': 'language-mzn:toggle'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
'menu': [
|
|
||||||
{
|
|
||||||
'label': 'Packages'
|
|
||||||
'submenu': [
|
|
||||||
'label': 'language-mzn'
|
|
||||||
'submenu': [
|
|
||||||
{
|
|
||||||
'label': 'Toggle'
|
|
||||||
'command': 'language-mzn:toggle'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
@ -1,62 +0,0 @@
|
|||||||
LanguageMzn = require '../lib/language-mzn'
|
|
||||||
|
|
||||||
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
|
|
||||||
#
|
|
||||||
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
|
|
||||||
# or `fdescribe`). Remove the `f` to unfocus the block.
|
|
||||||
|
|
||||||
describe "LanguageMzn", ->
|
|
||||||
[workspaceElement, activationPromise] = []
|
|
||||||
|
|
||||||
beforeEach ->
|
|
||||||
workspaceElement = atom.views.getView(atom.workspace)
|
|
||||||
activationPromise = atom.packages.activatePackage('language-mzn')
|
|
||||||
|
|
||||||
describe "when the language-mzn:toggle event is triggered", ->
|
|
||||||
it "hides and shows the modal panel", ->
|
|
||||||
# Before the activation event the view is not on the DOM, and no panel
|
|
||||||
# has been created
|
|
||||||
expect(workspaceElement.querySelector('.language-mzn')).not.toExist()
|
|
||||||
|
|
||||||
# This is an activation event, triggering it will cause the package to be
|
|
||||||
# activated.
|
|
||||||
atom.commands.dispatch workspaceElement, 'language-mzn:toggle'
|
|
||||||
|
|
||||||
waitsForPromise ->
|
|
||||||
activationPromise
|
|
||||||
|
|
||||||
runs ->
|
|
||||||
expect(workspaceElement.querySelector('.language-mzn')).toExist()
|
|
||||||
|
|
||||||
languageMznElement = workspaceElement.querySelector('.language-mzn')
|
|
||||||
expect(languageMznElement).toExist()
|
|
||||||
|
|
||||||
languageMznPanel = atom.workspace.panelForItem(languageMznElement)
|
|
||||||
expect(languageMznPanel.isVisible()).toBe true
|
|
||||||
atom.commands.dispatch workspaceElement, 'language-mzn:toggle'
|
|
||||||
expect(languageMznPanel.isVisible()).toBe false
|
|
||||||
|
|
||||||
it "hides and shows the view", ->
|
|
||||||
# This test shows you an integration test testing at the view level.
|
|
||||||
|
|
||||||
# Attaching the workspaceElement to the DOM is required to allow the
|
|
||||||
# `toBeVisible()` matchers to work. Anything testing visibility or focus
|
|
||||||
# requires that the workspaceElement is on the DOM. Tests that attach the
|
|
||||||
# workspaceElement to the DOM are generally slower than those off DOM.
|
|
||||||
jasmine.attachToDOM(workspaceElement)
|
|
||||||
|
|
||||||
expect(workspaceElement.querySelector('.language-mzn')).not.toExist()
|
|
||||||
|
|
||||||
# This is an activation event, triggering it causes the package to be
|
|
||||||
# activated.
|
|
||||||
atom.commands.dispatch workspaceElement, 'language-mzn:toggle'
|
|
||||||
|
|
||||||
waitsForPromise ->
|
|
||||||
activationPromise
|
|
||||||
|
|
||||||
runs ->
|
|
||||||
# Now we can test for view visibility
|
|
||||||
languageMznElement = workspaceElement.querySelector('.language-mzn')
|
|
||||||
expect(languageMznElement).toBeVisible()
|
|
||||||
atom.commands.dispatch workspaceElement, 'language-mzn:toggle'
|
|
||||||
expect(languageMznElement).not.toBeVisible()
|
|
@ -1,5 +0,0 @@
|
|||||||
LanguageMznView = require '../lib/language-mzn-view'
|
|
||||||
|
|
||||||
describe "LanguageMznView", ->
|
|
||||||
it "has one valid test", ->
|
|
||||||
expect("life").toBe "easy"
|
|
@ -1,8 +0,0 @@
|
|||||||
// The ui-variables file is provided by base themes provided by Atom.
|
|
||||||
//
|
|
||||||
// See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
|
|
||||||
// for a full listing of what's available.
|
|
||||||
@import "ui-variables";
|
|
||||||
|
|
||||||
.language-mzn {
|
|
||||||
}
|
|
Reference in New Issue
Block a user