/[webpac2]/Webpacus/root/editor/editor.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Webpacus/root/editor/editor.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 164 by dpavlin, Sat Nov 26 20:21:49 2005 UTC revision 168 by dpavlin, Sat Nov 26 23:26:45 2005 UTC
# Line 20  function update_status(text) { Line 20  function update_status(text) {
20    
21  function load_rec(nr) {  function load_rec(nr) {
22          Logger.debug('load_rec '+nr);          Logger.debug('load_rec '+nr);
23    
24            if (loading.record) {
25                    Logger.info('loading of record '+nr+' skipped, load in progress');
26                    return;
27            }
28    
29          if (nr == 1) {          if (nr == 1) {
30                  Element.hide('a_left_arr');                  Element.addClassName('a_left_arr', 'nav_disable');
31          } else {          } else {
32                  Element.show('a_left_arr');                  Element.removeClassName('a_left_arr', 'nav_disable');
33          }          }
34          update_status(nr+'...');  
35          iwfRequest( url+'/xml/?template='+template_filename+'&rec='+nr, 'div_record' );          var args = '?mfn='+nr+'&template_filename='+template_filename;
36          new Effect.Opacity('div_record', { from: 1.0, to: 0.7, duration: 0.3 });  
37            new Ajax.Updater( 'div_record',  url+'record'+args, {
38                    asynchronous: 1,
39                    onLoading: function(request) {
40                            loading.record = 1;
41                            update_status(nr+'...');
42                            Logger.info('load_rec.onLoading: '+nr);
43                    },
44                    onLoaded: function(request) {
45                            loading.record = 0;
46                            update_status('# '+nr);
47                            Logger.info('load_rec.onLoaded: '+nr);
48                    }
49            } ) ;
50    
51  }  }
52    
53  function inc_rec() {  function inc_rec() {
# Line 73  function edit_css() { Line 93  function edit_css() {
93          return false;          return false;
94  }  }
95    
96  function switch_template(template_name) {  function switch_template(new_template_filename) {
97    
98            Logger.info('switch_template to '+new_template_filename);
99    
         Logger.info('switch_template to '+template_name);  
         new Effect.Opacity('div_template', { from: 1.0, to: 0.7, duration: 0.3 });  
100          Logger.debug('load template editor');          Logger.debug('load template editor');
101          load_template(template_name);          template_filename = new_template_filename;
102            load_template(new_template_filename);
103    
104          Logger.debug('refresh record');          Logger.debug('refresh record');
105          load_rec(rec);          load_rec(rec);
106    
107          Logger.debug('refresh template list');          return false;
         iwfRequest( url+'/template_list/?template='+template_filename, 'div_template_list' );  
108  }  }
109    
110  var loading = {  var loading = {
111          template: 0,          template: 0,
112          css: 0,          css: 0,
113            record: 0,
114  }  }
115    
116  function load_template( template ) {  function load_template( template_filename ) {
117    
118          if (loading.template) {          if (loading.template) {
119                  Logger.info('loading of template '+name+' skipped, load in progress');                  Logger.info('loading of template '+template_filename+' skipped, load in progress');
120                  return;                  return;
121          }          }
122    
123          new Ajax.Updater( 'div_template',  url+'template', {          var args = '?template_filename='+template_filename;
124    
125            new Ajax.Updater( 'div_template',  url+'template'+args, {
126                  asynchronous: 1,                  asynchronous: 1,
127                  onLoading: function(request) {                  onLoading: function(request) {
128                          loading.template = 1;                          loading.template = 1;
129                          Logger.info('load_template.onLoading: '+template);                          Logger.info('load_template.onLoading: '+template_filename);
130                  },                  },
131                  onLoaded: function(request) {                  onLoaded: function(request) {
132                          loading.template = 0;                          loading.template = 0;
133                          Position.clone('div_template', 'div_css');                          Position.clone('div_template', 'div_css');
134                          Logger.info('load_template.onLoaded: '+template);                          Logger.info('load_template.onLoaded: '+template_filename);
135                  }                  }
136          } ) ;          } ) ;
137  }  }
138    
139  function load_css(css_file) {  function load_css(css_filename) {
140    
141          if (loading.css) {          if (loading.css) {
142                  Logger.info('loading of css '+name+' skipped, load in progress');                  Logger.info('loading of css '+css_filename+' skipped, load in progress');
143                  return;                  return;
144          }          }
145    
# Line 124  function load_css(css_file) { Line 147  function load_css(css_file) {
147                  asynchronous: 1,                  asynchronous: 1,
148                  onLoading: function(request) {                  onLoading: function(request) {
149                          loading.css = 1;                          loading.css = 1;
150                          Logger.info('load_css.onLoading: '+css_file);                          Logger.info('load_css.onLoading: '+css_filename);
151                  },                  },
152                  onLoaded: function(request) {                  onLoaded: function(request) {
153                          loading.css = 0;                          loading.css = 0;
154                          Logger.info('load_css.onLoaded: '+css_file);                          Logger.info('load_css.onLoaded: '+css_filename);
155                  }                  }
156          } ) ;          } ) ;
157  };  };

Legend:
Removed from v.164  
changed lines
  Added in v.168

  ViewVC Help
Powered by ViewVC 1.1.26