a:17:{s:9:"#provides";s:5:"dijit";s:9:"#resource";s:14:"_base/place.js";s:9:"#requires";a:1:{i:0;a:3:{i:0;s:6:"common";i:1;s:20:"dojo.AdapterRegistry";i:2;s:4:"dojo";}}s:17:"dijit.getViewport";a:3:{s:4:"type";s:8:"Function";s:6:"source";s:289:" var scrollRoot = (dojo.doc.compatMode == 'BackCompat')? dojo.body() : dojo.doc.documentElement; // get scroll position var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y };";s:7:"summary";s:83:"Returns the dimensions and scroll position of the viewable area of a browser window";}s:16:"dijit.__Position";a:5:{s:4:"type";s:8:"Function";s:6:"source";s:763:"dojo.provide("dijit._base.place"); dojo.require("dojo.AdapterRegistry"); // ported from dojo.html.util dijit.getViewport = function(){ // summary: // Returns the dimensions and scroll position of the viewable area of a browser window var scrollRoot = (dojo.doc.compatMode == 'BackCompat')? dojo.body() : dojo.doc.documentElement; // get scroll position var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y }; }; dijit.__Position = function(){ // x: Integer // horizontal coordinate in pixels, relative to document body // y: Integer // vertical coordinate in pixels, relative to document body thix.x = x; this.y = y;";s:7:"private";b:1;s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:18:"dijit.__Position.y";a:3:{s:8:"instance";s:16:"dijit.__Position";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:19:"dijit.placeOnScreen";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:4:{s:4:"node";a:1:{s:4:"type";s:7:"DomNode";}s:3:"pos";a:2:{s:4:"type";s:16:"dijit.__Position";s:7:"summary";s:26:"Object like {x: 10, y: 20}";}s:7:"corners";a:2:{s:4:"type";s:8:"String[]";s:7:"summary";s:234:"Array of Strings representing order to try corners in, like ["TR", "BL"]. Possible values are: * "BL" - bottom left * "BR" - bottom right * "TL" - top left * "TR" - top right";}s:7:"padding";a:3:{s:8:"optional";b:1;s:4:"type";s:16:"dijit.__Position";s:7:"summary";s:71:"set padding to put some buffer around the element you want to position.";}}s:6:"source";s:308:" var choices = dojo.map(corners, function(corner){ var c = { corner: corner, pos: {x:pos.x,y:pos.y} }; if(padding){ c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x; c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y; } return c; }); return dijit._place(node, choices);";s:7:"summary";s:102:"Positions one of the node's corners at specified position such that node is fully visible in viewport.";s:11:"description";s:64:"NOTE: node is assumed to be absolutely or relatively positioned.";s:8:"examples";a:1:{i:0;s:194:"Try to place node's top right corner at (10,20). If that makes node go (partially) off screen, then try placing bottom left corner at (10,20). placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"])";}}s:12:"dijit._place";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:4:"node";a:1:{s:4:"type";s:7:"DomNode";}s:7:"choices";a:2:{s:4:"type";s:5:"Array";s:7:"summary";s:129:"Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} } Above example says to put the top-left corner of the node at (10,20)";}s:10:"layoutNode";a:1:{s:4:"type";s:8:"Function";}}s:6:"source";s:4769:"dojo.provide("dijit._base.place"); dojo.require("dojo.AdapterRegistry"); // ported from dojo.html.util dijit.getViewport = function(){ // summary: // Returns the dimensions and scroll position of the viewable area of a browser window var scrollRoot = (dojo.doc.compatMode == 'BackCompat')? dojo.body() : dojo.doc.documentElement; // get scroll position var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y }; }; dijit.__Position = function(){ // x: Integer // horizontal coordinate in pixels, relative to document body // y: Integer // vertical coordinate in pixels, relative to document body thix.x = x; this.y = y; } dijit.placeOnScreen = function( /* DomNode */ node, /* dijit.__Position */ pos, /* String[] */ corners, /* dijit.__Position? */ padding){ // summary: // Positions one of the node's corners at specified position // such that node is fully visible in viewport. // description: // NOTE: node is assumed to be absolutely or relatively positioned. // pos: // Object like {x: 10, y: 20} // corners: // Array of Strings representing order to try corners in, like ["TR", "BL"]. // Possible values are: // * "BL" - bottom left // * "BR" - bottom right // * "TL" - top left // * "TR" - top right // padding: // set padding to put some buffer around the element you want to position. // example: // Try to place node's top right corner at (10,20). // If that makes node go (partially) off screen, then try placing // bottom left corner at (10,20). // | placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"]) var choices = dojo.map(corners, function(corner){ var c = { corner: corner, pos: {x:pos.x,y:pos.y} }; if(padding){ c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x; c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y; } return c; }); return dijit._place(node, choices); } dijit._place = function(/*DomNode*/ node, /* Array */ choices, /* Function */ layoutNode){ // summary: // Given a list of spots to put node, put it at the first spot where it fits, // of if it doesn't fit anywhere then the place with the least overflow // choices: Array // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} } // Above example says to put the top-left corner of the node at (10,20) // layoutNode: Function(node, aroundNodeCorner, nodeCorner) // for things like tooltip, they are displayed differently (and have different dimensions) // based on their orientation relative to the parent. This adjusts the popup based on orientation. // get {x: 10, y: 10, w: 100, h:100} type obj representing position of // viewport over document var view = dijit.getViewport(); // This won't work if the node is inside a
, // so reattach it to dojo.doc.body. (Otherwise, the positioning will be wrong // and also it might get cutoff) if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){ dojo.body().appendChild(node); } var best = null; dojo.some(choices, function(choice){ var corner = choice.corner; var pos = choice.pos; // configure node to be displayed in given position relative to button // (need to do this in order to get an accurate size for the node, because // a tooltips size changes based on position, due to triangle) if(layoutNode){ layoutNode(node, choice.aroundCorner, corner); } // get node's size var style = node.style; var oldDisplay = style.display; var oldVis = style.visibility; style.visibility = "hidden"; style.display = ""; var mb = dojo.marginBox(node); style.display = oldDisplay; style.visibility = oldVis; // coordinates and size of node with specified corner placed at pos, // and clipped by viewport var startX = (corner.charAt(1) == 'L' ? pos.x : Math.max(view.l, pos.x - mb.w)), startY = (corner.charAt(0) == 'T' ? pos.y : Math.max(view.t, pos.y - mb.h)), endX = (corner.charAt(1) == 'L' ? Math.min(view.l + view.w, startX + mb.w) : pos.x), endY = (corner.charAt(0) == 'T' ? Math.min(view.t + view.h, startY + mb.h) : pos.y), width = endX - startX, height = endY - startY, overflow = (mb.w - width) + (mb.h - height); if(best == null || overflow < best.overflow){ best = { corner: corner, aroundCorner: choice.aroundCorner, x: startX, y: startY, w: width, h: height, overflow: overflow }; } return !overflow; }); node.style.left = best.x + "px"; node.style.top = best.y + "px"; if(best.overflow && layoutNode){ layoutNode(node, best.aroundCorner, best.corner); } return best;";s:7:"summary";s:143:"Given a list of spots to put node, put it at the first spot where it fits, of if it doesn't fit anywhere then the place with the least overflow";s:7:"private";b:1;}s:29:"dijit.placeOnScreenAroundNode";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:4:{s:4:"node";a:1:{s:4:"type";s:7:"DomNode";}s:10:"aroundNode";a:1:{s:4:"type";s:7:"DomNode";}s:13:"aroundCorners";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:475:"Ordered list of pairs of corners to try matching up. Each pair of corners is represented as a key/value in the hash, where the key corresponds to the aroundNode's corner, and the value corresponds to the node's corner: { aroundNodeCorner1: nodeCorner1, aroundNodeCorner2: nodeCorner2, ...} The following strings are used to represent the four corners: * "BL" - bottom left * "BR" - bottom right * "TL" - top left * "TR" - top right";}s:10:"layoutNode";a:3:{s:8:"optional";b:1;s:4:"type";s:8:"Function";s:7:"summary";s:230:"Function(node, aroundNodeCorner, nodeCorner) For things like tooltip, they are displayed differently (and have different dimensions) based on their orientation relative to the parent. This adjusts the popup based on orientation.";}}s:6:"source";s:7055:"dojo.provide("dijit._base.place"); dojo.require("dojo.AdapterRegistry"); // ported from dojo.html.util dijit.getViewport = function(){ // summary: // Returns the dimensions and scroll position of the viewable area of a browser window var scrollRoot = (dojo.doc.compatMode == 'BackCompat')? dojo.body() : dojo.doc.documentElement; // get scroll position var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y }; }; dijit.__Position = function(){ // x: Integer // horizontal coordinate in pixels, relative to document body // y: Integer // vertical coordinate in pixels, relative to document body thix.x = x; this.y = y; } dijit.placeOnScreen = function( /* DomNode */ node, /* dijit.__Position */ pos, /* String[] */ corners, /* dijit.__Position? */ padding){ // summary: // Positions one of the node's corners at specified position // such that node is fully visible in viewport. // description: // NOTE: node is assumed to be absolutely or relatively positioned. // pos: // Object like {x: 10, y: 20} // corners: // Array of Strings representing order to try corners in, like ["TR", "BL"]. // Possible values are: // * "BL" - bottom left // * "BR" - bottom right // * "TL" - top left // * "TR" - top right // padding: // set padding to put some buffer around the element you want to position. // example: // Try to place node's top right corner at (10,20). // If that makes node go (partially) off screen, then try placing // bottom left corner at (10,20). // | placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"]) var choices = dojo.map(corners, function(corner){ var c = { corner: corner, pos: {x:pos.x,y:pos.y} }; if(padding){ c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x; c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y; } return c; }); return dijit._place(node, choices); } dijit._place = function(/*DomNode*/ node, /* Array */ choices, /* Function */ layoutNode){ // summary: // Given a list of spots to put node, put it at the first spot where it fits, // of if it doesn't fit anywhere then the place with the least overflow // choices: Array // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} } // Above example says to put the top-left corner of the node at (10,20) // layoutNode: Function(node, aroundNodeCorner, nodeCorner) // for things like tooltip, they are displayed differently (and have different dimensions) // based on their orientation relative to the parent. This adjusts the popup based on orientation. // get {x: 10, y: 10, w: 100, h:100} type obj representing position of // viewport over document var view = dijit.getViewport(); // This won't work if the node is inside a
, // so reattach it to dojo.doc.body. (Otherwise, the positioning will be wrong // and also it might get cutoff) if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){ dojo.body().appendChild(node); } var best = null; dojo.some(choices, function(choice){ var corner = choice.corner; var pos = choice.pos; // configure node to be displayed in given position relative to button // (need to do this in order to get an accurate size for the node, because // a tooltips size changes based on position, due to triangle) if(layoutNode){ layoutNode(node, choice.aroundCorner, corner); } // get node's size var style = node.style; var oldDisplay = style.display; var oldVis = style.visibility; style.visibility = "hidden"; style.display = ""; var mb = dojo.marginBox(node); style.display = oldDisplay; style.visibility = oldVis; // coordinates and size of node with specified corner placed at pos, // and clipped by viewport var startX = (corner.charAt(1) == 'L' ? pos.x : Math.max(view.l, pos.x - mb.w)), startY = (corner.charAt(0) == 'T' ? pos.y : Math.max(view.t, pos.y - mb.h)), endX = (corner.charAt(1) == 'L' ? Math.min(view.l + view.w, startX + mb.w) : pos.x), endY = (corner.charAt(0) == 'T' ? Math.min(view.t + view.h, startY + mb.h) : pos.y), width = endX - startX, height = endY - startY, overflow = (mb.w - width) + (mb.h - height); if(best == null || overflow < best.overflow){ best = { corner: corner, aroundCorner: choice.aroundCorner, x: startX, y: startY, w: width, h: height, overflow: overflow }; } return !overflow; }); node.style.left = best.x + "px"; node.style.top = best.y + "px"; if(best.overflow && layoutNode){ layoutNode(node, best.aroundCorner, best.corner); } return best; } dijit.placeOnScreenAroundNode = function( /* DomNode */ node, /* DomNode */ aroundNode, /* Object */ aroundCorners, /* Function? */ layoutNode){ // summary: // Position node adjacent or kitty-corner to aroundNode // such that it's fully visible in viewport. // // description: // Place node such that corner of node touches a corner of // aroundNode, and that node is fully visible. // // aroundCorners: // Ordered list of pairs of corners to try matching up. // Each pair of corners is represented as a key/value in the hash, // where the key corresponds to the aroundNode's corner, and // the value corresponds to the node's corner: // // | { aroundNodeCorner1: nodeCorner1, aroundNodeCorner2: nodeCorner2, ...} // // The following strings are used to represent the four corners: // * "BL" - bottom left // * "BR" - bottom right // * "TL" - top left // * "TR" - top right // // layoutNode: Function(node, aroundNodeCorner, nodeCorner) // For things like tooltip, they are displayed differently (and have different dimensions) // based on their orientation relative to the parent. This adjusts the popup based on orientation. // // example: // | dijit.placeOnScreenAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'}); // This will try to position node such that node's top-left corner is at the same position // as the bottom left corner of the aroundNode (ie, put node below // aroundNode, with left edges aligned). If that fails it will try to put // the bottom-right corner of node where the top right corner of aroundNode is // (ie, put node above aroundNode, with right edges aligned) // // get coordinates of aroundNode aroundNode = dojo.byId(aroundNode); var oldDisplay = aroundNode.style.display; aroundNode.style.display=""; // #3172: use the slightly tighter border box instead of marginBox var aroundNodeW = aroundNode.offsetWidth; //mb.w; var aroundNodeH = aroundNode.offsetHeight; //mb.h; var aroundNodePos = dojo.coords(aroundNode, true); aroundNode.style.display=oldDisplay; // place the node around the calculated rectangle return dijit._placeOnScreenAroundRect(node, aroundNodePos.x, aroundNodePos.y, aroundNodeW, aroundNodeH, // rectangle aroundCorners, layoutNode);";s:7:"summary";s:94:"Position node adjacent or kitty-corner to aroundNode such that it's fully visible in viewport.";s:11:"description";s:99:"Place node such that corner of node touches a corner of aroundNode, and that node is fully visible.";}s:17:"dijit.__Rectangle";a:5:{s:4:"type";s:8:"Function";s:6:"source";s:7403:"dojo.provide("dijit._base.place"); dojo.require("dojo.AdapterRegistry"); // ported from dojo.html.util dijit.getViewport = function(){ // summary: // Returns the dimensions and scroll position of the viewable area of a browser window var scrollRoot = (dojo.doc.compatMode == 'BackCompat')? dojo.body() : dojo.doc.documentElement; // get scroll position var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y }; }; dijit.__Position = function(){ // x: Integer // horizontal coordinate in pixels, relative to document body // y: Integer // vertical coordinate in pixels, relative to document body thix.x = x; this.y = y; } dijit.placeOnScreen = function( /* DomNode */ node, /* dijit.__Position */ pos, /* String[] */ corners, /* dijit.__Position? */ padding){ // summary: // Positions one of the node's corners at specified position // such that node is fully visible in viewport. // description: // NOTE: node is assumed to be absolutely or relatively positioned. // pos: // Object like {x: 10, y: 20} // corners: // Array of Strings representing order to try corners in, like ["TR", "BL"]. // Possible values are: // * "BL" - bottom left // * "BR" - bottom right // * "TL" - top left // * "TR" - top right // padding: // set padding to put some buffer around the element you want to position. // example: // Try to place node's top right corner at (10,20). // If that makes node go (partially) off screen, then try placing // bottom left corner at (10,20). // | placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"]) var choices = dojo.map(corners, function(corner){ var c = { corner: corner, pos: {x:pos.x,y:pos.y} }; if(padding){ c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x; c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y; } return c; }); return dijit._place(node, choices); } dijit._place = function(/*DomNode*/ node, /* Array */ choices, /* Function */ layoutNode){ // summary: // Given a list of spots to put node, put it at the first spot where it fits, // of if it doesn't fit anywhere then the place with the least overflow // choices: Array // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} } // Above example says to put the top-left corner of the node at (10,20) // layoutNode: Function(node, aroundNodeCorner, nodeCorner) // for things like tooltip, they are displayed differently (and have different dimensions) // based on their orientation relative to the parent. This adjusts the popup based on orientation. // get {x: 10, y: 10, w: 100, h:100} type obj representing position of // viewport over document var view = dijit.getViewport(); // This won't work if the node is inside a
, // so reattach it to dojo.doc.body. (Otherwise, the positioning will be wrong // and also it might get cutoff) if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){ dojo.body().appendChild(node); } var best = null; dojo.some(choices, function(choice){ var corner = choice.corner; var pos = choice.pos; // configure node to be displayed in given position relative to button // (need to do this in order to get an accurate size for the node, because // a tooltips size changes based on position, due to triangle) if(layoutNode){ layoutNode(node, choice.aroundCorner, corner); } // get node's size var style = node.style; var oldDisplay = style.display; var oldVis = style.visibility; style.visibility = "hidden"; style.display = ""; var mb = dojo.marginBox(node); style.display = oldDisplay; style.visibility = oldVis; // coordinates and size of node with specified corner placed at pos, // and clipped by viewport var startX = (corner.charAt(1) == 'L' ? pos.x : Math.max(view.l, pos.x - mb.w)), startY = (corner.charAt(0) == 'T' ? pos.y : Math.max(view.t, pos.y - mb.h)), endX = (corner.charAt(1) == 'L' ? Math.min(view.l + view.w, startX + mb.w) : pos.x), endY = (corner.charAt(0) == 'T' ? Math.min(view.t + view.h, startY + mb.h) : pos.y), width = endX - startX, height = endY - startY, overflow = (mb.w - width) + (mb.h - height); if(best == null || overflow < best.overflow){ best = { corner: corner, aroundCorner: choice.aroundCorner, x: startX, y: startY, w: width, h: height, overflow: overflow }; } return !overflow; }); node.style.left = best.x + "px"; node.style.top = best.y + "px"; if(best.overflow && layoutNode){ layoutNode(node, best.aroundCorner, best.corner); } return best; } dijit.placeOnScreenAroundNode = function( /* DomNode */ node, /* DomNode */ aroundNode, /* Object */ aroundCorners, /* Function? */ layoutNode){ // summary: // Position node adjacent or kitty-corner to aroundNode // such that it's fully visible in viewport. // // description: // Place node such that corner of node touches a corner of // aroundNode, and that node is fully visible. // // aroundCorners: // Ordered list of pairs of corners to try matching up. // Each pair of corners is represented as a key/value in the hash, // where the key corresponds to the aroundNode's corner, and // the value corresponds to the node's corner: // // | { aroundNodeCorner1: nodeCorner1, aroundNodeCorner2: nodeCorner2, ...} // // The following strings are used to represent the four corners: // * "BL" - bottom left // * "BR" - bottom right // * "TL" - top left // * "TR" - top right // // layoutNode: Function(node, aroundNodeCorner, nodeCorner) // For things like tooltip, they are displayed differently (and have different dimensions) // based on their orientation relative to the parent. This adjusts the popup based on orientation. // // example: // | dijit.placeOnScreenAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'}); // This will try to position node such that node's top-left corner is at the same position // as the bottom left corner of the aroundNode (ie, put node below // aroundNode, with left edges aligned). If that fails it will try to put // the bottom-right corner of node where the top right corner of aroundNode is // (ie, put node above aroundNode, with right edges aligned) // // get coordinates of aroundNode aroundNode = dojo.byId(aroundNode); var oldDisplay = aroundNode.style.display; aroundNode.style.display=""; // #3172: use the slightly tighter border box instead of marginBox var aroundNodeW = aroundNode.offsetWidth; //mb.w; var aroundNodeH = aroundNode.offsetHeight; //mb.h; var aroundNodePos = dojo.coords(aroundNode, true); aroundNode.style.display=oldDisplay; // place the node around the calculated rectangle return dijit._placeOnScreenAroundRect(node, aroundNodePos.x, aroundNodePos.y, aroundNodeW, aroundNodeH, // rectangle aroundCorners, layoutNode); }; dijit.__Rectangle = function(){ // x: Integer // horizontal offset in pixels, relative to document body // y: Integer // vertical offset in pixels, relative to document body // width: Integer // width in pixels // height: Integer // height in pixels thix.x = x; this.y = y; thix.width = width; this.height = height;";s:7:"private";b:1;s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:19:"dijit.__Rectangle.y";a:3:{s:8:"instance";s:17:"dijit.__Rectangle";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:24:"dijit.__Rectangle.height";a:3:{s:8:"instance";s:17:"dijit.__Rectangle";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:34:"dijit.placeOnScreenAroundRectangle";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:4:{s:4:"node";a:1:{s:4:"type";s:7:"DomNode";}s:10:"aroundRect";a:1:{s:4:"type";s:17:"dijit.__Rectangle";}s:13:"aroundCorners";a:1:{s:4:"type";s:6:"Object";}s:10:"layoutNode";a:1:{s:4:"type";s:8:"Function";}}s:6:"source";s:155:" return dijit._placeOnScreenAroundRect(node, aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height, // rectangle aroundCorners, layoutNode);";s:7:"summary";s:167:"Like dijit.placeOnScreenAroundNode(), except that the "around" parameter is an arbitrary rectangle on the screen (x, y, width, height) instead of a dom node.";}s:30:"dijit._placeOnScreenAroundRect";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:7:{s:4:"node";a:1:{s:4:"type";s:7:"DomNode";}s:1:"x";a:1:{s:4:"type";s:6:"Number";}s:1:"y";a:1:{s:4:"type";s:6:"Number";}s:5:"width";a:1:{s:4:"type";s:6:"Number";}s:6:"height";a:1:{s:4:"type";s:6:"Number";}s:13:"aroundCorners";a:1:{s:4:"type";s:6:"Object";}s:10:"layoutNode";a:1:{s:4:"type";s:8:"Function";}}s:6:"source";s:8712:"dojo.provide("dijit._base.place"); dojo.require("dojo.AdapterRegistry"); // ported from dojo.html.util dijit.getViewport = function(){ // summary: // Returns the dimensions and scroll position of the viewable area of a browser window var scrollRoot = (dojo.doc.compatMode == 'BackCompat')? dojo.body() : dojo.doc.documentElement; // get scroll position var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y }; }; dijit.__Position = function(){ // x: Integer // horizontal coordinate in pixels, relative to document body // y: Integer // vertical coordinate in pixels, relative to document body thix.x = x; this.y = y; } dijit.placeOnScreen = function( /* DomNode */ node, /* dijit.__Position */ pos, /* String[] */ corners, /* dijit.__Position? */ padding){ // summary: // Positions one of the node's corners at specified position // such that node is fully visible in viewport. // description: // NOTE: node is assumed to be absolutely or relatively positioned. // pos: // Object like {x: 10, y: 20} // corners: // Array of Strings representing order to try corners in, like ["TR", "BL"]. // Possible values are: // * "BL" - bottom left // * "BR" - bottom right // * "TL" - top left // * "TR" - top right // padding: // set padding to put some buffer around the element you want to position. // example: // Try to place node's top right corner at (10,20). // If that makes node go (partially) off screen, then try placing // bottom left corner at (10,20). // | placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"]) var choices = dojo.map(corners, function(corner){ var c = { corner: corner, pos: {x:pos.x,y:pos.y} }; if(padding){ c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x; c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y; } return c; }); return dijit._place(node, choices); } dijit._place = function(/*DomNode*/ node, /* Array */ choices, /* Function */ layoutNode){ // summary: // Given a list of spots to put node, put it at the first spot where it fits, // of if it doesn't fit anywhere then the place with the least overflow // choices: Array // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} } // Above example says to put the top-left corner of the node at (10,20) // layoutNode: Function(node, aroundNodeCorner, nodeCorner) // for things like tooltip, they are displayed differently (and have different dimensions) // based on their orientation relative to the parent. This adjusts the popup based on orientation. // get {x: 10, y: 10, w: 100, h:100} type obj representing position of // viewport over document var view = dijit.getViewport(); // This won't work if the node is inside a
, // so reattach it to dojo.doc.body. (Otherwise, the positioning will be wrong // and also it might get cutoff) if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){ dojo.body().appendChild(node); } var best = null; dojo.some(choices, function(choice){ var corner = choice.corner; var pos = choice.pos; // configure node to be displayed in given position relative to button // (need to do this in order to get an accurate size for the node, because // a tooltips size changes based on position, due to triangle) if(layoutNode){ layoutNode(node, choice.aroundCorner, corner); } // get node's size var style = node.style; var oldDisplay = style.display; var oldVis = style.visibility; style.visibility = "hidden"; style.display = ""; var mb = dojo.marginBox(node); style.display = oldDisplay; style.visibility = oldVis; // coordinates and size of node with specified corner placed at pos, // and clipped by viewport var startX = (corner.charAt(1) == 'L' ? pos.x : Math.max(view.l, pos.x - mb.w)), startY = (corner.charAt(0) == 'T' ? pos.y : Math.max(view.t, pos.y - mb.h)), endX = (corner.charAt(1) == 'L' ? Math.min(view.l + view.w, startX + mb.w) : pos.x), endY = (corner.charAt(0) == 'T' ? Math.min(view.t + view.h, startY + mb.h) : pos.y), width = endX - startX, height = endY - startY, overflow = (mb.w - width) + (mb.h - height); if(best == null || overflow < best.overflow){ best = { corner: corner, aroundCorner: choice.aroundCorner, x: startX, y: startY, w: width, h: height, overflow: overflow }; } return !overflow; }); node.style.left = best.x + "px"; node.style.top = best.y + "px"; if(best.overflow && layoutNode){ layoutNode(node, best.aroundCorner, best.corner); } return best; } dijit.placeOnScreenAroundNode = function( /* DomNode */ node, /* DomNode */ aroundNode, /* Object */ aroundCorners, /* Function? */ layoutNode){ // summary: // Position node adjacent or kitty-corner to aroundNode // such that it's fully visible in viewport. // // description: // Place node such that corner of node touches a corner of // aroundNode, and that node is fully visible. // // aroundCorners: // Ordered list of pairs of corners to try matching up. // Each pair of corners is represented as a key/value in the hash, // where the key corresponds to the aroundNode's corner, and // the value corresponds to the node's corner: // // | { aroundNodeCorner1: nodeCorner1, aroundNodeCorner2: nodeCorner2, ...} // // The following strings are used to represent the four corners: // * "BL" - bottom left // * "BR" - bottom right // * "TL" - top left // * "TR" - top right // // layoutNode: Function(node, aroundNodeCorner, nodeCorner) // For things like tooltip, they are displayed differently (and have different dimensions) // based on their orientation relative to the parent. This adjusts the popup based on orientation. // // example: // | dijit.placeOnScreenAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'}); // This will try to position node such that node's top-left corner is at the same position // as the bottom left corner of the aroundNode (ie, put node below // aroundNode, with left edges aligned). If that fails it will try to put // the bottom-right corner of node where the top right corner of aroundNode is // (ie, put node above aroundNode, with right edges aligned) // // get coordinates of aroundNode aroundNode = dojo.byId(aroundNode); var oldDisplay = aroundNode.style.display; aroundNode.style.display=""; // #3172: use the slightly tighter border box instead of marginBox var aroundNodeW = aroundNode.offsetWidth; //mb.w; var aroundNodeH = aroundNode.offsetHeight; //mb.h; var aroundNodePos = dojo.coords(aroundNode, true); aroundNode.style.display=oldDisplay; // place the node around the calculated rectangle return dijit._placeOnScreenAroundRect(node, aroundNodePos.x, aroundNodePos.y, aroundNodeW, aroundNodeH, // rectangle aroundCorners, layoutNode); }; dijit.__Rectangle = function(){ // x: Integer // horizontal offset in pixels, relative to document body // y: Integer // vertical offset in pixels, relative to document body // width: Integer // width in pixels // height: Integer // height in pixels thix.x = x; this.y = y; thix.width = width; this.height = height; } dijit.placeOnScreenAroundRectangle = function( /* DomNode */ node, /* dijit.__Rectangle */ aroundRect, /* Object */ aroundCorners, /* Function */ layoutNode){ // summary: // Like dijit.placeOnScreenAroundNode(), except that the "around" // parameter is an arbitrary rectangle on the screen (x, y, width, height) // instead of a dom node. return dijit._placeOnScreenAroundRect(node, aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height, // rectangle aroundCorners, layoutNode); }; dijit._placeOnScreenAroundRect = function( /* DomNode */ node, /* Number */ x, /* Number */ y, /* Number */ width, /* Number */ height, /* Object */ aroundCorners, /* Function */ layoutNode){ // summary: // Like dijit.placeOnScreenAroundNode(), except it accepts coordinates // of a rectangle to place node adjacent to. // TODO: combine with placeOnScreenAroundRectangle() // Generate list of possible positions for node var choices = []; for(var nodeCorner in aroundCorners){ choices.push( { aroundCorner: nodeCorner, corner: aroundCorners[nodeCorner], pos: { x: x + (nodeCorner.charAt(1) == 'L' ? 0 : width), y: y + (nodeCorner.charAt(0) == 'T' ? 0 : height) } }); } return dijit._place(node, choices, layoutNode);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:32:"dijit.placeOnScreenAroundElement";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:4:{s:4:"node";a:1:{s:4:"type";s:7:"DomNode";}s:13:"aroundElement";a:1:{s:4:"type";s:6:"Object";}s:13:"aroundCorners";a:1:{s:4:"type";s:6:"Object";}s:10:"layoutNode";a:1:{s:4:"type";s:8:"Function";}}s:6:"source";s:80:" return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments);";s:7:"summary";s:157:"Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object for the "around" argument and finds a proper processor to place a node.";s:6:"chains";a:1:{s:4:"call";a:1:{i:0;s:29:"dijit.placementRegistry.match";}}}s:23:"dijit.placementRegistry";a:1:{s:7:"summary";s:0:"";}s:5:"dijit";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}