Skip to content

Commit

Permalink
Gallery Build Tag: gallery-2011.09.28-20-06
Browse files Browse the repository at this point in the history
  • Loading branch information
YUI Builder committed Sep 28, 2011
1 parent a076dd9 commit 27ba9a5
Show file tree
Hide file tree
Showing 18 changed files with 340 additions and 113 deletions.
55 changes: 37 additions & 18 deletions build/gallery-colorpicker/gallery-colorpicker-debug.js
Expand Up @@ -553,9 +553,11 @@ Y.extend(ColorPicker, Y.Widget, {
this.trackBar = args.component;
this.trackBarCanvas = ev.target;
var offXY = ev.target.getXY(),
scrollX = ev.target.get('docScrollX'),
scrollY = ev.target.get('docScrollY'),
// get position within the square
x = ev.clientX - offXY[0],
y = ev.clientY - offXY[1];
x = ev.clientX + scrollX - offXY[0],
y = ev.clientY + scrollY - offXY[1];

this.barX = x;
this.barY = y;
Expand All @@ -573,13 +575,19 @@ Y.extend(ColorPicker, Y.Widget, {
x,
y,
width,
height;
height,
scrollX,
scrollY,
c;

if (this.trackSquare) {
offXY = Y.Node.one(this.squareCanvas).getXY();
c = Y.Node.one(this.squareCanvas);
offXY = c.getXY();
scrollX = c.get('docScrollX');
scrollY = c.get('docScrollY');
// get position within the square
x = ev.clientX - offXY[0];
y = ev.clientY - offXY[1];
x = ev.clientX + scrollX - offXY[0];
y = ev.clientY + scrollY - offXY[1];
width = this.get('squareWidth');
height = this.get('squareHeight');

Expand All @@ -592,9 +600,11 @@ Y.extend(ColorPicker, Y.Widget, {
}
if (this.trackBar) {
offXY = this.trackBarCanvas.getXY();
scrollX = this.trackBarCanvas.get('docScrollX');
scrollY = this.trackBarCanvas.get('docScrollY');
// get position within the square
x = -this.barPaddingX + ev.clientX - offXY[0];
y = -this.barPaddingY + ev.clientY - offXY[1];
x = -this.barPaddingX + ev.clientX + scrollX - offXY[0];
y = -this.barPaddingY + ev.clientY + scrollY - offXY[1];
width = this.get('barWidth');
height = this.get('barHeight');

Expand All @@ -611,16 +621,21 @@ Y.extend(ColorPicker, Y.Widget, {
// mousedown inside square, start tracking position
this.trackSquare = true;
var offXY = ev.target.getXY(),
scrollX = ev.target.get('docScrollX'),
scrollY = ev.target.get('docScrollY'),
// get position within the square
x = ev.clientX - offXY[0],
y = ev.clientY - offXY[1];
x = ev.clientX + scrollX - offXY[0],
y = ev.clientY + scrollY - offXY[1];

this.squareX = x;
this.squareY = y;
this.startUpdating();
ev.halt();
},
updateColor: function () {
if (!this.get('showHSLBars')) {
return;
}
var barWidth = this.get('barWidth'),
barHeight = this.get('barHeight'),
cacheBars = this.get('cacheBars'),
Expand Down Expand Up @@ -757,11 +772,13 @@ Y.extend(ColorPicker, Y.Widget, {
}
}
this.renderSquare();
this.updateColor();
this.updateValues();
this.drawThumb(this.hCanvas, 'h', {h: this.color.h, s: 1.0, l: 0.5}, barWidth, barHeight, 1.0, false);
this.drawThumb(this.sCanvas, 's', {h: this.color.h, s: 1.0, l: this.color.l}, barWidth, barHeight, 1.0, true);
this.drawThumb(this.lCanvas, 'l', {h: this.color.h, s: this.color.s, l: 0.5}, barWidth, barHeight, 1.0, true);
if (this.get('showHSLBars')) {
this.updateColor();
this.drawThumb(this.hCanvas, 'h', {h: this.color.h, s: 1.0, l: 0.5}, barWidth, barHeight, 1.0, false);
this.drawThumb(this.sCanvas, 's', {h: this.color.h, s: 1.0, l: this.color.l}, barWidth, barHeight, 1.0, true);
this.drawThumb(this.lCanvas, 'l', {h: this.color.h, s: this.color.s, l: 0.5}, barWidth, barHeight, 1.0, true);
}
},
renderSquare: function () {
var width = this.get('squareWidth'), height = this.get('squareHeight'),
Expand Down Expand Up @@ -864,9 +881,11 @@ Y.extend(ColorPicker, Y.Widget, {
},
bindUI: function () {
Y.on('mousedown', this.onSquareMouseDown, this.squareCanvas, this);
Y.on('mousedown', this.onBarMouseDown, this.hCanvas, this, {component: 'h'});
Y.on('mousedown', this.onBarMouseDown, this.sCanvas, this, {component: 's'});
Y.on('mousedown', this.onBarMouseDown, this.lCanvas, this, {component: 'l'});
if (this.get('showHSLBars')) {
Y.on('mousedown', this.onBarMouseDown, this.hCanvas, this, {component: 'h'});
Y.on('mousedown', this.onBarMouseDown, this.sCanvas, this, {component: 's'});
Y.on('mousedown', this.onBarMouseDown, this.lCanvas, this, {component: 'l'});
}
Y.delegate('keyup', this.onInputKeyUp, this.contentBox, '.' + ColorPicker.CLASSNAME_VALUE, this);
Y.delegate('blur', this.onInputBlur, this.contentBox, '.' + ColorPicker.CLASSNAME_VALUE, this);
Y.delegate('keydown', this.onInputKeyDown, this.contentBox, '.' + ColorPicker.CLASSNAME_VALUE, this);
Expand Down Expand Up @@ -976,4 +995,4 @@ Y.extend(ColorPalette, Y.Widget, {
Y.ColorPalette = ColorPalette;


}, 'gallery-2011.09.14-20-40' ,{requires:['node', 'event', 'widget', 'classnamemanager']});
}, 'gallery-2011.09.28-20-06' ,{requires:['node', 'event', 'widget', 'classnamemanager']});
4 changes: 2 additions & 2 deletions build/gallery-colorpicker/gallery-colorpicker-min.js

Large diffs are not rendered by default.

55 changes: 37 additions & 18 deletions build/gallery-colorpicker/gallery-colorpicker.js
Expand Up @@ -553,9 +553,11 @@ Y.extend(ColorPicker, Y.Widget, {
this.trackBar = args.component;
this.trackBarCanvas = ev.target;
var offXY = ev.target.getXY(),
scrollX = ev.target.get('docScrollX'),
scrollY = ev.target.get('docScrollY'),
// get position within the square
x = ev.clientX - offXY[0],
y = ev.clientY - offXY[1];
x = ev.clientX + scrollX - offXY[0],
y = ev.clientY + scrollY - offXY[1];

this.barX = x;
this.barY = y;
Expand All @@ -573,13 +575,19 @@ Y.extend(ColorPicker, Y.Widget, {
x,
y,
width,
height;
height,
scrollX,
scrollY,
c;

if (this.trackSquare) {
offXY = Y.Node.one(this.squareCanvas).getXY();
c = Y.Node.one(this.squareCanvas);
offXY = c.getXY();
scrollX = c.get('docScrollX');
scrollY = c.get('docScrollY');
// get position within the square
x = ev.clientX - offXY[0];
y = ev.clientY - offXY[1];
x = ev.clientX + scrollX - offXY[0];
y = ev.clientY + scrollY - offXY[1];
width = this.get('squareWidth');
height = this.get('squareHeight');

Expand All @@ -592,9 +600,11 @@ Y.extend(ColorPicker, Y.Widget, {
}
if (this.trackBar) {
offXY = this.trackBarCanvas.getXY();
scrollX = this.trackBarCanvas.get('docScrollX');
scrollY = this.trackBarCanvas.get('docScrollY');
// get position within the square
x = -this.barPaddingX + ev.clientX - offXY[0];
y = -this.barPaddingY + ev.clientY - offXY[1];
x = -this.barPaddingX + ev.clientX + scrollX - offXY[0];
y = -this.barPaddingY + ev.clientY + scrollY - offXY[1];
width = this.get('barWidth');
height = this.get('barHeight');

Expand All @@ -611,16 +621,21 @@ Y.extend(ColorPicker, Y.Widget, {
// mousedown inside square, start tracking position
this.trackSquare = true;
var offXY = ev.target.getXY(),
scrollX = ev.target.get('docScrollX'),
scrollY = ev.target.get('docScrollY'),
// get position within the square
x = ev.clientX - offXY[0],
y = ev.clientY - offXY[1];
x = ev.clientX + scrollX - offXY[0],
y = ev.clientY + scrollY - offXY[1];

this.squareX = x;
this.squareY = y;
this.startUpdating();
ev.halt();
},
updateColor: function () {
if (!this.get('showHSLBars')) {
return;
}
var barWidth = this.get('barWidth'),
barHeight = this.get('barHeight'),
cacheBars = this.get('cacheBars'),
Expand Down Expand Up @@ -757,11 +772,13 @@ Y.extend(ColorPicker, Y.Widget, {
}
}
this.renderSquare();
this.updateColor();
this.updateValues();
this.drawThumb(this.hCanvas, 'h', {h: this.color.h, s: 1.0, l: 0.5}, barWidth, barHeight, 1.0, false);
this.drawThumb(this.sCanvas, 's', {h: this.color.h, s: 1.0, l: this.color.l}, barWidth, barHeight, 1.0, true);
this.drawThumb(this.lCanvas, 'l', {h: this.color.h, s: this.color.s, l: 0.5}, barWidth, barHeight, 1.0, true);
if (this.get('showHSLBars')) {
this.updateColor();
this.drawThumb(this.hCanvas, 'h', {h: this.color.h, s: 1.0, l: 0.5}, barWidth, barHeight, 1.0, false);
this.drawThumb(this.sCanvas, 's', {h: this.color.h, s: 1.0, l: this.color.l}, barWidth, barHeight, 1.0, true);
this.drawThumb(this.lCanvas, 'l', {h: this.color.h, s: this.color.s, l: 0.5}, barWidth, barHeight, 1.0, true);
}
},
renderSquare: function () {
var width = this.get('squareWidth'), height = this.get('squareHeight'),
Expand Down Expand Up @@ -864,9 +881,11 @@ Y.extend(ColorPicker, Y.Widget, {
},
bindUI: function () {
Y.on('mousedown', this.onSquareMouseDown, this.squareCanvas, this);
Y.on('mousedown', this.onBarMouseDown, this.hCanvas, this, {component: 'h'});
Y.on('mousedown', this.onBarMouseDown, this.sCanvas, this, {component: 's'});
Y.on('mousedown', this.onBarMouseDown, this.lCanvas, this, {component: 'l'});
if (this.get('showHSLBars')) {
Y.on('mousedown', this.onBarMouseDown, this.hCanvas, this, {component: 'h'});
Y.on('mousedown', this.onBarMouseDown, this.sCanvas, this, {component: 's'});
Y.on('mousedown', this.onBarMouseDown, this.lCanvas, this, {component: 'l'});
}
Y.delegate('keyup', this.onInputKeyUp, this.contentBox, '.' + ColorPicker.CLASSNAME_VALUE, this);
Y.delegate('blur', this.onInputBlur, this.contentBox, '.' + ColorPicker.CLASSNAME_VALUE, this);
Y.delegate('keydown', this.onInputKeyDown, this.contentBox, '.' + ColorPicker.CLASSNAME_VALUE, this);
Expand Down Expand Up @@ -976,4 +995,4 @@ Y.extend(ColorPalette, Y.Widget, {
Y.ColorPalette = ColorPalette;


}, 'gallery-2011.09.14-20-40' ,{requires:['node', 'event', 'widget', 'classnamemanager']});
}, 'gallery-2011.09.28-20-06' ,{requires:['node', 'event', 'widget', 'classnamemanager']});
26 changes: 17 additions & 9 deletions build/gallery-form/gallery-form-debug.js
Expand Up @@ -249,17 +249,18 @@ Y.Form = Y.Base.create('form', Y.Widget, [Y.WidgetParent], {
formMethod = this.get('method'),
submitViaIO = this.get('submitViaIO'),
io = this.get("io"),
ioConfig = this.get('ioConfig') || {},
transaction,
cfg;

if (submitViaIO === true) {
cfg = {
cfg = Y.merge({
method: formMethod,
form: {
id: this.get('contentBox'),
upload: (this.get('encodingType') === Y.Form.MULTIPART_ENCODED)
}
};
}, ioConfig);

transaction = io(formAction, cfg);
this._ioIds[transaction.id] = transaction;
Expand Down Expand Up @@ -482,6 +483,9 @@ Y.Form = Y.Base.create('form', Y.Widget, [Y.WidgetParent], {
*/
io: {
value: Y.io
},

ioConfig : {
}

},
Expand Down Expand Up @@ -1380,6 +1384,11 @@ Y.CheckboxField = Y.Base.create('checkbox-field', Y.FormField, [Y.WidgetChild],
Y.CheckboxField.superclass.initializer.apply(this, arguments);
},

renderUI : function () {
this._renderFieldNode();
this._renderLabelNode();
},

syncUI : function () {
Y.CheckboxField.superclass.syncUI.apply(this, arguments);
this._syncChecked();
Expand Down Expand Up @@ -1536,10 +1545,6 @@ Y.ChoiceField = Y.Base.create('choice-field', Y.FormField, [Y.WidgetParent, Y.Wi
}
}

if (val.length === 0) {
return false;
}

return true;
},

Expand Down Expand Up @@ -1629,6 +1634,9 @@ Y.ChoiceField = Y.Base.create('choice-field', Y.FormField, [Y.WidgetParent, Y.Wi
* @description The choices to render into this field
*/
choices: {
valueFn : function () {
return [];
},
validator: function(val) {
return this._validateChoices(val);
}
Expand Down Expand Up @@ -1717,7 +1725,7 @@ Y.SelectField = Y.Base.create('select-field', Y.ChoiceField, [Y.WidgetParent, Y.
* @description Syncs the option nodes with the choices attribute
*/
_syncOptionNodes: function() {
var choices = this.get('choices'),
var choices = this.get('choices') || [],
contentBox = this.get('contentBox'),
options = contentBox.all('option'),
useDefaultOption = this.get('useDefaultOption'),
Expand Down Expand Up @@ -1748,7 +1756,7 @@ Y.SelectField = Y.Base.create('select-field', Y.ChoiceField, [Y.WidgetParent, Y.
},
this);

if (!currentVal && !useDefaultOption) {
if (!currentVal && !useDefaultOption && choices[0]) {
this.set('value', choices[0].value);
}
},
Expand Down Expand Up @@ -1958,4 +1966,4 @@ Y.ResetButton = Y.Base.create('reset-button', Y.FormField, [Y.WidgetChild], {
});


}, 'gallery-2011.09.07-20-35' ,{requires:['node', 'widget-base', 'widget-htmlparser', 'io-form', 'widget-parent', 'widget-child', 'base-build', 'substitute', 'io-upload-iframe']});
}, 'gallery-2011.09.28-20-06' ,{requires:['node', 'widget-base', 'widget-htmlparser', 'io-form', 'widget-parent', 'widget-child', 'base-build', 'substitute', 'io-upload-iframe']});

0 comments on commit 27ba9a5

Please sign in to comment.