V2EX - 超级增强

楼中楼回复(支持感谢数排序)、自动签到、快捷回复图片和表情、列表预览内容、点击帖子弹框展示详情、对用户打标签、回复上下文、记录上次阅读位置、自定义背景、使用 SOV2EX 搜索、正文超长自动折叠、划词 base64 解码、一键@所有人,@管理员、操作按钮(感谢、收藏、回复、隐藏)异步请求、支持黑暗模式

目前为 2023-07-13 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name V2EX - 超级增强
  3. // @namespace http://tampermonkey.net/
  4. // @version 6.2
  5. // @author zyronon
  6. // @description 楼中楼回复(支持感谢数排序)、自动签到、快捷回复图片和表情、列表预览内容、点击帖子弹框展示详情、对用户打标签、回复上下文、记录上次阅读位置、自定义背景、使用 SOV2EX 搜索、正文超长自动折叠、划词 base64 解码、一键@所有人,@管理员、操作按钮(感谢、收藏、回复、隐藏)异步请求、支持黑暗模式
  7. // @license GPL License
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=v2ex.com
  9. // @match https://v2ex.com/
  10. // @match https://v2ex.com/?tab=*
  11. // @match https://v2ex.com/t/*
  12. // @match https://v2ex.com/recent*
  13. // @match https://v2ex.com/go/*
  14. // @match https://*.v2ex.com/
  15. // @match https://*.v2ex.com/?tab=*
  16. // @match https://*.v2ex.com/t/*
  17. // @match https://*.v2ex.com/recent*
  18. // @match https://*.v2ex.com/go/*
  19. // @require https://cdn.jsdelivr.net/npm/vue@3.2.47/dist/vue.global.prod.js
  20. // @grant GM_notification
  21. // @grant GM_openInTab
  22. // @grant GM_registerMenuCommand
  23. // ==/UserScript==
  24.  
  25. (t=>{const e=document.createElement("style");e.dataset.source="vite-plugin-monkey",e.textContent=t,document.head.append(e)})(' .v-enter-active,.v-leave-active{transition:opacity .3s ease}.v-enter-from,.v-leave-to{opacity:0}.username{font-weight:700;font-size:1.4rem;margin-right:1rem}.op{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove{display:inline}.my-tag .remove{cursor:pointer;margin-left:.5rem;display:none}.floor{margin-left:1rem;font-size:1.2rem;line-height:1rem;border-radius:1rem;display:inline-block;background-color:#f0f0f0;color:#ccc;padding:.2rem .5rem;cursor:default}html,body{font-size:62.5%}.flex{display:flex;align-items:center;justify-content:space-between}.flex-end{justify-content:flex-end}.flex-center{justify-content:center}.p1{padding:1rem}.p0{padding:0!important}.post-author{display:flex;align-items:center;position:relative;color:#ccc!important}.post-author>.username{font-size:1.2rem}.sticky{position:sticky;bottom:0}.sticky[stuck]{box-shadow:0 2px 20px #00000059}a{color:#778087;text-decoration:none;cursor:pointer}a:hover{text-decoration:underline}.base-loading{border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle infinite 1s linear}.loading-c{border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle infinite 1s linear;width:3rem;height:3rem}.loading-b{border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle infinite 1s linear;border-color:#ffffff rgba(178,177,177,.2) rgba(178,177,177,.2) rgba(178,177,177,.2);width:3rem;height:3rem}@keyframes circle{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.button{cursor:pointer;padding:.4rem 2.4rem;border-radius:5px;display:inline-flex;justify-content:center;align-items:center;font-weight:700;font-size:1.2rem;color:#fff;background:#40a9ff;border:1px solid #40a9ff;user-select:none}.button:hover{opacity:.9}.button.info{color:#000;border:1px solid #40a9ff;background:white}.button.gray{color:#f5f5f5;border:1px solid #b6b6b6;background:#b6b6b6}.button.light{color:gray;border:1px solid #e2e2e2;background:#e2e2e2}.button:before{content:" ";border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle infinite 1s linear;border-color:#fff transparent transparent transparent;width:1rem;height:1rem;margin-right:1rem;display:none}.button.loading{cursor:not-allowed;opacity:.5}.button.loading:before{display:block}.button.disabled{cursor:not-allowed;color:#c6c6c6;background:#8d8d8d;border:1px solid transparent}.button.isNight{color:#c6c6c6;background:#2b4054;border:1px solid transparent}.tool{position:relative;margin-left:1rem;display:flex;align-items:center;font-size:1.2rem;font-weight:700;border-radius:.3rem;cursor:pointer;height:2.4rem;padding:0 .5rem}.tool:before{content:" ";border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle infinite 1s linear;border-color:transparent #929596 #929596 #929596;width:1rem;height:1rem;margin-left:1rem;display:none}.tool.loading{cursor:not-allowed;opacity:.5}.tool.loading:before{display:block}.tool.loading:hover{background:unset}.tool>svg{width:1.6rem!important;height:1.6rem!important;margin-right:.4rem;box-sizing:border-box;border-radius:.2rem}.tool:hover{background:#e8e8e8}.tool.no-hover{cursor:default}.tool.no-hover:hover{background:unset}.my-node{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node:hover{text-decoration:none;background:#e2e2e2}.msgs{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.msg{cursor:default;margin-bottom:2rem;background:white;display:flex;color:#000;font-size:1.4rem;box-sizing:border-box;border-radius:.4rem;box-shadow:0 0 1rem 1px silver}.msg.success .left{background:#40a9ff}.msg.warning .left{background:#c8c002}.msg.error .left{background:red}.msg .left{border-radius:.4rem 0 0 .4rem;display:flex;align-items:center;background:#40a9ff}.msg .left svg{margin:0 .3rem;cursor:pointer}.msg .right{flex:1;padding:1rem 2rem;display:flex;justify-content:space-between;align-items:center}.line{border-bottom:1px solid #e2e2e2}.my-box{box-shadow:0 2px 3px #0000001a;border-radius:.4rem;background:white;margin-bottom:2rem;width:100%;overflow:hidden;box-sizing:border-box}.my-cell{padding:.6rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid #e2e2e2}.f14{font-size:1.4rem}.switch{width:4.5rem;height:2rem;border-radius:2rem;position:relative;display:flex;align-items:center;transition:all .3s}.switch.light{border:1px solid #e2e2e2}.switch.light.active{background:#e2e2e2}.switch.light.active:before{right:.2rem;background:white}.switch.light:before{background:#e2e2e2}.switch.gray{border:1px solid #ccc}.switch.gray.active{background:#ccc}.switch.gray.active:before{right:.2rem;background:white}.switch.gray:before{background:#ccc}.switch.isNight{border:1px solid #31475e}.switch.isNight.active{background:#31475e}.switch.isNight.active:before{right:.2rem;background:gray}.switch.isNight:before{background:#31475e}.switch:before{position:absolute;content:" ";transition:all .3s;right:calc(100% - 2rem);width:1.8rem;height:1.8rem;border-radius:50%}.modal{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option{display:flex;justify-content:space-between;align-items:center;padding:.6rem 0}.modal .mask{position:fixed;width:100vw;height:100vh;left:0;top:0;background:rgba(0,0,0,.3)}.radio-group2{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid #e2e2e2}.radio-group2 .radio{cursor:pointer;background:transparent;padding:.3rem 1rem;border-left:1px solid #e2e2e2;color:#9ca1a4;font-size:1.2rem}.radio-group2 .radio:first-child{border-left:none}.radio-group2 .active{background:#e2e2e2;color:gray}.radio-group2.isNight{border:1px solid #454847}.radio-group2.isNight .radio{border-left:1px solid #454847;color:#fff}.radio-group2.isNight .active{background:#31475e}.pop-confirm{position:relative;display:inline-flex;justify-content:center}.tip{position:fixed;background:black;color:#fff;max-width:10rem;padding:.7rem 1rem;border-radius:.5rem;transform:translate(-50%);z-index:999}input{height:3rem;outline:unset;border:1px solid #e1e1e1;padding:0 .5rem;border-radius:5px;box-sizing:border-box}.isNight .wrapper[data-v-c0f35f60]{background:#22303f!important}.isNight .wrapper .title[data-v-c0f35f60],.isNight .wrapper .option-title[data-v-c0f35f60],.isNight .wrapper .option>span[data-v-c0f35f60]{color:#a9a9a9}.isNight .wrapper .notice[data-v-c0f35f60]{color:gray!important}.setting-modal .wrapper[data-v-c0f35f60]{z-index:9;background:#f1f1f1;border-radius:.8rem;font-size:1.4rem;padding:2rem;max-height:80vh;max-width:80vw;overflow:auto}.setting-modal .wrapper .sub-title[data-v-c0f35f60]{color:gray;font-size:1.4rem}.setting-modal .wrapper .option-title[data-v-c0f35f60]{text-align:start;font-size:1.6rem;font-weight:700;margin-top:1.5rem}.setting-modal .wrapper .body[data-v-c0f35f60]{display:flex;gap:3rem}.setting-modal .wrapper .body .option-list[data-v-c0f35f60]{width:45rem}.setting-modal .wrapper .notice[data-v-c0f35f60]{font-size:12px;padding-left:3rem;text-align:left}.setting-modal .wrapper .notice a[data-v-c0f35f60]{color:#00f}.pop-confirm-content[data-v-8df5d12b]{position:fixed;background:white;padding:1.5rem;box-shadow:0 0 12px #0003;border-radius:.4rem;transform:translate(-50%,calc(-100% - 1rem));z-index:999}.pop-confirm-content .text[data-v-8df5d12b]{color:#000;text-align:start;font-size:1.4rem;width:15rem;min-width:15rem}.pop-confirm-content .options[data-v-8df5d12b]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem;font-size:1rem}.pop-confirm-content .options div[data-v-8df5d12b]{cursor:pointer}.pop-confirm-content .options .main[data-v-8df5d12b]{color:gray;background:#e2e2e2;padding:.3rem .8rem;border-radius:.2rem}.point[data-v-810a119b]{margin-left:1rem;font-size:1.2rem;min-width:4rem;border-radius:.4rem 0 0 .4rem;display:flex;align-items:center;flex-direction:row!important;padding:0!important}.point .up[data-v-810a119b]{display:flex;flex-direction:column;align-items:center;justify-content:center}.point .num[data-v-810a119b]{margin-left:.2rem;font-weight:700;color:#000;user-select:none}.point svg[data-v-810a119b]{width:2rem;padding:.4rem;border-radius:.2rem}.point svg[data-v-810a119b]:hover{background:#e5e5e5}.point svg.disabled[data-v-810a119b]{cursor:not-allowed}.point svg.disabled[data-v-810a119b]:hover{background:unset!important}.Author[data-v-07853933]{display:flex;align-items:center;justify-content:space-between;font-size:1.2rem;position:relative}.Author.expand[data-v-07853933]{margin-bottom:0}.Author .Author-left[data-v-07853933]{display:flex;align-items:center;max-width:90%}.Author .Author-left .username[data-v-07853933]{font-size:1.4rem;margin-right:1rem}.Author .Author-left .expand-icon[data-v-07853933]{cursor:pointer;margin-right:.8rem;width:2rem;height:2rem;transform:rotate(90deg)}.Author .Author-left .avatar[data-v-07853933]{margin-right:1rem;display:flex}.Author .Author-left .avatar img[data-v-07853933]{width:2.8rem;height:2.8rem;border-radius:.4rem}.Author .Author-left .texts[data-v-07853933]{flex:1}.Author .Author-left .op[data-v-07853933]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.Author .Author-left .mod[data-v-07853933]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.Author .Author-left .my-tag[data-v-07853933]{font-size:1.4rem;color:red;margin-left:1rem}.Author .Author-left .my-tag:hover .remove[data-v-07853933]{display:inline}.Author .Author-left .my-tag .remove[data-v-07853933]{cursor:pointer;margin-left:.5rem;display:none}.Author .Author-left .add-tag[data-v-07853933]{font-size:2.5rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;display:none}.Author:hover .add-tag[data-v-07853933]{display:inline-block}.Author .Author-right[data-v-07853933]{position:absolute;right:0;display:flex;align-items:center}.Author .Author-right .toolbar[data-v-07853933]{display:flex;align-items:center;color:#929596;opacity:0}.Author .Author-right .toolbar[data-v-07853933]:hover{background:white;opacity:1}.Author .Author-right .floor[data-v-07853933]{margin-left:1rem;font-size:1.2rem;line-height:1rem;border-radius:1rem;display:inline-block;background-color:#f0f0f0;color:#ccc;padding:.2rem .5rem;cursor:default}.Author .Author-right .isDev[data-v-07853933]{color:#000!important}.post-editor-wrapper[data-v-502fb811]{width:100%;box-sizing:border-box;position:relative;overflow:hidden;transition:all .3s}.post-editor-wrapper.reply-post .post-editor[data-v-502fb811]{border:1px solid #e2e2e2;border-radius:.4rem}.post-editor-wrapper.reply-post.isFocus .post-editor[data-v-502fb811]{border:1px solid #968b8b}.post-editor-wrapper.reply-comment[data-v-502fb811]{border:1px solid #e2e2e2;border-radius:.4rem;overflow:hidden}.post-editor-wrapper.reply-comment.isFocus[data-v-502fb811]{border:1px solid #968b8b}.post-editor-wrapper.reply-comment .toolbar[data-v-502fb811]{background:#f6f7f8}.post-editor-wrapper .post-editor[data-v-502fb811]{transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;border:none;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.4rem;min-height:13rem;resize:none}.post-editor-wrapper .toolbar[data-v-502fb811]{box-sizing:border-box;padding:.5rem 1rem;width:100%;position:relative;display:flex;justify-content:space-between;align-items:center}.post-editor-wrapper .toolbar .left[data-v-502fb811]{display:flex;gap:1rem}.post-editor-wrapper .toolbar .left svg[data-v-502fb811]{cursor:pointer}.post-editor-wrapper .toolbar .left .upload input[data-v-502fb811]{cursor:pointer;position:absolute;width:20px;height:20px;opacity:0}.post-editor-wrapper .toolbar span[data-v-502fb811]{color:gray;font-size:1.3rem}.post-editor-wrapper .get-cursor[data-v-502fb811]{transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;border:none;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.4rem;min-height:13rem;resize:none;position:absolute;top:0;z-index:-100}.post-editor-wrapper .emoticon-pack[data-v-502fb811]{z-index:999999999;border-radius:1rem;padding:1rem;width:31rem;max-width:31rem;height:30rem;max-height:30rem;overflow:auto;background:white;border:1px solid #e2e8f0;box-shadow:0 9px 24px -3px #0000000f,0 4px 8px -1px #0000001f;position:fixed;bottom:11rem;left:14rem}.post-editor-wrapper .emoticon-pack i[data-v-502fb811]{cursor:pointer;position:absolute;right:2rem;font-size:2rem;color:#e2e2e2}.post-editor-wrapper .emoticon-pack .list[data-v-502fb811]{margin:1rem 0}.post-editor-wrapper .emoticon-pack img[data-v-502fb811]{cursor:pointer;width:3rem;height:3rem;padding:.5rem}.post-editor-wrapper .emoticon-pack span[data-v-502fb811]{display:inline-block;cursor:pointer;font-size:2.3rem;padding:.5rem}.isNight .emoticon-pack[data-v-502fb811]{background:#18222d;border:1px solid #737373}.v-enter-active[data-v-8ffbfeb2],.v-leave-active[data-v-8ffbfeb2]{transition:opacity .3s ease}.v-enter-from[data-v-8ffbfeb2],.v-leave-to[data-v-8ffbfeb2]{opacity:0}.username[data-v-8ffbfeb2]{font-weight:700;font-size:1.4rem;margin-right:1rem}.op[data-v-8ffbfeb2]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-8ffbfeb2]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-8ffbfeb2]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-8ffbfeb2]{display:inline}.my-tag .remove[data-v-8ffbfeb2]{cursor:pointer;margin-left:.5rem;display:none}.floor[data-v-8ffbfeb2]{margin-left:1rem;font-size:1.2rem;line-height:1rem;border-radius:1rem;display:inline-block;background-color:#f0f0f0;color:#ccc;padding:.2rem .5rem;cursor:default}html[data-v-8ffbfeb2],body[data-v-8ffbfeb2]{font-size:62.5%}.flex[data-v-8ffbfeb2]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-8ffbfeb2]{justify-content:flex-end}.flex-center[data-v-8ffbfeb2]{justify-content:center}.p1[data-v-8ffbfeb2]{padding:1rem}.p0[data-v-8ffbfeb2]{padding:0!important}.post-author[data-v-8ffbfeb2]{display:flex;align-items:center;position:relative;color:#ccc!important}.post-author>.username[data-v-8ffbfeb2]{font-size:1.2rem}.sticky[data-v-8ffbfeb2]{position:sticky;bottom:0}.sticky[stuck][data-v-8ffbfeb2]{box-shadow:0 2px 20px #00000059}a[data-v-8ffbfeb2]{color:#778087;text-decoration:none;cursor:pointer}a[data-v-8ffbfeb2]:hover{text-decoration:underline}.base-loading[data-v-8ffbfeb2]{border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle-8ffbfeb2 infinite 1s linear}.loading-c[data-v-8ffbfeb2]{border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle-8ffbfeb2 infinite 1s linear;width:3rem;height:3rem}.loading-b[data-v-8ffbfeb2]{border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle-8ffbfeb2 infinite 1s linear;border-color:#ffffff rgba(178,177,177,.2) rgba(178,177,177,.2) rgba(178,177,177,.2);width:3rem;height:3rem}@keyframes circle-8ffbfeb2{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.button[data-v-8ffbfeb2]{cursor:pointer;padding:.4rem 2.4rem;border-radius:5px;display:inline-flex;justify-content:center;align-items:center;font-weight:700;font-size:1.2rem;color:#fff;background:#40a9ff;border:1px solid #40a9ff;user-select:none}.button[data-v-8ffbfeb2]:hover{opacity:.9}.button.info[data-v-8ffbfeb2]{color:#000;border:1px solid #40a9ff;background:white}.button.gray[data-v-8ffbfeb2]{color:#f5f5f5;border:1px solid #b6b6b6;background:#b6b6b6}.button.light[data-v-8ffbfeb2]{color:gray;border:1px solid #e2e2e2;background:#e2e2e2}.button[data-v-8ffbfeb2]:before{content:" ";border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle-8ffbfeb2 infinite 1s linear;border-color:#fff transparent transparent transparent;width:1rem;height:1rem;margin-right:1rem;display:none}.button.loading[data-v-8ffbfeb2]{cursor:not-allowed;opacity:.5}.button.loading[data-v-8ffbfeb2]:before{display:block}.button.disabled[data-v-8ffbfeb2]{cursor:not-allowed;color:#c6c6c6;background:#8d8d8d;border:1px solid transparent}.button.isNight[data-v-8ffbfeb2]{color:#c6c6c6;background:#2b4054;border:1px solid transparent}.tool[data-v-8ffbfeb2]{position:relative;margin-left:1rem;display:flex;align-items:center;font-size:1.2rem;font-weight:700;border-radius:.3rem;cursor:pointer;height:2.4rem;padding:0 .5rem}.tool[data-v-8ffbfeb2]:before{content:" ";border:2px solid;border-color:#000 #00000033 #00000033 #00000033;border-radius:100%;animation:circle-8ffbfeb2 infinite 1s linear;border-color:transparent #929596 #929596 #929596;width:1rem;height:1rem;margin-left:1rem;display:none}.tool.loading[data-v-8ffbfeb2]{cursor:not-allowed;opacity:.5}.tool.loading[data-v-8ffbfeb2]:before{display:block}.tool.loading[data-v-8ffbfeb2]:hover{background:unset}.tool>svg[data-v-8ffbfeb2]{width:1.6rem!important;height:1.6rem!important;margin-right:.4rem;box-sizing:border-box;border-radius:.2rem}.tool[data-v-8ffbfeb2]:hover{background:#e8e8e8}.tool.no-hover[data-v-8ffbfeb2]{cursor:default}.tool.no-hover[data-v-8ffbfeb2]:hover{background:unset}.my-node[data-v-8ffbfeb2]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-8ffbfeb2]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-8ffbfeb2]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.msg[data-v-8ffbfeb2]{cursor:default;margin-bottom:2rem;background:white;display:flex;color:#000;font-size:1.4rem;box-sizing:border-box;border-radius:.4rem;box-shadow:0 0 1rem 1px silver}.msg.success .left[data-v-8ffbfeb2]{background:#40a9ff}.msg.warning .left[data-v-8ffbfeb2]{background:#c8c002}.msg.error .left[data-v-8ffbfeb2]{background:red}.msg .left[data-v-8ffbfeb2]{border-radius:.4rem 0 0 .4rem;display:flex;align-items:center;background:#40a9ff}.msg .left svg[data-v-8ffbfeb2]{margin:0 .3rem;cursor:pointer}.msg .right[data-v-8ffbfeb2]{flex:1;padding:1rem 2rem;display:flex;justify-content:space-between;align-items:center}.line[data-v-8ffbfeb2]{border-bottom:1px solid #e2e2e2}.my-box[data-v-8ffbfeb2]{box-shadow:0 2px 3px #0000001a;border-radius:.4rem;background:white;margin-bottom:2rem;width:100%;overflow:hidden;box-sizing:border-box}.my-cell[data-v-8ffbfeb2]{padding:.6rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid #e2e2e2}.f14[data-v-8ffbfeb2]{font-size:1.4rem}.switch[data-v-8ffbfeb2]{width:4.5rem;height:2rem;border-radius:2rem;position:relative;display:flex;align-items:center;transition:all .3s}.switch.light[data-v-8ffbfeb2]{border:1px solid #e2e2e2}.switch.light.active[data-v-8ffbfeb2]{background:#e2e2e2}.switch.light.active[data-v-8ffbfeb2]:before{right:.2rem;background:white}.switch.light[data-v-8ffbfeb2]:before{background:#e2e2e2}.switch.gray[data-v-8ffbfeb2]{border:1px solid #ccc}.switch.gray.active[data-v-8ffbfeb2]{background:#ccc}.switch.gray.active[data-v-8ffbfeb2]:before{right:.2rem;background:white}.switch.gray[data-v-8ffbfeb2]:before{background:#ccc}.switch.isNight[data-v-8ffbfeb2]{border:1px solid #31475e}.switch.isNight.active[data-v-8ffbfeb2]{background:#31475e}.switch.isNight.active[data-v-8ffbfeb2]:before{right:.2rem;background:gray}.switch.isNight[data-v-8ffbfeb2]:before{background:#31475e}.switch[data-v-8ffbfeb2]:before{position:absolute;content:" ";transition:all .3s;right:calc(100% - 2rem);width:1.8rem;height:1.8rem;border-radius:50%}.modal[data-v-8ffbfeb2]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-8ffbfeb2]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-8ffbfeb2]{display:flex;justify-content:space-between;align-items:center;padding:.6rem 0}.modal .mask[data-v-8ffbfeb2]{position:fixed;width:100vw;height:100vh;left:0;top:0;background:rgba(0,0,0,.3)}.radio-group2[data-v-8ffbfeb2]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid #e2e2e2}.radio-group2 .radio[data-v-8ffbfeb2]{cursor:pointer;background:transparent;padding:.3rem 1rem;border-left:1px solid #e2e2e2;color:#9ca1a4;font-size:1.2rem}.radio-group2 .radio[data-v-8ffbfeb2]:first-child{border-left:none}.radio-group2 .active[data-v-8ffbfeb2]{background:#e2e2e2;color:gray}.radio-group2.isNight[data-v-8ffbfeb2]{border:1px solid #454847}.radio-group2.isNight .radio[data-v-8ffbfeb2]{border-left:1px solid #454847;color:#fff}.radio-group2.isNight .active[data-v-8ffbfeb2]{background:#31475e}.pop-confirm[data-v-8ffbfeb2]{position:relative;display:inline-flex;justify-content:center}.tip[data-v-8ffbfeb2]{position:fixed;background:black;color:#fff;max-width:10rem;padding:.7rem 1rem;border-radius:.5rem;transform:translate(-50%);z-index:999}input[data-v-8ffbfeb2]{height:3rem;outline:unset;border:1px solid #e1e1e1;padding:0 .5rem;border-radius:5px;box-sizing:border-box}.html-wrapper[data-v-8ffbfeb2]{position:relative}.html-wrapper .mask[data-v-8ffbfeb2]{max-height:90rem;overflow:hidden;-webkit-mask-image:linear-gradient(180deg,#000 80%,transparent)}.html-wrapper .expand[data-v-8ffbfeb2]{position:absolute;z-index:1;bottom:2rem;padding:.2rem 1.5rem;border-radius:2rem;border:1px solid gray;background:white;color:gray;left:50%;transform:translate(-50%);cursor:pointer}.comment[data-v-62148878]{width:100%;box-sizing:border-box;margin-top:.6rem}.comment.isLevelOne[data-v-62148878]{border-bottom:1px solid #ececec;padding:.8rem 1rem;margin-top:0}.comment.ding[data-v-62148878]{background:rgba(255,255,0,.3)!important}.comment .comment-content-w .more[data-v-62148878]{text-align:center;margin:2rem 0}.comment .comment-content[data-v-62148878]{display:flex;position:relative}.comment .comment-content .expand-line[data-v-62148878]{cursor:pointer;margin-top:.6rem;width:2.8rem;min-width:2.8rem;position:relative}.comment .comment-content .expand-line[data-v-62148878]:after{position:absolute;left:50%;content:" ";height:100%;width:0;border-right:1px solid #ececec}.comment .comment-content .expand-line[data-v-62148878]:hover:after{border-right:2px solid #0079D3}.comment .comment-content .right[data-v-62148878]{flex:1;width:calc(100% - 3rem)}.comment .comment-content .right .w[data-v-62148878]{padding-left:1rem}.comment .comment-content .right .w .post-editor-wrapper[data-v-62148878]{margin-top:1rem}.wrong-wrapper[data-v-62148878]{font-size:1.4rem;margin-bottom:1rem}.wrong-wrapper span[data-v-62148878]{cursor:pointer}.wrong-wrapper .del-line[data-v-62148878]{text-decoration:line-through}.wrong-wrapper .wrong-icon[data-v-62148878]{margin-left:.5rem}.wrong-wrapper .warning[data-v-62148878]{border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;padding:1rem 0;margin-top:1rem;font-size:1.2rem;color:red}.toolbar[data-v-07fa3ae8]{display:flex;align-items:center;color:#929596}.comment[data-v-3eb530b9]{width:100%;box-sizing:border-box;display:flex;gap:1rem;padding:1rem;border-bottom:1px solid #e2e2e2}.comment .avatar[data-v-3eb530b9]{display:flex}.comment .avatar img[data-v-3eb530b9]{width:3.8rem;height:3.8rem;border-radius:.3rem}.comment .comment-body[data-v-3eb530b9]{flex:1;display:flex;flex-direction:column}.comment .comment-body .texts[data-v-3eb530b9]{display:flex;align-items:center}.comment .comment-body .reply_content[data-v-3eb530b9]{margin-top:1rem;max-width:calc(100% - 5rem)}.comment .isRight[data-v-3eb530b9]{align-items:flex-end}.comment .isRight .op[data-v-3eb530b9],.comment .isRight .mod[data-v-3eb530b9],.comment .isRight .username[data-v-3eb530b9]{margin:0 0 0 1rem}.comment .Author-right[data-v-3eb530b9]{display:flex;flex-direction:column;align-items:center}.comment .Author-right .floor[data-v-3eb530b9]{margin-left:0}.comment .Author-right .jump[data-v-3eb530b9]{color:#929596;margin-left:0}.comment .point[data-v-3eb530b9]{margin:0 .5rem;font-size:1.4rem;display:flex;gap:.5rem;align-items:center;font-weight:700;color:#000}.sticky{position:sticky;bottom:-2px;z-index:2}.sticky[stuck]{box-shadow:0 2px 20px #00000059!important}.Post[data-v-40ab5702]{position:unset!important;background:transparent!important;overflow:unset!important}.Post .main[data-v-40ab5702]{background:transparent!important;padding:unset!important;width:100%!important}.Post .close-btn[data-v-40ab5702]{display:none}.post-detail[data-v-40ab5702]{text-align:start;position:fixed;z-index:99;left:0;right:0;bottom:0;top:0;background:rgba(46,47,48,.8);overflow:auto;font-size:1.4rem;display:flex;justify-content:center;flex-wrap:wrap}.post-detail.isNight[data-v-40ab5702]{background:rgba(46,47,48,.8)}.post-detail.isNight .main[data-v-40ab5702]{background:#22303f}.post-detail.isNight .main .toolbar-wrapper[data-v-40ab5702]{border-top:unset!important}.post-detail.isNight .main .button.gray[data-v-40ab5702]{background:#18222d!important;border:1px solid #18222d!important}.post-detail.isNight .main .relationReply[data-v-40ab5702]{color:#fff}.post-detail.isNight .main .relationReply .comments[data-v-40ab5702],.post-detail.isNight .main .relationReply .my-cell[data-v-40ab5702]{background:#18222d}.post-detail.isNight .main .relationReply .comment[data-v-40ab5702]{border-bottom:1px solid #22303f}.post-detail.isNight .main .my-box[data-v-40ab5702]{color:#fff;background:#18222d}.post-detail.isNight .main .my-box .title[data-v-40ab5702],.post-detail.isNight .main .my-box .content[data-v-40ab5702]{color:#d1d5d9!important}.post-detail.isNight .main .my-box .base-info[data-v-40ab5702],.post-detail.isNight .main .my-box .content[data-v-40ab5702]{border:1px solid #22303f!important}.post-detail.isNight .main[data-v-40ab5702] .subtle .fade{color:#b2c3d4!important}.post-detail.isNight .main[data-v-40ab5702] .subtle .topic_content{color:#d1d5d9!important}.post-detail.isNight .main .my-cell[data-v-40ab5702]{border-bottom:1px solid #22303f!important}.post-detail.isNight .main[data-v-40ab5702] .isLevelOne{border-bottom:1px solid #22303f}.post-detail.isNight .main[data-v-40ab5702] .comment .expand-line:after{border-right:1px solid #22303f!important}.post-detail.isNight .main[data-v-40ab5702] .comment .expand-line:hover:after{border-right:2px solid #0079D3!important}.post-detail.isNight .main[data-v-40ab5702] .comment .comment-content .w>.text{color:#d1d5d9!important}.post-detail.isNight .main[data-v-40ab5702] .Author-right .toolbar:hover{background:#18222d!important}.post-detail.isNight .main[data-v-40ab5702] .Author-right .tool{background:#22303f!important}.post-detail.isNight .main[data-v-40ab5702] .point svg:hover{background:#22303f}.post-detail.isNight .main[data-v-40ab5702] .point .num{color:#d1d5d9!important}.post-detail.isNight .main[data-v-40ab5702] .floor{background:#393f4e!important;color:#d1d5d9!important}.post-detail.isNight .main .editor-wrapper[data-v-40ab5702]{background:#393f4e!important}.post-detail.isNight .main[data-v-40ab5702] .post-editor-wrapper .post-editor{background:#18222d;border:transparent;color:#fff}.post-detail.isNight .main[data-v-40ab5702] .post-editor-wrapper .toolbar{background:#393f4e!important}.post-detail.isNight .main .call-list[data-v-40ab5702]{background:#22303f}.post-detail.isNight .main .call-list .call-item[data-v-40ab5702]{border-top:1px solid #18222d}.post-detail.isNight .main .call-list .call-item .select[data-v-40ab5702],.post-detail.isNight .main .call-list .call-item[data-v-40ab5702]:hover,.post-detail.isNight .main .call-list .call-item.select[data-v-40ab5702]{background-color:#393f4e;text-decoration:none}.post-detail.isNight .main .scroll-to[data-v-40ab5702],.post-detail.isNight .main .close-btn[data-v-40ab5702],.post-detail.isNight .main .scroll-top[data-v-40ab5702],.post-detail.isNight .main .top-reply[data-v-40ab5702]{color:#9caec7}.post-detail .main[data-v-40ab5702]{display:flex;justify-content:flex-end;padding:3rem 8rem 15rem;background:#e2e2e2;position:relative;outline:none}.post-detail .main .main-wrapper[data-v-40ab5702]{width:77rem;padding-bottom:2rem;display:flex;flex-direction:column;align-items:center;position:relative}.post-detail .main .main-wrapper .post-wrapper .toolbar-wrapper[data-v-40ab5702]{border-top:1px solid #e2e2e2;height:3.4rem;padding-left:.6rem;display:flex;align-items:center}.post-detail .main .main-wrapper .editor-wrapper .float[data-v-40ab5702]{margin-right:2rem}.post-detail .main .main-wrapper .editor-wrapper .w[data-v-40ab5702]{padding:1.2rem}.post-detail .main .main-wrapper .comment-wrapper .comments[data-v-40ab5702]{width:100%;box-sizing:border-box}.post-detail .main .main-wrapper .loading-wrapper[data-v-40ab5702]{height:20rem;display:flex;justify-content:center;align-items:center}.post-detail .main .main-wrapper #no-comments-yet[data-v-40ab5702]{color:#a9a9a9;font-weight:700;text-align:center;width:100%;margin-bottom:2rem;box-sizing:border-box}.post-detail .main .relationReply[data-v-40ab5702]{position:fixed;width:25vw;top:6.5rem;bottom:15rem;z-index:99;transform:translate(calc(100% + 2rem));font-size:2rem;overflow:hidden}.post-detail .main .relationReply .my-cell[data-v-40ab5702]{background:white;border-radius:.5rem .5rem 0 0}.post-detail .main .relationReply .comments[data-v-40ab5702]{max-height:calc(100% - 4.2rem);overflow:auto;background:white;border-radius:0 0 .5rem .5rem}.post-detail .main .call-list[data-v-40ab5702]{z-index:9;position:absolute;top:12rem;border:1px solid #ccc;background-color:#fff;box-shadow:0 5px 15px #0000001a;overflow:hidden;max-height:30rem;min-width:8rem;box-sizing:content-box}.post-detail .main .call-list .call-item[data-v-40ab5702]{border-top:1px solid #ccc;height:3rem;display:flex;padding:0 1rem;align-items:center;cursor:pointer;font-size:14px;box-sizing:border-box}.post-detail .main .call-list .call-item .select[data-v-40ab5702],.post-detail .main .call-list .call-item[data-v-40ab5702]:hover,.post-detail .main .call-list .call-item.select[data-v-40ab5702]{background-color:#f0f0f0;text-decoration:none}.post-detail .main .call-list .call-item[data-v-40ab5702]:nth-child(1){border-top:1px solid transparent}@media screen and (max-width: 1500px){.post-detail .main-wrapper[data-v-40ab5702]{width:65vw!important}}@media screen and (max-width: 1280px){.post-detail .main-wrapper[data-v-40ab5702]{width:75vw!important}}.post-detail .scroll-top[data-v-40ab5702]{position:fixed;bottom:10rem;z-index:99;padding:.6rem .2rem;width:3.5rem;transform:translate(6rem);font-size:2rem;background:#f1f1f1;border:none;color:#a9a9a9}.post-detail .scroll-to[data-v-40ab5702]{position:fixed;bottom:10rem;z-index:99;padding:.6rem .2rem;width:3.5rem;transform:translate(6rem);font-size:2rem;background:#f1f1f1;border:none;color:#a9a9a9;bottom:15rem;display:flex;flex-direction:column}.post-detail .scroll-to input[data-v-40ab5702]{margin-top:.5rem;height:2rem;width:3.3rem;font-size:1.4rem;text-align:center;color:gray}.post-detail .read-notice[data-v-40ab5702]{display:flex;align-items:center;color:gray}.post-detail .read-notice .jump[data-v-40ab5702]{background:#f1f1f1;color:gray;padding:.3rem 1rem;border-radius:.4rem;margin:0 1rem;cursor:pointer}.post-detail .close-btn[data-v-40ab5702]{color:#b6b6b6;cursor:pointer;position:fixed;top:3rem;transform:translate(4rem);font-size:2rem}.post-detail .top-reply[data-v-40ab5702]{color:#e2e2e2;cursor:pointer;font-size:2rem;display:flex}.post-detail .top-reply i[data-v-40ab5702]{padding:0 1rem}.isNight[data-v-19fe372d]{background:#22303f!important;color:#ccc!important}.base64_tooltip[data-v-19fe372d]{box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;background:white;min-height:2.2rem;max-width:20rem;padding:.8rem;position:fixed;z-index:9998;display:flex;align-items:center;border-radius:.5rem;cursor:pointer;line-break:anywhere;font-size:1.4rem;color:#000}.base64_tooltip svg[data-v-19fe372d]{margin-left:1rem;min-width:1.8rem}.base64_tooltip .button[data-v-19fe372d]{margin-top:1rem;margin-left:2rem}.isNight .wrapper[data-v-b28a2e5e]{background:#22303f!important}.isNight .wrapper .title[data-v-b28a2e5e]{color:gray}.isNight .wrapper .option[data-v-b28a2e5e]{color:#fff!important}.isNight .wrapper .option span[data-v-b28a2e5e]{color:gray!important}.isNight .wrapper .white[data-v-b28a2e5e]{color:#fff!important}.tag-modal .wrapper[data-v-b28a2e5e]{z-index:9;background:#f1f1f1;border-radius:.8rem;font-size:1.4rem;padding:2rem 6rem 4rem;width:25rem}.tag-modal .wrapper .btns[data-v-b28a2e5e]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1.5rem;font-size:1rem}.tag-modal .wrapper .btns div[data-v-b28a2e5e]{cursor:pointer}.tag-modal .wrapper .btns .main[data-v-b28a2e5e]{color:gray;background:#e2e2e2;padding:.5rem 1.2rem;border-radius:.4rem}.msgs[data-v-95974c3e]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.isNight .open-post[data-v-f9a9d2e9],.isNight .nav[data-v-f9a9d2e9]{color:#fff;background:#18222d;border-bottom:1px solid #22303f}.card[data-v-f9a9d2e9]{border-radius:0 0 .4rem .4rem;overflow:hidden}.nav[data-v-f9a9d2e9]{font-size:1.4rem;background:white;padding:1rem;border-bottom:1px solid #e2e2e2} ');
  26.  
  27. (function (vue) {
  28. 'use strict';
  29.  
  30. var PageType = /* @__PURE__ */ ((PageType2) => {
  31. PageType2["Home"] = "Home";
  32. PageType2["Node"] = "Node";
  33. PageType2["Post"] = "Post";
  34. return PageType2;
  35. })(PageType || {});
  36. const _export_sfc = (sfc, props) => {
  37. const target = sfc.__vccOpts || sfc;
  38. for (const [key, val] of props) {
  39. target[key] = val;
  40. }
  41. return target;
  42. };
  43. const _sfc_main$f = {
  44. name: "Tooltip",
  45. props: {
  46. title: {
  47. type: String,
  48. default() {
  49. return "";
  50. }
  51. }
  52. },
  53. data() {
  54. return {
  55. show: false
  56. };
  57. },
  58. methods: {
  59. hoverIn(e) {
  60. let rect = e.target.getBoundingClientRect();
  61. this.show = true;
  62. vue.nextTick(() => {
  63. let tip = this.$refs.tip.getBoundingClientRect();
  64. this.$refs.tip.style.top = rect.top - tip.height - 5 + "px";
  65. this.$refs.tip.style.left = rect.left + rect.width / 2 + "px";
  66. });
  67. }
  68. }
  69. };
  70. const _hoisted_1$f = { class: "pop-confirm" };
  71. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  72. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
  73. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  74. vue.createVNode(vue.Transition, null, {
  75. default: vue.withCtx(() => [
  76. $data.show ? (vue.openBlock(), vue.createElementBlock("div", {
  77. key: 0,
  78. class: "tip",
  79. ref: "tip"
  80. }, vue.toDisplayString($props.title), 513)) : vue.createCommentVNode("", true)
  81. ]),
  82. _: 1
  83. })
  84. ])),
  85. vue.createElementVNode("span", {
  86. onMouseenter: _cache[0] || (_cache[0] = (...args) => $options.hoverIn && $options.hoverIn(...args)),
  87. onMouseleave: _cache[1] || (_cache[1] = ($event) => $data.show = false)
  88. }, [
  89. vue.renderSlot(_ctx.$slots, "default")
  90. ], 32)
  91. ]);
  92. }
  93. const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$9]]);
  94. const _sfc_main$e = {
  95. name: "Setting",
  96. components: {
  97. Tooltip
  98. },
  99. inject: ["isNight"],
  100. props: {
  101. modelValue: {
  102. type: Object,
  103. default() {
  104. return {};
  105. }
  106. },
  107. show: {
  108. type: Boolean,
  109. default() {
  110. return false;
  111. }
  112. }
  113. },
  114. data() {
  115. return {
  116. config: window.clone(this.modelValue)
  117. };
  118. },
  119. watch: {
  120. config: {
  121. handler(n) {
  122. n.topReplyLoveMinCount = Math.trunc(n.topReplyLoveMinCount);
  123. if (n.topReplyLoveMinCount < 0) {
  124. n.topReplyLoveMinCount = 1;
  125. }
  126. this.$emit("update:modelValue", n);
  127. },
  128. deep: true
  129. }
  130. },
  131. created() {
  132. }
  133. };
  134. const _withScopeId$8 = (n) => (vue.pushScopeId("data-v-c0f35f60"), n = n(), vue.popScopeId(), n);
  135. const _hoisted_1$e = { class: "wrapper" };
  136. const _hoisted_2$d = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 脚本设置 ", -1));
  137. const _hoisted_3$a = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sub-title" }, " 设置自动保存到本地,下次打开依然生效 ", -1));
  138. const _hoisted_4$8 = { class: "body" };
  139. const _hoisted_5$7 = { class: "option-list" };
  140. const _hoisted_6$7 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "option-title" }, "列表:", -1));
  141. const _hoisted_7$6 = { class: "option" };
  142. const _hoisted_8$6 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "列表帖子展示方式:", -1));
  143. const _hoisted_9$6 = { class: "option" };
  144. const _hoisted_10$6 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "列表hover时显示预览按钮:", -1));
  145. const _hoisted_11$6 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, " 此项需要刷新页面才能生效 ", -1));
  146. const _hoisted_12$6 = { class: "option" };
  147. const _hoisted_13$6 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "点击列表的帖子,打开详情弹框 :", -1));
  148. const _hoisted_14$6 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, " 若关闭此项,点击列表的帖子时,不会打开弹框,会跳转网页 ", -1));
  149. const _hoisted_15$6 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "option-title" }, "帖子:", -1));
  150. const _hoisted_16$5 = { class: "option" };
  151. const _hoisted_17$5 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复展示方式:", -1));
  152. const _hoisted_18$4 = { class: "option" };
  153. const _hoisted_19$4 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "单独打开帖子时默认显示楼中楼 :", -1));
  154. const _hoisted_20$4 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, " 单独打开这种地址 https://v2ex.com/t/xxxx 时,是否默认显示楼中楼 ", -1));
  155. const _hoisted_21$3 = { class: "option" };
  156. const _hoisted_22$3 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "点击左右两侧透明处关闭帖子详情弹框:", -1));
  157. const _hoisted_23$2 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "option-title" }, "点赞:", -1));
  158. const _hoisted_24$3 = { class: "option" };
  159. const _hoisted_25$2 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "显示高赞回复:", -1));
  160. const _hoisted_26$2 = { class: "option" };
  161. const _hoisted_27$2 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "最多显示多少个高赞回复:", -1));
  162. const _hoisted_28$1 = { class: "option" };
  163. const _hoisted_29$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "最少需要多少赞才能被判定为高赞:", -1));
  164. const _hoisted_30$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "option-title" }, "记忆阅读:", -1));
  165. const _hoisted_31$1 = { class: "option" };
  166. const _hoisted_32$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "记录上次阅读楼层(误差1层左右):", -1));
  167. const _hoisted_33$1 = { class: "option" };
  168. const _hoisted_34$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "打开帖子自动跳转到上次阅读楼层:", -1));
  169. const _hoisted_35$1 = { class: "option-list" };
  170. const _hoisted_36$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "option-title" }, "其他:", -1));
  171. const _hoisted_37 = { class: "option" };
  172. const _hoisted_38 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "显示工具栏:", -1));
  173. const _hoisted_39 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, [
  174. /* @__PURE__ */ vue.createTextVNode(" 关闭此项会隐藏以下三个工具栏 "),
  175. /* @__PURE__ */ vue.createElementVNode("div", null, " 1. 首页”卡片/表格“ "),
  176. /* @__PURE__ */ vue.createElementVNode("div", null, " 2. 详情页”楼中楼/只看楼主/感谢/V2原版“ "),
  177. /* @__PURE__ */ vue.createElementVNode("div", null, " 3. 单独打开帖子时”点击显示楼中楼“ ")
  178. ], -1));
  179. const _hoisted_40 = { class: "option" };
  180. const _hoisted_41 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "新标签页打开链接 :", -1));
  181. const _hoisted_42 = { class: "option" };
  182. const _hoisted_43 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "用户打标签(跨平台,数据保存在自己的记事本):", -1));
  183. const _hoisted_44 = { class: "option" };
  184. const _hoisted_45 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "正文超长自动折叠:", -1));
  185. const _hoisted_46 = { class: "option" };
  186. const _hoisted_47 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "划词显示Base64解码框:", -1));
  187. const _hoisted_48 = { class: "option" };
  188. const _hoisted_49 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "使用 SOV2EX 搜索:", -1));
  189. const _hoisted_50 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, " 此项需要刷新页面才能生效 ", -1));
  190. const _hoisted_51 = { class: "option" };
  191. const _hoisted_52 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "帖子宽度:", -1));
  192. const _hoisted_53 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, [
  193. /* @__PURE__ */ vue.createTextVNode(" 默认为77rem。接受合法的width值: "),
  194. /* @__PURE__ */ vue.createElementVNode("a", {
  195. href: "https://vue3js.cn/interview/css/em_px_rem_vh_vw.html#%E4%BA%8C%E3%80%81%E5%8D%95%E4%BD%8D",
  196. target: "_blank"
  197. }, "rem、px、vw、vh"),
  198. /* @__PURE__ */ vue.createTextVNode("。 vw代表屏幕百分比,如想要屏幕的66%,请填写66vw ")
  199. ], -1));
  200. const _hoisted_54 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, " 提示:此项设置以后,单独打开详情页时会出现帖子突然变宽(窄)的问题,暂时无解 ", -1));
  201. const _hoisted_55 = { class: "option" };
  202. const _hoisted_56 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "自动签到:", -1));
  203. const _hoisted_57 = { class: "option" };
  204. const _hoisted_58 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "自定义背景:", -1));
  205. const _hoisted_59 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, [
  206. /* @__PURE__ */ vue.createTextVNode(" 接受一个合法的css color值:例如"),
  207. /* @__PURE__ */ vue.createElementVNode("a", {
  208. href: "https://developer.mozilla.org/zh-CN/docs/Web/CSS/color_value",
  209. target: "_blank"
  210. }, "red、#ffffff、rgb(222,222,22)"),
  211. /* @__PURE__ */ vue.createTextVNode("等等。 没图片时的背景默认为 #e2e2e2。 ")
  212. ], -1));
  213. const _hoisted_60 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, " 此项需要刷新页面才能生效 ", -1));
  214. const _hoisted_61 = { class: "option" };
  215. const _hoisted_62 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "收藏时提醒添加到书签:", -1));
  216. const _hoisted_63 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "notice" }, " V站的帐号一旦被封了,就无法登录(不可用)了,账号里的收藏也就看不到了 ", -1));
  217. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  218. const _component_Tooltip = vue.resolveComponent("Tooltip");
  219. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  220. default: vue.withCtx(() => [
  221. $props.show ? (vue.openBlock(), vue.createElementBlock("div", {
  222. key: 0,
  223. class: vue.normalizeClass(["setting-modal modal", { isNight: $options.isNight }])
  224. }, [
  225. vue.createElementVNode("div", {
  226. class: "mask",
  227. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:show", false))
  228. }),
  229. vue.createElementVNode("div", _hoisted_1$e, [
  230. _hoisted_2$d,
  231. _hoisted_3$a,
  232. vue.createElementVNode("div", _hoisted_4$8, [
  233. vue.createElementVNode("div", _hoisted_5$7, [
  234. _hoisted_6$7,
  235. vue.createElementVNode("div", _hoisted_7$6, [
  236. _hoisted_8$6,
  237. vue.createElementVNode("div", {
  238. class: vue.normalizeClass(["radio-group2", { isNight: $options.isNight }])
  239. }, [
  240. vue.createElementVNode("div", {
  241. class: vue.normalizeClass(["radio", $data.config.viewType === "table" ? "active" : ""]),
  242. onClick: _cache[1] || (_cache[1] = ($event) => $data.config.viewType = "table")
  243. }, "表格 ", 2),
  244. vue.createElementVNode("div", {
  245. class: vue.normalizeClass(["radio", $data.config.viewType === "card" ? "active" : ""]),
  246. onClick: _cache[2] || (_cache[2] = ($event) => $data.config.viewType = "card")
  247. }, "卡片 ", 2)
  248. ], 2)
  249. ]),
  250. vue.createElementVNode("div", _hoisted_9$6, [
  251. _hoisted_10$6,
  252. vue.createElementVNode("div", {
  253. class: vue.normalizeClass(["switch gray", { active: $data.config.showPreviewBtn, isNight: $options.isNight }]),
  254. onClick: _cache[3] || (_cache[3] = ($event) => $data.config.showPreviewBtn = !$data.config.showPreviewBtn)
  255. }, null, 2)
  256. ]),
  257. _hoisted_11$6,
  258. vue.createElementVNode("div", _hoisted_12$6, [
  259. _hoisted_13$6,
  260. vue.createElementVNode("div", {
  261. class: vue.normalizeClass(["switch gray", { active: $data.config.clickPostItemOpenDetail, isNight: $options.isNight }]),
  262. onClick: _cache[4] || (_cache[4] = ($event) => $data.config.clickPostItemOpenDetail = !$data.config.clickPostItemOpenDetail)
  263. }, null, 2)
  264. ]),
  265. _hoisted_14$6,
  266. _hoisted_15$6,
  267. vue.createElementVNode("div", _hoisted_16$5, [
  268. _hoisted_17$5,
  269. vue.createElementVNode("div", {
  270. class: vue.normalizeClass(["radio-group2", { isNight: $options.isNight }])
  271. }, [
  272. vue.createVNode(_component_Tooltip, { title: "不隐藏@用户" }, {
  273. default: vue.withCtx(() => [
  274. vue.createElementVNode("div", {
  275. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === 0 ? "active" : ""]),
  276. onClick: _cache[5] || (_cache[5] = ($event) => $data.config.commentDisplayType = 0)
  277. }, "楼中楼(@) ", 2)
  278. ]),
  279. _: 1
  280. }),
  281. vue.createVNode(_component_Tooltip, { title: "隐藏第一个@用户,双击内容可显示原文" }, {
  282. default: vue.withCtx(() => [
  283. vue.createElementVNode("div", {
  284. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === 4 ? "active" : ""]),
  285. onClick: _cache[6] || (_cache[6] = ($event) => $data.config.commentDisplayType = 4)
  286. }, "楼中楼 ", 2)
  287. ]),
  288. _: 1
  289. }),
  290. vue.createElementVNode("div", {
  291. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === 1 ? "active" : ""]),
  292. onClick: _cache[7] || (_cache[7] = ($event) => $data.config.commentDisplayType = 1)
  293. }, "感谢 ", 2),
  294. vue.createElementVNode("div", {
  295. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === 3 ? "active" : ""]),
  296. onClick: _cache[8] || (_cache[8] = ($event) => $data.config.commentDisplayType = 3)
  297. }, "只看楼主 ", 2),
  298. vue.createElementVNode("div", {
  299. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === 2 ? "active" : ""]),
  300. onClick: _cache[9] || (_cache[9] = ($event) => $data.config.commentDisplayType = 2)
  301. }, "V2原版 ", 2)
  302. ], 2)
  303. ]),
  304. vue.createElementVNode("div", _hoisted_18$4, [
  305. _hoisted_19$4,
  306. vue.createElementVNode("div", {
  307. class: vue.normalizeClass(["switch gray", { active: $data.config.autoOpenDetail, isNight: $options.isNight }]),
  308. onClick: _cache[10] || (_cache[10] = ($event) => $data.config.autoOpenDetail = !$data.config.autoOpenDetail)
  309. }, null, 2)
  310. ]),
  311. _hoisted_20$4,
  312. vue.createElementVNode("div", _hoisted_21$3, [
  313. _hoisted_22$3,
  314. vue.createElementVNode("div", {
  315. class: vue.normalizeClass(["switch gray", { active: $data.config.closePostDetailBySpace, isNight: $options.isNight }]),
  316. onClick: _cache[11] || (_cache[11] = ($event) => $data.config.closePostDetailBySpace = !$data.config.closePostDetailBySpace)
  317. }, null, 2)
  318. ]),
  319. _hoisted_23$2,
  320. vue.createElementVNode("div", _hoisted_24$3, [
  321. _hoisted_25$2,
  322. vue.createElementVNode("div", {
  323. class: vue.normalizeClass(["switch gray", { active: $data.config.showTopReply, isNight: $options.isNight }]),
  324. onClick: _cache[12] || (_cache[12] = ($event) => $data.config.showTopReply = !$data.config.showTopReply)
  325. }, null, 2)
  326. ]),
  327. vue.createElementVNode("div", _hoisted_26$2, [
  328. _hoisted_27$2,
  329. vue.withDirectives(vue.createElementVNode("input", {
  330. type: "number",
  331. min: "1",
  332. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.config.topReplyCount = $event)
  333. }, null, 512), [
  334. [vue.vModelText, $data.config.topReplyCount]
  335. ])
  336. ]),
  337. vue.createElementVNode("div", _hoisted_28$1, [
  338. _hoisted_29$1,
  339. vue.withDirectives(vue.createElementVNode("input", {
  340. type: "number",
  341. min: "1",
  342. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.config.topReplyLoveMinCount = $event)
  343. }, null, 512), [
  344. [vue.vModelText, $data.config.topReplyLoveMinCount]
  345. ])
  346. ]),
  347. _hoisted_30$1,
  348. vue.createElementVNode("div", _hoisted_31$1, [
  349. _hoisted_32$1,
  350. vue.createElementVNode("div", {
  351. class: vue.normalizeClass(["switch gray", { active: $data.config.rememberLastReadFloor, isNight: $options.isNight }]),
  352. onClick: _cache[15] || (_cache[15] = ($event) => {
  353. $data.config.rememberLastReadFloor = !$data.config.rememberLastReadFloor;
  354. $data.config.autoJumpLastReadFloor = false;
  355. })
  356. }, null, 2)
  357. ]),
  358. vue.createElementVNode("div", _hoisted_33$1, [
  359. _hoisted_34$1,
  360. vue.createElementVNode("div", {
  361. class: vue.normalizeClass(["switch gray", { active: $data.config.autoJumpLastReadFloor, isNight: $options.isNight }]),
  362. onClick: _cache[16] || (_cache[16] = ($event) => $data.config.autoJumpLastReadFloor = !$data.config.autoJumpLastReadFloor)
  363. }, null, 2)
  364. ])
  365. ]),
  366. vue.createElementVNode("div", _hoisted_35$1, [
  367. _hoisted_36$1,
  368. vue.createElementVNode("div", _hoisted_37, [
  369. _hoisted_38,
  370. vue.createElementVNode("div", {
  371. class: vue.normalizeClass(["switch gray", { active: $data.config.showToolbar, isNight: $options.isNight }]),
  372. onClick: _cache[17] || (_cache[17] = ($event) => $data.config.showToolbar = !$data.config.showToolbar)
  373. }, null, 2)
  374. ]),
  375. _hoisted_39,
  376. vue.createElementVNode("div", _hoisted_40, [
  377. _hoisted_41,
  378. vue.createElementVNode("div", {
  379. class: vue.normalizeClass(["switch gray", { active: $data.config.newTabOpen, isNight: $options.isNight }]),
  380. onClick: _cache[18] || (_cache[18] = ($event) => {
  381. $data.config.newTabOpen = !$data.config.newTabOpen;
  382. $data.config.clickPostItemOpenDetail = !$data.config.newTabOpen;
  383. })
  384. }, null, 2)
  385. ]),
  386. vue.createElementVNode("div", _hoisted_42, [
  387. _hoisted_43,
  388. vue.createElementVNode("div", {
  389. class: vue.normalizeClass(["switch gray", { active: $data.config.openTag, isNight: $options.isNight }]),
  390. onClick: _cache[19] || (_cache[19] = ($event) => $data.config.openTag = !$data.config.openTag)
  391. }, null, 2)
  392. ]),
  393. vue.createElementVNode("div", _hoisted_44, [
  394. _hoisted_45,
  395. vue.createElementVNode("div", {
  396. class: vue.normalizeClass(["switch gray", { active: $data.config.contentAutoCollapse, isNight: $options.isNight }]),
  397. onClick: _cache[20] || (_cache[20] = ($event) => $data.config.contentAutoCollapse = !$data.config.contentAutoCollapse)
  398. }, null, 2)
  399. ]),
  400. vue.createElementVNode("div", _hoisted_46, [
  401. _hoisted_47,
  402. vue.createElementVNode("div", {
  403. class: vue.normalizeClass(["switch gray", { active: $data.config.base64, isNight: $options.isNight }]),
  404. onClick: _cache[21] || (_cache[21] = ($event) => $data.config.base64 = !$data.config.base64)
  405. }, null, 2)
  406. ]),
  407. vue.createElementVNode("div", _hoisted_48, [
  408. _hoisted_49,
  409. vue.createElementVNode("div", {
  410. class: vue.normalizeClass(["switch gray", { active: $data.config.sov2ex, isNight: $options.isNight }]),
  411. onClick: _cache[22] || (_cache[22] = ($event) => $data.config.sov2ex = !$data.config.sov2ex)
  412. }, null, 2)
  413. ]),
  414. _hoisted_50,
  415. vue.createElementVNode("div", _hoisted_51, [
  416. _hoisted_52,
  417. vue.withDirectives(vue.createElementVNode("input", {
  418. type: "text",
  419. "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => $data.config.postWidth = $event)
  420. }, null, 512), [
  421. [vue.vModelText, $data.config.postWidth]
  422. ])
  423. ]),
  424. _hoisted_53,
  425. _hoisted_54,
  426. vue.createElementVNode("div", _hoisted_55, [
  427. _hoisted_56,
  428. vue.createElementVNode("div", {
  429. class: vue.normalizeClass(["switch gray", { active: $data.config.autoSignin, isNight: $options.isNight }]),
  430. onClick: _cache[24] || (_cache[24] = ($event) => $data.config.autoSignin = !$data.config.autoSignin)
  431. }, null, 2)
  432. ]),
  433. vue.createElementVNode("div", _hoisted_57, [
  434. _hoisted_58,
  435. vue.withDirectives(vue.createElementVNode("input", {
  436. type: "text",
  437. "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => $data.config.customBgColor = $event)
  438. }, null, 512), [
  439. [vue.vModelText, $data.config.customBgColor]
  440. ])
  441. ]),
  442. _hoisted_59,
  443. _hoisted_60,
  444. vue.createElementVNode("div", _hoisted_61, [
  445. _hoisted_62,
  446. vue.createElementVNode("div", {
  447. class: vue.normalizeClass(["switch gray", { active: $data.config.collectBrowserNotice, isNight: $options.isNight }]),
  448. onClick: _cache[26] || (_cache[26] = ($event) => $data.config.collectBrowserNotice = !$data.config.collectBrowserNotice)
  449. }, null, 2)
  450. ]),
  451. _hoisted_63
  452. ])
  453. ])
  454. ])
  455. ], 2)) : vue.createCommentVNode("", true)
  456. ]),
  457. _: 1
  458. });
  459. }
  460. const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$8], ["__scopeId", "data-v-c0f35f60"]]);
  461. const eventBus = {
  462. eventMap: /* @__PURE__ */ new Map(),
  463. on(eventType, cb) {
  464. let cbs = this.eventMap.get(eventType);
  465. if (cbs) {
  466. cbs.push(cb);
  467. } else {
  468. cbs = [cb];
  469. }
  470. this.eventMap.set(eventType, cbs);
  471. },
  472. emit(eventType, val) {
  473. let cbs = this.eventMap.get(eventType);
  474. if (cbs) {
  475. cbs.map((cb) => cb(val));
  476. }
  477. },
  478. off(eventType) {
  479. let cbs = this.eventMap.has(eventType);
  480. if (cbs) {
  481. this.eventMap.delete(eventType);
  482. }
  483. },
  484. clear() {
  485. this.eventMap = /* @__PURE__ */ new Map();
  486. }
  487. };
  488. const CMD = {
  489. SHOW_TOOLTIP: "SHOW_TOOLTIP",
  490. SHOW_MSG: "SHOW_MSG",
  491. SET_CALL: "SET_CALL",
  492. SHOW_CALL: "SHOW_CALL",
  493. REFRESH_ONCE: "REFRESH_ONCE",
  494. ADD_REPLY: "ADD_REPLY",
  495. IGNORE: "IGNORE",
  496. MERGE: "MERGE",
  497. REMOVE: "REMOVE",
  498. CHANGE_COMMENT_THANK: "CHANGE_COMMENT_THANK",
  499. CHANGE_POST_THANK: "CHANGE_POST_THANK",
  500. ADD_TAG: "ADD_TAG",
  501. REMOVE_TAG: "REMOVE_TAG",
  502. RELATION_REPLY: "RELATION_REPLY",
  503. JUMP: "JUMP",
  504. ADD_READ: "ADD_READ"
  505. };
  506. const _sfc_main$d = {
  507. name: "PopConfirm",
  508. props: {
  509. title: {
  510. type: String,
  511. default() {
  512. return "";
  513. }
  514. },
  515. disabled: {
  516. type: Boolean,
  517. default() {
  518. return false;
  519. }
  520. }
  521. },
  522. data() {
  523. return {
  524. show: false
  525. };
  526. },
  527. methods: {
  528. showPop(e) {
  529. if (this.disabled)
  530. return;
  531. let rect = e.target.getBoundingClientRect();
  532. this.show = true;
  533. vue.nextTick(() => {
  534. this.$refs.tip.style.top = rect.top + "px";
  535. this.$refs.tip.style.left = rect.left + rect.width / 2 - 50 + "px";
  536. });
  537. },
  538. confirm() {
  539. this.show = false;
  540. this.$emit("confirm");
  541. }
  542. }
  543. };
  544. const _hoisted_1$d = { class: "pop-confirm" };
  545. const _hoisted_2$c = {
  546. key: 0,
  547. ref: "tip",
  548. class: "pop-confirm-content"
  549. };
  550. const _hoisted_3$9 = { class: "text" };
  551. const _hoisted_4$7 = { class: "options" };
  552. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  553. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
  554. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  555. vue.createVNode(vue.Transition, null, {
  556. default: vue.withCtx(() => [
  557. $data.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$c, [
  558. vue.createElementVNode("div", _hoisted_3$9, vue.toDisplayString($props.title), 1),
  559. vue.createElementVNode("div", _hoisted_4$7, [
  560. vue.createElementVNode("div", {
  561. onClick: _cache[0] || (_cache[0] = ($event) => $data.show = false)
  562. }, "取消"),
  563. vue.createElementVNode("div", {
  564. class: "main",
  565. onClick: _cache[1] || (_cache[1] = (...args) => $options.confirm && $options.confirm(...args))
  566. }, "确认")
  567. ])
  568. ], 512)) : vue.createCommentVNode("", true)
  569. ]),
  570. _: 1
  571. })
  572. ])),
  573. vue.createElementVNode("span", {
  574. onClick: _cache[2] || (_cache[2] = (...args) => $options.showPop && $options.showPop(...args))
  575. }, [
  576. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  577. ])
  578. ]);
  579. }
  580. const PopConfirm = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$7], ["__scopeId", "data-v-8df5d12b"]]);
  581. const loveColor = "rgb(224,42,42)";
  582. const _sfc_main$c = {
  583. name: "Point",
  584. components: { PopConfirm },
  585. inject: ["post", "isLogin"],
  586. props: {
  587. item: {
  588. type: Object,
  589. default() {
  590. return {};
  591. }
  592. },
  593. full: {
  594. type: Boolean,
  595. default() {
  596. return true;
  597. }
  598. },
  599. apiUrl: ""
  600. },
  601. computed: {
  602. disabled() {
  603. return this.item.username === window.user.username || this.item.isThanked || !this.isLogin;
  604. }
  605. },
  606. methods: {
  607. getColor() {
  608. if (this.item.isThanked)
  609. return loveColor;
  610. return this.full ? loveColor : "#929596";
  611. },
  612. getIsFull() {
  613. if (this.item.isThanked)
  614. return loveColor;
  615. return this.full ? loveColor : "none";
  616. },
  617. thankError() {
  618. if (this.item.username === window.user.username) {
  619. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  620. }
  621. if (this.item.isThanked) {
  622. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  623. }
  624. if (!this.isLogin) {
  625. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录(不可用)!" });
  626. }
  627. },
  628. async thank() {
  629. this.$emit("addThank");
  630. let url = `${window.baseUrl}/thank/${this.apiUrl}?once=${this.post.once}`;
  631. $.post(url).then((res) => {
  632. if (!res.success) {
  633. this.$emit("recallThank");
  634. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  635. }
  636. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  637. }, (err) => {
  638. this.$emit("recallThank");
  639. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  640. eventBus.emit(CMD.REFRESH_ONCE);
  641. });
  642. }
  643. }
  644. };
  645. const _hoisted_1$c = { class: "point" };
  646. const _hoisted_2$b = ["fill", "stroke"];
  647. const _hoisted_3$8 = { class: "num" };
  648. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  649. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  650. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
  651. vue.createVNode(_component_PopConfirm, {
  652. disabled: $options.disabled,
  653. title: `确认花费 10 个铜币向 @${$props.item.username} 的这条回复发送感谢?`,
  654. onConfirm: $options.thank
  655. }, {
  656. default: vue.withCtx(() => [
  657. vue.createElementVNode("div", {
  658. class: "up",
  659. onClick: _cache[0] || (_cache[0] = (...args) => $options.thankError && $options.thankError(...args))
  660. }, [
  661. (vue.openBlock(), vue.createElementBlock("svg", {
  662. class: vue.normalizeClass({ disabled: $options.disabled }),
  663. width: "19",
  664. height: "19",
  665. viewBox: "0 0 48 48",
  666. fill: "none",
  667. xmlns: "http://www.w3.org/2000/svg"
  668. }, [
  669. vue.createElementVNode("path", {
  670. d: "M15 8C8.92487 8 4 12.9249 4 19C4 30 17 40 24 42.3262C31 40 44 30 44 19C44 12.9249 39.0751 8 33 8C29.2797 8 25.9907 9.8469 24 12.6738C22.0093 9.8469 18.7203 8 15 8Z",
  671. fill: $options.getIsFull(),
  672. stroke: $options.getColor(),
  673. "stroke-width": "2",
  674. "stroke-linecap": "round",
  675. "stroke-linejoin": "round"
  676. }, null, 8, _hoisted_2$b)
  677. ], 2))
  678. ])
  679. ]),
  680. _: 1
  681. }, 8, ["disabled", "title", "onConfirm"]),
  682. vue.createElementVNode("div", _hoisted_3$8, vue.toDisplayString($props.item.thankCount ? $props.item.thankCount : "感谢"), 1)
  683. ]);
  684. }
  685. const Point = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$6], ["__scopeId", "data-v-810a119b"]]);
  686. const _sfc_main$b = {
  687. name: "Author",
  688. components: { PopConfirm, Point },
  689. inject: ["isLogin", "tags", "config"],
  690. props: {
  691. modelValue: false,
  692. comment: {
  693. type: Object,
  694. default() {
  695. return {};
  696. }
  697. },
  698. type: {
  699. type: String,
  700. default() {
  701. return "list";
  702. }
  703. }
  704. },
  705. computed: {
  706. isDev() {
  707. return false;
  708. },
  709. pointInfo() {
  710. return {
  711. isThanked: this.comment.isThanked,
  712. thankCount: this.comment.thankCount,
  713. username: this.comment.username
  714. };
  715. },
  716. myTags() {
  717. return this.tags[this.comment.username] ?? [];
  718. },
  719. context() {
  720. return this.comment.replyUsers.length;
  721. }
  722. },
  723. methods: {
  724. jump() {
  725. eventBus.emit(CMD.JUMP, this.comment.floor);
  726. },
  727. showRelationReply() {
  728. if (!this.comment.replyUsers.length) {
  729. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "该回复无上下文" });
  730. return;
  731. }
  732. eventBus.emit(CMD.RELATION_REPLY, {
  733. left: this.comment.replyUsers,
  734. right: this.comment.username,
  735. rightFloor: this.comment.floor
  736. });
  737. },
  738. addTag() {
  739. eventBus.emit(CMD.ADD_TAG, this.comment.username);
  740. },
  741. removeTag(tag) {
  742. eventBus.emit(CMD.REMOVE_TAG, { username: this.comment.username, tag });
  743. },
  744. checkIsLogin(emitName = "") {
  745. if (!this.isLogin) {
  746. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录(不可用)!" });
  747. return false;
  748. }
  749. this.$emit(emitName);
  750. return true;
  751. },
  752. addThank() {
  753. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "add" });
  754. },
  755. recallThank() {
  756. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "recall" });
  757. }
  758. }
  759. };
  760. const _withScopeId$7 = (n) => (vue.pushScopeId("data-v-07853933"), n = n(), vue.popScopeId(), n);
  761. const _hoisted_1$b = { class: "Author-left" };
  762. const _hoisted_2$a = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("path", {
  763. d: "M22 42H6V26",
  764. stroke: "#177EC9",
  765. "stroke-width": "4",
  766. "stroke-linecap": "round",
  767. "stroke-linejoin": "round"
  768. }, null, -1));
  769. const _hoisted_3$7 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("path", {
  770. d: "M26 6H42V22",
  771. stroke: "#177EC9",
  772. "stroke-width": "4",
  773. "stroke-linecap": "round",
  774. "stroke-linejoin": "round"
  775. }, null, -1));
  776. const _hoisted_4$6 = [
  777. _hoisted_2$a,
  778. _hoisted_3$7
  779. ];
  780. const _hoisted_5$6 = ["href"];
  781. const _hoisted_6$6 = ["src"];
  782. const _hoisted_7$5 = { class: "texts" };
  783. const _hoisted_8$5 = ["href"];
  784. const _hoisted_9$5 = {
  785. key: 0,
  786. class: "op"
  787. };
  788. const _hoisted_10$5 = {
  789. key: 1,
  790. class: "mod"
  791. };
  792. const _hoisted_11$5 = { class: "ago" };
  793. const _hoisted_12$5 = { class: "my-tag" };
  794. const _hoisted_13$5 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  795. const _hoisted_14$5 = ["onClick"];
  796. const _hoisted_15$5 = { class: "Author-right" };
  797. const _hoisted_16$4 = {
  798. key: 0,
  799. class: "toolbar"
  800. };
  801. const _hoisted_17$4 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "tool" }, [
  802. /* @__PURE__ */ vue.createElementVNode("span", null, "隐藏")
  803. ], -1));
  804. const _hoisted_18$3 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("span", null, "上下文", -1));
  805. const _hoisted_19$3 = [
  806. _hoisted_18$3
  807. ];
  808. const _hoisted_20$3 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  809. const _hoisted_21$2 = [
  810. _hoisted_20$3
  811. ];
  812. const _hoisted_22$2 = /* @__PURE__ */ vue.createStaticVNode('<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-07853933><path d="M4 6H44V36H29L24 41L19 36H4V6Z" fill="none" stroke="#929596" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-07853933></path><path d="M23 21H25.0025" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-07853933></path><path d="M33.001 21H34.9999" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-07853933></path><path d="M13.001 21H14.9999" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-07853933></path></svg><span data-v-07853933>回复</span>', 2);
  813. const _hoisted_24$2 = [
  814. _hoisted_22$2
  815. ];
  816. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  817. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  818. const _component_Point = vue.resolveComponent("Point");
  819. return vue.openBlock(), vue.createElementBlock("div", {
  820. class: vue.normalizeClass(["Author", { expand: !$props.modelValue }])
  821. }, [
  822. vue.createElementVNode("div", _hoisted_1$b, [
  823. !$props.modelValue ? (vue.openBlock(), vue.createElementBlock("svg", {
  824. key: 0,
  825. class: "expand-icon",
  826. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", true)),
  827. width: "24",
  828. height: "24",
  829. viewBox: "0 0 48 48",
  830. fill: "none",
  831. xmlns: "http://www.w3.org/2000/svg"
  832. }, _hoisted_4$6)) : vue.createCommentVNode("", true),
  833. vue.createElementVNode("a", {
  834. class: "avatar",
  835. href: `/member/${$props.comment.username}`
  836. }, [
  837. vue.createElementVNode("img", {
  838. src: $props.comment.avatar,
  839. alt: ""
  840. }, null, 8, _hoisted_6$6)
  841. ], 8, _hoisted_5$6),
  842. vue.createElementVNode("span", _hoisted_7$5, [
  843. vue.createElementVNode("strong", null, [
  844. vue.createElementVNode("a", {
  845. href: `/member/${$props.comment.username}`,
  846. class: "username"
  847. }, vue.toDisplayString($props.comment.username), 9, _hoisted_8$5)
  848. ]),
  849. $props.comment.isOp ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$5, "OP")) : vue.createCommentVNode("", true),
  850. $props.comment.isMod ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$5, "MOD")) : vue.createCommentVNode("", true),
  851. vue.createElementVNode("span", _hoisted_11$5, vue.toDisplayString($props.comment.date), 1),
  852. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
  853. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  854. return vue.openBlock(), vue.createElementBlock("span", _hoisted_12$5, [
  855. _hoisted_13$5,
  856. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  857. vue.createElementVNode("i", {
  858. class: "fa fa-trash-o remove",
  859. onClick: ($event) => $options.removeTag(i)
  860. }, null, 8, _hoisted_14$5)
  861. ]);
  862. }), 256)),
  863. vue.createElementVNode("span", {
  864. class: "add-tag ago",
  865. onClick: _cache[1] || (_cache[1] = (...args) => $options.addTag && $options.addTag(...args)),
  866. title: "添加标签"
  867. }, "+")
  868. ], 64)) : vue.createCommentVNode("", true)
  869. ])
  870. ]),
  871. vue.createElementVNode("div", _hoisted_15$5, [
  872. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$4, [
  873. vue.createVNode(_component_PopConfirm, {
  874. title: "确认隐藏这条回复?",
  875. onConfirm: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("hide"))
  876. }, {
  877. default: vue.withCtx(() => [
  878. _hoisted_17$4
  879. ]),
  880. _: 1
  881. }),
  882. $options.context ? (vue.openBlock(), vue.createElementBlock("div", {
  883. key: 0,
  884. class: "tool",
  885. onClick: _cache[3] || (_cache[3] = (...args) => $options.showRelationReply && $options.showRelationReply(...args))
  886. }, _hoisted_19$3)) : vue.createCommentVNode("", true),
  887. $props.type === "top" ? (vue.openBlock(), vue.createElementBlock("div", {
  888. key: 1,
  889. class: "tool",
  890. onClick: _cache[4] || (_cache[4] = (...args) => $options.jump && $options.jump(...args))
  891. }, _hoisted_21$2)) : vue.createCommentVNode("", true),
  892. vue.createElementVNode("div", {
  893. class: "tool",
  894. onClick: _cache[5] || (_cache[5] = ($event) => $options.checkIsLogin("reply"))
  895. }, _hoisted_24$2),
  896. vue.withDirectives(vue.createVNode(_component_Point, {
  897. item: $options.pointInfo,
  898. onAddThank: $options.addThank,
  899. onRecallThank: $options.recallThank,
  900. "api-url": "reply/" + $props.comment.id
  901. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  902. [vue.vShow, !$props.comment.thankCount]
  903. ])
  904. ])) : vue.createCommentVNode("", true),
  905. vue.withDirectives(vue.createVNode(_component_Point, {
  906. item: $options.pointInfo,
  907. onAddThank: $options.addThank,
  908. onRecallThank: $options.recallThank,
  909. "api-url": "reply/" + $props.comment.id
  910. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  911. [vue.vShow, $props.comment.thankCount]
  912. ]),
  913. vue.createElementVNode("div", {
  914. class: vue.normalizeClass(["floor", { isDev: $options.isDev }])
  915. }, vue.toDisplayString($options.isDev ? `a${$props.comment.floor}-` : $props.comment.floor), 3)
  916. ])
  917. ], 2);
  918. }
  919. const Author = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$5], ["__scopeId", "data-v-07853933"]]);
  920. const _withScopeId$6 = (n) => (vue.pushScopeId("data-v-502fb811"), n = n(), vue.popScopeId(), n);
  921. const _hoisted_1$a = { class: "get-cursor" };
  922. const _hoisted_2$9 = ["innerHTML"];
  923. const _hoisted_3$6 = { class: "toolbar" };
  924. const _hoisted_4$5 = { class: "left" };
  925. const _hoisted_5$5 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("path", {
  926. d: "M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",
  927. fill: "none",
  928. stroke: "#929596",
  929. "stroke-width": "2",
  930. "stroke-linejoin": "round"
  931. }, null, -1));
  932. const _hoisted_6$5 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("path", {
  933. d: "M24 35C29 35 31 31 31 31H17C17 31 19 35 24 35Z",
  934. stroke: "#929596",
  935. "stroke-width": "2",
  936. "stroke-linecap": "round",
  937. "stroke-linejoin": "round"
  938. }, null, -1));
  939. const _hoisted_7$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("path", {
  940. d: "M31 18V22",
  941. stroke: "#929596",
  942. "stroke-width": "2",
  943. "stroke-linecap": "round",
  944. "stroke-linejoin": "round"
  945. }, null, -1));
  946. const _hoisted_8$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("path", {
  947. d: "M17 18V22",
  948. stroke: "#929596",
  949. "stroke-width": "2",
  950. "stroke-linecap": "round",
  951. "stroke-linejoin": "round"
  952. }, null, -1));
  953. const _hoisted_9$4 = [
  954. _hoisted_5$5,
  955. _hoisted_6$5,
  956. _hoisted_7$4,
  957. _hoisted_8$4
  958. ];
  959. const _hoisted_10$4 = { class: "upload" };
  960. const _hoisted_11$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  961. width: "20",
  962. height: "20",
  963. viewBox: "0 0 48 48",
  964. fill: "none",
  965. xmlns: "http://www.w3.org/2000/svg"
  966. }, [
  967. /* @__PURE__ */ vue.createElementVNode("path", {
  968. "fill-rule": "evenodd",
  969. "clip-rule": "evenodd",
  970. d: "M5 10C5 8.89543 5.89543 8 7 8L41 8C42.1046 8 43 8.89543 43 10V38C43 39.1046 42.1046 40 41 40H7C5.89543 40 5 39.1046 5 38V10Z",
  971. stroke: "#929596",
  972. "stroke-width": "2",
  973. "stroke-linecap": "round",
  974. "stroke-linejoin": "round"
  975. }),
  976. /* @__PURE__ */ vue.createElementVNode("path", {
  977. "fill-rule": "evenodd",
  978. "clip-rule": "evenodd",
  979. d: "M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z",
  980. stroke: "#929596",
  981. "stroke-width": "2",
  982. "stroke-linecap": "round",
  983. "stroke-linejoin": "round"
  984. }),
  985. /* @__PURE__ */ vue.createElementVNode("path", {
  986. d: "M15 24L20 28L26 21L43 34V38C43 39.1046 42.1046 40 41 40H7C5.89543 40 5 39.1046 5 38V34L15 24Z",
  987. fill: "none",
  988. stroke: "#929596",
  989. "stroke-width": "2",
  990. "stroke-linejoin": "round"
  991. })
  992. ], -1));
  993. const _hoisted_12$4 = {
  994. key: 0,
  995. style: { "color": "black", "font-size": "1.4rem" }
  996. };
  997. const _hoisted_13$4 = { class: "right" };
  998. const _hoisted_14$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "经典表情", -1));
  999. const _hoisted_15$4 = { class: "list" };
  1000. const _hoisted_16$3 = ["src", "onClick"];
  1001. const _hoisted_17$3 = { class: "emoji" };
  1002. const _hoisted_18$2 = { class: "title" };
  1003. const _hoisted_19$2 = { class: "list" };
  1004. const _hoisted_20$2 = ["onClick"];
  1005. const _sfc_main$a = {
  1006. __name: "PostEditor",
  1007. props: {
  1008. replyUser: null,
  1009. replyFloor: null,
  1010. useType: {
  1011. type: String,
  1012. default() {
  1013. return "reply-comment";
  1014. }
  1015. }
  1016. },
  1017. emits: ["close"],
  1018. setup(__props, { expose, emit: emits }) {
  1019. const props = __props;
  1020. const { replyUser, replyFloor, useType } = props;
  1021. const replyInfo = replyUser ? `@${replyUser} #${replyFloor} ` : "";
  1022. const post = vue.inject("post");
  1023. const show = vue.inject("show");
  1024. const isNight = vue.inject("isNight");
  1025. vue.inject("pageType");
  1026. const allReplyUsers = vue.inject("allReplyUsers");
  1027. let isFocus = vue.ref(false);
  1028. const loading = vue.ref(false);
  1029. const uploadLoading = vue.ref(false);
  1030. const isShowEmoticons = vue.ref(false);
  1031. const editorId = vue.ref("editorId_" + Date.now());
  1032. const content = vue.ref(replyInfo);
  1033. const txtRef = vue.ref(null);
  1034. const cursorRef = vue.ref(null);
  1035. const emoticonsRef = vue.ref(null);
  1036. const none = vue.ref('<span style="white-space:pre-wrap;"> </span>');
  1037. const emojiEmoticons = [
  1038. {
  1039. title: "小黄脸",
  1040. list: [
  1041. "😀",
  1042. "😁",
  1043. "😂",
  1044. "🤣",
  1045. "😅",
  1046. "😊",
  1047. "😋",
  1048. "😘",
  1049. "🥰",
  1050. "😗",
  1051. "🤩",
  1052. "🤔",
  1053. "🤨",
  1054. "😐",
  1055. "😑",
  1056. "🙄",
  1057. "😏",
  1058. "😪",
  1059. "😫",
  1060. "🥱",
  1061. "😜",
  1062. "😒",
  1063. "😔",
  1064. "😨",
  1065. "😰",
  1066. "😱",
  1067. "🥵",
  1068. "😡",
  1069. "🥳",
  1070. "🥺",
  1071. "🤭",
  1072. "🧐",
  1073. "😎",
  1074. "🤓",
  1075. "😭",
  1076. "🤑",
  1077. "🤮"
  1078. ]
  1079. },
  1080. {
  1081. title: "手势",
  1082. list: [
  1083. "🙋",
  1084. "🙎",
  1085. "🙅",
  1086. "🙇",
  1087. "🤷",
  1088. "🤏",
  1089. "👉",
  1090. "✌️",
  1091. "🤘",
  1092. "🤙",
  1093. "👌",
  1094. "🤌",
  1095. "👍",
  1096. "👎",
  1097. "👋",
  1098. "🤝",
  1099. "🙏",
  1100. "👏"
  1101. ]
  1102. },
  1103. {
  1104. title: "庆祝",
  1105. list: ["✨", "🎉", "🎊"]
  1106. },
  1107. {
  1108. title: "其他",
  1109. list: ["👻", "🤡", "🐔", "👀", "💩", "🐴", "🦄", "🐧", "🐶", "🐒", "🙈", "🙉", "🙊", "🐵"]
  1110. }
  1111. ];
  1112. const classicsEmoticons = [
  1113. {
  1114. name: "[狗头]",
  1115. low: "https://i.imgur.com/io2SM1h.png",
  1116. high: "https://i.imgur.com/0icl60r.png"
  1117. },
  1118. {
  1119. name: "[马]",
  1120. low: "https://i.imgur.com/8EKZv7I.png",
  1121. high: "https://i.imgur.com/ANFUX52.png"
  1122. },
  1123. {
  1124. name: "[不高兴]",
  1125. low: "https://i.imgur.com/huX6coX.png",
  1126. high: "https://i.imgur.com/N7JEuvc.png"
  1127. },
  1128. {
  1129. name: "[呵呵]",
  1130. low: "https://i.imgur.com/RvoLAbX.png",
  1131. high: "https://i.imgur.com/xSzIqrK.png"
  1132. },
  1133. {
  1134. name: "[真棒]",
  1135. low: "https://i.imgur.com/xr1UOz1.png",
  1136. high: "https://i.imgur.com/w8YEw9Q.png"
  1137. },
  1138. {
  1139. name: "[鄙视]",
  1140. low: "https://i.imgur.com/u6jlqVq.png",
  1141. high: "https://i.imgur.com/8JFNANq.png"
  1142. },
  1143. {
  1144. name: "[疑问]",
  1145. low: "https://i.imgur.com/F29pmQ6.png",
  1146. high: "https://i.imgur.com/EbbTQAR.png"
  1147. },
  1148. {
  1149. name: "[吐舌]",
  1150. low: "https://i.imgur.com/InmIzl9.png",
  1151. high: "https://i.imgur.com/Ovj56Cd.png"
  1152. },
  1153. // {
  1154. // name: '[嘲笑]',
  1155. // low: 'https://i.imgur.com/BaWcsMR.png',
  1156. // high: 'https://i.imgur.com/0OGfJw4.png'
  1157. // },
  1158. // {
  1159. // name: '[滑稽]',
  1160. // low: 'https://i.imgur.com/lmbN0yI.png',
  1161. // high: 'https://i.imgur.com/Pc0wH85.png'
  1162. // },
  1163. {
  1164. name: "[笑眼]",
  1165. low: "https://i.imgur.com/ZveiiGy.png",
  1166. high: "https://i.imgur.com/PI1CfEr.png"
  1167. },
  1168. {
  1169. name: "[狂汗]",
  1170. low: "https://i.imgur.com/veWihk6.png",
  1171. high: "https://i.imgur.com/3LtHdQv.png"
  1172. },
  1173. {
  1174. name: "[大哭]",
  1175. low: "https://i.imgur.com/hu4oR6C.png",
  1176. high: "https://i.imgur.com/b4X9XLE.png"
  1177. },
  1178. {
  1179. name: "[喷]",
  1180. low: "https://i.imgur.com/bkw3VRr.png",
  1181. high: "https://i.imgur.com/wnZL13L.png"
  1182. },
  1183. {
  1184. name: "[苦笑]",
  1185. low: "https://i.imgur.com/VUWFktU.png",
  1186. high: "https://i.imgur.com/NAfspZ1.png"
  1187. },
  1188. {
  1189. name: "[喝酒]",
  1190. low: "https://i.imgur.com/2ZZSapE.png",
  1191. high: "https://i.imgur.com/rVbSVak.png"
  1192. },
  1193. {
  1194. name: "[吃瓜]",
  1195. low: "https://i.imgur.com/ee8Lq7H.png",
  1196. high: "https://i.imgur.com/0L26og9.png"
  1197. },
  1198. {
  1199. name: "[捂脸]",
  1200. low: "https://i.imgur.com/krir4IG.png",
  1201. high: "https://i.imgur.com/qqBqgVm.png"
  1202. },
  1203. {
  1204. name: "[呕]",
  1205. low: "https://i.imgur.com/6CUiUxv.png",
  1206. high: "https://i.imgur.com/kgdxRsG.png"
  1207. },
  1208. {
  1209. name: "[阴险]",
  1210. low: "https://i.imgur.com/MA8YqTP.png",
  1211. high: "https://i.imgur.com/e94jbaT.png"
  1212. },
  1213. {
  1214. name: "[怒]",
  1215. low: "https://i.imgur.com/n4kWfGB.png",
  1216. high: "https://i.imgur.com/iMXxNxh.png"
  1217. },
  1218. {
  1219. name: "[衰]",
  1220. low: "https://i.imgur.com/voHFDyQ.png",
  1221. high: "https://i.imgur.com/XffE6gu.png"
  1222. },
  1223. {
  1224. name: "[合十]",
  1225. low: "https://i.imgur.com/I8x3ang.png",
  1226. high: "https://i.imgur.com/T4rJVee.png"
  1227. },
  1228. {
  1229. name: "[赞]",
  1230. low: "https://i.imgur.com/lG44yUl.png",
  1231. high: "https://i.imgur.com/AoF5PLp.png"
  1232. },
  1233. {
  1234. name: "[踩]",
  1235. low: "https://i.imgur.com/cJp0uKZ.png",
  1236. high: "https://i.imgur.com/1XYGfXj.png"
  1237. },
  1238. {
  1239. name: "[爱心]",
  1240. low: "https://i.imgur.com/sLENaF5.png",
  1241. high: "https://i.imgur.com/dND56oX.png"
  1242. },
  1243. {
  1244. name: "[心碎]",
  1245. low: "https://i.imgur.com/AZxJzve.png",
  1246. high: "https://i.imgur.com/RiUsPci.png"
  1247. }
  1248. ];
  1249. const imgurClientIdPool = [
  1250. "3107b9ef8b316f3",
  1251. "442b04f26eefc8a",
  1252. "59cfebe717c09e4",
  1253. "60605aad4a62882",
  1254. "6c65ab1d3f5452a",
  1255. "83e123737849aa9",
  1256. "9311f6be1c10160",
  1257. "c4a4a563f698595",
  1258. "81be04b9e4a08ce"
  1259. ];
  1260. expose({ content });
  1261. const editorClass = vue.computed(() => {
  1262. return [useType, isFocus.value ? "isFocus" : "", isNight.value ? "isNight" : ""];
  1263. });
  1264. const cursorHtml = vue.computed(() => {
  1265. var _a;
  1266. if (!txtRef.value || !content.value)
  1267. return "";
  1268. let index2 = ((_a = txtRef.value) == null ? void 0 : _a.selectionStart) || 0;
  1269. return content.value.substring(0, index2).replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br/>").replace(/\s/g, none.value);
  1270. });
  1271. const disabled = vue.computed(() => {
  1272. if (content.value) {
  1273. return content.value === replyInfo;
  1274. } else {
  1275. return true;
  1276. }
  1277. });
  1278. function drop(e) {
  1279. e.preventDefault();
  1280. upload(e.dataTransfer.files[0]);
  1281. }
  1282. async function upload(file) {
  1283. if (!file)
  1284. return;
  1285. if (uploadLoading.value)
  1286. return;
  1287. uploadLoading.value = true;
  1288. const formData = new FormData();
  1289. formData.append("image", file);
  1290. const randomIndex = Math.floor(Math.random() * imgurClientIdPool.length);
  1291. const clidenId = imgurClientIdPool[randomIndex];
  1292. const res = await fetch("https://api.imgur.com/3/upload", {
  1293. method: "POST",
  1294. headers: { Authorization: `Client-ID ${clidenId}` },
  1295. body: formData
  1296. });
  1297. uploadLoading.value = false;
  1298. if (res.ok) {
  1299. const resData = await res.json();
  1300. if (resData.success) {
  1301. return insert(" " + resData.data.link + " ");
  1302. }
  1303. }
  1304. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "上传失败" });
  1305. }
  1306. async function submit() {
  1307. if (disabled.value || loading.value)
  1308. return;
  1309. loading.value = true;
  1310. let submit_content = content.value.replace(/\[((?!\[).)+\]/g, function(match) {
  1311. let item2 = classicsEmoticons.find((v) => v.name === match);
  1312. if (item2) {
  1313. return item2.low + " ";
  1314. }
  1315. return match;
  1316. });
  1317. let show_content = content.value.replace(/https?:\/\/(i\.)?imgur\.com\/((?!http).)+\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG)/g, function(match) {
  1318. return `<img src="${match}" data-originUrl="${match}" data-notice="这个img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`;
  1319. });
  1320. show_content = show_content.replace(/\[((?!\[).)+\]/g, function(match) {
  1321. let item2 = classicsEmoticons.find((v) => v.name === match);
  1322. if (item2) {
  1323. return `<a target="_blank" href="${item2.low}" rel="nofollow noopener"><img src="${item2.low}" class="embedded_image" rel="noreferrer"></a> `;
  1324. }
  1325. return match;
  1326. });
  1327. let matchUsers = show_content.match(/@([\w]+?[\s])/g);
  1328. if (matchUsers) {
  1329. matchUsers.map((i) => {
  1330. let username = i.replace("@", "").replace(" ", "");
  1331. show_content = show_content.replace(username, `<a href="/member/${username}">${username}</a>`);
  1332. });
  1333. }
  1334. show_content = show_content.replaceAll("\n", "<br/>");
  1335. console.log("show_content", show_content);
  1336. let item = {
  1337. thankCount: 0,
  1338. isThanked: false,
  1339. isOp: post.value.username === window.user.username,
  1340. id: Date.now(),
  1341. username: window.user.username,
  1342. avatar: window.user.avatar,
  1343. date: "几秒前",
  1344. floor: post.value.replyCount + 1,
  1345. reply_content: show_content ?? "",
  1346. children: [],
  1347. replyUsers: replyUser ? [replyUser] : [],
  1348. replyFloor: replyFloor || -1,
  1349. level: useType === "reply-comment" ? 1 : 0
  1350. };
  1351. item.hideCallUserReplyContent = item.reply_content;
  1352. if (item.replyUsers.length === 1) {
  1353. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  1354. }
  1355. let url = `${window.baseUrl}/t/${post.value.id}`;
  1356. $.post(url, { content: submit_content, once: post.value.once }).then(
  1357. (res) => {
  1358. loading.value = false;
  1359. let r = res.search("你上一条回复的内容和这条相同");
  1360. if (r > -1)
  1361. return eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你上一条回复的内容和这条相同" });
  1362. r = res.search("请不要在每一个回复中都包括外链,这看起来像是在 spamming");
  1363. if (r > -1)
  1364. return eventBus.emit(CMD.SHOW_MSG, {
  1365. type: "error",
  1366. text: "请不要在每一个回复中都包括外链,这看起来像是在 spamming"
  1367. });
  1368. let r2 = res.search("创建新回复");
  1369. if (r2 > -1) {
  1370. eventBus.emit(CMD.REFRESH_ONCE, res);
  1371. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复失败" });
  1372. let clientWidth = window.win().document.body.clientWidth;
  1373. let windowWidth = 1200;
  1374. let left = clientWidth / 2 - windowWidth / 2;
  1375. let newWin = window.win().open("about:blank", "hello", `width=${windowWidth},height=600,left=${left},top=100`);
  1376. newWin.document.write(res);
  1377. return;
  1378. }
  1379. content.value = replyInfo;
  1380. emits("close");
  1381. eventBus.emit(CMD.REFRESH_ONCE, res);
  1382. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "回复成功" });
  1383. eventBus.emit(CMD.ADD_REPLY, item);
  1384. },
  1385. (err) => {
  1386. console.log("err", err);
  1387. loading.value = false;
  1388. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复失败" });
  1389. }
  1390. ).catch((r) => {
  1391. console.log("cathc", r);
  1392. });
  1393. }
  1394. function showEmoticons(e) {
  1395. if (isShowEmoticons.value) {
  1396. return isShowEmoticons.value = false;
  1397. }
  1398. let rect = e.currentTarget.getBoundingClientRect();
  1399. emoticonsRef.value.style.left = rect.left + 30 + "px";
  1400. emoticonsRef.value.style.bottom = window.innerHeight - rect.top - 20 + "px";
  1401. isShowEmoticons.value = true;
  1402. }
  1403. function off() {
  1404. eventBus.emit(CMD.SHOW_CALL, { show: false });
  1405. eventBus.off(CMD.SET_CALL);
  1406. }
  1407. function checkHeight() {
  1408. txtRef.value.style.height = 0;
  1409. txtRef.value.style.height = txtRef.value.scrollHeight + "px";
  1410. }
  1411. function insert(str) {
  1412. let cursorPos = txtRef.value.selectionStart;
  1413. let start = content.value.slice(0, cursorPos);
  1414. let end = content.value.slice(cursorPos, content.value.length);
  1415. content.value = start + str + end;
  1416. let moveCursorPos = start.length + str.length;
  1417. setTimeout(() => {
  1418. txtRef.value.focus();
  1419. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  1420. checkHeight();
  1421. });
  1422. }
  1423. function showCallPopover(text) {
  1424. let r = cursorRef.value.getBoundingClientRect();
  1425. eventBus.emit(CMD.SHOW_CALL, { show: true, top: r.top, left: r.left, text });
  1426. eventBus.off(CMD.SET_CALL);
  1427. eventBus.on(CMD.SET_CALL, (e) => {
  1428. let cursorPos = txtRef.value.selectionStart;
  1429. let start = content.value.slice(0, cursorPos);
  1430. let end = content.value.slice(cursorPos, content.value.length);
  1431. let lastCallPos = start.lastIndexOf("@");
  1432. start = content.value.slice(0, lastCallPos + 1);
  1433. if (e === "管理员") {
  1434. e = "Livid @Kai @Olivia @GordianZ @sparanoid";
  1435. }
  1436. if (e === "所有人") {
  1437. e = allReplyUsers.value.map((v, i) => {
  1438. if (i)
  1439. return "@" + v;
  1440. else
  1441. return v;
  1442. }).join(" ");
  1443. }
  1444. content.value = start + e + " " + end;
  1445. let moveCursorPos = start.length + e.length + 1;
  1446. setTimeout(() => {
  1447. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  1448. checkHeight();
  1449. });
  1450. eventBus.off(CMD.SET_CALL);
  1451. });
  1452. }
  1453. function onKeydown(e) {
  1454. let code = e.keyCode;
  1455. switch (code) {
  1456. case 8:
  1457. if (content.value === "@") {
  1458. off();
  1459. }
  1460. break;
  1461. case 37:
  1462. case 38:
  1463. case 39:
  1464. case 40:
  1465. setTimeout(() => onInput({ data: "" }), 100);
  1466. break;
  1467. case 27:
  1468. e.preventDefault();
  1469. e.stopPropagation();
  1470. e.stopImmediatePropagation();
  1471. return false;
  1472. case 13:
  1473. if (e.ctrlKey)
  1474. submit();
  1475. break;
  1476. }
  1477. }
  1478. function onInput(e) {
  1479. let cursorPos = txtRef.value.selectionStart;
  1480. if (!content.value)
  1481. return;
  1482. if (e.data === " ") {
  1483. return off();
  1484. }
  1485. if (e.data === "@") {
  1486. if (content.value.length !== 1) {
  1487. if (content.value[cursorPos - 2] === " " || content.value[cursorPos - 2] === "\n") {
  1488. return showCallPopover("");
  1489. }
  1490. } else {
  1491. return showCallPopover("");
  1492. }
  1493. off();
  1494. } else {
  1495. let judgeStr = content.value.slice(0, cursorPos);
  1496. let lastCallPos = judgeStr.lastIndexOf("@");
  1497. if (lastCallPos === -1) {
  1498. return off();
  1499. }
  1500. let callStr = judgeStr.slice(lastCallPos, cursorPos);
  1501. let hasSpace = callStr.includes(" ");
  1502. if (hasSpace) {
  1503. off();
  1504. } else {
  1505. if (lastCallPos === 0) {
  1506. return showCallPopover(callStr.replace("@", ""));
  1507. }
  1508. if (content.value.length !== 1) {
  1509. if (content.value[lastCallPos - 1] === " " || content.value[lastCallPos - 1] === "\n") {
  1510. return showCallPopover(callStr.replace("@", ""));
  1511. }
  1512. } else {
  1513. return showCallPopover(callStr.replace("@", ""));
  1514. }
  1515. off();
  1516. }
  1517. }
  1518. }
  1519. function onPaste(e) {
  1520. const dataTransferItemList = e.clipboardData.items;
  1521. const items = [].slice.call(dataTransferItemList).filter(function(item) {
  1522. return item.type.indexOf("image") !== -1;
  1523. });
  1524. if (items.length === 0) {
  1525. return;
  1526. }
  1527. const dataTransferItem = items[0];
  1528. const blob = dataTransferItem.getAsFile();
  1529. upload(blob);
  1530. }
  1531. function onBlur() {
  1532. document.removeEventListener("paste", onPaste);
  1533. isFocus.value = false;
  1534. }
  1535. function onFocusin() {
  1536. document.addEventListener("paste", onPaste);
  1537. }
  1538. vue.watch(() => show, (n) => {
  1539. if (n.value)
  1540. isShowEmoticons.value = false;
  1541. }, { deep: true });
  1542. vue.onMounted(() => {
  1543. $(`.${editorId.value}`).each(function() {
  1544. this.setAttribute("style", "height:" + this.scrollHeight + "px;overflow-y:hidden;");
  1545. }).on("input", function() {
  1546. this.style.height = 0;
  1547. this.style.height = this.scrollHeight + "px";
  1548. });
  1549. if (useType === "reply-comment") {
  1550. txtRef.value && txtRef.value.focus();
  1551. }
  1552. });
  1553. vue.onBeforeUnmount(() => {
  1554. $(`.${editorId.value}`).off();
  1555. });
  1556. return (_ctx, _cache) => {
  1557. return vue.openBlock(), vue.createElementBlock("div", {
  1558. class: vue.normalizeClass(["post-editor-wrapper", vue.unref(editorClass)])
  1559. }, [
  1560. vue.withDirectives(vue.createElementVNode("textarea", {
  1561. class: vue.normalizeClass(["post-editor", editorId.value]),
  1562. ref_key: "txtRef",
  1563. ref: txtRef,
  1564. onFocus: _cache[0] || (_cache[0] = ($event) => vue.isRef(isFocus) ? isFocus.value = true : isFocus = true),
  1565. onBlur,
  1566. onFocusin,
  1567. placeholder: "请尽量让自己的回复能够对别人有帮助",
  1568. onInput,
  1569. onKeydown,
  1570. onDrop: drop,
  1571. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => content.value = $event)
  1572. }, null, 34), [
  1573. [vue.vModelText, content.value]
  1574. ]),
  1575. vue.createElementVNode("div", _hoisted_1$a, [
  1576. vue.createElementVNode("span", { innerHTML: vue.unref(cursorHtml) }, null, 8, _hoisted_2$9),
  1577. vue.createElementVNode("span", {
  1578. class: "cursor",
  1579. ref_key: "cursorRef",
  1580. ref: cursorRef
  1581. }, "|", 512)
  1582. ]),
  1583. vue.createElementVNode("div", _hoisted_3$6, [
  1584. vue.createElementVNode("div", _hoisted_4$5, [
  1585. (vue.openBlock(), vue.createElementBlock("svg", {
  1586. onClick: showEmoticons,
  1587. width: "20",
  1588. height: "20",
  1589. viewBox: "0 0 48 48",
  1590. fill: "none",
  1591. xmlns: "http://www.w3.org/2000/svg"
  1592. }, _hoisted_9$4)),
  1593. vue.createElementVNode("div", _hoisted_10$4, [
  1594. vue.createElementVNode("input", {
  1595. type: "file",
  1596. accept: "image/*",
  1597. onChange: _cache[2] || (_cache[2] = (e) => upload(e.currentTarget.files[0]))
  1598. }, null, 32),
  1599. _hoisted_11$4
  1600. ]),
  1601. uploadLoading.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_12$4, "上传中.....")) : vue.createCommentVNode("", true)
  1602. ]),
  1603. vue.createElementVNode("div", _hoisted_13$4, [
  1604. vue.unref(useType) === "reply-comment" ? (vue.openBlock(), vue.createElementBlock("span", {
  1605. key: 0,
  1606. style: { "margin-right": "1rem", "cursor": "pointer" },
  1607. onClick: _cache[3] || (_cache[3] = ($event) => emits("close"))
  1608. }, "关闭")) : vue.createCommentVNode("", true),
  1609. vue.createElementVNode("div", {
  1610. class: vue.normalizeClass(["button", { disabled: vue.unref(disabled), loading: loading.value }]),
  1611. onClick: submit
  1612. }, "回复 ", 2)
  1613. ])
  1614. ]),
  1615. vue.withDirectives(vue.createElementVNode("div", {
  1616. class: "emoticon-pack",
  1617. ref_key: "emoticonsRef",
  1618. ref: emoticonsRef
  1619. }, [
  1620. vue.createElementVNode("i", {
  1621. class: "fa fa-times",
  1622. "aria-hidden": "true",
  1623. onClick: _cache[4] || (_cache[4] = ($event) => isShowEmoticons.value = false)
  1624. }),
  1625. _hoisted_14$4,
  1626. vue.createElementVNode("div", _hoisted_15$4, [
  1627. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(classicsEmoticons, (item) => {
  1628. return vue.createElementVNode("img", {
  1629. src: item.high,
  1630. onClick: ($event) => {
  1631. insert(item.name);
  1632. isShowEmoticons.value = false;
  1633. }
  1634. }, null, 8, _hoisted_16$3);
  1635. }), 64))
  1636. ]),
  1637. vue.createElementVNode("div", _hoisted_17$3, [
  1638. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(emojiEmoticons, (item) => {
  1639. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  1640. vue.createElementVNode("div", _hoisted_18$2, vue.toDisplayString(item.title), 1),
  1641. vue.createElementVNode("div", _hoisted_19$2, [
  1642. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.list, (emoji) => {
  1643. return vue.openBlock(), vue.createElementBlock("span", {
  1644. onClick: ($event) => {
  1645. insert(emoji);
  1646. isShowEmoticons.value = false;
  1647. }
  1648. }, vue.toDisplayString(emoji), 9, _hoisted_20$2);
  1649. }), 256))
  1650. ])
  1651. ], 64);
  1652. }), 64))
  1653. ])
  1654. ], 512), [
  1655. [vue.vShow, isShowEmoticons.value]
  1656. ])
  1657. ], 2);
  1658. };
  1659. }
  1660. };
  1661. const PostEditor = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-502fb811"]]);
  1662. const _hoisted_1$9 = {
  1663. key: 0,
  1664. class: "html-wrapper"
  1665. };
  1666. const _hoisted_2$8 = ["innerHTML"];
  1667. const _sfc_main$9 = {
  1668. __name: "BaseHtmlRender",
  1669. props: ["html"],
  1670. setup(__props) {
  1671. const props = __props;
  1672. const config2 = vue.inject("config");
  1673. const contentRef = vue.ref(null);
  1674. const checkHeight = 900;
  1675. const mask = vue.ref(false);
  1676. const handOpen = vue.ref(false);
  1677. function mouseup(e) {
  1678. if (!config2.value.base64)
  1679. return;
  1680. let selectionText = window.win().getSelection().toString();
  1681. if (selectionText) {
  1682. let r = selectionText.match(/([A-Za-z0-9+/=]+)/g);
  1683. if (r) {
  1684. if (r[0].length < 4)
  1685. return;
  1686. eventBus.emit(CMD.SHOW_TOOLTIP, { text: r[0], e });
  1687. }
  1688. }
  1689. }
  1690. vue.watch(config2.value, (newVale) => {
  1691. if (!newVale.contentAutoCollapse) {
  1692. mask.value = false;
  1693. }
  1694. });
  1695. vue.watch([() => contentRef.value, () => props.html], () => {
  1696. if (!contentRef.value || !props.html)
  1697. return;
  1698. if (!config2.value.contentAutoCollapse)
  1699. return;
  1700. contentRef.value.querySelectorAll("img").forEach((item) => {
  1701. item.removeEventListener("load", checkContentHeight);
  1702. item.addEventListener("load", checkContentHeight);
  1703. });
  1704. checkContentHeight();
  1705. }, { immediate: true, flush: "post" });
  1706. function checkContentHeight() {
  1707. if (handOpen.value)
  1708. return;
  1709. let rect = contentRef.value.getBoundingClientRect();
  1710. mask.value = rect.height >= checkHeight;
  1711. }
  1712. return (_ctx, _cache) => {
  1713. return props.html ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
  1714. vue.createElementVNode("div", {
  1715. class: vue.normalizeClass({ mask: mask.value })
  1716. }, [
  1717. vue.createElementVNode("div", {
  1718. ref_key: "contentRef",
  1719. ref: contentRef,
  1720. innerHTML: props.html,
  1721. onMouseup: mouseup
  1722. }, null, 40, _hoisted_2$8)
  1723. ], 2),
  1724. mask.value ? (vue.openBlock(), vue.createElementBlock("div", {
  1725. key: 0,
  1726. class: "expand",
  1727. onClick: _cache[0] || (_cache[0] = ($event) => {
  1728. mask.value = false;
  1729. handOpen.value = true;
  1730. })
  1731. }, "展开")) : vue.createCommentVNode("", true)
  1732. ])) : vue.createCommentVNode("", true);
  1733. };
  1734. }
  1735. };
  1736. const BaseHtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-8ffbfeb2"]]);
  1737. const _sfc_main$8 = {
  1738. name: "Comment",
  1739. components: { BaseHtmlRender, Author, PostEditor, Point },
  1740. inject: ["post", "postDetailWidth", "show", "isNight", "config"],
  1741. props: {
  1742. modelValue: {
  1743. reply_content: ""
  1744. },
  1745. type: {
  1746. type: String,
  1747. default() {
  1748. return "list";
  1749. }
  1750. }
  1751. },
  1752. data() {
  1753. return {
  1754. showOrigin: false,
  1755. edit: false,
  1756. ding: false,
  1757. expand: true,
  1758. expandWrong: false,
  1759. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  1760. cssStyle: null,
  1761. floor: this.modelValue.floor
  1762. };
  1763. },
  1764. watch: {
  1765. show(e) {
  1766. if (e) {
  1767. this.edit = false;
  1768. }
  1769. },
  1770. postDetailWidth(n, o) {
  1771. this.checkIsTooLong(n);
  1772. }
  1773. },
  1774. computed: {
  1775. myClass() {
  1776. return {
  1777. isOp: this.modelValue.isOp,
  1778. ding: this.ding,
  1779. isLevelOne: this.modelValue.level === 0,
  1780. ["c_" + this.floor]: this.type !== "top"
  1781. };
  1782. }
  1783. },
  1784. mounted() {
  1785. this.checkIsTooLong(this.postDetailWidth);
  1786. },
  1787. methods: {
  1788. checkIsTooLong(postDetailWidth) {
  1789. if (postDetailWidth !== 0) {
  1790. let rect = this.$refs.comment.getBoundingClientRect();
  1791. let ban = postDetailWidth / 2;
  1792. console.log("ban", ban);
  1793. if (ban < rect.width && rect.width < ban + 25 && this.modelValue.children.length) {
  1794. this.expand = false;
  1795. let padding = 2;
  1796. this.cssStyle = {
  1797. padding: "1rem 0",
  1798. width: `calc(${postDetailWidth}px - ${padding}rem)`,
  1799. transform: `translateX(calc(${rect.width - postDetailWidth}px + ${padding}rem))`,
  1800. background: this.isNight ? "#18222d" : "white"
  1801. };
  1802. }
  1803. }
  1804. },
  1805. //高亮一下
  1806. showDing() {
  1807. this.ding = true;
  1808. setTimeout(() => {
  1809. this.ding = false;
  1810. }, 2e3);
  1811. },
  1812. hide() {
  1813. let url = `${window.baseUrl}/ignore/reply/${this.modelValue.id}?once=${this.post.once}`;
  1814. eventBus.emit(CMD.REMOVE, this.modelValue.floor);
  1815. $.post(url).then((res) => {
  1816. eventBus.emit(CMD.REFRESH_ONCE);
  1817. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "隐藏成功" });
  1818. }, (err) => {
  1819. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "隐藏成功,仅本次有效(接口调用失败!)" });
  1820. });
  1821. },
  1822. toggle() {
  1823. this.expand = !this.expand;
  1824. },
  1825. toggleContent() {
  1826. if (this.modelValue.level === 0)
  1827. return;
  1828. this.showOrigin = !this.showOrigin;
  1829. }
  1830. }
  1831. };
  1832. const _withScopeId$5 = (n) => (vue.pushScopeId("data-v-62148878"), n = n(), vue.popScopeId(), n);
  1833. const _hoisted_1$8 = ["data-floor"];
  1834. const _hoisted_2$7 = { class: "comment-content" };
  1835. const _hoisted_3$5 = { class: "right" };
  1836. const _hoisted_4$4 = { class: "w" };
  1837. const _hoisted_5$4 = {
  1838. key: 0,
  1839. class: "wrong-wrapper"
  1840. };
  1841. const _hoisted_6$4 = ["href"];
  1842. const _hoisted_7$3 = { class: "del-line" };
  1843. const _hoisted_8$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("i", {
  1844. class: "fa fa-question-circle-o wrong-icon",
  1845. "aria-hidden": "true"
  1846. }, null, -1));
  1847. const _hoisted_9$3 = {
  1848. key: 0,
  1849. class: "warning"
  1850. };
  1851. const _hoisted_10$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1852. const _hoisted_11$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1853. const _hoisted_12$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1854. const _hoisted_13$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1855. const _hoisted_14$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1856. const _hoisted_15$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("a", {
  1857. href: "https://github.com/zyronon/v2ex-script/discussions/7",
  1858. target: "_blank"
  1859. }, "这里", -1));
  1860. const _hoisted_16$2 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("p", null, "---原文---", -1));
  1861. const _hoisted_17$2 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("p", null, "-----------", -1));
  1862. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  1863. const _component_Author = vue.resolveComponent("Author");
  1864. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  1865. const _component_PostEditor = vue.resolveComponent("PostEditor");
  1866. const _component_Comment = vue.resolveComponent("Comment", true);
  1867. return vue.openBlock(), vue.createElementBlock("div", {
  1868. class: vue.normalizeClass(["comment", $options.myClass]),
  1869. ref: "comment",
  1870. "data-floor": $data.floor
  1871. }, [
  1872. vue.createVNode(_component_Author, {
  1873. modelValue: $data.expand,
  1874. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  1875. comment: $props.modelValue,
  1876. onReply: _cache[1] || (_cache[1] = ($event) => $data.edit = !$data.edit),
  1877. type: $props.type,
  1878. onHide: $options.hide
  1879. }, null, 8, ["modelValue", "comment", "type", "onHide"]),
  1880. $data.cssStyle && !$data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  1881. key: 0,
  1882. class: "more ago",
  1883. onClick: _cache[2] || (_cache[2] = ($event) => $data.expand = !$data.expand)
  1884. }, " 由于嵌套回复层级太深,自动将后续回复隐藏 ")) : vue.createCommentVNode("", true),
  1885. $data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  1886. key: 1,
  1887. class: "comment-content-w",
  1888. style: vue.normalizeStyle($data.cssStyle)
  1889. }, [
  1890. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  1891. key: 0,
  1892. class: "more ago",
  1893. onClick: _cache[3] || (_cache[3] = ($event) => $data.expand = !$data.expand)
  1894. }, " 由于嵌套回复层级太深,自动将以下回复移至可见范围 ")) : vue.createCommentVNode("", true),
  1895. vue.createElementVNode("div", _hoisted_2$7, [
  1896. vue.createElementVNode("div", {
  1897. class: "left expand-line",
  1898. onClick: _cache[4] || (_cache[4] = (...args) => $options.toggle && $options.toggle(...args))
  1899. }),
  1900. vue.createElementVNode("div", _hoisted_3$5, [
  1901. vue.createElementVNode("div", _hoisted_4$4, [
  1902. $props.modelValue.isWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
  1903. vue.createElementVNode("span", {
  1904. onClick: _cache[5] || (_cache[5] = ($event) => $data.expandWrong = !$data.expandWrong),
  1905. title: "点击楼层号查看提示"
  1906. }, [
  1907. vue.createElementVNode("a", {
  1908. href: "/member/" + $props.modelValue.replyUsers[0]
  1909. }, "@" + vue.toDisplayString($props.modelValue.replyUsers[0]) + "  ", 9, _hoisted_6$4),
  1910. vue.createElementVNode("span", _hoisted_7$3, "#" + vue.toDisplayString($props.modelValue.replyFloor), 1),
  1911. _hoisted_8$3
  1912. ]),
  1913. $data.expandWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$3, [
  1914. vue.createTextVNode(" 这条回复似乎有点问题,指定的楼层号与@的人对应不上 "),
  1915. _hoisted_10$3,
  1916. vue.createTextVNode(" 原因可能有下面几种: "),
  1917. _hoisted_11$3,
  1918. vue.createTextVNode(" 一、屏蔽用户导致楼层塌陷:你屏蔽了A,自A以后的回复的楼层号都会减1 "),
  1919. _hoisted_12$3,
  1920. vue.createTextVNode(" 二、忽略回复导致楼层塌陷:原理同上 "),
  1921. _hoisted_13$3,
  1922. vue.createTextVNode(" 三、层主回复时指定错了楼层号(同一,层主屏蔽了别人,导致楼层塌陷) "),
  1923. _hoisted_14$3,
  1924. vue.createTextVNode(" 四、脚本解析错误,请在"),
  1925. _hoisted_15$3,
  1926. vue.createTextVNode("反馈 ")
  1927. ])) : vue.createCommentVNode("", true)
  1928. ])) : vue.createCommentVNode("", true),
  1929. $options.config.commentDisplayType === 4 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  1930. $data.showOrigin ? (vue.openBlock(), vue.createElementBlock("div", {
  1931. key: 0,
  1932. onDblclick: _cache[6] || (_cache[6] = (...args) => $options.toggleContent && $options.toggleContent(...args))
  1933. }, [
  1934. _hoisted_16$2,
  1935. vue.createVNode(_component_BaseHtmlRender, {
  1936. class: "reply_content",
  1937. html: $props.modelValue.reply_content
  1938. }, null, 8, ["html"]),
  1939. _hoisted_17$2
  1940. ], 32)) : vue.createCommentVNode("", true),
  1941. vue.createVNode(_component_BaseHtmlRender, {
  1942. class: "reply_content",
  1943. onDblclick: $options.toggleContent,
  1944. html: $props.modelValue.hideCallUserReplyContent
  1945. }, null, 8, ["onDblclick", "html"])
  1946. ], 64)) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  1947. key: 2,
  1948. class: "reply_content",
  1949. html: $props.modelValue.reply_content
  1950. }, null, 8, ["html"])),
  1951. $data.edit ? (vue.openBlock(), vue.createBlock(_component_PostEditor, {
  1952. key: 3,
  1953. onClose: _cache[7] || (_cache[7] = ($event) => $data.edit = false),
  1954. replyInfo: $data.replyInfo,
  1955. replyUser: $props.modelValue.username,
  1956. replyFloor: $props.modelValue.floor
  1957. }, null, 8, ["replyInfo", "replyUser", "replyFloor"])) : vue.createCommentVNode("", true)
  1958. ]),
  1959. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index2) => {
  1960. return vue.openBlock(), vue.createBlock(_component_Comment, {
  1961. modelValue: $props.modelValue.children[index2],
  1962. "onUpdate:modelValue": ($event) => $props.modelValue.children[index2] = $event,
  1963. key: index2
  1964. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  1965. }), 128))
  1966. ])
  1967. ]),
  1968. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  1969. key: 1,
  1970. class: "more ago",
  1971. onClick: _cache[8] || (_cache[8] = ($event) => $data.expand = !$data.expand)
  1972. }, " 由于嵌套回复层级太深,自动将以上回复移至可见范围 ")) : vue.createCommentVNode("", true)
  1973. ], 4)) : vue.createCommentVNode("", true)
  1974. ], 10, _hoisted_1$8);
  1975. }
  1976. const Comment = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$4], ["__scopeId", "data-v-62148878"]]);
  1977. const _sfc_main$7 = {
  1978. name: "Toolbar",
  1979. inject: [
  1980. "isLogin",
  1981. "post",
  1982. "pageType"
  1983. ],
  1984. data() {
  1985. return {
  1986. timer: null,
  1987. loading: false,
  1988. loading2: false,
  1989. loading3: false
  1990. };
  1991. },
  1992. methods: {
  1993. checkIsLogin(emitName = "") {
  1994. if (!this.isLogin) {
  1995. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录(不可用)!" });
  1996. return false;
  1997. }
  1998. this.$emit(emitName);
  1999. return true;
  2000. },
  2001. getColor(val) {
  2002. return val ? "#ff4500" : "#929596";
  2003. },
  2004. getIsFull(val) {
  2005. return val ? "#ff4500" : "none";
  2006. },
  2007. tweet() {
  2008. if (!this.checkIsLogin())
  2009. return;
  2010. let username = window.user.username;
  2011. let url = `https://twitter.com/intent/tweet?url=${window.baseUrl}/t/${this.post.id}?r=${username}&related=v2ex&text=${this.post.title}`;
  2012. window.win().open(url, "_blank", "width=550,height=370");
  2013. },
  2014. report() {
  2015. if (!this.checkIsLogin())
  2016. return;
  2017. if (!this.isLogin)
  2018. return;
  2019. if (this.post.isReport)
  2020. return;
  2021. let username = window.user.username;
  2022. let url = `https://twitter.com/share?url=${window.baseUrl}/t/${this.post.id}?r=${username}&amp;related=v2ex&amp;hashtags=apple&amp;text=${this.post.title}`;
  2023. window.win().open(url, "_blank", "width=550,height=370");
  2024. },
  2025. async toggleIgnore() {
  2026. if (!this.checkIsLogin())
  2027. return;
  2028. let url = `${window.baseUrl}/${this.post.isIgnore ? "unignore" : "ignore"}/topic/${this.post.id}?once=${this.post.once}`;
  2029. if (this.pageType === "post") {
  2030. this.loading2 = true;
  2031. let apiRes = await window.win().fetch(url);
  2032. if (apiRes.redirected) {
  2033. if (!this.post.isIgnore) {
  2034. window.win().location = window.baseUrl;
  2035. }
  2036. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  2037. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  2038. } else {
  2039. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略失败" });
  2040. }
  2041. this.loading2 = false;
  2042. } else {
  2043. if (this.post.isIgnore) {
  2044. this.loading2 = true;
  2045. } else {
  2046. eventBus.emit(CMD.IGNORE);
  2047. }
  2048. let apiRes = await window.win().fetch(url);
  2049. if (apiRes.redirected) {
  2050. if (this.post.isIgnore) {
  2051. eventBus.emit(CMD.REFRESH_ONCE);
  2052. }
  2053. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  2054. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  2055. } else {
  2056. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略成功,仅本次有效(接口调用失败!)" });
  2057. }
  2058. this.loading2 = false;
  2059. }
  2060. },
  2061. async toggleFavorite() {
  2062. if (!this.post.isFavorite && config.collectBrowserNotice) {
  2063. alert("请按Command/Cmd/CTRL + D添加到书签");
  2064. }
  2065. if (!this.checkIsLogin())
  2066. return;
  2067. this.loading = true;
  2068. let url = `${window.baseUrl}/${this.post.isFavorite ? "unfavorite" : "favorite"}/topic/${this.post.id}?once=${this.post.once}`;
  2069. let apiRes = await window.win().fetch(url);
  2070. this.loading = false;
  2071. if (apiRes.redirected) {
  2072. let htmlText = await apiRes.text();
  2073. if (htmlText.search(this.post.isFavorite ? "加入收藏" : "取消收藏")) {
  2074. eventBus.emit(CMD.MERGE, { collectCount: this.post.isFavorite ? this.post.collectCount - 1 : this.post.collectCount + 1 });
  2075. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isFavorite ? "取消成功" : "收藏成功" });
  2076. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  2077. eventBus.emit(CMD.MERGE, { isFavorite: !this.post.isFavorite });
  2078. return;
  2079. }
  2080. }
  2081. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败" });
  2082. }
  2083. }
  2084. };
  2085. const _withScopeId$4 = (n) => (vue.pushScopeId("data-v-07fa3ae8"), n = n(), vue.popScopeId(), n);
  2086. const _hoisted_1$7 = { class: "toolbar" };
  2087. const _hoisted_2$6 = /* @__PURE__ */ vue.createStaticVNode('<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-07fa3ae8><path d="M4 6H44V36H29L24 41L19 36H4V6Z" fill="none" stroke="#929596" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-07fa3ae8></path><path d="M23 21H25.0025" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-07fa3ae8></path><path d="M33.001 21H34.9999" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-07fa3ae8></path><path d="M13.001 21H14.9999" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-07fa3ae8></path></svg><span data-v-07fa3ae8>回复</span>', 2);
  2088. const _hoisted_4$3 = [
  2089. _hoisted_2$6
  2090. ];
  2091. const _hoisted_5$3 = {
  2092. viewBox: "0 0 48 48",
  2093. fill: "none",
  2094. xmlns: "http://www.w3.org/2000/svg"
  2095. };
  2096. const _hoisted_6$3 = ["fill", "stroke"];
  2097. const _hoisted_7$2 = {
  2098. key: 1,
  2099. class: "tool no-hover"
  2100. };
  2101. const _hoisted_8$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  2102. viewBox: "0 0 48 48",
  2103. fill: "none",
  2104. xmlns: "http://www.w3.org/2000/svg"
  2105. }, [
  2106. /* @__PURE__ */ vue.createElementVNode("path", {
  2107. d: "M28 6H42V20",
  2108. stroke: "#929596",
  2109. "stroke-width": "2",
  2110. "stroke-linecap": "round",
  2111. "stroke-linejoin": "round"
  2112. }),
  2113. /* @__PURE__ */ vue.createElementVNode("path", {
  2114. d: "M42 29.4737V39C42 40.6569 40.6569 42 39 42H9C7.34315 42 6 40.6569 6 39V9C6 7.34315 7.34315 6 9 6L18 6",
  2115. stroke: "#929596",
  2116. "stroke-width": "2",
  2117. "stroke-linecap": "round",
  2118. "stroke-linejoin": "round"
  2119. }),
  2120. /* @__PURE__ */ vue.createElementVNode("path", {
  2121. d: "M25.7998 22.1999L41.0998 6.8999",
  2122. stroke: "#929596",
  2123. "stroke-width": "2",
  2124. "stroke-linecap": "round",
  2125. "stroke-linejoin": "round"
  2126. })
  2127. ], -1));
  2128. const _hoisted_9$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("span", null, "Tweet", -1));
  2129. const _hoisted_10$2 = [
  2130. _hoisted_8$2,
  2131. _hoisted_9$2
  2132. ];
  2133. const _hoisted_11$2 = {
  2134. viewBox: "0 0 48 48",
  2135. fill: "none",
  2136. xmlns: "http://www.w3.org/2000/svg"
  2137. };
  2138. const _hoisted_12$2 = ["fill", "stroke"];
  2139. const _hoisted_13$2 = ["fill", "stroke"];
  2140. const _hoisted_14$2 = ["fill", "stroke"];
  2141. const _hoisted_15$2 = /* @__PURE__ */ vue.createStaticVNode('<svg width="19" height="19" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-07fa3ae8><path d="M36 35H12V21C12 14.3726 17.3726 9 24 9C30.6274 9 36 14.3726 36 21V35Z" fill="#929596" stroke="#929596" stroke-width="4" stroke-linejoin="round" data-v-07fa3ae8></path><path d="M8 42H40" stroke="#929596" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-07fa3ae8></path><path d="M4 13L7 14" stroke="#929596" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-07fa3ae8></path><path d="M13 3.9999L14 6.9999" stroke="#929596" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-07fa3ae8></path><path d="M10.0001 9.99989L7.00009 6.99989" stroke="#929596" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-07fa3ae8></path></svg>', 1);
  2142. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  2143. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
  2144. vue.createElementVNode("div", {
  2145. class: "tool",
  2146. onClick: _cache[0] || (_cache[0] = ($event) => $options.checkIsLogin("reply"))
  2147. }, _hoisted_4$3),
  2148. $options.post.once ? (vue.openBlock(), vue.createElementBlock("div", {
  2149. key: 0,
  2150. class: vue.normalizeClass(["tool", { loading: $data.loading }]),
  2151. onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleFavorite && $options.toggleFavorite(...args))
  2152. }, [
  2153. (vue.openBlock(), vue.createElementBlock("svg", _hoisted_5$3, [
  2154. vue.createElementVNode("path", {
  2155. d: "M23.9986 5L17.8856 17.4776L4 19.4911L14.0589 29.3251L11.6544 43L23.9986 36.4192L36.3454 43L33.9586 29.3251L44 19.4911L30.1913 17.4776L23.9986 5Z",
  2156. fill: $options.getIsFull($options.post.isFavorite),
  2157. stroke: $options.getColor($options.post.isFavorite),
  2158. "stroke-width": "2",
  2159. "stroke-linejoin": "round"
  2160. }, null, 8, _hoisted_6$3)
  2161. ])),
  2162. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isFavorite ? "取消收藏" : "加入收藏"), 1)
  2163. ], 2)) : vue.createCommentVNode("", true),
  2164. $options.post.once && $options.post.collectCount !== 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, [
  2165. vue.createElementVNode("span", null, vue.toDisplayString($options.post.collectCount + "人收藏"), 1)
  2166. ])) : vue.createCommentVNode("", true),
  2167. vue.createElementVNode("div", {
  2168. class: "tool",
  2169. onClick: _cache[2] || (_cache[2] = (...args) => $options.tweet && $options.tweet(...args))
  2170. }, _hoisted_10$2),
  2171. $options.post.once ? (vue.openBlock(), vue.createElementBlock("div", {
  2172. key: 2,
  2173. class: vue.normalizeClass(["tool", { "loading": $data.loading2 }]),
  2174. onClick: _cache[3] || (_cache[3] = (...args) => $options.toggleIgnore && $options.toggleIgnore(...args))
  2175. }, [
  2176. (vue.openBlock(), vue.createElementBlock("svg", _hoisted_11$2, [
  2177. vue.createElementVNode("path", {
  2178. fill: $options.getIsFull($options.post.isIgnore),
  2179. stroke: $options.getColor($options.post.isIgnore),
  2180. d: "M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30",
  2181. "stroke-width": "2",
  2182. "stroke-linecap": "round",
  2183. "stroke-linejoin": "round"
  2184. }, null, 8, _hoisted_12$2),
  2185. vue.createElementVNode("path", {
  2186. fill: $options.getIsFull($options.post.isIgnore),
  2187. d: "M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705",
  2188. stroke: $options.getColor($options.post.isIgnore),
  2189. "stroke-width": "2",
  2190. "stroke-linecap": "round",
  2191. "stroke-linejoin": "round"
  2192. }, null, 8, _hoisted_13$2),
  2193. vue.createElementVNode("path", {
  2194. d: "M42 42L6 6",
  2195. fill: $options.getIsFull($options.post.isIgnore),
  2196. stroke: $options.getColor($options.post.isIgnore),
  2197. "stroke-width": "2",
  2198. "stroke-linecap": "round",
  2199. "stroke-linejoin": "round"
  2200. }, null, 8, _hoisted_14$2)
  2201. ])),
  2202. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isIgnore ? "取消忽略" : "忽略主题"), 1)
  2203. ], 2)) : vue.createCommentVNode("", true),
  2204. $options.post.once && $options.post.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  2205. key: 3,
  2206. class: vue.normalizeClass(["tool", { "loading": $data.loading3, "no-hover": $options.post.isLogin }]),
  2207. onClick: _cache[4] || (_cache[4] = (...args) => $options.report && $options.report(...args))
  2208. }, [
  2209. _hoisted_15$2,
  2210. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isReport ? "你已对本主题进行了报告" : "报告这个主题"), 1)
  2211. ], 2)) : vue.createCommentVNode("", true)
  2212. ]);
  2213. }
  2214. const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$3], ["__scopeId", "data-v-07fa3ae8"]]);
  2215. const _withScopeId$3 = (n) => (vue.pushScopeId("data-v-3eb530b9"), n = n(), vue.popScopeId(), n);
  2216. const _hoisted_1$6 = {
  2217. class: "comment",
  2218. ref: "comment"
  2219. };
  2220. const _hoisted_2$5 = ["href"];
  2221. const _hoisted_3$4 = ["src"];
  2222. const _hoisted_4$2 = { class: "texts" };
  2223. const _hoisted_5$2 = {
  2224. key: 0,
  2225. class: "point"
  2226. };
  2227. const _hoisted_6$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  2228. width: "19",
  2229. height: "19",
  2230. viewBox: "0 0 48 48",
  2231. fill: "none"
  2232. }, [
  2233. /* @__PURE__ */ vue.createElementVNode("path", {
  2234. d: "M15 8C8.92487 8 4 12.9249 4 19C4 30 17 40 24 42.3262C31 40 44 30 44 19C44 12.9249 39.0751 8 33 8C29.2797 8 25.9907 9.8469 24 12.6738C22.0093 9.8469 18.7203 8 15 8Z",
  2235. fill: "#E02A2A",
  2236. stroke: "#E02A2A",
  2237. "stroke-width": "2",
  2238. "stroke-linecap": "round",
  2239. "stroke-linejoin": "round"
  2240. })
  2241. ], -1));
  2242. const _hoisted_7$1 = { class: "num" };
  2243. const _hoisted_8$1 = { class: "my-tag" };
  2244. const _hoisted_9$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  2245. const _hoisted_10$1 = {
  2246. key: 2,
  2247. class: "ago"
  2248. };
  2249. const _hoisted_11$1 = {
  2250. key: 3,
  2251. class: "mod"
  2252. };
  2253. const _hoisted_12$1 = {
  2254. key: 4,
  2255. class: "op"
  2256. };
  2257. const _hoisted_13$1 = ["href"];
  2258. const _hoisted_14$1 = {
  2259. key: 5,
  2260. class: "op"
  2261. };
  2262. const _hoisted_15$1 = {
  2263. key: 6,
  2264. class: "mod"
  2265. };
  2266. const _hoisted_16$1 = {
  2267. key: 7,
  2268. class: "ago"
  2269. };
  2270. const _hoisted_17$1 = { class: "my-tag" };
  2271. const _hoisted_18$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  2272. const _hoisted_19$1 = {
  2273. key: 9,
  2274. class: "point"
  2275. };
  2276. const _hoisted_20$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  2277. width: "19",
  2278. height: "19",
  2279. viewBox: "0 0 48 48",
  2280. fill: "none"
  2281. }, [
  2282. /* @__PURE__ */ vue.createElementVNode("path", {
  2283. d: "M15 8C8.92487 8 4 12.9249 4 19C4 30 17 40 24 42.3262C31 40 44 30 44 19C44 12.9249 39.0751 8 33 8C29.2797 8 25.9907 9.8469 24 12.6738C22.0093 9.8469 18.7203 8 15 8Z",
  2284. fill: "#E02A2A",
  2285. stroke: "#E02A2A",
  2286. "stroke-width": "2",
  2287. "stroke-linecap": "round",
  2288. "stroke-linejoin": "round"
  2289. })
  2290. ], -1));
  2291. const _hoisted_21$1 = { class: "num" };
  2292. const _hoisted_22$1 = ["href"];
  2293. const _hoisted_23$1 = ["src"];
  2294. const _hoisted_24$1 = { class: "Author-right" };
  2295. const _hoisted_25$1 = { class: "floor" };
  2296. const _hoisted_26$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  2297. const _hoisted_27$1 = [
  2298. _hoisted_26$1
  2299. ];
  2300. const _sfc_main$6 = {
  2301. __name: "SingleComment",
  2302. props: {
  2303. comment: {
  2304. reply_content: ""
  2305. },
  2306. isRight: {
  2307. type: Boolean,
  2308. default() {
  2309. return false;
  2310. }
  2311. }
  2312. },
  2313. setup(__props) {
  2314. const props = __props;
  2315. const config2 = vue.inject("config");
  2316. const isLogin = vue.inject("isLogin");
  2317. const tags = vue.inject("tags");
  2318. const myTags = vue.computed(() => {
  2319. return tags[props.comment.username] ?? [];
  2320. });
  2321. function jump() {
  2322. eventBus.emit(CMD.JUMP, props.comment.floor);
  2323. }
  2324. return (_ctx, _cache) => {
  2325. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
  2326. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  2327. key: 0,
  2328. class: "avatar",
  2329. href: `/member/${__props.comment.username}`
  2330. }, [
  2331. vue.createElementVNode("img", {
  2332. src: __props.comment.avatar,
  2333. alt: ""
  2334. }, null, 8, _hoisted_3$4)
  2335. ], 8, _hoisted_2$5)) : vue.createCommentVNode("", true),
  2336. vue.createElementVNode("div", {
  2337. class: vue.normalizeClass(["comment-body", { isRight: __props.isRight }])
  2338. }, [
  2339. vue.createElementVNode("div", _hoisted_4$2, [
  2340. __props.comment.thankCount && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$2, [
  2341. _hoisted_6$2,
  2342. vue.createElementVNode("div", _hoisted_7$1, vue.toDisplayString(__props.comment.thankCount), 1)
  2343. ])) : vue.createCommentVNode("", true),
  2344. vue.unref(isLogin) && vue.unref(config2).openTag && __props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(vue.unref(myTags), (i) => {
  2345. return vue.openBlock(), vue.createElementBlock("span", _hoisted_8$1, [
  2346. _hoisted_9$1,
  2347. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  2348. ]);
  2349. }), 256)) : vue.createCommentVNode("", true),
  2350. __props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_10$1, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  2351. __props.comment.isMod && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$1, "MOD")) : vue.createCommentVNode("", true),
  2352. __props.comment.isOp && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, "OP")) : vue.createCommentVNode("", true),
  2353. vue.createElementVNode("a", {
  2354. href: `/member/${__props.comment.username}`,
  2355. class: "username"
  2356. }, vue.toDisplayString(__props.comment.username), 9, _hoisted_13$1),
  2357. __props.comment.isOp && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$1, "OP")) : vue.createCommentVNode("", true),
  2358. __props.comment.isMod && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15$1, "MOD")) : vue.createCommentVNode("", true),
  2359. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_16$1, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  2360. vue.unref(isLogin) && vue.unref(config2).openTag && !__props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 8 }, vue.renderList(vue.unref(myTags), (i) => {
  2361. return vue.openBlock(), vue.createElementBlock("span", _hoisted_17$1, [
  2362. _hoisted_18$1,
  2363. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  2364. ]);
  2365. }), 256)) : vue.createCommentVNode("", true),
  2366. __props.comment.thankCount && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19$1, [
  2367. _hoisted_20$1,
  2368. vue.createElementVNode("div", _hoisted_21$1, vue.toDisplayString(__props.comment.thankCount), 1)
  2369. ])) : vue.createCommentVNode("", true)
  2370. ]),
  2371. vue.createVNode(vue.unref(BaseHtmlRender), {
  2372. class: "reply_content",
  2373. html: __props.comment.reply_content
  2374. }, null, 8, ["html"])
  2375. ], 2),
  2376. __props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  2377. key: 1,
  2378. class: "avatar",
  2379. href: `/member/${__props.comment.username}`
  2380. }, [
  2381. vue.createElementVNode("img", {
  2382. src: __props.comment.avatar,
  2383. alt: ""
  2384. }, null, 8, _hoisted_23$1)
  2385. ], 8, _hoisted_22$1)) : vue.createCommentVNode("", true),
  2386. vue.createElementVNode("div", _hoisted_24$1, [
  2387. vue.createElementVNode("div", _hoisted_25$1, vue.toDisplayString(__props.comment.floor), 1),
  2388. vue.createElementVNode("div", {
  2389. class: "tool jump",
  2390. onClick: jump
  2391. }, _hoisted_27$1)
  2392. ])
  2393. ], 512);
  2394. };
  2395. }
  2396. };
  2397. const SingleComment = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-3eb530b9"]]);
  2398. function debounce(fn, delay, scope) {
  2399. let timer = null;
  2400. return function() {
  2401. let context = scope || this, args = arguments;
  2402. clearTimeout(timer);
  2403. timer = setTimeout(function() {
  2404. fn.apply(context, args);
  2405. timer = null;
  2406. }, delay);
  2407. };
  2408. }
  2409. const _sfc_main$5 = {
  2410. name: "detail",
  2411. components: {
  2412. SingleComment,
  2413. PopConfirm,
  2414. Comment,
  2415. PostEditor,
  2416. Point,
  2417. Toolbar,
  2418. BaseHtmlRender,
  2419. Tooltip
  2420. },
  2421. inject: ["allReplyUsers", "post", "isLogin", "config", "pageType", "isNight", "showConfig"],
  2422. provide() {
  2423. return {
  2424. postDetailWidth: vue.computed(() => this.postDetailWidth)
  2425. };
  2426. },
  2427. props: {
  2428. modelValue: {
  2429. type: Boolean,
  2430. default() {
  2431. return false;
  2432. }
  2433. },
  2434. loading: {
  2435. type: Boolean,
  2436. default() {
  2437. return false;
  2438. }
  2439. },
  2440. displayType: 0
  2441. },
  2442. data() {
  2443. return {
  2444. isSticky: false,
  2445. selectCallIndex: 0,
  2446. postDetailWidth: 0,
  2447. showCallList: false,
  2448. showRelationReply: false,
  2449. replyText: "",
  2450. callStyle: {
  2451. top: 0,
  2452. left: 0
  2453. },
  2454. targetUser: {
  2455. left: [],
  2456. right: "",
  2457. rightFloor: -1
  2458. },
  2459. debounceScroll: () => {
  2460. },
  2461. read: {
  2462. floor: 0,
  2463. total: 0
  2464. },
  2465. currentFloor: 1
  2466. };
  2467. },
  2468. computed: {
  2469. isPost() {
  2470. return this.pageType === PageType.Post;
  2471. },
  2472. filterCallList() {
  2473. if (this.showCallList) {
  2474. let list = ["管理员", "所有人"].concat(this.allReplyUsers);
  2475. if (this.replyText)
  2476. return list.filter((i) => i.search(this.replyText) > -1);
  2477. return list;
  2478. }
  2479. return [];
  2480. },
  2481. topReply() {
  2482. return this.post.replyList.filter((v) => v.thankCount >= this.config.topReplyLoveMinCount).sort((a, b) => b.thankCount - a.thankCount).slice(0, this.config.topReplyCount);
  2483. },
  2484. replyList() {
  2485. if ([0, 4].includes(this.displayType))
  2486. return this.post.nestedReplies;
  2487. if (this.displayType === 1) {
  2488. return window.clone(this.post.nestedReplies).sort((a, b) => b.thankCount - a.thankCount);
  2489. }
  2490. if (this.displayType === 2)
  2491. return this.post.replyList;
  2492. if (this.displayType === 3)
  2493. return this.post.replyList.filter((v) => {
  2494. var _a;
  2495. return v.username === ((_a = this.post.member) == null ? void 0 : _a.username);
  2496. });
  2497. return [];
  2498. },
  2499. //关联回复
  2500. relationReply() {
  2501. if (this.targetUser.left.length && this.targetUser.right) {
  2502. return this.post.replyList.filter((v) => {
  2503. if (this.targetUser.left.includes(v.username)) {
  2504. if (v.floor > this.targetUser.rightFloor) {
  2505. if (v.replyUsers.includes(this.targetUser.right)) {
  2506. return true;
  2507. }
  2508. } else {
  2509. return true;
  2510. }
  2511. }
  2512. if (v.username === this.targetUser.right) {
  2513. for (let i = 0; i < this.targetUser.left.length; i++) {
  2514. if (v.replyUsers.includes(this.targetUser.left[i])) {
  2515. return true;
  2516. }
  2517. }
  2518. }
  2519. });
  2520. }
  2521. return [];
  2522. }
  2523. },
  2524. watch: {
  2525. "post.id"(n, o) {
  2526. if (this.$refs["post-editor"]) {
  2527. this.$refs["post-editor"].content = "";
  2528. vue.nextTick(() => {
  2529. var _a, _b;
  2530. (_b = (_a = this.$refs) == null ? void 0 : _a.detail) == null ? void 0 : _b.scrollTo({ top: 0 });
  2531. });
  2532. }
  2533. },
  2534. modelValue: {
  2535. handler(newVal) {
  2536. if (this.isPost)
  2537. return;
  2538. if (newVal) {
  2539. document.body.style.overflow = "hidden";
  2540. this.read = this.post.read;
  2541. this.currentFloor = 1;
  2542. vue.nextTick(() => {
  2543. var _a, _b;
  2544. (_b = (_a = this.$refs) == null ? void 0 : _a.main) == null ? void 0 : _b.focus();
  2545. });
  2546. } else {
  2547. this.$emit("saveReadList");
  2548. document.body.style.overflow = "unset";
  2549. this.isSticky = false;
  2550. this.showRelationReply = false;
  2551. if ((this.pageType === PageType.Home || this.pageType === PageType.Node) && window.location.pathname !== "/") {
  2552. window.history.back();
  2553. }
  2554. }
  2555. }
  2556. }
  2557. },
  2558. mounted() {
  2559. setTimeout(() => {
  2560. var _a;
  2561. this.postDetailWidth = ((_a = this.$refs.mainWrapper) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
  2562. });
  2563. this.debounceScroll = debounce(this.scroll, 300, false);
  2564. if (this.isLogin) {
  2565. const observer = new IntersectionObserver(
  2566. ([e]) => e.target.toggleAttribute("stuck", e.intersectionRatio < 1),
  2567. { threshold: [1] }
  2568. );
  2569. observer.observe(this.$refs.replyBox);
  2570. window.addEventListener("keydown", this.onKeyDown);
  2571. }
  2572. eventBus.on(CMD.SHOW_CALL, (val) => {
  2573. if (val.show) {
  2574. this.showCallList = true;
  2575. this.replyText = val.text;
  2576. if (this.isPost) {
  2577. this.callStyle.top = val.top + $(window.win()).scrollTop() + -40 + "px";
  2578. } else {
  2579. this.callStyle.top = val.top + $(".post-detail").scrollTop() + 15 + "px";
  2580. }
  2581. this.callStyle.left = val.left - $(".main")[0].getBoundingClientRect().left + 10 + "px";
  2582. if (this.selectCallIndex >= this.filterCallList.length) {
  2583. this.selectCallIndex = 0;
  2584. }
  2585. } else {
  2586. this.replyText = "";
  2587. this.showCallList = false;
  2588. this.selectCallIndex = 0;
  2589. }
  2590. });
  2591. eventBus.on(CMD.RELATION_REPLY, (val) => {
  2592. this.targetUser = val;
  2593. this.showRelationReply = true;
  2594. });
  2595. eventBus.on(CMD.JUMP, this.jump);
  2596. if (this.isPost) {
  2597. window.addEventListener("scroll", this.debounceScroll);
  2598. }
  2599. },
  2600. beforeUnmount() {
  2601. window.removeEventListener("keydown", this.onKeyDown);
  2602. eventBus.off(CMD.SHOW_CALL);
  2603. },
  2604. methods: {
  2605. scroll() {
  2606. if (!this.config.rememberLastReadFloor)
  2607. return;
  2608. let height = window.innerHeight * 0.3;
  2609. let comments = $(".comments .comment");
  2610. let forCount = 0;
  2611. for (let i = 0; i < comments.length; i++) {
  2612. forCount++;
  2613. let ins = comments[i];
  2614. let rect = ins.getBoundingClientRect();
  2615. if (rect.top > height) {
  2616. let lastReadFloor = Number(ins.dataset["floor"]);
  2617. console.log("当前阅读楼层", lastReadFloor);
  2618. eventBus.emit(CMD.ADD_READ, {
  2619. floor: lastReadFloor > 3 ? lastReadFloor : 0,
  2620. total: this.post.replyList.length
  2621. });
  2622. if (lastReadFloor > 3) {
  2623. this.read.floor = 0;
  2624. }
  2625. break;
  2626. }
  2627. }
  2628. if (forCount === comments.length) {
  2629. console.log("看到最后了");
  2630. eventBus.emit(CMD.ADD_READ, {
  2631. floor: forCount,
  2632. total: this.post.replyList.length
  2633. });
  2634. }
  2635. },
  2636. stop(e) {
  2637. },
  2638. jump(floor) {
  2639. try {
  2640. floor = Number(floor);
  2641. } catch (e) {
  2642. }
  2643. if (!floor)
  2644. return;
  2645. if (!this.post.replyList.length) {
  2646. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "没有回复可跳转!" });
  2647. this.read.floor = 0;
  2648. return;
  2649. }
  2650. if (floor > this.post.replyList.length) {
  2651. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  2652. this.read.floor = 0;
  2653. return;
  2654. }
  2655. let comment = $(`.c_${floor}`);
  2656. if (!comment.length) {
  2657. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  2658. this.read.floor = 0;
  2659. return;
  2660. }
  2661. comment[0].scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
  2662. comment.addClass("ding");
  2663. this.read.floor = 0;
  2664. this.currentFloor = floor + 1;
  2665. setTimeout(() => {
  2666. comment.removeClass("ding");
  2667. }, 2e3);
  2668. },
  2669. jumpLastRead(floor) {
  2670. if (this.config.autoJumpLastReadFloor) {
  2671. if (!floor)
  2672. return;
  2673. setTimeout(() => {
  2674. console.log("上次跳转", floor);
  2675. this.jump(floor);
  2676. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "已跳转到上次阅读位置" });
  2677. }, 300);
  2678. }
  2679. },
  2680. collapseTopReplyList() {
  2681. $(this.$refs.topReply).slideToggle("fast");
  2682. },
  2683. goBottom() {
  2684. this.isSticky = false;
  2685. setTimeout(() => {
  2686. if (this.isPost) {
  2687. let body = $("body , html");
  2688. let scrollHeight = body.prop("scrollHeight");
  2689. body.animate({ scrollTop: scrollHeight - 850 }, 300);
  2690. } else {
  2691. this.$refs.detail.scrollTo({ top: this.$refs.detail.scrollHeight, behavior: "smooth" });
  2692. }
  2693. });
  2694. },
  2695. close(from) {
  2696. if (this.isPost)
  2697. return;
  2698. if (from === "space") {
  2699. if (this.config.closePostDetailBySpace) {
  2700. this.$emit("update:modelValue", false);
  2701. }
  2702. } else {
  2703. this.$emit("update:modelValue", false);
  2704. }
  2705. },
  2706. setCall(e) {
  2707. eventBus.emit(CMD.SET_CALL, e);
  2708. this.showCallList = false;
  2709. },
  2710. onKeyDown(e) {
  2711. if (!this.modelValue)
  2712. return;
  2713. if (!this.showCallList)
  2714. return;
  2715. let length = this.filterCallList.slice(0, 10).length;
  2716. if (e.keyCode === 13) {
  2717. this.setCall(this.filterCallList[this.selectCallIndex]);
  2718. e.preventDefault();
  2719. }
  2720. if (e.keyCode === 38) {
  2721. this.selectCallIndex--;
  2722. if (this.selectCallIndex < 0) {
  2723. this.selectCallIndex = length - 1;
  2724. }
  2725. e.preventDefault();
  2726. }
  2727. if (e.keyCode === 40) {
  2728. this.selectCallIndex++;
  2729. if (this.selectCallIndex > length - 1) {
  2730. this.selectCallIndex = 0;
  2731. }
  2732. e.preventDefault();
  2733. }
  2734. },
  2735. changeOption(item) {
  2736. this.$emit("update:displayType", item);
  2737. },
  2738. addThank() {
  2739. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "add" });
  2740. },
  2741. recallThank() {
  2742. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "recall" });
  2743. },
  2744. scrollTop() {
  2745. if (this.isPost) {
  2746. $("body , html").animate({ scrollTop: 0 }, 300);
  2747. } else {
  2748. this.$refs.detail.scrollTo({ top: 0, behavior: "smooth" });
  2749. }
  2750. }
  2751. }
  2752. };
  2753. const _withScopeId$2 = (n) => (vue.pushScopeId("data-v-40ab5702"), n = n(), vue.popScopeId(), n);
  2754. const _hoisted_1$5 = { class: "my-box post-wrapper" };
  2755. const _hoisted_2$4 = { class: "toolbar-wrapper" };
  2756. const _hoisted_3$3 = {
  2757. key: 0,
  2758. class: "my-box"
  2759. };
  2760. const _hoisted_4$1 = { class: "my-cell flex" };
  2761. const _hoisted_5$1 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "gray" }, "高赞回复", -1));
  2762. const _hoisted_6$1 = { class: "top-reply" };
  2763. const _hoisted_7 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-times" }, null, -1));
  2764. const _hoisted_8 = { ref: "topReply" };
  2765. const _hoisted_9 = { class: "my-box comment-wrapper" };
  2766. const _hoisted_10 = {
  2767. key: 0,
  2768. class: "my-cell flex"
  2769. };
  2770. const _hoisted_11 = {
  2771. key: 0,
  2772. class: "read-notice"
  2773. };
  2774. const _hoisted_12 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", null, "上次打开:", -1));
  2775. const _hoisted_13 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-long-arrow-down" }, null, -1));
  2776. const _hoisted_14 = [
  2777. _hoisted_13
  2778. ];
  2779. const _hoisted_15 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-long-arrow-down" }, null, -1));
  2780. const _hoisted_16 = [
  2781. _hoisted_15
  2782. ];
  2783. const _hoisted_17 = { class: "my-cell flex" };
  2784. const _hoisted_18 = { class: "gray" };
  2785. const _hoisted_19 = { key: 0 };
  2786. const _hoisted_20 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("strong", { class: "snow" }, "•", -1));
  2787. const _hoisted_21 = ["innerHTML"];
  2788. const _hoisted_22 = {
  2789. key: 0,
  2790. class: "loading-wrapper"
  2791. };
  2792. const _hoisted_23 = {
  2793. key: 1,
  2794. class: "comments"
  2795. };
  2796. const _hoisted_24 = {
  2797. key: 1,
  2798. id: "no-comments-yet"
  2799. };
  2800. const _hoisted_25 = { class: "my-cell flex" };
  2801. const _hoisted_26 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", null, "添加一条新回复", -1));
  2802. const _hoisted_27 = { class: "notice-right" };
  2803. const _hoisted_28 = { class: "w" };
  2804. const _hoisted_29 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "gray" }, "上下文", -1));
  2805. const _hoisted_30 = { class: "top-reply" };
  2806. const _hoisted_31 = ["onClick"];
  2807. const _hoisted_32 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("i", {
  2808. class: "fa fa-times",
  2809. "aria-hidden": "true"
  2810. }, null, -1));
  2811. const _hoisted_33 = [
  2812. _hoisted_32
  2813. ];
  2814. const _hoisted_34 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("i", {
  2815. class: "fa fa-long-arrow-up",
  2816. "aria-hidden": "true"
  2817. }, null, -1));
  2818. const _hoisted_35 = [
  2819. _hoisted_34
  2820. ];
  2821. const _hoisted_36 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-long-arrow-down" }, null, -1));
  2822. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  2823. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  2824. const _component_Point = vue.resolveComponent("Point");
  2825. const _component_Toolbar = vue.resolveComponent("Toolbar");
  2826. const _component_Tooltip = vue.resolveComponent("Tooltip");
  2827. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  2828. const _component_Comment = vue.resolveComponent("Comment");
  2829. const _component_PostEditor = vue.resolveComponent("PostEditor");
  2830. const _component_SingleComment = vue.resolveComponent("SingleComment");
  2831. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  2832. class: vue.normalizeClass(["post-detail", [$options.isNight ? "isNight" : "", $options.pageType]]),
  2833. ref: "detail",
  2834. onKeydown: _cache[24] || (_cache[24] = vue.withKeys(($event) => $options.close(), ["esc"])),
  2835. onScroll: _cache[25] || (_cache[25] = (...args) => $data.debounceScroll && $data.debounceScroll(...args)),
  2836. onClick: _cache[26] || (_cache[26] = ($event) => $options.close("space"))
  2837. }, [
  2838. vue.createElementVNode("div", {
  2839. ref: "main",
  2840. class: "main",
  2841. tabindex: "1",
  2842. onClick: _cache[23] || (_cache[23] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  2843. }, [
  2844. vue.createElementVNode("div", {
  2845. class: "main-wrapper",
  2846. ref: "mainWrapper",
  2847. style: vue.normalizeStyle({ width: $options.config.postWidth })
  2848. }, [
  2849. vue.createElementVNode("div", _hoisted_1$5, [
  2850. vue.createVNode(_component_BaseHtmlRender, {
  2851. html: $options.post.headerTemplate
  2852. }, null, 8, ["html"]),
  2853. vue.createElementVNode("div", _hoisted_2$4, [
  2854. vue.createVNode(_component_Point, {
  2855. onAddThank: $options.addThank,
  2856. onRecallThank: $options.recallThank,
  2857. full: false,
  2858. item: {
  2859. isThanked: $options.post.isThanked,
  2860. thankCount: $options.post.thankCount,
  2861. username: $options.post.username
  2862. },
  2863. "api-url": "topic/" + $options.post.id
  2864. }, null, 8, ["onAddThank", "onRecallThank", "item", "api-url"]),
  2865. vue.createVNode(_component_Toolbar, {
  2866. onReply: _cache[0] || (_cache[0] = ($event) => $data.isSticky = !$data.isSticky)
  2867. })
  2868. ])
  2869. ]),
  2870. $options.topReply.length && $options.config.showTopReply ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
  2871. vue.createElementVNode("div", _hoisted_4$1, [
  2872. _hoisted_5$1,
  2873. vue.createElementVNode("div", _hoisted_6$1, [
  2874. vue.createVNode(_component_Tooltip, {
  2875. title: `统计点赞数大于等于${$options.config.topReplyLoveMinCount}个的回复,可在设置中调整`
  2876. }, {
  2877. default: vue.withCtx(() => [
  2878. vue.createElementVNode("i", {
  2879. class: "fa fa-info",
  2880. onClick: _cache[1] || (_cache[1] = ($event) => $options.showConfig())
  2881. })
  2882. ]),
  2883. _: 1
  2884. }, 8, ["title"]),
  2885. vue.createVNode(_component_PopConfirm, {
  2886. title: "关闭后不再默认显示,可在设置里重新打开,确认关闭?",
  2887. onConfirm: _cache[2] || (_cache[2] = ($event) => $options.config.showTopReply = false)
  2888. }, {
  2889. default: vue.withCtx(() => [
  2890. _hoisted_7
  2891. ]),
  2892. _: 1
  2893. }),
  2894. vue.createVNode(_component_Tooltip, { title: "收起高赞回复" }, {
  2895. default: vue.withCtx(() => [
  2896. vue.createElementVNode("i", {
  2897. class: "fa fa-compress",
  2898. onClick: _cache[3] || (_cache[3] = (...args) => $options.collapseTopReplyList && $options.collapseTopReplyList(...args))
  2899. })
  2900. ]),
  2901. _: 1
  2902. })
  2903. ])
  2904. ]),
  2905. vue.createElementVNode("div", _hoisted_8, [
  2906. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.topReply, (item, index2) => {
  2907. return vue.openBlock(), vue.createBlock(_component_Comment, {
  2908. key: item.floor,
  2909. type: "top",
  2910. modelValue: $options.topReply[index2],
  2911. "onUpdate:modelValue": ($event) => $options.topReply[index2] = $event
  2912. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  2913. }), 128))
  2914. ], 512)
  2915. ])) : vue.createCommentVNode("", true),
  2916. vue.createElementVNode("div", _hoisted_9, [
  2917. $options.post.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  2918. $options.config.showToolbar ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
  2919. vue.createElementVNode("div", {
  2920. class: vue.normalizeClass(["radio-group2", { isNight: $options.isNight }])
  2921. }, [
  2922. vue.createVNode(_component_Tooltip, { title: "不隐藏@用户" }, {
  2923. default: vue.withCtx(() => [
  2924. vue.createElementVNode("div", {
  2925. class: vue.normalizeClass(["radio", $props.displayType === 0 ? "active" : ""]),
  2926. onClick: _cache[4] || (_cache[4] = ($event) => $options.changeOption(0))
  2927. }, "楼中楼(@) ", 2)
  2928. ]),
  2929. _: 1
  2930. }),
  2931. vue.createVNode(_component_Tooltip, { title: "隐藏第一个@用户,双击内容可显示原文" }, {
  2932. default: vue.withCtx(() => [
  2933. vue.createElementVNode("div", {
  2934. class: vue.normalizeClass(["radio", $props.displayType === 4 ? "active" : ""]),
  2935. onClick: _cache[5] || (_cache[5] = ($event) => $options.changeOption(4))
  2936. }, "楼中楼 ", 2)
  2937. ]),
  2938. _: 1
  2939. }),
  2940. vue.createElementVNode("div", {
  2941. class: vue.normalizeClass(["radio", $props.displayType === 1 ? "active" : ""]),
  2942. onClick: _cache[6] || (_cache[6] = ($event) => $options.changeOption(1))
  2943. }, "感谢 ", 2),
  2944. vue.createElementVNode("div", {
  2945. class: vue.normalizeClass(["radio", $props.displayType === 3 ? "active" : ""]),
  2946. onClick: _cache[7] || (_cache[7] = ($event) => $options.changeOption(3))
  2947. }, "只看楼主 ", 2),
  2948. vue.createElementVNode("div", {
  2949. class: vue.normalizeClass(["radio", $props.displayType === 2 ? "active" : ""]),
  2950. onClick: _cache[8] || (_cache[8] = ($event) => $options.changeOption(2))
  2951. }, "V2原版 ", 2)
  2952. ], 2),
  2953. $data.read.floor || $data.read.total ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
  2954. _hoisted_12,
  2955. $data.read.floor ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  2956. vue.createElementVNode("span", null, [
  2957. vue.createTextVNode("阅读到"),
  2958. vue.createElementVNode("b", null, vue.toDisplayString($data.read.floor), 1),
  2959. vue.createTextVNode("楼")
  2960. ]),
  2961. vue.createElementVNode("div", {
  2962. class: "jump jump1",
  2963. onClick: _cache[9] || (_cache[9] = ($event) => $options.jump($data.read.floor))
  2964. }, _hoisted_14)
  2965. ], 64)) : vue.createCommentVNode("", true),
  2966. vue.createElementVNode("span", null, [
  2967. vue.createTextVNode("总楼层"),
  2968. vue.createElementVNode("b", null, vue.toDisplayString($data.read.total), 1)
  2969. ]),
  2970. vue.createElementVNode("div", {
  2971. class: "jump",
  2972. onClick: _cache[10] || (_cache[10] = ($event) => $options.jump($data.read.total))
  2973. }, _hoisted_16)
  2974. ])) : vue.createCommentVNode("", true)
  2975. ])) : vue.createCommentVNode("", true),
  2976. vue.createElementVNode("div", _hoisted_17, [
  2977. vue.createElementVNode("span", _hoisted_18, [
  2978. vue.createTextVNode(vue.toDisplayString($options.post.replyCount) + " 条回复 ", 1),
  2979. $options.post.createDate ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_19, [
  2980. vue.createTextVNode("  "),
  2981. _hoisted_20,
  2982. vue.createTextVNode("  " + vue.toDisplayString($options.post.createDate), 1)
  2983. ])) : vue.createCommentVNode("", true)
  2984. ]),
  2985. vue.createElementVNode("div", {
  2986. class: "fr",
  2987. innerHTML: $options.post.fr
  2988. }, null, 8, _hoisted_21)
  2989. ])
  2990. ], 64)) : vue.createCommentVNode("", true),
  2991. $options.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  2992. $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_22, [
  2993. vue.createElementVNode("div", {
  2994. class: vue.normalizeClass([$options.isNight ? "loading-b" : "loading-c"])
  2995. }, null, 2)
  2996. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_23, [
  2997. $props.modelValue ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList($options.replyList, (item, index2) => {
  2998. return vue.openBlock(), vue.createBlock(_component_Comment, {
  2999. key: item.floor,
  3000. modelValue: $options.replyList[index2],
  3001. "onUpdate:modelValue": ($event) => $options.replyList[index2] = $event
  3002. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  3003. }), 128)) : vue.createCommentVNode("", true)
  3004. ]))
  3005. ], 64)) : vue.createCommentVNode("", true)
  3006. ]),
  3007. !($options.replyList.length || $props.loading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_24, "目前尚无回复")) : vue.createCommentVNode("", true),
  3008. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  3009. key: 2,
  3010. class: vue.normalizeClass(["my-box editor-wrapper", { "sticky": $data.isSticky }]),
  3011. ref: "replyBox"
  3012. }, [
  3013. vue.createElementVNode("div", _hoisted_25, [
  3014. _hoisted_26,
  3015. vue.createElementVNode("div", _hoisted_27, [
  3016. $data.isSticky ? (vue.openBlock(), vue.createElementBlock("a", {
  3017. key: 0,
  3018. class: "float",
  3019. onClick: _cache[11] || (_cache[11] = ($event) => $data.isSticky = false)
  3020. }, "取消回复框停靠")) : vue.createCommentVNode("", true),
  3021. vue.createElementVNode("a", {
  3022. onClick: _cache[12] || (_cache[12] = (...args) => $options.scrollTop && $options.scrollTop(...args))
  3023. }, "回到顶部")
  3024. ])
  3025. ]),
  3026. vue.createElementVNode("div", _hoisted_28, [
  3027. vue.createVNode(_component_PostEditor, {
  3028. onClose: $options.goBottom,
  3029. ref: "post-editor",
  3030. useType: "reply-post",
  3031. onClick: _cache[13] || (_cache[13] = ($event) => $data.isSticky = true)
  3032. }, null, 8, ["onClose"])
  3033. ])
  3034. ], 2)) : vue.createCommentVNode("", true)
  3035. ], 4),
  3036. $data.showRelationReply ? (vue.openBlock(), vue.createElementBlock("div", {
  3037. key: 0,
  3038. class: "relationReply",
  3039. onClick: _cache[17] || (_cache[17] = ($event) => $options.close("space"))
  3040. }, [
  3041. vue.createElementVNode("div", {
  3042. class: "my-cell flex",
  3043. onClick: _cache[15] || (_cache[15] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  3044. }, [
  3045. _hoisted_29,
  3046. vue.createElementVNode("div", _hoisted_30, [
  3047. vue.createElementVNode("i", {
  3048. class: "fa fa-times",
  3049. onClick: _cache[14] || (_cache[14] = ($event) => $data.showRelationReply = false)
  3050. })
  3051. ])
  3052. ]),
  3053. vue.createElementVNode("div", {
  3054. class: "comments",
  3055. onClick: _cache[16] || (_cache[16] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  3056. }, [
  3057. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.relationReply, (item, index2) => {
  3058. return vue.openBlock(), vue.createBlock(_component_SingleComment, {
  3059. "is-right": item.username === $data.targetUser.right,
  3060. key: item.floor,
  3061. comment: item
  3062. }, null, 8, ["is-right", "comment"]);
  3063. }), 128))
  3064. ])
  3065. ])) : vue.createCommentVNode("", true),
  3066. $data.showCallList && $options.filterCallList.length ? (vue.openBlock(), vue.createElementBlock("div", {
  3067. key: 1,
  3068. class: "call-list",
  3069. style: vue.normalizeStyle($data.callStyle)
  3070. }, [
  3071. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.filterCallList.slice(0, 10), (item, index2) => {
  3072. return vue.openBlock(), vue.createElementBlock("div", {
  3073. class: vue.normalizeClass(["call-item", { select: index2 === $data.selectCallIndex }]),
  3074. onClick: ($event) => $options.setCall(item)
  3075. }, [
  3076. vue.createElementVNode("a", null, vue.toDisplayString(item), 1)
  3077. ], 10, _hoisted_31);
  3078. }), 256))
  3079. ], 4)) : vue.createCommentVNode("", true),
  3080. $options.config.closePostDetailBySpace ? (vue.openBlock(), vue.createElementBlock("div", {
  3081. key: 2,
  3082. class: "close-btn",
  3083. onClick: _cache[18] || (_cache[18] = ($event) => $options.close("btn"))
  3084. }, _hoisted_33)) : vue.createCommentVNode("", true),
  3085. vue.createElementVNode("div", {
  3086. class: "scroll-top button",
  3087. onClick: _cache[19] || (_cache[19] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  3088. }, _hoisted_35),
  3089. vue.createElementVNode("div", {
  3090. class: "scroll-to button",
  3091. onClick: _cache[22] || (_cache[22] = vue.withModifiers(($event) => $options.jump($data.currentFloor), ["stop"]))
  3092. }, [
  3093. _hoisted_36,
  3094. vue.withDirectives(vue.createElementVNode("input", {
  3095. type: "text",
  3096. "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.currentFloor = $event),
  3097. onClick: _cache[21] || (_cache[21] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  3098. }, null, 512), [
  3099. [vue.vModelText, $data.currentFloor]
  3100. ])
  3101. ])
  3102. ], 512)
  3103. ], 34)), [
  3104. [vue.vShow, $props.modelValue]
  3105. ]);
  3106. }
  3107. const PostDetail = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$2], ["__scopeId", "data-v-40ab5702"]]);
  3108. const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-19fe372d"), n = n(), vue.popScopeId(), n);
  3109. const _hoisted_1$4 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  3110. width: "24",
  3111. height: "24",
  3112. viewBox: "0 0 48 48",
  3113. fill: "none",
  3114. xmlns: "http://www.w3.org/2000/svg"
  3115. }, [
  3116. /* @__PURE__ */ vue.createElementVNode("path", {
  3117. d: "M17 32L19.1875 27M31 32L28.8125 27M19.1875 27L24 16L28.8125 27M19.1875 27H28.8125",
  3118. stroke: "#929596",
  3119. "stroke-width": "4",
  3120. "stroke-linecap": "round",
  3121. "stroke-linejoin": "round"
  3122. }),
  3123. /* @__PURE__ */ vue.createElementVNode("path", {
  3124. d: "M43.1999 20C41.3468 10.871 33.2758 4 23.5999 4C13.9241 4 5.85308 10.871 4 20L10 18",
  3125. stroke: "#929596",
  3126. "stroke-width": "4",
  3127. "stroke-linecap": "round",
  3128. "stroke-linejoin": "round"
  3129. }),
  3130. /* @__PURE__ */ vue.createElementVNode("path", {
  3131. d: "M4 28C5.85308 37.129 13.9241 44 23.5999 44C33.2758 44 41.3468 37.129 43.1999 28L38 30",
  3132. stroke: "#929596",
  3133. "stroke-width": "4",
  3134. "stroke-linecap": "round",
  3135. "stroke-linejoin": "round"
  3136. })
  3137. ], -1));
  3138. const _hoisted_2$3 = { key: 1 };
  3139. const _sfc_main$4 = {
  3140. __name: "Base64Tooltip",
  3141. setup(__props) {
  3142. const tooltip = vue.ref(null);
  3143. const show = vue.ref(false);
  3144. const originalText = vue.ref("");
  3145. const decodeText = vue.ref("");
  3146. const styleObject = vue.reactive({
  3147. left: "-100vw",
  3148. top: "-100vh"
  3149. });
  3150. vue.onMounted(() => {
  3151. eventBus.on(CMD.SHOW_TOOLTIP, ({ text, e }) => {
  3152. setTimeout(() => show.value = true);
  3153. originalText.value = text;
  3154. decodeText.value = "";
  3155. styleObject.left = e.clientX + "px";
  3156. styleObject.top = e.clientY + 20 + "px";
  3157. });
  3158. window.addEventListener("click", (e) => {
  3159. if (!tooltip.value)
  3160. return;
  3161. if (!tooltip.value.contains(e.target) && show.value) {
  3162. show.value = false;
  3163. }
  3164. }, { capture: true });
  3165. const fn = () => show.value && (show.value = false);
  3166. $(".post-detail", window.win().doc).on("scroll", fn);
  3167. });
  3168. function copy() {
  3169. if (window.win().navigator.clipboard) {
  3170. window.win().navigator.clipboard.writeText(decodeText.value);
  3171. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "复制成功" });
  3172. } else {
  3173. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "复制失败!浏览器不支持!" });
  3174. }
  3175. }
  3176. function base64ToArrayBuffer(base64) {
  3177. let binary_string = window.atob(base64);
  3178. let len = binary_string.length;
  3179. let bytes = new Uint8Array(len);
  3180. for (let i = 0; i < len; i++) {
  3181. bytes[i] = binary_string.charCodeAt(i);
  3182. }
  3183. return bytes.buffer;
  3184. }
  3185. function decode() {
  3186. try {
  3187. new Blob([base64ToArrayBuffer(originalText.value)]).text().then((r) => {
  3188. decodeText.value = r;
  3189. });
  3190. } catch (e) {
  3191. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "Base64解码失败!不是标准数据!" });
  3192. }
  3193. }
  3194. return (_ctx, _cache) => {
  3195. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  3196. class: "base64_tooltip",
  3197. style: vue.normalizeStyle(styleObject),
  3198. onClick: decode,
  3199. ref_key: "tooltip",
  3200. ref: tooltip
  3201. }, [
  3202. !decodeText.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  3203. vue.createTextVNode(" Base64解码:" + vue.toDisplayString(originalText.value) + " ", 1),
  3204. _hoisted_1$4
  3205. ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
  3206. vue.createElementVNode("span", null, vue.toDisplayString(decodeText.value), 1),
  3207. vue.createElementVNode("div", {
  3208. class: "button",
  3209. onClick: copy
  3210. }, "点击复制")
  3211. ]))
  3212. ], 4)), [
  3213. [vue.vShow, show.value]
  3214. ]);
  3215. };
  3216. }
  3217. };
  3218. const Base64Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-19fe372d"]]);
  3219. const _sfc_main$3 = {
  3220. name: "Msg",
  3221. props: {
  3222. type: "",
  3223. text: ""
  3224. },
  3225. created() {
  3226. setTimeout(() => {
  3227. this.$emit("close");
  3228. }, 3e3);
  3229. }
  3230. };
  3231. const _hoisted_1$3 = /* @__PURE__ */ vue.createElementVNode("svg", {
  3232. width: "24",
  3233. height: "24",
  3234. viewBox: "0 0 48 48",
  3235. fill: "none",
  3236. xmlns: "http://www.w3.org/2000/svg"
  3237. }, [
  3238. /* @__PURE__ */ vue.createElementVNode("path", {
  3239. d: "M14 14L34 34",
  3240. stroke: "#ffffff",
  3241. "stroke-width": "4",
  3242. "stroke-linecap": "round",
  3243. "stroke-linejoin": "round"
  3244. }),
  3245. /* @__PURE__ */ vue.createElementVNode("path", {
  3246. d: "M14 34L34 14",
  3247. stroke: "#ffffff",
  3248. "stroke-width": "4",
  3249. "stroke-linecap": "round",
  3250. "stroke-linejoin": "round"
  3251. })
  3252. ], -1);
  3253. const _hoisted_2$2 = [
  3254. _hoisted_1$3
  3255. ];
  3256. const _hoisted_3$2 = { class: "right" };
  3257. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  3258. return vue.openBlock(), vue.createElementBlock("div", {
  3259. class: vue.normalizeClass(["msg", $props.type])
  3260. }, [
  3261. vue.createElementVNode("div", {
  3262. class: "left",
  3263. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  3264. }, _hoisted_2$2),
  3265. vue.createElementVNode("div", _hoisted_3$2, vue.toDisplayString($props.text), 1)
  3266. ], 2);
  3267. }
  3268. const Msg = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$1]]);
  3269. const _withScopeId = (n) => (vue.pushScopeId("data-v-b28a2e5e"), n = n(), vue.popScopeId(), n);
  3270. const _hoisted_1$2 = { class: "wrapper" };
  3271. const _hoisted_2$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 添加标签 ", -1));
  3272. const _hoisted_3$1 = { class: "option" };
  3273. const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "用户:", -1));
  3274. const _hoisted_5 = ["onKeydown"];
  3275. const _hoisted_6 = { class: "btns" };
  3276. const _sfc_main$2 = {
  3277. __name: "TagModal",
  3278. props: ["tags"],
  3279. emits: ["update:tags"],
  3280. setup(__props, { emit }) {
  3281. const props = __props;
  3282. const tagModal = vue.reactive({
  3283. show: false,
  3284. currentUsername: "",
  3285. tag: ""
  3286. });
  3287. const isNight = vue.inject("isNight");
  3288. const input = vue.ref < HTMLInputElement > null;
  3289. vue.onMounted(() => {
  3290. eventBus.on(CMD.ADD_TAG, (username) => {
  3291. tagModal.currentUsername = username;
  3292. tagModal.show = true;
  3293. vue.nextTick(() => {
  3294. input.value.focus();
  3295. });
  3296. });
  3297. });
  3298. async function addTag() {
  3299. let oldTag = window.clone(props.tags);
  3300. let tempTag = window.clone(props.tags);
  3301. let userTags = tempTag[tagModal.currentUsername] ?? [];
  3302. let rIndex = userTags.findIndex((v) => v === tagModal.tag);
  3303. if (rIndex > -1) {
  3304. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "标签已存在!" });
  3305. return;
  3306. } else {
  3307. userTags.push(tagModal.tag);
  3308. }
  3309. tempTag[tagModal.currentUsername] = userTags;
  3310. emit("update:tags", tempTag);
  3311. tagModal.tag = "";
  3312. tagModal.show = false;
  3313. let res = await window.parse.saveTags(tempTag);
  3314. if (!res) {
  3315. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签添加失败!" });
  3316. emit("update:tags", oldTag);
  3317. }
  3318. }
  3319. return (_ctx, _cache) => {
  3320. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  3321. default: vue.withCtx(() => [
  3322. tagModal.show ? (vue.openBlock(), vue.createElementBlock("div", {
  3323. key: 0,
  3324. class: vue.normalizeClass(["tag-modal modal", { isNight: vue.unref(isNight) }])
  3325. }, [
  3326. vue.createElementVNode("div", {
  3327. class: "mask",
  3328. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => tagModal.show = false, ["stop"]))
  3329. }),
  3330. vue.createElementVNode("div", _hoisted_1$2, [
  3331. _hoisted_2$1,
  3332. vue.createElementVNode("div", _hoisted_3$1, [
  3333. _hoisted_4,
  3334. vue.createElementVNode("div", null, vue.toDisplayString(tagModal.currentUsername), 1)
  3335. ]),
  3336. vue.withDirectives(vue.createElementVNode("input", {
  3337. type: "text",
  3338. ref: "input",
  3339. style: { "width": "100%" },
  3340. autofocus: "",
  3341. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tagModal.tag = $event),
  3342. onKeydown: vue.withKeys(addTag, ["enter"])
  3343. }, null, 40, _hoisted_5), [
  3344. [vue.vModelText, tagModal.tag]
  3345. ]),
  3346. vue.createElementVNode("div", _hoisted_6, [
  3347. vue.createElementVNode("div", {
  3348. class: "white",
  3349. onClick: _cache[2] || (_cache[2] = ($event) => tagModal.show = false)
  3350. }, "取消"),
  3351. vue.createElementVNode("div", {
  3352. class: "main",
  3353. onClick: addTag
  3354. }, "确定")
  3355. ])
  3356. ])
  3357. ], 2)) : vue.createCommentVNode("", true)
  3358. ]),
  3359. _: 1
  3360. });
  3361. };
  3362. }
  3363. };
  3364. const TagModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b28a2e5e"]]);
  3365. const _hoisted_1$1 = { class: "msgs" };
  3366. const _sfc_main$1 = {
  3367. __name: "MsgModal",
  3368. setup(__props) {
  3369. const msgList = vue.reactive([
  3370. // {type: 'success', text: '123', id: Date.now()}
  3371. ]);
  3372. vue.onMounted(() => {
  3373. eventBus.on(CMD.SHOW_MSG, (val) => {
  3374. msgList.push({ ...val, id: Date.now() });
  3375. });
  3376. });
  3377. function removeMsg(id) {
  3378. let rIndex = msgList.findIndex((item) => item.id === id);
  3379. if (rIndex > -1) {
  3380. msgList.splice(rIndex, 1);
  3381. }
  3382. }
  3383. return (_ctx, _cache) => {
  3384. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  3385. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(msgList, (v) => {
  3386. return vue.openBlock(), vue.createBlock(Msg, {
  3387. key: v.id,
  3388. type: v.type,
  3389. text: v.text,
  3390. onClose: ($event) => removeMsg(v.id)
  3391. }, null, 8, ["type", "text", "onClose"]);
  3392. }), 128))
  3393. ]);
  3394. };
  3395. }
  3396. };
  3397. const MsgModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-95974c3e"]]);
  3398. const _sfc_main = {
  3399. components: { MsgModal, TagModal, Tooltip, Setting, PostDetail, Base64Tooltip, Msg },
  3400. provide() {
  3401. return {
  3402. isLogin: vue.computed(() => this.isLogin),
  3403. isNight: vue.computed(() => this.isNight),
  3404. pageType: vue.computed(() => this.pageType),
  3405. tags: vue.computed(() => this.tags),
  3406. show: vue.computed(() => this.show),
  3407. post: vue.computed(() => this.current),
  3408. config: vue.computed(() => this.config),
  3409. allReplyUsers: vue.computed(() => {
  3410. var _a, _b, _c;
  3411. if ((_a = this.current) == null ? void 0 : _a.replyList) {
  3412. return Array.from(new Set(((_c = (_b = this.current) == null ? void 0 : _b.replyList) == null ? void 0 : _c.map((v) => v.username)) ?? []));
  3413. }
  3414. return [];
  3415. }),
  3416. showConfig: this.showConfig
  3417. };
  3418. },
  3419. data() {
  3420. return {
  3421. loading: window.pageType === PageType.Post,
  3422. loadMore: false,
  3423. isLogin: !!window.user.username,
  3424. pageType: window.pageType,
  3425. isNight: window.isNight,
  3426. stopMe: false,
  3427. //停止使用脚本
  3428. show: false,
  3429. current: window.clone(window.initPost),
  3430. list: [],
  3431. config: window.clone(window.config),
  3432. tags: window.user.tags,
  3433. readList: window.user.readList,
  3434. configModal: {
  3435. show: false
  3436. },
  3437. tagModal: {
  3438. show: false,
  3439. currentUsername: "",
  3440. tag: ""
  3441. }
  3442. };
  3443. },
  3444. computed: {
  3445. isList() {
  3446. return this.pageType !== PageType.Post;
  3447. },
  3448. isPost() {
  3449. return this.pageType === PageType.Post;
  3450. }
  3451. },
  3452. watch: {
  3453. "current.replyList": {
  3454. handler(newVal, oldVal) {
  3455. if (newVal.length) {
  3456. this.current.replyCount = newVal.length;
  3457. let res = window.parse.createNestedList(newVal, this.current.allReplyUsers);
  3458. if (res) {
  3459. this.current.nestedReplies = res;
  3460. }
  3461. } else {
  3462. this.current.replyCount = 0;
  3463. this.current.nestedReplies = [];
  3464. }
  3465. if (this.list) {
  3466. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  3467. if (rIndex > -1) {
  3468. this.list[rIndex].replyCount = newVal.length;
  3469. }
  3470. }
  3471. },
  3472. deep: true
  3473. },
  3474. config: {
  3475. handler(newVal) {
  3476. let config2 = { [window.user.username ?? "default"]: newVal };
  3477. localStorage.setItem("v2ex-config", JSON.stringify(config2));
  3478. window.config = newVal;
  3479. },
  3480. deep: true
  3481. },
  3482. tags(newVal) {
  3483. window.user.tags = newVal;
  3484. },
  3485. "config.viewType"(newVal) {
  3486. if (!newVal)
  3487. return;
  3488. if (newVal === "card") {
  3489. $(".post-item").each(function() {
  3490. $(this).addClass("preview");
  3491. });
  3492. } else {
  3493. $(".post-item").each(function() {
  3494. $(this).removeClass("preview");
  3495. });
  3496. }
  3497. }
  3498. },
  3499. created() {
  3500. window.cb = this.winCb;
  3501. if (window.win().canParseV2exPage) {
  3502. if (this.isList)
  3503. ;
  3504. }
  3505. $(document).on("click", "a", (e) => {
  3506. if (this.stopMe)
  3507. return true;
  3508. let { href, id, title } = window.parse.parseA(e.currentTarget);
  3509. if (this.clickPost(e, id, href, title)) {
  3510. return false;
  3511. }
  3512. });
  3513. let that = this;
  3514. $(document).on("click", ".post-item", function(e) {
  3515. if (this.classList.contains("preview")) {
  3516. if (e.target.tagName !== "A" && e.target.tagName !== "IMG" && !e.target.classList.contains("toggle")) {
  3517. console.log("点空白处");
  3518. let id = this.dataset["id"];
  3519. let href = this.dataset["href"];
  3520. if (that.clickPost(e, id, href)) {
  3521. return false;
  3522. } else {
  3523. location.href = href;
  3524. }
  3525. }
  3526. }
  3527. });
  3528. $(document).on("click", ".toggle", (e) => {
  3529. let id = e.currentTarget.dataset["id"];
  3530. let itemDom = window.win().query(`.id_${id}`);
  3531. if (itemDom.classList.contains("preview")) {
  3532. itemDom.classList.remove("preview");
  3533. } else {
  3534. itemDom.classList.add("preview");
  3535. }
  3536. });
  3537. window.onpopstate = (event) => {
  3538. if (event.state) {
  3539. if (!this.show)
  3540. this.show = true;
  3541. } else {
  3542. if (this.show)
  3543. this.show = false;
  3544. }
  3545. };
  3546. window.onbeforeunload = () => {
  3547. this.saveReadList();
  3548. };
  3549. this.initEvent();
  3550. },
  3551. beforeUnmount() {
  3552. eventBus.clear();
  3553. },
  3554. methods: {
  3555. saveReadList() {
  3556. window.parse.saveReadList(this.readList);
  3557. },
  3558. clickPost(e, id, href, title = "") {
  3559. var _a, _b, _c, _d, _e, _f;
  3560. if (id) {
  3561. if (this.config.clickPostItemOpenDetail) {
  3562. let index2 = this.list.findIndex((v) => v.id == id);
  3563. let postItem = this.clone(window.initPost);
  3564. if (index2 > -1) {
  3565. postItem = this.list[index2];
  3566. } else {
  3567. postItem.title = title ?? "加载中";
  3568. }
  3569. postItem.id = id;
  3570. postItem.href = href;
  3571. if (!postItem.headerTemplate) {
  3572. let template = `
  3573. <div class="header">
  3574. <div class="fr">
  3575. <a href="/member/${((_a = postItem == null ? void 0 : postItem.member) == null ? void 0 : _a.username) ?? ""}">
  3576. <img src="${((_b = postItem == null ? void 0 : postItem.member) == null ? void 0 : _b.avatar_large) ?? ""}" class="avatar"
  3577. border="0"
  3578. align="default" width="73" style="width: 73px; max-height: 73px;" alt="${((_c = postItem == null ? void 0 : postItem.member) == null ? void 0 : _c.username) ?? ""}">
  3579. </a>
  3580. </div>
  3581. <a href="/public">V2EX</a> <span class="chevron">&nbsp;›&nbsp;</span> <a href="${((_d = postItem == null ? void 0 : postItem.node) == null ? void 0 : _d.url) ?? ""}">${((_e = postItem == null ? void 0 : postItem.node) == null ? void 0 : _e.title) ?? ""}</a>
  3582. <div class="sep10"></div>
  3583. <h1>${(postItem == null ? void 0 : postItem.title) || "加载中..."}</h1>
  3584. <div id="topic_930514_votes" class="votes">
  3585. <a href="javascript:" onclick="null" class="vote">
  3586. <li class="fa fa-chevron-up"></li>
  3587. &nbsp;
  3588. </a> &nbsp;
  3589. <a href="javascript:" onclick="null" class="vote">
  3590. <li class="fa fa-chevron-down"></li>
  3591. </a>
  3592. </div> &nbsp;
  3593. <small class="gray">
  3594. <a href="/member/zyronon">${((_f = postItem == null ? void 0 : postItem.member) == null ? void 0 : _f.username) ?? ""}</a> ·
  3595. <span title="2023-04-07 11:32:28 +08:00">1 天前</span> · 0 次点击
  3596. </small>
  3597. </div>
  3598. <div class="cell">
  3599. <div class="topic_content">
  3600. <div class="markdown_body">
  3601. ${(postItem == null ? void 0 : postItem.content_rendered) ?? ""}
  3602. </div>
  3603. </div>
  3604. </div>
  3605. `;
  3606. postItem.headerTemplate = template;
  3607. }
  3608. this.getPostDetail(postItem);
  3609. e.preventDefault();
  3610. return true;
  3611. }
  3612. if (this.config.newTabOpen) {
  3613. let tempId = "a_blank_" + Date.now();
  3614. let a = win().doc.createElement("a");
  3615. a.setAttribute("href", href);
  3616. a.setAttribute("target", "_blank");
  3617. a.setAttribute("id", tempId);
  3618. if (!win().doc.getElementById(tempId)) {
  3619. win().doc.body.appendChild(a);
  3620. }
  3621. a.click();
  3622. return true;
  3623. }
  3624. }
  3625. },
  3626. showPost() {
  3627. this.show = true;
  3628. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  3629. $(this).hide();
  3630. });
  3631. },
  3632. showConfig() {
  3633. this.configModal.show = true;
  3634. },
  3635. async winCb({ type, value }) {
  3636. if (type === "openSetting") {
  3637. this.configModal.show = true;
  3638. }
  3639. if (type === "restorePost") {
  3640. if (this.stopMe)
  3641. return;
  3642. this.stopMe = true;
  3643. this.show = false;
  3644. this.loading = false;
  3645. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "脚本无法查看此页面!" });
  3646. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  3647. $(this).show();
  3648. });
  3649. }
  3650. if (type === "postContent") {
  3651. if (this.stopMe)
  3652. return;
  3653. this.current = Object.assign(this.clone(this.current), this.clone(value));
  3654. if (this.config.autoOpenDetail) {
  3655. this.showPost();
  3656. }
  3657. }
  3658. if (type === "postReplies") {
  3659. if (this.stopMe)
  3660. return;
  3661. this.current = Object.assign(this.clone(this.current), this.clone(value));
  3662. console.log("当前帖子", this.current);
  3663. this.loading = false;
  3664. }
  3665. if (type === "syncData") {
  3666. this.list = window.postList;
  3667. this.config = window.config;
  3668. this.tags = window.user.tags;
  3669. this.readList = window.user.readList;
  3670. this.current.read = this.readList[this.current.id] ?? {};
  3671. if (this.show && this.isPost && this.current.read.floor) {
  3672. this.$refs.postDetail.read = this.current.read;
  3673. }
  3674. console.log("this.readList", this.readList);
  3675. }
  3676. },
  3677. clone(val) {
  3678. return window.clone(val);
  3679. },
  3680. initEvent() {
  3681. eventBus.on(CMD.CHANGE_COMMENT_THANK, (val) => {
  3682. console.log("CHANGE_COMMENT_THANK", val);
  3683. const { id, type } = val;
  3684. let currentI = this.current.replyList.findIndex((i) => i.id === id);
  3685. if (currentI > -1) {
  3686. this.current.replyList[currentI].isThanked = type === "add";
  3687. if (type === "add") {
  3688. this.current.replyList[currentI].thankCount++;
  3689. } else {
  3690. this.current.replyList[currentI].thankCount--;
  3691. }
  3692. }
  3693. });
  3694. eventBus.on(CMD.CHANGE_POST_THANK, (val) => {
  3695. const { id, type } = val;
  3696. this.current.isThanked = type === "add";
  3697. if (type === "add") {
  3698. this.current.thankCount++;
  3699. } else {
  3700. this.current.thankCount--;
  3701. }
  3702. let currentI = this.list.findIndex((i) => i.id === id);
  3703. if (currentI > -1) {
  3704. this.list[currentI].isThanked = type === "add";
  3705. if (type === "add") {
  3706. this.list[currentI].thankCount++;
  3707. } else {
  3708. this.list[currentI].thankCount++;
  3709. }
  3710. }
  3711. });
  3712. eventBus.on(CMD.REMOVE, (val) => {
  3713. let removeIndex = this.current.replyList.findIndex((i) => i.floor === val);
  3714. if (removeIndex > -1) {
  3715. this.current.replyList.splice(removeIndex, 1);
  3716. }
  3717. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  3718. if (rIndex > -1) {
  3719. this.list[rIndex] = Object.assign(this.list[rIndex], val);
  3720. }
  3721. });
  3722. eventBus.on(CMD.IGNORE, () => {
  3723. this.show = false;
  3724. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  3725. if (rIndex > -1) {
  3726. this.list.splice(rIndex, 1);
  3727. }
  3728. this.current = this.clone(window.initPost);
  3729. });
  3730. eventBus.on(CMD.MERGE, (val) => {
  3731. this.current = Object.assign(this.current, val);
  3732. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  3733. if (rIndex > -1) {
  3734. this.list[rIndex] = Object.assign(this.list[rIndex], val);
  3735. }
  3736. });
  3737. eventBus.on(CMD.ADD_READ, (val) => {
  3738. this.readList[this.current.id] = val;
  3739. });
  3740. eventBus.on(CMD.ADD_REPLY, (item) => {
  3741. this.current.replyList.push(item);
  3742. });
  3743. eventBus.on(CMD.REFRESH_ONCE, async (once) => {
  3744. if (once) {
  3745. if (typeof once === "string") {
  3746. let res = once.match(/var once = "([\d]+)";/);
  3747. if (res && res[1]) {
  3748. this.current.once = Number(res[1]);
  3749. return;
  3750. }
  3751. }
  3752. if (typeof once === "number") {
  3753. this.current.once = once;
  3754. return;
  3755. }
  3756. }
  3757. window.fetchOnce().then((r) => {
  3758. this.current.once = r;
  3759. });
  3760. });
  3761. eventBus.on(CMD.REMOVE_TAG, async ({ username, tag }) => {
  3762. let oldTag = this.clone(this.tags);
  3763. let tags = this.tags[username] ?? [];
  3764. let rIndex = tags.findIndex((v) => v === tag);
  3765. if (rIndex > -1) {
  3766. tags.splice(rIndex, 1);
  3767. }
  3768. this.tags[username] = tags;
  3769. let res = await window.parse.saveTags(this.tags);
  3770. if (!res) {
  3771. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签删除失败!" });
  3772. this.tags = oldTag;
  3773. }
  3774. });
  3775. },
  3776. async getPostDetail(post, event) {
  3777. this.current = Object.assign({}, window.initPost, post);
  3778. this.current.read = this.readList[this.current.id] ?? { floor: 0, total: 0 };
  3779. this.show = true;
  3780. let url = window.baseUrl + "/t/" + post.id;
  3781. document.body.style.overflow = "hidden";
  3782. window.history.pushState({}, 0, post.href ?? url);
  3783. window.document.title = post.title ?? "V2EX";
  3784. let alreadyHasReply = this.current.replyList.length;
  3785. if (alreadyHasReply) {
  3786. this.$refs.postDetail.jumpLastRead(this.current.read.floor);
  3787. } else {
  3788. this.loading = true;
  3789. }
  3790. let apiRes = await window.fetch(url + "?p=1");
  3791. if (apiRes.status === 404) {
  3792. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "主题未找到" });
  3793. return this.loading = false;
  3794. }
  3795. if (apiRes.status === 403) {
  3796. this.loading = false;
  3797. this.show = false;
  3798. window.open(`https://www.v2ex.com/t/${post.id}?p=1&script=0`, "_black");
  3799. return;
  3800. }
  3801. if (apiRes.redirected) {
  3802. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有权限" });
  3803. return this.loading = false;
  3804. }
  3805. let htmlText = await apiRes.text();
  3806. let hasPermission = htmlText.search("你要查看的页面需要先登录(不可用)");
  3807. if (hasPermission > -1) {
  3808. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你要查看的页面需要先登录(不可用)" });
  3809. return this.loading = false;
  3810. }
  3811. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  3812. let body = $(bodyText[0]);
  3813. this.current = await window.parse.getPostDetail(this.current, body, htmlText);
  3814. if (this.current.replyList.length) {
  3815. let index2 = this.list.findIndex((v) => v.id == post.id);
  3816. if (index2 > -1) {
  3817. this.list[index2].replyList = this.current.replyList;
  3818. this.list[index2].nestedReplies = this.current.nestedReplies;
  3819. this.list[index2].once = this.current.once;
  3820. this.list[index2].createDate = this.current.createDate;
  3821. } else {
  3822. this.list.push(this.clone(this.current));
  3823. }
  3824. }
  3825. this.loading = false;
  3826. if (!alreadyHasReply) {
  3827. vue.nextTick(() => {
  3828. this.$refs.postDetail.jumpLastRead(this.current.read.floor);
  3829. });
  3830. }
  3831. console.log("当前帖子", this.current);
  3832. }
  3833. }
  3834. };
  3835. const _hoisted_1 = {
  3836. key: 0,
  3837. class: "nav flex flex-end"
  3838. };
  3839. const _hoisted_2 = {
  3840. key: 1,
  3841. class: "my-box flex f14 open-post",
  3842. style: { "margin": "2rem 0 0 0", "padding": "1rem" }
  3843. };
  3844. const _hoisted_3 = { class: "flex" };
  3845. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  3846. const _component_Setting = vue.resolveComponent("Setting");
  3847. const _component_TagModal = vue.resolveComponent("TagModal");
  3848. const _component_PostDetail = vue.resolveComponent("PostDetail");
  3849. const _component_Base64Tooltip = vue.resolveComponent("Base64Tooltip");
  3850. const _component_MsgModal = vue.resolveComponent("MsgModal");
  3851. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  3852. vue.createVNode(_component_Setting, {
  3853. modelValue: $data.config,
  3854. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.config = $event),
  3855. show: $data.configModal.show,
  3856. "onUpdate:show": _cache[1] || (_cache[1] = ($event) => $data.configModal.show = $event)
  3857. }, null, 8, ["modelValue", "show"]),
  3858. vue.createVNode(_component_TagModal, {
  3859. tags: $data.tags,
  3860. "onUpdate:tags": _cache[2] || (_cache[2] = ($event) => $data.tags = $event)
  3861. }, null, 8, ["tags"]),
  3862. vue.createVNode(_component_PostDetail, {
  3863. modelValue: $data.show,
  3864. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.show = $event),
  3865. ref: "postDetail",
  3866. displayType: $data.config.commentDisplayType,
  3867. "onUpdate:displayType": _cache[4] || (_cache[4] = ($event) => $data.config.commentDisplayType = $event),
  3868. onSaveReadList: $options.saveReadList,
  3869. loading: $data.loading
  3870. }, null, 8, ["modelValue", "displayType", "onSaveReadList", "loading"]),
  3871. vue.createVNode(_component_Base64Tooltip),
  3872. vue.createVNode(_component_MsgModal),
  3873. !$data.stopMe && $data.config.showToolbar ? (vue.openBlock(), vue.createElementBlock("div", {
  3874. key: 0,
  3875. class: vue.normalizeClass(["toolbar", [$data.isNight ? "isNight" : "", $data.config["viewType"]]])
  3876. }, [
  3877. $options.isList ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
  3878. vue.createElementVNode("div", {
  3879. class: vue.normalizeClass(["radio-group2", { isNight: $data.isNight }])
  3880. }, [
  3881. vue.createElementVNode("div", {
  3882. class: vue.normalizeClass(["radio", $data.config.viewType === "table" ? "active" : ""]),
  3883. onClick: _cache[5] || (_cache[5] = ($event) => $data.config.viewType = "table")
  3884. }, "表格 ", 2),
  3885. vue.createElementVNode("div", {
  3886. class: vue.normalizeClass(["radio", $data.config.viewType === "card" ? "active" : ""]),
  3887. onClick: _cache[6] || (_cache[6] = ($event) => $data.config.viewType = "card")
  3888. }, "卡片 ", 2)
  3889. ], 2)
  3890. ])) : vue.createCommentVNode("", true),
  3891. !$options.isList && !$data.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
  3892. vue.createElementVNode("div", _hoisted_3, [
  3893. vue.createTextVNode(" 默认显示楼中楼 : "),
  3894. vue.createElementVNode("div", {
  3895. class: vue.normalizeClass(["switch light", { active: $data.config.autoOpenDetail }]),
  3896. onClick: _cache[7] || (_cache[7] = ($event) => $data.config.autoOpenDetail = !$data.config.autoOpenDetail)
  3897. }, null, 2)
  3898. ]),
  3899. vue.createElementVNode("div", {
  3900. class: vue.normalizeClass(["button light", { loading: $data.loading, isNight: $data.isNight }]),
  3901. onClick: _cache[8] || (_cache[8] = (...args) => $options.showPost && $options.showPost(...args))
  3902. }, " 点击显示楼中楼 ", 2)
  3903. ])) : vue.createCommentVNode("", true)
  3904. ], 2)) : vue.createCommentVNode("", true)
  3905. ], 64);
  3906. }
  3907. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f9a9d2e9"]]);
  3908. var _GM_notification = /* @__PURE__ */ (() => typeof GM_notification != "undefined" ? GM_notification : void 0)();
  3909. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  3910. var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
  3911. let $section = document.createElement("section");
  3912. $section.id = "app";
  3913. function run() {
  3914. window.baseUrl = location.origin;
  3915. window.initPost = {
  3916. allReplyUsers: [],
  3917. content_rendered: "",
  3918. createDate: "",
  3919. fr: "",
  3920. replyList: [],
  3921. nestedReplies: [],
  3922. username: "",
  3923. member: {},
  3924. node: {},
  3925. headerTemplate: "",
  3926. title: "",
  3927. id: "",
  3928. type: "post",
  3929. once: "",
  3930. replyCount: 0,
  3931. clickCount: 0,
  3932. thankCount: 0,
  3933. collectCount: 0,
  3934. lastReadFloor: 0,
  3935. isFavorite: false,
  3936. isIgnore: false,
  3937. isThanked: false,
  3938. isReport: false
  3939. };
  3940. window.win = function() {
  3941. return window;
  3942. };
  3943. window.win().doc = window.win().document;
  3944. window.win().query = (v) => window.win().document.querySelector(v);
  3945. window.query = (v) => window.win().document.querySelector(v);
  3946. window.clone = (val) => JSON.parse(JSON.stringify(val));
  3947. window.user = {
  3948. tagPrefix: "--用户标签--",
  3949. tags: {},
  3950. tagsId: "",
  3951. username: "",
  3952. avatar: "",
  3953. readPrefix: "--已读楼层--",
  3954. readNoteItemId: "",
  3955. readList: {}
  3956. };
  3957. window.pageType = void 0;
  3958. window.pageData = { pageNo: 1 };
  3959. window.config = {
  3960. showToolbar: true,
  3961. showPreviewBtn: true,
  3962. autoOpenDetail: true,
  3963. openTag: true,
  3964. //给用户打标签
  3965. clickPostItemOpenDetail: true,
  3966. closePostDetailBySpace: true,
  3967. //点击空白处关闭详情
  3968. contentAutoCollapse: true,
  3969. //正文超长自动折叠
  3970. viewType: "table",
  3971. commentDisplayType: 4,
  3972. newTabOpen: false,
  3973. //新标签打开
  3974. base64: true,
  3975. //base功能
  3976. sov2ex: false,
  3977. postWidth: "",
  3978. showTopReply: true,
  3979. topReplyLoveMinCount: 3,
  3980. topReplyCount: 3,
  3981. autoJumpLastReadFloor: false,
  3982. rememberLastReadFloor: true,
  3983. autoSignin: true,
  3984. customBgColor: "",
  3985. version: 1,
  3986. collectBrowserNotice: false
  3987. };
  3988. window.isNight = $(".Night").length === 1;
  3989. window.cb = null;
  3990. window.postList = [];
  3991. window.parse = {
  3992. //解析帖子内容
  3993. async parsePostContent(post, body, htmlText) {
  3994. let once = htmlText.match(/var once = "([\d]+)";/);
  3995. if (once && once[1]) {
  3996. post.once = once[1];
  3997. }
  3998. post.isReport = htmlText.includes("你已对本主题进行了报告");
  3999. if (!post.title || !post.content_rendered) {
  4000. let main = body.find("#Main");
  4001. let aName = main.find(".header small.gray a:nth-child(1)");
  4002. if (aName) {
  4003. post.member.username = aName[0].innerText;
  4004. }
  4005. }
  4006. let topic_buttons = body.find(".topic_buttons");
  4007. if (topic_buttons.length) {
  4008. let favoriteNode = topic_buttons.find(".tb:first");
  4009. if (favoriteNode.length) {
  4010. post.isFavorite = favoriteNode[0].innerText === "取消收藏";
  4011. }
  4012. let ignoreNode = topic_buttons.find(".tb:nth-child(3)");
  4013. if (ignoreNode.length) {
  4014. post.isIgnore = ignoreNode[0].innerText === "取消忽略";
  4015. }
  4016. let thankNode = topic_buttons.find("#topic_thank .tb");
  4017. if (!thankNode.length) {
  4018. post.isThanked = true;
  4019. }
  4020. let topic_stats = topic_buttons.find(".topic_stats");
  4021. if (topic_stats.length) {
  4022. let text = topic_stats[0].innerText;
  4023. let reg1 = text.matchAll(/([\d]+)[\s]*人收藏/g);
  4024. let collectCountReg = [...reg1];
  4025. if (collectCountReg.length) {
  4026. post.collectCount = Number(collectCountReg[0][1]);
  4027. }
  4028. reg1 = text.matchAll(/([\d]+)[\s]*likes/g);
  4029. collectCountReg = [...reg1];
  4030. if (collectCountReg.length) {
  4031. post.collectCount = Number(collectCountReg[0][1]);
  4032. }
  4033. let reg2 = text.matchAll(/([\d]+)[\s]*人感谢/g);
  4034. let thankCountReg = [...reg2];
  4035. if (thankCountReg.length) {
  4036. post.thankCount = Number(thankCountReg[0][1]);
  4037. }
  4038. let reg3 = text.matchAll(/([\d]+)[\s]*次点击/g);
  4039. let clickCountReg = [...reg3];
  4040. if (clickCountReg.length) {
  4041. post.clickCount = Number(clickCountReg[0][1]);
  4042. }
  4043. reg3 = text.matchAll(/([\d]+)[\s]*views/g);
  4044. clickCountReg = [...reg3];
  4045. if (clickCountReg.length) {
  4046. post.clickCount = Number(clickCountReg[0][1]);
  4047. }
  4048. }
  4049. }
  4050. let header = body.find("#Main .box").first();
  4051. let temp = header.clone();
  4052. temp.find(".topic_buttons").remove();
  4053. let html = temp.html();
  4054. html = this.checkPhotoLink2Img(html);
  4055. post.headerTemplate = html;
  4056. return post;
  4057. },
  4058. //获取帖子所有回复
  4059. async getPostAllReplies(post, body, htmlText, pageNo = 1) {
  4060. var _a, _b;
  4061. if (body.find("#no-comments-yet").length) {
  4062. return post;
  4063. }
  4064. let box = body.find("#Main > .box")[1];
  4065. let cells = box.querySelectorAll(".cell");
  4066. if (cells && cells.length) {
  4067. post.fr = cells[0].querySelector(".cell .fr").innerHTML;
  4068. cells = Array.from(cells);
  4069. }
  4070. let snow = cells[0].querySelector(".snow");
  4071. post.createDate = ((_b = (_a = snow == null ? void 0 : snow.nextSibling) == null ? void 0 : _a.nodeValue) == null ? void 0 : _b.trim()) || "";
  4072. let repliesMap = [];
  4073. if (cells[1].id) {
  4074. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(1)) });
  4075. let replyList = this.getAllReply(repliesMap);
  4076. post.replyList = replyList;
  4077. post.replyCount = replyList.length;
  4078. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  4079. let nestedList = this.createNestedList(replyList, post.allReplyUsers);
  4080. if (nestedList)
  4081. post.nestedReplies = nestedList;
  4082. return post;
  4083. } else {
  4084. let promiseList = [];
  4085. return new Promise((resolve, reject) => {
  4086. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  4087. let pages = cells[1].querySelectorAll("a");
  4088. pages = Array.from(pages);
  4089. let url = window.baseUrl + "/t/" + post.id;
  4090. for (let i = 0; i < pages.length; i++) {
  4091. let currentPageNo = Number(pages[i].innerText);
  4092. if (currentPageNo == pageNo)
  4093. continue;
  4094. promiseList.push(this.fetchPostOtherPageReplies(url + "?p=" + currentPageNo, currentPageNo));
  4095. }
  4096. Promise.allSettled(promiseList).then(
  4097. (results) => {
  4098. results.filter((result) => result.status === "fulfilled").map((v) => repliesMap.push(v.value));
  4099. let replyList = this.getAllReply(repliesMap);
  4100. post.replyList = replyList;
  4101. post.replyCount = replyList.length;
  4102. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  4103. let nestedList = this.createNestedList(replyList, post.allReplyUsers);
  4104. if (nestedList)
  4105. post.nestedReplies = nestedList;
  4106. resolve(post);
  4107. }
  4108. );
  4109. });
  4110. }
  4111. },
  4112. //请求帖子其他页的回复
  4113. fetchPostOtherPageReplies(href, pageNo) {
  4114. return new Promise((resolve) => {
  4115. $.get(href).then((res) => {
  4116. let s = res.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4117. let box = $(s[0]).find("#Main .box")[1];
  4118. let cells = box.querySelectorAll(".cell");
  4119. cells = Array.from(cells);
  4120. resolve({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  4121. }).catch((r) => {
  4122. if (r.status === 403) {
  4123. cbChecker({ type: "restorePost", value: null });
  4124. }
  4125. });
  4126. });
  4127. },
  4128. //解析页面的回复
  4129. parsePageReplies(nodes) {
  4130. let replyList = [];
  4131. nodes.forEach((node, index2) => {
  4132. if (!node.id)
  4133. return;
  4134. let item = {
  4135. level: 0,
  4136. thankCount: 0,
  4137. isThanked: false,
  4138. isOp: false,
  4139. id: node.id.replace("r_", "")
  4140. };
  4141. let reply_content = node.querySelector(".reply_content");
  4142. item.reply_content = this.checkPhotoLink2Img(reply_content.innerHTML);
  4143. item.reply_text = reply_content.textContent;
  4144. let { users, floor } = this.parseReplyContent(item.reply_content);
  4145. item.hideCallUserReplyContent = item.reply_content;
  4146. if (users.length === 1) {
  4147. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  4148. }
  4149. item.replyUsers = users;
  4150. item.replyFloor = floor;
  4151. let ago = node.querySelector(".ago");
  4152. item.date = ago.textContent;
  4153. let userNode = node.querySelector("strong a");
  4154. item.username = userNode.textContent;
  4155. let avatar = node.querySelector("td img");
  4156. item.avatar = avatar.src;
  4157. let no = node.querySelector(".no");
  4158. item.floor = Number(no.textContent);
  4159. let thank_area = node.querySelector(".thank_area");
  4160. if (thank_area) {
  4161. item.isThanked = thank_area.classList.contains("thanked");
  4162. }
  4163. let small = node.querySelector(".small");
  4164. if (small) {
  4165. item.thankCount = Number(small.textContent);
  4166. }
  4167. let op = node.querySelector(".op");
  4168. if (op) {
  4169. item.isOp = true;
  4170. }
  4171. let mod = node.querySelector(".mod");
  4172. if (mod) {
  4173. item.isMod = true;
  4174. }
  4175. replyList.push(item);
  4176. });
  4177. return replyList;
  4178. },
  4179. //解析回复内容,解析出@用户,回复楼层。用于后续生成嵌套楼层
  4180. parseReplyContent(str) {
  4181. if (!str)
  4182. return;
  4183. let users = [];
  4184. let getUsername = (userStr) => {
  4185. let endIndex = userStr.indexOf('">');
  4186. if (endIndex > -1) {
  4187. let user = userStr.substring(0, endIndex);
  4188. if (!users.find((i) => i === user)) {
  4189. users.push(user);
  4190. }
  4191. }
  4192. };
  4193. let userReg = /@<a href="\/member\/([\s\S]+?)<\/a>/g;
  4194. let has = str.matchAll(userReg);
  4195. let res2 = [...has];
  4196. if (res2.length > 1) {
  4197. res2.map((item) => {
  4198. getUsername(item[1]);
  4199. });
  4200. }
  4201. if (res2.length === 1) {
  4202. getUsername(res2[0][1]);
  4203. }
  4204. let floor = -1;
  4205. if (users.length === 1) {
  4206. let floorReg = /@<a href="\/member\/[\s\S]+?<\/a>[\s]+#([\d]+)/g;
  4207. let hasFloor = str.matchAll(floorReg);
  4208. let res = [...hasFloor];
  4209. if (res.length) {
  4210. floor = Number(res[0][1]);
  4211. }
  4212. }
  4213. return { users, floor };
  4214. },
  4215. //获取帖子详情
  4216. async getPostDetail(post, body, htmlText, pageNo = 1) {
  4217. post = await this.parsePostContent(post, body, htmlText);
  4218. return await this.getPostAllReplies(post, body, htmlText, pageNo);
  4219. },
  4220. getAllReply(repliesMap = []) {
  4221. return repliesMap.sort((a, b) => a.i - b.i).reduce((pre, i) => {
  4222. pre = pre.concat(i.replyList);
  4223. return pre;
  4224. }, []);
  4225. },
  4226. //生成嵌套回复
  4227. createNestedList(allList = []) {
  4228. if (!allList.length)
  4229. return [];
  4230. if (Date.now() - window.win().lastCallDate < 1e3) {
  4231. return false;
  4232. }
  4233. let list = window.clone(allList);
  4234. let nestedList = [];
  4235. list.map((item, index2) => {
  4236. let startList = list.slice(0, index2);
  4237. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  4238. let endList = list.slice(index2 + 1);
  4239. if (index2 === 0) {
  4240. nestedList.push(this.findChildren(item, endList, list));
  4241. } else {
  4242. if (!item.isUse) {
  4243. let isOneLevelReply = false;
  4244. if (item.replyUsers.length) {
  4245. if (item.replyUsers.length > 1) {
  4246. isOneLevelReply = true;
  4247. } else {
  4248. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  4249. }
  4250. } else {
  4251. isOneLevelReply = true;
  4252. }
  4253. if (isOneLevelReply) {
  4254. item.level === 0;
  4255. nestedList.push(this.findChildren(item, endList, list));
  4256. }
  4257. }
  4258. }
  4259. });
  4260. window.win().lastCallDate = Date.now();
  4261. return nestedList;
  4262. },
  4263. //查找子回复
  4264. findChildren(item, endList, all) {
  4265. var _a;
  4266. const fn = (child, endList2, parent) => {
  4267. child.level = parent.level + 1;
  4268. let rIndex = all.findIndex((v) => v.floor === child.floor);
  4269. if (rIndex > -1) {
  4270. all[rIndex].isUse = true;
  4271. }
  4272. parent.children.push(this.findChildren(child, endList2, all));
  4273. };
  4274. item.children = [];
  4275. let floorReplyList = [];
  4276. for (let i = 0; i < endList.length; i++) {
  4277. let currentItem = endList[i];
  4278. if (currentItem.isUse)
  4279. continue;
  4280. if (currentItem.replyFloor === item.floor) {
  4281. if (currentItem.replyUsers.length === 1 && currentItem.replyUsers[0] === item.username) {
  4282. currentItem.isUse = true;
  4283. floorReplyList.push({ endList: endList.slice(i + 1), currentItem });
  4284. } else {
  4285. currentItem.isWrong = true;
  4286. }
  4287. }
  4288. }
  4289. floorReplyList.reverse().map(({ currentItem, endList: endList2 }) => {
  4290. fn(currentItem, endList2, item);
  4291. });
  4292. let nextMeIndex = endList.findIndex((v) => {
  4293. var _a2;
  4294. return v.username === item.username && ((_a2 = v.replyUsers) == null ? void 0 : _a2[0]) !== item.username;
  4295. });
  4296. let findList = nextMeIndex > -1 ? endList.slice(0, nextMeIndex) : endList;
  4297. for (let i = 0; i < findList.length; i++) {
  4298. let currentItem = findList[i];
  4299. if (currentItem.isUse)
  4300. continue;
  4301. if (currentItem.replyUsers.length === 1) {
  4302. if (currentItem.replyFloor !== -1) {
  4303. if (((_a = all[currentItem.replyFloor - 1]) == null ? void 0 : _a.username) === currentItem.replyUsers[0]) {
  4304. continue;
  4305. }
  4306. }
  4307. let endList2 = endList.slice(i + 1);
  4308. if (currentItem.username === item.username) {
  4309. if (currentItem.replyUsers[0] === item.username) {
  4310. fn(currentItem, endList2, item);
  4311. }
  4312. break;
  4313. } else {
  4314. if (currentItem.replyUsers[0] === item.username) {
  4315. fn(currentItem, endList2, item);
  4316. }
  4317. }
  4318. } else {
  4319. if (currentItem.username === item.username)
  4320. break;
  4321. }
  4322. }
  4323. item.children = item.children.sort((a, b) => a.floor - b.floor);
  4324. return item;
  4325. },
  4326. //解析页面帖子列表
  4327. parsePagePostList(list, box) {
  4328. list.forEach((itemDom) => {
  4329. let item = window.clone(window.initPost);
  4330. let item_title = itemDom.querySelector(".item_title a");
  4331. let { href, id } = window.parse.parseA(item_title);
  4332. item.id = id;
  4333. item.href = href;
  4334. item.url = location.origin + "/api/topics/show.json?id=" + item.id;
  4335. itemDom.classList.add("post-item");
  4336. itemDom.classList.add(`id_${id}`);
  4337. itemDom.dataset["href"] = href;
  4338. itemDom.dataset["id"] = id;
  4339. window.postList.push(item);
  4340. });
  4341. Promise.allSettled(window.postList.map((item) => $.get(item.url))).then((res) => {
  4342. let ok = res.filter((r) => r.status === "fulfilled").map((v) => v.value[0]);
  4343. box.style.boxShadow = "unset";
  4344. box.style.background = "unset";
  4345. if (window.config.viewType === "card") {
  4346. list.forEach((itemDom) => itemDom.classList.add("preview"));
  4347. }
  4348. ok.map((postItem) => {
  4349. if (postItem == null ? void 0 : postItem.id) {
  4350. let itemDom = box.querySelector(`.id_${postItem.id}`);
  4351. if (window.config.showPreviewBtn) {
  4352. let td = itemDom.querySelector("td:nth-child(4)");
  4353. td.style.position = "relative";
  4354. let toggle = document.createElement("div");
  4355. toggle.dataset["id"] = postItem.id;
  4356. toggle.classList.add("toggle");
  4357. toggle.innerText = "点击展开/收起";
  4358. td.append(toggle);
  4359. }
  4360. let index2 = window.postList.findIndex((v) => v.id == postItem.id);
  4361. if (index2 > -1) {
  4362. let obj = window.postList[index2];
  4363. window.postList[index2] = Object.assign({}, obj, postItem);
  4364. if (postItem.content_rendered) {
  4365. let a = document.createElement("a");
  4366. a.href = obj.href;
  4367. a.classList.add("post-content");
  4368. let div = document.createElement("div");
  4369. div.innerHTML = postItem.content_rendered;
  4370. a.append(div);
  4371. itemDom.append(a);
  4372. }
  4373. }
  4374. }
  4375. });
  4376. cbChecker({ type: "syncData" });
  4377. });
  4378. },
  4379. parseA(a) {
  4380. let href = a.href;
  4381. let id;
  4382. if (href.includes("/t/")) {
  4383. id = href.substring(href.indexOf("/t/") + 3, href.indexOf("/t/") + 9);
  4384. }
  4385. return { href, id, title: a.innerText };
  4386. },
  4387. //创建记事本子条目
  4388. async createNoteItem(itemName) {
  4389. return new Promise(async (resolve) => {
  4390. let data = new FormData();
  4391. data.append("content", itemName);
  4392. data.append("parent_id", 0);
  4393. data.append("syntax", 0);
  4394. let apiRes = await window.win().fetch(`${window.baseUrl}/notes/new`, { method: "post", body: data });
  4395. console.log(apiRes);
  4396. if (apiRes.redirected && apiRes.status === 200) {
  4397. resolve(apiRes.url.substr(-5));
  4398. return;
  4399. }
  4400. resolve(null);
  4401. });
  4402. },
  4403. //编辑记事本子条目
  4404. async editNoteItem(val, id) {
  4405. let data = new FormData();
  4406. data.append("content", val);
  4407. data.append("syntax", 0);
  4408. let apiRes = await window.fetch(`${window.baseUrl}/notes/edit/${id}`, {
  4409. method: "post",
  4410. body: data
  4411. });
  4412. return apiRes.redirected && apiRes.status === 200;
  4413. },
  4414. //标签操作
  4415. async saveTags(val) {
  4416. return await this.editNoteItem(window.user.tagPrefix + JSON.stringify(val), window.user.tagsId);
  4417. },
  4418. //已读楼层操作
  4419. async saveReadList(val) {
  4420. return await this.editNoteItem(window.user.readPrefix + JSON.stringify(val), window.user.readNoteItemId);
  4421. },
  4422. //图片链接转Img标签
  4423. checkPhotoLink2Img(str) {
  4424. if (!str)
  4425. return;
  4426. try {
  4427. let imgWebs = [
  4428. /<a((?!<a).)*href="https?:\/\/((?!<a).)*imgur.com((?!<a).)*>(((?!<a).)*)<\/a>/g,
  4429. /<a((?!<a).)*href="https?:\/\/((?!<a).)*\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG)((?!<a).)*>(((?!<a).)*)<\/a>/g
  4430. ];
  4431. imgWebs.map((v, i) => {
  4432. let has = str.matchAll(v);
  4433. let res2 = [...has];
  4434. res2.map((r) => {
  4435. let p = i === 0 ? r[4] : r[5];
  4436. if (p) {
  4437. let link = p.toLowerCase();
  4438. let src = p;
  4439. if (link.includes(".png") || link.includes(".jpg") || link.includes(".jpeg") || link.includes(".gif")) {
  4440. } else {
  4441. src = p + ".png";
  4442. }
  4443. str = str.replace(r[0], `<img src="${src}" data-originUrl="${p}" data-notice="这个img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`);
  4444. }
  4445. });
  4446. });
  4447. } catch (e) {
  4448. console.log("正则解析html里面的a标签的图片链接出错了");
  4449. }
  4450. return str;
  4451. }
  4452. };
  4453. async function sleep(time) {
  4454. return new Promise((resolve) => {
  4455. setTimeout(resolve, time);
  4456. });
  4457. }
  4458. async function cbChecker(val, count = 0) {
  4459. if (window.cb) {
  4460. window.cb(val);
  4461. } else {
  4462. while (!window.cb && count < 20) {
  4463. await sleep(500);
  4464. count++;
  4465. }
  4466. window.cb && window.cb(val);
  4467. }
  4468. }
  4469. function feedback() {
  4470. _GM_openInTab("https://github.com/zyronon/v2ex-script/discussions/", {
  4471. active: true,
  4472. insert: true,
  4473. setParent: true
  4474. });
  4475. }
  4476. function initMonkeyMenu() {
  4477. try {
  4478. _GM_registerMenuCommand("脚本设置", function(event) {
  4479. cbChecker({ type: "openSetting" });
  4480. });
  4481. _GM_registerMenuCommand("💬 反馈 & 建议", feedback);
  4482. } catch (e) {
  4483. console.error("无法使用Tampermonkey");
  4484. }
  4485. }
  4486. function initStyle() {
  4487. let style2 = `
  4488. html, body {
  4489. font-size: 62.5%;
  4490. }
  4491.  
  4492. #Wrapper {
  4493. height: unset !important;
  4494. width: unset !important;
  4495. }
  4496.  
  4497. #Wrapper > .content {
  4498. height: unset !important;
  4499. width: unset !important;
  4500. }
  4501.  
  4502. .post-item {
  4503. background: white;
  4504. }
  4505.  
  4506. .post-item > .post-content {
  4507. height: 0;
  4508. margin-top: 0;
  4509. }
  4510.  
  4511. .post-item:hover .toggle {
  4512. display: flex;
  4513. }
  4514.  
  4515. .toggle {
  4516. position: absolute;
  4517. right: 0;
  4518. top: 0.5rem;
  4519. width: 9rem;
  4520. height: 100%;
  4521. display: flex;
  4522. justify-content: flex-end;
  4523. align-items: flex-end;
  4524. cursor: pointer;
  4525. font-size: 1.2rem;
  4526. color: #ccc;
  4527. display: none;
  4528. }
  4529.  
  4530. .preview {
  4531. margin: 1rem 0;
  4532. border: 1px solid #c8c8c8;
  4533. border-radius: 0.4rem;
  4534. cursor: pointer;
  4535. }
  4536.  
  4537. .preview:hover {
  4538. border: 1px solid #968b8b;
  4539. }
  4540.  
  4541. .preview > .post-content {
  4542. height: unset !important;
  4543. margin-top: 0.5rem !important;
  4544. }
  4545.  
  4546. .preview .topic-link:link {
  4547. color: black !important;
  4548. }
  4549.  
  4550. .post-content {
  4551. margin-top: 0.5rem;
  4552. display: block;
  4553. max-height: 20rem;
  4554. overflow: hidden;
  4555. text-decoration: unset !important;
  4556. line-break: anywhere;
  4557. -webkit-mask-image: linear-gradient(180deg,#000 60%,transparent);
  4558. }
  4559.  
  4560. .post-content:link {
  4561. color: #494949;
  4562. }
  4563.  
  4564.  
  4565. .post-content:visited {
  4566. color: #afb9c1 !important;
  4567. }
  4568.  
  4569. .Night .post-item {
  4570. background: #18222d !important;
  4571. }
  4572.  
  4573. .Night .preview {
  4574. border: 1px solid #3b536e;
  4575. }
  4576.  
  4577. .Night .preview > .post-content:link {
  4578. color: #d1d5d9;
  4579. }
  4580.  
  4581. .Night .preview > .post-content:visited {
  4582. color: #393f4e !important;
  4583. }
  4584.  
  4585. .Night .preview .topic-link:link {
  4586. color: #c0dbff !important;
  4587. }
  4588.  
  4589. `;
  4590. let addStyle2 = document.createElement("style");
  4591. addStyle2.rel = "stylesheet";
  4592. addStyle2.type = "text/css";
  4593. addStyle2.innerHTML = style2;
  4594. $(window.win().doc.head).append(addStyle2);
  4595. }
  4596. function qianDao() {
  4597. let timeNow = (/* @__PURE__ */ new Date()).getUTCFullYear() + "/" + ((/* @__PURE__ */ new Date()).getUTCMonth() + 1) + "/" + (/* @__PURE__ */ new Date()).getUTCDate();
  4598. if (window.pageType === PageType.Home) {
  4599. let qiandao = window.query('.box .inner a[href="/mission/daily"]');
  4600. if (qiandao) {
  4601. qianDao_(qiandao, timeNow);
  4602. } else if (window.win().doc.getElementById("gift_v2excellent")) {
  4603. window.win().doc.getElementById("gift_v2excellent").click();
  4604. localStorage.setItem("menu_clockInTime", timeNow);
  4605. console.info("[V2EX - 超级增强] 自动签到完成!");
  4606. } else {
  4607. console.info("[V2EX - 超级增强] 自动签到完成!");
  4608. }
  4609. } else {
  4610. let timeOld = localStorage.getItem("menu_clockInTime");
  4611. if (!timeOld || timeOld != timeNow) {
  4612. qianDaoStatus_(timeNow);
  4613. } else {
  4614. console.info("[V2EX - 超级增强] 自动签到完成!");
  4615. }
  4616. }
  4617. }
  4618. function qianDao_(qiandao, timeNow) {
  4619. let url = window.baseUrl + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector("div#Top .tools, #menu-body").innerHTML)[0];
  4620. console.log("url", url);
  4621. $.get(url).then((r) => {
  4622. let bodyText = r.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4623. let html = $(bodyText[0]);
  4624. if (html.find("li.fa.fa-ok-sign").length) {
  4625. html = html.find("#Main").text().match(/已连续登录(不可用) (\d+?) 天/)[0];
  4626. localStorage.setItem("menu_clockInTime", timeNow);
  4627. console.info("[V2EX - 超级增强] 自动签到完成!");
  4628. if (qiandao) {
  4629. qiandao.textContent = `自动签到完成!${html}`;
  4630. qiandao.href = "javascript:void(0);";
  4631. }
  4632. } else {
  4633. _GM_notification({
  4634. text: "自动签到失败!请访问 V2EX 首页试试。\n如果连续几天都签到失败,请联系作者解决!",
  4635. timeout: 4e3,
  4636. onclick() {
  4637. feedback();
  4638. }
  4639. });
  4640. console.warn("[V2EX 增强] 自动签到失败!请访问 V2EX 首页试试。如果连续几天都签到失败,请联系作者解决!");
  4641. if (qiandao)
  4642. qiandao.textContent = "自动签到失败!请尝试手动签到!";
  4643. }
  4644. });
  4645. }
  4646. function qianDaoStatus_(timeNow) {
  4647. $.get(window.baseUrl + "/mission/daily").then((r) => {
  4648. let bodyText = r.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4649. let html = $(bodyText[0]);
  4650. if (html.find('input[value^="领取"]').length) {
  4651. qianDao_(null, timeNow);
  4652. } else {
  4653. console.info("[V2EX 增强] 已经签过到了。");
  4654. localStorage.setItem("menu_clockInTime", timeNow);
  4655. }
  4656. });
  4657. }
  4658. function checkPageType() {
  4659. let location2 = window.win().location;
  4660. if (location2.pathname === "/") {
  4661. window.pageType = PageType.Home;
  4662. } else if (location2.href.match(/.com\/?tab=/)) {
  4663. window.pageType = PageType.Home;
  4664. } else if (location2.href.match(/.com\/go\//)) {
  4665. if (!location2.href.includes("/links")) {
  4666. window.pageType = PageType.Node;
  4667. }
  4668. } else if (location2.href.match(/.com\/recent/)) {
  4669. window.pageType = PageType.Home;
  4670. } else {
  4671. let r = location2.href.match(/.com\/t\/([\d]+)/);
  4672. if (r) {
  4673. window.pageType = PageType.Post;
  4674. window.pageData.id = r[1];
  4675. if (location2.search) {
  4676. let pr = location2.href.match(/\?p=([\d]+)/);
  4677. if (pr)
  4678. window.pageData.pageNo = Number(pr[1]);
  4679. }
  4680. }
  4681. }
  4682. }
  4683. function getNoteItemContent(id, prefix) {
  4684. return new Promise((resolve, reject) => {
  4685. $.get(window.baseUrl + "/notes/edit/" + id).then((r2) => {
  4686. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4687. let body = $(bodyText[0]);
  4688. let text = body.find(".note_editor").text();
  4689. if (text === prefix) {
  4690. resolve({});
  4691. } else {
  4692. let tagJson = text.substring(prefix.length);
  4693. try {
  4694. resolve(JSON.parse(tagJson));
  4695. } catch (e) {
  4696. console.log("tage", tagJson);
  4697. resolve({});
  4698. }
  4699. }
  4700. });
  4701. });
  4702. }
  4703. async function initNoteData() {
  4704. $.get(window.baseUrl + "/notes").then(async (r) => {
  4705. let bodyText = r.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4706. let body = $(bodyText[0]);
  4707. let items = body.find("#Main .box .note_item_title a");
  4708. if (items.length) {
  4709. let tagItem = Array.from(items).find((v) => v.innerText.includes(window.user.tagPrefix));
  4710. if (tagItem) {
  4711. window.user.tagsId = tagItem.href.substr(-5);
  4712. window.user.tags = await getNoteItemContent(window.user.tagsId, window.user.tagPrefix);
  4713. } else {
  4714. let r2 = await window.parse.createNoteItem(window.user.tagPrefix);
  4715. r2 && (window.user.tagsId = r2);
  4716. }
  4717. let readItem = Array.from(items).find((v) => v.innerText.includes(window.user.readPrefix));
  4718. if (readItem) {
  4719. window.user.readNoteItemId = readItem.href.substr(-5);
  4720. window.user.readList = await getNoteItemContent(window.user.readNoteItemId, window.user.readPrefix);
  4721. } else {
  4722. let r2 = await window.parse.createNoteItem(window.user.readPrefix);
  4723. r2 && (window.user.readNoteItemId = r2);
  4724. }
  4725. cbChecker({ type: "syncData" });
  4726. }
  4727. });
  4728. }
  4729. function initConfig() {
  4730. return new Promise((resolve) => {
  4731. let configStr = window.win().localStorage.getItem("v2ex-config");
  4732. if (configStr) {
  4733. let configObj = JSON.parse(configStr);
  4734. configObj = configObj[window.user.username ?? "default"];
  4735. if (configObj) {
  4736. window.config = Object.assign(window.config, configObj);
  4737. }
  4738. }
  4739. resolve(window.config);
  4740. });
  4741. }
  4742. function initSoV2ex() {
  4743. var $search = $("#search");
  4744. var searchEvents = $._data($search[0], "events");
  4745. console.log($search, searchEvents);
  4746. var oKeydownEvent = searchEvents["keydown"][0]["handler"];
  4747. var oInputEvent = searchEvents["input"][0]["handler"];
  4748. $search.attr("placeholder", "sov2ex");
  4749. $search.unbind("keydown", oKeydownEvent);
  4750. $search.unbind("input", oInputEvent);
  4751. $search.on("input", function(e) {
  4752. oInputEvent(e);
  4753. $(".search-item:last").attr("href", "https://www.sov2ex.com/?q=" + $search.val()).text("sov2ex " + $search.val());
  4754. });
  4755. $search.keydown(function(e) {
  4756. if (e.code == "Enter" || e.code == "NumpadEnter" || e.keyCode === 13) {
  4757. if ($(".search-item:last").is(".active")) {
  4758. $(this).val($(this).val().replace(/[#%&]/g, ""));
  4759. window.open("https://www.sov2ex.com/?q=" + $(this).val());
  4760. return 0;
  4761. }
  4762. }
  4763. oKeydownEvent(e);
  4764. });
  4765. }
  4766. function addSettingText() {
  4767. let setting = $(`<a href="javascript:void 0;" class="top">脚本设置</a>`);
  4768. setting.on("click", () => {
  4769. cbChecker({ type: "openSetting" });
  4770. });
  4771. $(".tools").prepend(setting);
  4772. }
  4773. function initCustomBgColor() {
  4774. let style2 = `#Wrapper {
  4775. background-color: ${window.config.customBgColor} !important;
  4776. background-image: unset !important;
  4777. }`;
  4778. let addStyle2 = document.createElement("style");
  4779. addStyle2.rel = "stylesheet";
  4780. addStyle2.type = "text/css";
  4781. addStyle2.innerHTML = style2;
  4782. $(window.win().doc.head).append(addStyle2);
  4783. }
  4784. function init() {
  4785. checkPageType();
  4786. initMonkeyMenu();
  4787. initStyle();
  4788. let top2 = document.querySelector(".tools .top:nth-child(2)");
  4789. if (top2 && top2.textContent !== "注册(不可用)") {
  4790. window.user.username = top2.textContent;
  4791. window.user.avatar = $("#Rightbar .box .avatar").attr("src");
  4792. initNoteData();
  4793. }
  4794. addSettingText();
  4795. initConfig().then((r) => {
  4796. if (window.config.sov2ex) {
  4797. setTimeout(initSoV2ex, 1e3);
  4798. }
  4799. if (window.config.customBgColor) {
  4800. initCustomBgColor();
  4801. }
  4802. try {
  4803. if (window.config.autoSignin && window.user.username) {
  4804. qianDao();
  4805. }
  4806. } catch (e) {
  4807. console.log("签到失败");
  4808. }
  4809. });
  4810. let box;
  4811. let list;
  4812. switch (window.pageType) {
  4813. case PageType.Node:
  4814. box = window.win().doc.querySelectorAll("#Wrapper #Main .box");
  4815. let topics = box[1].querySelector("#TopicsNode");
  4816. list = topics.querySelectorAll(".cell");
  4817. list[0].before($section);
  4818. window.parse.parsePagePostList(list, box[1]);
  4819. break;
  4820. case PageType.Home:
  4821. box = document.querySelector("#Wrapper #Main .box");
  4822. list = box.querySelectorAll(".item");
  4823. list[0].before($section);
  4824. window.parse.parsePagePostList(list, box);
  4825. break;
  4826. case PageType.Post:
  4827. if (window.config.postWidth) {
  4828. let Main = $("#Main");
  4829. Main.css({
  4830. "width": window.config.postWidth,
  4831. margin: "unset"
  4832. });
  4833. $("#Wrapper > .content").css({
  4834. "max-width": "unset",
  4835. display: "flex",
  4836. "justify-content": "center",
  4837. gap: "20px"
  4838. });
  4839. Main.after($("#Rightbar"));
  4840. }
  4841. box = document.querySelector("#Wrapper #Main .box");
  4842. box.after($section);
  4843. let post = Object.assign({}, window.clone(window.initPost), { id: window.pageData.id });
  4844. let body = $(window.win().doc.body);
  4845. let htmlText = window.win().doc.documentElement.outerHTML;
  4846. window.parse.parsePostContent(
  4847. post,
  4848. body,
  4849. htmlText
  4850. ).then(async (res) => {
  4851. await cbChecker({ type: "postContent", value: res }, 0);
  4852. });
  4853. window.parse.getPostAllReplies(
  4854. post,
  4855. body,
  4856. htmlText,
  4857. window.pageData.pageNo
  4858. ).then(async (res) => {
  4859. await cbChecker({ type: "postReplies", value: res }, 0);
  4860. });
  4861. break;
  4862. default:
  4863. console.error("未知页面");
  4864. break;
  4865. }
  4866. }
  4867. window.canParseV2exPage = !window.location.href.includes("script=0");
  4868. if (window.canParseV2exPage) {
  4869. init();
  4870. } else {
  4871. alert("脚本无法查看此主题,已为您单独打开此主题");
  4872. }
  4873. }
  4874. run();
  4875. let vueApp = vue.createApp(App);
  4876. vueApp.config.unwrapInjectedRef = true;
  4877. vueApp.mount($section);
  4878.  
  4879. })(Vue);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址