Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pr/760
Browse files Browse the repository at this point in the history
# Conflicts:
#	dist/textAngular.min.js
  • Loading branch information
pbassut committed Sep 2, 2015
2 parents dc5ea4d + c7893dc commit a0a8455
Show file tree
Hide file tree
Showing 26 changed files with 1,931 additions and 1,072 deletions.
49 changes: 37 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function (grunt) {

// load all grunt tasks
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
Expand All @@ -14,29 +14,47 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-shell');

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', 'copy:setupFiles', 'jshint', 'karma', 'coverage', 'coveralls']);
grunt.registerTask('release', ['bump-only','compile','changelog','gitcommit','bump-commit', 'shell:publish']);

grunt.registerTask('release', ['bump-only','compile', 'demo_pages', 'changelog','gitcommit','bump-commit', 'shell:publish']);
grunt.registerTask('release:patch', ['bump-only:patch','compile','changelog','gitcommit','bump-commit', 'shell:publish']);
grunt.registerTask('release:minor', ['bump-only:minor','compile','changelog','gitcommit','bump-commit', 'shell:publish']);
grunt.registerTask('release:major', ['bump-only:major','compile','changelog','gitcommit','bump-commit', 'shell:publish']);
grunt.registerTask('release:prerelease', ['bump-only:prerelease','compile','changelog','gitcommit','bump-commit', 'shell:publish']);

var testConfig = function (configFile, customOptions) {
var options = { configFile: configFile, keepalive: true };
var travisOptions = process.env.TRAVIS && { browsers: ['PhantomJS'], reporters: ['dots','coverage'] };
return grunt.util._.extend(options, customOptions, travisOptions);
};


grunt.registerMultiTask('demo_pages', 'Compile demo pages', function(){
var d = this.data;
var srcPath = function(fname){ return d.cwd + fname; };
var destPath = function(fname){ return d.dest + fname; };

grunt.file.expand({cwd: d.cwd}, d.src).forEach(function(each){
grunt.file.copy(srcPath(each), destPath(each), {
process: function (contents, path){
return grunt.template.process(contents, {
data: {
js: Object.keys(grunt.config('uglify.my_target.files')),
version: grunt.config('pkg.version')
}
});
}
});
});
});

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
changelog: {options: {dest: 'changelog.md'}},

bump: {
options: {
files: ['package.json','bower.json'],
Expand All @@ -51,7 +69,7 @@ module.exports = function (grunt) {
message: "chore(release): Build Dist files"
},
files: {
src: ['src/*','dist/*']
src: ['src/*', 'src/demo/*','dist/*']
}
}
},
Expand Down Expand Up @@ -129,14 +147,21 @@ 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': ['dist/textAngularSetup.js','dist/textAngular.js'],
'dist/textAngular-sanitize.min.js': ['src/textAngular-sanitize.js']
'dist/textAngular-sanitize.min.js': ['src/textAngular-sanitize.js'],
'dist/textAngular.min.js': ['dist/textAngularSetup.js','dist/textAngular.js']
}
}
},
demo_pages: {
main: {
cwd: 'src/demo/',
src: '*.html',
dest: 'demo/'
}
},
watch: {
files: "lib/*.js",
tasks: "concat"
files: "src/*.js",
tasks: "compile"
}
});
};
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
textAngular v1.3.0
textAngular v1.4.0
===========

[![Build Status](https://travis-ci.org/fraywing/textAngular.png?branch=master)](https://travis-ci.org/fraywing/textAngular) [![Coverage Status](https://coveralls.io/repos/fraywing/textAngular/badge.png)](https://coveralls.io/r/fraywing/textAngular)


Demo is available at: http://www.textangular.com (Or editable [Plunkr Demo](http://plnkr.co/edit/tpl:RaBEszV5xrAZ0VRoZ7PM))
Demo is available at: http://www.textangular.com (Or editable [Plunkr Demo](http://plnkr.co/edit/kKPfk0LCXWrMpZ1gkblb?p=preview))

#### Upgrading From 1.2.2 or earlier

Expand All @@ -15,10 +15,11 @@ To upgrade from version 1.2.2 or earlier you need to follow these steps:

## Requirements

1. `AngularJS``1.2.x`
2. `Rangy``1.2.x`, Both rangy-core and rangy-saveselection are required. (There is a minified combination of these two included in the dist folder)
1. `AngularJS``1.3.x`
2. `Rangy``1.3.x`, Both rangy-core and rangy-saveselection are required. (There is a minified combination of these two included in the dist folder)
3. `Font-Awesome``4.x` for the default icons on the toolbar
1. `Bootstrap``3.x` for the default styles (Can use `bootstrap-css-only`, you must add this to your bower or include this manually)
5. NOTE: please check the requirements for earlier releases, if these are an issue.

### Where to get it

Expand Down Expand Up @@ -103,14 +104,14 @@ OR
This acts similar to a regular AngularJS / form input if you give it a name attribute, allowing for form submission and AngularJS form validation.

Have fun!

**Important Note:** Though textAngular supports the use of all attributes in it's input, please note that angulars ng-bind-html **WILL** strip out all of your style attributes if you are using `angular-sanitize.js`.

For Additional options see the [github Wiki](https://github.com/fraywing/textAngular/wiki).

### Issues?

textAngular uses ```execCommand``` for the rich-text functionality.
textAngular uses ```execCommand``` for the rich-text functionality.
That being said, its still a fairly experimental browser feature-set, and may not behave the same in all browsers - see http://tifftiff.de/contenteditable/compliance_test.html for a full compliance list.
It has been tested to work on Chrome, Safari, Opera, Firefox and Internet Explorer 8+.
If you find something, please let me know - throw me a message, or submit a issue request!
Expand Down Expand Up @@ -154,6 +155,6 @@ This project is licensed under the [MIT license](http://opensource.org/licenses/

## Contributers

Special thanks to all the contributions thus far!
Special thanks to all the contributions thus far!

For a full list see: https://github.com/fraywing/textAngular/graphs/contributors
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "textAngular",
"version": "1.4.1",
"version": "1.4.3",
"main": [
"./dist/textAngular.js",
"./dist/textAngular-sanitize.js",
Expand Down
49 changes: 49 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
<a name"1.4.3"></a>
### 1.4.3 (2015-07-30)


#### Bug Fixes

* **textAngular:** Fix image resize broken for chrome ([86072d4b](https://github.com/fraywing/textAngular/commit/86072d4b))
* **textAngularSetup:** Inorder to fully block Undo or Redo, one must also call event.preventDefault() ([aedc38e4](https://github.com/fraywing/textAngular/commit/aedc38e4))
* **textAngular:** Fix remove CSSRule-when-no-rules ([0eb2f38](https://github.com/fraywing/textAngular/commit/86072d4b))

#### Features

* **taToolbar:** Update insertVideo to handle youtube link variants ([1372bc1d](https://github.com/fraywing/textAngular/commit/1372bc1d))
* **test:** Added coverage for 'justifyFull' button. ([72cca334](https://github.com/fraywing/textAngular/commit/72cca334))
* **textAngularSetup:**
* Added taOptions.keyMappings to customize key bindings. ([05546ab4](https://github.com/fraywing/textAngular/commit/05546ab4))
* Added taOptions.keyMappings to adjustment the key bindings for Redo, Undo, ... ([de12e3e3](https://github.com/fraywing/textAngular/commit/de12e3e3))
* Added a taOptions:forceTextAngularSanitize to verify sanitizer provider. ([ad04836b](https://github.com/fraywing/textAngular/commit/ad04836b))
* Added a taOptions:forceTextAngularSanitize to verify sanitizer provider. ([8e642c15](https://github.com/fraywing/textAngular/commit/8e642c15))

#### Breaking Changes

If you were using a different sanitize provider instead of textAngular-sanitize we will now detect this and throw an error. To eliminate this error set taOptions.forceTextAngularSanitize: false

<a name"1.4.2"></a>
### 1.4.2 (2015-07-15)

#### Bug Fixes

* **textAngular:** corrected undefined event #796 ([6186ed52](https://github.com/fraywing/textAngular/commit/6186ed52))
* **taBind:** Reapply selector handles on focus ([f05857e3](https://github.com/fraywing/textAngular/commit/f05857e3))
* **textAngular:** Fixed resize image issue ([52fb20c0](https://github.com/fraywing/textAngular/commit/52fb20c0))
* **grunt:** Update javascript path in watch target ([58df955d](https://github.com/fraywing/textAngular/commit/58df955d))
* **textAngular:**
* Fixed test coverage when commonElement is document ([b807423b](https://github.com/fraywing/textAngular/commit/b807423b ))
* Fixed corner case when commonElement is document ([dbea6244](https://github.com/fraywing/textAngular/commit/dbea6244))
* Use CSS instead of html attributes to resize image. ([a84f6df4](https://github.com/fraywing/textAngular/commit/a84f6df4))
* Fix resize image issue ([52fb20c0](https://github.com/fraywing/textAngular/commit/52fb20c0))

#### Features

* **textAngular:**
* Added directives ta-resize-keep-aspect-ratio and ta-resize-maintain-aspect-ratio to control image-resize ([32697058](https://github.com/fraywing/textAngular/commit/32697058))
* Added input to the safe element list ([945cfa00](https://github.com/fraywing/textAngular/commit/945cfa00))
* **textAngularDemo:** Updated the demo to be in synch with this release ([93fd4048](https://github.com/fraywing/textAngular/commit/93fd4048))
* **globals:** Added aria-hidden to hidden input, to hide it from screen readers ([b49bf814](https://github.com/fraywing/textAngular/commit/b49bf814))
* **textAngularSetup:** Enhanced toolbar to handle TAB and SHIFT-TAB KEYS. ([8df51fb](https://github.com/fraywing/textAngular/commit/8df51fb))
* **taToolFunctions:** Create factory for sharable functions ([032611dd](https://github.com/fraywing/textAngular/commit/032611dd))

<a name="1.4.1"></a>
### 1.4.1 (2015-05-25)

Expand Down
114 changes: 53 additions & 61 deletions demo/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,62 @@
<html>

<head>

<meta charset="UTF-8">

<title>textAngular 1.2.2 Demo</title>

<meta name="robots" content="noindex">

<link rel='stylesheet prefetch' href='http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css'>

<meta charset="UTF-8">
<title>textAngular 1.4.3 Demo</title>
<meta name="robots" content="noindex">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel='stylesheet' href='../bower_components/font-awesome/css/font-awesome.css'>
<style>
.ta-editor {
min-height: 300px;
height: auto;
overflow: auto;
font-family: inherit;
font-size: 100%;
}
</style>

.ta-editor {
min-height: 300px;
height: auto;
overflow: auto;
font-family: inherit;
font-size: 100%;
}
</style>

<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js'></script>

<script src='../dist/textAngular-rangy.min.js'></script>

<script src='../dist/textAngular-sanitize.min.js'></script>

<script src='../dist/textAngular.min.js'></script>

</head>

<body>

<div ng-app="textAngularTest" ng-controller="wysiwygeditor" class="container app">
<h1>Editor</h1>
<button ng-click="disabled = !disabled" unselectable>Disable text-angular Toggle</button>
<div text-angular="text-angular" name="htmlcontent" ng-model="htmlcontent" ta-disabled='disabled'></div>
<h1>Raw HTML in a text area</h1>
<textarea ng-model="htmlcontent" style="width: 100%"></textarea>
<h1>Bound with ng-bind-html</h1>
<div ng-bind-html="htmlcontent"></div>
<h1>Bound with ta-bind, our internal html-binding directive</h1>
<div ta-bind="text" ng-model="htmlcontent" ta-readonly='disabled'></div>
<button type="button" ng-click="htmlcontent = orightml">Reset</button>
<p>Note: although we support classes and styles, angularjs' ng-bind-html directive will strip out all style attributes.</p>

<h1>Option to masquerade as a fancy text-area - complete with form submission and optional ngModel</h1>
<text-angular name="htmlcontent" ng-model="htmlcontenttwo">
<p>Any <b>HTML</b> we put in-between the text-angular tags gets automatically put into the editor if there <strong style="font-size: 12pt;"><u><em>is not</em></u></strong> a value assigned to the ngModel.</p>
<p>If there is a value assigned to the ngModel, it replaces any html here. To see this, uncomment the line at the bottom of demo.html</p>
</text-angular>
<h1>Bound with ta-bind, our internal html-binding directive</h1>
<div ta-bind="text" ng-model="htmlcontenttwo" ta-readonly='disabled'></div>

</div>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/textAngular/1.2.2/textAngular-sanitize.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/textAngular/1.2.2/textAngular.min.js'></script>

<script type="text/javascript">
angular.module("textAngularTest", ['textAngular']);
function wysiwygeditor($scope) {
$scope.orightml = '<h2>Try me!</h2><p>textAngular is a super cool WYSIWYG Text Editor directive for AngularJS</p><p><img class="ta-insert-video" ta-insert-video="http://www.youtube.com/embed/2maA1-mvicY" src="" allowfullscreen="true" width="300" frameborder="0" height="250"/></p><p><b>Features:</b></p><ol><li>Automatic Seamless Two-Way-Binding</li><li>Super Easy <b>Theming</b> Options</li><li style="color: green;">Simple Editor Instance Creation</li><li>Safely Parses Html for Custom Toolbar Icons</li><li class="text-danger">Doesn&apos;t Use an iFrame</li><li>Works with Firefox, Chrome, and IE8+</li></ol><p><b>Code at GitHub:</b> <a href="https://github.com/fraywing/textAngular">Here</a> </p><h4>Supports non-latin Characters</h4><p>昮朐 魡 燚璒瘭 譾躒鑅, 皾籈譧 紵脭脧 逯郹酟 煃 瑐瑍, 踆跾踄 趡趛踠 顣飁 廞 熥獘 豥 蔰蝯蝺 廦廥彋 蕍蕧螛 溹溦 幨懅憴 妎岓岕 緁, 滍 蘹蠮 蟷蠉蟼 鱐鱍鱕, 阰刲 鞮鞢騉 烳牼翐 魡 骱 銇韎餀 媓幁惁 嵉愊惵 蛶觢, 犝獫 嶵嶯幯 縓罃蔾 魵 踄 罃蔾 獿譿躐 峷敊浭, 媓幁 黐曮禷 椵楘溍 輗 漀 摲摓 墐墆墏 捃挸栚 蛣袹跜, 岓岕 溿 斶檎檦 匢奾灱 逜郰傃</p>';
$scope.htmlcontent = $scope.orightml;
$scope.disabled = false;

////
// Masquerade perfers the scope value over the innerHTML
// Uncomment this line to see the effect:
// $scope.htmlcontenttwo = "Override originalContents";
};
</script>

<div ng-app="textAngularTest" ng-controller="wysiwygeditor" class="container app">
<h1>Editor</h1>
<button ng-click="disabled = !disabled" unselectable>Disable text-angular Toggle</button>
<div text-angular="text-angular" name="htmlcontent" ng-model="htmlcontent" ta-disabled='disabled'></div>
<h1>Raw HTML in a text area</h1>
<textarea ng-model="htmlcontent" style="width: 100%"></textarea>
<h1>Bound with ng-bind-html</h1>
<div ng-bind-html="htmlcontent"></div>
<h1>Bound with ta-bind, our internal html-binding directive</h1>
<div ta-bind="text" ng-model="htmlcontent" ta-readonly='disabled'></div>
<button type="button" ng-click="htmlcontent = orightml">Reset</button>
<p>Note: although we support classes and styles, angularjs' ng-bind-html directive will strip out all style attributes.</p>
<h1>Option to masquerade as a fancy text-area - complete with form submission and optional ngModel</h1>
<text-angular name="htmlcontent" ng-model="htmlcontenttwo">
<p>Any <b>HTML</b> we put in-between the text-angular tags gets automatically put into the editor if there <strong style="font-size: 12pt;"><u><em>is not</em></u></strong> a value assigned to the ngModel.</p>
<p>If there is a value assigned to the ngModel, it replaces any html here. To see this, uncomment the line at the bottom of demo.html</p>
</text-angular>
<h1>Bound with ta-bind, our internal html-binding directive</h1>
<div ta-bind="text" ng-model="htmlcontenttwo" ta-readonly='disabled'></div>
</div>


<script type="text/javascript">
angular.module("textAngularTest", ['textAngular'])
.controller('wysiwygeditor', function wysiwygeditor($scope) {
$scope.orightml = '<h2>Try me!</h2><p>textAngular is a super cool WYSIWYG Text Editor directive for AngularJS</p><p><img class="ta-insert-video" ta-insert-video="http://www.youtube.com/embed/2maA1-mvicY" src="" allowfullscreen="true" width="300" frameborder="0" height="250"/></p><p><b>Features:</b></p><ol><li>Automatic Seamless Two-Way-Binding</li><li>Super Easy <b>Theming</b> Options</li><li style="color: green;">Simple Editor Instance Creation</li><li>Safely Parses Html for Custom Toolbar Icons</li><li class="text-danger">Doesn&apos;t Use an iFrame</li><li>Works with Firefox, Chrome, and IE9+</li></ol><p><b>Code at GitHub:</b> <a href="https://github.com/fraywing/textAngular">Here</a> </p><h4>Supports non-latin Characters</h4><p>昮朐 魡 燚璒瘭 譾躒鑅, 皾籈譧 紵脭脧 逯郹酟 煃 瑐瑍, 踆跾踄 趡趛踠 顣飁 廞 熥獘 豥 蔰蝯蝺 廦廥彋 蕍蕧螛 溹溦 幨懅憴 妎岓岕 緁, 滍 蘹蠮 蟷蠉蟼 鱐鱍鱕, 阰刲 鞮鞢騉 烳牼翐 魡 骱 銇韎餀 媓幁惁 嵉愊惵 蛶觢, 犝獫 嶵嶯幯 縓罃蔾 魵 踄 罃蔾 獿譿躐 峷敊浭, 媓幁 黐曮禷 椵楘溍 輗 漀 摲摓 墐墆墏 捃挸栚 蛣袹跜, 岓岕 溿 斶檎檦 匢奾灱 逜郰傃</p>';
$scope.htmlcontent = $scope.orightml;
$scope.disabled = false;
});
</script>
</body>

</html>
</html>
Loading

0 comments on commit a0a8455

Please sign in to comment.