mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Minor code and comments cleanup.
This commit is contained in:
parent
9a49c2141c
commit
753b27afe0
3 changed files with 4 additions and 4 deletions
|
@ -613,13 +613,13 @@ Base.inject(/** @lends Base# */{
|
|||
* Camelizes the passed hyphenated string: caps-lock -> capsLock
|
||||
*/
|
||||
camelize: function(str) {
|
||||
return str.replace(/-(.)/g, function(all, chr) {
|
||||
return str.replace(/-(.)/g, function(match, chr) {
|
||||
return chr.toUpperCase();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Converst camelized strings to hyphenated ones: CapsLock -> caps-lock
|
||||
* Converts camelized strings to hyphenated ones: CapsLock -> caps-lock
|
||||
*/
|
||||
hyphenate: function(str) {
|
||||
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
|
|
|
@ -89,7 +89,7 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
|
|||
// only difference to jQuery.browser
|
||||
user.replace(
|
||||
/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,
|
||||
function(all, n, v1, v2, rv) {
|
||||
function(match, n, v1, v2, rv) {
|
||||
// Do not set additional browsers once chrome is detected.
|
||||
if (!agent.chrome) {
|
||||
var v = n === 'opera' ? v2 :
|
||||
|
|
|
@ -45,7 +45,7 @@ XMLSerializer.prototype.serializeToString = function(node) {
|
|||
var tagName = tagNames[i];
|
||||
text = text.replace(
|
||||
new RegExp('(<|</)' + tagName.toLowerCase() + '\\b', 'g'),
|
||||
function(all, start) {
|
||||
function(match, start) {
|
||||
return start + tagName;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue