mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -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
|
* Camelizes the passed hyphenated string: caps-lock -> capsLock
|
||||||
*/
|
*/
|
||||||
camelize: function(str) {
|
camelize: function(str) {
|
||||||
return str.replace(/-(.)/g, function(all, chr) {
|
return str.replace(/-(.)/g, function(match, chr) {
|
||||||
return chr.toUpperCase();
|
return chr.toUpperCase();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converst camelized strings to hyphenated ones: CapsLock -> caps-lock
|
* Converts camelized strings to hyphenated ones: CapsLock -> caps-lock
|
||||||
*/
|
*/
|
||||||
hyphenate: function(str) {
|
hyphenate: function(str) {
|
||||||
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
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
|
// only difference to jQuery.browser
|
||||||
user.replace(
|
user.replace(
|
||||||
/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,
|
/(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.
|
// Do not set additional browsers once chrome is detected.
|
||||||
if (!agent.chrome) {
|
if (!agent.chrome) {
|
||||||
var v = n === 'opera' ? v2 :
|
var v = n === 'opera' ? v2 :
|
||||||
|
|
|
@ -45,7 +45,7 @@ XMLSerializer.prototype.serializeToString = function(node) {
|
||||||
var tagName = tagNames[i];
|
var tagName = tagNames[i];
|
||||||
text = text.replace(
|
text = text.replace(
|
||||||
new RegExp('(<|</)' + tagName.toLowerCase() + '\\b', 'g'),
|
new RegExp('(<|</)' + tagName.toLowerCase() + '\\b', 'g'),
|
||||||
function(all, start) {
|
function(match, start) {
|
||||||
return start + tagName;
|
return start + tagName;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue