Skip to content

Commit f6e0271

Browse files
committed
Merge pull request #3 from robinwassen/master
Various enhancements and bug fixes for ng-annotate
2 parents bc3d2ca + 0bbd6ca commit f6e0271

16 files changed

+21898
-20
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
22
.sass-cache/
33
*.sublime-*
4-
node_modules/
4+
node_modules/
5+
dev/

Gruntfile.coffee

+26-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
module.exports = (grunt) ->
2-
distTasks = ["coffee", "sass", "uglify", "cssmin"]
3-
defaultTasks = ["coffee", "sass"]
4-
watchTasks = ["coffee", "sass"]
2+
# Release
3+
distTasks = ["coffee:release", "sass:release", "uglify", "cssmin"]
4+
5+
# Development
6+
defaultTasks = ["coffee:development", "sass:development"]
7+
watchTasks = ["coffee:development", "sass:development"]
8+
serveTasks = ["connect", "coffee:development", "sass:development", "watch"]
59

610
grunt.initConfig
711
pkg: grunt.file.readJSON "package.json"
@@ -13,11 +17,19 @@ module.exports = (grunt) ->
1317
src: ["js/src/ng-annotate.coffee"]
1418
dest: "dist/<%= pkg.version %>/js/<%= pkg.name %>-<%= pkg.version %>.js"
1519

20+
development:
21+
src: ["js/src/ng-annotate.coffee"]
22+
dest: "dev/<%= pkg.name %>-unstable.js"
23+
1624
sass:
1725
release:
1826
src: ["css/src/ng-annotate.scss"]
1927
dest: "dist/<%= pkg.version %>/css/<%= pkg.name %>-<%= pkg.version %>.css"
2028

29+
development:
30+
src: ["css/src/ng-annotate.scss"]
31+
dest: "dev/<%= pkg.name %>-unstable.css"
32+
2133
uglify:
2234
options:
2335
mangle: false
@@ -34,12 +46,22 @@ module.exports = (grunt) ->
3446
release:
3547
files: ["<%= coffee.release.src %>", "<%= sass.release.src %>"]
3648
tasks: watchTasks
49+
50+
connect:
51+
server:
52+
options:
53+
port: 3000
54+
hostname: "localhost"
55+
open: "http://localhost:3000/example-app/"
56+
3757

3858
grunt.loadNpmTasks "grunt-contrib-uglify"
3959
grunt.loadNpmTasks "grunt-contrib-coffee"
4060
grunt.loadNpmTasks "grunt-contrib-watch"
4161
grunt.loadNpmTasks "grunt-contrib-sass"
4262
grunt.loadNpmTasks "grunt-contrib-cssmin"
63+
grunt.loadNpmTasks "grunt-contrib-connect"
4364

4465
grunt.registerTask "default", defaultTasks
45-
grunt.registerTask "dist", distTasks
66+
grunt.registerTask "dist", distTasks
67+
grunt.registerTask "serve", serveTasks

README.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
ng-annotate
22
=========================
33

4+
ng-annotate is a library to annotate texts in AngularJS.
5+
6+
![Screenshot](http://i.imgur.com/IHjxXn1.png?1)
7+
8+
# Getting started
9+
10+
- Install NodeJS
11+
- Run **npm install -g grunt-cli**
12+
- Run **npm install** in the ng-annotate folder
13+
- Run **grunt serve**
414

515
# Annotation colors
616

717
Main annotation class is `.ng-annotation`.
818
An annotation is extended by adding a type class to `.ng-annotation`.
9-
Available type classes are:
19+
20+
Available default type classes are:
1021

11-
.red - Sets background to red, color to white and border-color to red.
12-
.green - Sets background to green, color to white and border-color to green.
13-
.blue - Sets background to blue, color to white and border-color to blue.
14-
.pink - Sets background to pink, color to white and border-color to pink.
22+
.red - Sets background to red, color to black and border-color to red.
23+
.green - Sets background to green, color to black and border-color to green.
24+
.blue - Sets background to blue, color to black and border-color to blue.
25+
.pink - Sets background to pink, color to black and border-color to pink.
1526
.yellow - Sets background to yellow, color to black and border-color to yellow.
27+
.teal - Sets background to teal, color to black and border-color to teal.
1628

css/src/ng-annotate.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
border-bottom: 1px solid #000;
99
cursor: pointer;
1010

11-
&.red { color: #fff; background: #f00; border-color: #f00; }
12-
&.green { color: #fff; background: #0f0; border-color: #0f0; }
13-
&.blue { color: #fff; background: #00f; border-color: #00f; }
14-
&.pink { color: #fff; background: #f0f; border-color: #f0f; }
15-
&.yellow { color: #000; background: #ff0; border-color: #ff0; }
16-
&.teal { color: #00f; background: #0ff; border-color: #0ff; }
11+
&.red { color: #000; background: #fcbcbc; border-color: #fcbcbc; }
12+
&.green { color: #000; background: #c7fcbc; border-color: #c7fcbc; }
13+
&.blue { color: #000; background: #BCDFFC; border-color: #BCDFFC; }
14+
&.pink { color: #000; background: #fcbcfa; border-color: #fcbcfa; }
15+
&.yellow { color: #000; background: #fafcbc; border-color: #fafcbc; }
16+
&.teal { color: #000; background: #bcfcf7; border-color: #bcfcf7; }
1717

1818
&.strike { text-decoration: line-through; }
1919
}

example-app/css/lib/bootstrap-theme.min.css

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example-app/css/lib/bootstrap.min.css

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example-app/css/main.css

Whitespace-only changes.

example-app/index.html

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html ng-app="app">
3+
<head>
4+
<title>ng-annotate</title>
5+
<meta charset="utf-8">
6+
<link href="./css/lib/bootstrap.min.css" rel="stylesheet" type="text/css">
7+
<link href="./css/lib/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
8+
<link href="../dev/ng-annotate-unstable.css" rel="stylesheet" type="text/css">
9+
<link href="./css/main.css" rel="stylesheet" type="text/css">
10+
<script src="./js/lib/jquery-1.11.0.min.js" type="text/javascript"></script>
11+
<script src="./js/lib/angular.js" type="text/javascript"></script>
12+
<script src="../dev/ng-annotate-unstable.js" type="text/javascript"></script>
13+
</head>
14+
<body>
15+
<div class="container" ng-controller="MainController">
16+
<div class="row">
17+
<div class="col-lg-12 text-center">
18+
<h1>NG-ANNOTATE</h1>
19+
</div>
20+
</div>
21+
<div class="row">
22+
<div style="width: 700px; margin: 0 auto;">
23+
<p ng-annotate options="options"
24+
annotations="annotations"
25+
on-annotate="onAnnotate"
26+
on-annotate-error="onAnnotateError"
27+
text="text">
28+
</p>
29+
</div>
30+
</div>
31+
</div>
32+
<script src="./js/app.js" type="text/javascript"></script>
33+
</body>
34+
</html>

0 commit comments

Comments
 (0)