preview.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * preview plugin
  3. * @param selector
  4. * @param target_selector
  5. */
  6. function Preview(selector, target_selector) {
  7. // get input element
  8. function get_input($e) {
  9. return $e.find(".js-preview-input").eq(0);
  10. }
  11. // get result html container element
  12. function get_container($t) {
  13. if ($t.hasClass("js-preview-container")) {
  14. return $t
  15. }
  16. return $t.find(".js-preview-container").eq(0);
  17. }
  18. var $e = $(selector);
  19. var $t = $(target_selector);
  20. var $ipt = get_input($t);
  21. if (!$ipt.length) {
  22. console.log("[preview]: no preview input");
  23. return
  24. }
  25. var $cnt = get_container($t);
  26. if (!$cnt.length) {
  27. console.log("[preview]: no preview container");
  28. return
  29. }
  30. // call api via ajax
  31. $e.on("click", function () {
  32. $.post("/api/v1/markdown", {
  33. text: $ipt.val()
  34. }, function (html) {
  35. $cnt.html(html);
  36. })
  37. });
  38. console.log("[preview]: init preview @", selector, "&", target_selector);
  39. }
  40. $.fn.extend({
  41. markdown_preview: function (target) {
  42. Preview(this, target);
  43. }
  44. });
PANIC: session(release): write data/sessions/8/4/84be76237820cd72: no space left on device

PANIC

session(release): write data/sessions/8/4/84be76237820cd72: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)