V2EX - 超级增强

让V2EX现代化。支持楼中楼、简洁模式、高赞回复排序、发送图片和表情、base64 解码等功能

当前为 2023-12-09 提交的版本,查看 最新版本

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

QingJ © 2025

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