Y.Color #236

Closed
wants to merge 246 commits into
from

Conversation

Projects
None yet
@apipkin
Contributor

apipkin commented Sep 4, 2012

Full Y.Color with tests, docs, and harmony methods.

mention @jconniff
mention @msweeney
mention @allenrabinovich

ericf and others added some commits Jun 15, 2012

Extract BaseEvents from Base.
Move the observablility of `Y.Base`'s lifecycle and attribute changes
into `Y.BaseEvents`, an extension for `Y.BaseCore`.
Update `Y.Base.create/mix` to work with `Y.BaseCore`.
This allows BaseCore to be the root Base-based superclass enabling the
ability to mix in BaseEvents at runtime. The following is now possible:

    Y.Foo = Y.Base.create('foo', Y.BaseCore, []);

    // And...

    Y.Bar = Y.Base.create('bar', Y.BaseCore, [Y.BaseEvents]);

    // Or...

    Y.Baz = Y.Base.create('baz', Y.BaseCore, []);
    Y.Base.mix(Y.Baz, [Y.BaseEvents]);
Initial commit of Y.template().
ERB and Underscore-style templating for YUI.
Generic Y.Template API and Y.template() -> Y.Template.Micro
Moves Y.template() to a static Y.Template.Micro namespace and
adds Y.Template, a generic template engine API that supports
Y.Handlebars, Y.Template.Micro, and any other template engine
that adheres to a simple API interface.
Don't rely on `with`, don't do extra work during precompilation.
Removing the `with` block in compiled templates makes rendering way
faster, bumping Micro ahead of both Underscore and Handlebars in
rendering speed.
@travisbot

This comment has been minimized.

Show comment
Hide comment
@travisbot

travisbot Sep 4, 2012

This pull request fails (merged 07bbf6d into 38da169).

This pull request fails (merged 07bbf6d into 38da169).

@ericf

This comment has been minimized.

Show comment
Hide comment
@ericf

ericf Sep 4, 2012

Member

Move "color-brightness-chart.html" and "color-brightness-selector.html" under "src/color/tests/manual/".

Member

ericf commented Sep 4, 2012

Move "color-brightness-chart.html" and "color-brightness-selector.html" under "src/color/tests/manual/".

@ericf

This comment has been minimized.

Show comment
Hide comment
@ericf

ericf Sep 4, 2012

Member

Move any of the raw assets like PSDs to the YUI Assets project. You can create a color dir in its components and organize things like the other components in there.

Member

ericf commented Sep 4, 2012

Move any of the raw assets like PSDs to the YUI Assets project. You can create a color dir in its components and organize things like the other components in there.

src/color/README.md
+Color
+=========
+
+Color is a beta Component. It provides static methods for color conversion.

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

s/is a beta Component. It//

@ericf

ericf Sep 4, 2012

Member

s/is a beta Component. It//

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

You could describe each of the three modules in the Y.Color namespace.

@ericf

ericf Sep 4, 2012

Member

You could describe each of the three modules in the Y.Color namespace.

src/color/docs/assets/README.md
@@ -0,0 +1,3 @@
+Documentation Assets
+====================
+

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

Add URL to where these assets live in the YUI Assets project (once they are moved).

@ericf

ericf Sep 4, 2012

Member

Add URL to where these assets live in the YUI Assets project (once they are moved).

src/color/docs/component.json
+{
+ "name" : "color",
+ "displayName": "Color",
+ "description": "The Sortable utility provides support for the creation of a sortable list as well as the ability to join lists in various ways.",

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

Duplicate "description" key. Copy/paste error.

@ericf

ericf Sep 4, 2012

Member

Duplicate "description" key. Copy/paste error.

src/color/js/color-base.js
+/**
+Color provides static methods for color conversion.
+
+<p>For all cases of option.type, valid types are:</p><dl>

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

I think you should only use Markdown to format API docs in the JavaScript source files. The HTML is hard to read in the text editor.

@ericf

ericf Sep 4, 2012

Member

I think you should only use Markdown to format API docs in the JavaScript source files. The HTML is hard to read in the text editor.

src/color/js/color-base.js
+
+ KEYWORDS: KEYWORDS,
+
+ re_RGB: REXP_RGB,

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

If these are constants, why not have them be all upper case (e.g. REGEX_RGB)?

I'd also use REGEX instead of REXP.

@ericf

ericf Sep 4, 2012

Member

If these are constants, why not have them be all upper case (e.g. REGEX_RGB)?

I'd also use REGEX instead of REXP.

This comment has been minimized.

@apipkin

apipkin Sep 5, 2012

Contributor

re_RGB and re_Hex were in Y.Dom. They are only added to Y.Color for back compat

@apipkin

apipkin Sep 5, 2012

Contributor

re_RGB and re_Hex were in Y.Dom. They are only added to Y.Color for back compat

src/color/js/color-base.js
+ @returns {String|Array} returns array of values or CSS string if options.css is true
+ **/
+ toHex: function(options) {
+ if (Y.Lang.isString(options)) { // Preserve backwards compatability

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

Back-compat for Y.DOM?

@ericf

ericf Sep 4, 2012

Member

Back-compat for Y.DOM?

This comment has been minimized.

@apipkin

apipkin Sep 5, 2012

Contributor

Yeah. Should that be added in?

@apipkin

apipkin Sep 5, 2012

Contributor

Yeah. Should that be added in?

This comment has been minimized.

@ericf

ericf Sep 5, 2012

Member

Sure, doesn't hurt. It just stood out to be that there's back-compat code for a new component.

@ericf

ericf Sep 5, 2012

Member

Sure, doesn't hurt. It just stood out to be that there's back-compat code for a new component.

@jconniff

This comment has been minimized.

Show comment
Hide comment
@jconniff

jconniff Sep 4, 2012

Contributor

Just curious on the origin of the name "harmony" in this.

Contributor

jconniff commented Sep 4, 2012

Just curious on the origin of the name "harmony" in this.

src/color/js/color-base.js
+ type = options.type.toLowerCase();
+ val = (Y.Lang.isString(val)) ? val.toLowerCase() : val;
+
+ switch(type) {

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

Not sure I'd use a switch with fall through for this since there are only two main cases. if/else might be more clear.

@ericf

ericf Sep 4, 2012

Member

Not sure I'd use a switch with fall through for this since there are only two main cases. if/else might be more clear.

src/color/js/color-base.js
+ @returns {Object}
+ **/
+ _convertTo: function(options, to) {
+ var _options = Y.mix({}, options),

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

This creates a shallow copy of an object:

options = Y.merge(options);
@ericf

ericf Sep 4, 2012

Member

This creates a shallow copy of an object:

options = Y.merge(options);

This comment has been minimized.

@apipkin

apipkin Sep 5, 2012

Contributor

I wasn't aware of this. Should Y.merge() be used throughout?

@apipkin

apipkin Sep 5, 2012

Contributor

I wasn't aware of this. Should Y.merge() be used throughout?

This comment has been minimized.

@ericf

ericf Sep 5, 2012

Member

Not in all places, only when you want a shallow copy or a new object.

@ericf

ericf Sep 5, 2012

Member

Not in all places, only when you want a shallow copy or a new object.

src/color/js/color-harmony.js
+/**
+Color provides static methods for color conversion.
+
+<p>For all cases of options.type, valid types are:</p><dl>

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

HTML -> Markdown

@ericf

ericf Sep 4, 2012

Member

HTML -> Markdown

src/color/js/color.js
+/**
+Color provides static methods for color conversion.
+
+<p>For all cases of option.type, valid types are:</p><dl>

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

HTML -> Markdown

@ericf

ericf Sep 4, 2012

Member

HTML -> Markdown

src/color/js/color.js
+ //----------------------------
+ // C O N S T A N T S
+ //---------------------------
+ REXP: {

This comment has been minimized.

@ericf

ericf Sep 4, 2012

Member

Why not have all the Regexps in this object?

Also I think REGEX is a better name.

@ericf

ericf Sep 4, 2012

Member

Why not have all the Regexps in this object?

Also I think REGEX is a better name.

@ericf

This comment has been minimized.

Show comment
Hide comment
@ericf

ericf Sep 4, 2012

Member

Looks like some of the text files are missing their ending newlines (they are pointed out in the diff view).

Member

ericf commented Sep 4, 2012

Looks like some of the text files are missing their ending newlines (they are pointed out in the diff view).

src/color/js/color.js
+ h = 0;
+ } else if (r === max) {
+ h = ((60 * (g - b) / sub) + 360) % 360;
+ } else if (g == max) {

This comment has been minimized.

@okuryu

okuryu Sep 4, 2012

Member

Use ===.

@okuryu

okuryu Sep 4, 2012

Member

Use ===.

apipkin and others added some commits Nov 2, 2012

Add Custom Engine and Micro Precompilation sections to Template's guide.
Also, fix Templace.Micro code examples to use `<%= data.animal %>`.
Merge branch 'template' into 3.x
Conflicts:
	build/loader-yui3/loader-yui3-coverage.js
	build/loader-yui3/loader-yui3-debug.js
	build/loader-yui3/loader-yui3-min.js
	build/loader-yui3/loader-yui3.js
	build/loader/loader-debug.js
	build/loader/loader-min.js
	build/loader/loader.js
	build/simpleyui/simpleyui-min.js
	build/yui-base/yui-base-coverage.js
	build/yui-base/yui-base-min.js
	build/yui-core/yui-core-coverage.js
	build/yui-core/yui-core-min.js
	build/yui-nodejs/yui-nodejs-coverage.js
	build/yui-nodejs/yui-nodejs-debug.js
	build/yui-nodejs/yui-nodejs-min.js
	build/yui-nodejs/yui-nodejs.js
	build/yui/yui-coverage.js
	build/yui/yui-debug.js
	build/yui/yui-min.js
	build/yui/yui.js
	src/loader/js/yui3.js
Merge branch '3.x' of yuisource.corp.yahoo.com:yui3 into 3.x
Conflicts:
	build/yui-nodejs/yui-nodejs-coverage.js
	build/yui-nodejs/yui-nodejs-min.js
	build/yui/yui-coverage.js
	build/yui/yui-min.js
@apipkin

This comment has been minimized.

Show comment
Hide comment
@apipkin

apipkin Dec 6, 2012

Contributor

In dev-3.x. Closing.

Contributor

apipkin commented Dec 6, 2012

In dev-3.x. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment