Changes between Version 15 and Version 16 of RendererHOWTO
- Timestamp:
- 16-01-2007 00:35:41 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RendererHOWTO
v15 v16 118 118 Then it defines the default options with {{{ options = Object.extend({}) }}} 119 119 120 These 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 120 126 And then it defines the default CSS styles with {{{ options.css={} }}}. If an option '''css''' is provided, then the dynamic CSS is not set. 121 127 … … 128 134 options = Object.extend({ // default options 129 135 'divid': false, 136 'boxclass': 'hello', 130 137 'text': 'Hello World', 131 138 }, arguments[0] || {}); … … 134 141 if(options.css===undefined) { 135 142 options.css={ 136 'h1': { 143 '.hello': { 144 'font-family':'Verdana', 145 }, 146 '.hello h1': { 137 147 'margin':'10px 0 0 0', 138 148 'padding':'0', … … 141 151 } 142 152 } 143 SAPO.Utility.CSS.set(options.css,short); 153 144 154 }; 155 156 SAPO.Utility.CSS.set(options.css,short); 145 157 }}} 146 158 … … 155 167 156 168 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>"); 158 170 divid=document.getElementById(short+this.options.instance); 159 171 } … … 161 173 { 162 174 divid=document.getElementById(options.divid); 163 divid.setAttribute('class', short);175 divid.setAttribute('class', options.boxclass); 164 176 } 165 177