You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/03/29 03:14:49 UTC

svn commit: r928555 [16/16] - in /myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources: oam.custom.calendar.DB/ oam.custom.calendar.WH/ oam.custom.calendar.images/ oam.custom.inputHtml.kupudrawers/ oam.custom.inputHtml.kupuimages/ oam.cu...

Added: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-minus.gif
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-minus.gif?rev=928555&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-minus.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-plus-line-last.gif
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-plus-line-last.gif?rev=928555&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-plus-line-last.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-plus-line-middle.gif
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-plus-line-middle.gif?rev=928555&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-plus-line-middle.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-plus.gif
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-plus.gif?rev=928555&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/nav-plus.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/spacer.gif
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/spacer.gif?rev=928555&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.images/spacer.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.javascript/cookielib.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.javascript/cookielib.js?rev=928555&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.javascript/cookielib.js (added)
+++ myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.javascript/cookielib.js Mon Mar 29 01:14:43 2010
@@ -0,0 +1,124 @@
+//=============================================================================
+// CookieLib Definition
+// Contains general purpose javascript methods for managing html cookies
+//=============================================================================
+
+function CookieLib(){}
+
+CookieLib.COOKIE_DELIM = ";";
+CookieLib.COOKIE_KEYVAL = "=";
+CookieLib.ATTRIB_DELIM = ";";
+CookieLib.ATTRIB_KEYVAL = "=";
+
+/**
+ * Retrieves the specified cookie as a String of text
+ * @param String name - name of cookie to retrieve
+ * @return String cookie value or null if not found
+ */
+function CookieLib_getRawCookie(name) {
+    var search = name + CookieLib.COOKIE_KEYVAL;
+    if (document.cookie)
+    {
+        if (document.cookie.length > 0)
+        {
+            offset = document.cookie.indexOf(search);
+            if (offset != -1)
+            {
+               offset += search.length;
+               end = document.cookie.indexOf(CookieLib.COOKIE_DELIM, offset);
+               if (end == -1) end = document.cookie.length;
+               return unescape(document.cookie.substring(offset, end));
+            }
+        }
+    }
+    return null;
+}
+CookieLib.getRawCookie = CookieLib_getRawCookie;
+
+/**
+ * Cookies can hold multiple pieces of information.  This methods saves a key/value pair to
+ * the specified cookie.  Each key/value pair is separated by a special character
+ * defined by the ATTRIB_DELIM constant.  Setting an attribute's value to null or empty string
+ * will remove it from the cookie.
+ * @param cookieName String - name of cookie that will hold the key/value pair
+ * @param attribName String - attribute key
+ * @param attribValue String - attribute value
+ */
+function CookieLib_setCookieAttrib(cookieName, attribName, attribValue)
+{
+    var attribMap = CookieLib.getCookie(cookieName);
+    attribMap[attribName] = attribValue;
+    CookieLib.setCookie(cookieName,attribMap);
+}
+CookieLib.setCookieAttrib = CookieLib_setCookieAttrib;
+
+/**
+ * Cookies can hold multiple pieces of information.  This methods retrieves a value from the
+ * specified cookie using the specified key (attribName).  Each key/value pair is separated by a
+ * special character defined by the ATTRIB_DELIM constant.
+ * @param cookieName String - name of cookie that that holds the key/value pair
+ * @param attribName String - attribute key
+ * @param attribValue String - attribute value
+ * @return String value
+ */
+function CookieLib_getCookieAttrib(cookieName, attribName)
+{
+    var attribMap = CookieLib.getCookie(cookieName);
+    return attribMap[attribName];
+}
+CookieLib.getCookieAttrib = CookieLib_getCookieAttrib;
+
+/**
+ * Retrieves a map of all key/value pairs (attributes) stored in the specified cookie.
+ * @param cookieName String - name of cookie
+ * @return Array of all attributes
+ */
+function CookieLib_getCookie(cookieName)
+{
+    var attribMap = new Array();
+    var cookie = CookieLib.getRawCookie(cookieName);
+    if (typeof( cookie ) != "undefined"  && cookie != null)
+    {
+        var attribArray = cookie.split(CookieLib.ATTRIB_DELIM);
+        for (var i=0;i<attribArray.length;i++)
+        {
+            var index = attribArray[i].indexOf(CookieLib.ATTRIB_KEYVAL);
+            var name =  attribArray[i].substring(0,index);
+            var value = attribArray[i].substring(index+1);
+            attribMap[name] = value;
+        }
+    }
+    return attribMap;
+}
+CookieLib.getCookie = CookieLib_getCookie;
+
+/**
+ * Saves a map of cookie attributes to the specified cookie.  Null or empty string values are not saved.
+ * @param cookieName String - name of cookie to create
+ * @param attribMap Array - holds key/value pairs to save in cookie
+ */
+function CookieLib_setCookie(cookieName, attribMap)
+{
+    var attrib = "";
+    for (var name in attribMap)
+    {
+        var value = attribMap[name];
+
+        if (typeof( value ) != "undefined"  && value != null && value != "" && typeof(value) != "function")
+        {
+            if (name.indexOf(CookieLib.ATTRIB_KEYVAL) < 0 && value.indexOf(CookieLib.ATTRIB_KEYVAL) < 0 &&
+                name.indexOf(CookieLib.ATTRIB_DELIM) < 0 && value.indexOf(CookieLib.ATTRIB_DELIM) < 0)
+            {
+                attrib += ((attrib == "") ? "" : CookieLib.ATTRIB_DELIM);
+                attrib += (name + CookieLib.ATTRIB_KEYVAL + value);
+             }
+            else
+            {
+                alert("Cookie attribute name and/or value contains a delimeter (" +
+                       CookieLib.ATTRIB_KEYVAL + " or " + CookieLib.ATTRIB_DELIM + ").");
+            }
+        }
+    }
+    document.cookie = cookieName + CookieLib.COOKIE_KEYVAL + escape(attrib);
+}
+CookieLib.setCookie = CookieLib_setCookie;

Added: myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.javascript/tree.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.javascript/tree.js?rev=928555&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.javascript/tree.js (added)
+++ myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/resources/oam.custom.tree2.javascript/tree.js Mon Mar 29 01:14:43 2010
@@ -0,0 +1,22 @@
+function treeNavClick(spanId, navImageId, image1, image2, nodeImgId, expandImg, collapseImg, cookieName, nodeId)  {
+    var navSpan = document.getElementById(spanId);
+    var displayStyle = navSpan.style.display;
+    if (displayStyle == 'none') {
+        displayStyle = 'block'
+        CookieLib.setCookieAttrib(cookieName, nodeId, "x");
+    } else {
+        displayStyle = 'none';
+        CookieLib.setCookieAttrib(cookieName, nodeId, "c");
+    }
+    navSpan.style.display = displayStyle;
+    if (navImageId != '') {
+        var navImage = document.getElementById(navImageId);
+        if (navImage.src.indexOf(image1)>=0) navImage.src = image2; else navImage.src = image1;
+    }
+    if (nodeImgId != '') {
+        var nodeImg = document.getElementById(nodeImgId);
+        if (nodeImg.src.indexOf(expandImg) >=0)
+            nodeImg.src = collapseImg;
+        else nodeImg.src = expandImg;
+    }
+}
\ No newline at end of file