You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by jo...@apache.org on 2009/07/24 00:34:04 UTC

svn commit: r797250 - in /incubator/shindig/trunk/features/src/main/javascript/features: ./ dynamic-height.util/ dynamic-height/

Author: johnh
Date: Thu Jul 23 22:34:04 2009
New Revision: 797250

URL: http://svn.apache.org/viewvc?rev=797250&view=rev
Log:
Refactoring feature dynamic-height. Pulls out gadgets.window.getViewportDimensions()


Added:
    incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/
    incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js
    incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/feature.xml
Modified:
    incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js
    incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/feature.xml
    incubator/shindig/trunk/features/src/main/javascript/features/features.txt

Added: incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js?rev=797250&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js Thu Jul 23 22:34:04 2009
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+/**
+ * @fileoverview This library augments gadgets.window with functionality
+ * to get the frame's viewport dimensions.
+ */
+
+var gadgets = gadgets || {};
+
+/**
+ * @static
+ * @class Provides operations for getting information about and modifying the
+ *     window the gadget is placed in.
+ * @name gadgets.window
+ */
+gadgets.window = gadgets.window || {};
+
+// we wrap these in an anonymous function to avoid storing private data
+// as members of gadgets.window.
+(function() {
+  /**
+   * Detects the inner dimensions of a frame.
+   * See: http://www.quirksmode.org/viewport/compatibility.html for more
+   * information.
+   * @returns {Object} An object with width and height properties.
+   * @member gadgets.window
+   */
+  gadgets.window.getViewportDimensions = function() {
+    var x,y;
+    if (self.innerHeight) {
+      // all except Explorer
+      x = self.innerWidth;
+      y = self.innerHeight;
+    } else if (document.documentElement &&
+               document.documentElement.clientHeight) {
+      // Explorer 6 Strict Mode
+      x = document.documentElement.clientWidth;
+      y = document.documentElement.clientHeight;
+    } else if (document.body) {
+      // other Explorers
+      x = document.body.clientWidth;
+      y = document.body.clientHeight;
+    } else {
+      x = 0;
+      y = 0;
+    }
+    return {width: x, height: y};
+  };
+})();

Added: incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/feature.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/feature.xml?rev=797250&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/feature.xml (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/feature.xml Thu Jul 23 22:34:04 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+-->
+<feature>
+  <name>dynamic-height.util</name>
+  <gadget>
+    <script src="dynamic-height-util.js"/>
+  </gadget>
+</feature>

Modified: incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js?rev=797250&r1=797249&r2=797250&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js Thu Jul 23 22:34:04 2009
@@ -74,35 +74,6 @@
   }
 
   /**
-   * Detects the inner dimensions of a frame.
-   * See: http://www.quirksmode.org/viewport/compatibility.html for more
-   * information.
-   * @returns {Object} An object with width and height properties.
-   * @member gadgets.window
-   */
-  gadgets.window.getViewportDimensions = function() {
-    var x,y;
-    if (self.innerHeight) {
-      // all except Explorer
-      x = self.innerWidth;
-      y = self.innerHeight;
-    } else if (document.documentElement &&
-               document.documentElement.clientHeight) {
-      // Explorer 6 Strict Mode
-      x = document.documentElement.clientWidth;
-      y = document.documentElement.clientHeight;
-    } else if (document.body) {
-      // other Explorers
-      x = document.body.clientWidth;
-      y = document.body.clientHeight;
-    } else {
-      x = 0;
-      y = 0;
-    }
-    return {width: x, height: y};
-  };
-
-  /**
    * Adjusts the gadget height
    * @param {Number} opt_height An optional preferred height in pixels. If not
    *     specified, will attempt to fit the gadget to its content.

Modified: incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/feature.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/feature.xml?rev=797250&r1=797249&r2=797250&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/feature.xml (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/feature.xml Thu Jul 23 22:34:04 2009
@@ -18,6 +18,7 @@
 -->
 <feature>
   <name>dynamic-height</name>
+  <dependency>dynamic-height.util</dependency>
   <dependency>rpc</dependency>
   <gadget>
     <script src="dynamic-height.js"/>

Modified: incubator/shindig/trunk/features/src/main/javascript/features/features.txt
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/features.txt?rev=797250&r1=797249&r2=797250&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/features.txt (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/features.txt Thu Jul 23 22:34:04 2009
@@ -24,6 +24,7 @@
 features/content-rewrite/feature.xml
 features/core.io/feature.xml
 features/core/feature.xml
+features/dynamic-height.util/feature.xml
 features/dynamic-height/feature.xml
 features/flash/feature.xml
 features/i18n/feature.xml
@@ -35,13 +36,13 @@
 features/opensocial-0.8/feature.xml
 features/opensocial-base/feature.xml
 features/opensocial-current/feature.xml
-features/opensocial-data/feature.xml
 features/opensocial-data-context/feature.xml
+features/opensocial-data/feature.xml
 features/opensocial-jsonrpc/feature.xml
 features/opensocial-reference/feature.xml
 features/opensocial-templates/feature.xml
-features/pubsub/feature.xml
 features/osapi/feature.xml
+features/pubsub/feature.xml
 features/rpc/feature.xml
 features/setprefs/feature.xml
 features/settitle/feature.xml