--- Webpacus/root/editor/editor.js 2005/11/26 23:26:51 169 +++ Webpacus/root/editor/editor.js 2005/11/27 00:50:27 170 @@ -8,11 +8,6 @@ var css_rnd = 0; -function iwfRequest( url, div ) { - Logger.info('iwfRequest('+url+','+div+')'); - return; -} - function update_status(text) { var el = $('div_record_nr'); if (el) el.innerHTML = text; @@ -26,6 +21,9 @@ return; } + show_working(); + $('record_nr').disabled = 'true'; + if (nr == 1) { Element.addClassName('a_left_arr', 'nav_disable'); } else { @@ -38,12 +36,14 @@ asynchronous: 1, onLoading: function(request) { loading.record = 1; - update_status(nr+'...'); Logger.info('load_rec.onLoading: '+nr); }, onLoaded: function(request) { loading.record = 0; - update_status('# '+nr); + hide_working(); + $('record_nr').value = nr; + $('record_nr').disabled = ''; + rec = nr; Logger.info('load_rec.onLoaded: '+nr); } } ) ; @@ -51,21 +51,27 @@ } function inc_rec() { + show_working(); rec++; load_rec(rec); + hide_working(); return false; } function dec_rec() { if (rec > 1) { + show_working(); rec--; load_rec(rec); + hide_working(); } return false; } function reload_rec() { + show_working(); load_rec(rec); + hide_working(); return false; } @@ -96,6 +102,7 @@ function switch_template(new_template_filename) { Logger.info('switch_template to '+new_template_filename); + show_working(); Logger.debug('load template editor'); template_filename = new_template_filename; @@ -104,6 +111,8 @@ Logger.debug('refresh record'); load_rec(rec); + hide_working(); + return false; } @@ -126,11 +135,13 @@ asynchronous: 1, onLoading: function(request) { loading.template = 1; + show_working(); Logger.info('load_template.onLoading: '+template_filename); }, onLoaded: function(request) { loading.template = 0; Position.clone('div_template', 'div_css'); + hide_working(); Logger.info('load_template.onLoaded: '+template_filename); } } ) ; @@ -147,21 +158,39 @@ asynchronous: 1, onLoading: function(request) { loading.css = 1; + show_working(); Logger.info('load_css.onLoading: '+css_filename); }, onLoaded: function(request) { loading.css = 0; + hide_working(); Logger.info('load_css.onLoaded: '+css_filename); } } ) ; }; -function init_page() { +function reload_css() { + Logger.error('reload_css is not yet implemented!'); + return false; +} -// Element.hide('div_css'); -// Element.show('div_template'); +var working_count = 0; -// Position.clone('div_template', 'div_css'); +function show_working() { + working_count++; + if (working_count > 1) Element.show('working'); + Logger.debug('show_working, count = '+working_count); +} + +function hide_working() { + working_count--; + if (working_count < 1) Element.hide('working'); + Logger.debug('hide_working, count = '+working_count); +} + +function init_page() { + + show_working(); edit_template(); @@ -171,5 +200,7 @@ // load template editor and record switch_template(template_filename); + hide_working(); + }