Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/yui/yui3

  • Loading branch information...
commit 07c953d8c08d838de30ef98528a504f90d175364 2 parents 8ad4fc3 + 17cdba6
@ericf ericf authored
Showing with 3,735 additions and 3,785 deletions.
  1. +32 −31 build/createlink-base/createlink-base-coverage.js
  2. +3 −2 build/createlink-base/createlink-base-debug.js
  3. +3 −2 build/createlink-base/createlink-base.js
  4. +178 −171 build/dd-constrain/dd-constrain-coverage.js
  5. +17 −10 build/dd-constrain/dd-constrain-debug.js
  6. +1 −1  build/dd-constrain/dd-constrain-min.js
  7. +17 −10 build/dd-constrain/dd-constrain.js
  8. +66 −65 build/dd-ddm-base/dd-ddm-base-coverage.js
  9. +19 −18 build/dd-ddm-base/dd-ddm-base-debug.js
  10. +1 −1  build/dd-ddm-base/dd-ddm-base-min.js
  11. +19 −18 build/dd-ddm-base/dd-ddm-base.js
  12. +175 −174 build/dd-ddm-drop/dd-ddm-drop-coverage.js
  13. +31 −30 build/dd-ddm-drop/dd-ddm-drop-debug.js
  14. +1 −1  build/dd-ddm-drop/dd-ddm-drop-min.js
  15. +31 −30 build/dd-ddm-drop/dd-ddm-drop.js
  16. +46 −45 build/dd-ddm/dd-ddm-coverage.js
  17. +6 −5 build/dd-ddm/dd-ddm-debug.js
  18. +1 −1  build/dd-ddm/dd-ddm-min.js
  19. +6 −5 build/dd-ddm/dd-ddm.js
  20. +24 −24 build/dd-delegate/dd-delegate-coverage.js
  21. +23 −23 build/dd-delegate/dd-delegate-debug.js
  22. +1 −1  build/dd-delegate/dd-delegate-min.js
  23. +23 −23 build/dd-delegate/dd-delegate.js
  24. +352 −348 build/dd-drag/dd-drag-coverage.js
  25. +55 −51 build/dd-drag/dd-drag-debug.js
  26. +1 −1  build/dd-drag/dd-drag-min.js
  27. +55 −51 build/dd-drag/dd-drag.js
  28. +2 −2 build/dd-drop-plugin/dd-drop-plugin-coverage.js
  29. +1 −1  build/dd-drop-plugin/dd-drop-plugin-debug.js
  30. +1 −1  build/dd-drop-plugin/dd-drop-plugin.js
  31. +172 −170 build/dd-drop/dd-drop-coverage.js
  32. +25 −23 build/dd-drop/dd-drop-debug.js
  33. +1 −1  build/dd-drop/dd-drop-min.js
  34. +25 −23 build/dd-drop/dd-drop.js
  35. +2 −2 build/dd-gestures/dd-gestures-coverage.js
  36. +1 −1  build/dd-gestures/dd-gestures-debug.js
  37. +1 −1  build/dd-gestures/dd-gestures.js
  38. +10 −10 build/dd-plugin/dd-plugin-coverage.js
  39. +9 −9 build/dd-plugin/dd-plugin-debug.js
  40. +9 −9 build/dd-plugin/dd-plugin.js
  41. +7 −7 build/dd-proxy/dd-proxy-coverage.js
  42. +6 −6 build/dd-proxy/dd-proxy-debug.js
  43. +1 −1  build/dd-proxy/dd-proxy-min.js
  44. +6 −6 build/dd-proxy/dd-proxy.js
  45. +12 −12 build/dd-scroll/dd-scroll-coverage.js
  46. +11 −11 build/dd-scroll/dd-scroll-debug.js
  47. +1 −1  build/dd-scroll/dd-scroll-min.js
  48. +11 −11 build/dd-scroll/dd-scroll.js
  49. +349 −344 build/editor-base/editor-base-coverage.js
  50. +83 −73 build/editor-base/editor-base-debug.js
  51. +1 −1  build/editor-base/editor-base-min.js
  52. +83 −72 build/editor-base/editor-base.js
  53. +95 −93 build/editor-bidi/editor-bidi-coverage.js
  54. +24 −23 build/editor-bidi/editor-bidi-debug.js
  55. +1 −1  build/editor-bidi/editor-bidi-min.js
  56. +24 −23 build/editor-bidi/editor-bidi.js
  57. +41 −46 build/editor-br/editor-br-coverage.js
  58. +7 −9 build/editor-br/editor-br-debug.js
  59. +1 −1  build/editor-br/editor-br-min.js
  60. +7 −9 build/editor-br/editor-br.js
  61. +49 −47 build/editor-lists/editor-lists-coverage.js
  62. +7 −5 build/editor-lists/editor-lists-debug.js
  63. +1 −1  build/editor-lists/editor-lists-min.js
  64. +7 −5 build/editor-lists/editor-lists.js
  65. +23 −24 build/editor-para-base/editor-para-base-coverage.js
  66. +6 −7 build/editor-para-base/editor-para-base-debug.js
  67. +1 −1  build/editor-para-base/editor-para-base-min.js
  68. +6 −7 build/editor-para-base/editor-para-base.js
  69. +16 −15 build/editor-para-ie/editor-para-ie-coverage.js
  70. +12 −12 build/editor-para-ie/editor-para-ie-debug.js
  71. +1 −1  build/editor-para-ie/editor-para-ie-min.js
  72. +12 −12 build/editor-para-ie/editor-para-ie.js
  73. +170 −167 build/editor-para/editor-para-coverage.js
  74. +15 −13 build/editor-para/editor-para-debug.js
  75. +1 −1  build/editor-para/editor-para-min.js
  76. +15 −13 build/editor-para/editor-para.js
  77. +443 −489 build/editor-selection/editor-selection-coverage.js
  78. +77 −123 build/editor-selection/editor-selection-debug.js
  79. +1 −1  build/editor-selection/editor-selection-min.js
  80. +77 −118 build/editor-selection/editor-selection.js
  81. +2 −2 build/editor-tab/editor-tab-coverage.js
  82. +1 −1  build/editor-tab/editor-tab-debug.js
  83. +1 −1  build/editor-tab/editor-tab.js
  84. +399 −401 build/exec-command/exec-command-coverage.js
  85. +87 −86 build/exec-command/exec-command-debug.js
  86. +1 −1  build/exec-command/exec-command-min.js
  87. +87 −86 build/exec-command/exec-command.js
Sorry, we could not display the entire diff because it was too big.
View
63 build/createlink-base/createlink-base-coverage.js
@@ -26,9 +26,9 @@ _yuitest_coverage["build/createlink-base/createlink-base.js"] = {
path: "build/createlink-base/createlink-base.js",
code: []
};
-_yuitest_coverage["build/createlink-base/createlink-base.js"].code=["YUI.add('createlink-base', function (Y, NAME) {","",""," /**"," * Adds prompt style link creation. Adds an override for the <a href=\"Plugin.ExecCommand.html#method_COMMANDS.createlink\">createlink execCommand</a>."," * @class Plugin.CreateLinkBase"," * @static"," * @submodule createlink-base"," * @module editor"," */"," "," var CreateLinkBase = {};"," /**"," * Strings used by the plugin"," * @property STRINGS"," * @static"," */"," CreateLinkBase.STRINGS = {"," /**"," * String used for the Prompt"," * @property PROMPT"," * @static"," */"," PROMPT: 'Please enter the URL for the link to point to:',"," /**"," * String used as the default value of the Prompt"," * @property DEFAULT"," * @static"," */"," DEFAULT: 'http://'"," };",""," Y.namespace('Plugin');"," Y.Plugin.CreateLinkBase = CreateLinkBase;",""," Y.mix(Y.Plugin.ExecCommand.COMMANDS, {"," /**"," * Override for the createlink method from the <a href=\"Plugin.CreateLinkBase.html\">CreateLinkBase</a> plugin."," * @for ExecCommand"," * @method COMMANDS.createlink"," * @static"," * @param {String} cmd The command executed: createlink"," * @return {Node} Node instance of the item touched by this command."," */"," createlink: function(cmd) {"," var inst = this.get('host').getInstance(), out, a, sel, holder,"," url = prompt(CreateLinkBase.STRINGS.PROMPT, CreateLinkBase.STRINGS.DEFAULT);",""," if (url) {"," holder = inst.config.doc.createElement('div');"," url = url.replace(/\"/g, '').replace(/'/g, ''); //Remove single & double quotes"," url = inst.config.doc.createTextNode(url);"," holder.appendChild(url);"," url = holder.innerHTML;","",""," this.get('host')._execCommand(cmd, url);"," sel = new inst.EditorSelection();"," out = sel.getSelected();"," if (!sel.isCollapsed && out.size()) {"," //We have a selection"," a = out.item(0).one('a');"," if (a) {"," out.item(0).replace(a);"," }"," if (Y.UA.gecko) {"," if (a.get('parentNode').test('span')) {"," if (a.get('parentNode').one('br.yui-cursor')) {"," a.get('parentNode').insert(a, 'before');"," }"," }"," }"," } else {"," //No selection, insert a new node.."," this.get('host').execCommand('inserthtml', '<a href=\"' + url + '\">' + url + '</a>');"," }"," }"," return a;"," }"," });","","","","}, '@VERSION@', {\"requires\": [\"editor-base\"]});"];
-_yuitest_coverage["build/createlink-base/createlink-base.js"].lines = {"1":0,"12":0,"18":0,"33":0,"34":0,"36":0,"46":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"57":0,"58":0,"59":0,"60":0,"62":0,"63":0,"64":0,"66":0,"67":0,"68":0,"69":0,"75":0,"78":0};
-_yuitest_coverage["build/createlink-base/createlink-base.js"].functions = {"createlink:45":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/createlink-base/createlink-base.js"].code=["YUI.add('createlink-base', function (Y, NAME) {","",""," /**"," * Adds prompt style link creation. Adds an override for the"," * <a href=\"Plugin.ExecCommand.html#method_COMMANDS.createlink\">createlink execCommand</a>."," * @class Plugin.CreateLinkBase"," * @static"," * @submodule createlink-base"," * @module editor"," */",""," var CreateLinkBase = {};"," /**"," * Strings used by the plugin"," * @property STRINGS"," * @static"," */"," CreateLinkBase.STRINGS = {"," /**"," * String used for the Prompt"," * @property PROMPT"," * @static"," */"," PROMPT: 'Please enter the URL for the link to point to:',"," /**"," * String used as the default value of the Prompt"," * @property DEFAULT"," * @static"," */"," DEFAULT: 'http://'"," };",""," Y.namespace('Plugin');"," Y.Plugin.CreateLinkBase = CreateLinkBase;",""," Y.mix(Y.Plugin.ExecCommand.COMMANDS, {"," /**"," * Override for the createlink method from the <a href=\"Plugin.CreateLinkBase.html\">CreateLinkBase</a> plugin."," * @for ExecCommand"," * @method COMMANDS.createlink"," * @static"," * @param {String} cmd The command executed: createlink"," * @return {Node} Node instance of the item touched by this command."," */"," createlink: function(cmd) {"," var inst = this.get('host').getInstance(), out, a, sel, holder,"," url = prompt(CreateLinkBase.STRINGS.PROMPT, CreateLinkBase.STRINGS.DEFAULT);",""," if (url) {"," holder = inst.config.doc.createElement('div');"," url = url.replace(/\"/g, '').replace(/'/g, ''); //Remove single & double quotes"," url = inst.config.doc.createTextNode(url);"," holder.appendChild(url);"," url = holder.innerHTML;","",""," this.get('host')._execCommand(cmd, url);"," sel = new inst.EditorSelection();"," out = sel.getSelected();"," if (!sel.isCollapsed && out.size()) {"," //We have a selection"," a = out.item(0).one('a');"," if (a) {"," out.item(0).replace(a);"," }"," if (Y.UA.gecko) {"," if (a.get('parentNode').test('span')) {"," if (a.get('parentNode').one('br.yui-cursor')) {"," a.get('parentNode').insert(a, 'before');"," }"," }"," }"," } else {"," //No selection, insert a new node.."," this.get('host').execCommand('inserthtml', '<a href=\"' + url + '\">' + url + '</a>');"," }"," }"," return a;"," }"," });","","","","}, '@VERSION@', {\"requires\": [\"editor-base\"]});"];
+_yuitest_coverage["build/createlink-base/createlink-base.js"].lines = {"1":0,"13":0,"19":0,"34":0,"35":0,"37":0,"47":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"58":0,"59":0,"60":0,"61":0,"63":0,"64":0,"65":0,"67":0,"68":0,"69":0,"70":0,"76":0,"79":0};
+_yuitest_coverage["build/createlink-base/createlink-base.js"].functions = {"createlink:46":0,"(anonymous 1):1":0};
_yuitest_coverage["build/createlink-base/createlink-base.js"].coveredLines = 26;
_yuitest_coverage["build/createlink-base/createlink-base.js"].coveredFunctions = 2;
_yuitest_coverline("build/createlink-base/createlink-base.js", 1);
@@ -36,22 +36,23 @@ YUI.add('createlink-base', function (Y, NAME) {
/**
- * Adds prompt style link creation. Adds an override for the <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.
+ * Adds prompt style link creation. Adds an override for the
+ * <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.
* @class Plugin.CreateLinkBase
* @static
* @submodule createlink-base
* @module editor
*/
-
+
_yuitest_coverfunc("build/createlink-base/createlink-base.js", "(anonymous 1)", 1);
-_yuitest_coverline("build/createlink-base/createlink-base.js", 12);
+_yuitest_coverline("build/createlink-base/createlink-base.js", 13);
var CreateLinkBase = {};
/**
* Strings used by the plugin
* @property STRINGS
* @static
*/
- _yuitest_coverline("build/createlink-base/createlink-base.js", 18);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 19);
CreateLinkBase.STRINGS = {
/**
* String used for the Prompt
@@ -67,12 +68,12 @@ CreateLinkBase.STRINGS = {
DEFAULT: 'http://'
};
- _yuitest_coverline("build/createlink-base/createlink-base.js", 33);
-Y.namespace('Plugin');
_yuitest_coverline("build/createlink-base/createlink-base.js", 34);
+Y.namespace('Plugin');
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 35);
Y.Plugin.CreateLinkBase = CreateLinkBase;
- _yuitest_coverline("build/createlink-base/createlink-base.js", 36);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 37);
Y.mix(Y.Plugin.ExecCommand.COMMANDS, {
/**
* Override for the createlink method from the <a href="Plugin.CreateLinkBase.html">CreateLinkBase</a> plugin.
@@ -83,59 +84,59 @@ Y.mix(Y.Plugin.ExecCommand.COMMANDS, {
* @return {Node} Node instance of the item touched by this command.
*/
createlink: function(cmd) {
- _yuitest_coverfunc("build/createlink-base/createlink-base.js", "createlink", 45);
-_yuitest_coverline("build/createlink-base/createlink-base.js", 46);
+ _yuitest_coverfunc("build/createlink-base/createlink-base.js", "createlink", 46);
+_yuitest_coverline("build/createlink-base/createlink-base.js", 47);
var inst = this.get('host').getInstance(), out, a, sel, holder,
url = prompt(CreateLinkBase.STRINGS.PROMPT, CreateLinkBase.STRINGS.DEFAULT);
- _yuitest_coverline("build/createlink-base/createlink-base.js", 49);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 50);
if (url) {
- _yuitest_coverline("build/createlink-base/createlink-base.js", 50);
-holder = inst.config.doc.createElement('div');
_yuitest_coverline("build/createlink-base/createlink-base.js", 51);
-url = url.replace(/"/g, '').replace(/'/g, ''); //Remove single & double quotes
+holder = inst.config.doc.createElement('div');
_yuitest_coverline("build/createlink-base/createlink-base.js", 52);
-url = inst.config.doc.createTextNode(url);
+url = url.replace(/"/g, '').replace(/'/g, ''); //Remove single & double quotes
_yuitest_coverline("build/createlink-base/createlink-base.js", 53);
-holder.appendChild(url);
+url = inst.config.doc.createTextNode(url);
_yuitest_coverline("build/createlink-base/createlink-base.js", 54);
+holder.appendChild(url);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 55);
url = holder.innerHTML;
- _yuitest_coverline("build/createlink-base/createlink-base.js", 57);
-this.get('host')._execCommand(cmd, url);
_yuitest_coverline("build/createlink-base/createlink-base.js", 58);
-sel = new inst.EditorSelection();
+this.get('host')._execCommand(cmd, url);
_yuitest_coverline("build/createlink-base/createlink-base.js", 59);
-out = sel.getSelected();
+sel = new inst.EditorSelection();
_yuitest_coverline("build/createlink-base/createlink-base.js", 60);
+out = sel.getSelected();
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 61);
if (!sel.isCollapsed && out.size()) {
//We have a selection
- _yuitest_coverline("build/createlink-base/createlink-base.js", 62);
-a = out.item(0).one('a');
_yuitest_coverline("build/createlink-base/createlink-base.js", 63);
+a = out.item(0).one('a');
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 64);
if (a) {
- _yuitest_coverline("build/createlink-base/createlink-base.js", 64);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 65);
out.item(0).replace(a);
}
- _yuitest_coverline("build/createlink-base/createlink-base.js", 66);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 67);
if (Y.UA.gecko) {
- _yuitest_coverline("build/createlink-base/createlink-base.js", 67);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 68);
if (a.get('parentNode').test('span')) {
- _yuitest_coverline("build/createlink-base/createlink-base.js", 68);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 69);
if (a.get('parentNode').one('br.yui-cursor')) {
- _yuitest_coverline("build/createlink-base/createlink-base.js", 69);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 70);
a.get('parentNode').insert(a, 'before');
}
}
}
} else {
//No selection, insert a new node..
- _yuitest_coverline("build/createlink-base/createlink-base.js", 75);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 76);
this.get('host').execCommand('inserthtml', '<a href="' + url + '">' + url + '</a>');
}
}
- _yuitest_coverline("build/createlink-base/createlink-base.js", 78);
+ _yuitest_coverline("build/createlink-base/createlink-base.js", 79);
return a;
}
});
View
5 build/createlink-base/createlink-base-debug.js
@@ -2,13 +2,14 @@ YUI.add('createlink-base', function (Y, NAME) {
/**
- * Adds prompt style link creation. Adds an override for the <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.
+ * Adds prompt style link creation. Adds an override for the
+ * <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.
* @class Plugin.CreateLinkBase
* @static
* @submodule createlink-base
* @module editor
*/
-
+
var CreateLinkBase = {};
/**
* Strings used by the plugin
View
5 build/createlink-base/createlink-base.js
@@ -2,13 +2,14 @@ YUI.add('createlink-base', function (Y, NAME) {
/**
- * Adds prompt style link creation. Adds an override for the <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.
+ * Adds prompt style link creation. Adds an override for the
+ * <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.
* @class Plugin.CreateLinkBase
* @static
* @submodule createlink-base
* @module editor
*/
-
+
var CreateLinkBase = {};
/**
* Strings used by the plugin
View
349 build/dd-constrain/dd-constrain-coverage.js
@@ -26,9 +26,9 @@ _yuitest_coverage["build/dd-constrain/dd-constrain.js"] = {
path: "build/dd-constrain/dd-constrain.js",
code: []
};
-_yuitest_coverage["build/dd-constrain/dd-constrain.js"].code=["YUI.add('dd-constrain', function (Y, NAME) {","",""," /**"," * The Drag & Drop Utility allows you to create a draggable interface efficiently, buffering you from browser-level abnormalities and enabling you to focus on the interesting logic surrounding your particular implementation. This component enables you to create a variety of standard draggable objects with just a few lines of code and then, using its extensive API, add your own specific implementation logic."," * @module dd"," * @main dd"," * @submodule dd-constrain"," */"," /**"," * Plugin for the dd-drag module to add the constraining methods to it. It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints."," * @class DDConstrained"," * @extends Base"," * @constructor"," * @namespace Plugin"," */",""," var DRAG_NODE = 'dragNode',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," HOST = 'host',"," TICK_X_ARRAY = 'tickXArray',"," TICK_Y_ARRAY = 'tickYArray',"," DDM = Y.DD.DDM,"," TOP = 'top',"," RIGHT = 'right',"," BOTTOM = 'bottom',"," LEFT = 'left',"," VIEW = 'view',"," proto = null,",""," /**"," * @event drag:tickAlignX"," * @description Fires when this node is aligned with the tickX value."," * @param {EventFacade} event An Event Facade object"," * @type {CustomEvent}"," */"," EV_TICK_ALIGN_X = 'drag:tickAlignX',",""," /**"," * @event drag:tickAlignY"," * @description Fires when this node is aligned with the tickY value."," * @param {EventFacade} event An Event Facade object"," * @type {CustomEvent}"," */"," EV_TICK_ALIGN_Y = 'drag:tickAlignY',",""," C = function(config) {"," this._lazyAddAttrs = false;"," C.superclass.constructor.apply(this, arguments);"," };",""," C.NAME = 'ddConstrained';"," /**"," * @property NS"," * @default con"," * @readonly"," * @protected"," * @static"," * @description The Constrained instance will be placed on the Drag instance under the con namespace."," * @type {String}","*/"," C.NS = 'con';",""," C.ATTRS = {"," host: {"," },"," /**"," * @attribute stickX"," * @description Stick the drag movement to the X-Axis. Default: false"," * @type Boolean"," */"," stickX: {"," value: false"," },"," /**"," * @attribute stickY"," * @description Stick the drag movement to the Y-Axis"," * @type Boolean"," */"," stickY: {"," value: false"," },"," /**"," * @attribute tickX"," * @description The X tick offset the drag node should snap to on each drag move. False for no ticks. Default: false"," * @type Number/false"," */"," tickX: {"," value: false"," },"," /**"," * @attribute tickY"," * @description The Y tick offset the drag node should snap to on each drag move. False for no ticks. Default: false"," * @type Number/false"," */"," tickY: {"," value: false"," },"," /**"," * @attribute tickXArray"," * @description An array of page coordinates to use as X ticks for drag movement."," * @type Array"," */"," tickXArray: {"," value: false"," },"," /**"," * @attribute tickYArray"," * @description An array of page coordinates to use as Y ticks for drag movement."," * @type Array"," */"," tickYArray: {"," value: false"," },"," /**"," * @attribute gutter"," * @description CSS style string for the gutter of a region (supports negative values): '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)"," * @type String"," */"," gutter: {"," value: '0',"," setter: function(gutter) {"," return Y.DD.DDM.cssSizestoObject(gutter);"," }"," },"," /**"," * @attribute constrain"," * @description Will attempt to constrain the drag node to the boundaries. Arguments:<br>"," * 'view': Contrain to Viewport<br>"," * '#selector_string': Constrain to this node<br>"," * '{Region Object}': An Object Literal containing a valid region (top, right, bottom, left) of page positions"," * @type {String/Object/Node}"," */"," constrain: {"," value: VIEW,"," setter: function(con) {"," var node = Y.one(con);"," if (node) {"," con = node;"," }"," return con;"," }"," },"," /**"," * @deprecated"," * @attribute constrain2region"," * @description An Object Literal containing a valid region (top, right, bottom, left) of page positions to constrain the drag node to."," * @type Object"," */"," constrain2region: {"," setter: function(r) {"," return this.set('constrain', r);"," }"," },"," /**"," * @deprecated"," * @attribute constrain2node"," * @description Will attempt to constrain the drag node to the boundaries of this node."," * @type Object"," */"," constrain2node: {"," setter: function(n) {"," return this.set('constrain', Y.one(n));"," }"," },"," /**"," * @deprecated"," * @attribute constrain2view"," * @description Will attempt to constrain the drag node to the boundaries of the viewport region."," * @type Object"," */"," constrain2view: {"," setter: function(n) {"," return this.set('constrain', VIEW);"," }"," },"," /**"," * @attribute cacheRegion"," * @description Should the region be cached for performace. Default: true"," * @type Boolean"," */"," cacheRegion: {"," value: true"," }"," };",""," proto = {"," _lastTickXFired: null,"," _lastTickYFired: null,",""," initializer: function() {"," this._createEvents();",""," this._eventHandles = ["," this.get(HOST).on('drag:end', Y.bind(this._handleEnd, this)),"," this.get(HOST).on('drag:start', Y.bind(this._handleStart, this)),"," this.get(HOST).after('drag:align', Y.bind(this.align, this)),"," this.get(HOST).after('drag:drag', Y.bind(this.drag, this))"," ];"," },"," destructor: function() {"," Y.each("," this._eventHandles,"," function(handle, index) {"," handle.detach();"," }"," );",""," this._eventHandles.length = 0;"," },"," /**"," * @private"," * @method _createEvents"," * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling."," */"," _createEvents: function() {"," var ev = ["," EV_TICK_ALIGN_X,"," EV_TICK_ALIGN_Y"," ];",""," Y.each(ev, function(v, k) {"," this.publish(v, {"," type: v,"," emitFacade: true,"," bubbles: true,"," queuable: false,"," prefix: 'drag'"," });"," }, this);"," },"," /**"," * @private"," * @method _handleEnd"," * @description Fires on drag:end"," */"," _handleEnd: function() {"," this._lastTickYFired = null;"," this._lastTickXFired = null;"," },"," /**"," * @private"," * @method _handleStart"," * @description Fires on drag:start and clears the _regionCache"," */"," _handleStart: function() {"," this.resetCache();"," },"," /**"," * @private"," * @property _regionCache"," * @description Store a cache of the region that we are constraining to"," * @type Object"," */"," _regionCache: null,"," /**"," * @private"," * @method _cacheRegion"," * @description Get's the region and caches it, called from window.resize and when the cache is null"," */"," _cacheRegion: function() {"," this._regionCache = this.get('constrain').get('region');"," },"," /**"," * @method resetCache"," * @description Reset the internal region cache."," */"," resetCache: function() {"," this._regionCache = null;"," },"," /**"," * @private"," * @method _getConstraint"," * @description Standardizes the 'constraint' attribute"," */"," _getConstraint: function() {"," var con = this.get('constrain'),"," g = this.get('gutter'),"," region;",""," if (con) {"," if (con instanceof Y.Node) {"," if (!this._regionCache) {"," this._eventHandles.push(Y.on('resize', Y.bind(this._cacheRegion, this), Y.config.win));"," this._cacheRegion();"," }"," region = Y.clone(this._regionCache);"," if (!this.get('cacheRegion')) {"," this.resetCache();"," }"," } else if (Y.Lang.isObject(con)) {"," region = Y.clone(con);"," }"," }"," if (!con || !region) {"," con = VIEW;"," }"," if (con === VIEW) {"," region = this.get(HOST).get(DRAG_NODE).get('viewportRegion');"," }",""," Y.each(g, function(i, n) {"," if ((n == RIGHT) || (n == BOTTOM)) {"," region[n] -= i;"," } else {"," region[n] += i;"," }"," });"," return region;"," },",""," /**"," * @method getRegion"," * @description Get the active region: viewport, node, custom region"," * @param {Boolean} inc Include the node's height and width"," * @return {Object} The active region."," */"," getRegion: function(inc) {"," var r = {}, oh = null, ow = null,"," host = this.get(HOST);",""," r = this._getConstraint();",""," if (inc) {"," oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT);"," ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);"," r[RIGHT] = r[RIGHT] - ow;"," r[BOTTOM] = r[BOTTOM] - oh;"," }"," return r;"," },"," /**"," * @private"," * @method _checkRegion"," * @description Check if xy is inside a given region, if not change to it be inside."," * @param {Array} _xy The XY to check if it's in the current region, if it isn't inside the region, it will reset the xy array to be inside the region."," * @return {Array} The new XY that is inside the region"," */"," _checkRegion: function(_xy) {"," var oxy = _xy,"," r = this.getRegion(),"," host = this.get(HOST),"," oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT),"," ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);",""," if (oxy[1] > (r[BOTTOM] - oh)) {"," _xy[1] = (r[BOTTOM] - oh);"," }"," if (r[TOP] > oxy[1]) {"," _xy[1] = r[TOP];",""," }"," if (oxy[0] > (r[RIGHT] - ow)) {"," _xy[0] = (r[RIGHT] - ow);"," }"," if (r[LEFT] > oxy[0]) {"," _xy[0] = r[LEFT];"," }",""," return _xy;"," },"," /**"," * @method inRegion"," * @description Checks if the XY passed or the dragNode is inside the active region."," * @param {Array} xy Optional XY to check, if not supplied this.get('dragNode').getXY() is used."," * @return {Boolean} True if the XY is inside the region, false otherwise."," */"," inRegion: function(xy) {"," xy = xy || this.get(HOST).get(DRAG_NODE).getXY();",""," var _xy = this._checkRegion([xy[0], xy[1]]),"," inside = false;"," if ((xy[0] === _xy[0]) && (xy[1] === _xy[1])) {"," inside = true;"," }"," return inside;"," },"," /**"," * @method align"," * @description Modifies the Drag.actXY method from the after drag:align event. This is where the constraining happens."," */"," align: function() {"," var host = this.get(HOST),"," _xy = [host.actXY[0], host.actXY[1]],"," r = this.getRegion(true);",""," if (this.get('stickX')) {"," _xy[1] = (host.startXY[1] - host.deltaXY[1]);"," }"," if (this.get('stickY')) {"," _xy[0] = (host.startXY[0] - host.deltaXY[0]);"," }",""," if (r) {"," _xy = this._checkRegion(_xy);"," }",""," _xy = this._checkTicks(_xy, r);",""," host.actXY = _xy;"," },"," /**"," * @method drag"," * @description Fires after drag:drag. Handle the tickX and tickX align events."," */"," drag: function(event) {"," var host = this.get(HOST),"," xt = this.get('tickX'),"," yt = this.get('tickY'),"," _xy = [host.actXY[0], host.actXY[1]];",""," if ((Y.Lang.isNumber(xt) || this.get(TICK_X_ARRAY)) && (this._lastTickXFired !== _xy[0])) {"," this._tickAlignX();"," this._lastTickXFired = _xy[0];"," }",""," if ((Y.Lang.isNumber(yt) || this.get(TICK_Y_ARRAY)) && (this._lastTickYFired !== _xy[1])) {"," this._tickAlignY();"," this._lastTickYFired = _xy[1];"," }"," },"," /**"," * @private"," * @method _checkTicks"," * @description This method delegates the proper helper method for tick calculations"," * @param {Array} xy The XY coords for the Drag"," * @param {Object} r The optional region that we are bound to."," * @return {Array} The calced XY coords"," */"," _checkTicks: function(xy, r) {"," var host = this.get(HOST),"," lx = (host.startXY[0] - host.deltaXY[0]),"," ly = (host.startXY[1] - host.deltaXY[1]),"," xt = this.get('tickX'),"," yt = this.get('tickY');"," if (xt && !this.get(TICK_X_ARRAY)) {"," xy[0] = DDM._calcTicks(xy[0], lx, xt, r[LEFT], r[RIGHT]);"," }"," if (yt && !this.get(TICK_Y_ARRAY)) {"," xy[1] = DDM._calcTicks(xy[1], ly, yt, r[TOP], r[BOTTOM]);"," }"," if (this.get(TICK_X_ARRAY)) {"," xy[0] = DDM._calcTickArray(xy[0], this.get(TICK_X_ARRAY), r[LEFT], r[RIGHT]);"," }"," if (this.get(TICK_Y_ARRAY)) {"," xy[1] = DDM._calcTickArray(xy[1], this.get(TICK_Y_ARRAY), r[TOP], r[BOTTOM]);"," }",""," return xy;"," },"," /**"," * @private"," * @method _tickAlignX"," * @description Fires when the actXY[0] reach a new value respecting the tickX gap."," */"," _tickAlignX: function() {"," this.fire(EV_TICK_ALIGN_X);"," },"," /**"," * @private"," * @method _tickAlignY"," * @description Fires when the actXY[1] reach a new value respecting the tickY gap."," */"," _tickAlignY: function() {"," this.fire(EV_TICK_ALIGN_Y);"," }"," };",""," Y.namespace('Plugin');"," Y.extend(C, Y.Base, proto);"," Y.Plugin.DDConstrained = C;",""," Y.mix(DDM, {"," /**"," * @for DDM"," * @namespace DD"," * @private"," * @method _calcTicks"," * @description Helper method to calculate the tick offsets for a given position"," * @param {Number} pos The current X or Y position"," * @param {Number} start The start X or Y position"," * @param {Number} tick The X or Y tick increment"," * @param {Number} off1 The min offset that we can't pass (region)"," * @param {Number} off2 The max offset that we can't pass (region)"," * @return {Number} The new position based on the tick calculation"," */"," _calcTicks: function(pos, start, tick, off1, off2) {"," var ix = ((pos - start) / tick),"," min = Math.floor(ix),"," max = Math.ceil(ix);"," if ((min !== 0) || (max !== 0)) {"," if ((ix >= min) && (ix <= max)) {"," pos = (start + (tick * min));"," if (off1 && off2) {"," if (pos < off1) {"," pos = (start + (tick * (min + 1)));"," }"," if (pos > off2) {"," pos = (start + (tick * (min - 1)));"," }"," }"," }"," }"," return pos;"," },"," /**"," * @for DDM"," * @namespace DD"," * @private"," * @method _calcTickArray"," * @description This method is used with the tickXArray and tickYArray config options"," * @param {Number} pos The current X or Y position"," * @param {Number} ticks The array containing our custom tick positions."," * @param {Number} off1 The min offset that we can't pass (region)"," * @param {Number} off2 The max offset that we can't pass (region)"," * @return The tick position"," */"," _calcTickArray: function(pos, ticks, off1, off2) {"," var i = 0, len = ticks.length, next = 0,"," diff1, diff2, ret;",""," if (!ticks || (ticks.length === 0)) {"," return pos;"," }"," if (ticks[0] >= pos) {"," return ticks[0];"," }",""," for (i = 0; i < len; i++) {"," next = (i + 1);"," if (ticks[next] && ticks[next] >= pos) {"," diff1 = pos - ticks[i];"," diff2 = ticks[next] - pos;"," ret = (diff2 > diff1) ? ticks[i] : ticks[next];"," if (off1 && off2) {"," if (ret > off2) {"," if (ticks[i]) {"," ret = ticks[i];"," } else {"," ret = ticks[len - 1];"," }"," }"," }"," return ret;"," }",""," }"," return ticks[ticks.length - 1];"," }"," });","","","","}, '@VERSION@', {\"requires\": [\"dd-drag\"]});"];
-_yuitest_coverage["build/dd-constrain/dd-constrain.js"].lines = {"1":0,"18":0,"49":0,"50":0,"53":0,"63":0,"65":0,"124":0,"138":0,"139":0,"140":0,"142":0,"153":0,"164":0,"175":0,"188":0,"193":0,"195":0,"203":0,"206":0,"210":0,"218":0,"223":0,"224":0,"239":0,"240":0,"248":0,"263":0,"270":0,"278":0,"282":0,"283":0,"284":0,"285":0,"286":0,"288":0,"289":0,"290":0,"292":0,"293":0,"296":0,"297":0,"299":0,"300":0,"303":0,"304":0,"305":0,"307":0,"310":0,"320":0,"323":0,"325":0,"326":0,"327":0,"328":0,"329":0,"331":0,"341":0,"347":0,"348":0,"350":0,"351":0,"354":0,"355":0,"357":0,"358":0,"361":0,"370":0,"372":0,"374":0,"375":0,"377":0,"384":0,"388":0,"389":0,"391":0,"392":0,"395":0,"396":0,"399":0,"401":0,"408":0,"413":0,"414":0,"415":0,"418":0,"419":0,"420":0,"432":0,"437":0,"438":0,"440":0,"441":0,"443":0,"444":0,"446":0,"447":0,"450":0,"458":0,"466":0,"470":0,"471":0,"472":0,"474":0,"489":0,"492":0,"493":0,"494":0,"495":0,"496":0,"497":0,"499":0,"500":0,"505":0,"520":0,"523":0,"524":0,"526":0,"527":0,"530":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"539":0,"541":0,"545":0,"549":0};
-_yuitest_coverage["build/dd-constrain/dd-constrain.js"].functions = {"C:48":0,"setter:123":0,"setter:137":0,"setter:152":0,"setter:163":0,"setter:174":0,"initializer:192":0,"(anonymous 2):205":0,"destructor:202":0,"(anonymous 3):223":0,"_createEvents:217":0,"_handleEnd:238":0,"_handleStart:247":0,"_cacheRegion:262":0,"resetCache:269":0,"(anonymous 4):303":0,"_getConstraint:277":0,"getRegion:319":0,"_checkRegion:340":0,"inRegion:369":0,"align:383":0,"drag:407":0,"_checkTicks:431":0,"_tickAlignX:457":0,"_tickAlignY:465":0,"_calcTicks:488":0,"_calcTickArray:519":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/dd-constrain/dd-constrain.js"].code=["YUI.add('dd-constrain', function (Y, NAME) {","",""," /**"," * The Drag & Drop Utility allows you to create a draggable interface efficiently,"," * buffering you from browser-level abnormalities and enabling you to focus on the interesting"," * logic surrounding your particular implementation. This component enables you to create a"," * variety of standard draggable objects with just a few lines of code and then,"," * using its extensive API, add your own specific implementation logic."," * @module dd"," * @main dd"," * @submodule dd-constrain"," */"," /**"," * Plugin for the dd-drag module to add the constraining methods to it."," * It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints."," * @class DDConstrained"," * @extends Base"," * @constructor"," * @namespace Plugin"," */",""," var DRAG_NODE = 'dragNode',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," HOST = 'host',"," TICK_X_ARRAY = 'tickXArray',"," TICK_Y_ARRAY = 'tickYArray',"," DDM = Y.DD.DDM,"," TOP = 'top',"," RIGHT = 'right',"," BOTTOM = 'bottom',"," LEFT = 'left',"," VIEW = 'view',"," proto = null,",""," /**"," * @event drag:tickAlignX"," * @description Fires when this node is aligned with the tickX value."," * @param {EventFacade} event An Event Facade object"," * @type {CustomEvent}"," */"," EV_TICK_ALIGN_X = 'drag:tickAlignX',",""," /**"," * @event drag:tickAlignY"," * @description Fires when this node is aligned with the tickY value."," * @param {EventFacade} event An Event Facade object"," * @type {CustomEvent}"," */"," EV_TICK_ALIGN_Y = 'drag:tickAlignY',",""," C = function() {"," this._lazyAddAttrs = false;"," C.superclass.constructor.apply(this, arguments);"," };",""," C.NAME = 'ddConstrained';"," /**"," * @property NS"," * @default con"," * @readonly"," * @protected"," * @static"," * @description The Constrained instance will be placed on the Drag instance under the con namespace."," * @type {String}","*/"," C.NS = 'con';",""," C.ATTRS = {"," host: {"," },"," /**"," * @attribute stickX"," * @description Stick the drag movement to the X-Axis. Default: false"," * @type Boolean"," */"," stickX: {"," value: false"," },"," /**"," * @attribute stickY"," * @description Stick the drag movement to the Y-Axis"," * @type Boolean"," */"," stickY: {"," value: false"," },"," /**"," * @attribute tickX"," * @description The X tick offset the drag node should snap to on each drag move. False for no ticks. Default: false"," * @type Number/false"," */"," tickX: {"," value: false"," },"," /**"," * @attribute tickY"," * @description The Y tick offset the drag node should snap to on each drag move. False for no ticks. Default: false"," * @type Number/false"," */"," tickY: {"," value: false"," },"," /**"," * @attribute tickXArray"," * @description An array of page coordinates to use as X ticks for drag movement."," * @type Array"," */"," tickXArray: {"," value: false"," },"," /**"," * @attribute tickYArray"," * @description An array of page coordinates to use as Y ticks for drag movement."," * @type Array"," */"," tickYArray: {"," value: false"," },"," /**"," * CSS style string for the gutter of a region (supports negative values): '5 0'"," * (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)"," * @attribute gutter"," * @type String"," */"," gutter: {"," value: '0',"," setter: function(gutter) {"," return Y.DD.DDM.cssSizestoObject(gutter);"," }"," },"," /**"," * @attribute constrain"," * @description Will attempt to constrain the drag node to the boundaries. Arguments:<br>"," * 'view': Contrain to Viewport<br>"," * '#selector_string': Constrain to this node<br>"," * '{Region Object}': An Object Literal containing a valid region (top, right, bottom, left) of page positions"," * @type {String/Object/Node}"," */"," constrain: {"," value: VIEW,"," setter: function(con) {"," var node = Y.one(con);"," if (node) {"," con = node;"," }"," return con;"," }"," },"," /**"," * @deprecated"," * @attribute constrain2region"," * @description An Object Literal containing a valid region (top, right, bottom, left) of page positions to constrain the drag node to."," * @type Object"," */"," constrain2region: {"," setter: function(r) {"," return this.set('constrain', r);"," }"," },"," /**"," * @deprecated"," * @attribute constrain2node"," * @description Will attempt to constrain the drag node to the boundaries of this node."," * @type Object"," */"," constrain2node: {"," setter: function(n) {"," return this.set('constrain', Y.one(n));"," }"," },"," /**"," * @deprecated"," * @attribute constrain2view"," * @description Will attempt to constrain the drag node to the boundaries of the viewport region."," * @type Object"," */"," constrain2view: {"," setter: function() {"," return this.set('constrain', VIEW);"," }"," },"," /**"," * @attribute cacheRegion"," * @description Should the region be cached for performace. Default: true"," * @type Boolean"," */"," cacheRegion: {"," value: true"," }"," };",""," proto = {"," _lastTickXFired: null,"," _lastTickYFired: null,",""," initializer: function() {"," this._createEvents();",""," this._eventHandles = ["," this.get(HOST).on('drag:end', Y.bind(this._handleEnd, this)),"," this.get(HOST).on('drag:start', Y.bind(this._handleStart, this)),"," this.get(HOST).after('drag:align', Y.bind(this.align, this)),"," this.get(HOST).after('drag:drag', Y.bind(this.drag, this))"," ];"," },"," destructor: function() {"," Y.each("," this._eventHandles,"," function(handle) {"," handle.detach();"," }"," );",""," this._eventHandles.length = 0;"," },"," /**"," * @private"," * @method _createEvents"," * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling."," */"," _createEvents: function() {"," var ev = ["," EV_TICK_ALIGN_X,"," EV_TICK_ALIGN_Y"," ];",""," Y.each(ev, function(v) {"," this.publish(v, {"," type: v,"," emitFacade: true,"," bubbles: true,"," queuable: false,"," prefix: 'drag'"," });"," }, this);"," },"," /**"," * @private"," * @method _handleEnd"," * @description Fires on drag:end"," */"," _handleEnd: function() {"," this._lastTickYFired = null;"," this._lastTickXFired = null;"," },"," /**"," * @private"," * @method _handleStart"," * @description Fires on drag:start and clears the _regionCache"," */"," _handleStart: function() {"," this.resetCache();"," },"," /**"," * @private"," * @property _regionCache"," * @description Store a cache of the region that we are constraining to"," * @type Object"," */"," _regionCache: null,"," /**"," * @private"," * @method _cacheRegion"," * @description Get's the region and caches it, called from window.resize and when the cache is null"," */"," _cacheRegion: function() {"," this._regionCache = this.get('constrain').get('region');"," },"," /**"," * @method resetCache"," * @description Reset the internal region cache."," */"," resetCache: function() {"," this._regionCache = null;"," },"," /**"," * @private"," * @method _getConstraint"," * @description Standardizes the 'constraint' attribute"," */"," _getConstraint: function() {"," var con = this.get('constrain'),"," g = this.get('gutter'),"," region;",""," if (con) {"," if (con instanceof Y.Node) {"," if (!this._regionCache) {"," this._eventHandles.push(Y.on('resize', Y.bind(this._cacheRegion, this), Y.config.win));"," this._cacheRegion();"," }"," region = Y.clone(this._regionCache);"," if (!this.get('cacheRegion')) {"," this.resetCache();"," }"," } else if (Y.Lang.isObject(con)) {"," region = Y.clone(con);"," }"," }"," if (!con || !region) {"," con = VIEW;"," }"," if (con === VIEW) {"," region = this.get(HOST).get(DRAG_NODE).get('viewportRegion');"," }",""," Y.each(g, function(i, n) {"," if ((n === RIGHT) || (n === BOTTOM)) {"," region[n] -= i;"," } else {"," region[n] += i;"," }"," });"," return region;"," },",""," /**"," * @method getRegion"," * @description Get the active region: viewport, node, custom region"," * @param {Boolean} inc Include the node's height and width"," * @return {Object} The active region."," */"," getRegion: function(inc) {"," var r = {}, oh = null, ow = null,"," host = this.get(HOST);",""," r = this._getConstraint();",""," if (inc) {"," oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT);"," ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);"," r[RIGHT] = r[RIGHT] - ow;"," r[BOTTOM] = r[BOTTOM] - oh;"," }"," return r;"," },"," /**"," * @private"," * @method _checkRegion"," * @description Check if xy is inside a given region, if not change to it be inside."," * @param {Array} _xy The XY to check if it's in the current region, if it isn't"," * inside the region, it will reset the xy array to be inside the region."," * @return {Array} The new XY that is inside the region"," */"," _checkRegion: function(_xy) {"," var oxy = _xy,"," r = this.getRegion(),"," host = this.get(HOST),"," oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT),"," ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);",""," if (oxy[1] > (r[BOTTOM] - oh)) {"," _xy[1] = (r[BOTTOM] - oh);"," }"," if (r[TOP] > oxy[1]) {"," _xy[1] = r[TOP];",""," }"," if (oxy[0] > (r[RIGHT] - ow)) {"," _xy[0] = (r[RIGHT] - ow);"," }"," if (r[LEFT] > oxy[0]) {"," _xy[0] = r[LEFT];"," }",""," return _xy;"," },"," /**"," * @method inRegion"," * @description Checks if the XY passed or the dragNode is inside the active region."," * @param {Array} xy Optional XY to check, if not supplied this.get('dragNode').getXY() is used."," * @return {Boolean} True if the XY is inside the region, false otherwise."," */"," inRegion: function(xy) {"," xy = xy || this.get(HOST).get(DRAG_NODE).getXY();",""," var _xy = this._checkRegion([xy[0], xy[1]]),"," inside = false;"," if ((xy[0] === _xy[0]) && (xy[1] === _xy[1])) {"," inside = true;"," }"," return inside;"," },"," /**"," * @method align"," * @description Modifies the Drag.actXY method from the after drag:align event. This is where the constraining happens."," */"," align: function() {"," var host = this.get(HOST),"," _xy = [host.actXY[0], host.actXY[1]],"," r = this.getRegion(true);",""," if (this.get('stickX')) {"," _xy[1] = (host.startXY[1] - host.deltaXY[1]);"," }"," if (this.get('stickY')) {"," _xy[0] = (host.startXY[0] - host.deltaXY[0]);"," }",""," if (r) {"," _xy = this._checkRegion(_xy);"," }",""," _xy = this._checkTicks(_xy, r);",""," host.actXY = _xy;"," },"," /**"," * @method drag"," * @description Fires after drag:drag. Handle the tickX and tickX align events."," */"," drag: function() {"," var host = this.get(HOST),"," xt = this.get('tickX'),"," yt = this.get('tickY'),"," _xy = [host.actXY[0], host.actXY[1]];",""," if ((Y.Lang.isNumber(xt) || this.get(TICK_X_ARRAY)) && (this._lastTickXFired !== _xy[0])) {"," this._tickAlignX();"," this._lastTickXFired = _xy[0];"," }",""," if ((Y.Lang.isNumber(yt) || this.get(TICK_Y_ARRAY)) && (this._lastTickYFired !== _xy[1])) {"," this._tickAlignY();"," this._lastTickYFired = _xy[1];"," }"," },"," /**"," * @private"," * @method _checkTicks"," * @description This method delegates the proper helper method for tick calculations"," * @param {Array} xy The XY coords for the Drag"," * @param {Object} r The optional region that we are bound to."," * @return {Array} The calced XY coords"," */"," _checkTicks: function(xy, r) {"," var host = this.get(HOST),"," lx = (host.startXY[0] - host.deltaXY[0]),"," ly = (host.startXY[1] - host.deltaXY[1]),"," xt = this.get('tickX'),"," yt = this.get('tickY');"," if (xt && !this.get(TICK_X_ARRAY)) {"," xy[0] = DDM._calcTicks(xy[0], lx, xt, r[LEFT], r[RIGHT]);"," }"," if (yt && !this.get(TICK_Y_ARRAY)) {"," xy[1] = DDM._calcTicks(xy[1], ly, yt, r[TOP], r[BOTTOM]);"," }"," if (this.get(TICK_X_ARRAY)) {"," xy[0] = DDM._calcTickArray(xy[0], this.get(TICK_X_ARRAY), r[LEFT], r[RIGHT]);"," }"," if (this.get(TICK_Y_ARRAY)) {"," xy[1] = DDM._calcTickArray(xy[1], this.get(TICK_Y_ARRAY), r[TOP], r[BOTTOM]);"," }",""," return xy;"," },"," /**"," * @private"," * @method _tickAlignX"," * @description Fires when the actXY[0] reach a new value respecting the tickX gap."," */"," _tickAlignX: function() {"," this.fire(EV_TICK_ALIGN_X);"," },"," /**"," * @private"," * @method _tickAlignY"," * @description Fires when the actXY[1] reach a new value respecting the tickY gap."," */"," _tickAlignY: function() {"," this.fire(EV_TICK_ALIGN_Y);"," }"," };",""," Y.namespace('Plugin');"," Y.extend(C, Y.Base, proto);"," Y.Plugin.DDConstrained = C;",""," Y.mix(DDM, {"," /**"," * @for DDM"," * @namespace DD"," * @private"," * @method _calcTicks"," * @description Helper method to calculate the tick offsets for a given position"," * @param {Number} pos The current X or Y position"," * @param {Number} start The start X or Y position"," * @param {Number} tick The X or Y tick increment"," * @param {Number} off1 The min offset that we can't pass (region)"," * @param {Number} off2 The max offset that we can't pass (region)"," * @return {Number} The new position based on the tick calculation"," */"," _calcTicks: function(pos, start, tick, off1, off2) {"," var ix = ((pos - start) / tick),"," min = Math.floor(ix),"," max = Math.ceil(ix);"," if ((min !== 0) || (max !== 0)) {"," if ((ix >= min) && (ix <= max)) {"," pos = (start + (tick * min));"," if (off1 && off2) {"," if (pos < off1) {"," pos = (start + (tick * (min + 1)));"," }"," if (pos > off2) {"," pos = (start + (tick * (min - 1)));"," }"," }"," }"," }"," return pos;"," },"," /**"," * @for DDM"," * @namespace DD"," * @private"," * @method _calcTickArray"," * @description This method is used with the tickXArray and tickYArray config options"," * @param {Number} pos The current X or Y position"," * @param {Number} ticks The array containing our custom tick positions."," * @param {Number} off1 The min offset that we can't pass (region)"," * @param {Number} off2 The max offset that we can't pass (region)"," * @return The tick position"," */"," _calcTickArray: function(pos, ticks, off1, off2) {"," var i = 0, len = ticks.length, next = 0,"," diff1, diff2, ret;",""," if (!ticks || (ticks.length === 0)) {"," return pos;"," }"," if (ticks[0] >= pos) {"," return ticks[0];"," }",""," for (i = 0; i < len; i++) {"," next = (i + 1);"," if (ticks[next] && ticks[next] >= pos) {"," diff1 = pos - ticks[i];"," diff2 = ticks[next] - pos;"," ret = (diff2 > diff1) ? ticks[i] : ticks[next];"," if (off1 && off2) {"," if (ret > off2) {"," if (ticks[i]) {"," ret = ticks[i];"," } else {"," ret = ticks[len - 1];"," }"," }"," }"," return ret;"," }",""," }"," return ticks[ticks.length - 1];"," }"," });","","","","}, '@VERSION@', {\"requires\": [\"dd-drag\"]});"];
+_yuitest_coverage["build/dd-constrain/dd-constrain.js"].lines = {"1":0,"23":0,"54":0,"55":0,"58":0,"68":0,"70":0,"130":0,"144":0,"145":0,"146":0,"148":0,"159":0,"170":0,"181":0,"194":0,"199":0,"201":0,"209":0,"212":0,"216":0,"224":0,"229":0,"230":0,"245":0,"246":0,"254":0,"269":0,"276":0,"284":0,"288":0,"289":0,"290":0,"291":0,"292":0,"294":0,"295":0,"296":0,"298":0,"299":0,"302":0,"303":0,"305":0,"306":0,"309":0,"310":0,"311":0,"313":0,"316":0,"326":0,"329":0,"331":0,"332":0,"333":0,"334":0,"335":0,"337":0,"348":0,"354":0,"355":0,"357":0,"358":0,"361":0,"362":0,"364":0,"365":0,"368":0,"377":0,"379":0,"381":0,"382":0,"384":0,"391":0,"395":0,"396":0,"398":0,"399":0,"402":0,"403":0,"406":0,"408":0,"415":0,"420":0,"421":0,"422":0,"425":0,"426":0,"427":0,"439":0,"444":0,"445":0,"447":0,"448":0,"450":0,"451":0,"453":0,"454":0,"457":0,"465":0,"473":0,"477":0,"478":0,"479":0,"481":0,"496":0,"499":0,"500":0,"501":0,"502":0,"503":0,"504":0,"506":0,"507":0,"512":0,"527":0,"530":0,"531":0,"533":0,"534":0,"537":0,"538":0,"539":0,"540":0,"541":0,"542":0,"543":0,"544":0,"545":0,"546":0,"548":0,"552":0,"556":0};
+_yuitest_coverage["build/dd-constrain/dd-constrain.js"].functions = {"C:53":0,"setter:129":0,"setter:143":0,"setter:158":0,"setter:169":0,"setter:180":0,"initializer:198":0,"(anonymous 2):211":0,"destructor:208":0,"(anonymous 3):229":0,"_createEvents:223":0,"_handleEnd:244":0,"_handleStart:253":0,"_cacheRegion:268":0,"resetCache:275":0,"(anonymous 4):309":0,"_getConstraint:283":0,"getRegion:325":0,"_checkRegion:347":0,"inRegion:376":0,"align:390":0,"drag:414":0,"_checkTicks:438":0,"_tickAlignX:464":0,"_tickAlignY:472":0,"_calcTicks:495":0,"_calcTickArray:526":0,"(anonymous 1):1":0};
_yuitest_coverage["build/dd-constrain/dd-constrain.js"].coveredLines = 132;
_yuitest_coverage["build/dd-constrain/dd-constrain.js"].coveredFunctions = 28;
_yuitest_coverline("build/dd-constrain/dd-constrain.js", 1);
@@ -36,13 +36,18 @@ YUI.add('dd-constrain', function (Y, NAME) {
/**
- * The Drag & Drop Utility allows you to create a draggable interface efficiently, buffering you from browser-level abnormalities and enabling you to focus on the interesting logic surrounding your particular implementation. This component enables you to create a variety of standard draggable objects with just a few lines of code and then, using its extensive API, add your own specific implementation logic.
+ * The Drag & Drop Utility allows you to create a draggable interface efficiently,
+ * buffering you from browser-level abnormalities and enabling you to focus on the interesting
+ * logic surrounding your particular implementation. This component enables you to create a
+ * variety of standard draggable objects with just a few lines of code and then,
+ * using its extensive API, add your own specific implementation logic.
* @module dd
* @main dd
* @submodule dd-constrain
*/
/**
- * Plugin for the dd-drag module to add the constraining methods to it. It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints.
+ * Plugin for the dd-drag module to add the constraining methods to it.
+ * It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints.
* @class DDConstrained
* @extends Base
* @constructor
@@ -50,7 +55,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
*/
_yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 1)", 1);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 18);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 23);
var DRAG_NODE = 'dragNode',
OFFSET_HEIGHT = 'offsetHeight',
OFFSET_WIDTH = 'offsetWidth',
@@ -81,15 +86,15 @@ var DRAG_NODE = 'dragNode',
*/
EV_TICK_ALIGN_Y = 'drag:tickAlignY',
- C = function(config) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "C", 48);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 49);
+ C = function() {
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "C", 53);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 54);
this._lazyAddAttrs = false;
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 50);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 55);
C.superclass.constructor.apply(this, arguments);
};
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 53);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 58);
C.NAME = 'ddConstrained';
/**
* @property NS
@@ -100,10 +105,10 @@ C.NAME = 'ddConstrained';
* @description The Constrained instance will be placed on the Drag instance under the con namespace.
* @type {String}
*/
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 63);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 68);
C.NS = 'con';
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 65);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 70);
C.ATTRS = {
host: {
},
@@ -156,15 +161,16 @@ C.ATTRS = {
value: false
},
/**
+ * CSS style string for the gutter of a region (supports negative values): '5 0'
+ * (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)
* @attribute gutter
- * @description CSS style string for the gutter of a region (supports negative values): '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)
* @type String
*/
gutter: {
value: '0',
setter: function(gutter) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 123);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 124);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 129);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 130);
return Y.DD.DDM.cssSizestoObject(gutter);
}
},
@@ -179,15 +185,15 @@ return Y.DD.DDM.cssSizestoObject(gutter);
constrain: {
value: VIEW,
setter: function(con) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 137);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 138);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 143);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 144);
var node = Y.one(con);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 139);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 145);
if (node) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 140);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 146);
con = node;
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 142);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 148);
return con;
}
},
@@ -199,8 +205,8 @@ return con;
*/
constrain2region: {
setter: function(r) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 152);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 153);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 158);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 159);
return this.set('constrain', r);
}
},
@@ -212,8 +218,8 @@ return this.set('constrain', r);
*/
constrain2node: {
setter: function(n) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 163);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 164);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 169);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 170);
return this.set('constrain', Y.one(n));
}
},
@@ -224,9 +230,9 @@ return this.set('constrain', Y.one(n));
* @type Object
*/
constrain2view: {
- setter: function(n) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 174);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 175);
+ setter: function() {
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 180);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 181);
return this.set('constrain', VIEW);
}
},
@@ -240,17 +246,17 @@ return this.set('constrain', VIEW);
}
};
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 188);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 194);
proto = {
_lastTickXFired: null,
_lastTickYFired: null,
initializer: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "initializer", 192);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 193);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "initializer", 198);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 199);
this._createEvents();
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 195);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 201);
this._eventHandles = [
this.get(HOST).on('drag:end', Y.bind(this._handleEnd, this)),
this.get(HOST).on('drag:start', Y.bind(this._handleStart, this)),
@@ -259,18 +265,18 @@ this._eventHandles = [
];
},
destructor: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "destructor", 202);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 203);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "destructor", 208);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 209);
Y.each(
this._eventHandles,
- function(handle, index) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 2)", 205);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 206);
+ function(handle) {
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 2)", 211);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 212);
handle.detach();
}
);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 210);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 216);
this._eventHandles.length = 0;
},
/**
@@ -279,17 +285,17 @@ this._eventHandles.length = 0;
* @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling.
*/
_createEvents: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_createEvents", 217);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 218);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_createEvents", 223);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 224);
var ev = [
EV_TICK_ALIGN_X,
EV_TICK_ALIGN_Y
];
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 223);
-Y.each(ev, function(v, k) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 3)", 223);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 224);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 229);
+Y.each(ev, function(v) {
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 3)", 229);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 230);
this.publish(v, {
type: v,
emitFacade: true,
@@ -305,10 +311,10 @@ this.publish(v, {
* @description Fires on drag:end
*/
_handleEnd: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_handleEnd", 238);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 239);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_handleEnd", 244);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 245);
this._lastTickYFired = null;
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 240);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 246);
this._lastTickXFired = null;
},
/**
@@ -317,8 +323,8 @@ this._lastTickXFired = null;
* @description Fires on drag:start and clears the _regionCache
*/
_handleStart: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_handleStart", 247);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 248);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_handleStart", 253);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 254);
this.resetCache();
},
/**
@@ -334,8 +340,8 @@ this.resetCache();
* @description Get's the region and caches it, called from window.resize and when the cache is null
*/
_cacheRegion: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_cacheRegion", 262);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 263);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_cacheRegion", 268);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 269);
this._regionCache = this.get('constrain').get('region');
},
/**
@@ -343,8 +349,8 @@ this._regionCache = this.get('constrain').get('region');
* @description Reset the internal region cache.
*/
resetCache: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "resetCache", 269);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 270);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "resetCache", 275);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 276);
this._regionCache = null;
},
/**
@@ -353,60 +359,60 @@ this._regionCache = null;
* @description Standardizes the 'constraint' attribute
*/
_getConstraint: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_getConstraint", 277);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 278);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_getConstraint", 283);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 284);
var con = this.get('constrain'),
g = this.get('gutter'),
region;
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 282);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 288);
if (con) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 283);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 289);
if (con instanceof Y.Node) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 284);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 290);
if (!this._regionCache) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 285);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 291);
this._eventHandles.push(Y.on('resize', Y.bind(this._cacheRegion, this), Y.config.win));
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 286);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 292);
this._cacheRegion();
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 288);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 294);
region = Y.clone(this._regionCache);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 289);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 295);
if (!this.get('cacheRegion')) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 290);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 296);
this.resetCache();
}
- } else {_yuitest_coverline("build/dd-constrain/dd-constrain.js", 292);
+ } else {_yuitest_coverline("build/dd-constrain/dd-constrain.js", 298);
if (Y.Lang.isObject(con)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 293);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 299);
region = Y.clone(con);
}}
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 296);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 302);
if (!con || !region) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 297);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 303);
con = VIEW;
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 299);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 305);
if (con === VIEW) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 300);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 306);
region = this.get(HOST).get(DRAG_NODE).get('viewportRegion');
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 303);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 309);
Y.each(g, function(i, n) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 4)", 303);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 304);
-if ((n == RIGHT) || (n == BOTTOM)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 305);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 4)", 309);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 310);
+if ((n === RIGHT) || (n === BOTTOM)) {
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 311);
region[n] -= i;
} else {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 307);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 313);
region[n] += i;
}
});
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 310);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 316);
return region;
},
@@ -417,67 +423,68 @@ return region;
* @return {Object} The active region.
*/
getRegion: function(inc) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "getRegion", 319);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 320);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "getRegion", 325);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 326);
var r = {}, oh = null, ow = null,
host = this.get(HOST);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 323);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 329);
r = this._getConstraint();
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 325);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 331);
if (inc) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 326);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 332);
oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 327);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 333);
ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 328);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 334);
r[RIGHT] = r[RIGHT] - ow;
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 329);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 335);
r[BOTTOM] = r[BOTTOM] - oh;
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 331);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 337);
return r;
},
/**
* @private
* @method _checkRegion
* @description Check if xy is inside a given region, if not change to it be inside.
- * @param {Array} _xy The XY to check if it's in the current region, if it isn't inside the region, it will reset the xy array to be inside the region.
+ * @param {Array} _xy The XY to check if it's in the current region, if it isn't
+ * inside the region, it will reset the xy array to be inside the region.
* @return {Array} The new XY that is inside the region
*/
_checkRegion: function(_xy) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_checkRegion", 340);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 341);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_checkRegion", 347);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 348);
var oxy = _xy,
r = this.getRegion(),
host = this.get(HOST),
oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT),
ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 347);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 354);
if (oxy[1] > (r[BOTTOM] - oh)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 348);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 355);
_xy[1] = (r[BOTTOM] - oh);
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 350);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 357);
if (r[TOP] > oxy[1]) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 351);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 358);
_xy[1] = r[TOP];
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 354);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 361);
if (oxy[0] > (r[RIGHT] - ow)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 355);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 362);
_xy[0] = (r[RIGHT] - ow);
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 357);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 364);
if (r[LEFT] > oxy[0]) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 358);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 365);
_xy[0] = r[LEFT];
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 361);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 368);
return _xy;
},
/**
@@ -487,19 +494,19 @@ return _xy;
* @return {Boolean} True if the XY is inside the region, false otherwise.
*/
inRegion: function(xy) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "inRegion", 369);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 370);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "inRegion", 376);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 377);
xy = xy || this.get(HOST).get(DRAG_NODE).getXY();
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 372);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 379);
var _xy = this._checkRegion([xy[0], xy[1]]),
inside = false;
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 374);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 381);
if ((xy[0] === _xy[0]) && (xy[1] === _xy[1])) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 375);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 382);
inside = true;
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 377);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 384);
return inside;
},
/**
@@ -507,60 +514,60 @@ return inside;
* @description Modifies the Drag.actXY method from the after drag:align event. This is where the constraining happens.
*/
align: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "align", 383);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 384);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "align", 390);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 391);
var host = this.get(HOST),
_xy = [host.actXY[0], host.actXY[1]],
r = this.getRegion(true);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 388);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 395);
if (this.get('stickX')) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 389);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 396);
_xy[1] = (host.startXY[1] - host.deltaXY[1]);
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 391);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 398);
if (this.get('stickY')) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 392);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 399);
_xy[0] = (host.startXY[0] - host.deltaXY[0]);
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 395);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 402);
if (r) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 396);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 403);
_xy = this._checkRegion(_xy);
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 399);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 406);
_xy = this._checkTicks(_xy, r);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 401);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 408);
host.actXY = _xy;
},
/**
* @method drag
* @description Fires after drag:drag. Handle the tickX and tickX align events.
*/
- drag: function(event) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "drag", 407);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 408);
+ drag: function() {
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "drag", 414);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 415);
var host = this.get(HOST),
xt = this.get('tickX'),
yt = this.get('tickY'),
_xy = [host.actXY[0], host.actXY[1]];
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 413);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 420);
if ((Y.Lang.isNumber(xt) || this.get(TICK_X_ARRAY)) && (this._lastTickXFired !== _xy[0])) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 414);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 421);
this._tickAlignX();
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 415);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 422);
this._lastTickXFired = _xy[0];
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 418);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 425);
if ((Y.Lang.isNumber(yt) || this.get(TICK_Y_ARRAY)) && (this._lastTickYFired !== _xy[1])) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 419);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 426);
this._tickAlignY();
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 420);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 427);
this._lastTickYFired = _xy[1];
}
},
@@ -573,35 +580,35 @@ this._lastTickYFired = _xy[1];
* @return {Array} The calced XY coords
*/
_checkTicks: function(xy, r) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_checkTicks", 431);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 432);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_checkTicks", 438);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 439);
var host = this.get(HOST),
lx = (host.startXY[0] - host.deltaXY[0]),
ly = (host.startXY[1] - host.deltaXY[1]),
xt = this.get('tickX'),
yt = this.get('tickY');
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 437);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 444);
if (xt && !this.get(TICK_X_ARRAY)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 438);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 445);
xy[0] = DDM._calcTicks(xy[0], lx, xt, r[LEFT], r[RIGHT]);
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 440);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 447);
if (yt && !this.get(TICK_Y_ARRAY)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 441);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 448);
xy[1] = DDM._calcTicks(xy[1], ly, yt, r[TOP], r[BOTTOM]);
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 443);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 450);
if (this.get(TICK_X_ARRAY)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 444);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 451);
xy[0] = DDM._calcTickArray(xy[0], this.get(TICK_X_ARRAY), r[LEFT], r[RIGHT]);
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 446);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 453);
if (this.get(TICK_Y_ARRAY)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 447);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 454);
xy[1] = DDM._calcTickArray(xy[1], this.get(TICK_Y_ARRAY), r[TOP], r[BOTTOM]);
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 450);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 457);
return xy;
},
/**
@@ -610,8 +617,8 @@ return xy;
* @description Fires when the actXY[0] reach a new value respecting the tickX gap.
*/
_tickAlignX: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_tickAlignX", 457);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 458);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_tickAlignX", 464);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 465);
this.fire(EV_TICK_ALIGN_X);
},
/**
@@ -620,20 +627,20 @@ this.fire(EV_TICK_ALIGN_X);
* @description Fires when the actXY[1] reach a new value respecting the tickY gap.
*/
_tickAlignY: function() {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_tickAlignY", 465);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 466);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_tickAlignY", 472);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 473);
this.fire(EV_TICK_ALIGN_Y);
}
};
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 470);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 477);
Y.namespace('Plugin');
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 471);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 478);
Y.extend(C, Y.Base, proto);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 472);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 479);
Y.Plugin.DDConstrained = C;
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 474);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 481);
Y.mix(DDM, {
/**
* @for DDM
@@ -649,33 +656,33 @@ Y.mix(DDM, {
* @return {Number} The new position based on the tick calculation
*/
_calcTicks: function(pos, start, tick, off1, off2) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_calcTicks", 488);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 489);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_calcTicks", 495);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 496);
var ix = ((pos - start) / tick),
min = Math.floor(ix),
max = Math.ceil(ix);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 492);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 499);
if ((min !== 0) || (max !== 0)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 493);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 500);
if ((ix >= min) && (ix <= max)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 494);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 501);
pos = (start + (tick * min));
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 495);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 502);
if (off1 && off2) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 496);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 503);
if (pos < off1) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 497);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 504);
pos = (start + (tick * (min + 1)));
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 499);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 506);
if (pos > off2) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 500);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 507);
pos = (start + (tick * (min - 1)));
}
}
}
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 505);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 512);
return pos;
},
/**
@@ -691,54 +698,54 @@ return pos;
* @return The tick position
*/
_calcTickArray: function(pos, ticks, off1, off2) {
- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_calcTickArray", 519);
-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 520);
+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_calcTickArray", 526);
+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 527);
var i = 0, len = ticks.length, next = 0,
diff1, diff2, ret;
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 523);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 530);
if (!ticks || (ticks.length === 0)) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 524);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 531);
return pos;
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 526);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 533);
if (ticks[0] >= pos) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 527);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 534);
return ticks[0];
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 530);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 537);
for (i = 0; i < len; i++) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 531);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 538);
next = (i + 1);
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 532);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 539);
if (ticks[next] && ticks[next] >= pos) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 533);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 540);
diff1 = pos - ticks[i];
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 534);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 541);
diff2 = ticks[next] - pos;
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 535);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 542);
ret = (diff2 > diff1) ? ticks[i] : ticks[next];
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 536);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 543);
if (off1 && off2) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 537);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 544);
if (ret > off2) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 538);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 545);
if (ticks[i]) {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 539);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 546);
ret = ticks[i];
} else {
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 541);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 548);
ret = ticks[len - 1];
}
}
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 545);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 552);
return ret;
}
}
- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 549);
+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 556);
return ticks[ticks.length - 1];
}
});
View
27 build/dd-constrain/dd-constrain-debug.js
@@ -2,13 +2,18 @@ YUI.add('dd-constrain', function (Y, NAME) {
/**
- * The Drag & Drop Utility allows you to create a draggable interface efficiently, buffering you from browser-level abnormalities and enabling you to focus on the interesting logic surrounding your particular implementation. This component enables you to create a variety of standard draggable objects with just a few lines of code and then, using its extensive API, add your own specific implementation logic.
+ * The Drag & Drop Utility allows you to create a draggable interface efficiently,
+ * buffering you from browser-level abnormalities and enabling you to focus on the interesting
+ * logic surrounding your particular implementation. This component enables you to create a
+ * variety of standard draggable objects with just a few lines of code and then,
+ * using its extensive API, add your own specific implementation logic.
* @module dd
* @main dd
* @submodule dd-constrain
*/
/**
- * Plugin for the dd-drag module to add the constraining methods to it. It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints.
+ * Plugin for the dd-drag module to add the constraining methods to it.
+ * It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints.
* @class DDConstrained
* @extends Base
* @constructor
@@ -45,7 +50,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
*/
EV_TICK_ALIGN_Y = 'drag:tickAlignY',
- C = function(config) {
+ C = function() {
this._lazyAddAttrs = false;
C.superclass.constructor.apply(this, arguments);
};
@@ -114,8 +119,9 @@ YUI.add('dd-constrain', function (Y, NAME) {
value: false
},
/**
+ * CSS style string for the gutter of a region (supports negative values): '5 0'
+ * (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)
* @attribute gutter
- * @description CSS style string for the gutter of a region (supports negative values): '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)
* @type String
*/
gutter: {
@@ -171,7 +177,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
* @type Object
*/
constrain2view: {
- setter: function(n) {
+ setter: function() {
return this.set('constrain', VIEW);
}
},
@@ -202,7 +208,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
destructor: function() {
Y.each(
this._eventHandles,
- function(handle, index) {
+ function(handle) {
handle.detach();
}
);
@@ -220,7 +226,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
EV_TICK_ALIGN_Y
];
- Y.each(ev, function(v, k) {
+ Y.each(ev, function(v) {
this.publish(v, {
type: v,
emitFacade: true,
@@ -301,7 +307,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
}
Y.each(g, function(i, n) {
- if ((n == RIGHT) || (n == BOTTOM)) {
+ if ((n === RIGHT) || (n === BOTTOM)) {
region[n] -= i;
} else {
region[n] += i;
@@ -334,7 +340,8 @@ YUI.add('dd-constrain', function (Y, NAME) {
* @private
* @method _checkRegion
* @description Check if xy is inside a given region, if not change to it be inside.
- * @param {Array} _xy The XY to check if it's in the current region, if it isn't inside the region, it will reset the xy array to be inside the region.
+ * @param {Array} _xy The XY to check if it's in the current region, if it isn't
+ * inside the region, it will reset the xy array to be inside the region.
* @return {Array} The new XY that is inside the region
*/
_checkRegion: function(_xy) {
@@ -404,7 +411,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
* @method drag
* @description Fires after drag:drag. Handle the tickX and tickX align events.
*/
- drag: function(event) {
+ drag: function() {
var host = this.get(HOST),
xt = this.get('tickX'),
yt = this.get('tickY'),
View
2  build/dd-constrain/dd-constrain-min.js
@@ -1 +1 @@
-YUI.add("dd-constrain",function(e,t){var n="dragNode",r="offsetHeight",i="offsetWidth",s="host",o="tickXArray",u="tickYArray",a=e.DD.DDM,f="top",l="right",c="bottom",h="left",p="view",d=null,v="drag:tickAlignX",m="drag:tickAlignY",g=function(e){this._lazyAddAttrs=!1,g.superclass.constructor.apply(this,arguments)};g.NAME="ddConstrained",g.NS="con",g.ATTRS={host:{},stickX:{value:!1},stickY:{value:!1},tickX:{value:!1},tickY:{value:!1},tickXArray:{value:!1},tickYArray:{value:!1},gutter:{value:"0",setter:function(t){return e.DD.DDM.cssSizestoObject(t)}},constrain:{value:p,setter:function(t){var n=e.one(t);return n&&(t=n),t}},constrain2region:{setter:function(e){return this.set("constrain",e)}},constrain2node:{setter:function(t){return this.set("constrain",e.one(t))}},constrain2view:{setter:function(e){return this.set("constrain",p)}},cacheRegion:{value:!0}},d={_lastTickXFired:null,_lastTickYFired:null,initializer:function(){this._createEvents(),this._eventHandles=[this.get(s).on("drag:end",e.bind(this._handleEnd,this)),this.get(s).on("drag:start",e.bind(this._handleStart,this)),this.get(s).after("drag:align",e.bind(this.align,this)),this.get(s).after("drag:drag",e.bind(this.drag,this))]},destructor:function(){e.each(this._eventHandles,function(e,t){e.detach()}),this._eventHandles.length=0},_createEvents:function(){var t=[v,m];e.each(t,function(e,t){this.publish(e,{type:e,emitFacade:!0,bubbles:!0,queuable:!1,prefix:"drag"})},this)},_handleEnd:function(){this._lastTickYFired=null,this._lastTickXFired=null},_handleStart:function(){this.resetCache()},_regionCache:null,_cacheRegion:function(){this._regionCache=this.get("constrain").get("region")},resetCache:function(){this._regionCache=null},_getConstraint:function(){var t=this.get("constrain"),r=this.get("gutter"),i;t&&(t instanceof e.Node?(this._regionCache||(this._eventHandles.push(e.on("resize",e.bind(this._cacheRegion,this),e.config.win)),this._cacheRegion()),i=e.clone(this._regionCache),this.get("cacheRegion")||this.resetCache()):e.Lang.isObject(t)&&(i=e.clone(t)));if(!t||!i)t=p;return t===p&&(i=this.get(s).get(n).get("viewportRegion")),e.each(r,function(e,t){t==l||t==c?i[t]-=e:i[t]+=e}),i},getRegion:function(e){var t={},o=null,u=null,a=this.get(s);return t=this._getConstraint(),e&&(o=a.get(n).get(r),u=a.get(n).get(i),t[l]=t[l]-u,t[c]=t[c]-o),t},_checkRegion:function(e){var t=e,o=this.getRegion(),u=this.get(s),a=u.get(n).get(r),p=u.get(n).get(i);return t[1]>o[c]-a&&(e[1]=o[c]-a),o[f]>t[1]&&(e[1]=o[f]),t[0]>o[l]-p&&(e[0]=o[l]-p),o[h]>t[0]&&(e[0]=o[h]),e},inRegion:function(e){e=e||this.get(s).get(n).getXY();var t=this._checkRegion([e[0],e[1]]),r=!1;return e[0]===t[0]&&e[1]===t[1]&&(r=!0),r},align:function(){var e=this.get(s),t=[e.actXY[0],e.actXY[1]],n=this.getRegion(!0);this.get("stickX")&&(t[1]=e.startXY[1]-e.deltaXY[1]),this.get("stickY")&&(t[0]=e.startXY[0]-e.deltaXY[0]),n&&(t=this._checkRegion(t)),t=this._checkTicks(t,n),e.actXY=t},drag:function(t){var n=this.get(s),r=this.get("tickX"),i=this.get("tickY"),a=[n.actXY[0],n.actXY[1]];(e.Lang.isNumber(r)||this.get(o))&&this._lastTickXFired!==a[0]&&(this._tickAlignX(),this._lastTickXFired=a[0]),(e.Lang.isNumber(i)||this.get(u))&&this._lastTickYFired!==a[1]&&(this._tickAlignY(),this._lastTickYFired=a[1])},_checkTicks:function(e,t){var n=this.get(s),r=n.startXY[0]-n.deltaXY[0],i=n.startXY[1]-n.deltaXY[1],p=this.get("tickX"),d=this.get("tickY");return p&&!this.get(o)&&(e[0]=a._calcTicks(e[0],r,p,t[h],t[l])),d&&!this.get(u)&&(e[1]=a._calcTicks(e[1],i,d,t[f],t[c])),this.get(o)&&(e[0]=a._calcTickArray(e[0],this.get(o),t[h],t[l])),this.get(u)&&(e[1]=a._calcTickArray(e[1],this.get(u),t[f],t[c])),e},_tickAlignX:function(){this.fire(v)},_tickAlignY:function(){this.fire(m)}},e.namespace("Plugin"),e.extend(g,e.Base,d),e.Plugin.DDConstrained=g,e.mix(a,{_calcTicks:function(e,t,n,r,i){var s=(e-t)/n,o=Math.floor(s),u=Math.ceil(s);return(o!==0||u!==0)&&s>=o&&s<=u&&(e=t+n*o,r&&i&&(e<r&&(e=t+n*(o+1)),e>i&&(e=t+n*(o-1)))),e},_calcTickArray:function(e,t,n,r){var i=0,s=t.length,o=0,u,a,f;if(!t||t.length===0)return e;if(t[0]>=e)return t[0];for(i=0;i<s;i++){o=i+1;if(t[o]&&t[o]>=e)return u=e-t[i],a=t[o]-e,f=a>u?t[i]:t[o],n&&r&&f>r&&(t[i]?f=t[i]:f=t[s-1]),f}return t[t.length-1]}})},"@VERSION@",{requires:["dd-drag"]});
+YUI.add("dd-constrain",function(e,t){var n="dragNode",r="offsetHeight",i="offsetWidth",s="host",o="tickXArray",u="tickYArray",a=e.DD.DDM,f="top",l="right",c="bottom",h="left",p="view",d=null,v="drag:tickAlignX",m="drag:tickAlignY",g=function(){this._lazyAddAttrs=!1,g.superclass.constructor.apply(this,arguments)};g.NAME="ddConstrained",g.NS="con",g.ATTRS={host:{},stickX:{value:!1},stickY:{value:!1},tickX:{value:!1},tickY:{value:!1},tickXArray:{value:!1},tickYArray:{value:!1},gutter:{value:"0",setter:function(t){return e.DD.DDM.cssSizestoObject(t)}},constrain:{value:p,setter:function(t){var n=e.one(t);return n&&(t=n),t}},constrain2region:{setter:function(e){return this.set("constrain",e)}},constrain2node:{setter:function(t){return this.set("constrain",e.one(t))}},constrain2view:{setter:function(){return this.set("constrain",p)}},cacheRegion:{value:!0}},d={_lastTickXFired:null,_lastTickYFired:null,initializer:function(){this._createEvents(),this._eventHandles=[this.get(s).on("drag:end",e.bind(this._handleEnd,this)),this.get(s).on("drag:start",e.bind(this._handleStart,this)),this.get(s).after("drag:align",e.bind(this.align,this)),this.get(s).after("drag:drag",e.bind(this.drag,this))]},destructor:function(){e.each(this._eventHandles,function(e){e.detach()}),this._eventHandles.length=0},_createEvents:function(){var t=[v,m];e.each(t,function(e){this.publish(e,{type:e,emitFacade:!0,bubbles:!0,queuable:!1,prefix:"drag"})},this)},_handleEnd:function(){this._lastTickYFired=null,this._lastTickXFired=null},_handleStart:function(){this.resetCache()},_regionCache:null,_cacheRegion:function(){this._regionCache=this.get("constrain").get("region")},resetCache:function(){this._regionCache=null},_getConstraint:function(){var t=this.get("constrain"),r=this.get("gutter"),i;t&&(t instanceof e.Node?(this._regionCache||(this._eventHandles.push(e.on("resize",e.bind(this._cacheRegion,this),e.config.win)),this._cacheRegion()),i=e.clone(this._regionCache),this.get("cacheRegion")||this.resetCache()):e.Lang.isObject(t)&&(i=e.clone(t)));if(!t||!i)t=p;return t===p&&(i=this.get(s).get(n).get("viewportRegion")),e.each(r,function(e,t){t===l||t===c?i[t]-=e:i[t]+=e}),i},getRegion:function(e){var t={},o=null,u=null,a=this.get(s);return t=this._getConstraint(),e&&(o=a.get(n).get(r),u=a.get(n).get(i),t[l]=t[l]-u,t[c]=t[c]-o),t},_checkRegion:function(e){var t=e,o=this.getRegion(),u=this.get(s),a=u.get(n).get(r),p=u.get(n).get(i);return t[1]>o[c]-a&&(e[1]=o[c]-a),o[f]>t[1]&&(e[1]=o[f]),t[0]>o[l]-p&&(e[0]=o[l]-p),o[h]>t[0]&&(e[0]=o[h]),e},inRegion:function(e){e=e||this.get(s).get(n).getXY();var t=this._checkRegion([e[0],e[1]]),r=!1;return e[0]===t[0]&&e[1]===t[1]&&(r=!0),r},align:function(){var e=this.get(s),t=[e.actXY[0],e.actXY[1]],n=this.getRegion(!0);this.get("stickX")&&(t[1]=e.startXY[1]-e.deltaXY[1]),this.get("stickY")&&(t[0]=e.startXY[0]-e.deltaXY[0]),n&&(t=this._checkRegion(t)),t=this._checkTicks(t,n),e.actXY=t},drag:function(){var t=this.get(s),n=this.get("tickX"),r=this.get("tickY"),i=[t.actXY[0],t.actXY[1]];(e.Lang.isNumber(n)||this.get(o))&&this._lastTickXFired!==i[0]&&(this._tickAlignX(),this._lastTickXFired=i[0]),(e.Lang.isNumber(r)||this.get(u))&&this._lastTickYFired!==i[1]&&(this._tickAlignY(),this._lastTickYFired=i[1])},_checkTicks:function(e,t){var n=this.get(s),r=n.startXY[0]-n.deltaXY[0],i=n.startXY[1]-n.deltaXY[1],p=this.get("tickX"),d=this.get("tickY");return p&&!this.get(o)&&(e[0]=a._calcTicks(e[0],r,p,t[h],t[l])),d&&!this.get(u)&&(e[1]=a._calcTicks(e[1],i,d,t[f],t[c])),this.get(o)&&(e[0]=a._calcTickArray(e[0],this.get(o),t[h],t[l])),this.get(u)&&(e[1]=a._calcTickArray(e[1],this.get(u),t[f],t[c])),e},_tickAlignX:function(){this.fire(v)},_tickAlignY:function(){this.fire(m)}},e.namespace("Plugin"),e.extend(g,e.Base,d),e.Plugin.DDConstrained=g,e.mix(a,{_calcTicks:function(e,t,n,r,i){var s=(e-t)/n,o=Math.floor(s),u=Math.ceil(s);return(o!==0||u!==0)&&s>=o&&s<=u&&(e=t+n*o,r&&i&&(e<r&&(e=t+n*(o+1)),e>i&&(e=t+n*(o-1)))),e},_calcTickArray:function(e,t,n,r){var i=0,s=t.length,o=0,u,a,f;if(!t||t.length===0)return e;if(t[0]>=e)return t[0];for(i=0;i<s;i++){o=i+1;if(t[o]&&t[o]>=e)return u=e-t[i],a=t[o]-e,f=a>u?t[i]:t[o],n&&r&&f>r&&(t[i]?f=t[i]:f=t[s-1]),f}return t[t.length-1]}})},"@VERSION@",{requires:["dd-drag"]});
View
27 build/dd-constrain/dd-constrain.js
@@ -2,13 +2,18 @@ YUI.add('dd-constrain', function (Y, NAME) {
/**
- * The Drag & Drop Utility allows you to create a draggable interface efficiently, buffering you from browser-level abnormalities and enabling you to focus on the interesting logic surrounding your particular implementation. This component enables you to create a variety of standard draggable objects with just a few lines of code and then, using its extensive API, add your own specific implementation logic.
+ * The Drag & Drop Utility allows you to create a draggable interface efficiently,
+ * buffering you from browser-level abnormalities and enabling you to focus on the interesting
+ * logic surrounding your particular implementation. This component enables you to create a
+ * variety of standard draggable objects with just a few lines of code and then,
+ * using its extensive API, add your own specific implementation logic.
* @module dd
* @main dd
* @submodule dd-constrain
*/
/**
- * Plugin for the dd-drag module to add the constraining methods to it. It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints.
+ * Plugin for the dd-drag module to add the constraining methods to it.
+ * It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints.
* @class DDConstrained
* @extends Base
* @constructor
@@ -45,7 +50,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
*/
EV_TICK_ALIGN_Y = 'drag:tickAlignY',
- C = function(config) {
+ C = function() {
this._lazyAddAttrs = false;
C.superclass.constructor.apply(this, arguments);
};
@@ -114,8 +119,9 @@ YUI.add('dd-constrain', function (Y, NAME) {
value: false
},
/**
+ * CSS style string for the gutter of a region (supports negative values): '5 0'
+ * (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)
* @attribute gutter
- * @description CSS style string for the gutter of a region (supports negative values): '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)
* @type String
*/
gutter: {
@@ -171,7 +177,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
* @type Object
*/
constrain2view: {
- setter: function(n) {
+ setter: function() {
return this.set('constrain', VIEW);
}
},
@@ -202,7 +208,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
destructor: function() {
Y.each(
this._eventHandles,
- function(handle, index) {
+ function(handle) {
handle.detach();
}
);
@@ -220,7 +226,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
EV_TICK_ALIGN_Y
];
- Y.each(ev, function(v, k) {
+ Y.each(ev, function(v) {
this.publish(v, {
type: v,
emitFacade: true,
@@ -301,7 +307,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
}
Y.each(g, function(i, n) {
- if ((n == RIGHT) || (n == BOTTOM)) {
+ if ((n === RIGHT) || (n === BOTTOM)) {
region[n] -= i;
} else {
region[n] += i;
@@ -334,7 +340,8 @@ YUI.add('dd-constrain', function (Y, NAME) {
* @private
* @method _checkRegion
* @description Check if xy is inside a given region, if not change to it be inside.
- * @param {Array} _xy The XY to check if it's in the current region, if it isn't inside the region, it will reset the xy array to be inside the region.
+ * @param {Array} _xy The XY to check if it's in the current region, if it isn't
+ * inside the region, it will reset the xy array to be inside the region.
* @return {Array} The new XY that is inside the region
*/
_checkRegion: function(_xy) {
@@ -404,7 +411,7 @@ YUI.add('dd-constrain', function (Y, NAME) {
* @method drag
* @description Fires after drag:drag. Handle the tickX and tickX align events.
*/
- drag: function(event) {
+ drag: function() {
var host = this.get(HOST),
xt = this.get('tickX'),
yt = this.get('tickY'),
View
131 build/dd-ddm-base/dd-ddm-base-coverage.js
@@ -26,9 +26,9 @@ _yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"] = {
path: "build/dd-ddm-base/dd-ddm-base.js",
code: []
};
-_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].code=["YUI.add('dd-ddm-base', function (Y, NAME) {","",""," /**"," * Provides the base Drag Drop Manger required for making a Node draggable."," * @module dd"," * @submodule dd-ddm-base"," */ "," /**"," * Provides the base Drag Drop Manger required for making a Node draggable."," * @class DDM"," * @extends Base"," * @constructor"," * @namespace DD"," */"," "," var DDMBase = function() {"," DDMBase.superclass.constructor.apply(this, arguments);"," };",""," DDMBase.NAME = 'ddm';",""," DDMBase.ATTRS = {"," /**"," * @attribute dragCursor"," * @description The cursor to apply when dragging, if shimmed the shim will get the cursor."," * @type String"," */"," dragCursor: {"," value: 'move'"," },"," /**"," * @attribute clickPixelThresh"," * @description The number of pixels to move to start a drag operation, default is 3."," * @type Number"," */"," clickPixelThresh: {"," value: 3"," },"," /**"," * @attribute clickTimeThresh"," * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000."," * @type Number"," */ "," clickTimeThresh: {"," value: 1000"," },"," /**"," * @attribute throttleTime"," * @description The number of milliseconds to throttle the mousemove event. Default: 150"," * @type Number"," */ "," throttleTime: {"," //value: 150"," value: -1"," },"," /**"," * @attribute dragMode"," * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances. "," * @type String"," */ "," dragMode: {"," value: 'point',"," setter: function(mode) {"," this._setDragMode(mode);"," return mode;"," } "," }",""," };",""," Y.extend(DDMBase, Y.Base, {"," _createPG: function() {},"," /**"," * @property _active"," * @description flag set when we activate our first drag, so DDM can start listening for events."," * @type {Boolean}"," */"," _active: null,"," /**"," * @private"," * @method _setDragMode"," * @description Handler for dragMode attribute setter."," * @param String/Number The Number value or the String for the DragMode to default all future drag instances to."," * @return Number The Mode to be set"," */"," _setDragMode: function(mode) {"," if (mode === null) {"," mode = Y.DD.DDM.get('dragMode');"," }"," switch (mode) {"," case 1:"," case 'intersect':"," return 1;"," case 2:"," case 'strict':"," return 2;"," case 0:"," case 'point':"," return 0;"," }"," return 0; "," },"," /**"," * @property CSS_PREFIX"," * @description The PREFIX to attach to all DD CSS class names"," * @type {String}"," */"," CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),"," _activateTargets: function() {}, "," /**"," * @private"," * @property _drags"," * @description Holder for all registered drag elements."," * @type {Array}"," */"," _drags: [],"," /**"," * @property activeDrag"," * @description A reference to the currently active draggable object."," * @type {Drag}"," */"," activeDrag: false,"," /**"," * @private"," * @method _regDrag"," * @description Adds a reference to the drag object to the DDM._drags array, called in the constructor of Drag."," * @param {Drag} d The Drag object"," */"," _regDrag: function(d) {"," if (this.getDrag(d.get('node'))) {"," return false;"," }"," "," if (!this._active) {"," this._setupListeners();"," }"," this._drags.push(d);"," return true;"," },"," /**"," * @private"," * @method _unregDrag"," * @description Remove this drag object from the DDM._drags array."," * @param {Drag} d The drag object."," */"," _unregDrag: function(d) {"," var tmp = [];"," Y.each(this._drags, function(n, i) {"," if (n !== d) {"," tmp[tmp.length] = n;"," }"," });"," this._drags = tmp;"," },"," /**"," * @private"," * @method _setupListeners"," * @description Add the document listeners."," */"," _setupListeners: function() {"," this._createPG();"," this._active = true;",""," var doc = Y.one(Y.config.doc);"," doc.on('mousemove', Y.throttle(Y.bind(this._docMove, this), this.get('throttleTime')));"," doc.on('mouseup', Y.bind(this._end, this));"," },"," /**"," * @private"," * @method _start"," * @description Internal method used by Drag to signal the start of a drag operation"," */"," _start: function() {"," this.fire('ddm:start');"," this._startDrag();"," },"," /**"," * @private"," * @method _startDrag"," * @description Factory method to be overwritten by other DDM's"," * @param {Number} x The x position of the drag element"," * @param {Number} y The y position of the drag element"," * @param {Number} w The width of the drag element"," * @param {Number} h The height of the drag element"," */"," _startDrag: function() {},"," /**"," * @private"," * @method _endDrag"," * @description Factory method to be overwritten by other DDM's"," */"," _endDrag: function() {},"," _dropMove: function() {},"," /**"," * @private"," * @method _end"," * @description Internal method used by Drag to signal the end of a drag operation"," */"," _end: function() {"," if (this.activeDrag) {"," this._shimming = false;"," this._endDrag();"," this.fire('ddm:end');"," this.activeDrag.end.call(this.activeDrag);"," this.activeDrag = null;"," }"," },"," /**"," * @method stopDrag"," * @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag."," * @return {Self}"," * @chainable"," */ "," stopDrag: function() {"," if (this.activeDrag) {"," this._end();"," }"," return this;"," },"," /**"," * @private"," * @property _shimming"," * @description Set to true when drag starts and useShim is true. Used in pairing with _docMove"," * @see _docMove"," * @type {Boolean}"," */"," _shimming: false,"," /**"," * @private"," * @method _docMove"," * @description Internal listener for the mousemove on Document. Checks if the shim is in place to only call _move once per mouse move"," * @param {Event.Facade} ev The Dom mousemove Event"," */"," _docMove: function(ev) {"," if (!this._shimming) {"," this._move(ev);"," }"," },"," /**"," * @private"," * @method _move"," * @description Internal listener for the mousemove DOM event to pass to the Drag's move method."," * @param {Event.Facade} ev The Dom mousemove Event"," */"," _move: function(ev) {"," if (this.activeDrag) {"," this.activeDrag._move.call(this.activeDrag, ev);"," this._dropMove();"," }"," },"," /**"," * //TODO Private, rename??..."," * @private"," * @method cssSizestoObject"," * @description Helper method to use to set the gutter from the attribute setter."," * @param {String} gutter CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)"," * @return {Object} The gutter Object Literal."," */"," cssSizestoObject: function(gutter) {"," var x = gutter.split(' ');"," "," switch (x.length) {"," case 1: x[1] = x[2] = x[3] = x[0]; break;"," case 2: x[2] = x[0]; x[3] = x[1]; break;"," case 3: x[3] = x[1]; break;"," }",""," return {"," top : parseInt(x[0],10),"," right : parseInt(x[1],10),"," bottom: parseInt(x[2],10),"," left : parseInt(x[3],10)"," };"," },"," /**"," * @method getDrag"," * @description Get a valid Drag instance back from a Node or a selector string, false otherwise"," * @param {String/Object} node The Node instance or Selector string to check for a valid Drag Object"," * @return {Object}"," */"," getDrag: function(node) {"," var drag = false,"," n = Y.one(node);"," if (n instanceof Y.Node) {"," Y.each(this._drags, function(v, k) {"," if (n.compareTo(v.get('node'))) {"," drag = v;"," }"," });"," }"," return drag;"," },"," /**"," * @method swapPosition"," * @description Swap the position of 2 nodes based on their CSS positioning."," * @param {Node} n1 The first node to swap"," * @param {Node} n2 The first node to swap"," * @return {Node}"," */"," swapPosition: function(n1, n2) {"," n1 = Y.DD.DDM.getNode(n1);"," n2 = Y.DD.DDM.getNode(n2);"," var xy1 = n1.getXY(),"," xy2 = n2.getXY();",""," n1.setXY(xy2);"," n2.setXY(xy1);"," return n1;"," },"," /**"," * @method getNode"," * @description Return a node instance from the given node, selector string or Y.Base extended object."," * @param {Node/Object/String} n The node to resolve."," * @return {Node}"," */"," getNode: function(n) {"," if (n instanceof Y.Node) {"," return n;"," }"," if (n && n.get) {"," if (Y.Widget && (n instanceof Y.Widget)) {"," n = n.get('boundingBox');"," } else {"," n = n.get('node');"," }"," } else {"," n = Y.one(n);"," }"," return n;"," },"," /**"," * @method swapNode"," * @description Swap the position of 2 nodes based on their DOM location."," * @param {Node} n1 The first node to swap"," * @param {Node} n2 The first node to swap"," * @return {Node}"," */"," swapNode: function(n1, n2) {"," n1 = Y.DD.DDM.getNode(n1);"," n2 = Y.DD.DDM.getNode(n2);"," var p = n2.get('parentNode'),"," s = n2.get('nextSibling');",""," if (s == n1) {"," p.insertBefore(n1, n2);"," } else if (n2 == n1.get('nextSibling')) {"," p.insertBefore(n2, n1);"," } else {"," n1.get('parentNode').replaceChild(n2, n1);"," p.insertBefore(n1, s);"," }"," return n1;"," }"," });",""," Y.namespace('DD');"," Y.DD.DDM = new DDMBase();",""," /**"," * @event ddm:start"," * @description Fires from the DDM before all drag events fire."," * @type {CustomEvent}"," */"," /**"," * @event ddm:end"," * @description Fires from the DDM after the DDM finishes, before the drag end events."," * @type {CustomEvent}"," */","","","","","}, '@VERSION@', {\"requires\": [\"node\", \"base\", \"yui-throttle\", \"classnamemanager\"]});"];
-_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].lines = {"1":0,"17":0,"18":0,"21":0,"23":0,"65":0,"66":0,"72":0,"88":0,"89":0,"91":0,"94":0,"97":0,"100":0,"102":0,"131":0,"132":0,"135":0,"136":0,"138":0,"139":0,"148":0,"149":0,"150":0,"151":0,"154":0,"162":0,"163":0,"165":0,"166":0,"167":0,"175":0,"176":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"216":0,"217":0,"219":0,"236":0,"237":0,"247":0,"248":0,"249":0,"261":0,"263":0,"264":0,"265":0,"266":0,"269":0,"283":0,"285":0,"286":0,"287":0,"288":0,"292":0,"302":0,"303":0,"304":0,"307":0,"308":0,"309":0,"318":0,"319":0,"321":0,"322":0,"323":0,"325":0,"328":0,"330":0,"340":0,"341":0,"342":0,"345":0,"346":0,"347":0,"348":0,"350":0,"351":0,"353":0,"357":0,"358":0};
-_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].functions = {"DDMBase:17":0,"setter:64":0,"_setDragMode:87":0,"_regDrag:130":0,"(anonymous 2):149":0,"_unregDrag:147":0,"_setupListeners:161":0,"_start:174":0,"_end:200":0,"stopDrag:215":0,"_docMove:235":0,"_move:246":0,"cssSizestoObject:260":0,"(anonymous 3):286":0,"getDrag:282":0,"swapPosition:301":0,"getNode:317":0,"swapNode:339":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].code=["YUI.add('dd-ddm-base', function (Y, NAME) {","",""," /**"," * Provides the base Drag Drop Manger required for making a Node draggable."," * @module dd"," * @submodule dd-ddm-base"," */"," /**"," * Provides the base Drag Drop Manger required for making a Node draggable."," * @class DDM"," * @extends Base"," * @constructor"," * @namespace DD"," */",""," var DDMBase = function() {"," DDMBase.superclass.constructor.apply(this, arguments);"," };",""," DDMBase.NAME = 'ddm';",""," DDMBase.ATTRS = {"," /**"," * @attribute dragCursor"," * @description The cursor to apply when dragging, if shimmed the shim will get the cursor."," * @type String"," */"," dragCursor: {"," value: 'move'"," },"," /**"," * @attribute clickPixelThresh"," * @description The number of pixels to move to start a drag operation, default is 3."," * @type Number"," */"," clickPixelThresh: {"," value: 3"," },"," /**"," * @attribute clickTimeThresh"," * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000."," * @type Number"," */"," clickTimeThresh: {"," value: 1000"," },"," /**"," * @attribute throttleTime"," * @description The number of milliseconds to throttle the mousemove event. Default: 150"," * @type Number"," */"," throttleTime: {"," //value: 150"," value: -1"," },"," /**"," * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances."," * @attribute dragMode"," * @type String"," */"," dragMode: {"," value: 'point',"," setter: function(mode) {"," this._setDragMode(mode);"," return mode;"," }"," }",""," };",""," Y.extend(DDMBase, Y.Base, {"," _createPG: function() {},"," /**"," * @property _active"," * @description flag set when we activate our first drag, so DDM can start listening for events."," * @type {Boolean}"," */"," _active: null,"," /**"," * @private"," * @method _setDragMode"," * @description Handler for dragMode attribute setter."," * @param String/Number The Number value or the String for the DragMode to default all future drag instances to."," * @return Number The Mode to be set"," */"," _setDragMode: function(mode) {"," if (mode === null) {"," mode = Y.DD.DDM.get('dragMode');"," }"," switch (mode) {"," case 1:"," case 'intersect':"," return 1;"," case 2:"," case 'strict':"," return 2;"," case 0:"," case 'point':"," return 0;"," }"," return 0;"," },"," /**"," * @property CSS_PREFIX"," * @description The PREFIX to attach to all DD CSS class names"," * @type {String}"," */"," CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),"," _activateTargets: function() {},"," /**"," * @private"," * @property _drags"," * @description Holder for all registered drag elements."," * @type {Array}"," */"," _drags: [],"," /**"," * @property activeDrag"," * @description A reference to the currently active draggable object."," * @type {Drag}"," */"," activeDrag: false,"," /**"," * @private"," * @method _regDrag"," * @description Adds a reference to the drag object to the DDM._drags array, called in the constructor of Drag."," * @param {Drag} d The Drag object"," */"," _regDrag: function(d) {"," if (this.getDrag(d.get('node'))) {"," return false;"," }",""," if (!this._active) {"," this._setupListeners();"," }"," this._drags.push(d);"," return true;"," },"," /**"," * @private"," * @method _unregDrag"," * @description Remove this drag object from the DDM._drags array."," * @param {Drag} d The drag object."," */"," _unregDrag: function(d) {"," var tmp = [];"," Y.each(this._drags, function(n) {"," if (n !== d) {"," tmp[tmp.length] = n;"," }"," });"," this._drags = tmp;"," },"," /**"," * @private"," * @method _setupListeners"," * @description Add the document listeners."," */"," _setupListeners: function() {"," this._createPG();"," this._active = true;",""," var doc = Y.one(Y.config.doc);"," doc.on('mousemove', Y.throttle(Y.bind(this._docMove, this), this.get('throttleTime')));"," doc.on('mouseup', Y.bind(this._end, this));"," },"," /**"," * @private"," * @method _start"," * @description Internal method used by Drag to signal the start of a drag operation"," */"," _start: function() {"," this.fire('ddm:start');"," this._startDrag();"," },"," /**"," * @private"," * @method _startDrag"," * @description Factory method to be overwritten by other DDM's"," * @param {Number} x The x position of the drag element"," * @param {Number} y The y position of the drag element"," * @param {Number} w The width of the drag element"," * @param {Number} h The height of the drag element"," */"," _startDrag: function() {},"," /**"," * @private"," * @method _endDrag"," * @description Factory method to be overwritten by other DDM's"," */"," _endDrag: function() {},"," _dropMove: function() {},"," /**"," * @private"," * @method _end"," * @description Internal method used by Drag to signal the end of a drag operation"," */"," _end: function() {"," if (this.activeDrag) {"," this._shimming = false;"," this._endDrag();"," this.fire('ddm:end');"," this.activeDrag.end.call(this.activeDrag);"," this.activeDrag = null;"," }"," },"," /**"," * @method stopDrag"," * @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag."," * @return {Self}"," * @chainable"," */"," stopDrag: function() {"," if (this.activeDrag) {"," this._end();"," }"," return this;"," },"," /**"," * @private"," * @property _shimming"," * @description Set to true when drag starts and useShim is true. Used in pairing with _docMove"," * @see _docMove"," * @type {Boolean}"," */"," _shimming: false,"," /**"," * @private"," * @method _docMove"," * @description Internal listener for the mousemove on Document. Checks if the shim is in place to only call _move once per mouse move"," * @param {Event.Facade} ev The Dom mousemove Event"," */"," _docMove: function(ev) {"," if (!this._shimming) {"," this._move(ev);"," }"," },"," /**"," * @private"," * @method _move"," * @description Internal listener for the mousemove DOM event to pass to the Drag's move method."," * @param {Event.Facade} ev The Dom mousemove Event"," */"," _move: function(ev) {"," if (this.activeDrag) {"," this.activeDrag._move.call(this.activeDrag, ev);"," this._dropMove();"," }"," },"," /**"," * //TODO Private, rename??..."," * Helper method to use to set the gutter from the attribute setter."," * CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)"," * @private"," * @method cssSizestoObject"," * @param {String} gutter CSS style string for gutter"," * @return {Object} The gutter Object Literal."," */"," cssSizestoObject: function(gutter) {"," var x = gutter.split(' ');",""," switch (x.length) {"," case 1: x[1] = x[2] = x[3] = x[0]; break;"," case 2: x[2] = x[0]; x[3] = x[1]; break;"," case 3: x[3] = x[1]; break;"," }",""," return {"," top : parseInt(x[0],10),"," right : parseInt(x[1],10),"," bottom: parseInt(x[2],10),"," left : parseInt(x[3],10)"," };"," },"," /**"," * @method getDrag"," * @description Get a valid Drag instance back from a Node or a selector string, false otherwise"," * @param {String/Object} node The Node instance or Selector string to check for a valid Drag Object"," * @return {Object}"," */"," getDrag: function(node) {"," var drag = false,"," n = Y.one(node);"," if (n instanceof Y.Node) {"," Y.each(this._drags, function(v) {"," if (n.compareTo(v.get('node'))) {"," drag = v;"," }"," });"," }"," return drag;"," },"," /**"," * @method swapPosition"," * @description Swap the position of 2 nodes based on their CSS positioning."," * @param {Node} n1 The first node to swap"," * @param {Node} n2 The first node to swap"," * @return {Node}"," */"," swapPosition: function(n1, n2) {"," n1 = Y.DD.DDM.getNode(n1);"," n2 = Y.DD.DDM.getNode(n2);"," var xy1 = n1.getXY(),"," xy2 = n2.getXY();",""," n1.setXY(xy2);"," n2.setXY(xy1);"," return n1;"," },"," /**"," * @method getNode"," * @description Return a node instance from the given node, selector string or Y.Base extended object."," * @param {Node/Object/String} n The node to resolve."," * @return {Node}"," */"," getNode: function(n) {"," if (n instanceof Y.Node) {"," return n;"," }"," if (n && n.get) {"," if (Y.Widget && (n instanceof Y.Widget)) {"," n = n.get('boundingBox');"," } else {"," n = n.get('node');"," }"," } else {"," n = Y.one(n);"," }"," return n;"," },"," /**"," * @method swapNode"," * @description Swap the position of 2 nodes based on their DOM location."," * @param {Node} n1 The first node to swap"," * @param {Node} n2 The first node to swap"," * @return {Node}"," */"," swapNode: function(n1, n2) {"," n1 = Y.DD.DDM.getNode(n1);"," n2 = Y.DD.DDM.getNode(n2);"," var p = n2.get('parentNode'),"," s = n2.get('nextSibling');",""," if (s === n1) {"," p.insertBefore(n1, n2);"," } else if (n2 === n1.get('nextSibling')) {"," p.insertBefore(n2, n1);"," } else {"," n1.get('parentNode').replaceChild(n2, n1);"," p.insertBefore(n1, s);"," }"," return n1;"," }"," });",""," Y.namespace('DD');"," Y.DD.DDM = new DDMBase();",""," /**"," * @event ddm:start"," * @description Fires from the DDM before all drag events fire."," * @type {CustomEvent}"," */"," /**"," * @event ddm:end"," * @description Fires from the DDM after the DDM finishes, before the drag end events."," * @type {CustomEvent}"," */","","","","","}, '@VERSION@', {\"requires\": [\"node\", \"base\", \"yui-throttle\", \"classnamemanager\"]});"];
+_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].lines = {"1":0,"17":0,"18":0,"21":0,"23":0,"65":0,"66":0,"72":0,"88":0,"89":0,"91":0,"94":0,"97":0,"100":0,"102":0,"131":0,"132":0,"135":0,"136":0,"138":0,"139":0,"148":0,"149":0,"150":0,"151":0,"154":0,"162":0,"163":0,"165":0,"166":0,"167":0,"175":0,"176":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"216":0,"217":0,"219":0,"236":0,"237":0,"247":0,"248":0,"249":0,"262":0,"264":0,"265":0,"266":0,"267":0,"270":0,"284":0,"286":0,"287":0,"288":0,"289":0,"293":0,"303":0,"304":0,"305":0,"308":0,"309":0,"310":0,"319":0,"320":0,"322":0,"323":0,"324":0,"326":0,"329":0,"331":0,"341":0,"342":0,"343":0,"346":0,"347":0,"348":0,"349":0,"351":0,"352":0,"354":0,"358":0,"359":0};
+_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].functions = {"DDMBase:17":0,"setter:64":0,"_setDragMode:87":0,"_regDrag:130":0,"(anonymous 2):149":0,"_unregDrag:147":0,"_setupListeners:161":0,"_start:174":0,"_end:200":0,"stopDrag:215":0,"_docMove:235":0,"_move:246":0,"cssSizestoObject:261":0,"(anonymous 3):287":0,"getDrag:283":0,"swapPosition:302":0,"getNode:318":0,"swapNode:340":0,"(anonymous 1):1":0};
_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].coveredLines = 85;
_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].coveredFunctions = 19;
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 1);
@@ -39,7 +39,7 @@ YUI.add('dd-ddm-base', function (Y, NAME) {
* Provides the base Drag Drop Manger required for making a Node draggable.
* @module dd
* @submodule dd-ddm-base
- */
+ */
/**
* Provides the base Drag Drop Manger required for making a Node draggable.
* @class DDM
@@ -47,7 +47,7 @@ YUI.add('dd-ddm-base', function (Y, NAME) {
* @constructor
* @namespace DD
*/
-
+
_yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "(anonymous 1)", 1);
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 17);
var DDMBase = function() {
@@ -81,7 +81,7 @@ DDMBase.ATTRS = {
* @attribute clickTimeThresh
* @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000.
* @type Number
- */
+ */
clickTimeThresh: {
value: 1000
},
@@ -89,16 +89,16 @@ DDMBase.ATTRS = {
* @attribute throttleTime
* @description The number of milliseconds to throttle the mousemove event. Default: 150
* @type Number
- */
+ */
throttleTime: {
//value: 150
value: -1
},
/**
+ * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances.
* @attribute dragMode
- * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances.
* @type String
- */
+ */
dragMode: {
value: 'point',
setter: function(mode) {
@@ -107,7 +107,7 @@ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 65);
this._setDragMode(mode);
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 66);
return mode;
- }
+ }
}
};
@@ -151,7 +151,7 @@ return 2;
return 0;
}
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 102);
-return 0;
+return 0;
},
/**
* @property CSS_PREFIX
@@ -159,7 +159,7 @@ return 0;
* @type {String}
*/
CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),
- _activateTargets: function() {},
+ _activateTargets: function() {},
/**
* @private
* @property _drags
@@ -186,7 +186,7 @@ if (this.getDrag(d.get('node'))) {
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 132);
return false;
}
-
+
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 135);
if (!this._active) {
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 136);
@@ -208,7 +208,7 @@ return true;
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 148);
var tmp = [];
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 149);
-Y.each(this._drags, function(n, i) {
+Y.each(this._drags, function(n) {
_yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "(anonymous 2)", 149);
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 150);
if (n !== d) {
@@ -293,7 +293,7 @@ this.activeDrag = null;
* @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag.
* @return {Self}
* @chainable
- */
+ */
stopDrag: function() {
_yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "stopDrag", 215);
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 216);
@@ -344,28 +344,29 @@ this._dropMove();
},
/**
* //TODO Private, rename??...
+ * Helper method to use to set the gutter from the attribute setter.
+ * CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)
* @private
* @method cssSizestoObject
- * @description Helper method to use to set the gutter from the attribute setter.
- * @param {String} gutter CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)
+ * @param {String} gutter CSS style string for gutter
* @return {Object} The gutter Object Literal.
*/
cssSizestoObject: function(gutter) {
- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "cssSizestoObject", 260);
-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 261);
+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "cssSizestoObject", 261);
+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 262);
var x = gutter.split(' ');
-
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 263);
+
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 264);
switch (x.length) {
- case 1: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 264);
+ case 1: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 265);
x[1] = x[2] = x[3] = x[0]; break;
- case 2: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 265);
+ case 2: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 266);
x[2] = x[0]; x[3] = x[1]; break;
- case 3: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 266);
+ case 3: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 267);
x[3] = x[1]; break;
}
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 269);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 270);
return {
top : parseInt(x[0],10),
right : parseInt(x[1],10),
@@ -380,23 +381,23 @@ return {
* @return {Object}
*/
getDrag: function(node) {
- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "getDrag", 282);
-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 283);
+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "getDrag", 283);
+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 284);
var drag = false,
n = Y.one(node);
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 285);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 286);
if (n instanceof Y.Node) {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 286);
-Y.each(this._drags, function(v, k) {
- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "(anonymous 3)", 286);
-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 287);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 287);
+Y.each(this._drags, function(v) {
+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "(anonymous 3)", 287);
+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 288);
if (n.compareTo(v.get('node'))) {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 288);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 289);
drag = v;
}
});
}
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 292);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 293);
return drag;
},
/**
@@ -407,20 +408,20 @@ return drag;
* @return {Node}
*/
swapPosition: function(n1, n2) {
- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "swapPosition", 301);
-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 302);
+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "swapPosition", 302);
+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 303);
n1 = Y.DD.DDM.getNode(n1);
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 303);
-n2 = Y.DD.DDM.getNode(n2);
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 304);
+n2 = Y.DD.DDM.getNode(n2);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 305);
var xy1 = n1.getXY(),
xy2 = n2.getXY();
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 307);
-n1.setXY(xy2);
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 308);
-n2.setXY(xy1);
+n1.setXY(xy2);
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 309);
+n2.setXY(xy1);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 310);
return n1;
},
/**
@@ -430,27 +431,27 @@ return n1;
* @return {Node}
*/
getNode: function(n) {
- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "getNode", 317);
-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 318);
+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "getNode", 318);
+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 319);
if (n instanceof Y.Node) {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 319);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 320);
return n;
}
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 321);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 322);
if (n && n.get) {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 322);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 323);
if (Y.Widget && (n instanceof Y.Widget)) {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 323);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 324);
n = n.get('boundingBox');
} else {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 325);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 326);
n = n.get('node');
}
} else {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 328);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 329);
n = Y.one(n);
}
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 330);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 331);
return n;
},
/**
@@ -461,37 +462,37 @@ return n;
* @return {Node}
*/
swapNode: function(n1, n2) {
- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "swapNode", 339);
-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 340);
+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "swapNode", 340);
+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 341);
n1 = Y.DD.DDM.getNode(n1);
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 341);
-n2 = Y.DD.DDM.getNode(n2);
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 342);
+n2 = Y.DD.DDM.getNode(n2);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 343);
var p = n2.get('parentNode'),
s = n2.get('nextSibling');
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 345);
-if (s == n1) {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 346);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 346);
+if (s === n1) {
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 347);
p.insertBefore(n1, n2);
- } else {_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 347);
-if (n2 == n1.get('nextSibling')) {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 348);
+ } else {_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 348);
+if (n2 === n1.get('nextSibling')) {
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 349);
p.insertBefore(n2, n1);
} else {
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 350);
-n1.get('parentNode').replaceChild(n2, n1);
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 351);
+n1.get('parentNode').replaceChild(n2, n1);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 352);
p.insertBefore(n1, s);
}}
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 353);
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 354);
return n1;
}
});
- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 357);
-Y.namespace('DD');
_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 358);
+Y.namespace('DD');
+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 359);
Y.DD.DDM = new DDMBase();
/**
View
37 build/dd-ddm-base/dd-ddm-base-debug.js
@@ -5,7 +5,7 @@ YUI.add('dd-ddm-base', function (Y, NAME) {
* Provides the base Drag Drop Manger required for making a Node draggable.
* @module dd
* @submodule dd-ddm-base
- */
+ */
/**
* Provides the base Drag Drop Manger required for making a Node draggable.
* @class DDM
@@ -13,7 +13,7 @@ YUI.add('dd-ddm-base', function (Y, NAME) {
* @constructor
* @namespace DD
*/
-
+
var DDMBase = function() {
DDMBase.superclass.constructor.apply(this, arguments);
};
@@ -41,7 +41,7 @@ YUI.add('dd-ddm-base', function (Y, NAME) {
* @attribute clickTimeThresh
* @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000.
* @type Number
- */
+ */
clickTimeThresh: {
value: 1000
},
@@ -49,22 +49,22 @@ YUI.add('dd-ddm-base', function (Y, NAME) {
* @attribute throttleTime
* @description The number of milliseconds to throttle the mousemove event. Default: 150
* @type Number
- */
+ */
throttleTime: {
//value: 150
value: -1
},
/**
+ * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances.
* @attribute dragMode
- * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances.
* @type String
- */
+ */
dragMode: {
value: 'point',
setter: function(mode) {
this._setDragMode(mode);
return mode;
- }
+ }
}
};
@@ -99,7 +99,7 @@ YUI.add('dd-ddm-base', function (Y, NAME) {
case 'point':
return 0;
}
- return 0;
+ return 0;
},
/**
* @property CSS_PREFIX
@@ -107,7 +107,7 @@ YUI.add('dd-ddm-base', function (Y, NAME) {
* @type {String}
*/
CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),
- _activateTargets: function() {},
+ _activateTargets: function() {},
/**
* @private
* @property _drags
@@ -131,7 +131,7 @@ YUI.add('dd-ddm-base', function (Y, NAME) {
if (th