Skip to content
Browse files

docs and generator changes

  • Loading branch information...
1 parent 0f3d008 commit d9bb91a624bdbfe59f55e49018d685b8ffc59a39 @andrewplummer committed
Showing with 13 additions and 23 deletions.
  1. +1 −1 docs/generator.rb
  2. +12 −22 lib/sugar.js
View
2 docs/generator.rb
@@ -144,7 +144,7 @@ def get_examples(s, name)
get_html_parameters(method[:short])
get_html_parameters(method[:extra])
@current_module[:methods] << method
- if method[:name] == 'stripTags' || method[:name] == 'removeTags'
+ if method[:name] == 'stripTags' || method[:name] == 'removeTags' || method[:name] == 'escapeHTML' || method[:name] == 'unescapeHTML'
method[:escape_html] = true
end
if method[:alias]
View
34 lib/sugar.js
@@ -442,6 +442,7 @@
*
* Object.extended()
* Object.extended({ happy:true, pappy:false })
+ * Object.extended({ happy:true, pappy:false }).keys() -> ['happy','pappy']
*
***/
'extended': function(obj) {
@@ -862,10 +863,6 @@
*
* [1,2,3].indexOf(3) -> 1
* [1,2,3].indexOf(7) -> -1
- + [1,2,3].indexOf(function(n) {
- * return n > 1;
- * });
- * [{a:4},{b:2}].indexOf({a:4}) -> 0
*
***/
'indexOf': function(search, fromIndex) {
@@ -892,15 +889,11 @@
* @method lastIndexOf(<search>, [fromIndex])
* @returns Number
* @short Searches the array and returns the last index where <search> occurs, or -1 if the element is not found.
- * @extra [fromIndex] is the index from which to begin the search. This method performs a simple strict equality comparison on <search>. It does not support enhanced functionality such as searching the contents against a regex, callback, or deep comparison of objects. For such functionality, use the %findLast% method instead.
+ * @extra [fromIndex] is the index from which to begin the search. This method performs a simple strict equality comparison on <search>.
* @example
*
* [1,2,1].lastIndexOf(1) -> 2
* [1,2,1].lastIndexOf(7) -> -1
- + [1,2,1].lastIndexOf(function(n) {
- * return n == 1;
- * });
- * [{a:4},{b:2},{a:4}].lastIndexOf({a:4}) -> 2
*
***/
'lastIndexOf': function(search, fromIndex) {
@@ -1285,6 +1278,7 @@
* @example
*
* [1,3,5].subtract([5,7,9]) -> [1,3]
+ * [1,3,5].subtract([3],[5]) -> [1]
* ['a','b'].subtract('b','c') -> ['a']
*
***/
@@ -2436,7 +2430,6 @@
* 'सभी मनुष्यों'.isDevanagari() -> true
*
***/
-
var unicodeScripts = [
{ names: ['Arabic'], source: '\u0600-\u06FF' },
{ names: ['Armenian'], source: '\u0530-\u058F' },
@@ -5357,8 +5350,8 @@
* @short Sets the weekday of the date.
* @example
*
- * new Date().setWeekday(1) -> Monday of this week
- * new Date().setWeekday(6) -> Saturday of this week
+ * d = new Date(); d.setWeekday(1); d; -> Monday of this week
+ * d = new Date(); d.setWeekday(6); d; -> Saturday of this week
*
***/
'setWeekday': function(dow) {
@@ -5372,8 +5365,8 @@
* @short Sets the weekday of the date according to universal time.
* @example
*
- * new Date().setUTCWeekday(1) -> Monday of this week
- * new Date().setUTCWeekday(6) -> Saturday of this week
+ * d = new Date(); d.setUTCWeekday(1); d; -> Monday of this week
+ * d = new Date(); d.setUTCWeekday(6); d; -> Saturday of this week
*
***/
'setUTCWeekday': function(dow) {
@@ -5387,7 +5380,7 @@
* @short Sets the week (of the year).
* @example
*
- * Date.create('January 1').setWeek(15) -> 15th week of the year
+ * d = new Date(); d.setWeek(15); d; -> 15th week of the year
*
***/
'setWeek': function(week) {
@@ -5403,7 +5396,7 @@
* @short Sets the week (of the year) according to universal time.
* @example
*
- * Date.create('January 1').setUTCWeek(15) -> 15th week of the year
+ * d = new Date(); d.setUTCWeek(15); d; -> 15th week of the year
*
***/
'setUTCWeek': function(week) {
@@ -5623,13 +5616,10 @@
* Date.create().format('{d} {Month}, {YYYY}') -> ex. July 4, 2003
* Date.create().format('{hh}:{mm}') -> ex. 15:57
* Date.create().format('{12hr}:{mm}{tt}') -> ex. 3:57pm
- * Date.create().format(Date.AMERICAN_DATETIME) -> ex. 3/15/2005 3:15pm
- * Date.create().format(Date.INTERNATIONAL_TIME) -> ex. 21:55:03
* Date.create().format(Date.RFC1123) -> ex. Tue, 05 Jul 2011 04:04:22 GMT+0900
* Date.create().format(Date.ISO8601) -> ex. 2011-07-05 12:24:55.528Z
- * Date.create('1995').format('{years ago}') -> ex. 15 years ago
* Date.create('beginning of this week').format('relative') -> ex. 3 days ago
- + Date.create('yesterday').format(function(value,unit,ms,dir) {
+ * Date.create('yesterday').format(function(value,unit,ms,dir) {
* // value = 1, unit = 'day', ms = 86400000, dir = -1
* }); -> ex. 1 day ago
*
@@ -6010,7 +6000,7 @@
* @example
*
* var f = (function() {
- * alert('woo'); // Will be executed once only
+ * // Will be executed once only
* }).after(3); f(); f(); f();
*
***/
@@ -6034,7 +6024,7 @@
* @example
*
* var f = (function() {
- * alert('woo'); // Will be executed once only
+ * // Will be executed once only
* }).once(); f(); f(); f();
*
***/

0 comments on commit d9bb91a

Please sign in to comment.
Something went wrong with that request. Please try again.