Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewplummer committed Oct 4, 2012
1 parent c7474e5 commit a8b02a5
Show file tree
Hide file tree
Showing 13 changed files with 173 additions and 165 deletions.
11 changes: 2 additions & 9 deletions release/edge/precompiled/development/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,15 +905,8 @@
*
***/
'sample': function(num) {
var result = [], arr = this.clone(), index;
if(isUndefined(num)) num = 1;
while(result.length < num) {
index = floor(math.random() * (arr.length - 1));
result.push(arr[index]);
arr.removeAt(index);
if(arr.length == 0) break;
}
return arguments.length > 0 ? result : result[0];
var arr = this.randomize();
return arguments.length > 0 ? arr.slice(0, num) : arr[0];
},

/***
Expand Down
33 changes: 22 additions & 11 deletions release/edge/precompiled/development/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@
}
}



extend(string, true, false, {

/***
Expand Down Expand Up @@ -152,7 +150,12 @@
*
***/
'escapeHTML': function() {
return this.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
return this.replace(/&/g, '&amp;' )
.replace(/</g, '&lt;' )
.replace(/>/g, '&gt;' )
.replace(/"/g, '&quot;')
.replace(/'/g, '&apos;')
.replace(/\//g, '&#x2f;');
},

/***
Expand All @@ -166,7 +169,12 @@
*
***/
'unescapeHTML': function() {
return this.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&');
return this.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&apos;/g, "'")
.replace(/&#x2f;/g, '/');
},

/***
Expand Down Expand Up @@ -753,17 +761,21 @@
*
* 'jumpy'.repeat(2) -> 'jumpyjumpy'
* 'a'.repeat(5) -> 'aaaaa'
* 'a'.repeat(0) -> ''
*
***/
'repeat': function(num) {
var str = '', i = 0;
if(isNumber(num) && num > 0) {
while(i < num) {
str += this;
i++;
var result = '', str = this;
if(!isNumber(num) || num < 1) return '';
while (num) {
if (num & 1) {
result += str;
}
if (num >>= 1) {
str += str;
}
}
return str;
return result;
},

/***
Expand Down Expand Up @@ -851,7 +863,6 @@
});
return context;
}

});


Expand Down
22 changes: 11 additions & 11 deletions release/edge/precompiled/minified/array.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions release/edge/precompiled/minified/core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a8b02a5

Please sign in to comment.