X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-core-debug.js;h=5eac5f8ec1a0848f29bdabfb4bf065eb71552145;hb=915de16ffbca9f2447a6147af4e788ecdf399800;hp=08a58be6bea7b4afa5f6839f8029877cfb965998;hpb=dc0deb4ab24ebb1144a9c7c0cea2e5d6bedb54e1;p=roojs1 diff --git a/roojs-core-debug.js b/roojs-core-debug.js index 08a58be6be..5eac5f8ec1 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -700,9 +700,8 @@ Roo.factory(conf, Roo.data); Roo.namespace("Roo", "Roo.util", "Roo.grid", "Roo.dd", "Roo.tree", "Roo.data", "Roo.form", "Roo.menu", "Roo.state", "Roo.lib", "Roo.layout", - "Roo.app", "Roo.ux", - "Roo.bootstrap", - "Roo.bootstrap.dash"); + "Roo.app", "Roo.ux" + ); /* * Based on: * Ext JS Library 1.1.1 @@ -955,6 +954,16 @@ String.prototype.unicodeClean = function () { ); }; + +/** + * Make the first letter of a string uppercase + * + * @return {String} The new string. + */ +String.prototype.toUpperCaseFirst = function () { + return this.charAt(0).toUpperCase() + this.slice(1); +}; + /* * Based on: * Ext JS Library 1.1.1 @@ -1046,30 +1055,50 @@ Roo.applyIf(Array.prototype, { */ equals : function(b) { - // https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript - if (this === b) { - return true; - } - if (b == null) { - return false; - } - if (this.length !== b.length) { - return false; - } - - // sort?? a.sort().equals(b.sort()); + // https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript + if (this === b) { + return true; + } + if (b == null) { + return false; + } + if (this.length !== b.length) { + return false; + } + + // sort?? a.sort().equals(b.sort()); + + for (var i = 0; i < this.length; ++i) { + if (this[i] !== b[i]) { + return false; + } + } + return true; + } + + + + +}); + +Roo.applyIf(Array, { + /** + * from + * @static + * @param {Array} o Or Array like object (eg. nodelist) + * @returns {Array} + */ + from : function(o) + { + var ret= []; + + for (var i =0; i < o.length; i++) { + ret[i] = o[i]; + } + return ret; - for (var i = 0; i < this.length; ++i) { - if (this[i] !== b[i]) { - return false; - } - } - return true; } }); - - - /* * Based on: * Ext JS Library 1.1.1 @@ -1373,17 +1402,17 @@ Date.createParser = function(format) { } code += "if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n" - + "{v = new Date(y, m, d, h, i, s);}\n" + + "{v = new Date(y, m, d, h, i, s); v.setFullYear(y);}\n" + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n" - + "{v = new Date(y, m, d, h, i);}\n" + + "{v = new Date(y, m, d, h, i); v.setFullYear(y);}\n" + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n" - + "{v = new Date(y, m, d, h);}\n" + + "{v = new Date(y, m, d, h); v.setFullYear(y);}\n" + "else if (y >= 0 && m >= 0 && d > 0)\n" - + "{v = new Date(y, m, d);}\n" + + "{v = new Date(y, m, d); v.setFullYear(y);}\n" + "else if (y >= 0 && m >= 0)\n" - + "{v = new Date(y, m);}\n" + + "{v = new Date(y, m); v.setFullYear(y);}\n" + "else if (y >= 0)\n" - + "{v = new Date(y);}\n" + + "{v = new Date(y); v.setFullYear(y);}\n" + "}return (v && (z || o))?\n" // favour UTC offset over GMT offset + " ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n" // reset to UTC, then add offset + " v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n" // reset to GMT, then add offset @@ -1443,7 +1472,7 @@ Date.formatCodeToRegex = function(character, currentGroup) { s:"(\\d{1,2})"}; // Numeric representation of a month, without leading zeros case "m": return {g:1, - c:"m = parseInt(results[" + currentGroup + "], 10) - 1;\n", + c:"m = Math.max(0,parseInt(results[" + currentGroup + "], 10) - 1);\n", s:"(\\d{2})"}; // Numeric representation of a month, with leading zeros case "t": return {g:0, @@ -1905,17 +1934,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 +1966,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; @@ -2592,18 +2633,20 @@ Roo.lib.Event = function() { E._tryPreloadAttach(); })(); -/* - * Portions of this file are based on pieces of Yahoo User Interface Library - * Copyright (c) 2007, Yahoo! Inc. All rights reserved. - * YUI licensed under the BSD License: - * http://developer.yahoo.net/yui/license.txt - *