Skip to content

Commit

Permalink
Merge pull request manosim#2 from ekonstantinidis/reinit-package
Browse files Browse the repository at this point in the history
Reinit package
  • Loading branch information
ekonstantinidis committed Jun 2, 2015
2 parents f42c5ef + 8aef0dd commit bd2a648
Show file tree
Hide file tree
Showing 15 changed files with 133 additions and 63 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: objective-c

notifications:
email:
on_success: never
on_failure: change

script: 'curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh'
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.0
* Forked David Rapson's `cssedit-groups` repo and brought the package up to date
* The shortcut has been changed to `CMD+L`

## 0.3.0
* Fix a typo preventing the plugin from initialising

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 David Rapson
Copyright (c) 2015 Emmanouil Konstantinidis

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# cssedit-groups
# CSS Edit Groups - Atom Package [![Build Status](https://travis-ci.org/ekonstantinidis/cssedit-groups.svg?branch=master)](https://travis-ci.org/ekonstantinidis/cssedit-groups)

An Atom editor package to jump to CSS `@group` markers like CSSEdit. A port of [https://github.com/Kotrotsos/sublime-cssedit-groups](https://github.com/Kotrotsos/sublime-cssedit-groups)
An Atom editor package to jump to CSS `@group` markers like CSSEdit.

Whenever you are inside a CSS file that contains CSS Edit's group information (like `/* @group Headings */` ) press `cmd-shift-K` and you will be presented with a navigation list to jump around within the CSS file.
Whenever you are inside a CSS file that contains CSS Edit's group information (like `/* @group Headings */` ) press `cmd-L` and you will be presented with a navigation list to jump around within the CSS file.

![A screenshot of your package](https://f.cloud.github.com/assets/69169/2290250/c35d867a-a017-11e3-86be-cd7c5bf3ff9b.gif)

## Credits

- [https://github.com/davidrapson/cssedit-groups](https://github.com/davidrapson/cssedit-groups)
- [https://github.com/Kotrotsos/sublime-cssedit-groups](https://github.com/Kotrotsos/sublime-cssedit-groups)
5 changes: 3 additions & 2 deletions keymaps/cssedit-groups.cson → keymaps/css-edit-groups.cson
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@

# For more detailed documentation see
# https://atom.io/docs/latest/advanced/keymaps
'atom-workspace':
'shift-cmd-K': 'cssedit-groups:toggle'
'atom-text-editor':
'cmd-l': 'unset!'
'cmd-l': 'css-edit-groups:toggle'
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CsseditGroupsView extends SelectListView
initialize: (serializeState) ->
super
@addClass('overlay from-top task-list')
atom.commands.add 'atom-workspace', 'cssedit-groups:toggle', => @toggle()
atom.commands.add 'atom-workspace', 'css-edit-groups:toggle', => @toggle()

cancelled: ->
@hide()
Expand Down
2 changes: 1 addition & 1 deletion lib/cssedit-groups.coffee → lib/css-edit-groups.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CsseditGroupsView = require './cssedit-groups-view'
CsseditGroupsView = require './css-edit-groups-view'

module.exports =
csseditGroupsView: null
Expand Down
21 changes: 21 additions & 0 deletions menus/css-edit-groups.cson
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See https://atom.io/docs/latest/creating-a-package#menus for more details
'atom-workspace': [
{
'label': 'Enable cssedit-groups',
'command': 'css-edit-groups:toggle'
}
]
'atom-text-editor': [
{
'label': 'Packages'
'submenu': [
'label': 'CSS Edit Groups',
'submenu': [
{
'label': 'CSS Edit Groups',
'command':'css-edit-groups:toggle'
}
]
]
}
]
8 changes: 0 additions & 8 deletions menus/cssedit-groups.cson

This file was deleted.

41 changes: 29 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
{
"name": "cssedit-groups",
"main": "./lib/cssedit-groups",
"version": "0.3.0",
"private": true,
"description": "Jump to CSS @group markers like CSSEdit. A port of https://github.com/Kotrotsos/sublime-cssedit-groups",
"name": "css-edit-groups",
"main": "./lib/css-edit-groups",
"version": "0.4.0",
"description": "Jump to CSS @group markers like CSSEdit.",
"keywords": [
"atom",
"css",
"edit",
"group",
"css-edit-group",
"cssedit-group",
"package"
],
"activationCommands": {
"atom-workspace": ["cssedit-groups:toggle"]
"atom-workspace": "css-edit-groups:toggle"
},
"author": "Emmanouil Konstantinidis",
"contributors": [
{
"name": "Emmanouil Konstantinidis",
"url": "https://githib.com/ekonstantinidis"
},
{
"name": "David Rapson",
"url": "https://github.com/davidrapson"
}
],
"repository": {
"type": "git",
"url": "https://github.com/davidrapson/cssedit-groups"
"url": "https://github.com/ekonstantinidis/css-edit-groups"
},
"license": "MIT",
"engines": {
"atom": ">0.50.0"
"atom": ">=0.174.0 <2.0.0"
},
"dependencies": {
"atom-space-pen-views": "^2.0.3"
},
"readme": "# cssedit-groups\n\nAn Atom editor package to jump to CSS `@group` markers like CSSEdit. A port of [https://github.com/Kotrotsos/sublime-cssedit-groups](https://github.com/Kotrotsos/sublime-cssedit-groups)\n\nWhenever you are inside a CSS file that contains CSS Edit's group information (like `/* @group Headings */` ) press `cmd-shift-K` and you will be presented with a navigation list to jump around within the CSS file.\n\n## Credits\n\n- [https://github.com/Kotrotsos/sublime-cssedit-groups](https://github.com/Kotrotsos/sublime-cssedit-groups)\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/davidrapson/cssedit-groups/issues"
"url": "https://github.com/ekonstantinidis/css-edit-groups/issues"
},
"homepage": "https://github.com/davidrapson/cssedit-groups",
"homepage": "https://github.com/ekonstantinidis/css-edit-groups"
}
52 changes: 52 additions & 0 deletions spec/css-edit-groups-spec.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{$, $$, SelectListView} = require 'atom-space-pen-views'

describe "CSS Edit Groups", ->
[selectList, items, list, filterEditorView] = []

beforeEach ->
items = [
["A", "Alpha"], ["B", "Bravo"], ["C", "Charlie"],
["D", "Delta"], ["E", "Echo"], ["F", "Foxtrot"]
]

selectList = new SelectListView
selectList.setMaxItems(4)
selectList.getFilterKey = -> 1
selectList.viewForItem = (item) ->
$$ -> @li item[1], class: item[0]

selectList.confirmed = jasmine.createSpy('confirmed hook')
selectList.cancelled = jasmine.createSpy('cancelled hook')

selectList.setItems(items)
{list, filterEditorView} = selectList

describe "when an array is assigned", ->
it "populates the list with up to maxItems items, based on the liForElement function", ->
expect(list.find('li').length).toBe selectList.maxItems
expect(list.find('li:eq(0)')).toHaveText 'Alpha'
expect(list.find('li:eq(0)')).toHaveClass 'A'

describe "viewForItem(item)", ->
it "allows raw DOM elements to be returned", ->
selectList.viewForItem = (item) ->
li = document.createElement('li')
li.classList.add(item[0])
li.innerText = item[1]
li

selectList.setItems(items)

expect(list.find('li').length).toBe selectList.maxItems
expect(list.find('li:eq(0)')).toHaveText 'Alpha'
expect(list.find('li:eq(0)')).toHaveClass 'A'
expect(selectList.getSelectedItem()).toBe items[0]

it "allows raw HTML to be returned", ->
selectList.viewForItem = (item) ->
"<li>#{item}</li>"

selectList.setItems(['Bermuda', 'Bahama'])

expect(list.find('li:eq(0)')).toHaveText 'Bermuda'
expect(selectList.getSelectedItem()).toBe 'Bermuda'
5 changes: 5 additions & 0 deletions spec/css-edit-groups-view-spec.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CssEditGroupsView = require '../lib/css-edit-groups-view'

describe "CssEditGroupsView", ->
it "has one valid test", ->
expect("css-edit-groups").toBe "css-edit-groups"
30 changes: 0 additions & 30 deletions spec/cssedit-groups-spec.coffee

This file was deleted.

3 changes: 0 additions & 3 deletions spec/cssedit-groups-view-spec.coffee

This file was deleted.

4 changes: 2 additions & 2 deletions styles/cssedit-groups.less → styles/css-edit-groups.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// The ui-variables file is provided by base themes provided by Atom.
//
// See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less
// 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";

.cssedit-groups {
.css-edit-groups {
}

0 comments on commit bd2a648

Please sign in to comment.