Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/fraywing/textAngular
Browse files Browse the repository at this point in the history
  • Loading branch information
SimeonC authored and SimeonC committed Mar 13, 2015
2 parents 8693e1d + f3b4e76 commit 30aa67f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -37,7 +37,7 @@ chances of your issue being dealt with quickly:
* **Motivation for or Use Case** - explain why this is a bug for you
* **Angular Version(s)** - is it a regression?
* **Browsers and Operating System** - is this a problem with all browsers or only IE8?
* **Reproduce the error** - provide a live example ([Plunkr](http://plnkr.co/edit/tpl:8G84wkJVjabOvCl1DryF?p=preview)) or a unambiguous set of steps.
* **Reproduce the error** - provide a live example ([Plunkr](http://plnkr.co/edit/tpl:RaBEszV5xrAZ0VRoZ7PM?p=preview)) or a unambiguous set of steps.
* **Related issues** - has a similar issue been reported before?
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
causing the problem (line of code or commit)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@ textAngular v1.3.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:8G84wkJVjabOvCl1DryF))
Demo is available at: http://www.textangular.com (Or editable [Plunkr Demo](http://plnkr.co/edit/tpl:RaBEszV5xrAZ0VRoZ7PM))

#### Upgrading From 1.2.2 or earlier

Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Expand Up @@ -4,7 +4,7 @@

#### Bug Fixes

* **taSanitize:** Close XSS vector ([f5f27c26](http://github.com/fraywing/textAngular/commit/f5f27c26bc99dc6f8bb226d7beb99ce8bcada01a))
* **taSanitize:** Close XSS vector, See http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0167, http://xforce.iss.net/xforce/xfdb/100929 and https://exchange.xforce.ibmcloud.com/#/vulnerabilities/100929 for details. ([f5f27c26](http://github.com/fraywing/textAngular/commit/f5f27c26bc99dc6f8bb226d7beb99ce8bcada01a))


<a name="1.3.6"></a>
Expand Down
26 changes: 13 additions & 13 deletions src/textAngularSetup.js
Expand Up @@ -7,7 +7,7 @@ Version 1.3.7
See README.md or https://github.com/fraywing/textAngular/wiki for requirements and use.
*/
angular.module('textAngularSetup', [])

// Here we set up the global display defaults, to set your own use a angular $provider#decorator.
.value('taOptions', {
toolbar: [
Expand Down Expand Up @@ -104,7 +104,7 @@ angular.module('textAngularSetup', [])
tooltip: 'Ordered List'
},
quote: {
tooltip: 'Quote/unqoute selection or paragraph'
tooltip: 'Quote/unquote selection or paragraph'
},
undo: {
tooltip: 'Undo'
Expand Down Expand Up @@ -321,7 +321,7 @@ angular.module('textAngularSetup', [])
return this.$editor().wrapSelection("indent", null);
},
activeState: function(){
return this.$editor().queryFormatBlockState('blockquote');
return this.$editor().queryFormatBlockState('blockquote');
}
});
taRegisterTool('outdent', {
Expand Down Expand Up @@ -401,7 +401,7 @@ angular.module('textAngularSetup', [])
if(_preLis.length === 0 || _postLis.length === 0){
if(_postLis.length === 0) _parent.after(newElem);
else _parent[0].parentNode.insertBefore(newElem[0], _parent[0]);

if(_preLis.length === 0 && _postLis.length === 0) _parent.remove();
else angular.element(possibleNodes[0]).remove();
}else{
Expand Down Expand Up @@ -431,7 +431,7 @@ angular.module('textAngularSetup', [])
restoreSelection();
}
});

var imgOnSelectAction = function(event, $element, editorScope){
// setup the editor toolbar
// Credit to the work at http://hackerwins.github.io/summernote/ for this editbar logic/display
Expand Down Expand Up @@ -485,7 +485,7 @@ angular.module('textAngularSetup', [])
buttonGroup.append(quartButton);
buttonGroup.append(resetButton);
container.append(buttonGroup);

buttonGroup = angular.element('<div class="btn-group" style="padding-right: 6px;">');
var floatLeft = angular.element('<button type="button" class="btn btn-default btn-sm btn-small" unselectable="on" tabindex="-1"><i class="fa fa-align-left"></i></button>');
floatLeft.on('click', function(event){
Expand Down Expand Up @@ -524,7 +524,7 @@ angular.module('textAngularSetup', [])
buttonGroup.append(floatNone);
buttonGroup.append(floatRight);
container.append(buttonGroup);

buttonGroup = angular.element('<div class="btn-group">');
var remove = angular.element('<button type="button" class="btn btn-default btn-sm btn-small" unselectable="on" tabindex="-1"><i class="fa fa-trash-o"></i></button>');
remove.on('click', function(event){
Expand All @@ -534,11 +534,11 @@ angular.module('textAngularSetup', [])
});
buttonGroup.append(remove);
container.append(buttonGroup);

editorScope.showPopover($element);
editorScope.showResizeOverlay($element);
};

taRegisterTool('insertImage', {
iconclass: 'fa fa-picture-o',
tooltiptext: taTranslations.insertImage.tooltip,
Expand Down Expand Up @@ -581,7 +581,7 @@ angular.module('textAngularSetup', [])
onlyWithAttrs: ['ta-insert-video'],
action: imgOnSelectAction
}
});
});
taRegisterTool('insertLink', {
tooltiptext: taTranslations.insertLink.tooltip,
iconclass: 'fa fa-link',
Expand Down Expand Up @@ -661,11 +661,11 @@ angular.module('textAngularSetup', [])
var textElement = this.$editor().displayElements.text;
var workingHTML = textElement[0].innerHTML;
var sourceText = workingHTML.replace(/(<[^>]*?>)/ig, ' '); // replace all html tags with spaces

// Caculate number of words
var sourceTextMatches = sourceText.match(/\S+/g);
var noOfWords = sourceTextMatches && sourceTextMatches.length || 0;

//Set current scope
this.wordcount = noOfWords;
//Set editor scope
Expand All @@ -680,7 +680,7 @@ angular.module('textAngularSetup', [])
activeState: function(){ // this fires on keyup
var textElement = this.$editor().displayElements.text;
var sourceText = textElement[0].innerText || textElement[0].textContent; // to cover the non-jquery use case.

// Caculate number of chars
var noOfChars = sourceText.replace(/(\r\n|\n|\r)/gm,"").replace(/^\s+/g,' ').replace(/\s+$/g, ' ').length;
//Set current scope
Expand Down

0 comments on commit 30aa67f

Please sign in to comment.