my-gitea-templates/templates/base/ footer.tmpl
108 lines
3.2 KiB

  1. {{/*
  2. <html>
  3. <body>
  4. <div>
  5. */}}
  6. {{template "custom/body_inner_post" .}}
  7. </div>
  8. {{template "custom/body_outer_post" .}}
  9. <script src="{{StaticUrlPrefix}}/js/jquery.js?v={{MD5 AppVer}}"></script>
  10. {{if .RequireSimpleMDE}}
  11. <script src="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js"></script>
  12. <script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script>
  13. <script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script>
  14. <script>
  15. CodeMirror.modeURL = "{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js";
  16. </script>
  17. {{end}}
  18. <!-- Third-party libraries -->
  19. {{if .RequireMinicolors}}
  20. <script src="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js"></script>
  21. {{end}}
  22. {{if .RequireU2F}}
  23. <script src="{{StaticUrlPrefix}}/vendor/plugins/u2f/index.js"></script>
  24. {{end}}
  25. {{if .EnableCaptcha}}
  26. {{if eq .CaptchaType "recaptcha"}}
  27. <script src='{{ URLJoin .RecaptchaURL "api.js"}}' async></script>
  28. {{end}}
  29. {{end}}
  30. {{if .RequireTribute}}
  31. <script src="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.min.js"></script>
  32. <script>
  33. var issuesTribute = new Tribute({
  34. values: [
  35. {{ range .Assignees }}
  36. {key: '{{.Name}} {{.FullName}}', value: '{{.Name}}',
  37. name: '{{.Name}}', fullname: '{{.FullName}}', avatar: '{{.RelAvatarLink}}'},
  38. {{ end }}
  39. ],
  40. noMatchTemplate: function () { return null },
  41. menuItemTemplate: function (item) {
  42. var user = item.original;
  43. var item = $('<div/>')
  44. item.append($('<img/>', {'src': user.avatar}))
  45. item.append($('<span/>', {'class': 'name'}).text(user.name))
  46. if (user.fullname && user.fullname != '') {
  47. item.append($('<span/>', {'class': 'fullname'}).text(user.fullname))
  48. }
  49. return item.html();
  50. }
  51. });
  52. var content = document.getElementById('content');
  53. if (content != null) {
  54. issuesTribute.attach(content);
  55. }
  56. </script>
  57. <script>
  58. var emojiTribute = new Tribute({
  59. collection: [{
  60. trigger: ':',
  61. requireLeadingSpace: true,
  62. values: function (text, cb) {
  63. var array = emojify.emojiNames;
  64. var data = [];
  65. for(var j=0; j<array.length; j++) {
  66. if(array[j].indexOf(text) !== -1) {
  67. data.push(array[j]);
  68. if(data.length > 5) {
  69. break;
  70. }
  71. }
  72. }
  73. cb(data);
  74. },
  75. lookup: function (item) {
  76. return item;
  77. },
  78. selectTemplate: function (item) {
  79. if (typeof item === 'undefined') return null;
  80. return ':' + item.original + ':';
  81. },
  82. menuItemTemplate: function (item) {
  83. return '<img class="emoji" src="{{StaticUrlPrefix}}/vendor/plugins/emojify/images/' + item.original + '.png"/>' + item.original;
  84. }
  85. }]
  86. });
  87. var emojiInputs = document.querySelectorAll('.emoji-input');
  88. if (emojiInputs.length > 0) {
  89. emojiTribute.attach(emojiInputs);
  90. }
  91. var content = document.getElementById('content');
  92. if (content != null) {
  93. emojiTribute.attach(document.getElementById('content'));
  94. }
  95. </script>
  96. {{end}}
  97. <script src="{{StaticUrlPrefix}}/vendor/plugins/emojify/emojify.custom.js"></script>
  98. <script src="{{StaticUrlPrefix}}/fomantic/semantic.min.js?v={{MD5 AppVer}}"></script>
  99. <script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>
  100. {{template "custom/footer" .}}
  101. </body>
  102. </html>