Changeset 1660

Show
Ignore:
Timestamp:
08/08/08 21:53:00 (5 years ago)
Author:
evdlinden
Message:

Skinnable implemented. You can now set your own image, stylesheet, width and visible width.

Location:
coldbox/trunk/CodeDepot/projects/sidebar
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • coldbox/trunk/CodeDepot/projects/sidebar/config/coldbox.xml.cfm

    r1659 r1660  
    238238                <Interceptor class="sidebar.interceptors.sideBar"> 
    239239                        <Property name="isEnabled">true</Property> 
    240                         <Property name="yOffset">100</Property> 
    241                         <Property name="width">200</Property> 
     240                        <!-- Y offset, else leave blank --> 
     241                        <Property name="yOffset"></Property> 
     242                        <!-- Links (JSON array of objects), else leave blank --> 
    242243                        <Property name="links"> 
    243244                                [ 
     
    246247                                ,{"desc":"ColdBox Forums","href":"http:\/\/groups.google.com\/group\/coldbox"} 
    247248                                ,{"desc":"Coldfusion Live Docs","href":"http:\/\/livedocs.adobe.com\/coldfusion\/8\/htmldocs\/help.html?content=Part_3_CFML_Ref_1.html"} 
    248                                 ,{"desc":"Ernst","href":"http:\/\/evdlinden.behindthe.net"} 
    249                                 ,{"desc":"Luis","href":"http:\/\/www.luismajano.com"} 
    250249                                ] 
    251250                        </Property> 
     251                         
     252                        <!-- Width of the sidebar including visible width, else leave blank --> 
     253                        <Property name="width"></Property> 
     254                        <!-- Visible width, else leave blank  --> 
     255                        <Property name="visibleWidth"></Property> 
     256                        <!--Full path from the application's root, else leave blank. --> 
     257                        <Property name="imagePath"></Property> 
     258                        <!--Full path from the application's root, else leave blank. --> 
     259                        <Property name="cssPath"></Property> 
    252260                </Interceptor> 
    253261        </Interceptors> 
  • coldbox/trunk/CodeDepot/projects/sidebar/includes/sidebar/sideBar.cfm

    r1659 r1660  
    1616 
    1717<cfhtmlhead text='<script language="javascript" src="includes/sidebar/sideBar.js" type="text/javascript"></script>' /> 
    18 <cfhtmlhead text='<link rel="stylesheet" href="includes/sidebar/sideBar.css" type="text/css" media="screen">' /> 
     18<cfhtmlhead text='<link rel="stylesheet" href="#sideBar.cssPath#" type="text/css" media="screen">' /> 
    1919 
    2020<!---  
     
    7171                        <tr> 
    7272                                <td class="top" width="#sideBar.invisibleWidth#" nowrap><h1>Settings</h1></td> 
    73                                 <td background="" rowspan="#(15 + ArrayLen(sideBar.links))#" width="#sideBar.visibleWidth#" nowrap class="bar" valign="middle" align="left"><img src="includes/sideBar/sideBar.png" width="22" height="160" border="0" /></td> 
     73                                <td background="" rowspan="#(15 + ArrayLen(sideBar.links))#" width="#sideBar.visibleWidth#" nowrap class="bar" valign="middle" align="left"><img src="#sideBar.imagePath#" width="22" height="160" border="0" /></td> 
    7474                        </tr> 
    7575                        <tr> 
     
    117117                                <td><a href="">Clear Log</a></td> 
    118118                        </tr>    
    119                         </tr>    
    120                         <tr> 
    121                                 <td><a href="http://groups.google.com/group/coldbox" target="_blank"></a></td> 
    122                         </tr>    
    123                         <!--- links? ---> 
     119                        <!--- Custom links? ---> 
    124120                        <cfif ArrayLen(sideBar.links)> 
    125121                                <tr> 
    126122                                        <td><h1>Links</h1></td> 
    127123                                </tr> 
    128                                 <!--- Loop links ---> 
     124                                <!--- Loop custom links ---> 
    129125                                <cfloop index="i" from="1" to="#ArrayLen(sideBar.links)#"> 
    130126                                <tr> 
  • coldbox/trunk/CodeDepot/projects/sidebar/interceptors/sideBar.cfc

    r1657 r1660  
    2626                        if( not propertyExists('width') or not isNumeric(getproperty('width')) ){ 
    2727                                setProperty('width',200); 
     28                        } 
     29                        if( not propertyExists('visibleWidth') or not isNumeric(getproperty('visibleWidth')) ){ 
     30                                setProperty('visibleWidth',12); 
     31                        } 
     32                        if( not propertyExists('imagePath') or not REFindNoCase("[A-Z]",getproperty('imagePath')) ){ 
     33                                setProperty('imagePath',"includes/sideBar/sideBar.png"); 
     34                        } 
     35                        if( not propertyExists('cssPath') or not REFindNoCase("[A-Z]",getproperty('cssPath')) ){ 
     36                                setProperty('cssPath',"includes/sidebar/sideBar.css"); 
    2837                        } 
    2938                </cfscript> 
     
    7887                <cfset var renderedSideBar = ''> 
    7988                <cfset var i = 0> 
    80                 <!--- SideBar dimension settings ---> 
     89                <!--- SideBar Settings ---> 
    8190                <cfset var sideBar = StructNew()> 
    8291                <cfset sideBar.links = getproperty('links')> 
    8392                <cfset sideBar.yOffset = getproperty('yOffset')> 
    8493                <cfset sideBar.width = getproperty('width')> 
    85                 <cfset sideBar.visibleWidth = 22> 
     94                <cfset sideBar.visibleWidth = getproperty('visibleWidth')> 
    8695                <cfset sideBar.invisibleWidth = sideBar.width - sideBar.visibleWidth> 
    87                  
     96                <cfset sideBar.imagePath = getproperty('imagePath')> 
     97                <cfset sideBar.cssPath = getproperty('cssPath')> 
    8898                 
    8999                <!--- Render? --->