Skip to content

Commit

Permalink
h.makeColorObj: fix the new chrome issue
Browse files Browse the repository at this point in the history
  • Loading branch information
legomushroom committed Nov 19, 2015
1 parent ec0f9c1 commit 332c1bc
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 46 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mojs",
"description": "motion graphics toolbelt for the web",
"version": "0.147.3",
"version": "0.147.4",
"license": "MIT",
"homepage": "https://github.com/legomushroom/mojs",
"authors": [
Expand Down
8 changes: 4 additions & 4 deletions build/mo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
:: mo · js :: motion graphics toolbelt for the web
Oleg Solomka @LegoMushroom 2015 MIT
0.147.3
0.147.4
*/

(function(f){
Expand Down Expand Up @@ -1441,7 +1441,7 @@ Helpers = (function() {
};

Helpers.prototype.makeColorObj = function(color) {
var alpha, b, colorObj, g, isRgb, r, regexString1, regexString2, result, rgbColor, style;
var alpha, b, colorObj, g, isRgb, r, regexString1, regexString2, result, rgbColor;
if (color[0] === '#') {
result = /^#?([a-f\d]{1,2})([a-f\d]{1,2})([a-f\d]{1,2})$/i.exec(color);
colorObj = {};
Expand All @@ -1463,7 +1463,7 @@ Helpers = (function() {
rgbColor = color;
}
if (!isRgb) {
rgbColor = !this.shortColors[color] ? (this.div.style.color = color, this.isFF || this.isIE || this.isOldOpera ? (style = this.computedStyle(this.div), this.computedStyle(this.div).color) : this.div.style.color) : this.shortColors[color];
rgbColor = !this.shortColors[color] ? (this.div.style.color = color, this.computedStyle(this.div).color) : this.shortColors[color];
}
regexString1 = '^rgba?\\((\\d{1,3}),\\s?(\\d{1,3}),';
regexString2 = '\\s?(\\d{1,3}),?\\s?(\\d{1}|0?\\.\\d{1,})?\\)$';
Expand Down Expand Up @@ -1705,7 +1705,7 @@ module.exports = h;

},{}],7:[function(require,module,exports){
window.mojs = {
revision: '0.147.3',
revision: '0.147.4',
isDebug: true,
helpers: require('./h'),
Bit: require('./shapes/bit'),
Expand Down
9 changes: 5 additions & 4 deletions build/mo.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
<div class="segment">

<div class="comments ">
<div class="wrapper"><h1 id="mo-js-"><a href="#mo-js-" class="anchor"></a>mo · js <a href="https://travis-ci.org/legomushroom/mojs"><img src="https://travis-ci.org/legomushroom/mojs.svg?branch=master" alt="Build Status"></a> <a href="https://coveralls.io/r/legomushroom/mojs?branch=master"><img src="https://coveralls.io/repos/legomushroom/mojs/badge.svg?branch=master" alt="Coverage Status"></a> <a href="http://github.com/badges/stability-badges"><img src="https://img.shields.io/badge/stability-unstable-yellow.svg" alt="unstable"></a> <a href="https://mojs.slack.com/messages/mojs/"><img src="https://img.shields.io/badge/slack-mojs%20channel-61DAAA.svg?style=flat" alt="mojs channel on slack"></a></h1><h4 id="motion-graphics-toolbelt-for-the-web"><a href="#motion-graphics-toolbelt-for-the-web" class="anchor"></a>motion graphics toolbelt for the web</h4><p><a href="https://saucelabs.com/u/legomushroom"><img src="https://saucelabs.com/browser-matrix/legomushroom.svg" alt="Sauce Test Status"></a></p>
<h2 id="demos"><a href="#demos" class="anchor"></a>Demos</h2><p>[<a href="http://codepen.io/sol0mka/full/ogOYJj/">motion graphics for the web</a>]
[<a href="http://codepen.io/sol0mka/full/yNOage/">bubble layout</a>]</p>
<div class="wrapper"><h1 id="mo-js-"><a href="#mo-js-" class="anchor"></a>mo · js <a href="https://travis-ci.org/legomushroom/mojs"><img src="https://travis-ci.org/legomushroom/mojs.svg?branch=dev" alt="Build Status"></a> <a href="https://coveralls.io/r/legomushroom/mojs?branch=dev"><img src="https://coveralls.io/repos/legomushroom/mojs/badge.svg?branch=dev" alt="Coverage Status"></a> <a href="http://github.com/badges/stability-badges"><img src="https://img.shields.io/badge/stability-unstable-yellow.svg" alt="unstable"></a> <a href="https://mojs.slack.com/messages/mojs/"><img src="https://img.shields.io/badge/slack-mojs%20channel-61DAAA.svg?style=flat" alt="mojs channel on slack"></a></h1><h4 id="motion-graphics-toolbelt-for-the-web"><a href="#motion-graphics-toolbelt-for-the-web" class="anchor"></a>motion graphics toolbelt for the web</h4><p><a href="https://saucelabs.com/u/legomushroom-dev"><img src="https://saucelabs.com/browser-matrix/legomushroom-dev.svg" alt="Sauce Test Status"></a></p>
<h2 id="demos"><a href="#demos" class="anchor"></a>Demos</h2><p>[<a href="http://codepen.io/sol0mka/full/ogOYJj/">motion graphics for the web</a>]</p>
<h2 id="important-note"><a href="#important-note" class="anchor"></a>Important note</h2><p>The library is under active development. APIs should be considered <code>[unstable]</code> and can be changed drastically.</p>
<h2 id="installation"><a href="#installation" class="anchor"></a>Installation</h2><h3 id="cdn"><a href="#cdn" class="anchor"></a>CDN</h3><p><code>&lt;script src=&quot;//cdn.jsdelivr.net/mojs/latest/mo.min.js&quot;&gt;&lt;/script&gt;</code> </p>
<h3 id="bower"><a href="#bower" class="anchor"></a>Bower</h3><p><code>bower install mojs</code></p>
Expand Down
5 changes: 1 addition & 4 deletions docs/js/h.coffee.html
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,7 @@
<div class="code"><div class="wrapper"> <span class="hljs-keyword">if</span> !isRgb
rgbColor = <span class="hljs-keyword">if</span> !<span class="hljs-property">@shortColors</span>[color]
<span class="hljs-property">@div</span>.style.color = color
<span class="hljs-keyword">if</span> <span class="hljs-property">@isFF</span> <span class="hljs-keyword">or</span> <span class="hljs-property">@isIE</span> <span class="hljs-keyword">or</span> <span class="hljs-property">@isOldOpera</span>
style = <span class="hljs-property">@computedStyle</span>(<span class="hljs-property">@div</span>)
<span class="hljs-property">@computedStyle</span>(<span class="hljs-property">@div</span>).color
<span class="hljs-keyword">else</span> <span class="hljs-property">@div</span>.style.color
<span class="hljs-property">@computedStyle</span>(<span class="hljs-property">@div</span>).color
<span class="hljs-keyword">else</span> <span class="hljs-property">@shortColors</span>[color]

regexString1 = <span class="hljs-string">'^rgba?\\((\\d{1,3}),\\s?(\\d{1,3}),'</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/js/mojs.coffee.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


<div class="code"><div class="wrapper"><span class="hljs-built_in">window</span>.mojs =
<span class="hljs-attribute">revision</span>: <span class="hljs-string">'0.147.3'</span>, <span class="hljs-attribute">isDebug</span>: <span class="hljs-literal">true</span>
<span class="hljs-attribute">revision</span>: <span class="hljs-string">'0.147.4'</span>, <span class="hljs-attribute">isDebug</span>: <span class="hljs-literal">true</span>
helpers : <span class="hljs-built_in">require</span> <span class="hljs-string">'./h'</span>
Bit : <span class="hljs-built_in">require</span> <span class="hljs-string">'./shapes/bit'</span>
bitsMap : <span class="hljs-built_in">require</span> <span class="hljs-string">'./shapes/bitsMap'</span>
Expand Down
32 changes: 16 additions & 16 deletions docs/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,6 @@ window.files = [
}
]
},
{
"path": "js/polyfills/performance.coffee.html",
"originalName": "performance.coffee",
"originalPath": "js/polyfills/performance.coffee",
"name": "performance.coffee.html",
"lang": "coffeescript",
"toc": []
},
{
"path": "js/polyfills/raf.coffee.html",
"originalName": "raf.coffee",
"originalPath": "js/polyfills/raf.coffee",
"name": "raf.coffee.html",
"lang": "coffeescript",
"toc": []
},
{
"path": "js/shapes/bit.coffee.html",
"originalName": "bit.coffee",
Expand Down Expand Up @@ -222,6 +206,22 @@ window.files = [
"lang": "coffeescript",
"toc": []
},
{
"path": "js/polyfills/performance.coffee.html",
"originalName": "performance.coffee",
"originalPath": "js/polyfills/performance.coffee",
"name": "performance.coffee.html",
"lang": "coffeescript",
"toc": []
},
{
"path": "js/polyfills/raf.coffee.html",
"originalName": "raf.coffee",
"originalPath": "js/polyfills/raf.coffee",
"name": "raf.coffee.html",
"lang": "coffeescript",
"toc": []
},
{
"path": "js/tween/timeline.coffee.html",
"originalName": "timeline.coffee",
Expand Down
5 changes: 1 addition & 4 deletions js/h.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,7 @@ class Helpers
if !isRgb
rgbColor = if !@shortColors[color]
@div.style.color = color
if @isFF or @isIE or @isOldOpera
style = @computedStyle(@div)
@computedStyle(@div).color
else @div.style.color
@computedStyle(@div).color
else @shortColors[color]

regexString1 = '^rgba?\\((\\d{1,3}),\\s?(\\d{1,3}),'
Expand Down
3 changes: 1 addition & 2 deletions js/mojs.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

window.mojs =
revision: '0.147.3', isDebug: true
revision: '0.147.4', isDebug: true
helpers : require './h'
Bit : require './shapes/bit'
bitsMap : require './shapes/bitsMap'
Expand Down Expand Up @@ -33,4 +33,3 @@ if (typeof module is "object") and (typeof module.exports is "object")
module.exports = mojs
# ### istanbul ignore next ###
# return window?.mojs = mojs

4 changes: 2 additions & 2 deletions lib/h.js

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

2 changes: 1 addition & 1 deletion lib/mojs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function() {
window.mojs = {
revision: '0.147.3',
revision: '0.147.4',
isDebug: true,
helpers: require('./h'),
Bit: require('./shapes/bit'),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mo-js",
"description": "motion graphics toolbelt for the web",
"version": "0.147.3",
"version": "0.147.4",
"license": "MIT",
"private": false,
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions spec/mo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ Helpers = (function() {
};

Helpers.prototype.makeColorObj = function(color) {
var alpha, b, colorObj, g, isRgb, r, regexString1, regexString2, result, rgbColor, style;
var alpha, b, colorObj, g, isRgb, r, regexString1, regexString2, result, rgbColor;
if (color[0] === '#') {
result = /^#?([a-f\d]{1,2})([a-f\d]{1,2})([a-f\d]{1,2})$/i.exec(color);
colorObj = {};
Expand All @@ -1461,7 +1461,7 @@ Helpers = (function() {
rgbColor = color;
}
if (!isRgb) {
rgbColor = !this.shortColors[color] ? (this.div.style.color = color, this.isFF || this.isIE || this.isOldOpera ? (style = this.computedStyle(this.div), this.computedStyle(this.div).color) : this.div.style.color) : this.shortColors[color];
rgbColor = !this.shortColors[color] ? (this.div.style.color = color, this.computedStyle(this.div).color) : this.shortColors[color];
}
regexString1 = '^rgba?\\((\\d{1,3}),\\s?(\\d{1,3}),';
regexString2 = '\\s?(\\d{1,3}),?\\s?(\\d{1}|0?\\.\\d{1,})?\\)$';
Expand Down Expand Up @@ -1703,7 +1703,7 @@ module.exports = h;

},{}],7:[function(require,module,exports){
window.mojs = {
revision: '0.147.3',
revision: '0.147.4',
isDebug: true,
helpers: require('./h'),
Bit: require('./shapes/bit'),
Expand Down

0 comments on commit 332c1bc

Please sign in to comment.