Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit a5ce767

Browse files
author
Dean Sofer
committed
Stubbed out some other assets
1 parent 71235e2 commit a5ce767

File tree

10 files changed

+134
-2
lines changed

10 files changed

+134
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
npm-debug.log
3+
node_modules

LICENSE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2014 <Your name here>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

keymaps/angularjs.cson

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Keybindings require three things to be fully defined: A selector that is
2+
# matched against the focused element, the keystroke and the command to
3+
# execute.
4+
#
5+
# Below is a basic keybinding which registers on all platforms by applying to
6+
# the root workspace element.
7+
8+
# For more detailed documentation see
9+
# https://atom.io/docs/latest/advanced/keymaps
10+
#'.workspace':
11+
# 'ctrl-alt-o': 'angularjs:toggle'

lib/angularjs-view.coffee

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{View} = require 'atom'
2+
3+
module.exports =
4+
class AngularjsView extends View
5+
@content: ->
6+
@div class: 'angularjs overlay from-top', =>
7+
@div "The Angularjs package is Alive! It's ALIVE!", class: "message"
8+
9+
initialize: (serializeState) ->
10+
atom.workspaceView.command "angularjs:toggle", => @toggle()
11+
12+
# Returns an object that can be retrieved when package is activated
13+
serialize: ->
14+
15+
# Tear down any state and detach
16+
destroy: ->
17+
@detach()
18+
19+
toggle: ->
20+
console.log "AngularjsView was toggled!"
21+
if @hasParent()
22+
@detach()
23+
else
24+
atom.workspaceView.append(this)

lib/angularjs.coffee

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
AngularjsView = require './angularjs-view'
2+
3+
module.exports =
4+
angularjsView: null
5+
6+
activate: (state) ->
7+
@angularjsView = new AngularjsView(state.angularjsViewState)
8+
9+
deactivate: ->
10+
@angularjsView.destroy()
11+
12+
serialize: ->
13+
angularjsViewState: @angularjsView.serialize()

menus/angularjs.cson

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See https://atom.io/docs/latest/creating-a-package#menus for more details
2+
'context-menu':
3+
'.overlayer':
4+
'Enable angularjs': 'angularjs:toggle'
5+
6+
'menu': [
7+
{
8+
'label': 'Packages'
9+
'submenu': [
10+
'label': 'angularjs'
11+
'submenu': [
12+
{ 'label': 'Toggle', 'command': 'angularjs:toggle' }
13+
]
14+
]
15+
}
16+
]

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"name": "angularjs",
3-
"version": "0.0.1",
4-
"private": true,
3+
"main": "./lib/angularjs",
4+
"version": "0.0.2",
55
"description": "An AngularJS package for Atom",
6+
"activationEvents": ["angularjs:toggle"],
67
"repository": "https://github.com/angular-ui/AngularJS-Atom",
8+
"readmeFilename": "README.md",
79
"license": "MIT",
810
"engines": {
911
"atom": ">0.50.0"

spec/angularjs-spec.coffee

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Angularjs = require '../lib/angularjs'
2+
3+
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
4+
#
5+
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
6+
# or `fdescribe`). Remove the `f` to unfocus the block.
7+
8+
describe "Angularjs", ->
9+
activationPromise = null
10+
11+
beforeEach ->
12+
atom.workspaceView = new WorkspaceView
13+
activationPromise = atom.packages.activatePackage('angularjs')
14+
15+
describe "when the angularjs:toggle event is triggered", ->
16+
it "attaches and then detaches the view", ->
17+
expect(atom.workspaceView.find('.angularjs')).not.toExist()
18+
19+
# This is an activation event, triggering it will cause the package to be
20+
# activated.
21+
atom.workspaceView.trigger 'angularjs:toggle'
22+
23+
waitsForPromise ->
24+
activationPromise
25+
26+
runs ->
27+
expect(atom.workspaceView.find('.angularjs')).toExist()
28+
atom.workspaceView.trigger 'angularjs:toggle'
29+
expect(atom.workspaceView.find('.angularjs')).not.toExist()

spec/angularjs-view-spec.coffee

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
AngularjsView = require '../lib/angularjs-view'
2+
{WorkspaceView} = require 'atom'
3+
4+
describe "AngularjsView", ->
5+
it "has one valid test", ->
6+
expect("life").toBe "easy"

stylesheets/angularjs.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// The ui-variables file is provided by base themes provided by Atom.
2+
//
3+
// See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less
4+
// for a full listing of what's available.
5+
@import "ui-variables";
6+
7+
.angularjs {
8+
}

0 commit comments

Comments
 (0)