Changes between Version 15 and Version 16 of RendererHOWTO

Show
Ignore:
Timestamp:
16-01-2007 00:35:41 (6 years ago)
Author:
celso
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RendererHOWTO

    v15 v16  
    118118Then it defines the default options with {{{ options = Object.extend({}) }}} 
    119119 
     120These options are common to all widgets: 
     121 
     122  * '''divid''' - optional element ID to render the widget in. 
     123  * '''boxclass''' - optional CSS class name if you want to use a classical external definition of styles. 
     124  * '''css''' - optional CSS JSON structure if you want to use your own. 
     125 
    120126And then it defines the default CSS styles with {{{ options.css={} }}}. If an option '''css''' is provided, then the dynamic CSS is not set. 
    121127 
     
    128134        options = Object.extend({ // default options 
    129135          'divid': false, 
     136          'boxclass': 'hello', 
    130137          'text': 'Hello World', 
    131138           }, arguments[0] || {}); 
     
    134141         if(options.css===undefined) { 
    135142           options.css={ 
    136              'h1': { 
     143             '.hello': { 
     144               'font-family':'Verdana', 
     145               }, 
     146             '.hello h1': { 
    137147               'margin':'10px 0 0 0', 
    138148               'padding':'0', 
     
    141151               } 
    142152              } 
    143             SAPO.Utility.CSS.set(options.css,short); 
     153 
    144154            }; 
     155 
     156          SAPO.Utility.CSS.set(options.css,short); 
    145157}}} 
    146158 
     
    155167 
    156168          if(options.divid===false) { 
    157             document.write("<div class='stags' id='"+short+this.options.instance+"'></div>"); 
     169            document.write("<div class='"+options.boxclass+"' id='"+short+this.options.instance+"'></div>"); 
    158170            divid=document.getElementById(short+this.options.instance); 
    159171            } 
     
    161173            { 
    162174            divid=document.getElementById(options.divid); 
    163             divid.setAttribute('class', short); 
     175            divid.setAttribute('class', options.boxclass); 
    164176            } 
    165177