/[webpac2]/trunk/web/browse.cgi
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 /trunk/web/browse.cgi

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

revision 57 by dpavlin, Tue Nov 15 14:30:11 2005 UTC revision 61 by dpavlin, Tue Nov 15 14:31:03 2005 UTC
# Line 48  if ($q->path_info =~ m#xml#) { Line 48  if ($q->path_info =~ m#xml#) {
48          if (@ds && $#ds > 0) {          if (@ds && $#ds > 0) {
49                  print qq{<response>                  print qq{<response>
50  <action type='html' target='div_record' errorCode='' errorMessage='' >  <action type='html' target='div_record' errorCode='' errorMessage='' >
51                  }, $out->apply(                  }, $iconv_utf8->convert( $out->apply(
52                          template => $template,                          template => $template,
53                          data => \@ds,                          data => \@ds,
54                  ), qq{                  ) ), qq{
55    
56  </action>  </action>
57  <action type='javascript' errorCode='' errorMessage='' >  <action type='javascript' errorCode='' errorMessage='' >
# Line 74  if ($q->path_info =~ m#xml#) { Line 74  if ($q->path_info =~ m#xml#) {
74  <action type='javascript' errorCode='' errorMessage='' >  <action type='javascript' errorCode='' errorMessage='' >
75  <!--  <!--
76          var el = iwfGetById('div_record_nr');          var el = iwfGetById('div_record_nr');
77          if (el) el.innerHTML = '<strike>$rec</strike>';          if (el) el.innerHTML = '<strike>&nbsp;$rec&nbsp;</strike>';
78  //-->  //-->
79  </action>  </action>
80  </response>  </response>
# Line 88  if ($q->path_info =~ m#xml#) { Line 88  if ($q->path_info =~ m#xml#) {
88    
89                  if ($q->param('save_template')) {                  if ($q->param('save_template')) {
90    
91                          my $tmpl = $q->param('tt_template') || die "no template?";                          my $tmpl = $iconv_loc->convert( $q->param('tt_template') ) || die "no template?";
92                            sub _conv_js {
93                                    my $t = shift || return;
94                                    return $iconv_loc->convert(chr(hex($t)));
95                            }
96                            $tmpl =~ s/%u([a-fA-F0-9]{4})/_conv_js($1)/gex;
97    
98                          my $tmpl_file = $out->{'include_path'} . '/' . $template;                          my $tmpl_file = $out->{'include_path'} . '/' . $template;
99                          write_file($tmpl_file . '.new', $iconv_loc->convert($tmpl)) || die "can't save $tmpl_file: $!";                          write_file($tmpl_file . '.new', $tmpl) || die "can't save $tmpl_file: $!";
100                          rename $tmpl_file . '.new', $tmpl_file || die "can't rename to $tmpl_file: $!";                          rename $tmpl_file . '.new', $tmpl_file || die "can't rename to $tmpl_file: $!";
101    
102                          print qq{<response>                          print qq{<response>
103  <action type='html' target='div_status' errorCode='' errorMessage='' >  <action type='html' target='div_status' errorCode='' errorMessage='' >
104  $template saved  <tt>$template</tt> saved
105  </action>  </action>
106  <action type='js'>  <action type='js'>
107  <!--  <!--
108    iwfShow('div_status', 1);
109  reload_rec();  reload_rec();
110    iwfHideGentlyDelay('div_status', 2, 2000, 1);
111  -->  -->
112  </action>  </action>
113  </response>  </response>
# Line 115  reload_rec(); Line 123  reload_rec();
123  <action type='html' target='div_template' errorCode='' errorMessage='' >  <action type='html' target='div_template' errorCode='' errorMessage='' >
124  <pre>}, Dumper($q->Vars), qq{</pre>  <pre>}, Dumper($q->Vars), qq{</pre>
125    
126  <form name="frmEditor" action="$self" method="post"  <form name="frmEditor" action="$self" method="post" iwfTarget="div_status" >
 iwfTarget="div_status"  
 >  
127    
128  <textarea name="tt_template" cols="80" rows="10" style="display: block;">  <textarea name="tt_template" cols="80" rows="10" style="display: block;">
129  $tmpl  $tmpl
# Line 125  $tmpl Line 131  $tmpl
131    
132  <br/>  <br/>
133  <input type="button" name="save_template" value="Save" onclick="javascript:iwfRequest(this);" />  <input type="button" name="save_template" value="Save" onclick="javascript:iwfRequest(this);" />
134  <input type="checkbox" name="checkin_template" id="checkin_checkbox" label="checkin" />  <!--
135  <span id="div_status" style="color: #808080;">idle</span>  <input type="checkbox" name="checkin_template" id="checkin_checkbox" label="checkin" /> checkin
136    -->
137    &nbsp;&nbsp;<span id="div_status" style="color: #808080;">idle</span>
138    
139  <input type='hidden' value='hidden post value' name='hidValue' />  <input type='hidden' value='hidden post value' name='hidValue' />
140    
141  </form>  </form>
142  </action>  </action>
143    <action type='js'>
144    <!--
145    iwfHideGentlyDelay('div_status', 2, 2000, 1);
146    -->
147    </action>
148  </response>  </response>
149                  };                  };
150    
# Line 157  function update_status(text) { Line 170  function update_status(text) {
170  }  }
171    
172  function load_rec(nr) {  function load_rec(nr) {
173            if (nr == 1) {
174                    iwfHide('a_left_arr', 1);
175            } else {
176                    iwfShow('a_left_arr', 1);
177            }
178          update_status(nr+'...');          update_status(nr+'...');
179          iwfRequest( url+'/xml/?rec='+nr, 'div_record' );          iwfRequest( url+'/xml/?rec='+nr, 'div_record' );
180          iwfOpacity('div_record', 30);          iwfOpacity('div_record', 30);
# Line 169  function inc_rec() { Line 187  function inc_rec() {
187  }  }
188    
189  function dec_rec() {  function dec_rec() {
190          rec--;          if (rec > 1) {
191          load_rec(rec);                  rec--;
192                    load_rec(rec);
193            }
194          return false;          return false;
195  }  }
196    
# Line 196  template = <tt>$template</tt><br/> Line 216  template = <tt>$template</tt><br/>
216  </div>  </div>
217    
218  <div style="background: #e0e0e0; padding: 0.5em; display: block;">  <div style="background: #e0e0e0; padding: 0.5em; display: block;">
219          <a href="$self?rec=}, $rec - 1, qq{" onClick="return dec_rec();">&#8678;</a>&nbsp;          <a id="a_left_arr" href="$self?rec=}, $rec - 1, qq{" onClick="return dec_rec();">&#8678;</a>
220          <span id="div_record_nr"> none </span>          <span id="div_record_nr"> none </span>
221    
222          <a href="$self?rec=}, $rec + 1, qq{" onClick="return inc_rec();">&#8680;</a>&nbsp;          <a id="a_right_arr" href="$self?rec=}, $rec + 1, qq{" onClick="return inc_rec();">&#8680;</a>
223          <a href="$self?rec=}, $rec, qq{" onClick="return reload_rec();">&#8634;</a>&nbsp;          <a id="a_reload" href="$self?rec=}, $rec, qq{" onClick="return reload_rec();">&#8634;</a>
224          <a href="#" onClick="iwfRefreshLog(); return false;">&#9636;</a>&nbsp;          <a href="#" onClick="iwfRefreshLog(); return false;">&#9636;</a>
225    
226  </div>  </div>
227    

Legend:
Removed from v.57  
changed lines
  Added in v.61

  ViewVC Help
Powered by ViewVC 1.1.26