Index: style-size-normal.css =================================================================== --- style-size-normal.css (revision 0) +++ style-size-normal.css (revision 8) @@ -0,0 +1 @@ +#page{font-size:.83em;} \ No newline at end of file Property changes on: style-size-normal.css ___________________________________________________________________ Name: svn:eol-style + native Index: theme-settings.php =================================================================== --- theme-settings.php (revision 0) +++ theme-settings.php (revision 8) @@ -0,0 +1,46 @@ + 0, + 'tendu_size' => 'small', + ); + + // Merge the saved variables and their default values + $settings = array_merge($defaults, $saved_settings); + + // Create the form widgets using Forms API + $options = array(); + $options['normal'] = 'normal'; + $options['small'] = 'small'; + $form['tendu_size'] = array( + '#type' => 'select', + '#title' => t('Size'), + '#options' => $options, + '#default_value' => $settings['tendu_size'], + '#description' => t('Select a size scheme for this template, this will modify font sizes.'), + ); + + $form['tendu_niftycorners'] = array( + '#type' => 'checkbox', + '#title' => t('Enable niftycorners (rounded corners)'), + '#default_value' => $settings['tendu_niftycorners'], + ); + + + // Return the additional form widgets + return $form; +} \ No newline at end of file Property changes on: theme-settings.php ___________________________________________________________________ Name: svn:eol-style + native Index: style.css =================================================================== --- style.css (revision 5) +++ style.css (revision 8) @@ -74,7 +74,7 @@ html, body{height:100%;} * etc... */ body{font-family:Arial, Helvetica, sans-serif;font-size:100%;} -#page{font-size:.75em;line-height:1.333em;} +#page{line-height:1.333em;} /* Main Layout: */ @@ -115,7 +115,6 @@ body{font-family:Arial, Helvetica, sans- #content-top, #content-area, #content-bottom, -#footer, #header, #main{width:100%;overflow:hidden;} Index: template.php =================================================================== --- template.php (revision 5) +++ template.php (revision 8) @@ -12,6 +12,53 @@ * http://drupal.org/project/i18n */ +/* +* Initialize theme settings +*/ +if (is_null(theme_get_setting('tendu_size'))) { + global $theme_key; + + /* + * The default values for the theme variables. Make sure $defaults exactly + * matches the $defaults in the theme-settings.php file. + */ + $defaults = array( + 'tendu_niftycorners' => 0, + 'tendu_size' => 'small', + ); + + // Get default theme settings. + $settings = theme_get_settings($theme_key); + // Don't save the toggle_node_info_ variables. + if (module_exists('node')) { + foreach (node_get_types() as $type => $name) { + unset($settings['toggle_node_info_' . $type]); + } + } + // Save default theme settings. + variable_set( + str_replace('/', '_', 'theme_'. $theme_key .'_settings'), + array_merge($defaults, $settings) + ); + // Force refresh of Drupal internals. + theme_get_setting('', TRUE); +} + +if ( theme_get_setting('tendu_niftycorners') ) { + $theme_path = path_to_theme(); + + // Add javascript and stylesheets here. + drupal_add_js($theme_path .'/niftycube.js'); + drupal_add_css($theme_path .'/niftyCorners.css','theme','all'); + drupal_add_css($theme_path .'/niftyCornersTendu.css','theme','all'); + // Add nifty initialization js + drupal_add_js($theme_path .'/niftyTendu.js'); +} + +if ( $size = theme_get_setting('tendu_size') ) { + drupal_add_css(path_to_theme() ."/style-size-$size.css", 'theme'); +} + /** * CSS Files * Notes: Index: niftycube.js =================================================================== --- niftycube.js (revision 0) +++ niftycube.js (revision 8) @@ -0,0 +1,298 @@ +/* Nifty Corners Cube - rounded corners with CSS and Javascript +Copyright 2006 Alessandro Fulciniti (a.fulciniti@html.it) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +var niftyOk=(document.getElementById && document.createElement && Array.prototype.push); +var niftyCss=false; + +String.prototype.find=function(what){ +return(this.indexOf(what)>=0 ? true : false); +} + +var oldonload=window.onload; +if(typeof(NiftyLoad)!='function') NiftyLoad=function(){}; +if(typeof(oldonload)=='function') + window.onload=function(){oldonload();AddCss();NiftyLoad()}; +else window.onload=function(){AddCss();NiftyLoad()}; + +function AddCss(){ +niftyCss=true; +var l=CreateEl("link"); +l.setAttribute("type","text/css"); +l.setAttribute("rel","stylesheet"); +l.setAttribute("href","niftyCorners.css"); +l.setAttribute("media","screen"); +document.getElementsByTagName("head")[0].appendChild(l); +} + +function Nifty(selector,options){ +if(niftyOk==false) return; +if(niftyCss==false) AddCss(); +var i,v=selector.split(","),h=0; +if(options==null) options=""; +if(options.find("fixed-height")) + h=getElementsBySelector(v[0])[0].offsetHeight; +for(i=0;i0;i--) + d.appendChild(CreateStrip(i,side,color,border,btype)); +el.style.paddingBottom=0; +el.appendChild(d); +} + +function CreateStrip(index,side,color,border,btype){ +var x=CreateEl("b"); +x.className=btype+index; +x.style.backgroundColor=color; +x.style.borderColor=border; +if(side=="left"){ + x.style.borderRightWidth="0"; + x.style.marginRight="0"; + } +else if(side=="right"){ + x.style.borderLeftWidth="0"; + x.style.marginLeft="0"; + } +return(x); +} + +function CreateEl(x){ +return(document.createElement(x)); +} + +function FixIE(el){ +if(el.currentStyle!=null && el.currentStyle.hasLayout!=null && el.currentStyle.hasLayout==false) + el.style.display="inline-block"; +} + +function SameHeight(selector,maxh){ +var i,v=selector.split(","),t,j,els=[],gap; +for(i=0;imaxh) maxh=els[i].offsetHeight; + els[i].style.height="auto"; + } +for(i=0;i0){ + t=CreateEl("b");t.className="niftyfill";t.style.height=gap+"px"; + nc=els[i].lastChild; + if(nc.className=="niftycorners") + els[i].insertBefore(t,nc); + else els[i].appendChild(t); + } + } +} + +function getElementsBySelector(selector){ +var i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c; +if(selector.find("#")){ //id selector like "tag#id" + if(selector.find(" ")){ //descendant selector like "tag#id tag" + s=selector.split(" "); + var fs=s[0].split("#"); + if(fs.length==1) return(objlist); + f=document.getElementById(fs[1]); + if(f){ + v=f.getElementsByTagName(s[1]); + for(i=0;i