Fossil

Check-in [cb6804a2]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add confirmation dialog boxes when changing between markup and wysisyg editor mode, and before cancelling an edit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wysiwyg
Files: files | file ages | folders
SHA1:cb6804a2e3f7ca4db601acd8819e87274adf0e19
User & Date: drh 2012-08-11 22:25:48
Context
2012-08-13
12:30
Fixes to the <base> addition to the HTML header so that it works correctly with the "doc" webpage. Href is now $baseurl/$current_page. check-in: fd10cdba user: drh tags: wysiwyg
2012-08-11
22:25
Add confirmation dialog boxes when changing between markup and wysisyg editor mode, and before cancelling an edit. check-in: cb6804a2 user: drh tags: wysiwyg
15:37
Add a configuration option that enables WYSIWYG wiki editing. The traditional markup editor is still used unless this option is enabled. check-in: ebc48bf1 user: drh tags: wysiwyg
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/wiki.c.

370
371
372
373
374
375
376
377
378
379

380

381
382
383
384
385
386
387
...
388
389
390
391
392
393
394
395

396
397
398
399
400

401
402
403
404
405
406
407
  if( n>30 ) n = 30;
  if( !isWysiwyg ){
    /* Traditional markup-only editing */
    @ <form method="post" action="%s(g.zTop)/wikiedit"><div>
    @ <textarea name="w" class="wikiedit" cols="80" 
    @  rows="%d(n)" wrap="virtual">%h(zBody)</textarea>
    @ <br />
    @ <input type="submit" name="preview" value="Preview Your Changes" />
    if( db_get_boolean("wysiwyg-wiki", 0) ){
      @ <input type="submit" name="edit-wysiwyg" value="Wysiwyg Editor" />

    }

  }else{
    /* Wysiwyg editing */
    Blob html, temp;
    @ <form method="post" action="%s(g.zTop)/wikiedit"
    @  onsubmit="wysiwygSubmit()"><div>
    @ <input type="hidden" name="wysiwyg" value="1" />
    blob_zero(&temp);
................................................................................
    wiki_convert(&wiki, &temp, 0);
    blob_zero(&html);
    htmlTidy(blob_str(&temp), &html);
    blob_reset(&temp);
    wysiwygEditor("w", blob_str(&html), 60, n);
    blob_reset(&html);
    @ <br />
    @ <input type="submit" name="edit-markup" value="Markup Editor" />

  }
  @ <input type="submit" name="submit" value="Apply These Changes" />
  login_insert_csrf_secret();
  @ <input type="hidden" name="name" value="%h(zPageName)" />
  @ <input type="submit" name="cancel" value="Cancel" />

  @ </div></form>
  manifest_destroy(pWiki);
  blob_reset(&wiki);
  style_footer();
}

/*







<

|
>

>







 







|
>




|
>







370
371
372
373
374
375
376

377
378
379
380
381
382
383
384
385
386
387
388
...
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
  if( n>30 ) n = 30;
  if( !isWysiwyg ){
    /* Traditional markup-only editing */
    @ <form method="post" action="%s(g.zTop)/wikiedit"><div>
    @ <textarea name="w" class="wikiedit" cols="80" 
    @  rows="%d(n)" wrap="virtual">%h(zBody)</textarea>
    @ <br />

    if( db_get_boolean("wysiwyg-wiki", 0) ){
      @ <input type="submit" name="edit-wysiwyg" value="Wysiwyg Editor"
      @  onclick='return confirm("Switching to WYSIWYG-mode\nwill erase your markup\nedits. Continue?")' />
    }
    @ <input type="submit" name="preview" value="Preview Your Changes" />
  }else{
    /* Wysiwyg editing */
    Blob html, temp;
    @ <form method="post" action="%s(g.zTop)/wikiedit"
    @  onsubmit="wysiwygSubmit()"><div>
    @ <input type="hidden" name="wysiwyg" value="1" />
    blob_zero(&temp);
................................................................................
    wiki_convert(&wiki, &temp, 0);
    blob_zero(&html);
    htmlTidy(blob_str(&temp), &html);
    blob_reset(&temp);
    wysiwygEditor("w", blob_str(&html), 60, n);
    blob_reset(&html);
    @ <br />
    @ <input type="submit" name="edit-markup" value="Markup Editor"
    @  onclick='return confirm("Switching to markup-mode\nwill erase your WYSIWYG\nedits. Continue?")' />
  }
  @ <input type="submit" name="submit" value="Apply These Changes" />
  login_insert_csrf_secret();
  @ <input type="hidden" name="name" value="%h(zPageName)" />
  @ <input type="submit" name="cancel" value="Cancel"
  @  onclick='confirm("Abandon your changes?")' />
  @ </div></form>
  manifest_destroy(pWiki);
  blob_reset(&wiki);
  style_footer();
}

/*