JBoss Rich Faces SVN: r20778 - in trunk/core/impl/src/main/resources/org/richfaces: renderkit/html/images and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-23 11:06:35 -0500 (Thu, 23 Dec 2010)
New Revision: 20778
Removed:
trunk/core/impl/src/main/resources/org/richfaces/component/
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/images/bg_shadow.png
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/images/spacer.gif
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/available.js
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/browser_info.js
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/events.js
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/form.js
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.jcarousel.js
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.utils.js
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/skinning.js
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/ui.core.js
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
Legacy 3.x code removal
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/images/bg_shadow.png
===================================================================
(Binary files differ)
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/images/spacer.gif
===================================================================
(Binary files differ)
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/available.js
===================================================================
--- trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/available.js 2010-12-23 16:01:59 UTC (rev 20777)
+++ trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/available.js 2010-12-23 16:06:35 UTC (rev 20778)
@@ -1,145 +0,0 @@
-//Requires prototype.js & AJAX script
-if (!document.observe) {
- throw "prototype.js is required!";
-}
-
-if (!A4J || !A4J.AJAX || !A4J.AJAX.AddListener) {
- throw "AJAX script is required!";
-}
-
-if (!window.Richfaces) {
- window.Richfaces = {};
-}
-
-Object.extend(Richfaces, function() {
- var _queueLength = 0;
- var _available = {};
- var _pollingActivated = false;
-
- var _lastEltId = null;
-
- var executeCallback = function(elt, callbacks) {
- if (callbacks instanceof Array) {
- for (var i = 0; i < callbacks.length; i++) {
- callbacks[i](elt);
- }
- } else {
- callbacks(elt);
- }
- };
-
- var stopPolling = function() {
- if (_pollingActivated) {
- Event.stopObserving(document, "mouseover", onEvent, true);
- Event.stopObserving(document, "focus", onEvent, true);
- Event.stopObserving(document, "focusin", onEvent, true);
-
- _pollingActivated = false;
- _lastEltId = null;
- }
- }
-
- var onEvent = function(event) {
- var elt = Event.element(event);
- while (elt) {
- var id = elt.id;
- if (id) {
- if (!_lastEltId) {
- _lastEltId = id;
- } else if (_lastEltId == id) {
- //we can stop now because elements queue hasn't changed since we've checked this element
- break;
- }
-
- var callbacks = _available[id];
- if (callbacks) {
- try {
- executeCallback(elt, callbacks);
- } catch (e) {
- cleanup();
- throw e;
- }
-
- delete _available[id];
- if (--_queueLength == 0) {
- stopPolling();
- //done all elements for now
- break;
- }
- }
- }
-
- elt = elt.parentNode;
- }
- };
-
- var activatePolling = function() {
- if (!_pollingActivated) {
- Event.observe(document, "mousemove", onEvent, true);
- Event.observe(document, "focus", onEvent, true);
- Event.observe(document, "focusin", onEvent, true);
-
- _pollingActivated = true;
- }
- };
-
- var cleanup = function() {
- try {
- stopPolling();
- _queueLength = 0;
- _available = {};
- } catch (e) {
- LOG.error("Error occured during cleanup: " + e);
- }
- };
-
-
- var onReady = function() {
- try {
- for (var id in _available) {
- var elt = $(id);
- if (elt) {
- executeCallback(elt, _available[id]);
- } else {
- LOG.error("Element with id = " + id + " hasn't been found!");
- }
- }
- } finally {
- cleanup();
- }
- };
-
- var onAvailable = function(eltId, callback) {
- var elt = $(eltId);
- if (elt) {
- callback(elt);
- } else {
- var a = _available[eltId];
- if (!a) {
- _available[eltId] = callback;
-
- //reset cached element because we've just changed the queue
- _lastEltId = null;
-
- _queueLength++;
- activatePolling();
- } else {
- if (a instanceof Array) {
- a.push(callback)
- } else {
- var ar = new Array();
- ar.push(a);
- ar.push(callback);
- _available[eltId] = ar;
- }
- }
- }
- };
-
- A4J.AJAX.AddListener(onReady);
- document.observe("dom:loaded", onReady);
-
- return {
- onAvailable: onAvailable
- };
-}());
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/browser_info.js
===================================================================
--- trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/browser_info.js 2010-12-23 16:01:59 UTC (rev 20777)
+++ trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/browser_info.js 2010-12-23 16:06:35 UTC (rev 20778)
@@ -1,56 +0,0 @@
-if (!window.RichFaces) {
- window.RichFaces = {};
-}
-
-RichFaces.MSIE = 0;
-RichFaces.FF = 1;
-RichFaces.OPERA = 2;
-RichFaces.NETSCAPE = 3;
-RichFaces.SAFARI = 4;
-RichFaces.KONQ = 5;
-
-RichFaces.navigatorType = function () {
- var userAgent = navigator.userAgent.toLowerCase();
- if (userAgent.indexOf("msie") >= 0 ||
- userAgent.indexOf("explorer") >= 0)
- return RichFaces.MSIE;
- if (userAgent.indexOf("firefox") >= 0 ||
- userAgent.indexOf("iceweasel") >= 0)
- return RichFaces.FF;
- if (userAgent.indexOf("opera") >= 0)
- return RichFaces.OPERA;
- if (userAgent.indexOf("netscape") >= 0)
- return RichFaces.NETSCAPE;
- if (userAgent.indexOf("safari") >= 0)
- return RichFaces.SAFARI;
- if (userAgent.indexOf("konqueror") >= 0)
- return RichFaces.KONQ;
- return "OTHER";
-}
-
-RichFaces.getOperaVersion = function () {
- var userAgent = navigator.userAgent.toLowerCase();
- var index = userAgent.indexOf("opera");
- if (index == -1) return;
- return parseFloat(userAgent.substring(index+6));
-}
-
-RichFaces.getIEVersion = function () {
- var searchString = "msie";
- var agent = navigator.userAgent.toLowerCase();
- var idx = agent.indexOf(searchString);
- if (idx != -1) {
- var versIdx = agent.indexOf(";", idx);
- var versString;
-
- if (versIdx != -1) {
- versString = agent.substring(idx + searchString.length, versIdx);
- } else {
- versString = agent.substring(idx + searchString.length);
- }
-
- return parseFloat(versString);
- } else {
- return undefined;
- }
-}
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/events.js
===================================================================
--- trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/events.js 2010-12-23 16:01:59 UTC (rev 20777)
+++ trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/events.js 2010-12-23 16:06:35 UTC (rev 20778)
@@ -1,145 +0,0 @@
-if (!window.Richfaces) {
- window.Richfaces = {};
-}
-Richfaces.SYNTHETIC_EVENT = "Richfaces.SYNTHETIC_EVENT";
-
-Richfaces.createEvent = function (type, component, baseEvent, props) {
- var eventObj;
-
- if (document.createEventObject) {
- if (baseEvent) {
- eventObj = document.createEventObject(baseEvent);
- } else {
- eventObj = document.createEventObject();
- }
- } else {
- var bubbles = baseEvent && baseEvent.bubbles || false;
- var cancelable = baseEvent && baseEvent.cancelable || true;
-
- switch (type) {
- case 'abort':
- case 'blur':
- case 'change':
- case 'error':
- case 'focus':
- case 'load':
- case 'reset':
- case 'resize':
- case 'scroll':
- case 'select':
- case 'submit':
- case 'unload':
-
- eventObj = document.createEvent('HTMLEvents');
- eventObj.initEvent(type, bubbles, cancelable);
-
- break;
-
- case 'DOMActivate':
- case 'DOMFocusIn':
- case 'DOMFocusOut':
- case 'keydown':
- case 'keypress':
- case 'keyup':
-
- eventObj = document.createEvent('UIEvents');
- if (baseEvent) {
- eventObj.initUIEvent(type, bubbles, cancelable, baseEvent.windowObject,
- baseEvent.detail);
- } else {
- eventObj.initEvent(type, bubbles, cancelable);
- }
-
- break;
-
- case 'click':
- case 'mousedown':
- case 'mousemove':
- case 'mouseout':
- case 'mouseover':
- case 'mouseup':
-
- eventObj = document.createEvent('MouseEvents');
- if (baseEvent) {
- eventObj.initMouseEvent(type, bubbles, cancelable,
- baseEvent.windowObject,
- baseEvent.detail,
- baseEvent.screenX,
- baseEvent.screenY,
- baseEvent.clientX,
- baseEvent.clientY,
- baseEvent.ctrlKey,
- baseEvent.altKey,
- baseEvent.shiftKey,
- baseEvent.metaKey,
- baseEvent.button,
- baseEvent.relatedTarget);
- } else {
- eventObj.initEvent(type, bubbles, cancelable)
- }
-
- break;
-
- case 'DOMAttrModified':
- case 'DOMNodeInserted':
- case 'DOMNodeRemoved':
- case 'DOMCharacterDataModified':
- case 'DOMNodeInsertedIntoDocument':
- case 'DOMNodeRemovedFromDocument':
- case 'DOMSubtreeModified':
-
- eventObj = document.createEvent('MutationEvents');
- if (baseEvent) {
- eventObj.initMutationEvent(type, bubbles, cancelable,
- baseEvent.relatedNode,
- baseEvent.prevValue,
- baseEvent.newValue,
- baseEvent.attrName,
- baseEvent.attrChange
- );
- } else {
- eventObj.initEvent(type, bubbles, cancelable)
- }
-
- break;
-
- default:
- eventObj = document.createEvent('Events');
- eventObj.initEvent(type, bubbles, cancelable);
- }
- }
-
- if (props) {
- Object.extend(eventObj, props);
- }
-
- eventObj[Richfaces.SYNTHETIC_EVENT] = true;
-
- return {
- event: eventObj,
-
- fire: function() {
- if (component.fireEvent) {
- component.fireEvent("on" + type, this.event);
- } else {
- component.dispatchEvent(this.event);
- }
- },
-
- destroy: function() {
- if (props) {
- for (var name in props) {
- this.event[name] = undefined;
- }
- }
- }
- };
-}
-
-Richfaces.eventIsSynthetic = function (event) {
- if (event) {
- return new Boolean(event[Richfaces.SYNTHETIC_EVENT]).valueOf();
- }
-
- return false;
-}
\ No newline at end of file
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/form.js
===================================================================
--- trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/form.js 2010-12-23 16:01:59 UTC (rev 20777)
+++ trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/form.js 2010-12-23 16:06:35 UTC (rev 20778)
@@ -1,19 +0,0 @@
-if (!window.Richfaces) {
- window.Richfaces = {};
-}
-
-Richfaces.jsFormSubmit = function(linkId, formName, target, params) {
- var form = document.getElementById(formName);
- if (form) {
- var formTarget = form.target;
- var paramNames = new Array();
- if (params) {
- for (var n in params) {
- paramNames.push(n);
- }
- }
-
- _JSFFormSubmit(linkId,formName,target,params);
- _clearJSFFormParameters(formName, formTarget, paramNames);
- }
-}
\ No newline at end of file
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.jcarousel.js
===================================================================
--- trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.jcarousel.js 2010-12-23 16:01:59 UTC (rev 20777)
+++ trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.jcarousel.js 2010-12-23 16:06:35 UTC (rev 20778)
@@ -1,865 +0,0 @@
-/**
- * jCarousel - Riding carousels with jQuery
- * http://sorgalla.com/jcarousel/
- *
- * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * Built on top of the jQuery library
- * http://jquery.com
- *
- * Inspired by the "Carousel Component" by Bill Scott
- * http://billwscott.com/carousel/
- */
-
-(function($) {
- /**
- * Creates a carousel for all matched elements.
- *
- * @example $("#mycarousel").jcarousel();
- * @before <ul id="mycarousel"><li>First item</li><li>Second item</li></ul>
- * @result
- *
- * <div class="jcarousel-skin-name jcarousel-container">
- * <div disabled="disabled" class="jcarousel-prev jcarousel-prev-disabled"></div>
- * <div class="jcarousel-next"></div>
- * <div class="jcarousel-clip">
- * <ul class="jcarousel-list">
- * <li class="jcarousel-item-1">First item</li>
- * <li class="jcarousel-item-2">Second item</li>
- * </ul>
- * </div>
- * </div>
- *
- * @name jcarousel
- * @type jQuery
- * @param Hash o A set of key/value pairs to set as configuration properties.
- * @cat Plugins/jCarousel
- */
- $.fn.jcarousel = function(o) {
- return this.each(function() {
- new $jc(this, o);
- });
- };
-
- // Default configuration properties.
- var defaults = {
- vertical: false,
- start: 1,
- offset: 1,
- size: null,
- scroll: 3,
- visible: null,
- animation: 'normal',
- easing: 'swing',
- auto: 0,
- wrap: null,
- initCallback: null,
- reloadCallback: null,
- itemLoadCallback: null,
- itemFirstInCallback: null,
- itemFirstOutCallback: null,
- itemLastInCallback: null,
- itemLastOutCallback: null,
- itemVisibleInCallback: null,
- itemVisibleOutCallback: null,
- buttonNextHTML: '<div></div>',
- buttonPrevHTML: '<div></div>',
- buttonNextEvent: 'click',
- buttonPrevEvent: 'click',
- buttonNextCallback: null,
- buttonPrevCallback: null
- };
-
- /**
- * The jCarousel object.
- *
- * @constructor
- * @name $.jcarousel
- * @param Object e The element to create the carousel for.
- * @param Hash o A set of key/value pairs to set as configuration properties.
- * @cat Plugins/jCarousel
- */
- $.jcarousel = function(e, o) {
- this.options = $.extend({}, defaults, o || {});
-
- this.locked = false;
-
- this.container = null;
- this.clip = null;
- this.list = null;
- this.buttonNext = null;
- this.buttonPrev = null;
-
- this.wh = !this.options.vertical ? 'width' : 'height';
- this.lt = !this.options.vertical ? 'left' : 'top';
-
- if (e.nodeName == 'UL' || e.nodeName == 'OL') {
- this.list = $(e);
- this.container = this.list.parent();
-
- if ($.className.has(this.container[0].className, 'jcarousel-clip')) {
- if (!$.className.has(this.container[0].parentNode.className, 'jcarousel-container'))
- this.container = this.container.wrap('<div></div>');
-
- this.container = this.container.parent();
- } else if (!$.className.has(this.container[0].className, 'jcarousel-container'))
- this.container = this.list.wrap('<div></div>').parent();
-
- // Move skin class over to container
- var split = e.className.split(' ');
-
- for (var i = 0; i < split.length; i++) {
- if (split[i].indexOf('jcarousel-skin') != -1) {
- this.list.removeClass(split[i]);
- this.container.addClass(split[i]);
- break;
- }
- }
- } else {
- this.container = $(e);
- this.list = $(e).children('ul,ol');
- }
-
- this.clip = this.list.parent();
-
- if (!this.clip.length || !$.className.has(this.clip[0].className, 'jcarousel-clip'))
- this.clip = this.list.wrap('<div></div>').parent();
-
- this.buttonPrev = $('.jcarousel-prev', this.container);
-
- if (this.buttonPrev.size() == 0 && this.options.buttonPrevHTML != null)
- this.buttonPrev = this.clip.before(this.options.buttonPrevHTML).prev();
-
- this.buttonPrev.addClass(this.className('jcarousel-prev'));
-
- this.buttonNext = $('.jcarousel-next', this.container);
-
- if (this.buttonNext.size() == 0 && this.options.buttonNextHTML != null)
- this.buttonNext = this.clip.before(this.options.buttonNextHTML).prev();
-
- this.buttonNext.addClass(this.className('jcarousel-next'));
-
- this.clip.addClass(this.className('jcarousel-clip'));
- this.list.addClass(this.className('jcarousel-list'));
- this.container.addClass(this.className('jcarousel-container'));
-
- var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
- var li = this.list.children('li');
-
- var self = this;
-
- if (li.size() > 0) {
- var wh = 0, i = this.options.offset;
- li.each(function() {
- self.format(this, i++);
- wh += self.dimension(this, di);
- });
-
- this.list.css(this.wh, wh + 'px');
-
- // Only set if not explicitly passed as option
- if (!o || o.size == undefined)
- this.options.size = li.size();
- }
-
- // For whatever reason, .show() does not work in Safari...
- this.container.css('display', 'block');
- this.buttonNext.css('display', 'block');
- this.buttonPrev.css('display', 'block');
-
- this.funcNext = function() { self.next(); };
- this.funcPrev = function() { self.prev(); };
-
- $(window).bind('resize', function() { self.reload(); });
-
- if (this.options.initCallback != null)
- this.options.initCallback(this, 'init');
-
- this.setup();
- };
-
- // Create shortcut for internal use
- var $jc = $.jcarousel;
-
- $jc.fn = $jc.prototype = {
- jcarousel: '0.2.2'
- };
-
- $jc.fn.extend = $jc.extend = $.extend;
-
- $jc.fn.extend({
- /**
- * Setups the carousel.
- *
- * @name setup
- * @type undefined
- * @cat Plugins/jCarousel
- */
- setup: function() {
- this.first = null;
- this.last = null;
- this.prevFirst = null;
- this.prevLast = null;
- this.animating = false;
- this.timer = null;
- this.tail = null;
- this.inTail = false;
-
- if (this.locked)
- return;
-
- this.list.css(this.lt, this.pos(this.options.offset) + 'px');
- var p = this.pos(this.options.start);
- this.prevFirst = this.prevLast = null;
- this.animate(p, false);
- },
-
- /**
- * Clears the list and resets the carousel.
- *
- * @name reset
- * @type undefined
- * @cat Plugins/jCarousel
- */
- reset: function() {
- this.list.empty();
-
- this.list.css(this.lt, '0px');
- this.list.css(this.wh, '0px');
-
- if (this.options.initCallback != null)
- this.options.initCallback(this, 'reset');
-
- this.setup();
- },
-
- /**
- * Reloads the carousel and adjusts positions.
- *
- * @name reload
- * @type undefined
- * @cat Plugins/jCarousel
- */
- reload: function() {
- if (this.tail != null && this.inTail)
- this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + this.tail);
-
- this.tail = null;
- this.inTail = false;
-
- if (this.options.reloadCallback != null)
- this.options.reloadCallback(this);
-
- if (this.options.visible != null) {
- var self = this;
- var di = Math.ceil(this.clipping() / this.options.visible), wh = 0, lt = 0;
- $('li', this.list).each(function(i) {
- wh += self.dimension(this, di);
- if (i + 1 < self.first)
- lt = wh;
- });
-
- this.list.css(this.wh, wh + 'px');
- this.list.css(this.lt, -lt + 'px');
- }
-
- this.scroll(this.first, false);
- },
-
- /**
- * Locks the carousel.
- *
- * @name lock
- * @type undefined
- * @cat Plugins/jCarousel
- */
- lock: function() {
- this.locked = true;
- this.buttons();
- },
-
- /**
- * Unlocks the carousel.
- *
- * @name unlock
- * @type undefined
- * @cat Plugins/jCarousel
- */
- unlock: function() {
- this.locked = false;
- this.buttons();
- },
-
- /**
- * Sets the size of the carousel.
- *
- * @name size
- * @type undefined
- * @param Number s The size of the carousel.
- * @cat Plugins/jCarousel
- */
- size: function(s) {
- if (s != undefined) {
- this.options.size = s;
- if (!this.locked)
- this.buttons();
- }
-
- return this.options.size;
- },
-
- /**
- * Checks whether a list element exists for the given index (or index range).
- *
- * @name get
- * @type bool
- * @param Number i The index of the (first) element.
- * @param Number i2 The index of the last element.
- * @cat Plugins/jCarousel
- */
- has: function(i, i2) {
- if (i2 == undefined || !i2)
- i2 = i;
-
- for (var j = i; j <= i2; j++) {
- var e = this.get(j).get(0);
- if (!e || $.className.has(e, 'jcarousel-item-placeholder'))
- return false;
- }
-
- return true;
- },
-
- /**
- * Returns a jQuery object with list element for the given index.
- *
- * @name get
- * @type jQuery
- * @param Number i The index of the element.
- * @cat Plugins/jCarousel
- */
- get: function(i) {
- return $('.jcarousel-item-' + i, this.list);
- },
-
- /**
- * Adds an element for the given index to the list.
- * If the element already exists, it updates the inner html.
- * Returns the created element as jQuery object.
- *
- * @name add
- * @type jQuery
- * @param Number i The index of the element.
- * @param String s The innerHTML of the element.
- * @cat Plugins/jCarousel
- */
- add: function(i, s) {
- var e = this.get(i), old = 0;
-
- if (e.length == 0) {
- var c, e = this.create(i), j = $jc.intval(i);
- while (c = this.get(--j)) {
- if (j <= 0 || c.length) {
- j <= 0 ? this.list.prepend(e) : c.after(e);
- break;
- }
- }
- } else
- old = this.dimension(e);
-
- e.removeClass(this.className('jcarousel-item-placeholder'));
- typeof s == 'string' ? e.html(s) : e.empty().append(s);
-
- var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
- var wh = this.dimension(e, di) - old;
-
- if (i > 0 && i < this.first)
- this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + wh + 'px');
-
- this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) + wh + 'px');
-
- return e;
- },
-
- /**
- * Removes an element for the given index from the list.
- *
- * @name remove
- * @type undefined
- * @param Number i The index of the element.
- * @cat Plugins/jCarousel
- */
- remove: function(i) {
- var e = this.get(i);
-
- // Check if item exists and is not currently visible
- if (!e.length || (i >= this.first && i <= this.last))
- return;
-
- var d = this.dimension(e);
-
- if (i < this.first)
- this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + d + 'px');
-
- e.remove();
-
- this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) - d + 'px');
- },
-
- /**
- * Moves the carousel forwards.
- *
- * @name next
- * @type undefined
- * @cat Plugins/jCarousel
- */
- next: function() {
- this.stopAuto();
-
- if (this.tail != null && !this.inTail)
- this.scrollTail(false);
- else
- this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'last') && this.options.size != null && this.last == this.options.size) ? 1 : this.first + this.options.scroll);
- },
-
- /**
- * Moves the carousel backwards.
- *
- * @name prev
- * @type undefined
- * @cat Plugins/jCarousel
- */
- prev: function() {
- this.stopAuto();
-
- if (this.tail != null && this.inTail)
- this.scrollTail(true);
- else
- this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'first') && this.options.size != null && this.first == 1) ? this.options.size : this.first - this.options.scroll);
- },
-
- /**
- * Scrolls the tail of the carousel.
- *
- * @name scrollTail
- * @type undefined
- * @param Bool b Whether scroll the tail back or forward.
- * @cat Plugins/jCarousel
- */
- scrollTail: function(b) {
- if (this.locked || this.animating || !this.tail)
- return;
-
- var pos = $jc.intval(this.list.css(this.lt));
-
- !b ? pos -= this.tail : pos += this.tail;
- this.inTail = !b;
-
- // Save for callbacks
- this.prevFirst = this.first;
- this.prevLast = this.last;
-
- this.animate(pos);
- },
-
- /**
- * Scrolls the carousel to a certain position.
- *
- * @name scroll
- * @type undefined
- * @param Number i The index of the element to scoll to.
- * @param Bool a Flag indicating whether to perform animation.
- * @cat Plugins/jCarousel
- */
- scroll: function(i, a) {
- if (this.locked || this.animating)
- return;
-
- this.animate(this.pos(i), a);
- },
-
- /**
- * Prepares the carousel and return the position for a certian index.
- *
- * @name pos
- * @type Number
- * @param Number i The index of the element to scoll to.
- * @cat Plugins/jCarousel
- */
- pos: function(i) {
- if (this.locked || this.animating)
- return;
-
- if (this.options.wrap != 'circular')
- i = i < 1 ? 1 : (this.options.size && i > this.options.size ? this.options.size : i);
-
- var back = this.first > i;
- var pos = $jc.intval(this.list.css(this.lt));
-
- // Create placeholders, new list width/height
- // and new list position
- var f = this.options.wrap != 'circular' && this.first <= 1 ? 1 : this.first;
- var c = back ? this.get(f) : this.get(this.last);
- var j = back ? f : f - 1;
- var e = null, l = 0, p = false, d = 0;
-
- while (back ? --j >= i : ++j < i) {
- e = this.get(j);
- p = !e.length;
- if (e.length == 0) {
- e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
- c[back ? 'before' : 'after' ](e);
- }
-
- c = e;
- d = this.dimension(e);
-
- if (p)
- l += d;
-
- if (this.first != null && (this.options.wrap == 'circular' || (j >= 1 && (this.options.size == null || j <= this.options.size))))
- pos = back ? pos + d : pos - d;
- }
-
- // Calculate visible items
- var clipping = this.clipping();
- var cache = [];
- var visible = 0, j = i, v = 0;
- var c = this.get(i - 1);
-
- while (++visible) {
- e = this.get(j);
- p = !e.length;
- if (e.length == 0) {
- e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
- // This should only happen on a next scroll
- c.length == 0 ? this.list.prepend(e) : c[back ? 'before' : 'after' ](e);
- }
-
- c = e;
- var d = this.dimension(e);
-
- if (d == 0) {
- alert('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...');
- return 0;
- }
-
- if (this.options.wrap != 'circular' && this.options.size !== null && j > this.options.size)
- cache.push(e);
- else if (p)
- l += d;
-
- v += d;
-
- if (v >= clipping)
- break;
-
- j++;
- }
-
- // Remove out-of-range placeholders
- for (var x = 0; x < cache.length; x++)
- cache[x].remove();
-
- // Resize list
- if (l > 0) {
- this.list.css(this.wh, this.dimension(this.list) + l + 'px');
-
- if (back) {
- pos -= l;
- this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - l + 'px');
- }
- }
-
- // Calculate first and last item
- var last = i + visible - 1;
- if (this.options.wrap != 'circular' && this.options.size && last > this.options.size)
- last = this.options.size;
-
- if (j > last) {
- visible = 0, j = last, v = 0;
- while (++visible) {
- var e = this.get(j--);
- if (!e.length)
- break;
- v += this.dimension(e);
- if (v >= clipping)
- break;
- }
- }
-
- var first = last - visible + 1;
- if (this.options.wrap != 'circular' && first < 1)
- first = 1;
-
- if (this.inTail && back) {
- pos += this.tail;
- this.inTail = false;
- }
-
- this.tail = null;
- if (this.options.wrap != 'circular' && last == this.options.size && (last - visible + 1) >= 1) {
- var m = $jc.margin(this.get(last), !this.options.vertical ? 'marginRight' : 'marginBottom');
- if ((v - m) > clipping)
- this.tail = v - clipping - m;
- }
-
- // Adjust position
- while (i-- > first)
- pos += this.dimension(this.get(i));
-
- // Save visible item range
- this.prevFirst = this.first;
- this.prevLast = this.last;
- this.first = first;
- this.last = last;
-
- return pos;
- },
-
- /**
- * Animates the carousel to a certain position.
- *
- * @name animate
- * @type undefined
- * @param mixed p Position to scroll to.
- * @param Bool a Flag indicating whether to perform animation.
- * @cat Plugins/jCarousel
- */
- animate: function(p, a) {
- if (this.locked || this.animating)
- return;
-
- this.animating = true;
-
- var self = this;
- var scrolled = function() {
- self.animating = false;
-
- if (p == 0)
- self.list.css(self.lt, 0);
-
- if (self.options.wrap == 'both' || self.options.wrap == 'last' || self.options.size == null || self.last < self.options.size)
- self.startAuto();
-
- self.buttons();
- self.notify('onAfterAnimation');
- };
-
- this.notify('onBeforeAnimation');
-
- // Animate
- if (!this.options.animation || a == false) {
- this.list.css(this.lt, p + 'px');
- scrolled();
- } else {
- var o = !this.options.vertical ? {'left': p} : {'top': p};
- this.list.animate(o, this.options.animation, this.options.easing, scrolled);
- }
- },
-
- /**
- * Starts autoscrolling.
- *
- * @name auto
- * @type undefined
- * @param Number s Seconds to periodically autoscroll the content.
- * @cat Plugins/jCarousel
- */
- startAuto: function(s) {
- if (s != undefined)
- this.options.auto = s;
-
- if (this.options.auto == 0)
- return this.stopAuto();
-
- if (this.timer != null)
- return;
-
- var self = this;
- this.timer = setTimeout(function() { self.next(); }, this.options.auto * 1000);
- },
-
- /**
- * Stops autoscrolling.
- *
- * @name stopAuto
- * @type undefined
- * @cat Plugins/jCarousel
- */
- stopAuto: function() {
- if (this.timer == null)
- return;
-
- clearTimeout(this.timer);
- this.timer = null;
- },
-
- /**
- * Sets the states of the prev/next buttons.
- *
- * @name buttons
- * @type undefined
- * @cat Plugins/jCarousel
- */
- buttons: function(n, p) {
- if (n == undefined || n == null) {
- var n = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'first') || this.options.size == null || this.last < this.options.size);
- if (!this.locked && (!this.options.wrap || this.options.wrap == 'first') && this.options.size != null && this.last >= this.options.size)
- n = this.tail != null && !this.inTail;
- }
-
- if (p == undefined || p == null) {
- var p = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'last') || this.first > 1);
- if (!this.locked && (!this.options.wrap || this.options.wrap == 'last') && this.options.size != null && this.first == 1)
- p = this.tail != null && this.inTail;
- }
-
- var self = this;
-
- this.buttonNext[n ? 'bind' : 'unbind'](this.options.buttonNextEvent, this.funcNext)[n ? 'removeClass' : 'addClass'](this.className('jcarousel-next-disabled')).attr('disabled', n ? false : true);
- this.buttonPrev[p ? 'bind' : 'unbind'](this.options.buttonPrevEvent, this.funcPrev)[p ? 'removeClass' : 'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled', p ? false : true);
-
- if (this.buttonNext.length > 0 && (this.buttonNext[0].jcarouselstate == undefined || this.buttonNext[0].jcarouselstate != n) && this.options.buttonNextCallback != null) {
- this.buttonNext.each(function() { self.options.buttonNextCallback(self, this, n); });
- this.buttonNext[0].jcarouselstate = n;
- }
-
- if (this.buttonPrev.length > 0 && (this.buttonPrev[0].jcarouselstate == undefined || this.buttonPrev[0].jcarouselstate != p) && this.options.buttonPrevCallback != null) {
- this.buttonPrev.each(function() { self.options.buttonPrevCallback(self, this, p); });
- this.buttonPrev[0].jcarouselstate = p;
- }
- },
-
- notify: function(evt) {
- var state = this.prevFirst == null ? 'init' : (this.prevFirst < this.first ? 'next' : 'prev');
-
- // Load items
- this.callback('itemLoadCallback', evt, state);
-
- if (this.prevFirst != this.first) {
- this.callback('itemFirstInCallback', evt, state, this.first);
- this.callback('itemFirstOutCallback', evt, state, this.prevFirst);
- }
-
- if (this.prevLast != this.last) {
- this.callback('itemLastInCallback', evt, state, this.last);
- this.callback('itemLastOutCallback', evt, state, this.prevLast);
- }
-
- this.callback('itemVisibleInCallback', evt, state, this.first, this.last, this.prevFirst, this.prevLast);
- this.callback('itemVisibleOutCallback', evt, state, this.prevFirst, this.prevLast, this.first, this.last);
- },
-
- callback: function(cb, evt, state, i1, i2, i3, i4) {
- if (this.options[cb] == undefined || (typeof this.options[cb] != 'object' && evt != 'onAfterAnimation'))
- return;
-
- var callback = typeof this.options[cb] == 'object' ? this.options[cb][evt] : this.options[cb];
-
- if (!$.isFunction(callback))
- return;
-
- var self = this;
-
- if (i1 === undefined)
- callback(self, state, evt);
- else if (i2 === undefined)
- this.get(i1).each(function() { callback(self, this, i1, state, evt); });
- else {
- for (var i = i1; i <= i2; i++)
- if (!(i >= i3 && i <= i4))
- this.get(i).each(function() { callback(self, this, i, state, evt); });
- }
- },
-
- create: function(i) {
- return this.format('<li></li>', i);
- },
-
- format: function(e, i) {
- var $e = $(e).addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-' + i));
- $e.attr('jcarouselindex', i);
- return $e;
- },
-
- className: function(c) {
- return c + ' ' + c + (!this.options.vertical ? '-horizontal' : '-vertical');
- },
-
- dimension: function(e, d) {
- var el = e.jquery != undefined ? e[0] : e;
-
- var old = !this.options.vertical ?
- el.offsetWidth + $jc.margin(el, 'marginLeft') + $jc.margin(el, 'marginRight') :
- el.offsetHeight + $jc.margin(el, 'marginTop') + $jc.margin(el, 'marginBottom');
-
- if (d == undefined || old == d)
- return old;
-
- var w = !this.options.vertical ?
- d - $jc.margin(el, 'marginLeft') - $jc.margin(el, 'marginRight') :
- d - $jc.margin(el, 'marginTop') - $jc.margin(el, 'marginBottom');
-
- $(el).css(this.wh, w + 'px');
-
- return this.dimension(el);
- },
-
- clipping: function() {
- return !this.options.vertical ?
- this.clip[0].offsetWidth - $jc.intval(this.clip.css('borderLeftWidth')) - $jc.intval(this.clip.css('borderRightWidth')) :
- this.clip[0].offsetHeight - $jc.intval(this.clip.css('borderTopWidth')) - $jc.intval(this.clip.css('borderBottomWidth'));
- },
-
- index: function(i, s) {
- if (s == undefined)
- s = this.options.size;
-
- return Math.round((((i-1) / s) - Math.floor((i-1) / s)) * s) + 1;
- }
- });
-
- $jc.extend({
- /**
- * Sets the global default configuration properties.
- *
- * @name defaults
- * @descr Sets the global default configuration properties.
- * @type undefined
- * @param Hash d A set of key/value pairs to set as configuration properties.
- * @cat Plugins/jCarousel
- */
- defaults: function(d) {
- $.extend(defaults, d);
- },
-
- margin: function(e, p) {
- if (!e)
- return 0;
-
- var el = e.jquery != undefined ? e[0] : e;
-
- if (p == 'marginRight' && $.browser.safari) {
- var old = {'display': 'block', 'float': 'none', 'width': 'auto'}, oWidth, oWidth2;
-
- $.swap(el, old, function() { oWidth = el.offsetWidth; });
-
- old['marginRight'] = 0;
- $.swap(el, old, function() { oWidth2 = el.offsetWidth; });
-
- return oWidth2 - oWidth;
- }
-
- return $jc.intval($.css(el, p));
- },
-
- intval: function(v) {
- v = parseInt(v);
- return isNaN(v) ? 0 : v;
- }
- });
-
-})(jQuery);
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.utils.js
===================================================================
--- trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.utils.js 2010-12-23 16:01:59 UTC (rev 20777)
+++ trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.utils.js 2010-12-23 16:06:35 UTC (rev 20778)
@@ -1,83 +0,0 @@
-if (!window.Richfaces) {
- window.Richfaces = {};
-}
-
-Richfaces.jQuery = {};
-
-(function(_r$, jQuery) {
- var PX_REGEX = /^\s*[^\s]*px\s*$/;
-
- var parseToPx = function(value) {
- if (value) {
- if (PX_REGEX.test(value)) {
- try {
- return parseInt(value.replace(PX_REGEX, ""), 10);
- } catch (e) { }
- }
- }
-
- return NaN;
- };
-
- _r$.position = function(rect, element) {
- var jqe = jQuery(element);
- var width = jqe.width();
- var height = jqe.height();
-
- var left = parseToPx(jqe.css('left'));
- if (isNaN(left)) {
- left = 0;
- jqe.css('left', '0px');
- }
-
- var top = parseToPx(jqe.css('top'));
- if (isNaN(top)) {
- top = 0;
- jqe.css('top', '0px');
- }
-
- var elementOffset = jqe.offset();
-
- var jqw = jQuery(window);
-
- var winWidth = jqw.width();
- var winLeft = jqw.scrollLeft();
-
- var winHeight = jqw.height();
- var winTop = jqw.scrollTop();
-
- var newLeft;
- if (rect.left + width > winLeft + winWidth && rect.left + rect.width - width >= winLeft) {
- newLeft = rect.left + rect.width - width;
- } else {
- newLeft = rect.left;
- }
-
- var newTop;
- if (rect.top + rect.height + height > winTop + winHeight && rect.top - height >= winTop) {
- newTop = rect.top - height;
- } else {
- newTop = rect.top + rect.height;
- }
-
- left += newLeft - elementOffset.left;
- top += newTop - elementOffset.top;
-
- jqe.css('left', (left + 'px')).css('top', (top + 'px'));
- };
-
- _r$.getPointerRectangle = function(event) {
- var e = jQuery.event.fix(event);
-
- return {width: 0, height: 0, left: e.pageX, top: e.pageY};
- };
-
- _r$.getElementRectangle = function(element) {
- var jqe = jQuery(element);
- var offset = jqe.offset();
-
- return {width: jqe.width(), height: jqe.height(), left: offset.left, top: offset.top};
- };
-
-}(Richfaces.jQuery, jQuery));
-
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/skinning.js
===================================================================
--- trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/skinning.js 2010-12-23 16:01:59 UTC (rev 20777)
+++ trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/skinning.js 2010-12-23 16:06:35 UTC (rev 20778)
@@ -1,11 +0,0 @@
-(function(jQuery) {
- var userAgent = navigator.userAgent;
- var skipNavigator = window.opera || (userAgent.indexOf('AppleWebKit/') > -1 && userAgent.indexOf('Chrome/') == -1);
- if (!skipNavigator) {
- var f = function() {
- jQuery("head > link[media='rich-extended-skinning']").removeAttr('media');
- };
- jQuery(document).ready(f);
- f();
- }
-}(jQuery));
\ No newline at end of file
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/ui.core.js
===================================================================
--- trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/ui.core.js 2010-12-23 16:01:59 UTC (rev 20777)
+++ trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/ui.core.js 2010-12-23 16:06:35 UTC (rev 20778)
@@ -1,519 +0,0 @@
-/*
- * jQuery UI 1.7.1
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
-;jQuery.ui || (function($) {
-
-var _remove = $.fn.remove,
- isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
-
-//Helper functions and ui object
-$.ui = {
- version: "1.7.1",
-
- // $.ui.plugin is deprecated. Use the proxy pattern instead.
- plugin: {
- add: function(module, option, set) {
- var proto = $.ui[module].prototype;
- for(var i in set) {
- proto.plugins[i] = proto.plugins[i] || [];
- proto.plugins[i].push([option, set[i]]);
- }
- },
- call: function(instance, name, args) {
- var set = instance.plugins[name];
- if(!set || !instance.element[0].parentNode) { return; }
-
- for (var i = 0; i < set.length; i++) {
- if (instance.options[set[i][0]]) {
- set[i][1].apply(instance.element, args);
- }
- }
- }
- },
-
- contains: function(a, b) {
- return document.compareDocumentPosition
- ? a.compareDocumentPosition(b) & 16
- : a !== b && a.contains(b);
- },
-
- hasScroll: function(el, a) {
-
- //If overflow is hidden, the element might have extra content, but the user wants to hide it
- if ($(el).css('overflow') == 'hidden') { return false; }
-
- var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
- has = false;
-
- if (el[scroll] > 0) { return true; }
-
- // TODO: determine which cases actually cause this to happen
- // if the element doesn't have the scroll set, see if it's possible to
- // set the scroll
- el[scroll] = 1;
- has = (el[scroll] > 0);
- el[scroll] = 0;
- return has;
- },
-
- isOverAxis: function(x, reference, size) {
- //Determines when x coordinate is over "b" element axis
- return (x > reference) && (x < (reference + size));
- },
-
- isOver: function(y, x, top, left, height, width) {
- //Determines when x, y coordinates is over "b" element
- return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
- },
-
- keyCode: {
- BACKSPACE: 8,
- CAPS_LOCK: 20,
- COMMA: 188,
- CONTROL: 17,
- DELETE: 46,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- HOME: 36,
- INSERT: 45,
- LEFT: 37,
- NUMPAD_ADD: 107,
- NUMPAD_DECIMAL: 110,
- NUMPAD_DIVIDE: 111,
- NUMPAD_ENTER: 108,
- NUMPAD_MULTIPLY: 106,
- NUMPAD_SUBTRACT: 109,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- RIGHT: 39,
- SHIFT: 16,
- SPACE: 32,
- TAB: 9,
- UP: 38
- }
-};
-
-// WAI-ARIA normalization
-if (isFF2) {
- var attr = $.attr,
- removeAttr = $.fn.removeAttr,
- ariaNS = "http://www.w3.org/2005/07/aaa",
- ariaState = /^aria-/,
- ariaRole = /^wairole:/;
-
- $.attr = function(elem, name, value) {
- var set = value !== undefined;
-
- return (name == 'role'
- ? (set
- ? attr.call(this, elem, name, "wairole:" + value)
- : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
- : (ariaState.test(name)
- ? (set
- ? elem.setAttributeNS(ariaNS,
- name.replace(ariaState, "aaa:"), value)
- : attr.call(this, elem, name.replace(ariaState, "aaa:")))
- : attr.apply(this, arguments)));
- };
-
- $.fn.removeAttr = function(name) {
- return (ariaState.test(name)
- ? this.each(function() {
- this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
- }) : removeAttr.call(this, name));
- };
-}
-
-//jQuery plugins
-$.fn.extend({
- remove: function() {
- // Safari has a native remove event which actually removes DOM elements,
- // so we have to use triggerHandler instead of trigger (#3037).
- $("*", this).add(this).each(function() {
- $(this).triggerHandler("remove");
- });
- return _remove.apply(this, arguments );
- },
-
- enableSelection: function() {
- return this
- .attr('unselectable', 'off')
- .css('MozUserSelect', '')
- .unbind('selectstart.ui');
- },
-
- disableSelection: function() {
- return this
- .attr('unselectable', 'on')
- .css('MozUserSelect', 'none')
- .bind('selectstart.ui', function() { return false; });
- },
-
- scrollParent: function() {
- var scrollParent;
- if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
- scrollParent = this.parents().filter(function() {
- return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- } else {
- scrollParent = this.parents().filter(function() {
- return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- }
-
- return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
- }
-});
-
-
-//Additional selectors
-$.extend($.expr[':'], {
- data: function(elem, i, match) {
- return !!$.data(elem, match[3]);
- },
-
- focusable: function(element) {
- var nodeName = element.nodeName.toLowerCase(),
- tabIndex = $.attr(element, 'tabindex');
- return (/input|select|textarea|button|object/.test(nodeName)
- ? !element.disabled
- : 'a' == nodeName || 'area' == nodeName
- ? element.href || !isNaN(tabIndex)
- : !isNaN(tabIndex))
- // the element and all of its ancestors must be visible
- // the browser may report that the area is hidden
- && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
- },
-
- tabbable: function(element) {
- var tabIndex = $.attr(element, 'tabindex');
- return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
- }
-});
-
-
-// $.widget is a factory to create jQuery plugins
-// taking some boilerplate code out of the plugin code
-function getter(namespace, plugin, method, args) {
- function getMethods(type) {
- var methods = $[namespace][plugin][type] || [];
- return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
- }
-
- var methods = getMethods('getter');
- if (args.length == 1 && typeof args[0] == 'string') {
- methods = methods.concat(getMethods('getterSetter'));
- }
- return ($.inArray(method, methods) != -1);
-}
-
-$.widget = function(name, prototype) {
- var namespace = name.split(".")[0];
- name = name.split(".")[1];
-
- // create plugin method
- $.fn[name] = function(options) {
- var isMethodCall = (typeof options == 'string'),
- args = Array.prototype.slice.call(arguments, 1);
-
- // prevent calls to internal methods
- if (isMethodCall && options.substring(0, 1) == '_') {
- return this;
- }
-
- // handle getter methods
- if (isMethodCall && getter(namespace, name, options, args)) {
- var instance = $.data(this[0], name);
- return (instance ? instance[options].apply(instance, args)
- : undefined);
- }
-
- // handle initialization and non-getter methods
- return this.each(function() {
- var instance = $.data(this, name);
-
- // constructor
- (!instance && !isMethodCall &&
- $.data(this, name, new $[namespace][name](this, options))._init());
-
- // method call
- (instance && isMethodCall && $.isFunction(instance[options]) &&
- instance[options].apply(instance, args));
- });
- };
-
- // create widget constructor
- $[namespace] = $[namespace] || {};
- $[namespace][name] = function(element, options) {
- var self = this;
-
- this.namespace = namespace;
- this.widgetName = name;
- this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
- this.widgetBaseClass = namespace + '-' + name;
-
- this.options = $.extend({},
- $.widget.defaults,
- $[namespace][name].defaults,
- $.metadata && $.metadata.get(element)[name],
- options);
-
- this.element = $(element)
- .bind('setData.' + name, function(event, key, value) {
- if (event.target == element) {
- return self._setData(key, value);
- }
- })
- .bind('getData.' + name, function(event, key) {
- if (event.target == element) {
- return self._getData(key);
- }
- })
- .bind('remove', function() {
- return self.destroy();
- });
- };
-
- // add widget prototype
- $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
-
- // TODO: merge getter and getterSetter properties from widget prototype
- // and plugin prototype
- $[namespace][name].getterSetter = 'option';
-};
-
-$.widget.prototype = {
- _init: function() {},
- destroy: function() {
- this.element.removeData(this.widgetName)
- .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
- .removeAttr('aria-disabled');
- },
-
- option: function(key, value) {
- var options = key,
- self = this;
-
- if (typeof key == "string") {
- if (value === undefined) {
- return this._getData(key);
- }
- options = {};
- options[key] = value;
- }
-
- $.each(options, function(key, value) {
- self._setData(key, value);
- });
- },
- _getData: function(key) {
- return this.options[key];
- },
- _setData: function(key, value) {
- this.options[key] = value;
-
- if (key == 'disabled') {
- this.element
- [value ? 'addClass' : 'removeClass'](
- this.widgetBaseClass + '-disabled' + ' ' +
- this.namespace + '-state-disabled')
- .attr("aria-disabled", value);
- }
- },
-
- enable: function() {
- this._setData('disabled', false);
- },
- disable: function() {
- this._setData('disabled', true);
- },
-
- _trigger: function(type, event, data) {
- var callback = this.options[type],
- eventName = (type == this.widgetEventPrefix
- ? type : this.widgetEventPrefix + type);
-
- event = $.Event(event);
- event.type = eventName;
-
- // copy original event properties over to the new event
- // this would happen if we could call $.event.fix instead of $.Event
- // but we don't have a way to force an event to be fixed multiple times
- if (event.originalEvent) {
- for (var i = $.event.props.length, prop; i;) {
- prop = $.event.props[--i];
- event[prop] = event.originalEvent[prop];
- }
- }
-
- this.element.trigger(event, data);
-
- return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
- || event.isDefaultPrevented());
- }
-};
-
-$.widget.defaults = {
- disabled: false
-};
-
-
-/** Mouse Interaction Plugin **/
-
-$.ui.mouse = {
- _mouseInit: function() {
- var self = this;
-
- this.element
- .bind('mousedown.'+this.widgetName, function(event) {
- return self._mouseDown(event);
- })
- .bind('click.'+this.widgetName, function(event) {
- if(self._preventClickEvent) {
- self._preventClickEvent = false;
- event.stopImmediatePropagation();
- return false;
- }
- });
-
- // Prevent text selection in IE
- if ($.browser.msie) {
- this._mouseUnselectable = this.element.attr('unselectable');
- this.element.attr('unselectable', 'on');
- }
-
- this.started = false;
- },
-
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- _mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
-
- // Restore text selection in IE
- ($.browser.msie
- && this.element.attr('unselectable', this._mouseUnselectable));
- },
-
- _mouseDown: function(event) {
- // don't let more than one widget handle mouseStart
- // TODO: figure out why we have to use originalEvent
- event.originalEvent = event.originalEvent || {};
- if (event.originalEvent.mouseHandled) { return; }
-
- // we may have missed mouseup (out of window)
- (this._mouseStarted && this._mouseUp(event));
-
- this._mouseDownEvent = event;
-
- var self = this,
- btnIsLeft = (event.which == 1),
- elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
- return true;
- }
-
- this.mouseDelayMet = !this.options.delay;
- if (!this.mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function() {
- self.mouseDelayMet = true;
- }, this.options.delay);
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted = (this._mouseStart(event) !== false);
- if (!this._mouseStarted) {
- event.preventDefault();
- return true;
- }
- }
-
- // these delegates are required to keep context
- this._mouseMoveDelegate = function(event) {
- return self._mouseMove(event);
- };
- this._mouseUpDelegate = function(event) {
- return self._mouseUp(event);
- };
- $(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- // preventDefault() is used to prevent the selection of text here -
- // however, in Safari, this causes select boxes not to be selectable
- // anymore, so this fix is needed
- ($.browser.safari || event.preventDefault());
-
- event.originalEvent.mouseHandled = true;
- return true;
- },
-
- _mouseMove: function(event) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.browser.msie && !event.button) {
- return this._mouseUp(event);
- }
-
- if (this._mouseStarted) {
- this._mouseDrag(event);
- return event.preventDefault();
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted =
- (this._mouseStart(this._mouseDownEvent, event) !== false);
- (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
- }
-
- return !this._mouseStarted;
- },
-
- _mouseUp: function(event) {
- $(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
- this._preventClickEvent = (event.target == this._mouseDownEvent.target);
- this._mouseStop(event);
- }
-
- return false;
- },
-
- _mouseDistanceMet: function(event) {
- return (Math.max(
- Math.abs(this._mouseDownEvent.pageX - event.pageX),
- Math.abs(this._mouseDownEvent.pageY - event.pageY)
- ) >= this.options.distance
- );
- },
-
- _mouseDelayMet: function(event) {
- return this.mouseDelayMet;
- },
-
- // These are placeholder methods, to be overriden by extending plugin
- _mouseStart: function(event) {},
- _mouseDrag: function(event) {},
- _mouseStop: function(event) {},
- _mouseCapture: function(event) { return true; }
-};
-
-$.ui.mouse.defaults = {
- cancel: null,
- distance: 1,
- delay: 0
-};
-
-})(jQuery);
Deleted: trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2010-12-23 16:01:59 UTC (rev 20777)
+++ trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2010-12-23 16:06:35 UTC (rev 20778)
@@ -1,519 +0,0 @@
-if (!window.Richfaces) {
- window.Richfaces = {};
-}
-
-Richfaces.mergeStyles = function(userStyles,commonStyles) {
- var i;
- for(i in userStyles) {
- if (typeof userStyles[i] == "object") {
- this.mergeStyles(userStyles[i],commonStyles[i]);
- } else {
- commonStyles[i] += " " + userStyles[i];
- }
- }
- return commonStyles;
-};
-
-Richfaces.getComputedStyle = function(eltId, propertyName) {
- var elt = $(eltId);
-
- if (elt.nodeType != Node.ELEMENT_NODE) {
- return "";
- }
-
- if (elt.currentStyle) {
- return elt.currentStyle[propertyName];
- }
-
- if (document.defaultView && document.defaultView.getComputedStyle) {
-
- var styles = document.defaultView.getComputedStyle(elt, null);
- if (styles) {
- return styles.getPropertyValue(propertyName);
- }
-
- }
-
- return "";
-};
-
-Richfaces.getComputedStyleSize = function(eltId, propertyName) {
- var value = Richfaces.getComputedStyle(eltId, propertyName);
-
- if (value) {
- value = value.strip();
- value = value.replace(/px$/, "");
-
- return parseFloat(value);
- }
-
- return 0;
-};
-
-Richfaces.getWindowSize = function() {
- var myWidth = 0, myHeight = 0;
- if( typeof( window.innerWidth ) == 'number' ) {
- myWidth = window.innerWidth;
- myHeight = window.innerHeight;
- } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
- myWidth = document.documentElement.clientWidth;
- myHeight = document.documentElement.clientHeight;
- } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
- myWidth = document.body.clientWidth;
- myHeight = document.body.clientHeight;
- }
- return {"width":myWidth,"height":myHeight};
-};
-
-Richfaces.removePX = function(str) {
- var pxIndex = str.indexOf("px")
- if ( pxIndex == -1 ) return str;
- return str.substr(0,pxIndex);
-};
-
-Richfaces.visitTree = function(root, callback) {
- var node = root;
- if (!node) {
- node = document;
- }
-
- callback.call(this, node);
-
- var child = node.firstChild;
- while (child) {
- Richfaces.visitTree(child, callback);
- child = child.nextSibling;
- }
-};
-
-Richfaces.getNSAttribute = function (name, element) {
- if (element.getAttributeNS) {
- var attr = element.getAttributeNS('http://richfaces.ajax4jsf.org/rich', name);
- if (attr) {
- return attr;
- }
- }
-
- var attributes = element.attributes;
- var attrName = "rich:" + name;
- var attr = attributes[attrName];
- if (attr) {
- return attr.nodeValue;
- }
-
-// for (var i = 0; i < attributes.length; i++) {
-// attr = attributes[i];
-// if (attr && attrName == attr.nodeName) {
-// return attr.nodeValue;
-// }
-// }
-
- return null;
-};
-
-Richfaces.VARIABLE_NAME_PATTERN = /^\s*[_,A-Z,a-z][\w,_\.]*\s*$/;
-
-Richfaces.getObjectValue = function (str, object) {
- var a=str.split(".");
- var value=object[a[0]];
- var c=1;
- while (value && c<a.length) value = value[a[c++]];
- return (value ? value : "");
-}
-
-Richfaces.evalMacro = function(template, object)
-{
- var _value_="";
- // variable evaluation
- if (Richfaces.VARIABLE_NAME_PATTERN.test(template))
- {
- if (template.indexOf('.')==-1) {
- _value_ = object[template];
- if (!_value_) _value_=window[template];
- }
- // object's variable evaluation
- else {
- _value_ = Richfaces.getObjectValue(template, object);
- if (!_value_) _value_=Richfaces.getObjectValue(template, window);
- }
- if (_value_ && typeof _value_=='function') _value_ = _value_(object);
- if (!_value_) _value_="";
- }
- //js string evaluation
- else {
- try {
- if (Richfaces.browser.isObjectEval) {
- _value_ = object.eval(template);
- }
- else with (object) {
- _value_ = eval(template) ;
- }
-
- if (typeof _value_ == 'function') {
- _value_ = _value_(object);
- }
- } catch (e) { LOG.warn("Exception: "+e.Message + "\n[" + template + "]"); }
- }
- return _value_;
-}
-Richfaces.evalSimpleMacro = function(template, object)
-{
- var value = object[template];
- if (!value) {value=window[template]; if (!value) value="";}
- return value;
-}
-
-Richfaces.getComponent = function(componentType, element)
-{
- var attribute="richfacesComponent";
- var type = "richfaces:"+componentType;
- while (element.parentNode) {
- if (element[attribute] && element[attribute]==type)
- return element.component;
- else
- element = element.parentNode;
- }
-}
-
-Richfaces.browser= {
- isIE: (!window.opera && /MSIE/.test(navigator.userAgent)),
- isIE6: (!window.opera && /MSIE\s*[6][\d,\.]+;/.test(navigator.userAgent)),
- isSafari: /Safari/.test(navigator.userAgent),
- isOpera: !!window.opera,
- isObjectEval: (Richfaces.eval!=undefined),
- isFF2: (!window.opera && /Firefox\s*[\/]2[\.]/.test(navigator.userAgent)),
- isFF3: (!window.opera && /Firefox\s*[\/]3[\.]/.test(navigator.userAgent))
-};
-
-Richfaces.eval = function(template, object) {
- var value = '';
-
- try {
- with (object) {
- value = eval(template) ;
- }
- } catch (e) {
- LOG.warn('Exception: ' + e.message + '\n[' + template + ']');
- }
-
- return value;
-};
-
-Richfaces.interpolate = function (placeholders, context) {
-
- for(var k in context) {
- var v = context[k];
- var regexp = new RegExp("\\{" + k + "\\}", "g");
- placeholders = placeholders.replace(regexp, v);
- }
-
- return placeholders;
-
-};
-
-if (!Richfaces.position) Richfaces.Position={};
-
-Richfaces.Position.setElementPosition = function(element, baseElement, jointPoint, direction, offset)
-{
- // parameters:
- // jointPoint: {x:,y:} or ('top-left','top-right','bottom'-left,'bottom-right')
- // direction: ('top-left','top-right','bottom'-left,'bottom-right', 'auto')
- // offset: {x:,y:}
-
- var elementDim = Richfaces.Position.getOffsetDimensions(element);
- var baseElementDim = Richfaces.Position.getOffsetDimensions(baseElement);
-
- var windowRect = Richfaces.Position.getWindowViewport();
-
- var baseOffset = Position.cumulativeOffset(baseElement);
-
- // jointPoint
- var ox=baseOffset[0];
- var oy=baseOffset[1];
- var re = /^(top|bottom)-(left|right)$/;
- var match;
-
- if (typeof jointPoint=='object') {ox = jointPoint.x; oy = jointPoint.y}
- else if ( jointPoint && (match=jointPoint.toLowerCase().match(re))!=null )
- {
- if (match[2]=='right') ox+=baseElementDim.width;
- if (match[1]=='bottom') oy+=baseElementDim.height;
- } else
- {
- // ??? auto
- }
-
- // direction
- if (direction && (match=direction.toLowerCase().match(re))!=null )
- {
- var d = direction.toLowerCase().split('-');
- if (match[2]=='left') { ox-=elementDim.width + offset.x; } else ox += offset.x;
- if (match[1]=='top') { oy-=elementDim.height + offset.y; } else oy += offset.y
- } else
- {
- // auto
- var theBest = {square:0};
- // jointPoint: bottom-right, direction: bottom-left
- var rect = {right: baseOffset[0] + baseElementDim.width, top: baseOffset[1] + baseElementDim.height};
- rect.left = rect.right - elementDim.width;
- rect.bottom = rect.top + elementDim.height;
- ox = rect.left; oy = rect.top;
- var s = Richfaces.Position.checkCollision(rect, windowRect);
- if (s!=0)
- {
- if (ox>=0 && oy>=0 && theBest.square<s) theBest = {x:ox, y:oy, square:s};
- // jointPoint: top-right, direction: top-left
- rect = {right: baseOffset[0] + baseElementDim.width, bottom: baseOffset[1]};
- rect.left = rect.right - elementDim.width;
- rect.top = rect.bottom - elementDim.height;
- ox = rect.left; oy = rect.top;
- s = Richfaces.Position.checkCollision(rect, windowRect);
- if (s!=0)
- {
- if (ox>=0 && oy>=0 && theBest.square<s) theBest = {x:ox, y:oy, square:s};
- // jointPoint: bottom-left, direction: bottom-right
- rect = {left: baseOffset[0], top: baseOffset[1] + baseElementDim.height};
- rect.right = rect.left + elementDim.width;
- rect.bottom = rect.top + elementDim.height;
- ox = rect.left; oy = rect.top;
- s = Richfaces.Position.checkCollision(rect, windowRect);
- if (s!=0)
- {
- if (ox>=0 && oy>=0 && theBest.square<s) theBest = {x:ox, y:oy, square:s};
- // jointPoint: top-left, direction: top-right
- rect = {left: baseOffset[0], bottom: baseOffset[1]};
- rect.right = rect.left + elementDim.width;
- rect.top = rect.bottom - elementDim.height;
- ox = rect.left; oy = rect.top;
- s = Richfaces.Position.checkCollision(rect, windowRect);
- if (s!=0)
- {
- // the best way selection
- if (ox<0 || oy<0 || theBest.square>s) {ox=theBest.x; oy=theBest.y}
- }
- }
- }
-
- }
- }
-
- element.style.left = ox + 'px';
- element.style.top = oy + 'px';
-};
-
-Richfaces.Position.getOffsetDimensions = function(element) {
- // from prototype 1.5.0 // Pavel Yascenko
- element = $(element);
- var display = $(element).getStyle('display');
- if (display != 'none' && display != null) // Safari bug
- return {width: element.offsetWidth, height: element.offsetHeight};
-
- // All *Width and *Height properties give 0 on elements with display none,
- // so enable the element temporarily
- var els = element.style;
- var originalVisibility = els.visibility;
- var originalPosition = els.position;
- var originalDisplay = els.display;
- els.visibility = 'hidden';
- els.position = 'absolute';
- els.display = 'block';
- var originalWidth = element.offsetWidth; // was element.clientWidth // Pavel Yascenko
- var originalHeight = element.offsetHeight; // was element.clientHeight // Pavel Yascenko
- els.display = originalDisplay;
- els.position = originalPosition;
- els.visibility = originalVisibility;
- return {width: originalWidth, height: originalHeight};
-};
-
-Richfaces.Position.checkCollision = function(elementRect, windowRect, windowOffset)
-{
- if (elementRect.left >= windowRect.left &&
- elementRect.top >= windowRect.top &&
- elementRect.right <= windowRect.right &&
- elementRect.bottom <= windowRect.bottom)
- return 0;
-
- var rect = {left: (elementRect.left>windowRect.left ? elementRect.left : windowRect.left),
- top: (elementRect.top>windowRect.top ? elementRect.top : windowRect.top),
- right: (elementRect.right<windowRect.right ? elementRect.right : windowRect.right),
- bottom: (elementRect.bottom<windowRect.bottom ? elementRect.bottom : windowRect.bottom)};
- return (rect.right-rect.left)* (rect.bottom-rect.top);
-};
-
-
-Richfaces.Position.getWindowDimensions = function() {
- var w = self.innerWidth
- || document.documentElement.clientWidth
- || document.body.clientWidth
- || 0;
- var h = self.innerHeight
- || document.documentElement.clientHeight
- || document.body.clientHeight
- || 0;
- return {width:w, height: h};
-};
-
-Richfaces.Position.getWindowScrollOffset = function() {
- var dx = window.pageXOffset
- || document.documentElement.scrollLeft
- || document.body.scrollLeft
- || 0;
- var dy = window.pageYOffset
- || document.documentElement.scrollTop
- || document.body.scrollTop
- || 0;
- return {left:dx, top: dy};
-};
-
-Richfaces.Position.getWindowViewport = function() {
- var windowDim = Richfaces.Position.getWindowDimensions();
- var windowOffset = Richfaces.Position.getWindowScrollOffset();
- return {left:windowOffset.left, top:windowOffset.top, right: windowDim.width+windowOffset.left, bottom: windowDim.height+windowOffset.top};
-};
-
-Richfaces.firstDescendant = function(node) {
- var n = node.firstChild;
- while (n && n.nodeType != 1) {
- n = n.nextSibling;
- }
-
- return n;
-};
-
-Richfaces.lastDescendant = function(node) {
- var n = node.lastChild;
- while (n && n.nodeType != 1) {
- n = n.previousSibling;
- }
-
- return n;
-};
-
-Richfaces.next = function(node) {
- var n = node;
- do {
- n = n.nextSibling;
- } while (n && n.nodeType != 1);
-
- return n;
-};
-
-Richfaces.previous = function(node) {
- var n = node;
- do {
- n = n.previousSibling;
- } while (n && n.nodeType != 1);
-
- return n;
-};
-
-Richfaces.removeNode = function(node) {
- if (node) {
- var parentNode = node.parentNode;
- if (parentNode) {
- parentNode.removeChild(node);
- }
- }
-};
-
-Richfaces.readAttribute = function(element, name) {
- var result = null;
-
- var node = element.getAttributeNode(name);
- if (node) {
- result = node.nodeValue;
- }
-
- return result;
-};
-
-Richfaces.writeAttribute = function(element, name, value) {
- var node = element.getAttributeNode(name);
-
- if (value !== null) {
- if (node) {
- node.nodeValue = value;
- } else {
- node = document.createAttribute(name);
- node.nodeValue = value;
- element.setAttributeNode(node);
- }
- } else {
- if (node) {
- element.removeAttributeNode(node);
- }
- }
-};
-
-Richfaces.mergeObjects = function() {
- var target = arguments[0];
- if (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- if (source) {
- for (var name in source) {
- if (!target[name]) {
- target[name] = source[name];
- }
- }
- }
- }
- }
-};
-
-Richfaces.invokeEvent = function(eventFunc, element, eventName, memo) {
- var result;
- if (eventFunc) {
- element = $(element);
- if (element == document && document.createEvent && !element.dispatchEvent)
- element = document.documentElement;
-
- var event;
- if (document.createEvent) {
- event = document.createEvent("HTMLEvents");
- event.initEvent("dataavailable", true, true);
- } else {
- event = document.createEventObject();
- event.eventType = "ondataavailable";
- }
-
- event.eventName = eventName;
- event.rich = {component:this};
- event.memo = memo || { };
- try {
- result = eventFunc.call(element,event);
- }
- catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }
- }
- if (result!=false) result = true;
- return result;
-};
-
-Richfaces.setupScrollEventHandlers = function(element, handler) {
-
- var elements = []
-
- element = element.parentNode;
- while (element && element!=window.document.body)
- {
- if (element.offsetWidth!=element.scrollWidth || element.offsetHeight!=element.scrollHeight)
- {
- elements.push(element);
- Event.observe(element, "scroll", handler, false);
- }
- element = element.parentNode;
- }
-
- return elements;
-};
-
-Richfaces.removeScrollEventHandlers = function(elements, handler) {
- if (elements)
- {
- for (var i=0;i<elements.length;i++)
- {
- Event.stopObserving(elements[i], "scroll", handler, false);
- }
- elements = null;
- }
-};
14 years, 9 months
JBoss Rich Faces SVN: r20777 - in trunk/core/impl/src/main/resources/org: ajax4jsf/org and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-23 11:01:59 -0500 (Thu, 23 Dec 2010)
New Revision: 20777
Removed:
trunk/core/impl/src/main/resources/org/ajax4jsf/javascript/jsshell.html
trunk/core/impl/src/main/resources/org/ajax4jsf/javascript/scripts/
trunk/core/impl/src/main/resources/org/ajax4jsf/org/w3c/
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/
trunk/core/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/
Log:
Legacy 3.x code removal
Deleted: trunk/core/impl/src/main/resources/org/ajax4jsf/javascript/jsshell.html
===================================================================
--- trunk/core/impl/src/main/resources/org/ajax4jsf/javascript/jsshell.html 2010-12-23 15:55:58 UTC (rev 20776)
+++ trunk/core/impl/src/main/resources/org/ajax4jsf/javascript/jsshell.html 2010-12-23 16:01:59 UTC (rev 20777)
@@ -1,740 +0,0 @@
-<!-- short bookmarklet
-// javascript:function loadScript(scriptURL) { var scriptElem = document.createElement('SCRIPT'); scriptElem.setAttribute('language', 'JavaScript'); scriptElem.setAttribute('src', scriptURL); document.body.appendChild(scriptElem);} loadScript('http://blog.monstuff.com/archives/images/jsshell.js');
-
-
-with(window.open("","_blank","width="+screen.width*.6+",left="+screen.width*.35+",height="+screen.height*.9+",resizable,scrollbars=yes")){document.write("" +
--->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-
-<html >
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>JavaScript Shell 1.4 modified to support IE</title>
-
-<script type="text/javascript">
-var
-histList = [""],
-histPos = 0,
-_scope = {},
-_win, // a top-level context
-question,
-_in,
-_out,
-tooManyMatches = null,
-lastError = null;
-
-function refocus()
-{
- _in.blur(); // Needed for Mozilla to scroll correctly.
- _in.focus();
-}
-
-function init()
-{
- _in = document.getElementById("input");
- _out = document.getElementById("output");
-
- _win = window;
-
- if (opener && !opener.closed)
- {
- println("Using bookmarklet version of shell: commands will run in opener's context.", "message");
- _win = opener;
- }
-
- initTarget();
-
- recalculateInputHeight();
- refocus();
-}
-
-function initTarget()
-{
- _win.Shell = window;
- _win.print = shellCommands.print;
-}
-
-
-// Unless the user is selected something, refocus the textbox.
-// (requested by caillon, brendan, asa)
-function keepFocusInTextbox(e)
-{
- var g = e.srcElement ? e.srcElement : e.target; // IE vs. standard
-
- while (!g.tagName)
- g = g.parentNode;
- var t = g.tagName.toUpperCase();
- if (t=="A" || t=="INPUT")
- return;
-
- if (window.getSelection) {
- // Mozilla
- if (String(window.getSelection()))
- return;
- }
- else if (document.getSelection) {
- // Opera? Netscape 4?
- if (document.getSelection())
- return;
- }
- else {
- // IE
- if ( document.selection.createRange().text )
- return;
- }
-
- refocus();
-}
-
-function inputKeydown(e) {
- // Use onkeydown because IE doesn't support onkeypress for arrow keys
-
- //alert(e.keyCode + " ^ " + e.keycode);
-
- if (e.shiftKey && e.keyCode == 13) { // shift-enter
- // don't do anything; allow the shift-enter to insert a line break as normal
- } else if (e.keyCode == 13) { // enter
- // execute the input on enter
- try { go(); } catch(er) { alert(er); };
- setTimeout(function() { _in.value = ""; }, 0); // can't preventDefault on input, so clear it later
- } else if (e.keyCode == 38) { // up
- // go up in history if at top or ctrl-up
- if (e.ctrlKey || caretInFirstLine(_in))
- hist(true);
- } else if (e.keyCode == 40) { // down
- // go down in history if at end or ctrl-down
- if (e.ctrlKey || caretInLastLine(_in))
- hist(false);
- } else if(e.ctrlKey && e.keyCode == 32) { // ctrl-space
- tabcomplete();
- e.cancelBubble = false;
- e.returnValue = false;
- return false;
- } else if (e.keyCode == 9) { // tab
- tabcomplete();
- setTimeout(function() { refocus(); }, 0); // refocus because tab was hit
- } else { }
-
- setTimeout(recalculateInputHeight, 0);
-
- //return true;
-};
-
-function caretInFirstLine(textbox)
-{
- // IE doesn't support selectionStart/selectionEnd
- if (textbox.selectionStart == undefined)
- return true;
-
- var firstLineBreak = textbox.value.indexOf("\n");
-
- return ((firstLineBreak == -1) || (textbox.selectionStart <= firstLineBreak));
-}
-
-function caretInLastLine(textbox)
-{
- // IE doesn't support selectionStart/selectionEnd
- if (textbox.selectionEnd == undefined)
- return true;
-
- var lastLineBreak = textbox.value.lastIndexOf("\n");
-
- return (textbox.selectionEnd > lastLineBreak);
-}
-
-function recalculateInputHeight()
-{
- var rows = _in.value.split(/\n/).length
- + 1 // prevent scrollbar flickering in Mozilla
- + (window.opera ? 1 : 0); // leave room for scrollbar in Opera
-
- if (_in.rows != rows) // without this check, it is impossible to select text in Opera 7.60 or Opera 8.0.
- _in.rows = rows;
-}
-
-function println(s, type)
-{
- if((s=String(s)))
- {
- var newdiv = document.createElement("div");
- newdiv.appendChild(document.createTextNode(s));
- newdiv.className = type;
- _out.appendChild(newdiv);
- return newdiv;
- }
-}
-
-function printWithRunin(h, s, type)
-{
- var div = println(s, type);
- var head = document.createElement("strong");
- head.appendChild(document.createTextNode(h + ": "));
- div.insertBefore(head, div.firstChild);
-}
-
-
-var shellCommands =
-{
-load : function load(url)
-{
- var s = _win.document.createElement("script");
- s.type = "text/javascript";
- s.src = url;
- _win.document.getElementsByTagName("head")[0].appendChild(s);
- println("Loading " + url + "...", "message");
-},
-
-clear : function clear()
-{
- var CHILDREN_TO_PRESERVE = 3;
- while (_out.childNodes[CHILDREN_TO_PRESERVE])
- _out.removeChild(_out.childNodes[CHILDREN_TO_PRESERVE]);
-},
-
-print : function print(s) { println(s, "print"); },
-
-// the normal function, "print", shouldn't return a value
-// (suggested by brendan; later noticed it was a problem when showing others)
-pr : function pr(s)
-{
- shellCommands.print(s); // need to specify shellCommands so it doesn't try window.print()!
- return s;
-},
-
-props : function props(e, onePerLine)
-{
- if (e === null) {
- println("props called with null argument", "error");
- return;
- }
-
- if (e === undefined) {
- println("props called with undefined argument", "error");
- return;
- }
-
- var ns = ["Methods", "Fields", "Unreachables"];
- var as = [[], [], []]; // array of (empty) arrays of arrays!
- var p, j, i; // loop variables, several used multiple times
-
- var protoLevels = 0;
-
- for (p = e; p; p = p.__proto__)
- {
- for (i=0; i<ns.length; ++i)
- as[i][protoLevels] = [];
- ++protoLevels;
- }
-
- for(var a in e)
- {
- // Shortcoming: doesn't check that VALUES are the same in object and prototype.
-
- var protoLevel = -1;
- try
- {
- for (p = e; p && (a in p); p = p.__proto__)
- ++protoLevel;
- }
- catch(er) { protoLevel = 0; } // "in" operator throws when param to props() is a string
-
- var type = 1;
- try
- {
- if ((typeof e[a]) == "function")
- type = 0;
- }
- catch (er) { type = 2; }
-
- as[type][protoLevel].push(a);
- }
-
- function times(s, n) { return n ? s + times(s, n-1) : ""; }
-
- for (j=0; j<protoLevels; ++j)
- for (i=0;i<ns.length;++i)
- if (as[i][j].length)
- printWithRunin(
- ns[i] + times(" of prototype", j),
- (onePerLine ? "\n\n" : "") + as[i][j].sort().join(onePerLine ? "\n" : ", ") + (onePerLine ? "\n\n" : ""),
- "propList"
- );
-},
-
-blink : function blink(node)
-{
- if (!node) throw("blink: argument is null or undefined.");
- if (node.nodeType == null) throw("blink: argument must be a node.");
- if (node.nodeType == 3) throw("blink: argument must not be a text node");
- if (node.documentElement) throw("blink: argument must not be the document object");
-
- function setOutline(o) {
- return function() {
- if (node.style.outline != node.style.bogusProperty) {
- // browser supports outline (Firefox 1.1 and newer, CSS3, Opera 8).
- node.style.outline = o;
- }
- else if (node.style.MozOutline != node.style.bogusProperty) {
- // browser supports MozOutline (Firefox 1.0.x and older)
- node.style.MozOutline = o;
- }
- else {
- // browser only supports border (IE). border is a fallback because it moves things around.
- node.style.border = o;
- }
- }
- }
-
- function focusIt(a) {
- return function() {
- a.focus();
- }
- }
-
- if (node.ownerDocument) {
- var windowToFocusNow = (node.ownerDocument.defaultView || node.ownerDocument.parentWindow); // Moz vs. IE
- if (windowToFocusNow)
- setTimeout(focusIt(windowToFocusNow.top), 0);
- }
-
- for(var i=1;i<7;++i)
- setTimeout(setOutline((i%252)?'3px solid red':'none'), i*100);
-
- setTimeout(focusIt(window), 800);
- setTimeout(focusIt(_in), 810);
-},
-
-scope : function scope(sc)
-{
- if (!sc) sc = {};
- _scope = sc;
- println("Scope is now " + sc + ". If a variable is not found in this scope, window will also be searched. New variables will still go on window.", "message");
-},
-
-mathHelp : function mathHelp()
-{
- printWithRunin("Math constants", "E, LN2, LN10, LOG2E, LOG10E, PI, SQRT1_2, SQRT2", "propList");
- printWithRunin("Math methods", "abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random, round, sin, sqrt, tan", "propList");
-},
-
-ans : undefined
-};
-
-
-function hist(up)
-{
- // histList[0] = first command entered, [1] = second, etc.
- // type something, press up --> thing typed is now in "limbo"
- // (last item in histList) and should be reachable by pressing
- // down again.
-
- var L = histList.length;
-
- if (L == 1)
- return;
-
- if (up)
- {
- if (histPos == L-1)
- {
- // Save this entry in case the user hits the down key.
- histList[histPos] = _in.value;
- }
-
- if (histPos > 0)
- {
- histPos--;
- // Use a timeout to prevent up from moving cursor within new text
- // Set to nothing first for the same reason
- setTimeout(
- function() {
- _in.value = '';
- _in.value = histList[histPos];
- var caretPos = _in.value.length;
- if (_in.setSelectionRange)
- _in.setSelectionRange(caretPos, caretPos);
- },
- 0
- );
- }
- }
- else // down
- {
- if (histPos < L-1)
- {
- histPos++;
- _in.value = histList[histPos];
- }
- else if (histPos == L-1)
- {
- // Already on the current entry: clear but save
- if (_in.value)
- {
- histList[histPos] = _in.value;
- ++histPos;
- _in.value = "";
- }
- }
- }
-}
-
-function tabcomplete()
-{
- /*
- * Working backwards from s[from], find the spot
- * where this expression starts. It will scan
- * until it hits a mismatched ( or a space,
- * but it skips over quoted strings.
- * If stopAtDot is true, stop at a '.'
- */
- function findbeginning(s, from, stopAtDot)
- {
- /*
- * Complicated function.
- *
- * Return true if s[i] == q BUT ONLY IF
- * s[i-1] is not a backslash.
- */
- function equalButNotEscaped(s,i,q)
- {
- if(s.charAt(i) != q) // not equal go no further
- return false;
-
- if(i==0) // beginning of string
- return true;
-
- if(s.charAt(i-1) == '') // escaped?
- return false;
-
- return true;
- }
-
- var nparens = 0;
- var i;
- for(i=from; i>=0; i--)
- {
- if(s.charAt(i) == ' ')
- break;
-
- if(stopAtDot && s.charAt(i) == '.')
- break;
-
- if(s.charAt(i) == ')')
- nparens++;
- else if(s.charAt(i) == '(')
- nparens--;
-
- if(nparens < 0)
- break;
-
- // skip quoted strings
- if(s.charAt(i) == '\'' || s.charAt(i) == '"')
- {
- //dump("skipping quoted chars: ");
- var quot = s.charAt(i);
- i--;
- while(i >= 0 && !equalButNotEscaped(s,i,quot)) {
- //dump(s.charAt(i));
- i--;
- }
- //dump("\n");
- }
- }
- return i;
- }
-
- // XXX should be used more consistently (instead of using selectionStart/selectionEnd throughout code)
- // XXX doesn't work in IE, even though it contains IE-specific code
- function getcaretpos(inp)
- {
- if(inp.selectionEnd != null)
- return inp.selectionEnd;
-
- var range = document.selection.createRange();
- var isCollapsed = range.compareEndPoints("StartToEnd", range) == 0;
- if (!isCollapsed)
- range.collapse(false);
- var b = range.getBookmark();
- return b.charCodeAt(2) - 2;
- }
-
- function setselectionto(inp,pos)
- {
- if(inp.selectionStart) {
- inp.selectionStart = inp.selectionEnd = pos;
- }
- else if(inp.createTextRange) {
- var docrange = _win.Shell.document.selection.createRange();
- var inprange = inp.createTextRange();
- inprange.move('character',pos);
- inprange.select();
- }
- else { // err...
- /*
- inp.select();
- if(_win.Shell.document.getSelection())
- _win.Shell.document.getSelection() = "";
- */
- }
- }
- // get position of cursor within the input box
- var caret = getcaretpos(_in);
-
- if(caret) {
- //dump("----\n");
- var dotpos, spacepos, complete, obj;
- //dump("caret pos: " + caret + "\n");
- // see if there's a dot before here
- dotpos = findbeginning(_in.value, caret-1, true);
- //dump("dot pos: " + dotpos + "\n");
- if(dotpos == -1 || _in.value.charAt(dotpos) != '.') {
- dotpos = caret;
- //dump("changed dot pos: " + dotpos + "\n");
- }
-
- // look backwards for a non-variable-name character
- spacepos = findbeginning(_in.value, dotpos-1, false);
- //dump("space pos: " + spacepos + "\n");
- // get the object we're trying to complete on
- if(spacepos == dotpos || spacepos+1 == dotpos || dotpos == caret)
- {
- // try completing function args
- if(_in.value.charAt(dotpos) == '(' ||
- (_in.value.charAt(spacepos) == '(' && (spacepos+1) == dotpos))
- {
- var fn,fname;
- var from = (_in.value.charAt(dotpos) == '(') ? dotpos : spacepos;
- spacepos = findbeginning(_in.value, from-1, false);
-
- fname = _in.value.substr(spacepos+1,from-(spacepos+1));
- //dump("fname: " + fname + "\n");
- try {
- with(_win.Shell._scope)
- with(_win)
- with(Shell.shellCommands)
- fn = eval(fname);
- }
- catch(er) {
- //dump('fn is not a valid object\n');
- return;
- }
- if(fn == undefined) {
- //dump('fn is undefined');
- return;
- }
- if(fn instanceof Function)
- {
- // Print function definition, including argument names, but not function body
- if(!fn.toString().match(/function .+?\(\) +\{\n +\[native code\]\n\}/))
- println(fn.toString().match(/function .+?\(.*?\)/), "tabcomplete");
- }
-
- return;
- }
- else
- obj = _win;
- }
- else
- {
- var objname = _in.value.substr(spacepos+1,dotpos-(spacepos+1));
- //dump("objname: |" + objname + "|\n");
- try {
- with(_win.Shell._scope)
- with(_win)
- obj = eval(objname);
- }
- catch(er) {
- printError(er);
- return;
- }
- if(obj == undefined) {
- // sometimes this is tabcomplete's fault, so don't print it :(
- // e.g. completing from "print(document.getElements"
- // println("Can't complete from null or undefined expression " + objname, "error");
- return;
- }
- }
- //dump("obj: " + obj + "\n");
- // get the thing we're trying to complete
- if(dotpos == caret)
- {
- if(spacepos+1 == dotpos || spacepos == dotpos)
- {
- // nothing to complete
- //dump("nothing to complete\n");
- return;
- }
-
- complete = _in.value.substr(spacepos+1,dotpos-(spacepos+1));
- }
- else {
- complete = _in.value.substr(dotpos+1,caret-(dotpos+1));
- }
- //dump("complete: " + complete + "\n");
- // ok, now look at all the props/methods of this obj
- // and find ones starting with 'complete'
- var matches = [];
- var bestmatch = null;
- for(var a in obj)
- {
- //a = a.toString();
- //XXX: making it lowercase could help some cases,
- // but screws up my general logic.
- if(a.substr(0,complete.length) == complete) {
- matches.push(a);
- ////dump("match: " + a + "\n");
- // if no best match, this is the best match
- if(bestmatch == null)
- {
- bestmatch = a;
- }
- else {
- // the best match is the longest common string
- function min(a,b){ return ((a<b)?a:b); }
- var i;
- for(i=0; i< min(bestmatch.length, a.length); i++)
- {
- if(bestmatch.charAt(i) != a.charAt(i))
- break;
- }
- bestmatch = bestmatch.substr(0,i);
- ////dump("bestmatch len: " + i + "\n");
- }
- ////dump("bestmatch: " + bestmatch + "\n");
- }
- }
- bestmatch = (bestmatch || "");
- ////dump("matches: " + matches + "\n");
- var objAndComplete = (objname || obj) + "." + bestmatch;
- //dump("matches.length: " + matches.length + ", tooManyMatches: " + tooManyMatches + ", objAndComplete: " + objAndComplete + "\n");
- if(matches.length > 1 && (tooManyMatches == objAndComplete || matches.length <= 10)) {
-
- printWithRunin("Matches: ", matches.join(', '), "tabcomplete");
- tooManyMatches = null;
- }
- else if(matches.length > 10)
- {
- println(matches.length + " matches. Press tab or ctrl-space again to see them all", "tabcomplete");
- tooManyMatches = objAndComplete;
- }
- else {
- tooManyMatches = null;
- }
- if(bestmatch != "")
- {
- var sstart;
- if(dotpos == caret) {
- sstart = spacepos+1;
- }
- else {
- sstart = dotpos+1;
- }
- _in.value = _in.value.substr(0, sstart)
- + bestmatch
- + _in.value.substr(caret);
- setselectionto(_in,caret + (bestmatch.length - complete.length));
- }
- }
-}
-
-function printQuestion(q)
-{
- println(q, "input");
-}
-
-function printAnswer(a)
-{
- if (a !== undefined) {
- println(a, "normalOutput");
- shellCommands.ans = a;
- }
-}
-
-function printError(er)
-{
- var lineNumberString;
-
- lastError = er; // for debugging the shell
- if (er.name)
- {
- // lineNumberString should not be "", to avoid a very wacky bug in IE 6.
- lineNumberString = (er.lineNumber != undefined) ? (" on line " + er.lineNumber + ": ") : ": ";
- println(er.name + lineNumberString + er.message, "error"); // Because IE doesn't have error.toString.
- }
- else
- println(er, "error"); // Because security errors in Moz /only/ have toString.
-}
-
-function go(s)
-{
- _in.value = question = s ? s : _in.value;
-
- if (question == "")
- return;
-
- histList[histList.length-1] = question;
- histList[histList.length] = "";
- histPos = histList.length - 1;
-
- // Unfortunately, this has to happen *before* the JavaScript is run, so that
- // print() output will go in the right place.
- _in.value='';
- recalculateInputHeight();
- printQuestion(question);
-
- if (_win.closed) {
- printError("Target window has been closed.");
- return;
- }
-
- try { ("Shell" in _win) }
- catch(er) {
- printError("The JavaScript Shell cannot access variables in the target window. The most likely reason is that the target window now has a different page loaded and that page has a different hostname than the original page.");
- return;
- }
-
- if (!("Shell" in _win))
- initTarget(); // silent
-
- // Evaluate Shell.question using _win's eval (this is why eval isn't in the |with|, IIRC).
- _win.location.href = "javascript:try{ Shell.printAnswer(eval('with(Shell._scope) with(Shell.shellCommands) {' + Shell.question + String.fromCharCode(10) + '}')); } catch(er) { Shell.printError(er); }; setTimeout(Shell.refocus, 0); void 0";
-}
-
-</script>
-
-<!-- for http://ted.mielczarek.org/code/mozilla/extensiondev/ -->
-<script type="text/javascript" src="chrome://extensiondev/content/rdfhistory.js"></script>
-<script type="text/javascript" src="chrome://extensiondev/content/chromeShellExtras.js"></script>
-
-<style type="text/css">
-body { background: white; color: black; }
-
-#output { white-space: pre; white-space: -moz-pre-wrap; } /* Preserve line breaks, but wrap too if browser supports it */
-h3 { margin-top: 0; margin-bottom: 0em; }
-h3 + div { margin: 0; }
-
-form { margin: 0; padding: 0; }
-#input { width: 100%; border: none; padding: 0; overflow: auto; }
-
-.input { color: blue; background: white; font: inherit; font-weight: bold; margin-top: .5em; /* background: #E6E6FF; */ }
-.normalOutput { color: black; background: white; }
-.print { color: brown; background: white; }
-.error { color: red; background: white; }
-.propList { color: green; background: white; }
-.message { color: green; background: white; }
-.tabcomplete { color: purple; background: white; }
-</style>
-</head>
-
-<body onload="init()" onclick="keepFocusInTextbox(event)">
-
-<div id="output"><h3>JavaScript Shell 1.4</h3><h4>Modified by <a href="http://blog.monstuff.com">Julien Couvreur</a> to work in IE.</h4><div>Features: autocompletion of property names with Tab and Ctrl-Space, multiline input with Shift+Enter, input history with (Ctrl+) Up/Down, <a accesskey="M" href="javascript:go('scope(Math); mathHelp();');" title="Accesskey: M">Math</a>, <a accesskey="H" href="http://www.squarefree.com/shell/?ignoreReferrerFrom=shell1.4" title="Accesskey: H">help</a></div><div>Values and functions: ans, print(string), <a accesskey="P" href="javascript:go('props(ans)')" title="Accesskey: P">props(object)</a>, <a accesskey="B" href="javascript:go('blink(ans)')" title="Accesskey: B">blink(node)</a>, <a accesskey="C" href="javascript:go('clear()')" title="Accesskey: C">clear()</a>, load(scriptURL), scope(object)</div></div>
-
-<div><textarea id="input" class="input" wrap="off" onkeydown="inputKeydown(event)" rows="1"></textarea></div>
-
-</body>
-
-</html>
-<!--
-");document.close();}
--->
\ No newline at end of file
14 years, 9 months
JBoss Rich Faces SVN: r20776 - in trunk: ui/common/ui/src/main/java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-23 10:55:58 -0500 (Thu, 23 Dec 2010)
New Revision: 20776
Removed:
trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java
trunk/ui/common/ui/src/main/java/org/richfaces/component/MethodBindingMethodExpressionAdaptor.java
trunk/ui/common/ui/src/main/java/org/richfaces/component/MethodExpressionMethodBindingAdaptor.java
Modified:
trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java
trunk/ui/core/ui/src/main/java/org/richfaces/resource/MediaOutputResource.java
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/MediaOutputHandler.java
Log:
https://issues.jboss.org/browse/RF-2968
Modified: trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2010-12-23 15:45:04 UTC (rev 20775)
+++ trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2010-12-23 15:55:58 UTC (rev 20776)
@@ -25,7 +25,7 @@
import java.util.Date;
-import javax.faces.el.MethodBinding;
+import javax.el.MethodExpression;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
@@ -113,14 +113,20 @@
public abstract void setValue(Object newvalue);
/**
- * Get El binding to method in user bean to send resource. Method will called with two parameters - restored data object and servlet output stream.
- * @return
+ * Get MethodExpression to method in user bean to send resource. Method will
+ * called with two parameters - restored data object and servlet output
+ * stream.
+ *
+ * @return MethodExpression
*/
- public abstract MethodBinding getCreateContent();
+ public abstract MethodExpression getCreateContent();
/**
- * Set El binding to method in user bean to send resource. Method will called with two parameters - restored data object and servlet output stream.
- * @param newvalue
+ * Set MethodExpression to method in user bean to send resource. Method will
+ * called with two parameters - restored data object and servlet output
+ * stream.
+ *
+ * @param newvalue - new MethodExpression value
*/
- public abstract void setCreateContent(MethodBinding newvalue);
+ public abstract void setCreateContent(MethodExpression newvalue);
}
Deleted: trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java 2010-12-23 15:45:04 UTC (rev 20775)
+++ trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java 2010-12-23 15:55:58 UTC (rev 20776)
@@ -1,54 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.ajax4jsf.resource;
-
-import javax.el.MethodExpression;
-
-/**
- * Interface for the ResourceComponent introduced after refactoring
- * to support MethodExpression. Old interface is left for the
- * compatibility.
- *
- * @author Vladislav Baranov
- */
-public interface ResourceComponent2 extends ResourceComponent {
-
- /**
- * Get MethodExpression to method in user bean to send resource. Method will
- * called with two parameters - restored data object and servlet output
- * stream.
- *
- * @return MethodExpression
- */
- public abstract MethodExpression getCreateContentExpression();
-
- /**
- * Set MethodExpression to method in user bean to send resource. Method will
- * called with two parameters - restored data object and servlet output
- * stream.
- *
- * @param newvalue - new MethodExpression value
- */
- public abstract void setCreateContentExpression(MethodExpression newvalue);
-}
Deleted: trunk/ui/common/ui/src/main/java/org/richfaces/component/MethodBindingMethodExpressionAdaptor.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/MethodBindingMethodExpressionAdaptor.java 2010-12-23 15:45:04 UTC (rev 20775)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/MethodBindingMethodExpressionAdaptor.java 2010-12-23 15:55:58 UTC (rev 20776)
@@ -1,100 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import javax.el.ELException;
-import javax.el.MethodExpression;
-import javax.faces.component.StateHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.el.EvaluationException;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.MethodNotFoundException;
-
-/**
- * Maps {@link MethodExpression} to {@link MethodBinding}
- *
- * @author Maksim Kaszynski
- */
-@SuppressWarnings("deprecation")
-public class MethodBindingMethodExpressionAdaptor extends MethodBinding implements StateHolder {
- private MethodExpression expression;
- private boolean tranzient;
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.MethodBinding#getType(javax.faces.context.FacesContext)
- */
- public MethodBindingMethodExpressionAdaptor() {
-
- // TODO Auto-generated constructor stub
- }
-
- public MethodBindingMethodExpressionAdaptor(MethodExpression expression) {
- super();
- this.expression = expression;
- }
-
- @Override
- public Class<?> getType(FacesContext context) throws MethodNotFoundException {
- try {
- return expression.getMethodInfo(context.getELContext()).getReturnType();
- } catch (javax.el.MethodNotFoundException e) {
- throw new MethodNotFoundException(e);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.MethodBinding#invoke(javax.faces.context.FacesContext, java.lang.Object[])
- */
- @Override
- public Object invoke(FacesContext context, Object[] params) throws EvaluationException, MethodNotFoundException {
- try {
- return expression.invoke(context.getELContext(), params);
- } catch (javax.el.MethodNotFoundException e) {
- throw new MethodNotFoundException(e);
- } catch (ELException e) {
- throw new EvaluationException(e);
- }
- }
-
- public boolean isTransient() {
- return tranzient;
- }
-
- public void restoreState(FacesContext context, Object state) {
- expression = (MethodExpression) state;
- }
-
- public Object saveState(FacesContext context) {
- return expression;
- }
-
- public void setTransient(boolean newTransientValue) {
- tranzient = newTransientValue;
- }
-
- @Override
- public String getExpressionString() {
- return expression.getExpressionString();
- }
-}
Deleted: trunk/ui/common/ui/src/main/java/org/richfaces/component/MethodExpressionMethodBindingAdaptor.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/MethodExpressionMethodBindingAdaptor.java 2010-12-23 15:45:04 UTC (rev 20775)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/MethodExpressionMethodBindingAdaptor.java 2010-12-23 15:55:58 UTC (rev 20776)
@@ -1,202 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.MethodExpression;
-import javax.el.MethodInfo;
-import javax.faces.FacesException;
-import javax.faces.component.StateHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.el.EvaluationException;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.MethodNotFoundException;
-import java.io.Serializable;
-
-/**
- * @author Maksim Kaszynski
- */
-@SuppressWarnings("deprecation")
-public class MethodExpressionMethodBindingAdaptor extends MethodExpression implements StateHolder, Serializable {
- private static final long serialVersionUID = 1L;
- private MethodBinding binding;
- private boolean tranzient;
-
- public MethodExpressionMethodBindingAdaptor() {
- }
-
- public MethodExpressionMethodBindingAdaptor(MethodBinding binding) {
- this.binding = binding;
- }
-
- /*
- * (non-Javadoc)
- * @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext)
- */
- @Override
- public MethodInfo getMethodInfo(ELContext context) {
- FacesContext context2 = (FacesContext) context.getContext(FacesContext.class);
-
- try {
- return new MethodInfo(null, binding.getType(context2), null);
- } catch (MethodNotFoundException e) {
- throw new javax.el.MethodNotFoundException(e);
- } catch (EvaluationException e) {
- throw new ELException(e);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see javax.el.MethodExpression#invoke(javax.el.ELContext, java.lang.Object[])
- */
- @Override
- public Object invoke(ELContext context, Object[] params) {
- FacesContext context2 = (FacesContext) context.getContext(FacesContext.class);
-
- try {
- return binding.invoke(context2, params);
- } catch (MethodNotFoundException e) {
- throw new javax.el.MethodNotFoundException(e);
- } catch (EvaluationException e) {
- throw new ELException(e);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see javax.el.Expression#getExpressionString()
- */
- @Override
- public String getExpressionString() {
- return binding.getExpressionString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
-
- result = prime * result + ((binding == null) ? 0 : binding.hashCode());
-
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (getClass() != obj.getClass()) {
- return false;
- }
-
- MethodExpressionMethodBindingAdaptor other = (MethodExpressionMethodBindingAdaptor) obj;
-
- if (binding == null) {
- if (other.binding != null) {
- return false;
- }
- } else if (!binding.equals(other.binding)) {
- return false;
- }
-
- return true;
- }
-
- /*
- * (non-Javadoc)
- * @see javax.el.Expression#isLiteralText()
- */
- @Override
- public boolean isLiteralText() {
- String expr = binding.getExpressionString();
-
- return !(expr.startsWith("#{") && expr.endsWith("}"));
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.component.StateHolder#isTransient()
- */
- public boolean isTransient() {
- return tranzient;
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
- */
- public void restoreState(FacesContext context, Object state) {
- if (state instanceof MethodBinding) {
- binding = (MethodBinding) state;
- } else {
- Object[] states = (Object[]) state;
- String className = states[0].toString();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- if (loader == null) {
- loader = this.getClass().getClassLoader();
- }
-
- try {
- Class<?> bindingClass = Class.forName(className, true, loader);
-
- binding = (MethodBinding) bindingClass.newInstance();
- ((StateHolder) binding).restoreState(context, states[1]);
- } catch (Exception e) {
- throw new FacesException(e);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
- */
- public Object saveState(FacesContext context) {
- if (binding instanceof StateHolder) {
- Object[] state = new Object[2];
-
- state[0] = binding.getClass().getName();
- state[1] = ((StateHolder) binding).saveState(context);
-
- return state;
- } else {
- return binding;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.component.StateHolder#setTransient(boolean)
- */
- public void setTransient(boolean newTransientValue) {
- tranzient = newTransientValue;
- }
-
- public MethodBinding getBinding() {
- return binding;
- }
-}
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-12-23 15:45:04 UTC (rev 20775)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-12-23 15:55:58 UTC (rev 20776)
@@ -23,21 +23,17 @@
package org.richfaces.component;
-import java.io.OutputStream;
import java.util.Date;
-import javax.el.MethodExpression;
import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;
import javax.faces.component.UIOutput;
-import javax.faces.el.MethodBinding;
-import org.ajax4jsf.resource.ResourceComponent2;
+import org.ajax4jsf.resource.ResourceComponent;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
import org.richfaces.resource.MediaOutputResource;
@@ -50,7 +46,7 @@
tag = @Tag(generate = false, handler = "org.richfaces.view.facelets.html.MediaOutputHandler", type = TagType.Facelets),
renderer = @JsfRenderer(type = "org.richfaces.MediaOutputRenderer")
)
-public abstract class AbstractMediaOutput extends UIOutput implements ResourceComponent2 {
+public abstract class AbstractMediaOutput extends UIOutput implements ResourceComponent {
public static final String COMPONENT_TYPE = "org.richfaces.MediaOutput";
@@ -70,53 +66,6 @@
@Attribute
public abstract String getElement();
- /**
- * Get EL binding to method in user bean to send resource. Method will
- * called with two parameters - restored data object and servlet output
- * stream.
- *
- * @return MethodBinding to createContent
- */
- @Attribute(signature = @Signature(parameters = {OutputStream.class, Object.class}))
- public MethodBinding getCreateContent() {
- MethodBinding result = null;
- MethodExpression me = getCreateContentExpression();
-
- if (me != null) {
-
- // if the MethodExpression is an instance of our private
- // wrapper class.
- if (me instanceof MethodExpressionMethodBindingAdaptor) {
- result = ((MethodExpressionMethodBindingAdaptor) me).getBinding();
- } else {
-
- // otherwise, this is a real MethodExpression. Wrap it
- // in a MethodBinding.
- result = new MethodBindingMethodExpressionAdaptor(me);
- }
- }
-
- return result;
- }
-
- /**
- * Set EL binding to method in user bean to send resource. Method will
- * called with two parameters - restored data object and servlet output
- * stream.
- *
- * @param newvalue - new value of createContent method binding
- */
- public void setCreateContent(MethodBinding newvalue) {
- MethodExpressionMethodBindingAdaptor adapter;
-
- if (newvalue != null) {
- adapter = new MethodExpressionMethodBindingAdaptor(newvalue);
- setCreateContentExpression(adapter);
- } else {
- setCreateContentExpression(null);
- }
- }
-
public Resource getResource() {
ResourceHandler resourceHandler = getFacesContext().getApplication().getResourceHandler();
return resourceHandler.createResource(MediaOutputResource.class.getName());
@@ -152,8 +101,6 @@
@Attribute
public abstract String getCoords();
- public abstract MethodExpression getCreateContentExpression();
-
@Attribute
public abstract String getDeclare();
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/resource/MediaOutputResource.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/resource/MediaOutputResource.java 2010-12-23 15:45:04 UTC (rev 20775)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/resource/MediaOutputResource.java 2010-12-23 15:55:58 UTC (rev 20776)
@@ -105,7 +105,7 @@
this.setCacheable(uiMediaOutput.isCacheable());
this.setContentType(uiMediaOutput.getMimeType());
this.userData = uiMediaOutput.getValue();
- this.contentProducer = uiMediaOutput.getCreateContentExpression();
+ this.contentProducer = uiMediaOutput.getCreateContent();
this.lastModifiedExpression = uiMediaOutput.getValueExpression("lastModfied");
this.expiresExpression = uiMediaOutput.getValueExpression("expires");
this.timeToLiveExpression = uiMediaOutput.getValueExpression("timeToLive");
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/MediaOutputHandler.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/MediaOutputHandler.java 2010-12-23 15:45:04 UTC (rev 20775)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/MediaOutputHandler.java 2010-12-23 15:55:58 UTC (rev 20776)
@@ -22,8 +22,7 @@
package org.richfaces.view.facelets.html;
-import org.richfaces.component.AbstractMediaOutput;
-import org.richfaces.view.facelets.MethodMetadata;
+import java.io.OutputStream;
import javax.faces.view.facelets.ComponentConfig;
import javax.faces.view.facelets.ComponentHandler;
@@ -33,8 +32,10 @@
import javax.faces.view.facelets.Metadata;
import javax.faces.view.facelets.MetadataTarget;
import javax.faces.view.facelets.TagAttribute;
-import java.io.OutputStream;
+import org.richfaces.component.AbstractMediaOutput;
+import org.richfaces.view.facelets.MethodMetadata;
+
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
@@ -62,7 +63,7 @@
if ("createContent".equals(name)) {
return new MethodMetadata(attribute, OutputStream.class, Object.class) {
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((AbstractMediaOutput) instance).setCreateContentExpression(getMethodExpression(ctx));
+ ((AbstractMediaOutput) instance).setCreateContent(getMethodExpression(ctx));
}
};
}
14 years, 9 months
JBoss Rich Faces SVN: r20775 - in trunk/ui/iteration/ui/src: main/resources/META-INF/resources/org.richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-23 10:45:04 -0500 (Thu, 23 Dec 2010)
New Revision: 20775
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java
Log:
RF-8691
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-12-23 15:32:50 UTC (rev 20774)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-12-23 15:45:04 UTC (rev 20775)
@@ -69,6 +69,7 @@
@ResourceDependencies({
@ResourceDependency(library="org.richfaces", name = "extendedDataTable.ecss"),
@ResourceDependency(library="org.richfaces", name = "ajax.reslib"),
+ @ResourceDependency(library="org.richfaces", name = "base-component.reslib"),
@ResourceDependency(name = "jquery.position.js"),
@ResourceDependency(library="org.richfaces", name = "extendedDataTable.js")
})
@@ -675,7 +676,7 @@
component, EVENT_ATTRIBUTES.get("onbeforeselectionchange")), null, ScriptHashVariableWrapper.eventHandler);
addToScriptHash(options, "onselectionchange", RenderKitUtils.getAttributeAndBehaviorsValue(context,
component, EVENT_ATTRIBUTES.get("onselectionchange")), null, ScriptHashVariableWrapper.eventHandler);
- StringBuilder builder = new StringBuilder("new RichFaces.ExtendedDataTable('");
+ StringBuilder builder = new StringBuilder("new RichFaces.ui.ExtendedDataTable('");
builder.append(component.getClientId(context)).append("', ").append(getRowCount(component))
.append(", function(event, clientParams) {").append(ajaxFunction.toScript()).append(";}");
if (!options.isEmpty()) {
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js 2010-12-23 15:32:50 UTC (rev 20774)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js 2010-12-23 15:45:04 UTC (rev 20775)
@@ -131,413 +131,497 @@
}
};
- richfaces.ExtendedDataTable = function(id, rowCount, ajaxFunction, options) {
- var WIDTH_CLASS_NAME_BASE = "rf-edt-c-";
- var MIN_WIDTH = 20;
+ var WIDTH_CLASS_NAME_BASE = "rf-edt-c-";
+ var MIN_WIDTH = 20;
+
+ richfaces.ui = richfaces.ui || {};
+
+ richfaces.ui.ExtendedDataTable = richfaces.BaseComponent.extendClass({
- options = options || {};
- var ranges = new richfaces.utils.Ranges();
- var element = document.getElementById(id);
- var bodyElement, contentElement, spacerElement, dataTableElement, normalPartStyle, rows, rowHeight, parts, tbodies,
- shiftIndex, activeIndex, selectionFlag;
- var dragElement = document.getElementById(id + ":d");
- var reorderElement = document.getElementById(id + ":r");
- var reorderMarkerElement = document.getElementById(id + ":rm");
- var widthInput = document.getElementById(id + ":wi");
- var selectionInput = document.getElementById(id + ":si");
- var header = jQuery(element).children(".rf-edt-hdr");
- var resizerHolders = header.find(".rf-edt-rsz-cntr");
+ name: "ExtendedDataTable",
+
+ ranges: new richfaces.utils.Ranges(),
+ resizeData: {},
+ idOfReorderingColumn: "",
+ newWidths: {},
+ timeoutId: null,
+
+ init: function (id, rowCount, ajaxFunction, options) {
+ $super.constructor.call(this, id);
+ this.rowCount = rowCount;
+ this.ajaxFunction = ajaxFunction;
+ this.options = options || {};
+ this.element = this.attachToDom();
+// var bodyElement, contentElement, spacerElement, dataTableElement, normalPartStyle, rows, rowHeight, parts, tbodies,
+// shiftIndex, activeIndex, selectionFlag;
+ this.dragElement = document.getElementById(id + ":d");
+ this.reorderElement = document.getElementById(id + ":r");
+ this.reorderMarkerElement = document.getElementById(id + ":rm");
+ this.widthInput = document.getElementById(id + ":wi");
+ this.selectionInput = document.getElementById(id + ":si");
+ this.header = jQuery(this.element).children(".rf-edt-hdr");
+ this.resizerHolders = this.header.find(".rf-edt-rsz-cntr");
+
+ this.frozenHeaderPartElement = document.getElementById(id + ":frozenHeader");
+ this.frozenColumnCount = this.frozenHeaderPartElement ? this.frozenHeaderPartElement.firstChild.rows[0].cells.length : 0;//TODO Richfaces.firstDescendant;
+
+ this.scrollElement = document.getElementById(id + ":footer");
+
+ jQuery(document).ready(jQuery.proxy(this.initialize, this));
+ jQuery(window).bind("resize", jQuery.proxy(this.updateLayout, this));
+ jQuery(this.scrollElement).bind("scroll", jQuery.proxy(this.updateScrollPosition, this));
+ this.bindHeaderHandlers();
+ jQuery(this.element).bind("rich:onajaxcomplete", jQuery.proxy(this.ajaxComplete, this));
+ },
+
+ getColumnPosition: function(id) {
+ var position;
+ var headers = this.header.find(".rf-edt-hdr-c");
+ for (var i = 0; i < headers.length; i++) {
+ if (id == headers[i].className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1]) {
+ position = i;
+ }
+ }
+ return position;
+ },
+
+ setColumnPosition: function(id, position) {
+ var colunmsOrder = "";
+ var before;
+ var headers = this.header.find(".rf-edt-hdr-c");
+ for (var i = 0; i < headers.length; i++) {
+ var current = headers[i].className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
+ if (i == position) {
+ if (before) {
+ colunmsOrder += current + "," + id + ",";
+ } else {
+ colunmsOrder += id + "," + current + ",";
+ }
+ } else {
+ if (id != current) {
+ colunmsOrder += current + ",";
+ } else {
+ before = true;
+ }
+ }
+ }
+ this.ajaxFunction(null, {"rich:columnsOrder" : colunmsOrder}); // TODO Maybe, event model should be used here.
+ },
- var frozenHeaderPartElement = document.getElementById(id + ":frozenHeader");
- var frozenColumnCount = frozenHeaderPartElement ? frozenHeaderPartElement.firstChild.rows[0].cells.length : 0;//TODO Richfaces.firstDescendant;
+ setColumnWidth: function(id, width) {
+ width = width + "px";
+ richfaces.utils.getCSSRule("." + WIDTH_CLASS_NAME_BASE + id).style.width = width;
+ this.newWidths[id] = width;
+ var widthsArray = new Array();
+ for (var id in this.newWidths) {
+ widthsArray.push(id + ":" + this.newWidths[id]);
+ }
+ this.widthInput.value = widthsArray.toString();
+ this.updateLayout();
+ this.adjustResizers();
+ this.ajaxFunction(); // TODO Maybe, event model should be used here.
+ },
- var scrollElement = document.getElementById(id + ":footer");
+ filter: function(colunmId, filterValue, isClear) {
+ if (typeof(filterValue) == "undefined" || filterValue == null) {
+ filterValue = "";
+ }
+ var map = {};
+ map[id + "rich:filtering"] = colunmId + ":" + filterValue + ":" + isClear;
+ this.ajaxFunction(null, map); // TODO Maybe, event model should be used here.
+ },
- var resizeData = {};
- var idOfReorderingColumn = "";
- var newWidths = {};
+ clearFiltering: function() {
+ this.filter("", "", true);
+ },
- var timeoutId = null;
+ sort: function(colunmId, sortOrder, isClear) {
+ if (typeof(sortOrder) == "string") {
+ sortOrder = sortOrder.toUpperCase();
+ }
+ var map = {}
+ map[this.id + "rich:sorting"] = colunmId + ":" + sortOrder + ":" + isClear;
+ this.ajaxFunction(null, map); // TODO Maybe, event model should be used here.
+ },
- var sendAjax = function(event, map) {
- ajaxFunction(event, map);
- };
+ clearSorting: function() {
+ this.sort("", "", true);
+ },
+
+ destroy: function() {
+ jQuery(window).unbind("resize", this.updateLayout);
+ jQuery(richfaces.getDomElement(this.id + ':st')).remove();
+ $super.destroy.call(this);
+ },
- var updateLayout = function() {
- normalPartStyle.width = "auto";
- var offsetWidth = frozenHeaderPartElement ? frozenHeaderPartElement.offsetWidth : 0;
- var width = Math.max(0, element.clientWidth - offsetWidth);
+ bindHeaderHandlers: function() {
+ this.header.find(".rf-edt-rsz").bind("mousedown", jQuery.proxy(this.beginResize, this));
+ this.header.find(".rf-edt-hdr-c").bind("mousedown", jQuery.proxy(this.beginReorder, this));
+ },
+
+ updateLayout: function() {
+ this.normalPartStyle.width = "auto";
+ var offsetWidth = this.frozenHeaderPartElement ? this.frozenHeaderPartElement.offsetWidth : 0;
+ var width = Math.max(0, this.element.clientWidth - offsetWidth);
if (width) {
- if (parts.width() > width) {
- normalPartStyle.width = width + "px";
+ if (this.parts.width() > width) {
+ this.normalPartStyle.width = width + "px";
}
- normalPartStyle.display = "block";
- scrollElement.style.overflowX = "";
- if (scrollElement.clientWidth < scrollElement.scrollWidth
- && scrollElement.scrollHeight == scrollElement.offsetHeight) {
- scrollElement.style.overflowX = "scroll";
+ this.normalPartStyle.display = "block";
+ this.scrollElement.style.overflowX = "";
+ if (this.scrollElement.clientWidth < this.scrollElement.scrollWidth
+ && this.scrollElement.scrollHeight == this.scrollElement.offsetHeight) {
+ this.scrollElement.style.overflowX = "scroll";
}
- var delta = scrollElement.firstChild.offsetHeight - scrollElement.clientHeight;
+ var delta = this.scrollElement.firstChild.offsetHeight - this.scrollElement.clientHeight;
if (delta) {
- scrollElement.style.height = scrollElement.offsetHeight + delta;
+ this.scrollElement.style.height = this.scrollElement.offsetHeight + delta;
}
} else {
- normalPartStyle.display = "none";
+ this.normalPartStyle.display = "none";
}
- var height = element.clientHeight;
- var el = element.firstChild;
+ var height = this.element.clientHeight;
+ var el = this.element.firstChild;
while (el && (!el.nodeName || el.nodeName.toUpperCase() != "TABLE")) {
- if(el.nodeName && el.nodeName.toUpperCase() == "DIV" && el != bodyElement) {
+ if(el.nodeName && el.nodeName.toUpperCase() == "DIV" && el != this.bodyElement) {
height -= el.offsetHeight;
}
el = el.nextSibling;
}
- if (bodyElement.offsetHeight > height) {
- bodyElement.style.height = height + "px";
+ if (this.bodyElement.offsetHeight > height) {
+ this.bodyElement.style.height = height + "px";
}
- };
+ },
- var adjustResizers = function() {
- var scrollLeft = scrollElement ? scrollElement.scrollLeft : 0;
- var clientWidth = element.clientWidth - 3;
+ adjustResizers: function() { //For IE7 only.
+ var scrollLeft = this.scrollElement ? this.scrollElement.scrollLeft : 0;
+ var clientWidth = this.element.clientWidth - 3;
var i = 0;
- for (; i < frozenColumnCount; i++) {
+ for (; i < this.frozenColumnCount; i++) {
if (clientWidth > 0) {
- resizerHolders[i].style.display = "none";
- resizerHolders[i].style.display = "";
- clientWidth -= resizerHolders[i].offsetWidth;
+ this.resizerHolders[i].style.display = "none";
+ this.resizerHolders[i].style.display = "";
+ clientWidth -= this.resizerHolders[i].offsetWidth;
}
if (clientWidth <= 0) {
- resizerHolders[i].style.display = "none";
+ this.resizerHolders[i].style.display = "none";
}
}
scrollLeft -= 3;
- for (; i < resizerHolders.length; i++) {
+ for (; i < this.resizerHolders.length; i++) {
if (clientWidth > 0) {
- resizerHolders[i].style.display = "none";
+ this.resizerHolders[i].style.display = "none";
if (scrollLeft > 0) {
- resizerHolders[i].style.display = "";
- scrollLeft -= resizerHolders[i].offsetWidth;
+ this.resizerHolders[i].style.display = "";
+ scrollLeft -= this.resizerHolders[i].offsetWidth;
if (scrollLeft > 0) {
- resizerHolders[i].style.display = "none";
+ this.resizerHolders[i].style.display = "none";
} else {
clientWidth += scrollLeft;
}
} else {
- resizerHolders[i].style.display = "";
- clientWidth -= resizerHolders[i].offsetWidth;
+ this.resizerHolders[i].style.display = "";
+ clientWidth -= this.resizerHolders[i].offsetWidth;
}
}
if (clientWidth <= 0) {
- resizerHolders[i].style.display = "none";
+ this.resizerHolders[i].style.display = "none";
}
}
- };
-
- var updateScrollPosition = function() {
- if (scrollElement) {
- var scrollLeft = scrollElement.scrollLeft;
- parts.each(function() {
+ },
+
+ updateScrollPosition: function() {
+ if (this.scrollElement) {
+ var scrollLeft = this.scrollElement.scrollLeft;
+ this.parts.each(function() {
this.scrollLeft = scrollLeft;
});
}
- adjustResizers();
- };
-
- var initialize = function() {
- bodyElement = document.getElementById(id + ":b");
- bodyElement.tabIndex = -1; //TODO don't use tabIndex.
- normalPartStyle = richfaces.utils.getCSSRule("div.rf-edt-cnt").style;
- var bodyJQuery = jQuery(bodyElement);
- contentElement = bodyJQuery.children("div:first")[0];
- if (contentElement) {
- spacerElement = contentElement.firstChild;//TODO this.marginElement = Richfaces.firstDescendant(this.contentElement);
- dataTableElement = contentElement.lastChild;//TODO this.dataTableElement = Richfaces.lastDescendant(this.contentElement);
- tbodies = jQuery(document.getElementById(id + ":tbf")).add(document.getElementById(id + ":tbn"));
- rows = tbodies[0].rows.length;
- rowHeight = dataTableElement.offsetHeight / rows;
- if (rowCount != rows) {
- contentElement.style.height = (rowCount * rowHeight) + "px";
+ this.adjustResizers();
+ },
+
+ initialize: function() {
+ this.bodyElement = document.getElementById(this.id + ":b");
+ this.bodyElement.tabIndex = -1; //TODO don't use tabIndex.
+ this.normalPartStyle = richfaces.utils.getCSSRule("div.rf-edt-cnt").style;
+ var bodyJQuery = jQuery(this.bodyElement);
+ this.contentElement = bodyJQuery.children("div:first")[0];
+ if (this.contentElement) {
+ this.spacerElement = this.contentElement.firstChild;//TODO this.marginElement = Richfaces.firstDescendant(this.contentElement);
+ this.dataTableElement = this.contentElement.lastChild;//TODO this.dataTableElement = Richfaces.lastDescendant(this.contentElement);
+ this.tbodies = jQuery(document.getElementById(this.id + ":tbf")).add(document.getElementById(this.id + ":tbn"));
+ this.rows = this.tbodies[0].rows.length;
+ this.rowHeight = this.dataTableElement.offsetHeight / this.rows;
+ if (this.rowCount != this.rows) {
+ this.contentElement.style.height = (this.rowCount * this.rowHeight) + "px";
}
- bodyJQuery.bind("scroll", bodyScrollListener);
- if (options.selectionMode != "none") {
- tbodies.bind("click", selectionClickListener);
- bodyJQuery.bind(window.opera ? "keypress" : "keydown", selectionKeyDownListener);
- initializeSelection();
+ bodyJQuery.bind("scroll", jQuery.proxy(this.bodyScrollListener, this));
+ if (this.options.selectionMode != "none") {
+ this.tbodies.bind("click", jQuery.proxy(this.selectionClickListener, this));
+ bodyJQuery.bind(window.opera ? "keypress" : "keydown", jQuery.proxy(this.selectionKeyDownListener, this));
+ this.initializeSelection();
}
} else {
- spacerElement = null;
- dataTableElement = null;
+ this.spacerElement = null;
+ this.dataTableElement = null;
}
- parts = jQuery(element).find(".rf-edt-cnt, .rf-edt-ftr-cnt");
- updateLayout();
- updateScrollPosition(); //TODO Restore horizontal scroll position
- };
+ this.parts = jQuery(this.element).find(".rf-edt-cnt, .rf-edt-ftr-cnt");
+ this.updateLayout();
+ this.updateScrollPosition(); //TODO Restore horizontal scroll position
+ },
- var drag = function(event) {
- jQuery(dragElement).setPosition({left:Math.max(resizeData.left + MIN_WIDTH, event.pageX)});
+ drag: function(event) {
+ jQuery(this.dragElement).setPosition({left:Math.max(this.resizeData.left + MIN_WIDTH, event.pageX)});
return false;
- };
+ },
- var beginResize = function(event) {
- var id = this.parentNode.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
- resizeData = {
+ beginResize: function(event) {
+ var id = event.currentTarget.parentNode.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
+ this.resizeData = {
id : id,
- left : jQuery(this).parent().offset().left
+ left : jQuery(event.currentTarget).parent().offset().left
};
- dragElement.style.height = element.offsetHeight + "px";
- jQuery(dragElement).setPosition({top:jQuery(element).offset().top, left:event.pageX});
- dragElement.style.display = "block";
- jQuery(document).bind("mousemove", drag);
- jQuery(document).one("mouseup", endResize);
+ this.dragElement.style.height = this.element.offsetHeight + "px";
+ jQuery(this.dragElement).setPosition({top:jQuery(this.element).offset().top, left:event.pageX});
+ this.dragElement.style.display = "block";
+ jQuery(document).bind("mousemove", jQuery.proxy(this.drag, this));
+ jQuery(document).one("mouseup", jQuery.proxy(this.endResize, this));
return false;
- };
+ },
- var setColumnWidth = function(id, width) {
- width = width + "px";
- richfaces.utils.getCSSRule("." + WIDTH_CLASS_NAME_BASE + id).style.width = width;
- newWidths[id] = width;
- var widthsArray = new Array();
- for (var id in newWidths) {
- widthsArray.push(id + ":" + newWidths[id]);
- }
- widthInput.value = widthsArray.toString();
- updateLayout();
- adjustResizers();
- sendAjax(); // TODO Maybe, event model should be used here.
- };
-
- var endResize = function(event) {
- jQuery(document).unbind("mousemove", drag);
- dragElement.style.display = "none";
- var width = Math.max(MIN_WIDTH, event.pageX - resizeData.left);
- setColumnWidth(resizeData.id, width);
- };
-
- var reorder = function(event) {
- jQuery(reorderElement).setPosition(event, {offset:[5,5]});
- reorderElement.style.display = "block";
+ endResize: function(event) {
+ jQuery(document).unbind("mousemove", this.drag);
+ this.dragElement.style.display = "none";
+ var width = Math.max(MIN_WIDTH, event.pageX - this.resizeData.left);
+ this.setColumnWidth(this.resizeData.id, width);
+ },
+
+ reorder: function(event) {
+ jQuery(this.reorderElement).setPosition(event, {offset:[5,5]});
+ this.reorderElement.style.display = "block";
return false;
- };
-
- var beginReorder = function(event) {
- if (!jQuery(event.target).is("a, img, :input")) {
- idOfReorderingColumn = this.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
- jQuery(document).bind("mousemove", reorder);
- header.find(".rf-edt-hdr-c").bind("mouseover", overReorder);
- jQuery(document).one("mouseup", cancelReorder);
+ },
+
+ beginReorder: function(event) {
+ if (!jQuery(event.currentTarget).is("a, img, :input")) {
+ this.idOfReorderingColumn = event.currentTarget.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
+ jQuery(document).bind("mousemove", jQuery.proxy(this.reorder, this));
+ this.header.find(".rf-edt-hdr-c").bind("mouseover", jQuery.proxy(this.overReorder, this));
+ jQuery(document).one("mouseup", jQuery.proxy(this.cancelReorder, this));
return false;
}
- };
+ },
- var overReorder = function(event) {
- if (idOfReorderingColumn != this.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1]) {
- var thisElement = jQuery(this);
- var offset = thisElement.offset();
- jQuery(reorderMarkerElement).setPosition({top:offset.top + thisElement.height(), left:offset.left - 5});
- reorderMarkerElement.style.display = "block";
- thisElement.one("mouseout", outReorder);
- thisElement.one("mouseup", endReorder);
+ overReorder: function(event) {
+ if (this.idOfReorderingColumn != event.currentTarget.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1]) {
+ var eventElement = jQuery(event.currentTarget);
+ var offset = eventElement.offset();
+ jQuery(this.reorderMarkerElement).setPosition({top:offset.top + eventElement.height(), left:offset.left - 5});
+ this.reorderMarkerElement.style.display = "block";
+ eventElement.one("mouseout", jQuery.proxy(this.outReorder, this));
+ eventElement.one("mouseup", jQuery.proxy(this.endReorder, this));
}
- };
+ },
- var outReorder = function(event) {
- reorderMarkerElement.style.display = "";
- jQuery(this).unbind("mouseup", endReorder);
- };
+ outReorder: function(event) {
+ this.reorderMarkerElement.style.display = "";
+ jQuery(event.currentTarget).unbind("mouseup", this.endReorder);
+ },
- var endReorder = function(event) {
- reorderMarkerElement.style.display = "";
- jQuery(this).unbind("mouseout", outReorder);
- var id = this.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
+ endReorder: function(event) {
+ this.reorderMarkerElement.style.display = "";
+ jQuery(event.currentTarget).unbind("mouseout", this.outReorder);
+ var id = event.currentTarget.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
var colunmsOrder = "";
- header.find(".rf-edt-hdr-c").each(function() {
+ var _this = this;
+ this.header.find(".rf-edt-hdr-c").each(function() {
var i = this.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
if (i == id) {
- colunmsOrder += idOfReorderingColumn + "," + id + ",";
- } else if (i != idOfReorderingColumn) {
+ colunmsOrder += _this.idOfReorderingColumn + "," + id + ",";
+ } else if (i != _this.idOfReorderingColumn) {
colunmsOrder += i + ",";
}
});
- sendAjax(event, {"rich:columnsOrder" : colunmsOrder}); // TODO Maybe, event model should be used here.
- };
+ this.ajaxFunction(event, {"rich:columnsOrder" : colunmsOrder}); // TODO Maybe, event model should be used here.
+ },
- var cancelReorder = function(event) {
- jQuery(document).unbind("mousemove", reorder);
- header.find(".rf-edt-hdr-c").unbind("mouseover", overReorder);
- reorderElement.style.display = "none";
- };
+ cancelReorder: function(event) {
+ jQuery(document).unbind("mousemove", this.reorder);
+ this.header.find(".rf-edt-hdr-c").unbind("mouseover", this.overReorder);
+ this.reorderElement.style.display = "none";
+ },
- var loadData = function(event) {
- var clientFirst = Math.round((bodyElement.scrollTop + bodyElement.clientHeight / 2) / (rowHeight) - rows / 2);
+ loadData: function(event) {
+ var clientFirst = Math.round((this.bodyElement.scrollTop + this.bodyElement.clientHeight / 2) / this.rowHeight - this.rows / 2);
if (clientFirst <= 0) {
clientFirst = 0;
} else {
- clientFirst = Math.min(rowCount - rows, clientFirst);
+ clientFirst = Math.min(this.rowCount - this.rows, clientFirst);
}
- sendAjax(event, {"rich:clientFirst" : clientFirst});// TODO Maybe, event model should be used here.
- }
-
- var bodyScrollListener = function(event) {
- if(timeoutId) {
- window.clearTimeout(timeoutId);
- timeoutId = null;
+ this.ajaxFunction(event, {"rich:clientFirst" : clientFirst});// TODO Maybe, event model should be used here.
+ },
+
+ bodyScrollListener: function(event) {
+ if(this.timeoutId) {
+ window.clearTimeout(this.timeoutId);
+ this.timeoutId = null;
}
- if (Math.max(this.scrollTop - rowHeight, 0) < spacerElement.offsetHeight
- || Math.min(this.scrollTop + rowHeight + this.clientHeight, this.scrollHeight) > spacerElement.offsetHeight + dataTableElement.offsetHeight) {
- timeoutId = window.setTimeout(function (event) {loadData(event)}, 1000);
+ if (Math.max(event.currentTarget.scrollTop - this.rowHeight, 0) < this.spacerElement.offsetHeight
+ || Math.min(event.currentTarget.scrollTop + this.rowHeight + event.currentTarget.clientHeight, event.currentTarget.scrollHeight) > this.spacerElement.offsetHeight + this.dataTableElement.offsetHeight) {
+ var _this = this;
+ this.timeoutId = window.setTimeout(function (event) {_this.loadData(event)}, 1000);
}
- };
-
- var showActiveRow = function() {
- if (bodyElement.scrollTop > activeIndex * rowHeight + spacerElement.offsetHeight) { //UP
- bodyElement.scrollTop = Math.max(bodyElement.scrollTop - rowHeight, 0);
- } else if (bodyElement.scrollTop + bodyElement.clientHeight
- < (activeIndex + 1) * rowHeight + spacerElement.offsetHeight) { //DOWN
- bodyElement.scrollTop = Math.min(bodyElement.scrollTop + rowHeight, bodyElement.scrollHeight - bodyElement.clientHeight);
+ },
+
+ showActiveRow: function() {
+ if (this.bodyElement.scrollTop > this.activeIndex * this.rowHeight + this.spacerElement.offsetHeight) { //UP
+ this.bodyElement.scrollTop = Math.max(this.bodyElement.scrollTop - this.rowHeight, 0);
+ } else if (this.bodyElement.scrollTop + this.bodyElement.clientHeight
+ < (this.activeIndex + 1) * this.rowHeight + this.spacerElement.offsetHeight) { //DOWN
+ this.bodyElement.scrollTop = Math.min(this.bodyElement.scrollTop + this.rowHeight, this.bodyElement.scrollHeight - this.bodyElement.clientHeight);
}
- }
-
- var selectRow = function(index) {
- ranges.add(index);
- for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[index]).addClass("rf-edt-r-sel");
+ },
+
+ selectRow: function(index) {
+ this.ranges.add(index);
+ for (var i = 0; i < this.tbodies.length; i++) {
+ jQuery(this.tbodies[i].rows[index]).addClass("rf-edt-r-sel");
}
- }
+ },
- var deselectRow = function (index) {
- ranges.remove(index);
- for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[index]).removeClass("rf-edt-r-sel");
+ deselectRow: function (index) {
+ this.ranges.remove(index);
+ for (var i = 0; i < this.tbodies.length; i++) {
+ jQuery(this.tbodies[i].rows[index]).removeClass("rf-edt-r-sel");
}
- }
-
- var setActiveRow = function (index) {
- if(typeof activeIndex == "number") {
- for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[activeIndex]).removeClass("rf-edt-r-act");
+ },
+
+ setActiveRow: function (index) {
+ if (typeof this.activeIndex == "number") {
+ for (var i = 0; i < this.tbodies.length; i++) {
+ jQuery(this.tbodies[i].rows[this.activeIndex]).removeClass("rf-edt-r-act");
}
}
- activeIndex = index;
- for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[activeIndex]).addClass("rf-edt-r-act");
+ this.activeIndex = index;
+ for (var i = 0; i < this.tbodies.length; i++) {
+ jQuery(this.tbodies[i].rows[this.activeIndex]).addClass("rf-edt-r-act");
}
- }
+ },
- var resetShiftRow = function () {
- if(typeof shiftIndex == "number") {
- for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[shiftIndex]).removeClass("rf-edt-r-sht");
+ resetShiftRow: function () {
+ if (typeof this.shiftIndex == "number") {
+ for (var i = 0; i < this.tbodies.length; i++) {
+ jQuery(this.tbodies[i].rows[this.shiftIndex]).removeClass("rf-edt-r-sht");
}
}
- shiftIndex = null;
- }
+ this.shiftIndex = null;
+ },
- var setShiftRow = function (index) {
- resetShiftRow();
- shiftIndex = index;
+ setShiftRow: function (index) {
+ this.resetShiftRow();
+ this.shiftIndex = index;
if(typeof index == "number") {
- for ( var i = 0; i < tbodies.length; i++) {
- jQuery(tbodies[i].rows[shiftIndex]).addClass("rf-edt-r-sht");
+ for (var i = 0; i < this.tbodies.length; i++) {
+ jQuery(this.tbodies[i].rows[this.shiftIndex]).addClass("rf-edt-r-sht");
}
}
- }
+ },
- var initializeSelection = function() {
- ranges.clear();
- var strings = selectionInput.value.split("|");
- activeIndex = strings[1] || null;
- shiftIndex = strings[2] || null;
- selectionFlag = null;
- var rows = tbodies[0].rows;
+ initializeSelection: function() {
+ this.ranges.clear();
+ var strings = this.selectionInput.value.split("|");
+ this.activeIndex = strings[1] || null;
+ this.shiftIndex = strings[2] || null;
+ this.selectionFlag = null;
+ var rows = this.tbodies[0].rows;
for (var i = 0; i < rows.length; i++) {
var row = jQuery(rows[i]);
if (row.hasClass("rf-edt-r-sel")) {
- ranges.add(row[0].rowIndex)
+ this.ranges.add(row[0].rowIndex)
}
if (row.hasClass("rf-edt-r-act")) {
- activeIndex = row[0].rowIndex;
+ this.activeIndex = row[0].rowIndex;
}
if (row.hasClass("rf-edt-r-sht")) {
- shiftIndex = row[0].rowIndex;
+ this.shiftIndex = row[0].rowIndex;
}
}
- writeSelection();
- }
-
- var writeSelection = function() {
- selectionInput.value = [ranges, activeIndex, shiftIndex, selectionFlag].join("|");
- }
+ this.writeSelection();
+ },
- var selectRows = function(range) {
+ writeSelection: function() {
+ this.selectionInput.value = [this.ranges, this.activeIndex, this.shiftIndex, this.selectionFlag].join("|");
+ },
+
+ selectRows: function(range) {
if (typeof range == "number") {
range = [range, range];
}
var changed;
var i = 0;
for (; i < range[0]; i++) {
- if (ranges.contains(i)) {
- deselectRow(i);
+ if (this.ranges.contains(i)) {
+ this.deselectRow(i);
changed = true;
}
}
for (; i <= range[1]; i++) {
- if (!ranges.contains(i)) {
- selectRow(i);
+ if (!this.ranges.contains(i)) {
+ this.selectRow(i);
changed = true;
}
}
- for (; i < rows; i++) {
- if (ranges.contains(i)) {
- deselectRow(i);
+ for (; i < this.rows; i++) {
+ if (this.ranges.contains(i)) {
+ this.deselectRow(i);
changed = true;
}
}
- selectionFlag = typeof shiftIndex == "string" ? shiftIndex : "x";
+ this.selectionFlag = typeof this.shiftIndex == "string" ? this.shiftIndex : "x";
return changed;
- }
+ },
- var processSlectionWithShiftKey = function(index) {
- if(shiftIndex == null) {
- setShiftRow(activeIndex != null ? activeIndex : index);
+ processSlectionWithShiftKey: function(index) {
+ if(this.shiftIndex == null) {
+ this.setShiftRow(this.activeIndex != null ? this.activeIndex : index);
}
var range;
- if ("u" == shiftIndex) {
+ if ("u" == this.shiftIndex) {
range = [0, index];
- } else if ("d" == shiftIndex) {
+ } else if ("d" == this.shiftIndex) {
range = [index, rows - 1];
- } else if (index >= shiftIndex) {
- range = [shiftIndex, index];
+ } else if (index >= this.shiftIndex) {
+ range = [this.shiftIndex, index];
} else {
- range = [index, shiftIndex];
+ range = [index, this.shiftIndex];
}
- return selectRows(range);
- }
+ return this.selectRows(range);
+ },
- var onbeforeselectionchange = function (event) {
- return !options.onbeforeselectionchange || options.onbeforeselectionchange.call(element, event) !== false;
- }
+ onbeforeselectionchange: function (event) {
+ return !this.options.onbeforeselectionchange || this.options.onbeforeselectionchange.call(this.element, event) !== false;
+ },
- var onselectionchange = function (event, index, changed) {
+ onselectionchange: function (event, index, changed) {
if(!event.shiftKey) {
- resetShiftRow();
+ this.resetShiftRow();
}
- if (activeIndex != index) {
- setActiveRow(index);
- showActiveRow();
+ if (this.activeIndex != index) {
+ this.setActiveRow(index);
+ this.showActiveRow();
}
if (changed) {
- writeSelection();
- if (options.onselectionchange) {
- options.onselectionchange.call(element, event);
+ this.writeSelection();
+ if (this.options.onselectionchange) {
+ this.options.onselectionchange.call(this.element, event);
}
}
- }
+ },
- var selectionClickListener = function (event) {
- if (!onbeforeselectionchange(event)) {
+ selectionClickListener: function (event) {
+ if (!this.onbeforeselectionchange(event)) {
return;
}
var changed;
@@ -549,32 +633,32 @@
}
}
var tr = event.target;
- while (tbodies.index(tr.parentNode) == -1) {
+ while (this.tbodies.index(tr.parentNode) == -1) {
tr = tr.parentNode;
}
var index = tr.rowIndex;
- if (options.selectionMode == "single" || (options.selectionMode != "multipleKeyboardFree"
+ if (this.options.selectionMode == "single" || (this.options.selectionMode != "multipleKeyboardFree"
&& !event.shiftKey && !event.ctrlKey)) {
- changed = selectRows(index);
- } else if (options.selectionMode == "multipleKeyboardFree" || (!event.shiftKey && event.ctrlKey)) {
- if (ranges.contains(index)) {
- deselectRow(index);
+ changed = this.selectRows(index);
+ } else if (this.options.selectionMode == "multipleKeyboardFree" || (!event.shiftKey && event.ctrlKey)) {
+ if (this.ranges.contains(index)) {
+ this.deselectRow(index);
} else {
- selectRow(index);
+ this.selectRow(index);
}
changed = true;
} else {
- changed = processSlectionWithShiftKey(index);
+ changed = this.processSlectionWithShiftKey(index);
}
- onselectionchange(event, index, changed);
- }
-
- var selectionKeyDownListener = function(event) {
- if (event.ctrlKey && options.selectionMode != "single" && (event.keyCode == 65 || event.keyCode == 97) //Ctrl-A
- && onbeforeselectionchange(event)) {
- selectRows([0, rows]);
- selectionFlag = "a";
- onselectionchange(event, activeIndex, true); //TODO Is there a way to know that selection haven't changed?
+ this.onselectionchange(event, index, changed);
+ },
+
+ selectionKeyDownListener: function(event) {
+ if (event.ctrlKey && this.options.selectionMode != "single" && (event.keyCode == 65 || event.keyCode == 97) //Ctrl-A
+ && this.onbeforeselectionchange(event)) {
+ this.selectRows([0, rows]);
+ this.selectionFlag = "a";
+ this.onselectionchange(event, this.activeIndex, true); //TODO Is there a way to know that selection haven't changed?
event.preventDefault();
} else {
var index;
@@ -583,127 +667,41 @@
} else if (event.keyCode == 40) { //DOWN
index = 1;
}
- if (index != null && onbeforeselectionchange(event)) {
- if (typeof activeIndex == "number") {
- index += activeIndex;
- if (index >= 0 && index < rows ) {
+ if (index != null && this.onbeforeselectionchange(event)) {
+ if (typeof this.activeIndex == "number") {
+ index += this.activeIndex;
+ if (index >= 0 && index < this.rows) {
var changed;
- if (options.selectionMode == "single" || (!event.shiftKey && !event.ctrlKey)) {
- changed = selectRows(index);
+ if (this.options.selectionMode == "single" || (!event.shiftKey && !event.ctrlKey)) {
+ changed = this.selectRows(index);
} else if (event.shiftKey) {
- changed = processSlectionWithShiftKey(index);
+ changed = this.processSlectionWithShiftKey(index);
}
- onselectionchange(event, index, changed);
+ this.onselectionchange(event, index, changed);
}
}
event.preventDefault();
}
}
- }
-
- var ajaxComplete = function (event, data) {
+ },
+
+ ajaxComplete: function (event, data) {
if (data.reinitializeHeader) {
- bindHeaderHandlers();
+ this.bindHeaderHandlers();
} else {
- selectionInput = document.getElementById(id + ":si");
+ this.selectionInput = document.getElementById(this.id + ":si");
if (data.reinitializeBody) {
- rowCount = data.rowCount;
- initialize();
- } else if (options.selectionMode != "none") {
- initializeSelection();
+ this.rowCount = data.rowCount;
+ this.initialize();
+ } else if (this.options.selectionMode != "none") {
+ this.initializeSelection();
}
- if (spacerElement) {
- spacerElement.style.height = (data.first * rowHeight) + "px";
+ if (this.spacerElement) {
+ this.spacerElement.style.height = (data.first * this.rowHeight) + "px";
}
}
- };
-
- jQuery(document).ready(initialize);
- jQuery(window).bind("resize", updateLayout);
- jQuery(scrollElement).bind("scroll", updateScrollPosition);
- var bindHeaderHandlers = function () {
- header.find(".rf-edt-rsz").bind("mousedown", beginResize);
- header.find(".rf-edt-hdr-c").bind("mousedown", beginReorder);
}
- bindHeaderHandlers();
- jQuery(element).bind("rich:onajaxcomplete", ajaxComplete);
-
- //JS API
- element[richfaces.RICH_CONTAINER] = element[richfaces.RICH_CONTAINER] || {}; // TODO ExtendedDataTable should extend richfaces.BaseComponent instead of using it.
- element[richfaces.RICH_CONTAINER].component = this;
- this.destroy = function() {
- element[richfaces.RICH_CONTAINER] = null;
- jQuery(window).unbind("resize", updateLayout);
- jQuery(richfaces.getDomElement(id + ':st')).remove();
- }
-
- this.detach = function () {
- // TODO see implementation in richfaces-base-component.js
- };
-
- this.getColumnPosition = function(id) {
- var position;
- var headers = header.find(".rf-edt-hdr-c");
- for (var i = 0; i < headers.length; i++) {
- if (id == headers[i].className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1]) {
- position = i;
- }
- }
- return position;
- }
-
- this.setColumnPosition = function(id, position) {
- var colunmsOrder = "";
- var before;
- var headers = header.find(".rf-edt-hdr-c");
- for (var i = 0; i < headers.length; i++) {
- var current = headers[i].className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
- if (i == position) {
- if (before) {
- colunmsOrder += current + "," + id + ",";
- } else {
- colunmsOrder += id + "," + current + ",";
- }
- } else {
- if (id != current) {
- colunmsOrder += current + ",";
- } else {
- before = true;
- }
- }
- }
- sendAjax(null, {"rich:columnsOrder" : colunmsOrder}); // TODO Maybe, event model should be used here.
- }
-
- this.setColumnWidth = function(id, width) {
- setColumnWidth(id, width);
- }
-
- this.filter = function(colunmId, filterValue, isClear) {
- if (typeof(filterValue) == "undefined" || filterValue == null) {
- filterValue = "";
- }
- var map = {}
- map[id + "rich:filtering"] = colunmId + ":" + filterValue + ":" + isClear;
- sendAjax(null, map); // TODO Maybe, event model should be used here.
- }
-
- this.clearFiltering = function() {
- this.filter("", "", true);
- }
-
- this.sort = function(colunmId, sortOrder, isClear) {
- if (typeof(sortOrder) == "string") {
- sortOrder = sortOrder.toUpperCase();
- }
- var map = {}
- map[id + "rich:sorting"] = colunmId + ":" + sortOrder + ":" + isClear;
- sendAjax(null, map); // TODO Maybe, event model should be used here.
- }
-
- this.clearSorting = function() {
- this.filter("", "", true);
- }
- };
-}(window.RichFaces, jQuery));
-
+ });
+
+ var $super = richfaces.ui.ExtendedDataTable.$super;
+}(window.RichFaces, jQuery));
\ No newline at end of file
Modified: trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java
===================================================================
--- trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java 2010-12-23 15:32:50 UTC (rev 20774)
+++ trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java 2010-12-23 15:45:04 UTC (rev 20775)
@@ -172,7 +172,7 @@
assertEquals("rf-edt-rord-mkr", table.getElementById("table:rm").getAttribute("class"));
assertEquals("table:wi", table.getElementById("table:wi").getAttribute("name"));
assertTrue(table.getElementsByTagName("script").get(0).getTextContent()
- .contains("RichFaces.ExtendedDataTable"));
+ .contains("RichFaces.ui.ExtendedDataTable"));
}
/**
14 years, 9 months
JBoss Rich Faces SVN: r20774 - trunk/core/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-12-23 10:32:50 -0500 (Thu, 23 Dec 2010)
New Revision: 20774
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
http://jira.jboss.com/jira/browse/RF-10046
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-12-23 14:54:40 UTC (rev 20773)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-12-23 15:32:50 UTC (rev 20774)
@@ -79,12 +79,12 @@
var elements = e.getElementsByTagName("*");
if (elements.length) {
jQuery.cleanData(elements);
- jQuery.cleanData([e]);
jQuery.each(elements, function(index) {
richfaces.cleanComponent(this);
});
- richfaces.cleanComponent(e);
}
+ jQuery.cleanData([e]);
+ richfaces.cleanComponent(e);
}
};
14 years, 9 months
JBoss Rich Faces SVN: r20773 - trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/model.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-12-23 09:54:40 -0500 (Thu, 23 Dec 2010)
New Revision: 20773
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/model/CalendarModel.java
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/model/CalendarModelItem.java
Log:
checkstyle
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/model/CalendarModel.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/model/CalendarModel.java 2010-12-23 14:53:40 UTC (rev 20772)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/model/CalendarModel.java 2010-12-23 14:54:40 UTC (rev 20773)
@@ -36,13 +36,13 @@
if (current.before(today)) {
modelItem.setEnabled(false);
modelItem.setStyleClass(BOUNDARY_DAY_CLASS);
- } else if (checkBusyDay(current)){
+ } else if (checkBusyDay(current)) {
modelItem.setEnabled(false);
modelItem.setStyleClass(BUSY_DAY_CLASS);
- }else if (checkWeekend(current)){
+ } else if (checkWeekend(current)) {
modelItem.setEnabled(false);
modelItem.setStyleClass(WEEKEND_DAY_CLASS);
- }else{
+ } else {
modelItem.setEnabled(true);
modelItem.setStyleClass("");
}
@@ -52,9 +52,9 @@
return modelItems;
}
- @Override
- public Object getToolTip(Date date) {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Object getToolTip(Date date) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/model/CalendarModelItem.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/model/CalendarModelItem.java 2010-12-23 14:53:40 UTC (rev 20772)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/model/CalendarModelItem.java 2010-12-23 14:54:40 UTC (rev 20773)
@@ -2,11 +2,10 @@
import org.richfaces.model.CalendarDataModelItem;
-public class CalendarModelItem implements CalendarDataModelItem{
+public class CalendarModelItem implements CalendarDataModelItem {
private boolean enabled;
private String styleClass;
-
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@@ -23,27 +22,27 @@
return styleClass;
}
- @Override
- public Object getData() {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Object getData() {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public boolean hasToolTip() {
- // TODO Auto-generated method stub
- return false;
- }
+ @Override
+ public boolean hasToolTip() {
+ // TODO Auto-generated method stub
+ return false;
+ }
- @Override
- public Object getToolTip() {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Object getToolTip() {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public int getDay() {
- // TODO Auto-generated method stub
- return 0;
- }
+ @Override
+ public int getDay() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
}
14 years, 9 months
JBoss Rich Faces SVN: r20772 - in trunk: ui/common/ui/src/main/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-23 09:53:40 -0500 (Thu, 23 Dec 2010)
New Revision: 20772
Removed:
trunk/core/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
Modified:
trunk/core/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java
trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
Log:
https://issues.jboss.org/browse/RF-10077
Modified: trunk/core/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java 2010-12-23 14:27:11 UTC (rev 20771)
+++ trunk/core/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java 2010-12-23 14:53:40 UTC (rev 20772)
@@ -53,18 +53,6 @@
public abstract Object getRowKey();
/**
- * Iteration component can support save data for use at decoding/validation/update phases to avoid
- * unnessesary calls to original models,
- * for example - to avoid requests to database until all data is validated.
- * @return
- */
- public SerializableDataModel getSerializableModel(Range range) {
-
- // By default, model not serializable.
- return null;
- }
-
- /**
* Iterate over model by "visitor" pattern, for given range
* @param context current JSF context.
* @param visitor instance of {@link DataVisitor}, for process each row.
Deleted: trunk/core/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2010-12-23 14:27:11 UTC (rev 20771)
+++ trunk/core/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2010-12-23 14:53:40 UTC (rev 20772)
@@ -1,42 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.ajax4jsf.model;
-
-import java.io.Serializable;
-
-/**
- * Serializable version of {@link ExtendedDataModel}, for save lightweight version of data
- *
- * @author shura
- *
- */
-@SuppressWarnings("serial")
-public abstract class SerializableDataModel extends ExtendedDataModel implements Serializable {
-
- /**
- * Method called after update all model values. For example, developer can update
- * database with new values of modified rows.
- */
- public abstract void update();
-}
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-12-23 14:27:11 UTC (rev 20771)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-12-23 14:53:40 UTC (rev 20772)
@@ -69,7 +69,6 @@
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.ExtendedDataModel;
import org.ajax4jsf.model.Range;
-import org.ajax4jsf.model.SerializableDataModel;
import org.richfaces.context.ExtendedVisitContext;
import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
@@ -104,7 +103,7 @@
private boolean componentStateIsStateHolder;
- private ExtendedDataModel<?> dataModel;
+ private transient ExtendedDataModel<?> dataModel;
public IterationState() {
super();
@@ -154,18 +153,10 @@
}
}
- Object savedSerializableModel = null;
-
- if (componentState != null && dataModel != null) {
- // TODO handle model serialization - "execute" model
- savedSerializableModel = dataModel.getSerializableModel(componentState.getRange());
- }
-
- if (localSavedComponentState != null || savedSerializableModel != null) {
+ if (localSavedComponentState != null) {
return new Object[] {
localComponentStateIsHolder,
- localSavedComponentState,
- savedSerializableModel
+ localSavedComponentState
};
} else {
return null;
@@ -183,8 +174,6 @@
} else {
componentState = (DataComponentState) localSavedComponentState;
}
-
- dataModel = (ExtendedDataModel<?>) state[2];
}
}
@@ -961,16 +950,6 @@
preUpdate(faces);
this.iterate(faces, updateVisitor);
- ExtendedDataModel<?> dataModel = getExtendedDataModel();
-
- // If no validation errors, update values for serializable model,
- // restored from view.
- if ((dataModel instanceof SerializableDataModel) && (!isKeepSaved())) {
- SerializableDataModel serializableModel = (SerializableDataModel) dataModel;
-
- serializableModel.update();
- }
-
doUpdate();
popComponentFromEL(faces);
14 years, 9 months
JBoss Rich Faces SVN: r20771 - in trunk: archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-23 09:27:11 -0500 (Thu, 23 Dec 2010)
New Revision: 20771
Modified:
trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/bom/pom.xml
trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/parent/pom.xml
trunk/examples/push-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/parent/pom.xml
Log:
RF environment updates:
- MyFaces versions changed to 2.0.3 & 2.0.4-SNAPSHOT
- Guava updated to r07
- Added jsf_profile=jsf_ri_2_1 for Mojarra 2.1.0-b09
Modified: trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -8,7 +8,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/bom/pom.xml
===================================================================
--- trunk/bom/pom.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/bom/pom.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -149,12 +149,12 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>2.0.2</version>
+ <version>2.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>2.0.2</version>
+ <version>2.0.3</version>
</dependency>
<!-- Misc -->
@@ -181,7 +181,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>r05</version>
+ <version>r07</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
Modified: trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/examples/parent/pom.xml
===================================================================
--- trunk/examples/parent/pom.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/parent/pom.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -206,6 +206,27 @@
</dependencies>
</profile>
<profile>
+ <id>jsf_ri_2_1</id>
+ <activation>
+ <property>
+ <name>jsf_profile</name>
+ <value>jsf_ri_2_1</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.1.0-b09</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>2.1.0-b09</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>myfaces_snapshot</id>
<activation>
<property>
@@ -217,12 +238,12 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>2.0.3-SNAPSHOT</version>
+ <version>2.0.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>2.0.3-SNAPSHOT</version>
+ <version>2.0.4-SNAPSHOT</version>
</dependency>
</dependencies>
</profile>
Modified: trunk/examples/push-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/push-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/push-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -5,7 +5,7 @@
-->
<path name="WEB-INF/classes"></path>
- <path name="WEB-INF/lib/guava-r05.jar">
+ <path name="WEB-INF/lib/guava-r07.jar">
<exclude name="com.google.common.collect" />
</path>
</scanning>
\ No newline at end of file
Modified: trunk/parent/pom.xml
===================================================================
--- trunk/parent/pom.xml 2010-12-23 14:18:13 UTC (rev 20770)
+++ trunk/parent/pom.xml 2010-12-23 14:27:11 UTC (rev 20771)
@@ -345,7 +345,7 @@
</dependencies>
</profile>
<profile>
- <id>jsf_ri_snapshot</id>
+ <id>jsf_ri_2_1_snapshot</id>
<activation>
<property>
<name>jsf_profile</name>
@@ -368,6 +368,29 @@
</dependencies>
</profile>
<profile>
+ <id>jsf_ri_2_1</id>
+ <activation>
+ <property>
+ <name>jsf_profile</name>
+ <value>jsf_ri_2_1</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.1.0-b09</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>2.1.0-b09</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>myfaces_snapshot</id>
<activation>
<property>
@@ -379,13 +402,13 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>2.0.3-SNAPSHOT</version>
+ <version>2.0.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>2.0.3-SNAPSHOT</version>
+ <version>2.0.4-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
14 years, 9 months
JBoss Rich Faces SVN: r20770 - in trunk/ui/input/ui/src: main/java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-23 09:18:13 -0500 (Thu, 23 Dec 2010)
New Revision: 20770
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java
trunk/ui/input/ui/src/main/templates/select.template.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml
Log:
fix inplaceSelectTests, RF-9735, RF-9737
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2010-12-23 14:09:07 UTC (rev 20769)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2010-12-23 14:18:13 UTC (rev 20770)
@@ -32,5 +32,14 @@
@Attribute(defaultValue="true")
public abstract boolean isShowButton();
+
+ @Attribute(defaultValue="20px")
+ public abstract String getMinListHeight();
+
+ @Attribute(defaultValue="100px")
+ public abstract String getMaxListHeight();
+ @Attribute(defaultValue="auto")
+ public abstract String getListHeight();
+
}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java 2010-12-23 14:09:07 UTC (rev 20769)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java 2010-12-23 14:18:13 UTC (rev 20770)
@@ -34,7 +34,7 @@
public abstract class AbstractSelectComponent extends UISelectOne {
- @Attribute(defaultValue="250px")
+ @Attribute(defaultValue="200px")
public abstract String getListWidth();
@Attribute(defaultValue="100px")
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java 2010-12-23 14:09:07 UTC (rev 20769)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java 2010-12-23 14:18:13 UTC (rev 20770)
@@ -30,6 +30,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.richfaces.component.AbstractSelect;
import org.richfaces.component.AbstractSelectComponent;
/**
@@ -62,6 +63,40 @@
return SelectHelper.getSelectInputLabel(facesContext, component);
}
+ public String getListWidth(UIComponent component) {
+ AbstractSelect select = (AbstractSelect)component;
+ String width = select.getListWidth();
+ return (width != null && width.trim().length() != 0) ? ("width: " + width) : "";
+ }
+
+ public String encodeHeightAndWidth(UIComponent component) {
+ AbstractSelect select = (AbstractSelect)component;
+
+ String height = select.getListHeight();
+ if(!"auto".equals(height)) {
+ height = (height != null && height.trim().length() != 0) ? ("height: " + height) : "";
+ } else {
+ String minHeight = select.getMinListHeight();
+ minHeight = (minHeight != null && minHeight.trim().length() != 0) ? ("min-height: " + minHeight) : "";
+
+ String maxHeight = select.getMaxListHeight();
+ maxHeight = (maxHeight != null && maxHeight.trim().length() != 0) ? ("max-height: " + maxHeight) : "";
+ height = concatStyles(minHeight, maxHeight);
+ }
+
+ String width = select.getListWidth();
+ width = (width != null && width.trim().length() != 0) ? ("width: " + width) : "";
+
+ return concatStyles(height, width);
+ }
+
+ public String getListCss(UIComponent component) {
+ AbstractSelect inplaceSelect = (AbstractSelect)component;
+ String css = inplaceSelect.getListClass();
+ css = (css != null) ? concatClasses("rf-sel-lst-cord", css) : "rf-sel-lst-cord";
+ return css;
+ }
+
public String getSelectLabel(FacesContext facesContext, UIComponent component) {
AbstractSelectComponent select = (AbstractSelectComponent) component;
String label = getSelectInputLabel(facesContext, select);
Modified: trunk/ui/input/ui/src/main/templates/select.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/select.template.xml 2010-12-23 14:09:07 UTC (rev 20769)
+++ trunk/ui/input/ui/src/main/templates/select.template.xml 2010-12-23 14:18:13 UTC (rev 20770)
@@ -47,7 +47,7 @@
</c:if>
</div>
- <div id="#{clientId}List" class="rf-sel-lst-cord">
+ <div id="#{clientId}List" class="#{getListCss(component)}">
<cdk:call expression="renderListHandlers(facesContext, component);"/>
<div class="rf-sel-shdw">
<div class="rf-sel-shdw-t"></div>
@@ -56,7 +56,7 @@
<div class="rf-sel-shdw-b"></div>
<div class="rf-sel-lst-dcrtn">
- <div class="rf-sel-lst-scrl">
+ <div class="rf-sel-lst-scrl" style="#{encodeHeightAndWidth(component)}">
<div id="#{clientId}Items" >
<cdk:call expression="encodeItems(facesContext, component, clientSelectItems);"/>
</div>
@@ -67,9 +67,8 @@
<script type="text/javascript">
<cdk:scriptObject name="options">
<cdk:scriptOption name="items" value="#{clientSelectItems}" />
- <cdk:scriptOption name="itemCss" value="#{concatClasses('rf-sel-opt', component.attributes['itemClass'])}" />
+ <cdk:scriptOption name="itemCss" value="rf-sel-opt" />
<cdk:scriptOption name="selectItemCss" value="#{concatClasses('rf-sel-sel', component.attributes['selectItemClass'])}" />
- <cdk:scriptOption name="listCss" value="#{concatClasses('rf-sel-lst-cord', component.attributes['listClass'])}" />
<cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onchange onblur onselectitem onfocus" wrapper="eventHandler"/>
<cdk:scriptOption attributes="showControl defaultLabel enableManualInput selectFirst" />
</cdk:scriptObject>
Modified: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml 2010-12-23 14:09:07 UTC (rev 20769)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml 2010-12-23 14:18:13 UTC (rev 20770)
@@ -1,45 +1,31 @@
<span class="rf-is-d-s" id="form:inplaceSelectDefault">
- <span class="rf-is-lbl" id="form:inplaceSelectDefaultLabel">
- Edit Text
- </span>
- <input class="rf-is-none" id="form:inplaceSelectDefaultFocus" name="form:inplaceSelectDefaultFocus" style="position: absolute; top: 0px; left: 0px; outline-style: none;" type="image"/>
- <span class="rf-is-edit rf-is-none" id="form:inplaceSelectDefaultEdit">
- <input id="form:inplaceSelectDefaultselValue" name="form:inplaceSelectDefault" type="hidden"/>
- <input autocomplete="off" class="rf-is-fld" id="form:inplaceSelectDefaultInput" name="form:inplaceSelectDefaultInput" readonly="readonly" style="width: ;" type="text"/>
- <span class="rf-is-lst-cord" id="form:inplaceSelectDefaultList" style="display: none">
- <span class="rf-is-lst-pos" style="width: 250px">
- <span class="rf-is-shdw">
- <span class="rf-is-shdw-t">
- </span>
- <span class="rf-is-shdw-l">
- </span>
- <span class="rf-is-shdw-r">
- </span>
- <span class="rf-is-shdw-b">
- </span>
- <span class="rf-is-lst-dec">
- <span class="rf-is-lst-scrl" style="height: 100px">
- <span id="form:inplaceSelectDefaultItems">
- <span id="form:inplaceSelectDefaultItem0" class="rf-is-opt">
- Label#1
- </span>
- <span id="form:inplaceSelectDefaultItem1" class="rf-is-opt">
- Label#2
- </span>
- <span id="form:inplaceSelectDefaultItem2" class="rf-is-opt">
- Label#3
- </span>
- <span id="form:inplaceSelectDefaultItem3" class="rf-is-opt">
- Label#4
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- <script type="text/javascript">
- //ignored
- </script>
+ <span class="rf-is-lbl" id="form:inplaceSelectDefaultLabel">Edit Text</span>
+ <input class="rf-is-none" id="form:inplaceSelectDefaultFocus" name="form:inplaceSelectDefaultFocus" style="position: absolute; top: 0px; left: 0px; outline-style: none;" type="image" />
+ <span class="rf-is-edit rf-is-none" id="form:inplaceSelectDefaultEdit">
+ <input id="form:inplaceSelectDefaultselValue" name="form:inplaceSelectDefault" type="hidden" />
+ <input autocomplete="off" class="rf-is-fld" id="form:inplaceSelectDefaultInput" name="form:inplaceSelectDefaultInput" readonly="readonly" style="width: ;" type="text" />
+ <span class="rf-is-lst-cord" id="form:inplaceSelectDefaultList" style="display: none">
+ <span class="rf-is-lst-pos" style="width: 200px">
+ <span class="rf-is-shdw">
+ <span class="rf-is-shdw-t"></span>
+ <span class="rf-is-shdw-l"></span>
+ <span class="rf-is-shdw-r"></span>
+ <span class="rf-is-shdw-b"></span>
+ <span class="rf-is-lst-dec">
+ <span class="rf-is-lst-scrl" style="height: 100px">
+ <span id="form:inplaceSelectDefaultItems">
+ <span id="form:inplaceSelectDefaultItem0" class="rf-is-opt">Label#1</span>
+ <span id="form:inplaceSelectDefaultItem1" class="rf-is-opt">Label#2</span>
+ <span id="form:inplaceSelectDefaultItem2" class="rf-is-opt">Label#3</span>
+ <span id="form:inplaceSelectDefaultItem3" class="rf-is-opt">Label#4</span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ <script type="text/javascript">
+ //ignored
+ </script>
</span>
Modified: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml 2010-12-23 14:09:07 UTC (rev 20769)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml 2010-12-23 14:18:13 UTC (rev 20770)
@@ -1,64 +1,46 @@
<span class="rf-is-d-s rf-is-e-s" id="form:inplaceSelectEdit">
- <span class="rf-is-lbl" id="form:inplaceSelectEditLabel">
- Edit Text
- </span>
- <input class="rf-is-none" id="form:inplaceSelectEditFocus" name="form:inplaceSelectEditFocus" style="position: absolute; top: 0px; left: 0px; outline-style: none;" type="image"/>
- <span class="rf-is-edit" id="form:inplaceSelectEditEdit">
- <input id="form:inplaceSelectEditselValue" name="form:inplaceSelectEdit" type="hidden"/>
- <input autocomplete="off" class="rf-is-fld" id="form:inplaceSelectEditInput" name="form:inplaceSelectEditInput" readonly="readonly" style="width: ;" type="text"/>
- <span class="rf-is-btn-prepos">
- <span class="rf-is-btn-pos">
- <span class="rf-is-shdw" id="form:inplaceSelectEditBtnshadow">
- <span class="rf-is-shdw-t">
- </span>
- <span class="rf-is-shdw-l">
- </span>
- <span class="rf-is-shdw-r">
- </span>
- <span class="rf-is-shdw-b">
- </span>
- <span id="form:inplaceSelectEditBtn" style="position : relative;">
- <input class="rf-is-btn" id="form:inplaceSelectEditOkbtn" name="form:inplaceSelectEditOkbtn" onmousedown="this.className='rf-is-btn-press'" onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" src="/javax.faces.resource/ico_ok.gif.jsf?ln=org.richfaces" type="image"/>
- <input class="rf-is-btn" id="form:inplaceSelectEditCancelbtn" name="form:inplaceSelectEditOkbtn" onmousedown="this.className='rf-is-btn-press'" onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" src="/javax.faces.resource/ico_cancel.gif.jsf?ln=org.richfaces" type="image"/>
- <br/>
- </span>
- </span>
- </span>
- </span>
- <span class="rf-is-lst-cord" id="form:inplaceSelectEditList" style="display: none">
- <span class="rf-is-lst-pos" style="width: 250px">
- <span class="rf-is-shdw">
- <span class="rf-is-shdw-t">
- </span>
- <span class="rf-is-shdw-l">
- </span>
- <span class="rf-is-shdw-r">
- </span>
- <span class="rf-is-shdw-b">
- </span>
- <span class="rf-is-lst-dec">
- <span class="rf-is-lst-scrl" style="height: 100px">
- <span id="form:inplaceSelectEditItems">
- <span id="form:inplaceSelectEditItem0" class="rf-is-opt">
- Label#1
- </span>
- <span id="form:inplaceSelectEditItem1" class="rf-is-opt">
- Label#2
- </span>
- <span id="form:inplaceSelectEditItem2" class="rf-is-opt">
- Label#3
- </span>
- <span id="form:inplaceSelectEditItem3" class="rf-is-opt">
- Label#4
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- <script type="text/javascript">
- //ignored
- </script>
+ <span class="rf-is-lbl" id="form:inplaceSelectEditLabel">Edit Text</span>
+ <input class="rf-is-none" id="form:inplaceSelectEditFocus" name="form:inplaceSelectEditFocus" style="position: absolute; top: 0px; left: 0px; outline-style: none;" type="image" />
+ <span class="rf-is-edit" id="form:inplaceSelectEditEdit">
+ <input id="form:inplaceSelectEditselValue" name="form:inplaceSelectEdit" type="hidden" />
+ <input autocomplete="off" class="rf-is-fld" id="form:inplaceSelectEditInput" name="form:inplaceSelectEditInput" readonly="readonly" style="width: ;" type="text" />
+ <span class="rf-is-btn-prepos">
+ <span class="rf-is-btn-pos">
+ <span class="rf-is-shdw" id="form:inplaceSelectEditBtnshadow">
+ <span class="rf-is-shdw-t"></span>
+ <span class="rf-is-shdw-l"></span>
+ <span class="rf-is-shdw-r"></span>
+ <span class="rf-is-shdw-b"></span>
+ <span id="form:inplaceSelectEditBtn" style="position : relative;">
+ <input class="rf-is-btn" id="form:inplaceSelectEditOkbtn" onmousedown="this.className='rf-is-btn-press'" onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" src="/javax.faces.resource/ico_ok.gif.jsf?ln=org.richfaces" type="image" />
+ <input class="rf-is-btn" id="form:inplaceSelectEditCancelbtn" onmousedown="this.className='rf-is-btn-press'" onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" src="/javax.faces.resource/ico_cancel.gif.jsf?ln=org.richfaces" type="image" />
+ <br />
+ </span>
+ </span>
+ </span>
+ </span>
+ <span class="rf-is-lst-cord" id="form:inplaceSelectEditList" style="display: none">
+ <span class="rf-is-lst-pos" style="width: 200px">
+ <span class="rf-is-shdw">
+ <span class="rf-is-shdw-t"></span>
+ <span class="rf-is-shdw-l"></span>
+ <span class="rf-is-shdw-r"></span>
+ <span class="rf-is-shdw-b"></span>
+ <span class="rf-is-lst-dec">
+ <span class="rf-is-lst-scrl" style="height: 100px">
+ <span id="form:inplaceSelectEditItems">
+ <span id="form:inplaceSelectEditItem0" class="rf-is-opt">Label#1</span>
+ <span id="form:inplaceSelectEditItem1" class="rf-is-opt">Label#2</span>
+ <span id="form:inplaceSelectEditItem2" class="rf-is-opt">Label#3</span>
+ <span id="form:inplaceSelectEditItem3" class="rf-is-opt">Label#4</span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ <script type="text/javascript">
+ //ignore
+ </script>
</span>
Modified: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml 2010-12-23 14:09:07 UTC (rev 20769)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml 2010-12-23 14:18:13 UTC (rev 20770)
@@ -1,64 +1,46 @@
<span class="rf-is-d-s" id="form:inplaceSelectWithControls">
- <span class="rf-is-lbl" id="form:inplaceSelectWithControlsLabel">
- Edit Text
- </span>
- <input class="rf-is-none" id="form:inplaceSelectWithControlsFocus" name="form:inplaceSelectWithControlsFocus" style="position: absolute; top: 0px; left: 0px; outline-style: none;" type="image"/>
- <span class="rf-is-edit rf-is-none" id="form:inplaceSelectWithControlsEdit">
- <input id="form:inplaceSelectWithControlsselValue" name="form:inplaceSelectWithControls" type="hidden"/>
- <input autocomplete="off" class="rf-is-fld" id="form:inplaceSelectWithControlsInput" name="form:inplaceSelectWithControlsInput" readonly="readonly" style="width: ;" type="text"/>
- <span class="rf-is-btn-prepos">
- <span class="rf-is-btn-pos">
- <span class="rf-is-shdw" id="form:inplaceSelectWithControlsBtnshadow">
- <span class="rf-is-shdw-t">
- </span>
- <span class="rf-is-shdw-l">
- </span>
- <span class="rf-is-shdw-r">
- </span>
- <span class="rf-is-shdw-b">
- </span>
- <span id="form:inplaceSelectWithControlsBtn" style="position : relative;">
- <input class="rf-is-btn" id="form:inplaceSelectWithControlsOkbtn" name="form:inplaceSelectWithControlsOkbtn" onmousedown="this.className='rf-is-btn-press'" onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" src="/javax.faces.resource/ico_ok.gif.jsf?ln=org.richfaces" type="image"/>
- <input class="rf-is-btn" id="form:inplaceSelectWithControlsCancelbtn" name="form:inplaceSelectWithControlsOkbtn" onmousedown="this.className='rf-is-btn-press'" onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" src="/javax.faces.resource/ico_cancel.gif.jsf?ln=org.richfaces" type="image"/>
- <br/>
- </span>
- </span>
- </span>
- </span>
- <span class="rf-is-lst-cord" id="form:inplaceSelectWithControlsList" style="display: none">
- <span class="rf-is-lst-pos" style="width: 250px">
- <span class="rf-is-shdw">
- <span class="rf-is-shdw-t">
- </span>
- <span class="rf-is-shdw-l">
- </span>
- <span class="rf-is-shdw-r">
- </span>
- <span class="rf-is-shdw-b">
- </span>
- <span class="rf-is-lst-dec">
- <span class="rf-is-lst-scrl" style="height: 100px">
- <span id="form:inplaceSelectWithControlsItems">
- <span id="form:inplaceSelectWithControlsItem0" class="rf-is-opt">
- Label#1
- </span>
- <span id="form:inplaceSelectWithControlsItem1" class="rf-is-opt">
- Label#2
- </span>
- <span id="form:inplaceSelectWithControlsItem2" class="rf-is-opt">
- Label#3
- </span>
- <span id="form:inplaceSelectWithControlsItem3" class="rf-is-opt">
- Label#4
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- </span>
- <script type="text/javascript">
- //ignored
- </script>
+ <span class="rf-is-lbl" id="form:inplaceSelectWithControlsLabel">Edit Text</span>
+ <input class="rf-is-none" id="form:inplaceSelectWithControlsFocus" name="form:inplaceSelectWithControlsFocus" style="position: absolute; top: 0px; left: 0px; outline-style: none;" type="image" />
+ <span class="rf-is-edit rf-is-none" id="form:inplaceSelectWithControlsEdit">
+ <input id="form:inplaceSelectWithControlsselValue" name="form:inplaceSelectWithControls" type="hidden" />
+ <input autocomplete="off" class="rf-is-fld" id="form:inplaceSelectWithControlsInput" name="form:inplaceSelectWithControlsInput" readonly="readonly" style="width: ;" type="text" />
+ <span class="rf-is-btn-prepos">
+ <span class="rf-is-btn-pos">
+ <span class="rf-is-shdw" id="form:inplaceSelectWithControlsBtnshadow">
+ <span class="rf-is-shdw-t"></span>
+ <span class="rf-is-shdw-l"></span>
+ <span class="rf-is-shdw-r"></span>
+ <span class="rf-is-shdw-b"></span>
+ <span id="form:inplaceSelectWithControlsBtn" style="position : relative;">
+ <input class="rf-is-btn" id="form:inplaceSelectWithControlsOkbtn" onmousedown="this.className='rf-is-btn-press'" onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" src="/javax.faces.resource/ico_ok.gif.jsf?ln=org.richfaces" type="image" />
+ <input class="rf-is-btn" id="form:inplaceSelectWithControlsCancelbtn" onmousedown="this.className='rf-is-btn-press'" onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" src="/javax.faces.resource/ico_cancel.gif.jsf?ln=org.richfaces" type="image" />
+ <br />
+ </span>
+ </span>
+ </span>
+ </span>
+ <span class="rf-is-lst-cord" id="form:inplaceSelectWithControlsList" style="display: none">
+ <span class="rf-is-lst-pos" style="width: 200px">
+ <span class="rf-is-shdw">
+ <span class="rf-is-shdw-t"></span>
+ <span class="rf-is-shdw-l"></span>
+ <span class="rf-is-shdw-r"></span>
+ <span class="rf-is-shdw-b"></span>
+ <span class="rf-is-lst-dec">
+ <span class="rf-is-lst-scrl" style="height: 100px">
+ <span id="form:inplaceSelectWithControlsItems">
+ <span id="form:inplaceSelectWithControlsItem0" class="rf-is-opt">Label#1</span>
+ <span id="form:inplaceSelectWithControlsItem1" class="rf-is-opt">Label#2</span>
+ <span id="form:inplaceSelectWithControlsItem2" class="rf-is-opt">Label#3</span>
+ <span id="form:inplaceSelectWithControlsItem3" class="rf-is-opt">Label#4</span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ </span>
+ <script type="text/javascript">
+ // ignore
+ </script>
</span>
\ No newline at end of file
14 years, 9 months
JBoss Rich Faces SVN: r20769 - modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-23 09:09:07 -0500 (Thu, 23 Dec 2010)
New Revision: 20769
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/dataModel.xhtml
Log:
* fixed calendar sample - output is now updated
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/dataModel.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/dataModel.xhtml 2010-12-23 14:08:01 UTC (rev 20768)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/dataModel.xhtml 2010-12-23 14:09:07 UTC (rev 20769)
@@ -54,7 +54,12 @@
<ui:define name="component">
<div style="padding: 250px">
- <rich:calendar id="calendar" boundaryDatesMode="scroll" dataModel="#{calendarModel}" mode="ajax" >
+ <rich:calendar id="calendar"
+ boundaryDatesMode="scroll"
+ dataModel="#{calendarModel}"
+ mode="ajax"
+ timeZone="#{richCalendarBean.timeZone}"
+ value="#{richCalendarBean.attributes['value'].value}" >
<a4j:ajax event="change" render="output, phasesPanel" limitRender="#{true}"/>
</rich:calendar>
</div>
14 years, 9 months