X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-ui-debug.js;h=c51b5dc4c4fbc4f13bd6c0be6091c522538ffb76;hb=dc5d9380aff25134bf025953bdafe40b580337ff;hp=9f96dcd2b5a8c72f08637e315c39fe8cfaed60a4;hpb=d0e5b291c44330ce53b03e9eee214ceeca7e9e6a;p=roojs1 diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 9f96dcd2b5..5bfabbbc98 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -10,1174 +10,1078 @@ */ - -/* - * These classes are derivatives of the similarly named classes in the YUI Library. - * The original license: - * Copyright (c) 2006, Yahoo! Inc. All rights reserved. - * Code licensed under the BSD License: - * http://developer.yahoo.net/yui/license.txt - */ - -(function() { - -var Event=Roo.EventManager; -var Dom=Roo.lib.Dom; - /** - * @class Roo.dd.DragDrop - * @extends Roo.util.Observable - * Defines the interface and base operation of items that that can be - * dragged or can be drop targets. It was designed to be extended, overriding - * the event handlers for startDrag, onDrag, onDragOver and onDragOut. - * Up to three html elements can be associated with a DragDrop instance: - * - * This class should not be instantiated until the onload event to ensure that - * the associated elements are available. - * The following would define a DragDrop obj that would interact with any - * other DragDrop obj in the "group1" group: - *
- *  dd = new Roo.dd.DragDrop("div1", "group1");
- * 
- * Since none of the event handlers have been implemented, nothing would - * actually happen if you were to run the code above. Normally you would - * override this class or one of the default implementations, but you can - * also override the methods you want on an instance of the class... - *
- *  dd.onDragDrop = function(e, id) {
- *    alert("dd was dropped on " + id);
- *  }
- * 
- * @constructor - * @param {String} id of the element that is linked to this instance - * @param {String} sGroup the group of related DragDrop objects - * @param {object} config an object containing configurable attributes - * Valid properties for DragDrop: - * padding, isTarget, maintainOffset, primaryButtonOnly + * @class Roo.data.SortTypes + * @singleton + * Defines the default sorting (casting?) comparison functions used when sorting data. */ -Roo.dd.DragDrop = function(id, sGroup, config) { - if (id) { - this.init(id, sGroup, config); - } - -}; - -Roo.extend(Roo.dd.DragDrop, Roo.util.Observable , { - - /** - * The id of the element associated with this object. This is what we - * refer to as the "linked element" because the size and position of - * this element is used to determine when the drag and drop objects have - * interacted. - * @property id - * @type String - */ - id: null, - +Roo.data.SortTypes = { /** - * Configuration attributes passed into the constructor - * @property config - * @type object + * Default sort that does nothing + * @param {Mixed} s The value being converted + * @return {Mixed} The comparison value */ - config: null, - + none : function(s){ + return s; + }, + /** - * The id of the element that will be dragged. By default this is same - * as the linked element , but could be changed to another element. Ex: - * Roo.dd.DDProxy - * @property dragElId - * @type String - * @private + * The regular expression used to strip tags + * @type {RegExp} + * @property */ - dragElId: null, - + stripTagsRE : /<\/?[^>]+>/gi, + /** - * the id of the element that initiates the drag operation. By default - * this is the linked element, but could be changed to be a child of this - * element. This lets us do things like only starting the drag when the - * header element within the linked html element is clicked. - * @property handleElId - * @type String - * @private + * Strips all HTML tags to sort on text only + * @param {Mixed} s The value being converted + * @return {String} The comparison value */ - handleElId: null, - + asText : function(s){ + return String(s).replace(this.stripTagsRE, ""); + }, + /** - * An associative array of HTML tags that will be ignored if clicked. - * @property invalidHandleTypes - * @type {string: string} + * Strips all HTML tags to sort on text only - Case insensitive + * @param {Mixed} s The value being converted + * @return {String} The comparison value */ - invalidHandleTypes: null, - + asUCText : function(s){ + return String(s).toUpperCase().replace(this.stripTagsRE, ""); + }, + /** - * An associative array of ids for elements that will be ignored if clicked - * @property invalidHandleIds - * @type {string: string} + * Case insensitive string + * @param {Mixed} s The value being converted + * @return {String} The comparison value */ - invalidHandleIds: null, - + asUCString : function(s) { + return String(s).toUpperCase(); + }, + /** - * An indexted array of css class names for elements that will be ignored - * if clicked. - * @property invalidHandleClasses - * @type string[] + * Date sorting + * @param {Mixed} s The value being converted + * @return {Number} The comparison value */ - invalidHandleClasses: null, - + asDate : function(s) { + if(!s){ + return 0; + } + if(s instanceof Date){ + return s.getTime(); + } + return Date.parse(String(s)); + }, + /** - * The linked element's absolute X position at the time the drag was - * started - * @property startPageX - * @type int - * @private + * Float sorting + * @param {Mixed} s The value being converted + * @return {Float} The comparison value */ - startPageX: 0, - + asFloat : function(s) { + var val = parseFloat(String(s).replace(/,/g, "")); + if(isNaN(val)) { + val = 0; + } + return val; + }, + /** - * The linked element's absolute X position at the time the drag was - * started - * @property startPageY - * @type int - * @private + * Integer sorting + * @param {Mixed} s The value being converted + * @return {Number} The comparison value */ - startPageY: 0, + asInt : function(s) { + var val = parseInt(String(s).replace(/,/g, "")); + if(isNaN(val)) { + val = 0; + } + return val; + } +};/* + * Based on: + * Ext JS Library 1.1.1 + * Copyright(c) 2006-2007, Ext JS, LLC. + * + * Originally Released Under LGPL - original licence link has changed is not relivant. + * + * Fork - LGPL + *