--- Webpacus/root/editor/editor.js 2005/11/26 20:21:59 166 +++ Webpacus/root/editor/editor.js 2005/11/26 23:26:45 168 @@ -93,18 +93,18 @@ return false; } -function switch_template(template_name) { +function switch_template(new_template_filename) { + + Logger.info('switch_template to '+new_template_filename); - Logger.info('switch_template to '+template_name); - new Effect.Opacity('div_template', { from: 1.0, to: 0.7, duration: 0.3 }); Logger.debug('load template editor'); - load_template(template_name); + template_filename = new_template_filename; + load_template(new_template_filename); Logger.debug('refresh record'); load_rec(rec); - Logger.debug('refresh template list'); - iwfRequest( url+'/template_list/?template='+template_filename, 'div_template_list' ); + return false; } var loading = { @@ -113,10 +113,10 @@ record: 0, } -function load_template( template ) { +function load_template( template_filename ) { if (loading.template) { - Logger.info('loading of template '+name+' skipped, load in progress'); + Logger.info('loading of template '+template_filename+' skipped, load in progress'); return; } @@ -126,20 +126,20 @@ asynchronous: 1, onLoading: function(request) { loading.template = 1; - Logger.info('load_template.onLoading: '+template); + Logger.info('load_template.onLoading: '+template_filename); }, onLoaded: function(request) { loading.template = 0; Position.clone('div_template', 'div_css'); - Logger.info('load_template.onLoaded: '+template); + Logger.info('load_template.onLoaded: '+template_filename); } } ) ; } -function load_css(css_file) { +function load_css(css_filename) { if (loading.css) { - Logger.info('loading of css '+name+' skipped, load in progress'); + Logger.info('loading of css '+css_filename+' skipped, load in progress'); return; } @@ -147,11 +147,11 @@ asynchronous: 1, onLoading: function(request) { loading.css = 1; - Logger.info('load_css.onLoading: '+css_file); + Logger.info('load_css.onLoading: '+css_filename); }, onLoaded: function(request) { loading.css = 0; - Logger.info('load_css.onLoaded: '+css_file); + Logger.info('load_css.onLoaded: '+css_filename); } } ) ; };