--- Webpacus/root/editor/editor.js 2006/01/07 23:43:33 356 +++ Webpacus/root/editor/editor.js 2006/01/07 23:43:38 357 @@ -231,11 +231,38 @@ Logger.debug('hide_working, count = '+working_count); } +/* called body.onLoad */ + function init_page() { show_working(); + textarea_reset_size( 'template_content' ); + textarea_reset_size( 'css_content' ); + edit_template(); hide_working(); } +/* resize textarea */ + +function textarea_reset_size( id ) { + var textarea = $( id ); + if (! textarea) { + Logger.error('can\'t reset size to non-existant textarea '+id); + return; + } + var hgt = Cookie.get('webpacus_ta_'+id); + if (! hgt) hgt='20em'; + textarea.style.height = hgt; + Logger.debug('reset textarea '+id+' height to '+hgt); +} + +function textarea_resize( id, val ){ + var textarea = $( id ); + var height = parseInt(textarea.style.height.substr(0,textarea.style.height.length-2)); + height += val; + Logger.debug('resize_textarea('+id+','+val+') '+textarea.style.height+' '+height); + textarea.style.height = height+'px'; + Cookie.set('webpacus_ta_'+id,textarea.style.height,365); +}