/[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 187 by dpavlin, Sun Nov 27 22:10:36 2005 UTC revision 193 by dpavlin, Tue Nov 29 14:31:26 2005 UTC
# Line 32  function load_rec(nr, tmp_template_filen Line 32  function load_rec(nr, tmp_template_filen
32    
33          if (loading.record) {          if (loading.record) {
34                  Logger.info('loading of record '+nr+' skipped, load in progress');                  Logger.info('loading of record '+nr+' skipped, load in progress');
35                  return;                  return false;
36          }          }
37    
38          show_working();          show_working();
# Line 62  function load_rec(nr, tmp_template_filen Line 62  function load_rec(nr, tmp_template_filen
62                  }                  }
63          } ) ;          } ) ;
64    
65            return false;
66  }  }
67    
68  function inc_rec() {  function inc_rec() {
# Line 92  function reload_rec() { Line 93  function reload_rec() {
93  var current_edit = '';  var current_edit = '';
94    
95  function edit_template() {  function edit_template() {
96          $('div_css').style.visibility = "hidden";          Element.hide('row_css');
97          $('div_css').style.zIndex = 1;  
98          Element.removeClassName('a_css', 'tab_selected');          Element.removeClassName('a_css', 'tab_selected');
99          Element.addClassName('a_template', 'tab_selected');          Element.addClassName('a_template', 'tab_selected');
100          $('div_template').style.visibility = "visible";  
101          $('div_template').style.zIndex = 2;          Element.show('row_template');
102    
103          Logger.debug("switched to template editor");          Logger.debug("switched to template editor");
104          var c = $('template_content');          var c = $('template_content');
105          if (c) c.focus();          if (c) c.focus();
106          Logger.debug('zIndex template:'+$('div_template').style.zIndex+' css:'+$('div_css').style.zIndex);          Logger.debug('zIndex template:'+$('row_template').style.zIndex+' css:'+$('row_css').style.zIndex);
107          return false;          return false;
108  }  }
109    
110  function edit_css() {  function edit_css() {
111          $('div_template').style.visibility = "hidden";  
112          $('div_template').style.zIndex = 1;          Element.hide('row_template');
113    
114          Element.removeClassName('a_template', 'tab_selected');          Element.removeClassName('a_template', 'tab_selected');
115          Element.addClassName('a_css', 'tab_selected');          Element.addClassName('a_css', 'tab_selected');
116          $('div_css').style.visibility = "visible";  
117          $('div_css').style.zIndex = 2;          Element.show('row_css');
118    
119          Logger.debug("switched to CSS editor");          Logger.debug("switched to CSS editor");
120          var c = $('css_content');          var c = $('css_content');
121          if (c) c.focus();          if (c) c.focus();
122          Logger.debug('zIndex template:'+$('div_template').style.zIndex+' css:'+$('div_css').style.zIndex);          Logger.debug('zIndex template:'+$('row_template').style.zIndex+' css:'+$('row_css').style.zIndex);
123          return false;          return false;
124  }  }
125    
# Line 155  function load_template( template_filenam Line 159  function load_template( template_filenam
159    
160          var args = '?template_filename='+template_filename;          var args = '?template_filename='+template_filename;
161    
162          new Ajax.Updater( 'div_template',  url+'template'+args, {          new Ajax.Updater( 'row_template',  url+'template'+args, {
163                  asynchronous: 1,                  asynchronous: 1,
164                  onLoading: function(request) {                  onLoading: function(request) {
165                          loading.template = 1;                          loading.template = 1;
# Line 163  function load_template( template_filenam Line 167  function load_template( template_filenam
167                  },                  },
168                  onLoaded: function(request) {                  onLoaded: function(request) {
169                          loading.template = 0;                          loading.template = 0;
                         Position.clone('div_template', 'div_css');  
170                          hide_working();                          hide_working();
171                          Logger.info('load_template.onLoaded: '+template_filename);                          Logger.info('load_template.onLoaded: '+template_filename);
172                  }                  }
# Line 177  function load_css(css_filename) { Line 180  function load_css(css_filename) {
180                  return;                  return;
181          }          }
182    
183            Logger.info('load_css '+css_filename);
184    
185          show_working();          show_working();
186    
187          new Ajax.Updater( 'div_css',  url+'css', {          new Ajax.Updater( 'row_css',  url+'css', {
188                  asynchronous: 1,                  asynchronous: 1,
189                  onLoading: function(request) {                  onLoading: function(request) {
190                          loading.css = 1;                          loading.css = 1;
# Line 189  function load_css(css_filename) { Line 194  function load_css(css_filename) {
194                          loading.css = 0;                          loading.css = 0;
195                          hide_working();                          hide_working();
196                          Logger.info('load_css.onLoaded: '+css_filename);                          Logger.info('load_css.onLoaded: '+css_filename);
197                            reload_css( css_filename );
198                  }                  }
199          } ) ;          } ) ;
200  };  };
201    
202  function reload_css() {  function reload_css( css_filename ) {
203    
204            if (! css_filename) css_filename = 'user.css';
205    
206          css_rnd++;          css_rnd++;
207          Logger.info('loading user.css?'+css_rnd);          var css_url = url + 'css/' + css_filename + '?' + css_rnd;
208          $('user_css_link').href = 'css/user.css?'+css_rnd;          Logger.info('reload_css from '+css_url);
209            $('user_css_link').href = css_url;
210    
211          return false;          return false;
212  }  }

Legend:
Removed from v.187  
changed lines
  Added in v.193

  ViewVC Help
Powered by ViewVC 1.1.26