Skip to content

Commit 108857f

Browse files
SimeonCSimeonC
SimeonC
authored and
SimeonC
committedMay 24, 2015
fix(taPaste): Fix the taPaste order s.t. sanitizer is called after paste handler.
Fixes #686 BREAKING CHANGES: This changes the structure of the files - all production files are now in the dist folder, this makes where PR's should be done a little more clear. If you were referencing the src/*.js files they will need to be updated to dist/*js.
1 parent 4fae3e4 commit 108857f

17 files changed

+1732
-51
lines changed
 

‎Gruntfile.js

+39-30
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = function (grunt) {
44
grunt.loadNpmTasks('grunt-contrib-jshint');
55
grunt.loadNpmTasks('grunt-contrib-uglify');
66
grunt.loadNpmTasks('grunt-contrib-clean');
7+
grunt.loadNpmTasks('grunt-contrib-copy');
78
grunt.loadNpmTasks('grunt-contrib-watch');
89
grunt.loadNpmTasks('grunt-contrib-concat');
910
grunt.loadNpmTasks('grunt-istanbul-coverage');
@@ -14,10 +15,10 @@ module.exports = function (grunt) {
1415
grunt.loadNpmTasks('grunt-git');
1516
grunt.loadNpmTasks('grunt-shell');
1617

17-
grunt.registerTask('compile', ['concat', 'jshint', 'uglify']);
18+
grunt.registerTask('compile', ['concat', 'copy:setupFiles', 'jshint', 'uglify']);
1819
grunt.registerTask('default', ['compile', 'test']);
1920
grunt.registerTask('test', ['clean', 'jshint', 'karma', 'coverage']);
20-
grunt.registerTask('travis-test', ['concat', 'jshint', 'karma', 'coverage', 'coveralls']);
21+
grunt.registerTask('travis-test', ['concat', 'copy:setupFiles', 'jshint', 'karma', 'coverage', 'coveralls']);
2122

2223
grunt.registerTask('release', ['bump-only','compile','changelog','gitcommit','bump-commit', 'shell:publish']);
2324
grunt.registerTask('release:patch', ['bump-only:patch','compile','changelog','gitcommit','bump-commit', 'shell:publish']);
@@ -61,15 +62,15 @@ module.exports = function (grunt) {
6162
},
6263
clean: ["coverage"],
6364
coverage: {
64-
options: {
65-
thresholds: {
66-
'statements': 100,
67-
'branches': 100,
68-
'lines': 100,
69-
'functions': 100
65+
options: {
66+
thresholds: {
67+
'statements': 100,
68+
'branches': 100,
69+
'lines': 100,
70+
'functions': 100
7071
},
7172
dir: 'coverage'
72-
}
73+
}
7374
},
7475
coveralls: {
7576
options: {
@@ -79,35 +80,43 @@ module.exports = function (grunt) {
7980
}
8081
},
8182
karma: {
82-
jquery: {
83-
options: testConfig('karma-jquery.conf.js')
84-
},
85-
jqlite: {
86-
options: testConfig('karma-jqlite.conf.js')
87-
}
83+
jquery: {
84+
options: testConfig('karma-jquery.conf.js')
85+
},
86+
jqlite: {
87+
options: testConfig('karma-jqlite.conf.js')
88+
}
8889
},
8990
jshint: {
90-
files: ['lib/*.js', 'src/textAngularSetup.js', 'test/*.spec.js', 'test/taBind/*.spec.js'],// don't hint the textAngularSanitize as they will fail
91-
options: {
92-
eqeqeq: true,
93-
immed: true,
94-
latedef: true,
95-
newcap: true,
96-
noarg: true,
97-
sub: true,
98-
boss: true,
99-
eqnull: true,
100-
globals: {}
101-
}
91+
files: ['src/*.js', 'test/*.spec.js', 'test/taBind/*.spec.js', '!src/textAngular-sanitize.js'],// don't hint the textAngularSanitize as they will fail
92+
options: {
93+
eqeqeq: true,
94+
immed: true,
95+
latedef: true,
96+
newcap: true,
97+
noarg: true,
98+
sub: true,
99+
boss: true,
100+
eqnull: true,
101+
globals: {}
102+
}
103+
},
104+
copy: {
105+
setupFiles: {
106+
expand: true,
107+
cwd: 'src/',
108+
src: ['textAngularSetup.js', 'textAngular.css', 'textAngular-sanitize.js'],
109+
dest: 'dist/'
110+
}
102111
},
103112
concat: {
104113
options: {
105114
banner: "/*\n@license textAngular\nAuthor : Austin Anderson\nLicense : 2013 MIT\nVersion <%- pkg.version %>\n\nSee README.md or https://github.com/fraywing/textAngular/wiki for requirements and use.\n*/\n\n(function(){ // encapsulate all variables so they don't become global vars\n\"use strict\";",
106115
footer: "})();"
107116
},
108117
dist: {
109-
src: ['lib/globals.js','lib/factories.js','lib/DOM.js','lib/validators.js','lib/taBind.js','lib/main.js'],
110-
dest: 'src/textAngular.js'
118+
src: ['src/globals.js','src/factories.js','src/DOM.js','src/validators.js','src/taBind.js','src/main.js'],
119+
dest: 'dist/textAngular.js'
111120
}
112121
},
113122
uglify: {
@@ -120,7 +129,7 @@ module.exports = function (grunt) {
120129
my_target: {
121130
files: {
122131
'dist/textAngular-rangy.min.js': ['bower_components/rangy/rangy-core.js', 'bower_components/rangy/rangy-selectionsaverestore.js'],
123-
'dist/textAngular.min.js': ['src/textAngularSetup.js','src/textAngular.js'],
132+
'dist/textAngular.min.js': ['dist/textAngularSetup.js','dist/textAngular.js'],
124133
'dist/textAngular-sanitize.min.js': ['src/textAngular-sanitize.js']
125134
}
126135
}

‎README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Demo is available at: http://www.textangular.com (Or editable [Plunkr Demo](http
1010

1111
To upgrade from version 1.2.2 or earlier you need to follow these steps:
1212

13-
1. The styling for textAngular is now in the `src/textAngular.css` file, you will need to include this or a copy of it with your own modifications.
13+
1. The styling for textAngular is now in the `dist/textAngular.css` file, you will need to include this or a copy of it with your own modifications.
1414
2. The rangy library is now required, you will need both the `rangy-core` and `rangy-saveselection` modules, alternatively you can include the compressed version (`textAngular-rangy.min.js`) in the dist folder
1515

1616
## Requirements
@@ -29,7 +29,7 @@ To upgrade from version 1.2.2 or earlier you need to follow these steps:
2929
Run `bower install textAngular` from the command line.
3030
Include script tags similar to the following:
3131
```html
32-
<link rel='stylesheet' href='/bower_components/textAngular/src/textAngular.css'>
32+
<link rel='stylesheet' href='/bower_components/textAngular/dist/textAngular.css'>
3333
<script src='/bower_components/textAngular/dist/textAngular-rangy.min.js'></script>
3434
<script src='/bower_components/textAngular/dist/textAngular-sanitize.min.js'></script>
3535
<script src='/bower_components/textAngular/dist/textAngular.min.js'></script>
@@ -40,7 +40,7 @@ Include script tags similar to the following:
4040
Run `npm install textangular` from the command line.
4141
Include script tags similar to the following:
4242
```html
43-
<link rel='stylesheet' href='/node_modules/textangular/src/textAngular.css'>
43+
<link rel='stylesheet' href='/node_modules/textangular/dist/textAngular.css'>
4444
<script src='/node_modules/textangular/dist/textAngular-rangy.min.js'></script>
4545
<script src='/node_modules/textangular/dist/textAngular-sanitize.min.js'></script>
4646
<script src='/node_modules/textangular/dist/textAngular.min.js'></script>
@@ -65,7 +65,7 @@ Include script tag similar to the following: (For details on how this works see:
6565

6666
Download the code from [https://github.com/fraywing/textAngular/releases/latest](https://github.com/fraywing/textAngular/releases/latest), unzip the files then add script tags similar to the following:
6767
```html
68-
<link rel='stylesheet' href='/path/to/unzipped/files/src/textAngular.min.css'>
68+
<link rel='stylesheet' href='/path/to/unzipped/files/dist/textAngular.min.css'>
6969
<script src='/path/to/unzipped/files/dist/textAngular-rangy.min.js'></script>
7070
<script src='/path/to/unzipped/files/dist/textAngular-sanitize.min.js'></script>
7171
<script src='/path/to/unzipped/files/dist/textAngular.min.js'></script>

‎bower.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"name": "textAngular",
33
"version": "1.4.0",
44
"main": [
5-
"./src/textAngular.js",
6-
"./src/textAngular-sanitize.js",
7-
"./src/textAngularSetup.js",
8-
"./src/textAngular.css"
5+
"./dist/textAngular.js",
6+
"./dist/textAngular-sanitize.js",
7+
"./dist/textAngularSetup.js",
8+
"./dist/textAngular.css"
99
],
1010
"description": "A radically powerful Text-Editor/Wysiwyg editor for Angular.js",
1111
"keywords": [

0 commit comments

Comments
 (0)