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 |
|
|
23 |
function load_rec(nr) { |
function load_rec(nr, tmp_template_filename) { |
24 |
Logger.debug('load_rec '+nr); |
|
25 |
|
if (! nr) { |
26 |
|
Logger.error('load_rec called without nr'); |
27 |
|
return false; |
28 |
|
} |
29 |
|
|
30 |
|
if (! tmp_template_filename) tmp_template_filename = template_filename; |
31 |
|
Logger.info('load_rec '+nr+' in '+tmp_template_filename); |
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(); |
44 |
Element.removeClassName('a_left_arr', 'nav_disable'); |
Element.removeClassName('a_left_arr', 'nav_disable'); |
45 |
} |
} |
46 |
|
|
47 |
var args = '?mfn='+nr+'&template_filename='+template_filename; |
var args = '?mfn='+nr+'&template_filename='+tmp_template_filename; |
48 |
|
|
49 |
new Ajax.Updater( 'div_record', url+'record'+args, { |
new Ajax.Updater( 'div_record', url+'record'+args, { |
50 |
asynchronous: 1, |
asynchronous: 1, |
62 |
} |
} |
63 |
} ) ; |
} ) ; |
64 |
|
|
65 |
|
return false; |
66 |
} |
} |
67 |
|
|
68 |
function inc_rec() { |
function inc_rec() { |
132 |
Logger.debug('refresh record'); |
Logger.debug('refresh record'); |
133 |
load_rec(rec); |
load_rec(rec); |
134 |
|
|
135 |
|
edKill('template_content'); |
136 |
|
|
137 |
hide_working(); |
hide_working(); |
138 |
|
|
139 |
return false; |
return false; |
152 |
return; |
return; |
153 |
} |
} |
154 |
|
|
155 |
|
show_working(); |
156 |
|
|
157 |
var args = '?template_filename='+template_filename; |
var args = '?template_filename='+template_filename; |
158 |
|
|
159 |
new Ajax.Updater( 'div_template', url+'template'+args, { |
new Ajax.Updater( 'div_template', url+'template'+args, { |
160 |
asynchronous: 1, |
asynchronous: 1, |
161 |
onLoading: function(request) { |
onLoading: function(request) { |
162 |
loading.template = 1; |
loading.template = 1; |
|
show_working(); |
|
163 |
Logger.info('load_template.onLoading: '+template_filename); |
Logger.info('load_template.onLoading: '+template_filename); |
164 |
}, |
}, |
165 |
onLoaded: function(request) { |
onLoaded: function(request) { |
178 |
return; |
return; |
179 |
} |
} |
180 |
|
|
181 |
|
show_working(); |
182 |
|
|
183 |
new Ajax.Updater( 'div_css', url+'css', { |
new Ajax.Updater( 'div_css', url+'css', { |
184 |
asynchronous: 1, |
asynchronous: 1, |
185 |
onLoading: function(request) { |
onLoading: function(request) { |
186 |
loading.css = 1; |
loading.css = 1; |
|
show_working(); |
|
187 |
Logger.info('load_css.onLoading: '+css_filename); |
Logger.info('load_css.onLoading: '+css_filename); |
188 |
}, |
}, |
189 |
onLoaded: function(request) { |
onLoaded: function(request) { |
190 |
loading.css = 0; |
loading.css = 0; |
191 |
hide_working(); |
hide_working(); |
192 |
Logger.info('load_css.onLoaded: '+css_filename); |
Logger.info('load_css.onLoaded: '+css_filename); |
193 |
|
Element.clone('div_template', 'div_css'); |
194 |
} |
} |
195 |
} ) ; |
} ) ; |
196 |
}; |
}; |
197 |
|
|
198 |
function reload_css() { |
function reload_css() { |
199 |
Logger.error('reload_css is not yet implemented!'); |
|
200 |
|
css_rnd++; |
201 |
|
var css_url = url + 'css/user.css?'+css_rnd; |
202 |
|
Logger.info('reload_css from '+css_url); |
203 |
|
$('user_css_link').href = css_url; |
204 |
|
|
205 |
return false; |
return false; |
206 |
} |
} |
207 |
|
|