From e41f075f9f862196e550e2617309b0d482285e27 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 3 Aug 2021 17:58:53 +0800 Subject: [PATCH] sync --- docs/json/roodata.json | 124 +++++ docs/src/Roo_lib_Color.js.html | 757 +++++++++++++++++++++++++++++ docs/src/Roo_lib_Dom.js.html | 20 +- docs/symbols/Roo.lib.Color.json | 29 ++ docs/symbols/Roo.lib.Dom.json | 100 ++++ docs/symbols/Roo.lib.HSLColor.json | 27 + docs/tree.json | 10 + roojs-core-debug.js | 20 +- 8 files changed, 1079 insertions(+), 8 deletions(-) create mode 100644 docs/src/Roo_lib_Color.js.html create mode 100644 docs/symbols/Roo.lib.Color.json create mode 100644 docs/symbols/Roo.lib.HSLColor.json diff --git a/docs/json/roodata.json b/docs/json/roodata.json index db01ff8793..4f70576086 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -274296,10 +274296,74 @@ "tree_children" : [], "tree_parent" : [] }, + "Roo.lib.Color" : { + "props" : [], + "events" : [], + "methods" : [], + "isAbstract" : false, + "isBuilderTop" : false, + "childClasses" : { + "Roo.lib.Color" : [ + "Roo.lib.HSLColor" + ] + }, + "tree_children" : [], + "tree_parent" : [] + }, "Roo.lib.Dom" : { "props" : [], "events" : [], "methods" : [ + { + "name" : "getDocumentHeight", + "type" : "function", + "desc" : "Get the Full Document height", + "sig" : "()\n{\n\n}", + "static" : true, + "memberOf" : "", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Number", + "desc" : "The height" + } + ] + }, + { + "name" : "getDocumentWidth", + "type" : "function", + "desc" : "Get the Full Document width", + "sig" : "()\n{\n\n}", + "static" : true, + "memberOf" : "", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Number", + "desc" : "The width" + } + ] + }, { "name" : "getViewHeight", "type" : "function", @@ -274363,6 +274427,56 @@ "desc" : "The width" } ] + }, + { + "name" : "getViewportHeight", + "type" : "function", + "desc" : "Get the Window Viewport height", + "sig" : "()\n{\n\n}", + "static" : true, + "memberOf" : "", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Number", + "desc" : "The height" + } + ] + }, + { + "name" : "getViewportWidth", + "type" : "function", + "desc" : "Get the Window Viewport width", + "sig" : "()\n{\n\n}", + "static" : true, + "memberOf" : "", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Number", + "desc" : "The width" + } + ] } ], "isAbstract" : false, @@ -274371,6 +274485,16 @@ "tree_children" : [], "tree_parent" : [] }, + "Roo.lib.HSLColor" : { + "props" : [], + "events" : [], + "methods" : [], + "isAbstract" : false, + "isBuilderTop" : false, + "childClasses" : { }, + "tree_children" : [], + "tree_parent" : [] + }, "Roo.menu" : { "props" : [], "events" : [], diff --git a/docs/src/Roo_lib_Color.js.html b/docs/src/Roo_lib_Color.js.html new file mode 100644 index 0000000000..8b940928ce --- /dev/null +++ b/docs/src/Roo_lib_Color.js.html @@ -0,0 +1,757 @@ +Roo/lib/Color.js/* + +Color.js + +Functions for Color handling and processing. + +http://www.safalra.com/web-design/javascript/Color-handling-and-processing/ + +The author of this program, Safalra (Stephen Morley), irrevocably releases all +rights to this program, with the intention of it becoming part of the public +domain. Because this program is released into the public domain, it comes with +no warranty either expressed or implied, to the extent permitted by law. + +For more free and public domain JavaScript code by the same author, visit: +http://www.safalra.com/web-design/javascript/ + +*/ + + +/* + * @class Roo.lib.Color + * @constructor + * An abstract Color implementation. Concrete Color implementations should use + * an instance of this function as their prototype, and implement the getRGB and + * getHSL functions. getRGB should return an object representing the RGB + * components of this Color, with the red, green, and blue components in the + * range [0,255] and the alpha component in the range [0,100]. getHSL should + * return an object representing the HSL components of this Color, with the hue + * component in the range [0,360), the saturation and lightness components in + * the range [0,100], and the alpha component in the range [0,1]. + */ +Roo.lib.Color = function() { } + + +Roo.apply(Roo.lib.Color.prototype, { + /** + * @returns an object representing the RGBA components of this Color. The red, + * green, and blue components are converted to integers in the range [0,255]. + * The alpha is a value in the range [0,1]. + */ + getIntegerRGB : function(){ + + // get the RGB components of this Color + var rgb = this.getRGB(); + + // return the integer components + return { + 'r' : Math.round(rgb.r), + 'g' : Math.round(rgb.g), + 'b' : Math.round(rgb.b), + 'a' : rgb.a + }; + + }, + + /** + * @returns an object representing the RGBA components of this Color. The red, + * green, and blue components are converted to numbers in the range [0,100]. + * The alpha is a value in the range [0,1]. + */ + getPercentageRGB : function(){ + + // get the RGB components of this Color + var rgb = this.getRGB(); + + // return the percentage components + return { + 'r' : 100 * rgb.r / 255, + 'g' : 100 * rgb.g / 255, + 'b' : 100 * rgb.b / 255, + 'a' : rgb.a + }; + + }, + + /** + * @returns a string representing this Color as a CSS hexadecimal RGB Color + * value - that is, a string of the form #RRGGBB where each of RR, GG, and BB + * are two-digit hexadecimal numbers. + */ + getCSSHexadecimalRGB : function() + { + + // get the integer RGB components + var rgb = this.getIntegerRGB(); + + // determine the hexadecimal equivalents + var r16 = rgb.r.toString(16); + var g16 = rgb.g.toString(16); + var b16 = rgb.b.toString(16); + + // return the CSS RGB Color value + return '#' + + (r16.length == 2 ? r16 : '0' + r16) + + (g16.length == 2 ? g16 : '0' + g16) + + (b16.length == 2 ? b16 : '0' + b16); + + }, + + /** + * @returns a string representing this Color as a CSS integer RGB Color + * value - that is, a string of the form rgb(r,g,b) where each of r, g, and b + * are integers in the range [0,255]. + */ + getCSSIntegerRGB : function(){ + + // get the integer RGB components + var rgb = this.getIntegerRGB(); + + // return the CSS RGB Color value + return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')'; + + }, + + /** + * @returns Returns a string representing this Color as a CSS integer RGBA Color + * value - that is, a string of the form rgba(r,g,b,a) where each of r, g, and + * b are integers in the range [0,255] and a is in the range [0,1]. + */ + getCSSIntegerRGBA : function(){ + + // get the integer RGB components + var rgb = this.getIntegerRGB(); + + // return the CSS integer RGBA Color value + return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + rgb.a + ')'; + + }, + + /** + * @returns a string representing this Color as a CSS percentage RGB Color + * value - that is, a string of the form rgb(r%,g%,b%) where each of r, g, and + * b are in the range [0,100]. + */ + getCSSPercentageRGB : function(){ + + // get the percentage RGB components + var rgb = this.getPercentageRGB(); + + // return the CSS RGB Color value + return 'rgb(' + rgb.r + '%,' + rgb.g + '%,' + rgb.b + '%)'; + + }, + + /** + * @returns a string representing this Color as a CSS percentage RGBA Color + * value - that is, a string of the form rgba(r%,g%,b%,a) where each of r, g, + * and b are in the range [0,100] and a is in the range [0,1]. + */ + getCSSPercentageRGBA : function(){ + + // get the percentage RGB components + var rgb = this.getPercentageRGB(); + + // return the CSS percentage RGBA Color value + return 'rgb(' + rgb.r + '%,' + rgb.g + '%,' + rgb.b + '%,' + rgb.a + ')'; + + }, + + /** + * @returns a string representing this Color as a CSS HSL Color value - that + * is, a string of the form hsl(h,s%,l%) where h is in the range [0,100] and + * s and l are in the range [0,100]. + */ + getCSSHSL : function(){ + + // get the HSL components + var hsl = this.getHSL(); + + // return the CSS HSL Color value + return 'hsl(' + hsl.h + ',' + hsl.s + '%,' + hsl.l + '%)'; + + }, + + /** + * @returns a string representing this Color as a CSS HSLA Color value - that + * is, a string of the form hsla(h,s%,l%,a) where h is in the range [0,100], + * s and l are in the range [0,100], and a is in the range [0,1]. + */ + getCSSHSLA : function(){ + + // get the HSL components + var hsl = this.getHSL(); + + // return the CSS HSL Color value + return 'hsl(' + hsl.h + ',' + hsl.s + '%,' + hsl.l + '%,' + hsl.a + ')'; + + }, + + /** + * Sets the Color of the specified node to this Color. This functions sets + * the CSS 'color' property for the node. The parameter is: + * + * @param {DomElement} node - the node whose Color should be set + */ + setNodeColor : function(node){ + + // set the Color of the node + node.style.color = this.getCSSHexadecimalRGB(); + + }, + + /** + * Sets the background Color of the specified node to this Color. This + * functions sets the CSS 'background-color' property for the node. The + * parameter is: + * + * @param {DomElement} node - the node whose background Color should be set + */ + setNodeBackgroundColor : function(node){ + + // set the background Color of the node + node.style.backgroundColor = this.getCSSHexadecimalRGB(); + + }, + // convert between formats.. + toRGB: function() + { + var r = this.getIntegerRGB(); + return new Roo.lib.RGBColor(r.r,r.g,r.b,r.a); + + }, + toHSL : function() + { + var hsl = this.getHSL(); + // return the CSS HSL Color value + return new Roo.lib.HSLColor(hsl.h, hsl.s, hsl.l , hsl.a ); + + }, + + toHSV : function() + { + var rgb = this.toRGB(); + var hsv = rgb.getHSV(); + // return the CSS HSL Color value + return new Roo.lib.HSVColor(hsv.h, hsv.s, hsv.v , hsv.a ); + + }, + + // modify v = 0 ... 1 (eg. 0.5) + saturate : function(v) + { + var rgb = this.toRGB(); + var hsv = rgb.getHSV(); + return new Roo.lib.HSVColor(hsv.h, hsv.s * v, hsv.v , hsv.a ); + + + } + + + + +}); + + +/* + * @class Roo.lib.RGBColor + * @extends Roo.lib.Color + * Creates a Color specified in the RGB Color space, with an optional alpha + * component. The parameters are: + * + * r - the red component, clipped to the range [0,255] + * g - the green component, clipped to the range [0,255] + * b - the blue component, clipped to the range [0,255] + * a - the alpha component, clipped to the range [0,1] - this parameter is + * optional and defaults to 1 + */ +Roo.lib.RGBColor = function (r, g, b, a){ + + // store the alpha component after clipping it if necessary + var alpha = (a === undefined ? 1 : Math.max(0, Math.min(1, a))); + + // store the RGB components after clipping them if necessary + var rgb = + { + 'r' : Math.max(0, Math.min(255, r)), + 'g' : Math.max(0, Math.min(255, g)), + 'b' : Math.max(0, Math.min(255, b)) + }; + + // initialise the HSV and HSL components to null + var hsv = null; + var hsl = null; + + /* + * //private returns the HSV or HSL hue component of this RGBColor. The hue is in the + * range [0,360). The parameters are: + * + * maximum - the maximum of the RGB component values + * range - the range of the RGB component values + */ + function getHue(maximum, range){ + + // check whether the range is zero + if (range == 0){ + + // set the hue to zero (any hue is acceptable as the Color is grey) + var hue = 0; + + }else{ + + // determine which of the components has the highest value and set the hue + switch (maximum){ + + // red has the highest value + case rgb.r: + var hue = (rgb.g - rgb.b) / range * 60; + if (hue < 0) hue += 360; + break; + + // green has the highest value + case rgb.g: + var hue = (rgb.b - rgb.r) / range * 60 + 120; + break; + + // blue has the highest value + case rgb.b: + var hue = (rgb.r - rgb.g) / range * 60 + 240; + break; + + } + + } + + // return the hue + return hue; + + } + + /* //private Calculates and stores the HSV components of this RGBColor so that they can + * be returned be the getHSV function. + */ + function calculateHSV(){ + + // get the maximum and range of the RGB component values + var maximum = Math.max(rgb.r, rgb.g, rgb.b); + var range = maximum - Math.min(rgb.r, rgb.g, rgb.b); + + // store the HSV components + hsv = + { + 'h' : getHue(maximum, range), + 's' : (maximum == 0 ? 0 : 100 * range / maximum), + 'v' : maximum / 2.55 + }; + + } + + /* //private Calculates and stores the HSL components of this RGBColor so that they can + * be returned be the getHSL function. + */ + function calculateHSL(){ + + // get the maximum and range of the RGB component values + var maximum = Math.max(rgb.r, rgb.g, rgb.b); + var range = maximum - Math.min(rgb.r, rgb.g, rgb.b); + + // determine the lightness in the range [0,1] + var l = maximum / 255 - range / 510; + + // store the HSL components + hsl = + { + 'h' : getHue(maximum, range), + 's' : (range == 0 ? 0 : range / 2.55 / (l < 0.5 ? l * 2 : 2 - l * 2)), + 'l' : 100 * l + }; + + } + + /** + * @returns the RGB and alpha components of this RGBColor as an object with r, + * g, b, and a properties. r, g, and b are in the range [0,255] and a is in + * the range [0,1]. + */ + this.getRGB = function(){ + + // return the RGB components + return { + 'r' : rgb.r, + 'g' : rgb.g, + 'b' : rgb.b, + 'a' : alpha + }; + + }; + + /** + * @returns the HSV and alpha components of this RGBColor as an object with h, + * s, v, and a properties. h is in the range [0,360), s and v are in the range + * [0,100], and a is in the range [0,1]. + */ + this.getHSV = function(){ + + // calculate the HSV components if necessary + if (hsv == null) calculateHSV(); + + // return the HSV components + return { + 'h' : hsv.h, + 's' : hsv.s, + 'v' : hsv.v, + 'a' : alpha + }; + + }; + + /** + * @returns the HSL and alpha components of this RGBColor as an object with h, + * s, l, and a properties. h is in the range [0,360), s and l are in the range + * [0,100], and a is in the range [0,1]. + */ + this.getHSL = function(){ + + // calculate the HSV components if necessary + if (hsl == null) calculateHSL(); + + // return the HSL components + return { + 'h' : hsl.h, + 's' : hsl.s, + 'l' : hsl.l, + 'a' : alpha + }; + + }; + +} +// this does an 'exteds' +Roo.lib.RGBColor.prototype = new Roo.lib.Color(); + + +/* + * @class Roo.lib.HSVColor + * @extends Roo.lib.Color + * Creates a Color specified in the HSV Color space, with an optional alpha + * component. The parameters are: + * + * h - the hue component, wrapped to the range [0,360) + * s - the saturation component, clipped to the range [0,100] + * v - the value component, clipped to the range [0,100] + * a - the alpha component, clipped to the range [0,1] - this parameter is + * optional and defaults to 1 + */ +Roo.lib.HSVColor = function (h, s, v, a){ + + // store the alpha component after clipping it if necessary + var alpha = (a === undefined ? 1 : Math.max(0, Math.min(1, a))); + + // store the HSV components after clipping or wrapping them if necessary + var hsv = + { + 'h' : (h % 360 + 360) % 360, + 's' : Math.max(0, Math.min(100, s)), + 'v' : Math.max(0, Math.min(100, v)) + }; + + // initialise the RGB and HSL components to null + var rgb = null; + var hsl = null; + + /* Calculates and stores the RGB components of this HSVColor so that they can + * be returned be the getRGB function. + */ + function calculateRGB(){ + + // check whether the saturation is zero + if (hsv.s == 0){ + + // set the Color to the appropriate shade of grey + var r = hsv.v; + var g = hsv.v; + var b = hsv.v; + + }else{ + + // set some temporary values + var f = hsv.h / 60 - Math.floor(hsv.h / 60); + var p = hsv.v * (1 - hsv.s / 100); + var q = hsv.v * (1 - hsv.s / 100 * f); + var t = hsv.v * (1 - hsv.s / 100 * (1 - f)); + + // set the RGB Color components to their temporary values + switch (Math.floor(hsv.h / 60)){ + case 0: var r = hsv.v; var g = t; var b = p; break; + case 1: var r = q; var g = hsv.v; var b = p; break; + case 2: var r = p; var g = hsv.v; var b = t; break; + case 3: var r = p; var g = q; var b = hsv.v; break; + case 4: var r = t; var g = p; var b = hsv.v; break; + case 5: var r = hsv.v; var g = p; var b = q; break; + } + + } + + // store the RGB components + rgb = + { + 'r' : r * 2.55, + 'g' : g * 2.55, + 'b' : b * 2.55 + }; + + } + + /* Calculates and stores the HSL components of this HSVColor so that they can + * be returned be the getHSL function. + */ + function calculateHSL(){ + + // determine the lightness in the range [0,100] + var l = (2 - hsv.s / 100) * hsv.v / 2; + + // store the HSL components + hsl = + { + 'h' : hsv.h, + 's' : hsv.s * hsv.v / (l < 50 ? l * 2 : 200 - l * 2), + 'l' : l + }; + + // correct a division-by-zero error + if (isNaN(hsl.s)) hsl.s = 0; + + } + + /** + * @returns the RGB and alpha components of this HSVColor as an object with r, + * g, b, and a properties. r, g, and b are in the range [0,255] and a is in + * the range [0,1]. + */ + this.getRGB = function(){ + + // calculate the RGB components if necessary + if (rgb == null) calculateRGB(); + + // return the RGB components + return { + 'r' : rgb.r, + 'g' : rgb.g, + 'b' : rgb.b, + 'a' : alpha + }; + + }; + + /** + * @returns the HSV and alpha components of this HSVColor as an object with h, + * s, v, and a properties. h is in the range [0,360), s and v are in the range + * [0,100], and a is in the range [0,1]. + */ + this.getHSV = function(){ + + // return the HSV components + return { + 'h' : hsv.h, + 's' : hsv.s, + 'v' : hsv.v, + 'a' : alpha + }; + + }; + + /** + * @returns the HSL and alpha components of this HSVColor as an object with h, + * s, l, and a properties. h is in the range [0,360), s and l are in the range + * [0,100], and a is in the range [0,1]. + */ + this.getHSL = function(){ + + // calculate the HSL components if necessary + if (hsl == null) calculateHSL(); + + // return the HSL components + return { + 'h' : hsl.h, + 's' : hsl.s, + 'l' : hsl.l, + 'a' : alpha + }; + + }; + +} +Roo.lib.HSVColor.prototype = new Roo.lib.Color(); + + +/** + * @class Roo.lib.HSLColor + * @extends Roo.lib.Color + * + * Creates a Color specified in the HSL Color space, with an optional alpha + * component. The parameters are: + * + * h - the hue component, wrapped to the range [0,360) + * s - the saturation component, clipped to the range [0,100] + * l - the lightness component, clipped to the range [0,100] + * a - the alpha component, clipped to the range [0,1] - this parameter is + * optional and defaults to 1 + */ + +Roo.lib.HSLColor = function(h, s, l, a){ + + // store the alpha component after clipping it if necessary + var alpha = (a === undefined ? 1 : Math.max(0, Math.min(1, a))); + + // store the HSL components after clipping or wrapping them if necessary + var hsl = + { + 'h' : (h % 360 + 360) % 360, + 's' : Math.max(0, Math.min(100, s)), + 'l' : Math.max(0, Math.min(100, l)) + }; + + // initialise the RGB and HSV components to null + var rgb = null; + var hsv = null; + + /* Calculates and stores the RGB components of this HSLColor so that they can + * be returned be the getRGB function. + */ + function calculateRGB(){ + + // check whether the saturation is zero + if (hsl.s == 0){ + + // store the RGB components representing the appropriate shade of grey + rgb = + { + 'r' : hsl.l * 2.55, + 'g' : hsl.l * 2.55, + 'b' : hsl.l * 2.55 + }; + + }else{ + + // set some temporary values + var p = hsl.l < 50 + ? hsl.l * (1 + hsl.s / 100) + : hsl.l + hsl.s - hsl.l * hsl.s / 100; + var q = 2 * hsl.l - p; + + // initialise the RGB components + rgb = + { + 'r' : (h + 120) / 60 % 6, + 'g' : h / 60, + 'b' : (h + 240) / 60 % 6 + }; + + // loop over the RGB components + for (var key in rgb){ + + // ensure that the property is not inherited from the root object + if (rgb.hasOwnProperty(key)){ + + // set the component to its value in the range [0,100] + if (rgb[key] < 1){ + rgb[key] = q + (p - q) * rgb[key]; + }else if (rgb[key] < 3){ + rgb[key] = p; + }else if (rgb[key] < 4){ + rgb[key] = q + (p - q) * (4 - rgb[key]); + }else{ + rgb[key] = q; + } + + // set the component to its value in the range [0,255] + rgb[key] *= 2.55; + + } + + } + + } + + } + + /* Calculates and stores the HSV components of this HSLColor so that they can + * be returned be the getHSL function. + */ + function calculateHSV(){ + + // set a temporary value + var t = hsl.s * (hsl.l < 50 ? hsl.l : 100 - hsl.l) / 100; + + // store the HSV components + hsv = + { + 'h' : hsl.h, + 's' : 200 * t / (hsl.l + t), + 'v' : t + hsl.l + }; + + // correct a division-by-zero error + if (isNaN(hsv.s)) hsv.s = 0; + + } + + /** + * @returns the RGB and alpha components of this HSLColor as an object with r, + * g, b, and a properties. r, g, and b are in the range [0,255] and a is in + * the range [0,1]. + */ + this.getRGB = function(){ + + // calculate the RGB components if necessary + if (rgb == null) calculateRGB(); + + // return the RGB components + return { + 'r' : rgb.r, + 'g' : rgb.g, + 'b' : rgb.b, + 'a' : alpha + }; + + }; + + /** + * @returns the HSV and alpha components of this HSLColor as an object with h, + * s, v, and a properties. h is in the range [0,360), s and v are in the range + * [0,100], and a is in the range [0,1]. + */ + this.getHSV = function(){ + + // calculate the HSV components if necessary + if (hsv == null) calculateHSV(); + + // return the HSV components + return { + 'h' : hsv.h, + 's' : hsv.s, + 'v' : hsv.v, + 'a' : alpha + }; + + }; + + /** + * @returns the HSL and alpha components of this HSLColor as an object with h, + * s, l, and a properties. h is in the range [0,360), s and l are in the range + * [0,100], and a is in the range [0,1]. + */ + this.getHSL = function(){ + + // return the HSL components + return { + 'h' : hsl.h, + 's' : hsl.s, + 'l' : hsl.l, + 'a' : alpha + }; + + }; + +} +Roo.lib.HSLColor.prototype = new Roo.lib.Color(); \ No newline at end of file diff --git a/docs/src/Roo_lib_Dom.js.html b/docs/src/Roo_lib_Dom.js.html index 0dc42634eb..eafdb43524 100644 --- a/docs/src/Roo_lib_Dom.js.html +++ b/docs/src/Roo_lib_Dom.js.html @@ -25,17 +25,26 @@ getViewHeight : function(full) { return full ? this.getDocumentHeight() : this.getViewportHeight(); }, - + /** + * Get the Full Document height + * @return {Number} The height + */ getDocumentHeight: function() { var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight; return Math.max(scrollHeight, this.getViewportHeight()); }, - + /** + * Get the Full Document width + * @return {Number} The width + */ getDocumentWidth: function() { var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth; return Math.max(scrollWidth, this.getViewportWidth()); }, - + /** + * Get the Window Viewport height + * @return {Number} The height + */ getViewportHeight: function() { var height = self.innerHeight; var mode = document.compatMode; @@ -48,7 +57,10 @@ return height; }, - + /** + * Get the Window Viewport width + * @return {Number} The width + */ getViewportWidth: function() { var width = self.innerWidth; var mode = document.compatMode; diff --git a/docs/symbols/Roo.lib.Color.json b/docs/symbols/Roo.lib.Color.json new file mode 100644 index 0000000000..2b68c6676e --- /dev/null +++ b/docs/symbols/Roo.lib.Color.json @@ -0,0 +1,29 @@ +{ + "name" : "Roo.lib.Color", + "augments" : [], + "childClasses" : { + "Roo.lib.Color" : [ + "Roo.lib.HSLColor" + ] + }, + "tree_children" : [], + "tree_parent" : [], + "desc" : "", + "isSingleton" : false, + "isStatic" : false, + "isBuiltin" : false, + "isAbstract" : false, + "isBuilderTop" : false, + "memberOf" : "Roo.lib.Color", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [], + "returns" : [], + "throws" : "", + "requires" : "", + "config" : [], + "methods" : [], + "events" : [] +} \ No newline at end of file diff --git a/docs/symbols/Roo.lib.Dom.json b/docs/symbols/Roo.lib.Dom.json index c5cb943e28..47ffcdef01 100644 --- a/docs/symbols/Roo.lib.Dom.json +++ b/docs/symbols/Roo.lib.Dom.json @@ -21,6 +21,56 @@ "requires" : "", "config" : [], "methods" : [ + { + "name" : "getDocumentWidth", + "type" : "function", + "desc" : "Get the Full Document width", + "sig" : "()\n{\n\n}", + "static" : true, + "memberOf" : "", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Number", + "desc" : "The width" + } + ] + }, + { + "name" : "getViewportWidth", + "type" : "function", + "desc" : "Get the Window Viewport width", + "sig" : "()\n{\n\n}", + "static" : true, + "memberOf" : "", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Number", + "desc" : "The width" + } + ] + }, { "name" : "getViewWidth", "type" : "function", @@ -53,6 +103,31 @@ } ] }, + { + "name" : "getDocumentHeight", + "type" : "function", + "desc" : "Get the Full Document height", + "sig" : "()\n{\n\n}", + "static" : true, + "memberOf" : "", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Number", + "desc" : "The height" + } + ] + }, { "name" : "getViewHeight", "type" : "function", @@ -84,6 +159,31 @@ "desc" : "The height" } ] + }, + { + "name" : "getViewportHeight", + "type" : "function", + "desc" : "Get the Window Viewport height", + "sig" : "()\n{\n\n}", + "static" : true, + "memberOf" : "", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [ + { + "name" : "", + "type" : "Number", + "desc" : "The height" + } + ] } ], "events" : [] diff --git a/docs/symbols/Roo.lib.HSLColor.json b/docs/symbols/Roo.lib.HSLColor.json new file mode 100644 index 0000000000..49eba6f4e6 --- /dev/null +++ b/docs/symbols/Roo.lib.HSLColor.json @@ -0,0 +1,27 @@ +{ + "name" : "Roo.lib.HSLColor", + "augments" : [ + "Roo.lib.Color" + ], + "childClasses" : { }, + "tree_children" : [], + "tree_parent" : [], + "desc" : "Creates a Color specified in the HSL Color space, with an optional alpha\ncomponent. The parameters are:\n\nh - the hue component, wrapped to the range [0,360)\ns - the saturation component, clipped to the range [0,100]\nl - the lightness component, clipped to the range [0,100]\na - the alpha component, clipped to the range [0,1] - this parameter is\n optional and defaults to 1", + "isSingleton" : false, + "isStatic" : true, + "isBuiltin" : false, + "isAbstract" : false, + "isBuilderTop" : false, + "memberOf" : "HSLColor", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [], + "returns" : [], + "throws" : "", + "requires" : "", + "config" : [], + "methods" : [], + "events" : [] +} \ No newline at end of file diff --git a/docs/tree.json b/docs/tree.json index 7966309c08..9c9fa69ca6 100644 --- a/docs/tree.json +++ b/docs/tree.json @@ -1305,10 +1305,20 @@ "cn" : [], "is_class" : true }, + { + "name" : "Roo.lib.Color", + "cn" : [], + "is_class" : false + }, { "name" : "Roo.lib.Dom", "cn" : [], "is_class" : true + }, + { + "name" : "Roo.lib.HSLColor", + "cn" : [], + "is_class" : false } ], "is_class" : false diff --git a/roojs-core-debug.js b/roojs-core-debug.js index 08a58be6be..49a482707c 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -1905,17 +1905,26 @@ Roo.lib.Dom = { getViewHeight : function(full) { return full ? this.getDocumentHeight() : this.getViewportHeight(); }, - + /** + * Get the Full Document height + * @return {Number} The height + */ getDocumentHeight: function() { var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight; return Math.max(scrollHeight, this.getViewportHeight()); }, - + /** + * Get the Full Document width + * @return {Number} The width + */ getDocumentWidth: function() { var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth; return Math.max(scrollWidth, this.getViewportWidth()); }, - + /** + * Get the Window Viewport height + * @return {Number} The height + */ getViewportHeight: function() { var height = self.innerHeight; var mode = document.compatMode; @@ -1928,7 +1937,10 @@ Roo.lib.Dom = { return height; }, - + /** + * Get the Window Viewport width + * @return {Number} The width + */ getViewportWidth: function() { var width = self.innerWidth; var mode = document.compatMode; -- 2.39.2