231 |
Logger.debug('hide_working, count = '+working_count); |
Logger.debug('hide_working, count = '+working_count); |
232 |
} |
} |
233 |
|
|
234 |
|
/* called body.onLoad */ |
235 |
|
|
236 |
function init_page() { |
function init_page() { |
237 |
show_working(); |
show_working(); |
238 |
|
|
239 |
|
textarea_reset_size( 'template_content' ); |
240 |
|
textarea_reset_size( 'css_content' ); |
241 |
|
|
242 |
edit_template(); |
edit_template(); |
243 |
|
|
244 |
hide_working(); |
hide_working(); |
245 |
} |
} |
246 |
|
|
247 |
|
/* resize textarea */ |
248 |
|
|
249 |
|
function textarea_reset_size( id ) { |
250 |
|
var textarea = $( id ); |
251 |
|
if (! textarea) { |
252 |
|
Logger.error('can\'t reset size to non-existant textarea '+id); |
253 |
|
return; |
254 |
|
} |
255 |
|
var hgt = Cookie.get('webpacus_ta_'+id); |
256 |
|
if (! hgt) hgt='20em'; |
257 |
|
textarea.style.height = hgt; |
258 |
|
Logger.debug('reset textarea '+id+' height to '+hgt); |
259 |
|
} |
260 |
|
|
261 |
|
function textarea_resize( id, val ){ |
262 |
|
var textarea = $( id ); |
263 |
|
var height = parseInt(textarea.style.height.substr(0,textarea.style.height.length-2)); |
264 |
|
height += val; |
265 |
|
Logger.debug('resize_textarea('+id+','+val+') '+textarea.style.height+' '+height); |
266 |
|
textarea.style.height = height+'px'; |
267 |
|
Cookie.set('webpacus_ta_'+id,textarea.style.height,365); |
268 |
|
} |