Diff for /loncom/xml/lonxml.pm between versions 1.511 and 1.512

version 1.511, 2010/07/26 09:58:53 version 1.512, 2010/08/07 19:23:56
Line 1492  sub inserteditinfo { Line 1492  sub inserteditinfo {
       my $dragmath_button;        my $dragmath_button;
       my ($add_to_onload, $add_to_onresize);        my ($add_to_onload, $add_to_onresize);
       $initialize=&Apache::lonhtmlcommon::spellheader();        $initialize=&Apache::lonhtmlcommon::spellheader();
       if ($filetype eq 'html'         if (($filetype eq 'html') && (&Apache::lonhtmlcommon::htmlareabrowser())) { 
   && (!&Apache::lonhtmlcommon::htmlareablocked() &&  
       &Apache::lonhtmlcommon::htmlareabrowser())) {  
   $textarea_id .= '___Frame';  
   my $lang = &Apache::lonhtmlcommon::htmlarea_lang();    my $lang = &Apache::lonhtmlcommon::htmlarea_lang();
   $initialize.=(<<FULLPAGE);            my %textarea_args = (
 <script type="text/javascript">                                  fullpage => 'true',
 lonca                                  dragmath => 'math',
     function initDocument() {                                );
         var oFCKeditor = new FCKeditor('filecont');            $initialize .= 
  oFCKeditor.Config['CustomConfigurationsPath'] = '/fckeditor/loncapaconfig.js'  ;                &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args).
  oFCKeditor.Config['FullPage'] = true        (<<FULLPAGE);
  oFCKeditor.Config['AutoDetectLanguage'] = false;  
         oFCKeditor.Config['DefaultLanguage'] = "$lang";  
  oFCKeditor.ReplaceTextarea();  
     }  
     function check_if_dirty(editor) {  
  if (editor.IsDirty()) {  
     unClean();  
  }  
     }  
     function FCKeditor_OnComplete(editor) {  
  editor.Events.AttachEvent("OnSelectionChange",check_if_dirty);  
  resize_textarea('$textarea_id','LC_aftertextarea');  
     }  
 </script>  
 FULLPAGE  
       } else {  
   $initialize.=(<<FULLPAGE);  
 <script type="text/javascript">  <script type="text/javascript">
     function initDocument() {      function initDocument() {
  resize_textarea('$textarea_id','LC_aftertextarea');   resize_textarea('$textarea_id','LC_aftertextarea');
     }      }
 </script>  </script>
 FULLPAGE  FULLPAGE
           if ($filetype eq 'html' || $filetype eq 'tex') {        }
         if ($filetype eq 'html' || $filetype eq 'tex') {
                 $dragmath_button = '<div id="math_filecont">'.&Apache::lonhtmlcommon::dragmath_button('filecont',1).'</div>';
               $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');                $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');
               $dragmath_button = &Apache::lonhtmlcommon::dragmath_button('filecont',1);  
           }  
       }        }
   
       $add_to_onload = 'initDocument();';        $add_to_onload = 'initDocument();';
Line 1541  FULLPAGE Line 1521  FULLPAGE
       }        }
   
       my $titledisplay=&display_title();        my $titledisplay=&display_title();
       my $wysiwyglink;        my $textareaclass;
       my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',        my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',
  'vi' => 'Save and View',   'vi' => 'Save and View',
  'dv' => 'Discard Edits and View',   'dv' => 'Discard Edits and View',
  'un' => 'undo',   'un' => 'undo',
  'ed' => 'Edit');   'ed' => 'Edit');
       my $spelllink .=&Apache::lonhtmlcommon::spelllink('xmledit','filecont');        my $spelllink = &Apache::lonhtmlcommon::spelllink('xmledit','filecont');
       my $textarea_events = &Apache::edit::element_change_detection();        my $textarea_events = &Apache::edit::element_change_detection();
       my $form_events     = &Apache::edit::form_change_detection();        my $form_events     = &Apache::edit::form_change_detection();
       my $htmlerror;        my $htmlerror;
Line 1557  FULLPAGE Line 1537  FULLPAGE
               $htmlerror='<span class="LC_error">'.$htmlerror.'</span>';                $htmlerror='<span class="LC_error">'.$htmlerror.'</span>';
           }            }
           if (&Apache::lonhtmlcommon::htmlareabrowser()) {            if (&Apache::lonhtmlcommon::htmlareabrowser()) {
               if (&Apache::lonhtmlcommon::htmlareablocked()) {                $textareaclass = 'class="LC_richDetectHtml"';
                   $wysiwyglink = &Apache::lonhtmlcommon::enablelink($textarea_id);  
               } else {  
                   $wysiwyglink = &Apache::lonhtmlcommon::disablelink($textarea_id);  
               }  
           }            }
       }        }
       my $editfooter=(<<ENDFOOTER);        my $editfooter=(<<ENDFOOTER);
Line 1578  $initialize Line 1554  $initialize
     <div class="LC_edit_problem_discards">      <div class="LC_edit_problem_discards">
       <input type="submit" name="discardview" accesskey="d" value="$lt{'dv'}" />        <input type="submit" name="discardview" accesskey="d" value="$lt{'dv'}" />
       <input type="submit" name="Undo" accesskey="u" value="$lt{'un'}" />        <input type="submit" name="Undo" accesskey="u" value="$lt{'un'}" />
       $dragmath_button $spelllink $htmlerror        $spelllink $htmlerror
     </div>      </div>
     <div class="LC_edit_problem_saves">      <div class="LC_edit_problem_saves">
       <input type="submit" name="savethisfile" accesskey="s" value="$lt{'st'}" />        <input type="submit" name="savethisfile" accesskey="s" value="$lt{'st'}" />
       <input type="submit" name="viewmode" accesskey="v" value="$lt{'vi'}" />        <input type="submit" name="viewmode" accesskey="v" value="$lt{'vi'}" />
     </div>      </div>
   </div>    </div>
   <textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea>  $dragmath_button
     <textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont" $textareaclass>$filecontents</textarea>
   <div id="LC_aftertextarea">    <div id="LC_aftertextarea">
     $wysiwyglink  
     <br />      <br />
     $titledisplay      $titledisplay
   </div>    </div>

Removed from v.1.511  
changed lines
  Added in v.1.512


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>