/[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 170 by dpavlin, Sun Nov 27 00:50:27 2005 UTC revision 175 by dpavlin, Sun Nov 27 04:45:56 2005 UTC
# Line 6  var rec = null; Line 6  var rec = null;
6  var url = null;  var url = null;
7  var template_filename = null;  var template_filename = null;
8    
9    var pending_js = null;
10    
11  var css_rnd = 0;  var css_rnd = 0;
12    
13  function update_status(text) {  function _ts(text) {
14          var el = $('div_record_nr');          var el = $('div_template_status');
15            if (el) el.innerHTML = text;
16    }
17    
18    function _cs(text) {
19            var el = $('div_css_status');
20          if (el) el.innerHTML = text;          if (el) el.innerHTML = text;
21  }  }
22    
# Line 79  var current_edit = ''; Line 86  var current_edit = '';
86    
87  function edit_template() {  function edit_template() {
88          $('div_css').style.visibility = "hidden";          $('div_css').style.visibility = "hidden";
89            $('div_css').style.zIndex = 1;
90          Element.removeClassName('a_css', 'tab_selected');          Element.removeClassName('a_css', 'tab_selected');
91          Element.addClassName('a_template', 'tab_selected');          Element.addClassName('a_template', 'tab_selected');
92          $('div_template').style.visibility = "visible";          $('div_template').style.visibility = "visible";
93            $('div_template').style.zIndex = 2;
94          Logger.debug("switched to template editor");          Logger.debug("switched to template editor");
95          var c = $('template_content');          var c = $('template_content');
96          if (c) c.focus();          if (c) c.focus();
97            Logger.debug('zIndex template:'+$('div_template').style.zIndex+' css:'+$('div_css').style.zIndex);
98          return false;          return false;
99  }  }
100    
101  function edit_css() {  function edit_css() {
102          $('div_template').style.visibility = "hidden";          $('div_template').style.visibility = "hidden";
103            $('div_template').style.zIndex = 1;
104          Element.removeClassName('a_template', 'tab_selected');          Element.removeClassName('a_template', 'tab_selected');
105          Element.addClassName('a_css', 'tab_selected');          Element.addClassName('a_css', 'tab_selected');
106          $('div_css').style.visibility = "visible";          $('div_css').style.visibility = "visible";
107            $('div_css').style.zIndex = 2;
108          Logger.debug("switched to CSS editor");          Logger.debug("switched to CSS editor");
109          var c = $('css_content');          var c = $('css_content');
110          if (c) c.focus();          if (c) c.focus();
111            Logger.debug('zIndex template:'+$('div_template').style.zIndex+' css:'+$('div_css').style.zIndex);
112          return false;          return false;
113  }  }
114    
# Line 111  function switch_template(new_template_fi Line 124  function switch_template(new_template_fi
124          Logger.debug('refresh record');          Logger.debug('refresh record');
125          load_rec(rec);          load_rec(rec);
126    
127            edKill('template_content');
128    
129          hide_working();          hide_working();
130    
131          return false;          return false;
# Line 129  function load_template( template_filenam Line 144  function load_template( template_filenam
144                  return;                  return;
145          }          }
146    
147            show_working();
148    
149          var args = '?template_filename='+template_filename;          var args = '?template_filename='+template_filename;
150    
151          new Ajax.Updater( 'div_template',  url+'template'+args, {          new Ajax.Updater( 'div_template',  url+'template'+args, {
152                  asynchronous: 1,                  asynchronous: 1,
153                  onLoading: function(request) {                  onLoading: function(request) {
154                          loading.template = 1;                          loading.template = 1;
                         show_working();  
155                          Logger.info('load_template.onLoading: '+template_filename);                          Logger.info('load_template.onLoading: '+template_filename);
156                  },                  },
157                  onLoaded: function(request) {                  onLoaded: function(request) {
# Line 154  function load_css(css_filename) { Line 170  function load_css(css_filename) {
170                  return;                  return;
171          }          }
172    
173            show_working();
174    
175          new Ajax.Updater( 'div_css',  url+'css', {          new Ajax.Updater( 'div_css',  url+'css', {
176                  asynchronous: 1,                  asynchronous: 1,
177                  onLoading: function(request) {                  onLoading: function(request) {
178                          loading.css = 1;                          loading.css = 1;
                         show_working();  
179                          Logger.info('load_css.onLoading: '+css_filename);                          Logger.info('load_css.onLoading: '+css_filename);
180                  },                  },
181                  onLoaded: function(request) {                  onLoaded: function(request) {
# Line 170  function load_css(css_filename) { Line 187  function load_css(css_filename) {
187  };  };
188    
189  function reload_css() {  function reload_css() {
190          Logger.error('reload_css is not yet implemented!');  
191            css_rnd++;
192            Logger.info('loading user.css?'+css_rnd);
193            $('user_css_link').href = 'css/user.css?'+css_rnd;
194    
195          return false;          return false;
196  }  }
197    

Legend:
Removed from v.170  
changed lines
  Added in v.175

  ViewVC Help
Powered by ViewVC 1.1.26