You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LICENSE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Copyright (C) 2013 Sacha Schmid
1
+
Copyright (C) 2014 Sacha Schmid
2
2
3
3
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copy file name to clipboardExpand all lines: README.md
+59-1Lines changed: 59 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,14 +86,17 @@ Countable.enabled(area)
86
86
```javascript
87
87
{
88
88
hardReturns:false,
89
-
stripTags:false
89
+
stripTags:false,
90
+
ignoreReturns:false
90
91
}
91
92
```
92
93
93
94
By default, paragraphs are split by a single return (a soft return). By setting `hardReturns` to true, Countable splits paragraphs after two returns.
94
95
95
96
Depending on your application and audience, you might need to strip HTML tags from the text before counting it. You can do this by setting `stripTags` to true.
96
97
98
+
In most cases, returns should be counted as part of the `all` property. Set `ignoreReturns` to false to remove them from the counter.
99
+
97
100
## Browser Support
98
101
99
102
Countable supports all modern browsers. Internet Explorer is supported down to version 7. Note that some browsers don't implement the `oninput` event consistently so there might be differences in the way Countable works in different browsers.
@@ -125,6 +128,61 @@ Countable.live(area, function (counter) {
125
128
*`Countable.live()` and `Countable.once()` both accept one or more elements, rather than just a single one
126
129
* Inside the callback, `this` is now bound to the current element
127
130
131
+
## Changelog
132
+
133
+
### 2.0.2 _(2014-02-19)_
134
+
135
+
* NEW: Returns are counted as part of the `all` property. A new option `ignoreReturns` was added to restore the old behaviour.
136
+
137
+
### 2.0.1 _(2013-07-13)_
138
+
139
+
* FIX: Missing parameter in `Countable.once`. (Thanks to [MrOPR](https://github.com/RadLikeWhoa/Countable/pull/18))
140
+
141
+
### 2.0.0 _(2013-05-25)_
142
+
143
+
* NEW: Countable has a new Syntax. You can now use `Countable.live`, `Countable.once`, `Countable.die` and `Countable.enabled`. Notes on upgrading is provided in the README.
144
+
* NEW: Countable can now work on multiple elements with one function call.
145
+
* FIX: Prevent a XSS bug. (Thanks to [Rob--W](https://github.com/RadLikeWhoa/Countable/pull/17))
146
+
147
+
### 1.4.2 _(2013-05-23)_
148
+
149
+
* FIX: Fix a bug where options wouldn't be applied correctly.
150
+
151
+
### 1.4.1 _(2013-05-22)_
152
+
153
+
* NEW: Added option to execute the callback only once.
154
+
155
+
### 1.4.0 _(2013-05-20)_
156
+
157
+
* NEW: Allow for an options object as the third parameter.
158
+
159
+
### 1.3.0 _(2013-05-16)_
160
+
161
+
* NEW: Countable is now available as an AMD and CommonJS module.
162
+
* FIX: Better handle `textarea` with predefined value. (Thanks to [besmithett](https://github.com/RadLikeWhoa/Countable/pull/15))
163
+
164
+
### 1.2.0 _(2013-05-02)_
165
+
166
+
* NEW: Optionally strip HTML tags. (Thanks to [craniumslows](https://github.com/RadLikeWhoa/Countable/pull/13))
167
+
* NEW: Include ucs2decode function from the [punycode](https://github.com/bestiejs/punycode.js) library to better handle special characters. (Thanks to [craniumslows](https://github.com/RadLikeWhoa/Countable/pull/13))
168
+
* IMPROVED: Better handling of punctuation.
169
+
170
+
### 1.1.1 _(2013-03-16)_
171
+
172
+
* IMPROVED: Better support for foreign languages and special characters.
173
+
174
+
### 1.1.0 _(2013-03-12)_
175
+
176
+
* NEW: Include number of characters including whitespace.
177
+
* NEW: Countable is now available on Bower.
178
+
* IMPROVED: Improve performance when counting the values.
179
+
* IMPROVED: Improve performance when trimming strings by using `String::trim` when available.
180
+
* IMPROVED: Better documentation.
181
+
182
+
### 1.0.0 _(2013-03-11)_
183
+
184
+
* Initial release
185
+
128
186
## About the Author
129
187
130
188
My name is [Sacha Schmid](http://sachaschmid.ch) ([**@sachaschmid**](https://twitter.com/sachaschmid)). I'm a front-end engineer from Switzerland. I am the creator of [SSGS](http://github.com/RadLikeWhoa/SSGS) and [other open source projects](https://github.com/RadLikeWhoa).
0 commit comments