Permalink
Browse files

Gallery Build Tag: gallery-2011.06.22-20-13

  • Loading branch information...
1 parent c188e70 commit 1223ea9a80afdf5627a8954a015b681e029ab994 YUI Builder committed Jun 22, 2011
@@ -1,49 +1,60 @@
YUI.add('gallery-dimensions', function(Y) {
+"use strict";
+
+/**********************************************************************
+ * <p>Functions for measuring the size of a node.</p>
+ *
+ * @module node
+ * @submodule gallery-dimensions
+ * @class Node
+ */
+
var em_div = null,
the_horiz_styles =
[
- 'margin-left',
- 'border-left-width',
- 'padding-left',
- 'padding-right',
- 'border-right-width',
- 'margin-right'
+ 'marginLeft',
+ 'borderLeftWidth',
+ 'paddingLeft',
+ 'paddingRight',
+ 'borderRightWidth',
+ 'marginRight'
],
the_vert_styles =
[
- 'margin-top',
- 'border-top-width',
- 'padding-top',
- 'padding-bottom',
- 'border-bottom-width',
- 'margin-bottom'
+ 'marginTop',
+ 'borderTopWidth',
+ 'paddingTop',
+ 'paddingBottom',
+ 'borderBottomWidth',
+ 'marginBottom'
];
/**********************************************************************
* <p>Returns the size of one em in pixels.</p>
*
* @method emToPx
+ * @static
*/
-Y.emToPx = function(
+Y.Node.emToPx = function(
/* float */ em_count)
{
if (!em_div)
{
- em_div = document.createElement('div');
+ em_div = Y.config.doc.createElement('div');
em_div.style.position = 'absolute';
em_div.style.top = '-10000px';
em_div.style.left = '-10000px';
em_div.style.visibility = 'hidden';
em_div.style.width = '10em';
em_div.style.height = '10em';
- document.body.appendChild(em_div);
+ Y.config.doc.body.appendChild(em_div);
}
return em_count * (em_div.offsetWidth / 10.0);
-}
+};
/**********************************************************************
* <p>Computes the size of everything surrounding the element's content.</p>
@@ -62,7 +73,7 @@ Y.Node.prototype.horizMarginBorderPadding = function()
this);
return w;
-}
+};
/**********************************************************************
* <p>Computes the size of everything surrounding the element's content.</p>
@@ -81,7 +92,7 @@ Y.Node.prototype.vertMarginBorderPadding = function()
this);
return h;
-}
+};
/**********************************************************************
* <p>Returns the size of the style in pixels.</p>
@@ -92,7 +103,7 @@ Y.Node.prototype.vertMarginBorderPadding = function()
Y.Node.prototype.parseDimensionStyle = function(
/* string */ style)
{
- var s = this.getStyle(style);
+ var s = this.getComputedStyle(style);
if (!s || !/^[0-9]/.test(s)) // ignore values like "medium"
{
return 0;
@@ -101,11 +112,11 @@ Y.Node.prototype.parseDimensionStyle = function(
var v = parseFloat(s, 10);
if (/em$/.test(s))
{
- v *= Y.emToPx(1);
+ v *= Y.Node.emToPx(1);
}
return Math.round(v);
-}
+};
-}, 'gallery-2009.12.08-22' ,{requires:['node-style']});
+}, 'gallery-2011.06.22-20-13' ,{requires:['node-style']});

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,49 +1,60 @@
YUI.add('gallery-dimensions', function(Y) {
+"use strict";
+
+/**********************************************************************
+ * <p>Functions for measuring the size of a node.</p>
+ *
+ * @module node
+ * @submodule gallery-dimensions
+ * @class Node
+ */
+
var em_div = null,
the_horiz_styles =
[
- 'margin-left',
- 'border-left-width',
- 'padding-left',
- 'padding-right',
- 'border-right-width',
- 'margin-right'
+ 'marginLeft',
+ 'borderLeftWidth',
+ 'paddingLeft',
+ 'paddingRight',
+ 'borderRightWidth',
+ 'marginRight'
],
the_vert_styles =
[
- 'margin-top',
- 'border-top-width',
- 'padding-top',
- 'padding-bottom',
- 'border-bottom-width',
- 'margin-bottom'
+ 'marginTop',
+ 'borderTopWidth',
+ 'paddingTop',
+ 'paddingBottom',
+ 'borderBottomWidth',
+ 'marginBottom'
];
/**********************************************************************
* <p>Returns the size of one em in pixels.</p>
*
* @method emToPx
+ * @static
*/
-Y.emToPx = function(
+Y.Node.emToPx = function(
/* float */ em_count)
{
if (!em_div)
{
- em_div = document.createElement('div');
+ em_div = Y.config.doc.createElement('div');
em_div.style.position = 'absolute';
em_div.style.top = '-10000px';
em_div.style.left = '-10000px';
em_div.style.visibility = 'hidden';
em_div.style.width = '10em';
em_div.style.height = '10em';
- document.body.appendChild(em_div);
+ Y.config.doc.body.appendChild(em_div);
}
return em_count * (em_div.offsetWidth / 10.0);
-}
+};
/**********************************************************************
* <p>Computes the size of everything surrounding the element's content.</p>
@@ -62,7 +73,7 @@ Y.Node.prototype.horizMarginBorderPadding = function()
this);
return w;
-}
+};
/**********************************************************************
* <p>Computes the size of everything surrounding the element's content.</p>
@@ -81,7 +92,7 @@ Y.Node.prototype.vertMarginBorderPadding = function()
this);
return h;
-}
+};
/**********************************************************************
* <p>Returns the size of the style in pixels.</p>
@@ -92,7 +103,7 @@ Y.Node.prototype.vertMarginBorderPadding = function()
Y.Node.prototype.parseDimensionStyle = function(
/* string */ style)
{
- var s = this.getStyle(style);
+ var s = this.getComputedStyle(style);
if (!s || !/^[0-9]/.test(s)) // ignore values like "medium"
{
return 0;
@@ -101,11 +112,11 @@ Y.Node.prototype.parseDimensionStyle = function(
var v = parseFloat(s, 10);
if (/em$/.test(s))
{
- v *= Y.emToPx(1);
+ v *= Y.Node.emToPx(1);
}
return Math.round(v);
-}
+};
-}, 'gallery-2009.12.08-22' ,{requires:['node-style']});
+}, 'gallery-2011.06.22-20-13' ,{requires:['node-style']});
@@ -11,33 +11,21 @@ YUI.add('gallery-event-konami', function(Y) {
* @class YUI~event-konami
*/
-/**
- * Provides a subscribable event named &quot;konami&quot;.
- *
- * @event konami
- * @param type {String} 'konami'
- * @param fn {Function} the callback function
- * @param id {String|Node|etc} the element to bind (typically document)
- * @param o {Object} optional context object
- * @param args 0..n additional arguments that should be provided
- * to the listener.
- * @return {Event.Handle} the detach handle
- */
-Y.Event.define('konami', {
+var config = {
_keys: [ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65 ],
- _attach: function (node, sub, notifier, filter) {
+ on: function (node, sub, notifier, filter) {
var method = (filter) ? 'delegate' : 'on',
progressKey = '-yui3-konami-progress(' + Y.guid() + ')',
keys = this._keys;
- sub['_' + method + 'Handle'] = node[method]("keydown", function (e) {
+ sub.handle = node[method]("keydown", function (e) {
var progress = this.getData(progressKey) || 0;
if (e.keyCode === keys[progress]) {
if (++progress === 10) {
this.clearData(progressKey);
- notifier.fire();
+ notifier.fire(e);
node.detach('konami');
}
} else {
@@ -49,23 +37,26 @@ Y.Event.define('konami', {
}, (filter || node));
},
- on: function () {
- this._attach.apply(this, arguments);
- },
- delegate: function () {
- this._attach.apply(this, arguments);
- },
detach: function (node, sub) {
- if (sub._onHandle) {
- sub._onHandle.detach();
- }
- },
- detachDelegate: function (node, sub) {
- if (sub._delegateHandle) {
- sub._delegateHandle.detach();
- }
+ sub.handle.detach();
}
-});
+};
+config.delegate = config.on;
+config.detachDelegate = config.detach;
+
+/**
+ * Provides a subscribable event named &quot;konami&quot;.
+ *
+ * @event konami
+ * @param type {String} 'konami'
+ * @param fn {Function} the callback function
+ * @param id {String|Node|etc} the element to bind (typically document)
+ * @param o {Object} optional context object
+ * @param args 0..n additional arguments that should be provided
+ * to the listener.
+ * @return {Event.Handle} the detach handle
+ */
+Y.Event.define('konami', config);
-}, 'gallery-2011.01.18-21-05' ,{requires:['event-synthetic']});
+}, 'gallery-2011.06.22-20-13' ,{requires:['event-synthetic']});

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 1223ea9

Please sign in to comment.