Navigation Menu

Skip to content

Commit

Permalink
fix(taPaste): Fix the taPaste order s.t. sanitizer is called after pa…
Browse files Browse the repository at this point in the history
…ste 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.
  • Loading branch information
SimeonC authored and SimeonC committed May 24, 2015
1 parent 4fae3e4 commit 108857f
Show file tree
Hide file tree
Showing 17 changed files with 1,732 additions and 51 deletions.
69 changes: 39 additions & 30 deletions Gruntfile.js
Expand Up @@ -4,6 +4,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-istanbul-coverage');
Expand All @@ -14,10 +15,10 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-shell');

grunt.registerTask('compile', ['concat', 'jshint', 'uglify']);
grunt.registerTask('compile', ['concat', 'copy:setupFiles', 'jshint', 'uglify']);
grunt.registerTask('default', ['compile', 'test']);
grunt.registerTask('test', ['clean', 'jshint', 'karma', 'coverage']);
grunt.registerTask('travis-test', ['concat', 'jshint', 'karma', 'coverage', 'coveralls']);
grunt.registerTask('travis-test', ['concat', 'copy:setupFiles', 'jshint', 'karma', 'coverage', 'coveralls']);

grunt.registerTask('release', ['bump-only','compile','changelog','gitcommit','bump-commit', 'shell:publish']);
grunt.registerTask('release:patch', ['bump-only:patch','compile','changelog','gitcommit','bump-commit', 'shell:publish']);
Expand Down Expand Up @@ -61,15 +62,15 @@ module.exports = function (grunt) {
},
clean: ["coverage"],
coverage: {
options: {
thresholds: {
'statements': 100,
'branches': 100,
'lines': 100,
'functions': 100
options: {
thresholds: {
'statements': 100,
'branches': 100,
'lines': 100,
'functions': 100
},
dir: 'coverage'
}
}
},
coveralls: {
options: {
Expand All @@ -79,35 +80,43 @@ module.exports = function (grunt) {
}
},
karma: {
jquery: {
options: testConfig('karma-jquery.conf.js')
},
jqlite: {
options: testConfig('karma-jqlite.conf.js')
}
jquery: {
options: testConfig('karma-jquery.conf.js')
},
jqlite: {
options: testConfig('karma-jqlite.conf.js')
}
},
jshint: {
files: ['lib/*.js', 'src/textAngularSetup.js', 'test/*.spec.js', 'test/taBind/*.spec.js'],// don't hint the textAngularSanitize as they will fail
options: {
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
boss: true,
eqnull: true,
globals: {}
}
files: ['src/*.js', 'test/*.spec.js', 'test/taBind/*.spec.js', '!src/textAngular-sanitize.js'],// don't hint the textAngularSanitize as they will fail
options: {
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
boss: true,
eqnull: true,
globals: {}
}
},
copy: {
setupFiles: {
expand: true,
cwd: 'src/',
src: ['textAngularSetup.js', 'textAngular.css', 'textAngular-sanitize.js'],
dest: 'dist/'
}
},
concat: {
options: {
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\";",
footer: "})();"
},
dist: {
src: ['lib/globals.js','lib/factories.js','lib/DOM.js','lib/validators.js','lib/taBind.js','lib/main.js'],
dest: 'src/textAngular.js'
src: ['src/globals.js','src/factories.js','src/DOM.js','src/validators.js','src/taBind.js','src/main.js'],
dest: 'dist/textAngular.js'
}
},
uglify: {
Expand All @@ -120,7 +129,7 @@ module.exports = function (grunt) {
my_target: {
files: {
'dist/textAngular-rangy.min.js': ['bower_components/rangy/rangy-core.js', 'bower_components/rangy/rangy-selectionsaverestore.js'],
'dist/textAngular.min.js': ['src/textAngularSetup.js','src/textAngular.js'],
'dist/textAngular.min.js': ['dist/textAngularSetup.js','dist/textAngular.js'],
'dist/textAngular-sanitize.min.js': ['src/textAngular-sanitize.js']
}
}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -10,7 +10,7 @@ Demo is available at: http://www.textangular.com (Or editable [Plunkr Demo](http

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

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.
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.
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

## Requirements
Expand All @@ -29,7 +29,7 @@ To upgrade from version 1.2.2 or earlier you need to follow these steps:
Run `bower install textAngular` from the command line.
Include script tags similar to the following:
```html
<link rel='stylesheet' href='/bower_components/textAngular/src/textAngular.css'>
<link rel='stylesheet' href='/bower_components/textAngular/dist/textAngular.css'>
<script src='/bower_components/textAngular/dist/textAngular-rangy.min.js'></script>
<script src='/bower_components/textAngular/dist/textAngular-sanitize.min.js'></script>
<script src='/bower_components/textAngular/dist/textAngular.min.js'></script>
Expand All @@ -40,7 +40,7 @@ Include script tags similar to the following:
Run `npm install textangular` from the command line.
Include script tags similar to the following:
```html
<link rel='stylesheet' href='/node_modules/textangular/src/textAngular.css'>
<link rel='stylesheet' href='/node_modules/textangular/dist/textAngular.css'>
<script src='/node_modules/textangular/dist/textAngular-rangy.min.js'></script>
<script src='/node_modules/textangular/dist/textAngular-sanitize.min.js'></script>
<script src='/node_modules/textangular/dist/textAngular.min.js'></script>
Expand All @@ -65,7 +65,7 @@ Include script tag similar to the following: (For details on how this works see:

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:
```html
<link rel='stylesheet' href='/path/to/unzipped/files/src/textAngular.min.css'>
<link rel='stylesheet' href='/path/to/unzipped/files/dist/textAngular.min.css'>
<script src='/path/to/unzipped/files/dist/textAngular-rangy.min.js'></script>
<script src='/path/to/unzipped/files/dist/textAngular-sanitize.min.js'></script>
<script src='/path/to/unzipped/files/dist/textAngular.min.js'></script>
Expand Down
8 changes: 4 additions & 4 deletions bower.json
Expand Up @@ -2,10 +2,10 @@
"name": "textAngular",
"version": "1.4.0",
"main": [
"./src/textAngular.js",
"./src/textAngular-sanitize.js",
"./src/textAngularSetup.js",
"./src/textAngular.css"
"./dist/textAngular.js",
"./dist/textAngular-sanitize.js",
"./dist/textAngularSetup.js",
"./dist/textAngular.css"
],
"description": "A radically powerful Text-Editor/Wysiwyg editor for Angular.js",
"keywords": [
Expand Down

0 comments on commit 108857f

Please sign in to comment.