Author: Alex.Kolonitsky
Date: 2010-10-27 13:53:45 -0400 (Wed, 27 Oct 2010)
New Revision: 19711
Added:
trunk/ui/common/ui/src/main/resources/META-INF/resources/
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
Removed:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
Log:
move popup to common ui and clean up
Copied: trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
(from rev 19665,
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js)
===================================================================
--- trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
(rev 0)
+++
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-27
17:53:45 UTC (rev 19711)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Popup = function(id, options) {
+ this.id = id;
+ this.popup = $(document.getElementById(id));
+
+ var mergedOptions = $.extend({}, defaultOptions, options);
+ this.visible = mergedOptions.visible;
+ this.attachTo = mergedOptions.attachTo;
+ this.attachToBody = mergedOptions.attachToBody;
+ this.positionType = mergedOptions.positionType;
+ this.positionOffset = mergedOptions.positionOffset;
+ };
+
+ rf.BaseComponent.extend(rf.ui.Popup);
+ var $super = rf.ui.Popup.$super;
+
+
+ var defaultOptions = {
+ visible: false
+ };
+
+ $.extend(rf.ui.Popup.prototype, {
+
+ name : "popup",
+
+ show: function(event) {
+ if (!this.visible) {
+ if (this.attachToBody) {
+ this.parentElement = this.popup.parent();
+ this.popup.detach().appendTo("body");
+ }
+ this.visible = true;
+ }
+
+ this.popup.setPosition(event || {id: this.attachTo}, {type: this.positionType
, offset: this.positionOffset}).show();
+ },
+
+ hide: function() {
+ if (this.visible) {
+ this.popup.hide();
+ this.visible = false;
+ if (this.attachToBody && this.parentElement) {
+ this.popup.detach().appendTo(this.parentElement);
+ this.parentElement = null;
+ }
+ }
+ },
+
+ isVisible: function() {
+ return this.visible;
+ },
+
+ getId: function() {
+ return this.id;
+ }
+ });
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Deleted: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-27
17:52:44 UTC (rev 19710)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-27
17:53:45 UTC (rev 19711)
@@ -1,83 +0,0 @@
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.Popup = function(id, options) {
- this.id = id;
- this.attachToDom(id);
- this.popup = $(document.getElementById(id));
-
- var mergedOptions = $.extend({}, defaultOptions, options);
- this.visible = mergedOptions.visible;
- this.attachTo = mergedOptions.attachTo;
- this.attachToBody = mergedOptions.attachToBody;
- this.positionType = mergedOptions.positionType;
- this.positionOffset = mergedOptions.positionOffset;
-
- this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
- this.popup.bind("click", $.proxy(this.__onClick, this));
- };
-
- rf.BaseComponent.extend(rf.ui.Popup);
- var $super = rf.ui.Popup.$super;
-
-
- var defaultOptions = {
- visible: false
- };
-
- $.extend(rf.ui.Popup.prototype, (function () {
-
- return{
-
- name : "popup",
-
- show: function() {
- if(!this.visible) {
- if(this.attachToBody) {
- this.parentElement = this.popup.parent();
- this.popup.detach().appendTo("body");
- }
- this.popup.setPosition({id: this.attachTo}, {type: this.positionType , offset:
this.positionOffset}).show();
- this.visible = true;
- this.__onShow();
- }
- },
-
- hide: function() {
- if(this.visible) {
- this.popup.hide();
- this.visible = false;
- if (this.attachToBody && this.parentElement) {
- this.popup.detach().appendTo(this.parentElement);
- this.parentElement = null;
- }
- this.__onHide();
- }
- },
-
- isVisible: function() {
- return this.visible;
- },
-
- getId: function() {
- return this.id;
- },
-
- __onMouseOver: function(e) {
- },
-
- __onClick: function(e) {
- },
-
- __onHide: function() {
- },
-
- __onShow: function() {
-
- }
- }
-
- })());
-
-})(jQuery, window.RichFaces);
\ No newline at end of file