@jx3box/jx3box-ui 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/.storybook/main.js +208 -0
  2. package/.storybook/preview.js +93 -0
  3. package/.storybook/storybookMocks.js +191 -0
  4. package/README.md +29 -82
  5. package/assets/css/bread/admin.less +20 -2
  6. package/assets/css/bread/breadcrumb.less +5 -2
  7. package/assets/css/comment/quick-reply.less +1 -1
  8. package/assets/css/common/left-sidebar.less +1 -1
  9. package/assets/css/interact/like2.less +5 -2
  10. package/assets/css/single/author.less +15 -10
  11. package/assets/css/single/cms-single.less +1 -0
  12. package/assets/css/single/thx.less +34 -11
  13. package/assets/data/nav.json +344 -10
  14. package/assets/img/comment/comment.svg +1 -1
  15. package/assets/img/comment/heart_1.svg +1 -1
  16. package/assets/img/comment/hide.svg +1 -1
  17. package/assets/img/leftsidebar/medal.svg +1 -1
  18. package/assets/img/leftsidebar/post.svg +27 -46
  19. package/i18n/messages/en-US.js +357 -22
  20. package/i18n/messages/vi.js +350 -22
  21. package/i18n/messages/zh-CN.js +469 -20
  22. package/i18n/messages/zh-TW.js +350 -22
  23. package/index.js +19 -7
  24. package/package.json +15 -5
  25. package/service/cms.js +22 -0
  26. package/service/commit-history.js +18 -0
  27. package/service/community.js +60 -0
  28. package/service/fav.js +5 -6
  29. package/src/App.vue +154 -80
  30. package/src/Breadcrumb.vue +24 -11
  31. package/src/CommonFooter.vue +4 -4
  32. package/src/Footer.vue +13 -5
  33. package/src/LeftSideToggle.vue +10 -3
  34. package/src/LeftSidebar.vue +19 -5
  35. package/src/Main.vue +9 -2
  36. package/src/RightSidebar.vue +12 -3
  37. package/src/SuspendCommon.vue +52 -38
  38. package/src/author/AuthorFans.vue +7 -5
  39. package/src/author/AuthorFollow.vue +14 -7
  40. package/src/author/AuthorGift.vue +25 -17
  41. package/src/author/AuthorInfo.vue +46 -19
  42. package/src/author/AuthorLink.vue +3 -1
  43. package/src/author/AuthorMedals.vue +5 -2
  44. package/src/author/AuthorPosts.vue +31 -13
  45. package/src/author/AuthorRss.vue +7 -3
  46. package/src/author/AuthorTeams.vue +3 -1
  47. package/src/author/UserPop.vue +29 -17
  48. package/src/bread/Admin.vue +55 -32
  49. package/src/bread/AdminDirectMessage.vue +15 -8
  50. package/src/bread/AdminDrop.vue +124 -45
  51. package/src/bread/CommunityAdmin.vue +527 -0
  52. package/src/bread/DesignTask.vue +30 -26
  53. package/src/bread/ListAdmin.vue +199 -0
  54. package/src/bread/MigrateCommunity.vue +192 -0
  55. package/src/bread/MoveToCommunityDialog.vue +234 -0
  56. package/src/comment/Avatar.vue +18 -24
  57. package/src/comment/CommentContent.vue +57 -37
  58. package/src/comment/CommentContentSimple.vue +61 -63
  59. package/src/comment/CommentInputForm.vue +45 -34
  60. package/src/comment/CommentWithReply.vue +9 -6
  61. package/src/comment/QuickReply.vue +5 -1
  62. package/src/comment/ReplyForReply.vue +6 -4
  63. package/src/comment/ReplyList.vue +28 -18
  64. package/src/comment/Upload.vue +24 -6
  65. package/src/filters/clientBy.vue +10 -8
  66. package/src/filters/markBy.vue +35 -31
  67. package/src/filters/menuBy.vue +20 -22
  68. package/src/filters/orderBy.vue +17 -11
  69. package/src/filters/tagBy.vue +4 -2
  70. package/src/filters/topicBy.vue +12 -10
  71. package/src/filters/versionBy.vue +5 -3
  72. package/src/filters/zlpBy.vue +29 -25
  73. package/src/footer/copyright.vue +5 -5
  74. package/src/footer/links.vue +2 -2
  75. package/src/footer/official.vue +1 -1
  76. package/src/footer/resource.vue +41 -8
  77. package/src/header/alternate.vue +35 -18
  78. package/src/header/asset.vue +9 -19
  79. package/src/header/box.vue +20 -8
  80. package/src/header/box2.vue +25 -13
  81. package/src/header/client.vue +7 -7
  82. package/src/header/lang.vue +41 -6
  83. package/src/header/logo.vue +2 -3
  84. package/src/header/manage.vue +2 -2
  85. package/src/header/message.vue +3 -3
  86. package/src/header/nav.vue +26 -23
  87. package/src/header/publish.vue +2 -2
  88. package/src/header/search.vue +2 -2
  89. package/src/header/shop.vue +2 -2
  90. package/src/header/user.vue +4 -4
  91. package/src/header/userInfo.vue +22 -24
  92. package/src/header/vip.vue +2 -2
  93. package/src/interact/BoxcoinAdmin.vue +30 -16
  94. package/src/interact/BoxcoinRecords.vue +28 -11
  95. package/src/interact/BoxcoinUser.vue +33 -17
  96. package/src/interact/Fav.vue +5 -1
  97. package/src/interact/Homework.vue +318 -0
  98. package/src/interact/Like.vue +4 -2
  99. package/src/interact/Rss.vue +10 -4
  100. package/src/interact/Share.vue +18 -19
  101. package/src/interact/WatchLater.vue +5 -1
  102. package/src/main.js +1 -0
  103. package/src/single/Author.vue +5 -1
  104. package/src/single/CmsSingle.vue +29 -15
  105. package/src/single/Collection.vue +36 -26
  106. package/src/single/Comment.vue +19 -13
  107. package/src/single/Creators.vue +5 -3
  108. package/src/single/PostCollection.vue +158 -0
  109. package/src/single/PostDirectory.vue +0 -126
  110. package/src/single/PostGuide.vue +93 -0
  111. package/src/single/PostHeader.vue +39 -17
  112. package/src/single/PostTopic.vue +3 -3
  113. package/src/single/PostVersion.vue +219 -0
  114. package/src/single/RightAffix.vue +160 -0
  115. package/src/single/SimpleThx.vue +4 -2
  116. package/src/single/Thx.vue +14 -2
  117. package/src/single/VersionDialog.vue +238 -0
  118. package/src/stories/components/StoryPropsTable.vue +137 -0
  119. package/src/stories/filters/FilterGallery.stories.js +110 -0
  120. package/src/stories/filters/clientBy.stories.js +24 -0
  121. package/src/stories/filters/markBy.stories.js +6 -0
  122. package/src/stories/filters/menuBy.stories.js +6 -0
  123. package/src/stories/filters/orderBy.stories.js +6 -0
  124. package/src/stories/filters/tagBy.stories.js +6 -0
  125. package/src/stories/filters/topicBy.stories.js +6 -0
  126. package/src/stories/filters/versionBy.stories.js +6 -0
  127. package/src/stories/filters/zlpBy.stories.js +6 -0
  128. package/src/stories/layout/BaseShell.stories.js +38 -0
  129. package/src/stories/layout/Breadcrumb.stories.js +40 -0
  130. package/src/stories/layout/CommonFooter.stories.js +22 -0
  131. package/src/stories/layout/CommonHeader.stories.js +39 -0
  132. package/src/stories/layout/LeftSideToggle.stories.js +78 -0
  133. package/src/stories/layout/LeftSidebar.stories.js +40 -0
  134. package/src/stories/layout/Main.stories.js +41 -0
  135. package/src/stories/layout/RightSidebar.stories.js +36 -0
  136. package/src/stories/layout/StorybookShell.vue +271 -0
  137. package/src/stories/layout/SuspendCommon.stories.js +67 -0
  138. package/src/stories/layout/SuspendCommonStage.vue +143 -0
  139. package/src/stories/mockData.js +275 -0
  140. package/src/stories/other/UserPop.stories.js +51 -0
  141. package/src/stories/single/Author.stories.js +19 -0
  142. package/src/stories/single/AuthorStoryStage.vue +103 -0
  143. package/src/stories/single/CmsSingle.stories.js +19 -0
  144. package/src/stories/single/CmsSingleStoryStage.vue +118 -0
  145. package/src/stories/single/Collection.stories.js +34 -0
  146. package/src/stories/single/Comment.stories.js +36 -0
  147. package/src/stories/single/Creators.stories.js +34 -0
  148. package/src/stories/single/PostCollection.stories.js +34 -0
  149. package/src/stories/single/PostDirectory.stories.js +31 -0
  150. package/src/stories/single/PostGuide.stories.js +47 -0
  151. package/src/stories/single/PostHeader.stories.js +39 -0
  152. package/src/stories/single/PostVersion.stories.js +41 -0
  153. package/src/stories/single/RightAffix.stories.js +84 -0
  154. package/src/stories/single/SimpleThx.stories.js +39 -0
  155. package/src/stories/single/SingleGallery.stories.js +207 -0
  156. package/src/stories/single/Thx.stories.js +38 -0
  157. package/vue.config.js +2 -12
  158. package/assets/css/common/bottom.less +0 -25
  159. package/assets/css/editor/article.less +0 -36
  160. package/assets/css/editor/combo.less +0 -362
  161. package/assets/css/editor/resource.less +0 -399
  162. package/assets/css/editor/tinymce.less +0 -100
  163. package/assets/css/editor/upload.less +0 -136
  164. package/assets/css/module/author.less +0 -231
  165. package/assets/css/module/buff.less +0 -88
  166. package/assets/css/module/directory.less +0 -165
  167. package/assets/css/module/icon.less +0 -25
  168. package/assets/css/module/item.less +0 -279
  169. package/assets/css/module/item_simple.less +0 -58
  170. package/assets/css/module/jx3_element.less +0 -5
  171. package/assets/css/module/macro.less +0 -89
  172. package/assets/css/module/npc.less +0 -265
  173. package/assets/css/module/resource.less +0 -93
  174. package/assets/css/module/skill.less +0 -74
  175. package/assets/css/module/talent.less +0 -495
  176. package/assets/js/a.js +0 -46
  177. package/assets/js/code.js +0 -13
  178. package/assets/js/combo.js +0 -40
  179. package/assets/js/directory.js +0 -114
  180. package/assets/js/filter2.js +0 -186
  181. package/assets/js/fold.js +0 -11
  182. package/assets/js/gallery.js +0 -14
  183. package/assets/js/hljs_languages.js +0 -177
  184. package/assets/js/iframe.js +0 -38
  185. package/assets/js/img.js +0 -23
  186. package/assets/js/item/attribute_percent.js +0 -88
  187. package/assets/js/item/bind.js +0 -18
  188. package/assets/js/item/border.js +0 -19
  189. package/assets/js/item/border_quest.js +0 -12
  190. package/assets/js/item/color.js +0 -25
  191. package/assets/js/item/hljs_languages.js +0 -177
  192. package/assets/js/item/icon_url.js +0 -15
  193. package/assets/js/item/second_format.js +0 -19
  194. package/assets/js/jx3_element.js +0 -73
  195. package/assets/js/katex.js +0 -181
  196. package/assets/js/macro.js +0 -16
  197. package/assets/js/nextpage.js +0 -4
  198. package/assets/js/pswp.js +0 -67
  199. package/assets/js/pswp_template.js +0 -66
  200. package/assets/js/pz_iframe.js +0 -30
  201. package/assets/js/qixue.js +0 -28
  202. package/assets/js/renderImgPreview.js +0 -18
  203. package/assets/js/script.js +0 -6
  204. package/assets/js/stat.js +0 -107
  205. package/assets/js/talent2.js +0 -21
  206. package/assets/js/tex-mml-chtml.js +0 -36310
  207. package/assets/js/voice.js +0 -238
  208. package/assets/js/xss.js +0 -130
  209. package/src/editor/Article.vue +0 -230
  210. package/src/editor/BoxResource.vue +0 -441
  211. package/src/editor/Resource.vue +0 -623
  212. package/src/editor/Tinymce.vue +0 -204
  213. package/src/editor/Upload.vue +0 -277
  214. package/src/editor/UploadAlum.vue +0 -176
  215. package/src/editor/UploadBanner.vue +0 -156
  216. package/src/editor/components/Author.vue +0 -322
  217. package/src/editor/components/Avatar.vue +0 -95
  218. package/src/editor/components/Buff.vue +0 -80
  219. package/src/editor/components/Combo.vue +0 -259
  220. package/src/editor/components/Equip.vue +0 -299
  221. package/src/editor/components/GameText.vue +0 -242
  222. package/src/editor/components/Item.vue +0 -325
  223. package/src/editor/components/ItemSimple.vue +0 -134
  224. package/src/editor/components/Medal.vue +0 -43
  225. package/src/editor/components/Npc.vue +0 -215
  226. package/src/editor/components/PostAuthor.vue +0 -102
  227. package/src/editor/components/Skill.vue +0 -71
@@ -1,40 +0,0 @@
1
- import $ from "jquery";
2
- import { iconLink } from "@jx3box/jx3box-common/js/utils";
3
-
4
- function renderCombo(selector = ".e-skill-combo .w-skill-combo-item") {
5
- try {
6
- let html = ''
7
- $(selector).each(function() {
8
- // 获取嵌入源地址
9
- let url = $(this).text();
10
-
11
- // extend = {gcd: 0}
12
- const [id, name, icon, extend] = url.split(",");
13
- // 去除左右花括号
14
-
15
-
16
- const _extend = extend ? JSON.parse(extend) : null;
17
-
18
- // 渲染
19
- let code = `
20
- <span class="w-skill-combo-item" data-id="${id}">
21
- <img class="u-skill-icon" src="${iconLink(icon)}" alt="${icon}" title="${name}" />
22
- <span class="u-skill-name" title="${name}">${name}</span>
23
- <i class="u-gcd-icon ${_extend && _extend.gcd == 0 ? 'is-show' : ''}" title="无GCD技能">
24
- <i class="el-icon-time"></i>
25
- </i>
26
- </span>
27
- `;
28
- html += code;
29
- });
30
-
31
- // console.log(html)
32
-
33
- // 挂载点
34
- $(selector).parent().html(html);
35
- } catch(e) {
36
- console.log(e)
37
- }
38
- }
39
-
40
- export default renderCombo;
@@ -1,114 +0,0 @@
1
- import $ from "jquery";
2
- const count = {
3
- H1: 0,
4
- H2: 0,
5
- H3: 0,
6
- H4: 0,
7
- H5: 0,
8
- H6: 0,
9
- };
10
- const MAX_DEPTH = 3;
11
- const PREFIX_CLS = "lv"; //class前缀
12
-
13
- function directory(from, to = "#directory") {
14
- // 装载容器设置
15
- const $box = $(to);
16
- if (!to && $box.length) return;
17
-
18
- // 遍历节点
19
- let directories = $(from).find("h1,h2,h3,h4,h5,h6");
20
-
21
- // 存在目录
22
- if (directories.length > 1) {
23
- let __markTags = analystics(from);
24
-
25
- $box.html(
26
- `<div class="c-article-directory" id="c-article-directory">
27
- <div class="c-article-directory-title" id="c-article-directory-title">
28
- <span class="c-article-directory-title-label" class="c-go-top"><i class="c-article-directory-title-icon"></i> 导读</span>
29
- <span class="c-article-directory-title-skip" class="c-go-top">↑ 顶部</span>
30
- <span class="c-article-directory-title-folder" class="c-go-top">↕ 折叠</span>
31
- </div>
32
- <div class="c-article-directory-content" id="c-article-directory-content"></div>
33
- </div>`
34
- );
35
-
36
- const $directory = $("#c-article-directory-content");
37
- const $skip = $(".c-article-directory-title-skip");
38
- const $folder = $(".c-article-directory-title-folder");
39
-
40
- // 顶部按钮
41
- $folder.on("click", function () {
42
- $("#c-article-directory-content").slideToggle();
43
- });
44
- $skip.on("click", function () {
45
- $(document).scrollTop(0);
46
- });
47
-
48
- // 遍历捕获的目录项
49
- directories.each(function (i, item) {
50
- // 进行克隆
51
- let _item = $(item).clone();
52
- // 解决懒加载跳转位置问题
53
- $(item).append(`<a id="directory-${i}"></a>`);
54
-
55
- // 过滤行内样式
56
- _item.removeAttr("style");
57
- _item.removeAttr("align");
58
- _item.removeAttr("color");
59
- _item.html($(item).text());
60
-
61
- // 设置原始元素所在的位置
62
- // _item.attr("data-skip", ~~$(this).offset().top - 112);
63
- _item.data("raw", $(item));
64
-
65
- // 样式设置
66
- let _tag = $(item)[0].tagName;
67
- if (__markTags.includes(_tag)) {
68
- let lv = __markTags.indexOf(_tag) + 1;
69
- _item.addClass(PREFIX_CLS + lv);
70
- } else {
71
- _item.addClass(PREFIX_CLS + 0);
72
- }
73
-
74
- //追加到目录盒中
75
- $directory.append(_item);
76
- });
77
-
78
- // 进行事件委托
79
- $directory.on("click", "h1,h2,h3,h4,h5,h6", function () {
80
- let target = $(this).data("raw").offset().top;
81
- $(document).scrollTop(target - 112);
82
- $(this).data("raw").addClass("isScrollFocus");
83
- setTimeout(() => {
84
- $(this).data("raw").removeClass("isScrollFocus");
85
- }, 3500);
86
- });
87
-
88
- return true;
89
- }
90
-
91
- // 不存在目录
92
- return false;
93
- }
94
-
95
- function analystics(from) {
96
- // 统计各个级别
97
- for (let key in count) {
98
- count[key] = $(from).find(key).length;
99
- }
100
- // 取前3个级别
101
- let __c = 0;
102
- let __markTags = [];
103
- for (let key in count) {
104
- if (count[key]) {
105
- if (__c < MAX_DEPTH) {
106
- __c += 1;
107
- __markTags.push(key);
108
- }
109
- }
110
- }
111
- return __markTags;
112
- }
113
-
114
- export default directory;
@@ -1,186 +0,0 @@
1
- //对数据库查询的desc字段进行数据加工
2
- import {JX3BOX} from '@jx3box/jx3box-common';
3
- let $ = jQuery
4
-
5
- //技能过滤器
6
- async function skillFilter(desc){
7
- //处理sub
8
- desc = await filterBySub(desc)
9
-
10
- //处理buff描述
11
- desc = await filterByBuffDesc(desc)
12
-
13
- //处理buff时间
14
- desc = await filterByBuffTime(desc)
15
-
16
- //处理额外附加攻击 -- 基于skill@22635改进,2019/11/8
17
- desc = filterByAdd(desc)
18
-
19
- //过滤其它<>
20
- desc = desc.replace(/\<.*?\>/g,'')
21
-
22
- //替换undefined
23
- desc = desc.replace(/undefined/g,'')
24
-
25
- //替换回车符
26
- desc = filterByLF(desc)
27
-
28
- return desc
29
- }
30
-
31
- //skill - <SUB 22792 0> 子技能
32
- async function filterBySub(desc){
33
- let reg = new RegExp(/\<SUB (\d+?) (\d)\>/g)
34
- let subreg = new RegExp(/\<SUB (\d+?) (\d)\>/)
35
- let hasMatched = reg.test(desc)
36
-
37
- if(hasMatched){
38
- let arr = desc.match(reg)
39
- for(let i=0;i<arr.length;i++){
40
- let capture = subreg.exec(arr[i])
41
- let id = capture[1]
42
- let level = capture[2]
43
-
44
- let result = await get_resource('skill',id)
45
- let skill = {}
46
- $.each(result,function (i,obj){
47
- if(obj.Level == level) {
48
- skill = obj
49
- return
50
- }
51
- })
52
-
53
- desc = desc.replace(arr[i],skill.Desc)
54
- }
55
- }
56
- return desc
57
- }
58
-
59
- //skill - <BUFF 112 0 desc> buff描述
60
- async function filterByBuffDesc(desc){
61
- let reg = new RegExp(/\<BUFF (\d+?) \d?\ desc>/)
62
- let hasMatched = reg.test(desc)
63
- if(hasMatched){
64
- let capture = reg.exec(desc)
65
- let id = capture[1]
66
- //let level = capture[2]
67
-
68
- let result = await get_resource('buff',id)
69
- let buff = result[0]
70
- desc = desc.replace(reg,buff.Desc)
71
- }
72
- return desc
73
- }
74
-
75
- //skill - <BUFF 126 0 time> buff时间
76
- async function filterByBuffTime(desc){
77
- let reg = new RegExp(/\<BUFF (\d+?) \d?\ time>/)
78
- let hasMatched = reg.test(desc)
79
- if(hasMatched){
80
- let capture = reg.exec(desc)
81
- let id = capture[1]
82
-
83
- let result = await get_resource('advbuff',id)
84
- let buff = result[0]
85
- let time = parseInt(buff.Interval1) / 16 * parseInt(buff.Count) + '秒'
86
- desc = desc.replace(reg,time)
87
- }
88
- return desc
89
- }
90
-
91
- //skill - (+<SKILLEx {D0} {TotalPhysicsAP 0.3906}>)
92
- function filterByAdd(desc){
93
- let reg = new RegExp(/\(\+\<SKILLEx.*?\>\)/g)
94
- let hasMatched = reg.test(desc)
95
-
96
- if(hasMatched){
97
- desc = desc.replace(reg,'')
98
- }
99
- return desc
100
- }
101
-
102
- //buff过滤器
103
- async function buffFilter(desc){
104
-
105
- //处理其他类型的buff -- 基于skill@22635改进,2019/11/8
106
- desc = filterByBuffAt(desc)
107
-
108
- //过滤其它<>
109
- desc = desc.replace(/\<.*?\>/g,'') //<Skill 5798 0 4%>
110
-
111
- //替换undefined
112
- desc = desc.replace(/undefined/g,'')
113
-
114
- //替换回车符
115
- desc = filterByLF(desc)
116
-
117
- return desc
118
- }
119
-
120
- //buff - <BUFF atCallPhysicsDamage>
121
- function filterByBuffAt(desc){
122
- let reg = new RegExp(/<BUFF at.*?>/g)
123
- let hasMatched = reg.test(desc)
124
-
125
- if(hasMatched){
126
- desc = desc.replace(reg,'')
127
- }
128
- return desc
129
- }
130
-
131
- //item过滤器
132
- async function itemFilter(desc){
133
-
134
- desc = desc.replace(/<Text>text=/g,'')
135
- desc = desc.replace(/<\/text>/g,'')
136
- desc = desc.replace(/font=\d+/g,'')
137
- desc = desc.replace(/"/g,'')
138
-
139
- //处理buff描述
140
- desc = await filterByBuffDesc(desc)
141
-
142
- //处理buff时间
143
- desc = await filterByBuffTime(desc)
144
-
145
- //处理buff属性
146
- desc = filterByBuffAt(desc)
147
-
148
- desc = filterByLF(desc)
149
- desc = desc.replace(/\\\\/g,'')
150
-
151
- return desc
152
- }
153
-
154
- //秘籍过滤器
155
- async function mijiFilter(desc){
156
- return desc
157
- }
158
-
159
- //回车
160
- function filterByLF(desc){
161
- desc = desc.replace(/\\n/g,'\n')
162
- return desc
163
- }
164
-
165
- //查询数据库
166
- function get_resource(type,query){
167
- return new Promise((resolve,reject)=>{
168
- $.ajax({
169
- url:JX3BOX.__node + `${type}/id/` + query,
170
- type:'GET',
171
- success:function (data){
172
- resolve(data)
173
- },
174
- error:function (err){
175
- reject(err)
176
- }
177
- })
178
- })
179
- }
180
-
181
- export {
182
- skillFilter,
183
- buffFilter,
184
- itemFilter,
185
- mijiFilter
186
- }
package/assets/js/fold.js DELETED
@@ -1,11 +0,0 @@
1
- //折叠文本区
2
- import $ from "jquery";
3
- function fold(ele) {
4
- $(ele)
5
- .find(".e-summary")
6
- .on("click", function () {
7
- $(this).next(".e-details").slideToggle();
8
- $(this).toggleClass("on");
9
- });
10
- }
11
- export default fold;
@@ -1,14 +0,0 @@
1
- import $ from "jquery";
2
-
3
- function renderGallery(vm, selector = ".c-article img") {
4
- $(selector).each((i, ele) => {
5
- // 加载全部src(lazyload)
6
- vm.images.push($(ele).attr("src"));
7
- // 绑定事件挂钩索引位置
8
- $(ele).on("click", (e) => {
9
- vm.gallery_index = i;
10
- });
11
- });
12
- }
13
-
14
- export default renderGallery;
@@ -1,177 +0,0 @@
1
- /**
2
- * highlight.js 默认支持(不需要额外装库)的语法
3
- * https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md
4
- */
5
-
6
- export default [
7
- // 不加参数时默认的
8
- { text: "JSON", value: "json" },
9
- { text: "Lua", value: "lua" },
10
- { text: "HTML, XML", value: "xml" },
11
- { text: "Bash", value: "bash" },
12
- { text: "JavaScript", value: "javascript" },
13
- { text: "Python", value: "python" },
14
- { text: "Java", value: "java" },
15
- { text: "C", value: "c" },
16
- { text: "C#", value: "csharp" },
17
- { text: "C++", value: "cpp" },
18
-
19
- // 其他支持的
20
- { text: "1C", value: "1c" },
21
- { text: "ABNF", value: "abnf" },
22
- { text: "Access logs", value: "accesslog" },
23
- { text: "Ada", value: "ada" },
24
- { text: "Arduino (C++ w/Arduino libs)", value: "arduino" },
25
- { text: "ARM assembler", value: "armasm" },
26
- { text: "AVR assembler", value: "avrasm" },
27
- { text: "ActionScript", value: "actionscript" },
28
- { text: "AngelScript", value: "angelscript" },
29
- { text: "Apache", value: "apache" },
30
- { text: "AppleScript", value: "applescript" },
31
- { text: "Arcade", value: "arcade" },
32
- { text: "AsciiDoc", value: "asciidoc" },
33
- { text: "AspectJ", value: "aspectj" },
34
- { text: "AutoHotkey", value: "autohotkey" },
35
- { text: "AutoIt", value: "autoit" },
36
- { text: "Awk", value: "awk" },
37
- { text: "Basic", value: "basic" },
38
- { text: "BNF", value: "bnf" },
39
- { text: "Brainfuck", value: "brainfuck" },
40
- { text: "C/AL", value: "cal" },
41
- { text: "Cache Object Script", value: "cos" },
42
- { text: "CMake", value: "cmake" },
43
- { text: "Coq", value: "coq" },
44
- { text: "CSP", value: "csp" },
45
- { text: "CSS", value: "css" },
46
- { text: "Cap’n Proto", value: "capnproto" },
47
- { text: "Clojure", value: "clojure" },
48
- { text: "CoffeeScript", value: "coffeescript" },
49
- { text: "Crmsh", value: "crmsh" },
50
- { text: "Crystal", value: "crystal" },
51
- { text: "D", value: "d" },
52
- { text: "Dart", value: "dart" },
53
- { text: "Delphi", value: "dpr" },
54
- { text: "Diff", value: "diff" },
55
- { text: "Django", value: "django" },
56
- { text: "DNS Zone file", value: "dns" },
57
- { text: "Dockerfile", value: "dockerfile" },
58
- { text: "DOS", value: "dos" },
59
- { text: "dsconfig", value: "dsconfig" },
60
- { text: "DTS (Device Tree)", value: "dts" },
61
- { text: "Dust", value: "dust" },
62
- { text: "EBNF", value: "ebnf" },
63
- { text: "Elixir", value: "elixir" },
64
- { text: "Elm", value: "elm" },
65
- { text: "Erlang", value: "erlang" },
66
- { text: "Excel", value: "excel" },
67
- { text: "F#", value: "fsharp" },
68
- { text: "FIX", value: "fix" },
69
- { text: "Fortran", value: "fortran" },
70
- { text: "G-Code", value: "gcode" },
71
- { text: "Gams", value: "gams" },
72
- { text: "GAUSS", value: "gauss" },
73
- { text: "Gherkin", value: "gherkin" },
74
- { text: "Go", value: "go" },
75
- { text: "Golo", value: "golo" },
76
- { text: "Gradle", value: "gradle" },
77
- { text: "Groovy", value: "groovy" },
78
- { text: "HTTP", value: "http" },
79
- { text: "Haml", value: "haml" },
80
- { text: "Handlebars", value: "handlebars" },
81
- { text: "Haskell", value: "haskell" },
82
- { text: "Haxe", value: "haxe" },
83
- { text: "Hy", value: "hy" },
84
- { text: "Ini, TOML", value: "ini" },
85
- { text: "Inform7", value: "inform7" },
86
- { text: "IRPF90", value: "irpf90" },
87
- { text: "Julia", value: "julia" },
88
- { text: "Kotlin", value: "kotlin" },
89
- { text: "LaTeX", value: "tex" },
90
- { text: "Leaf", value: "leaf" },
91
- { text: "Lasso", value: "lasso" },
92
- { text: "Less", value: "less" },
93
- { text: "LDIF", value: "ldif" },
94
- { text: "Lisp", value: "lisp" },
95
- { text: "LiveCode Server", value: "livecodeserver" },
96
- { text: "LiveScript", value: "livescript" },
97
- { text: "Makefile", value: "makefile" },
98
- { text: "Markdown", value: "markdown" },
99
- { text: "Mathematica", value: "mathematica" },
100
- { text: "Matlab", value: "matlab" },
101
- { text: "Maxima", value: "maxima" },
102
- { text: "Maya Embedded Language", value: "mel" },
103
- { text: "Mercury", value: "mercury" },
104
- { text: "Mizar", value: "mizar" },
105
- { text: "Mojolicious", value: "mojolicious" },
106
- { text: "Monkey", value: "monkey" },
107
- { text: "Moonscript", value: "moonscript" },
108
- { text: "N1QL", value: "n1ql" },
109
- { text: "NSIS", value: "nsis" },
110
- { text: "Nginx", value: "nginx" },
111
- { text: "Nim", value: "nim" },
112
- { text: "Nix", value: "nix" },
113
- { text: "OCaml", value: "ocaml" },
114
- { text: "Objective C", value: "objectivec" },
115
- { text: "OpenGL Shading Language", value: "glsl" },
116
- { text: "OpenSCAD", value: "openscad" },
117
- { text: "Oracle Rules Language", value: "ruleslanguage" },
118
- { text: "Oxygene", value: "oxygene" },
119
- { text: "PF", value: "pf" },
120
- { text: "PHP", value: "php" },
121
- { text: "Parser3", value: "parser3" },
122
- { text: "Perl", value: "perl" },
123
- { text: "Plaintext", value: "plaintext" },
124
- { text: "Pony", value: "pony" },
125
- { text: "PostgreSQL & PL/pgSQL", value: "pgsql" },
126
- { text: "PowerShell", value: "powershell" },
127
- { text: "Processing", value: "processing" },
128
- { text: "Prolog", value: "prolog" },
129
- { text: "Properties", value: "properties" },
130
- { text: "Protocol Buffers", value: "protobuf" },
131
- { text: "Puppet", value: "puppet" },
132
- { text: "Python profiler results", value: "profile" },
133
- { text: "Python REPL", value: "python-repl" },
134
- { text: "Q", value: "k" },
135
- { text: "QML", value: "qml" },
136
- { text: "R", value: "r" },
137
- { text: "ReasonML", value: "reasonml" },
138
- { text: "RenderMan RIB", value: "rib" },
139
- { text: "RenderMan RSL", value: "rsl" },
140
- { text: "Roboconf", value: "graph" },
141
- { text: "Ruby", value: "ruby" },
142
- { text: "Rust", value: "rust" },
143
- { text: "SAS", value: "SAS" },
144
- { text: "SCSS", value: "scss" },
145
- { text: "SQL", value: "sql" },
146
- { text: "STEP Part 21", value: "p21" },
147
- { text: "Scala", value: "scala" },
148
- { text: "Scheme", value: "scheme" },
149
- { text: "Scilab", value: "scilab" },
150
- { text: "Shell", value: "shell" },
151
- { text: "Smali", value: "smali" },
152
- { text: "Smalltalk", value: "smalltalk" },
153
- { text: "SML", value: "sml" },
154
- { text: "Stan", value: "stan" },
155
- { text: "Stata", value: "stata" },
156
- { text: "Stylus", value: "stylus" },
157
- { text: "SubUnit", value: "subunit" },
158
- { text: "Swift", value: "swift" },
159
- { text: "Tcl", value: "tcl" },
160
- { text: "Test Anything Protocol", value: "tap" },
161
- { text: "Thrift", value: "thrift" },
162
- { text: "TP", value: "tp" },
163
- { text: "Twig", value: "twig" },
164
- { text: "TypeScript", value: "typescript" },
165
- { text: "VB.Net", value: "vbnet" },
166
- { text: "VBScript", value: "vbscript" },
167
- { text: "VHDL", value: "vhdl" },
168
- { text: "Vala", value: "vala" },
169
- { text: "Verilog", value: "verilog" },
170
- { text: "Vim Script", value: "vim" },
171
- { text: "X++", value: "axapta" },
172
- { text: "x86 Assembly", value: "x86asm" },
173
- { text: "XL", value: "xl" },
174
- { text: "XQuery", value: "xquery" },
175
- { text: "YAML", value: "yml" },
176
- { text: "Zephir", value: "zephir" },
177
- ];
@@ -1,38 +0,0 @@
1
- // iframe白名单
2
- import url from "url";
3
- function iframeFilter(str) {
4
- if (!str) return;
5
-
6
- const REG = /<iframe(.*?)src=[\\'"]([^\\'"]+)[\\'"](.*?)>.*?<\/iframe>/gi;
7
- const white_list = ["player.bilibili.com", "docs.qq.com", "open.douyu.com"];
8
-
9
- let item;
10
- while ((item = REG.exec(str))) {
11
- let origin = item[0];
12
- let prefix = item[1];
13
-
14
- // bilibili路径处理
15
- let src = "";
16
- if (item[2].startsWith("//")) {
17
- src = item[2].replace("//", "https://");
18
- } else {
19
- src = item[2];
20
- }
21
-
22
- // 白名单过滤
23
- let src_parsed = url.parse(src);
24
- if (white_list.includes(src_parsed.hostname)) {
25
- src = item[2];
26
- } else {
27
- src = "";
28
- }
29
-
30
- let suffix = item[3];
31
- let output = `<iframe ${prefix} src="${item[2]}" ${suffix}></iframe>`;
32
- str = str.replace(origin, output);
33
- // console.log(origin,output)
34
- }
35
- // console.log(str)
36
- return str;
37
- }
38
- export default iframeFilter;
package/assets/js/img.js DELETED
@@ -1,23 +0,0 @@
1
- // 图片地址&懒加载
2
- import * as utilModule from "@jx3box/jx3box-common/js/utils";
3
- const { resolveImagePath } = utilModule;
4
- import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
5
- function lazyLoad(str) {
6
- if (!str) return;
7
-
8
- const REG = /<img(.*?)src=['"]([^'"]+)['"](.*?)>/gi;
9
- let item;
10
- while ((item = REG.exec(str))) {
11
- let origin = item[0];
12
- let prefix = item[1];
13
- let src = resolveImagePath(item[2]);
14
- if (src.includes('https://console.cnyixun.com/')) {
15
- src = src.replace('https://console.cnyixun.com/', JX3BOX.__cdn)
16
- }
17
- let suffix = item[3];
18
- let output = `<img ${prefix} loading="lazy" src="${src}" ${suffix}>`;
19
- str = str.replace(origin, output);
20
- }
21
- return str;
22
- }
23
- export default lazyLoad;