Fossil

Diff
Login

Differences From Artifact [5b7b27169b]:

To Artifact [9bbacf0d9f]:


532
533
534
535
536
537
538
539

540
541
542
543
544
545
546
532
533
534
535
536
537
538

539
540
541
542
543
544
545
546







-
+








  /**
     For use when installing a custom editor widget. Pass it the
     getter and setter callbacks to fetch resp. set the content of the
     custom widget. They will be triggered via
     P.wikiContent(). Returns this object.
  */
  P.setFileContentMethods = function(getter, setter){
  P.setContentMethods = function(getter, setter){
    this.wikiContent.get = getter;
    this.wikiContent.set = setter;
    return this;
  };

  /**
     Removes the default editor widget (and any dependent elements)
676
677
678
679
680
681
682

683
684
685
686
687
688
689
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690







+







    if(!affirmPageLoaded()) return this;
    if(!content){
      callback(content);
      return this;
    }
    const fd = new FormData();
    const mimetype = this.e.selectMimetype.value;
    fd.append('page', this.winfo.name);
    fd.append('mimetype',mimetype);
    fd.append('content',content || '');
    F.message(
      "Fetching preview..."
    ).fetch('wikiajax/preview',{
      payload: fd,
      onload: (r,header)=>{
741
742
743
744
745
746
747
748

749
750
751
752
753
754
755
742
743
744
745
746
747
748

749
750
751
752
753
754
755
756







-
+







    F.message(
      "Fetching diff..."
    ).fetch('wikiajax/diff',{
      payload: fd,
      onload: function(c){
        target.innerHTML = [
          "<div>Diff <code>[",
          self.winfo.checkin,
          self.winfo.name,
          "]</code> &rarr; Local Edits</div>",
          c||'No changes.'
        ].join('');
        if(sbs) P.tweakSbsDiffs2();
        F.message('Updated diff.');
        self.tabs.switchToTab(self.e.tabs.diff);
      }