You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by do...@apache.org on 2008/01/25 03:40:45 UTC

svn commit: r615100 - in /incubator/shindig/trunk/features: skins/ skins/feature.xml skins/skins.js tabs/tabs.js views/ views/feature.xml views/views.js

Author: doll
Date: Thu Jan 24 18:40:42 2008
New Revision: 615100

URL: http://svn.apache.org/viewvc?rev=615100&view=rev
Log:
Added first version of the skins and views libraries. These do not have working implementations yet.
Also made some small js doc changes to tabs.js


Added:
    incubator/shindig/trunk/features/skins/
    incubator/shindig/trunk/features/skins/feature.xml
    incubator/shindig/trunk/features/skins/skins.js
    incubator/shindig/trunk/features/views/
    incubator/shindig/trunk/features/views/feature.xml
    incubator/shindig/trunk/features/views/views.js
Modified:
    incubator/shindig/trunk/features/tabs/tabs.js

Added: incubator/shindig/trunk/features/skins/feature.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/skins/feature.xml?rev=615100&view=auto
==============================================================================
--- incubator/shindig/trunk/features/skins/feature.xml (added)
+++ incubator/shindig/trunk/features/skins/feature.xml Thu Jan 24 18:40:42 2008
@@ -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>skins</name>
+  <gadget>
+    <script src="skins.js"/>
+  </gadget>
+</feature>

Added: incubator/shindig/trunk/features/skins/skins.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/skins/skins.js?rev=615100&view=auto
==============================================================================
--- incubator/shindig/trunk/features/skins/skins.js (added)
+++ incubator/shindig/trunk/features/skins/skins.js Thu Jan 24 18:40:42 2008
@@ -0,0 +1,61 @@
+/*
+ * 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 provides functions for getting skin information.
+ */
+
+var gadgets = gadgets || {};
+
+/**
+ * @static
+ * @class Provides operations for getting display information about the
+ *     currently shown skin.
+ * @name gadgets.skins
+ */
+gadgets.skins = gadgets.skins || {};
+
+/**
+ * Fetches the display property mapped to the given key.
+ *
+ * @param {String} propertyKey The key to get data for;
+ *    keys are defined in <a href="gadgets.skins.Property.html"><code>
+ *    gadgets.skins.Property</code></a>
+ * @return {String} The data
+ */
+gadgets.skins.getProperty = function(propertyKey) {};
+
+/**
+ * @static
+ * @class
+ * All of the display values that can be fetched and used in the gadgets UI.
+ * These are the supported keys for the
+ * <a href="gadgets.skins.html#getProperty">gadgets.skins.getProperty()</a>
+ * method.
+ * @name gadgets.skins.Property
+ */
+gadgets.skins.Property = {
+  /** An image to use in the background of the gadget */
+  BG_IMAGE : 'BG_IMAGE',
+  /** The color of the background of the gadget */
+  BG_COLOR : 'BG_COLOR',
+  /** The color that the main font should use */
+  FONT_COLOR : 'FONT_COLOR',
+  /** The color that anchor tags should use */
+  ANCHOR_COLOR : 'ANCHOR_COLOR'
+};
\ No newline at end of file

Modified: incubator/shindig/trunk/features/tabs/tabs.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/tabs/tabs.js?rev=615100&r1=615099&r2=615100&view=diff
==============================================================================
--- incubator/shindig/trunk/features/tabs/tabs.js (original)
+++ incubator/shindig/trunk/features/tabs/tabs.js Thu Jan 24 18:40:42 2008
@@ -24,7 +24,14 @@
 
 /**
  * @class Tab class for gadgets.
+ *
+ * @name gadgets.Tab
+ * @description Creates a new Tab
+ */
+
+/**
  * @param {gadgets.Tabs} handle The associated gadgets.Tabs instance.
+ * @private
  * @constructor
  */
 gadgets.Tab = function(handle) {
@@ -83,7 +90,6 @@
  * @param {Element} opt_container The HTML element to contain the tabs.  If
  *                    omitted, a new div element is created and inserted at the
  *                    very top.
- * @constructor
  */
 gadgets.Tabs = function(opt_moduleId, opt_defaultTab, opt_container) {
   // TODO

Added: incubator/shindig/trunk/features/views/feature.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/views/feature.xml?rev=615100&view=auto
==============================================================================
--- incubator/shindig/trunk/features/views/feature.xml (added)
+++ incubator/shindig/trunk/features/views/feature.xml Thu Jan 24 18:40:42 2008
@@ -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>views</name>
+  <gadget>
+    <script src="views.js"/>
+  </gadget>
+</feature>

Added: incubator/shindig/trunk/features/views/views.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/views/views.js?rev=615100&view=auto
==============================================================================
--- incubator/shindig/trunk/features/views/views.js (added)
+++ incubator/shindig/trunk/features/views/views.js Thu Jan 24 18:40:42 2008
@@ -0,0 +1,138 @@
+/*
+ * 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 provides functions for navigating to and dealing
+ *     with views of the current gadget.
+ */
+
+var gadgets = gadgets || {};
+
+/**
+ * @static
+ * @class Provides operations for dealing with Views.
+ * @name gadgets.views
+ */
+gadgets.views = gadgets.views || {};
+
+/**
+ * Attempts to navigate to this gadget in a different view. If the container
+ * supports parameters will pass the optional parameters along to the gadget in
+ * the new view.
+ *
+ * @param {gadgets.views.View} view The view to navigate to
+ * @param {Map.&lt;String, String&gt;} opt_params Parameters to pass to the
+ *     gadget after it has been navigated to on the surface
+ */
+gadgets.views.requestNavigateTo = function(surface, opt_params) {
+  return opensocial.Container.get().requestNavigateTo(surface, opt_params);
+};
+
+/**
+ * Returns the current view.
+ *
+ * @return {gadgets.views.View} The current view
+ */
+gadgets.views.getCurrentView = function() {
+  return this.surface;
+};
+
+/**
+ * Returns a map of all the supported views. Keys each gadgets.view.View by
+ * its name.
+ *
+ * @return {Map&lt;gadgets.views.ViewType | String, gadgets.views.View&gt;} All
+ *   supported views, keyed by their name attribute.
+ */
+gadgets.views.getSupportedViews = function() {
+  return this.supportedSurfaces;
+};
+
+/**
+ * Returns the parameters passed into this gadget for this view. Does not
+ * include all url parameters, only the ones passed into
+ * gadgets.views.requestNavigateTo
+ *
+ * @return {Map.&lt;String, String&gt;} The parameter map
+ */
+gadgets.views.getParams = function() {
+  return this.params;
+};
+
+
+/**
+ * @class Base interface for all view objects.
+ * @name gadgets.views.View
+ */
+
+/**
+ * @private
+ * @constructor
+ */
+gadgets.views.View = function(name, opt_isOnlyVisibleGadgetValue) {
+  this.name = name;
+  this.isOnlyVisibleGadgetValue = !!opt_isOnlyVisibleGadgetValue;
+};
+
+/**
+ * Returns the name of this view.
+ *
+ * @return {gadgets.views.ViewType | String} The view name, usually specified as
+ * a gadgets.views.ViewType
+ */
+gadgets.views.View.prototype.getName = function() {
+  return this.name;
+};
+
+/**
+ * Returns true if the gadget is the only visible gadget in this view.
+ * On a canvas page or in maximize mode this is most likely true; on a profile
+ * page or in dashboard mode, it is most likely false.
+ *
+ * @return {boolean} True if the gadget is the only visible gadget; otherwise, false
+ */
+gadgets.views.View.prototype.isOnlyVisibleGadget = function() {
+  return this.isOnlyVisibleGadgetValue;
+};
+
+
+/**
+ * @static
+ * @class
+ * Used by <a href="gadgets.views.View.html"> View</a>s.
+ * @name gadgets.views.ViewType
+ */
+gadgets.views.ViewType = {
+ /**
+  * A view where the gadget is displayed in a very large mode. It should be the
+  * only thing on the page. In a social context, this is usually called the
+  * canvas page.
+  */
+  FULL_PAGE : 'FULL_PAGE',
+
+ /**
+  * A view where the gadget is displayed in a small area usually on a page with
+  * other gadgets. In a social context, this is usually called the profile page.
+  */
+  DASHBOARD : 'DASHBOARD',
+
+ /**
+  * A view where the gadget is displayed in a small separate window by itself.
+  */
+  POPUP : 'POPUP'
+};
\ No newline at end of file