You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
3.3 KiB

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