V2EX - 超级增强

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

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

  1. // ==UserScript==
  2. // @name V2EX - 超级增强
  3. // @namespace http://tampermonkey.net/
  4. // @version 7.3
  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-b4b79ce2]{width:100%;box-sizing:border-box;margin-top:.6rem}.comment.isLevelOne[data-v-b4b79ce2]{border-bottom:1px solid #ececec;padding:.8rem 1rem;margin-top:0}.comment.ding[data-v-b4b79ce2]{background:rgba(255,255,0,.3)!important}.comment.isSimple .avatar[data-v-b4b79ce2],.comment.isSimple .expand-line[data-v-b4b79ce2]{display:none}.comment.isSimple .simple-wrapper[data-v-b4b79ce2]{padding-left:2.8rem}.comment.isSimple .w[data-v-b4b79ce2]{padding-left:0!important;padding-top:.5rem}.comment .comment-content-w .more[data-v-b4b79ce2]{text-align:center;margin:2rem 0}.comment .comment-content[data-v-b4b79ce2]{display:flex;position:relative}.comment .comment-content .expand-line[data-v-b4b79ce2]{cursor:pointer;margin-top:.6rem;width:2.8rem;min-width:2.8rem;position:relative}.comment .comment-content .expand-line[data-v-b4b79ce2]:after{position:absolute;left:50%;content:" ";height:100%;width:0;border-right:1px solid #ececec}.comment .comment-content .expand-line[data-v-b4b79ce2]:hover:after{border-right:2px solid #0079D3}.comment .comment-content .right[data-v-b4b79ce2]{flex:1;width:calc(100% - 3rem)}.comment .comment-content .right .w[data-v-b4b79ce2]{padding-left:1rem}.comment .comment-content .right .w .post-editor-wrapper[data-v-b4b79ce2]{margin-top:1rem}.wrong-wrapper[data-v-b4b79ce2]{font-size:1.4rem;margin-bottom:1rem}.wrong-wrapper span[data-v-b4b79ce2]{cursor:pointer}.wrong-wrapper .del-line[data-v-b4b79ce2]{text-decoration:line-through}.wrong-wrapper .wrong-icon[data-v-b4b79ce2]{margin-left:.5rem}.wrong-wrapper .warning[data-v-b4b79ce2]{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-98d8cde8],.isNight .nav[data-v-98d8cde8]{color:#fff;background:#18222d;border-bottom:1px solid #22303f}.card[data-v-98d8cde8]{border-radius:0 0 .4rem .4rem;overflow:hidden}.nav[data-v-98d8cde8]{font-size:1.4rem;background:white;padding:1rem;border-bottom:1px solid #e2e2e2}.target-user-tags[data-v-98d8cde8]{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-98d8cde8]{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. console.log("ban", ban);
  1850. if (ban < rect.width && rect.width < ban + 25 && this.modelValue.children.length) {
  1851. this.expand = false;
  1852. let padding = 2;
  1853. this.cssStyle = {
  1854. padding: "1rem 0",
  1855. width: `calc(${postDetailWidth}px - ${padding}rem)`,
  1856. transform: `translateX(calc(${rect.width - postDetailWidth}px + ${padding}rem))`,
  1857. background: this.isNight ? "#18222d" : "white"
  1858. };
  1859. }
  1860. }
  1861. },
  1862. //高亮一下
  1863. showDing() {
  1864. this.ding = true;
  1865. setTimeout(() => {
  1866. this.ding = false;
  1867. }, 2e3);
  1868. },
  1869. hide() {
  1870. let url = `${window.baseUrl}/ignore/reply/${this.modelValue.id}?once=${this.post.once}`;
  1871. eventBus.emit(CMD.REMOVE, this.modelValue.floor);
  1872. $.post(url).then((res) => {
  1873. eventBus.emit(CMD.REFRESH_ONCE);
  1874. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "隐藏成功" });
  1875. }, (err) => {
  1876. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "隐藏成功,仅本次有效(接口调用失败!)" });
  1877. });
  1878. },
  1879. toggle() {
  1880. this.expand = !this.expand;
  1881. },
  1882. toggleContent() {
  1883. if (this.modelValue.level === 0 && this.modelValue.replyUsers.length === 0)
  1884. return;
  1885. this.showOrigin = !this.showOrigin;
  1886. }
  1887. }
  1888. };
  1889. const _withScopeId$6 = (n2) => (vue.pushScopeId("data-v-b4b79ce2"), n2 = n2(), vue.popScopeId(), n2);
  1890. const _hoisted_1$8 = ["data-floor"];
  1891. const _hoisted_2$7 = { class: "comment-content" };
  1892. const _hoisted_3$5 = { class: "right" };
  1893. const _hoisted_4$5 = { class: "w" };
  1894. const _hoisted_5$5 = {
  1895. key: 0,
  1896. class: "wrong-wrapper"
  1897. };
  1898. const _hoisted_6$5 = ["href"];
  1899. const _hoisted_7$4 = { class: "del-line" };
  1900. const _hoisted_8$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("i", {
  1901. class: "fa fa-question-circle-o wrong-icon",
  1902. "aria-hidden": "true"
  1903. }, null, -1));
  1904. const _hoisted_9$3 = {
  1905. key: 0,
  1906. class: "warning"
  1907. };
  1908. const _hoisted_10$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1909. const _hoisted_11$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1910. const _hoisted_12$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1911. const _hoisted_13$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1912. const _hoisted_14$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  1913. const _hoisted_15$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("a", {
  1914. href: "https://github.com/zyronon/v2ex-script/discussions/7",
  1915. target: "_blank"
  1916. }, "这里", -1));
  1917. const _hoisted_16$2 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("p", null, "---原文---", -1));
  1918. const _hoisted_17$2 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("p", null, "-----------", -1));
  1919. const _hoisted_18$2 = { class: "simple-wrapper" };
  1920. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  1921. const _component_Author = vue.resolveComponent("Author");
  1922. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  1923. const _component_PostEditor = vue.resolveComponent("PostEditor");
  1924. const _component_Comment = vue.resolveComponent("Comment", true);
  1925. return vue.openBlock(), vue.createElementBlock("div", {
  1926. class: vue.normalizeClass(["comment", $options.myClass]),
  1927. ref: "comment",
  1928. "data-floor": $data.floor
  1929. }, [
  1930. vue.createVNode(_component_Author, {
  1931. modelValue: $data.expand,
  1932. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  1933. comment: $props.modelValue,
  1934. onReply: _cache[1] || (_cache[1] = ($event) => $data.edit = !$data.edit),
  1935. type: $props.type,
  1936. onHide: $options.hide
  1937. }, null, 8, ["modelValue", "comment", "type", "onHide"]),
  1938. $data.cssStyle && !$data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  1939. key: 0,
  1940. class: "more ago",
  1941. onClick: _cache[2] || (_cache[2] = ($event) => $data.expand = !$data.expand)
  1942. }, " 由于嵌套回复层级太深,自动将后续回复隐藏 ")) : vue.createCommentVNode("", true),
  1943. $data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  1944. key: 1,
  1945. class: "comment-content-w",
  1946. style: vue.normalizeStyle($data.cssStyle)
  1947. }, [
  1948. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  1949. key: 0,
  1950. class: "more ago",
  1951. onClick: _cache[3] || (_cache[3] = ($event) => $data.expand = !$data.expand)
  1952. }, " 由于嵌套回复层级太深,自动将以下回复移至可见范围 ")) : vue.createCommentVNode("", true),
  1953. vue.createElementVNode("div", _hoisted_2$7, [
  1954. vue.createElementVNode("div", {
  1955. class: "left expand-line",
  1956. onClick: _cache[4] || (_cache[4] = (...args) => $options.toggle && $options.toggle(...args))
  1957. }),
  1958. vue.createElementVNode("div", _hoisted_3$5, [
  1959. vue.createElementVNode("div", _hoisted_4$5, [
  1960. $props.modelValue.isWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
  1961. vue.createElementVNode("span", {
  1962. onClick: _cache[5] || (_cache[5] = ($event) => $data.expandWrong = !$data.expandWrong),
  1963. title: "点击楼层号查看提示"
  1964. }, [
  1965. vue.createElementVNode("a", {
  1966. href: "/member/" + $props.modelValue.replyUsers[0]
  1967. }, "@" + vue.toDisplayString($props.modelValue.replyUsers[0]) + "  ", 9, _hoisted_6$5),
  1968. vue.createElementVNode("span", _hoisted_7$4, "#" + vue.toDisplayString($props.modelValue.replyFloor), 1),
  1969. _hoisted_8$4
  1970. ]),
  1971. $data.expandWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$3, [
  1972. vue.createTextVNode(" 这条回复似乎有点问题,指定的楼层号与@的人对应不上 "),
  1973. _hoisted_10$3,
  1974. vue.createTextVNode(" 原因可能有下面几种: "),
  1975. _hoisted_11$3,
  1976. vue.createTextVNode(" 一、屏蔽用户导致楼层塌陷:你屏蔽了A,自A以后的回复的楼层号都会减1 "),
  1977. _hoisted_12$3,
  1978. vue.createTextVNode(" 二、忽略回复导致楼层塌陷:原理同上 "),
  1979. _hoisted_13$3,
  1980. vue.createTextVNode(" 三、层主回复时指定错了楼层号(同一,层主屏蔽了别人,导致楼层塌陷) "),
  1981. _hoisted_14$3,
  1982. vue.createTextVNode(" 四、脚本解析错误,请在"),
  1983. _hoisted_15$3,
  1984. vue.createTextVNode("反馈 ")
  1985. ])) : vue.createCommentVNode("", true)
  1986. ])) : vue.createCommentVNode("", true),
  1987. $options.config.commentDisplayType === $options.CommentDisplayType.FloorInFloorNoCallUser && this.type !== "top" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  1988. $data.showOrigin ? (vue.openBlock(), vue.createElementBlock("div", {
  1989. key: 0,
  1990. onDblclick: _cache[6] || (_cache[6] = (...args) => $options.toggleContent && $options.toggleContent(...args))
  1991. }, [
  1992. _hoisted_16$2,
  1993. vue.createVNode(_component_BaseHtmlRender, {
  1994. class: "reply_content",
  1995. html: $props.modelValue.reply_content
  1996. }, null, 8, ["html"]),
  1997. _hoisted_17$2
  1998. ], 32)) : vue.createCommentVNode("", true),
  1999. vue.createVNode(_component_BaseHtmlRender, {
  2000. class: "reply_content",
  2001. onDblclick: $options.toggleContent,
  2002. html: $props.modelValue.hideCallUserReplyContent
  2003. }, null, 8, ["onDblclick", "html"])
  2004. ], 64)) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  2005. key: 2,
  2006. class: "reply_content",
  2007. html: $props.modelValue.reply_content
  2008. }, null, 8, ["html"])),
  2009. $data.edit ? (vue.openBlock(), vue.createBlock(_component_PostEditor, {
  2010. key: 3,
  2011. onClose: _cache[7] || (_cache[7] = ($event) => $data.edit = false),
  2012. replyInfo: $data.replyInfo,
  2013. replyUser: $props.modelValue.username,
  2014. replyFloor: $props.modelValue.floor
  2015. }, null, 8, ["replyInfo", "replyUser", "replyFloor"])) : vue.createCommentVNode("", true)
  2016. ]),
  2017. vue.createElementVNode("div", _hoisted_18$2, [
  2018. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index2) => {
  2019. return vue.openBlock(), vue.createBlock(_component_Comment, {
  2020. modelValue: $props.modelValue.children[index2],
  2021. "onUpdate:modelValue": ($event) => $props.modelValue.children[index2] = $event,
  2022. key: index2
  2023. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  2024. }), 128))
  2025. ])
  2026. ])
  2027. ]),
  2028. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  2029. key: 1,
  2030. class: "more ago",
  2031. onClick: _cache[8] || (_cache[8] = ($event) => $data.expand = !$data.expand)
  2032. }, " 由于嵌套回复层级太深,自动将以上回复移至可见范围 ")) : vue.createCommentVNode("", true)
  2033. ], 4)) : vue.createCommentVNode("", true)
  2034. ], 10, _hoisted_1$8);
  2035. }
  2036. const Comment = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$4], ["__scopeId", "data-v-b4b79ce2"]]);
  2037. const _sfc_main$7 = {
  2038. name: "Toolbar",
  2039. inject: [
  2040. "isLogin",
  2041. "post",
  2042. "pageType"
  2043. ],
  2044. data() {
  2045. return {
  2046. timer: null,
  2047. loading: false,
  2048. loading2: false,
  2049. loading3: false
  2050. };
  2051. },
  2052. methods: {
  2053. checkIsLogin(emitName = "") {
  2054. if (!this.isLogin) {
  2055. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录(不可用)!" });
  2056. return false;
  2057. }
  2058. this.$emit(emitName);
  2059. return true;
  2060. },
  2061. getColor(val) {
  2062. return val ? "#ff4500" : "#929596";
  2063. },
  2064. getIsFull(val) {
  2065. return val ? "#ff4500" : "none";
  2066. },
  2067. tweet() {
  2068. if (!this.checkIsLogin())
  2069. return;
  2070. let username = window.user.username;
  2071. let url = `https://twitter.com/intent/tweet?url=${window.baseUrl}/t/${this.post.id}?r=${username}&related=v2ex&text=${this.post.title}`;
  2072. window.win().open(url, "_blank", "width=550,height=370");
  2073. },
  2074. report() {
  2075. if (!this.checkIsLogin())
  2076. return;
  2077. if (!this.isLogin)
  2078. return;
  2079. if (this.post.isReport)
  2080. return;
  2081. let username = window.user.username;
  2082. 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}`;
  2083. window.win().open(url, "_blank", "width=550,height=370");
  2084. },
  2085. async toggleIgnore() {
  2086. if (!this.checkIsLogin())
  2087. return;
  2088. let url = `${window.baseUrl}/${this.post.isIgnore ? "unignore" : "ignore"}/topic/${this.post.id}?once=${this.post.once}`;
  2089. if (this.pageType === "post") {
  2090. this.loading2 = true;
  2091. let apiRes = await window.win().fetch(url);
  2092. if (apiRes.redirected) {
  2093. if (!this.post.isIgnore) {
  2094. window.win().location = window.baseUrl;
  2095. }
  2096. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  2097. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  2098. } else {
  2099. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略失败" });
  2100. }
  2101. this.loading2 = false;
  2102. } else {
  2103. if (this.post.isIgnore) {
  2104. this.loading2 = true;
  2105. } else {
  2106. eventBus.emit(CMD.IGNORE);
  2107. }
  2108. let apiRes = await window.win().fetch(url);
  2109. if (apiRes.redirected) {
  2110. if (this.post.isIgnore) {
  2111. eventBus.emit(CMD.REFRESH_ONCE);
  2112. }
  2113. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  2114. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  2115. } else {
  2116. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略成功,仅本次有效(接口调用失败!)" });
  2117. }
  2118. this.loading2 = false;
  2119. }
  2120. },
  2121. async toggleFavorite() {
  2122. if (!this.post.isFavorite && config.collectBrowserNotice) {
  2123. alert("请按Command/Cmd/CTRL + D添加到书签");
  2124. }
  2125. if (!this.checkIsLogin())
  2126. return;
  2127. this.loading = true;
  2128. let url = `${window.baseUrl}/${this.post.isFavorite ? "unfavorite" : "favorite"}/topic/${this.post.id}?once=${this.post.once}`;
  2129. let apiRes = await window.win().fetch(url);
  2130. this.loading = false;
  2131. if (apiRes.redirected) {
  2132. let htmlText = await apiRes.text();
  2133. if (htmlText.search(this.post.isFavorite ? "加入收藏" : "取消收藏")) {
  2134. eventBus.emit(CMD.MERGE, { collectCount: this.post.isFavorite ? this.post.collectCount - 1 : this.post.collectCount + 1 });
  2135. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isFavorite ? "取消成功" : "收藏成功" });
  2136. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  2137. eventBus.emit(CMD.MERGE, { isFavorite: !this.post.isFavorite });
  2138. return;
  2139. }
  2140. }
  2141. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败" });
  2142. }
  2143. }
  2144. };
  2145. const _withScopeId$5 = (n2) => (vue.pushScopeId("data-v-07fa3ae8"), n2 = n2(), vue.popScopeId(), n2);
  2146. const _hoisted_1$7 = { class: "toolbar" };
  2147. 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);
  2148. const _hoisted_4$4 = [
  2149. _hoisted_2$6
  2150. ];
  2151. const _hoisted_5$4 = {
  2152. viewBox: "0 0 48 48",
  2153. fill: "none",
  2154. xmlns: "http://www.w3.org/2000/svg"
  2155. };
  2156. const _hoisted_6$4 = ["fill", "stroke"];
  2157. const _hoisted_7$3 = {
  2158. key: 1,
  2159. class: "tool no-hover"
  2160. };
  2161. const _hoisted_8$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  2162. viewBox: "0 0 48 48",
  2163. fill: "none",
  2164. xmlns: "http://www.w3.org/2000/svg"
  2165. }, [
  2166. /* @__PURE__ */ vue.createElementVNode("path", {
  2167. d: "M28 6H42V20",
  2168. stroke: "#929596",
  2169. "stroke-width": "2",
  2170. "stroke-linecap": "round",
  2171. "stroke-linejoin": "round"
  2172. }),
  2173. /* @__PURE__ */ vue.createElementVNode("path", {
  2174. 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",
  2175. stroke: "#929596",
  2176. "stroke-width": "2",
  2177. "stroke-linecap": "round",
  2178. "stroke-linejoin": "round"
  2179. }),
  2180. /* @__PURE__ */ vue.createElementVNode("path", {
  2181. d: "M25.7998 22.1999L41.0998 6.8999",
  2182. stroke: "#929596",
  2183. "stroke-width": "2",
  2184. "stroke-linecap": "round",
  2185. "stroke-linejoin": "round"
  2186. })
  2187. ], -1));
  2188. const _hoisted_9$2 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "Tweet", -1));
  2189. const _hoisted_10$2 = [
  2190. _hoisted_8$3,
  2191. _hoisted_9$2
  2192. ];
  2193. const _hoisted_11$2 = {
  2194. viewBox: "0 0 48 48",
  2195. fill: "none",
  2196. xmlns: "http://www.w3.org/2000/svg"
  2197. };
  2198. const _hoisted_12$2 = ["fill", "stroke"];
  2199. const _hoisted_13$2 = ["fill", "stroke"];
  2200. const _hoisted_14$2 = ["fill", "stroke"];
  2201. 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);
  2202. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  2203. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
  2204. vue.createElementVNode("div", {
  2205. class: "tool",
  2206. onClick: _cache[0] || (_cache[0] = ($event) => $options.checkIsLogin("reply"))
  2207. }, _hoisted_4$4),
  2208. $options.post.once ? (vue.openBlock(), vue.createElementBlock("div", {
  2209. key: 0,
  2210. class: vue.normalizeClass(["tool", { loading: $data.loading }]),
  2211. onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleFavorite && $options.toggleFavorite(...args))
  2212. }, [
  2213. (vue.openBlock(), vue.createElementBlock("svg", _hoisted_5$4, [
  2214. vue.createElementVNode("path", {
  2215. 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",
  2216. fill: $options.getIsFull($options.post.isFavorite),
  2217. stroke: $options.getColor($options.post.isFavorite),
  2218. "stroke-width": "2",
  2219. "stroke-linejoin": "round"
  2220. }, null, 8, _hoisted_6$4)
  2221. ])),
  2222. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isFavorite ? "取消收藏" : "加入收藏"), 1)
  2223. ], 2)) : vue.createCommentVNode("", true),
  2224. $options.post.once && $options.post.collectCount !== 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$3, [
  2225. vue.createElementVNode("span", null, vue.toDisplayString($options.post.collectCount + "人收藏"), 1)
  2226. ])) : vue.createCommentVNode("", true),
  2227. vue.createElementVNode("div", {
  2228. class: "tool",
  2229. onClick: _cache[2] || (_cache[2] = (...args) => $options.tweet && $options.tweet(...args))
  2230. }, _hoisted_10$2),
  2231. $options.post.once ? (vue.openBlock(), vue.createElementBlock("div", {
  2232. key: 2,
  2233. class: vue.normalizeClass(["tool", { "loading": $data.loading2 }]),
  2234. onClick: _cache[3] || (_cache[3] = (...args) => $options.toggleIgnore && $options.toggleIgnore(...args))
  2235. }, [
  2236. (vue.openBlock(), vue.createElementBlock("svg", _hoisted_11$2, [
  2237. vue.createElementVNode("path", {
  2238. fill: $options.getIsFull($options.post.isIgnore),
  2239. stroke: $options.getColor($options.post.isIgnore),
  2240. 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",
  2241. "stroke-width": "2",
  2242. "stroke-linecap": "round",
  2243. "stroke-linejoin": "round"
  2244. }, null, 8, _hoisted_12$2),
  2245. vue.createElementVNode("path", {
  2246. fill: $options.getIsFull($options.post.isIgnore),
  2247. 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",
  2248. stroke: $options.getColor($options.post.isIgnore),
  2249. "stroke-width": "2",
  2250. "stroke-linecap": "round",
  2251. "stroke-linejoin": "round"
  2252. }, null, 8, _hoisted_13$2),
  2253. vue.createElementVNode("path", {
  2254. d: "M42 42L6 6",
  2255. fill: $options.getIsFull($options.post.isIgnore),
  2256. stroke: $options.getColor($options.post.isIgnore),
  2257. "stroke-width": "2",
  2258. "stroke-linecap": "round",
  2259. "stroke-linejoin": "round"
  2260. }, null, 8, _hoisted_14$2)
  2261. ])),
  2262. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isIgnore ? "取消忽略" : "忽略主题"), 1)
  2263. ], 2)) : vue.createCommentVNode("", true),
  2264. $options.post.once && $options.post.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  2265. key: 3,
  2266. class: vue.normalizeClass(["tool", { "loading": $data.loading3, "no-hover": $options.post.isLogin }]),
  2267. onClick: _cache[4] || (_cache[4] = (...args) => $options.report && $options.report(...args))
  2268. }, [
  2269. _hoisted_15$2,
  2270. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isReport ? "你已对本主题进行了报告" : "报告这个主题"), 1)
  2271. ], 2)) : vue.createCommentVNode("", true)
  2272. ]);
  2273. }
  2274. const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$3], ["__scopeId", "data-v-07fa3ae8"]]);
  2275. const _withScopeId$4 = (n2) => (vue.pushScopeId("data-v-0b71f2b8"), n2 = n2(), vue.popScopeId(), n2);
  2276. const _hoisted_1$6 = ["href"];
  2277. const _hoisted_2$5 = ["src"];
  2278. const _hoisted_3$4 = { class: "texts" };
  2279. const _hoisted_4$3 = {
  2280. key: 0,
  2281. class: "point"
  2282. };
  2283. const _hoisted_5$3 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  2284. width: "19",
  2285. height: "19",
  2286. viewBox: "0 0 48 48",
  2287. fill: "none"
  2288. }, [
  2289. /* @__PURE__ */ vue.createElementVNode("path", {
  2290. 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",
  2291. fill: "#E02A2A",
  2292. stroke: "#E02A2A",
  2293. "stroke-width": "2",
  2294. "stroke-linecap": "round",
  2295. "stroke-linejoin": "round"
  2296. })
  2297. ], -1));
  2298. const _hoisted_6$3 = { class: "num" };
  2299. const _hoisted_7$2 = { class: "my-tag" };
  2300. const _hoisted_8$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  2301. const _hoisted_9$1 = {
  2302. key: 2,
  2303. class: "ago"
  2304. };
  2305. const _hoisted_10$1 = {
  2306. key: 3,
  2307. class: "mod"
  2308. };
  2309. const _hoisted_11$1 = {
  2310. key: 4,
  2311. class: "op"
  2312. };
  2313. const _hoisted_12$1 = ["href"];
  2314. const _hoisted_13$1 = {
  2315. key: 5,
  2316. class: "op"
  2317. };
  2318. const _hoisted_14$1 = {
  2319. key: 6,
  2320. class: "mod"
  2321. };
  2322. const _hoisted_15$1 = {
  2323. key: 7,
  2324. class: "ago"
  2325. };
  2326. const _hoisted_16$1 = { class: "my-tag" };
  2327. const _hoisted_17$1 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  2328. const _hoisted_18$1 = {
  2329. key: 9,
  2330. class: "point"
  2331. };
  2332. const _hoisted_19$1 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  2333. width: "19",
  2334. height: "19",
  2335. viewBox: "0 0 48 48",
  2336. fill: "none"
  2337. }, [
  2338. /* @__PURE__ */ vue.createElementVNode("path", {
  2339. 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",
  2340. fill: "#E02A2A",
  2341. stroke: "#E02A2A",
  2342. "stroke-width": "2",
  2343. "stroke-linecap": "round",
  2344. "stroke-linejoin": "round"
  2345. })
  2346. ], -1));
  2347. const _hoisted_20$1 = { class: "num" };
  2348. const _hoisted_21$1 = ["href"];
  2349. const _hoisted_22$1 = ["src"];
  2350. const _hoisted_23$1 = { class: "Author-right" };
  2351. const _hoisted_24$1 = { class: "floor" };
  2352. const _hoisted_25$1 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  2353. const _hoisted_26$1 = [
  2354. _hoisted_25$1
  2355. ];
  2356. const _sfc_main$6 = {
  2357. __name: "SingleComment",
  2358. props: {
  2359. comment: {
  2360. reply_content: ""
  2361. },
  2362. isRight: {
  2363. type: Boolean,
  2364. default() {
  2365. return false;
  2366. }
  2367. }
  2368. },
  2369. setup(__props) {
  2370. const props = __props;
  2371. const config2 = vue.inject("config");
  2372. const isLogin = vue.inject("isLogin");
  2373. const tags = vue.inject("tags");
  2374. const myTags = vue.computed(() => {
  2375. return tags[props.comment.username] ?? [];
  2376. });
  2377. function jump() {
  2378. eventBus.emit(CMD.JUMP, props.comment.floor);
  2379. }
  2380. return (_ctx, _cache) => {
  2381. return vue.openBlock(), vue.createElementBlock("div", {
  2382. class: vue.normalizeClass(["comment", { isSimple: vue.unref(config2).simple }]),
  2383. ref: "comment"
  2384. }, [
  2385. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  2386. key: 0,
  2387. class: "avatar",
  2388. href: `/member/${__props.comment.username}`
  2389. }, [
  2390. vue.createElementVNode("img", {
  2391. src: __props.comment.avatar,
  2392. alt: ""
  2393. }, null, 8, _hoisted_2$5)
  2394. ], 8, _hoisted_1$6)) : vue.createCommentVNode("", true),
  2395. vue.createElementVNode("div", {
  2396. class: vue.normalizeClass(["comment-body", { isRight: __props.isRight }])
  2397. }, [
  2398. vue.createElementVNode("div", _hoisted_3$4, [
  2399. __props.comment.thankCount && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
  2400. _hoisted_5$3,
  2401. vue.createElementVNode("div", _hoisted_6$3, vue.toDisplayString(__props.comment.thankCount), 1)
  2402. ])) : vue.createCommentVNode("", true),
  2403. vue.unref(isLogin) && vue.unref(config2).openTag && __props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(vue.unref(myTags), (i) => {
  2404. return vue.openBlock(), vue.createElementBlock("span", _hoisted_7$2, [
  2405. _hoisted_8$2,
  2406. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  2407. ]);
  2408. }), 256)) : vue.createCommentVNode("", true),
  2409. __props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$1, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  2410. __props.comment.isMod && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$1, "MOD")) : vue.createCommentVNode("", true),
  2411. __props.comment.isOp && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$1, "OP")) : vue.createCommentVNode("", true),
  2412. vue.createElementVNode("a", {
  2413. href: `/member/${__props.comment.username}`,
  2414. class: "username"
  2415. }, vue.toDisplayString(__props.comment.username), 9, _hoisted_12$1),
  2416. __props.comment.isOp && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$1, "OP")) : vue.createCommentVNode("", true),
  2417. __props.comment.isMod && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$1, "MOD")) : vue.createCommentVNode("", true),
  2418. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_15$1, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  2419. vue.unref(isLogin) && vue.unref(config2).openTag && !__props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 8 }, vue.renderList(vue.unref(myTags), (i) => {
  2420. return vue.openBlock(), vue.createElementBlock("span", _hoisted_16$1, [
  2421. _hoisted_17$1,
  2422. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  2423. ]);
  2424. }), 256)) : vue.createCommentVNode("", true),
  2425. __props.comment.thankCount && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$1, [
  2426. _hoisted_19$1,
  2427. vue.createElementVNode("div", _hoisted_20$1, vue.toDisplayString(__props.comment.thankCount), 1)
  2428. ])) : vue.createCommentVNode("", true)
  2429. ]),
  2430. vue.createVNode(vue.unref(BaseHtmlRender), {
  2431. class: "reply_content",
  2432. html: __props.comment.reply_content
  2433. }, null, 8, ["html"])
  2434. ], 2),
  2435. __props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  2436. key: 1,
  2437. class: "avatar",
  2438. href: `/member/${__props.comment.username}`
  2439. }, [
  2440. vue.createElementVNode("img", {
  2441. src: __props.comment.avatar,
  2442. alt: ""
  2443. }, null, 8, _hoisted_22$1)
  2444. ], 8, _hoisted_21$1)) : vue.createCommentVNode("", true),
  2445. vue.createElementVNode("div", _hoisted_23$1, [
  2446. vue.createElementVNode("div", _hoisted_24$1, vue.toDisplayString(__props.comment.floor), 1),
  2447. vue.createElementVNode("div", {
  2448. class: "tool jump",
  2449. onClick: jump
  2450. }, _hoisted_26$1)
  2451. ])
  2452. ], 2);
  2453. };
  2454. }
  2455. };
  2456. const SingleComment = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-0b71f2b8"]]);
  2457. function debounce(fn, delay, scope) {
  2458. let timer = null;
  2459. return function() {
  2460. let context = scope || this, args = arguments;
  2461. clearTimeout(timer);
  2462. timer = setTimeout(function() {
  2463. fn.apply(context, args);
  2464. timer = null;
  2465. }, delay);
  2466. };
  2467. }
  2468. const _sfc_main$5 = {
  2469. name: "detail",
  2470. components: {
  2471. SingleComment,
  2472. PopConfirm,
  2473. Comment,
  2474. PostEditor,
  2475. Point,
  2476. Toolbar,
  2477. BaseHtmlRender,
  2478. Tooltip
  2479. },
  2480. inject: ["allReplyUsers", "post", "isLogin", "config", "pageType", "isNight", "showConfig"],
  2481. provide() {
  2482. return {
  2483. postDetailWidth: vue.computed(() => this.postDetailWidth)
  2484. };
  2485. },
  2486. props: {
  2487. modelValue: {
  2488. type: Boolean,
  2489. default() {
  2490. return false;
  2491. }
  2492. },
  2493. loading: {
  2494. type: Boolean,
  2495. default() {
  2496. return false;
  2497. }
  2498. },
  2499. displayType: CommentDisplayType.FloorInFloorNoCallUser
  2500. },
  2501. data() {
  2502. return {
  2503. isSticky: false,
  2504. selectCallIndex: 0,
  2505. postDetailWidth: 0,
  2506. showCallList: false,
  2507. showRelationReply: false,
  2508. replyText: "",
  2509. callStyle: {
  2510. top: 0,
  2511. left: 0
  2512. },
  2513. targetUser: {
  2514. left: [],
  2515. right: "",
  2516. rightFloor: -1
  2517. },
  2518. debounceScroll: () => {
  2519. },
  2520. read: {
  2521. floor: 0,
  2522. total: 0
  2523. },
  2524. currentFloor: 1
  2525. };
  2526. },
  2527. computed: {
  2528. CommentDisplayType() {
  2529. return CommentDisplayType;
  2530. },
  2531. isPost() {
  2532. return this.pageType === PageType.Post;
  2533. },
  2534. filterCallList() {
  2535. if (this.showCallList) {
  2536. let list = ["管理员", "所有人"].concat(this.allReplyUsers);
  2537. if (this.replyText)
  2538. return list.filter((i) => i.search(this.replyText) > -1);
  2539. return list;
  2540. }
  2541. return [];
  2542. },
  2543. topReply() {
  2544. return this.post.replyList.filter((v) => v.thankCount >= this.config.topReplyLoveMinCount).sort((a, b) => b.thankCount - a.thankCount).slice(0, this.config.topReplyCount);
  2545. },
  2546. replyList() {
  2547. if ([CommentDisplayType.FloorInFloor, CommentDisplayType.FloorInFloorNoCallUser].includes(this.displayType))
  2548. return this.post.nestedReplies;
  2549. if (this.displayType === CommentDisplayType.Like) {
  2550. return window.clone(this.post.nestedReplies).sort((a, b) => b.thankCount - a.thankCount);
  2551. }
  2552. if (this.displayType === CommentDisplayType.V2exOrigin)
  2553. return this.post.replyList;
  2554. if (this.displayType === CommentDisplayType.FloorInFloorNested)
  2555. return this.post.nestedRedundReplies;
  2556. if (this.displayType === CommentDisplayType.OnlyOp)
  2557. return this.post.replyList.filter((v) => {
  2558. var _a;
  2559. return v.username === ((_a = this.post.member) == null ? void 0 : _a.username);
  2560. });
  2561. return [];
  2562. },
  2563. //关联回复
  2564. relationReply() {
  2565. if (this.targetUser.left.length && this.targetUser.right) {
  2566. return this.post.replyList.filter((v) => {
  2567. if (this.targetUser.left.includes(v.username)) {
  2568. if (v.floor > this.targetUser.rightFloor) {
  2569. if (v.replyUsers.includes(this.targetUser.right)) {
  2570. return true;
  2571. }
  2572. } else {
  2573. return true;
  2574. }
  2575. }
  2576. if (v.username === this.targetUser.right) {
  2577. for (let i = 0; i < this.targetUser.left.length; i++) {
  2578. if (v.replyUsers.includes(this.targetUser.left[i])) {
  2579. return true;
  2580. }
  2581. }
  2582. }
  2583. });
  2584. }
  2585. return [];
  2586. }
  2587. },
  2588. watch: {
  2589. "post.id"(n2, o) {
  2590. if (this.$refs["post-editor"]) {
  2591. this.$refs["post-editor"].content = "";
  2592. vue.nextTick(() => {
  2593. var _a, _b;
  2594. (_b = (_a = this.$refs) == null ? void 0 : _a.detail) == null ? void 0 : _b.scrollTo({ top: 0 });
  2595. });
  2596. }
  2597. },
  2598. modelValue: {
  2599. handler(newVal) {
  2600. if (this.isPost)
  2601. return;
  2602. if (newVal) {
  2603. document.body.style.overflow = "hidden";
  2604. this.read = this.post.read;
  2605. this.currentFloor = 1;
  2606. vue.nextTick(() => {
  2607. var _a, _b;
  2608. (_b = (_a = this.$refs) == null ? void 0 : _a.main) == null ? void 0 : _b.focus();
  2609. });
  2610. } else {
  2611. this.$emit("saveReadList");
  2612. document.body.style.overflow = "unset";
  2613. this.isSticky = false;
  2614. this.showRelationReply = false;
  2615. if ((this.pageType === PageType.Home || this.pageType === PageType.Node || this.pageType === PageType.Member) && window.location.pathname !== "/") {
  2616. window.history.back();
  2617. }
  2618. }
  2619. }
  2620. }
  2621. },
  2622. mounted() {
  2623. setTimeout(() => {
  2624. var _a;
  2625. this.postDetailWidth = ((_a = this.$refs.mainWrapper) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
  2626. });
  2627. this.debounceScroll = debounce(this.scroll, 300, false);
  2628. if (this.isLogin) {
  2629. const observer = new IntersectionObserver(
  2630. ([e2]) => e2.target.toggleAttribute("stuck", e2.intersectionRatio < 1),
  2631. { threshold: [1] }
  2632. );
  2633. observer.observe(this.$refs.replyBox);
  2634. window.addEventListener("keydown", this.onKeyDown);
  2635. }
  2636. eventBus.on(CMD.SHOW_CALL, (val) => {
  2637. if (val.show) {
  2638. this.showCallList = true;
  2639. this.replyText = val.text;
  2640. if (this.isPost) {
  2641. this.callStyle.top = val.top + $(window.win()).scrollTop() + -40 + "px";
  2642. } else {
  2643. this.callStyle.top = val.top + $(".post-detail").scrollTop() + 15 + "px";
  2644. }
  2645. this.callStyle.left = val.left - $(".main")[0].getBoundingClientRect().left + 10 + "px";
  2646. if (this.selectCallIndex >= this.filterCallList.length) {
  2647. this.selectCallIndex = 0;
  2648. }
  2649. } else {
  2650. this.replyText = "";
  2651. this.showCallList = false;
  2652. this.selectCallIndex = 0;
  2653. }
  2654. });
  2655. eventBus.on(CMD.RELATION_REPLY, (val) => {
  2656. this.targetUser = val;
  2657. this.showRelationReply = true;
  2658. });
  2659. eventBus.on(CMD.JUMP, this.jump);
  2660. if (this.isPost) {
  2661. window.addEventListener("scroll", this.debounceScroll);
  2662. }
  2663. },
  2664. beforeUnmount() {
  2665. window.removeEventListener("keydown", this.onKeyDown);
  2666. eventBus.off(CMD.SHOW_CALL);
  2667. },
  2668. methods: {
  2669. scroll() {
  2670. if (!this.config.rememberLastReadFloor)
  2671. return;
  2672. let height = window.innerHeight * 0.3;
  2673. let comments = $(".comments .comment");
  2674. let forCount = 0;
  2675. for (let i = 0; i < comments.length; i++) {
  2676. forCount++;
  2677. let ins = comments[i];
  2678. let rect = ins.getBoundingClientRect();
  2679. if (rect.top > height) {
  2680. let lastReadFloor = Number(ins.dataset["floor"]);
  2681. console.log("当前阅读楼层", lastReadFloor);
  2682. eventBus.emit(CMD.ADD_READ, {
  2683. floor: lastReadFloor > 3 ? lastReadFloor : 0,
  2684. total: this.post.replyList.length
  2685. });
  2686. if (lastReadFloor > 3) {
  2687. this.read.floor = 0;
  2688. }
  2689. break;
  2690. }
  2691. }
  2692. if (forCount === comments.length) {
  2693. console.log("看到最后了");
  2694. eventBus.emit(CMD.ADD_READ, {
  2695. floor: forCount,
  2696. total: this.post.replyList.length
  2697. });
  2698. }
  2699. },
  2700. stop(e2) {
  2701. },
  2702. jump(floor) {
  2703. try {
  2704. floor = Number(floor);
  2705. } catch (e2) {
  2706. }
  2707. if (!floor)
  2708. return;
  2709. if (!this.post.replyList.length) {
  2710. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "没有回复可跳转!" });
  2711. this.read.floor = 0;
  2712. return;
  2713. }
  2714. if (floor > this.post.replyList.length) {
  2715. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  2716. this.read.floor = 0;
  2717. return;
  2718. }
  2719. let comment = $(`.c_${floor}`);
  2720. if (!comment.length) {
  2721. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  2722. this.read.floor = 0;
  2723. return;
  2724. }
  2725. comment[0].scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
  2726. comment.addClass("ding");
  2727. this.read.floor = 0;
  2728. this.currentFloor = floor + 1;
  2729. setTimeout(() => {
  2730. comment.removeClass("ding");
  2731. }, 2e3);
  2732. },
  2733. jumpLastRead(floor) {
  2734. if (this.config.autoJumpLastReadFloor) {
  2735. if (!floor)
  2736. return;
  2737. setTimeout(() => {
  2738. console.log("上次跳转", floor);
  2739. this.jump(floor);
  2740. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "已跳转到上次阅读位置" });
  2741. }, 300);
  2742. }
  2743. },
  2744. collapseTopReplyList() {
  2745. $(this.$refs.topReply).slideToggle("fast");
  2746. },
  2747. goBottom() {
  2748. this.isSticky = false;
  2749. setTimeout(() => {
  2750. if (this.isPost) {
  2751. let body = $("body , html");
  2752. let scrollHeight = body.prop("scrollHeight");
  2753. body.animate({ scrollTop: scrollHeight - 850 }, 300);
  2754. } else {
  2755. this.$refs.detail.scrollTo({ top: this.$refs.detail.scrollHeight, behavior: "smooth" });
  2756. }
  2757. });
  2758. },
  2759. close(from) {
  2760. if (this.isPost)
  2761. return;
  2762. if (from === "space") {
  2763. if (this.config.closePostDetailBySpace) {
  2764. this.$emit("update:modelValue", false);
  2765. }
  2766. } else {
  2767. this.$emit("update:modelValue", false);
  2768. }
  2769. },
  2770. setCall(e2) {
  2771. eventBus.emit(CMD.SET_CALL, e2);
  2772. this.showCallList = false;
  2773. },
  2774. onKeyDown(e2) {
  2775. if (!this.modelValue)
  2776. return;
  2777. if (!this.showCallList)
  2778. return;
  2779. let length = this.filterCallList.slice(0, 10).length;
  2780. if (e2.keyCode === 13) {
  2781. this.setCall(this.filterCallList[this.selectCallIndex]);
  2782. e2.preventDefault();
  2783. }
  2784. if (e2.keyCode === 38) {
  2785. this.selectCallIndex--;
  2786. if (this.selectCallIndex < 0) {
  2787. this.selectCallIndex = length - 1;
  2788. }
  2789. e2.preventDefault();
  2790. }
  2791. if (e2.keyCode === 40) {
  2792. this.selectCallIndex++;
  2793. if (this.selectCallIndex > length - 1) {
  2794. this.selectCallIndex = 0;
  2795. }
  2796. e2.preventDefault();
  2797. }
  2798. },
  2799. changeOption(item) {
  2800. this.$emit("update:displayType", item);
  2801. },
  2802. addThank() {
  2803. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "add" });
  2804. },
  2805. recallThank() {
  2806. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "recall" });
  2807. },
  2808. scrollTop() {
  2809. if (this.isPost) {
  2810. $("body , html").animate({ scrollTop: 0 }, 300);
  2811. } else {
  2812. this.$refs.detail.scrollTo({ top: 0, behavior: "smooth" });
  2813. }
  2814. }
  2815. }
  2816. };
  2817. const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-a6010948"), n2 = n2(), vue.popScopeId(), n2);
  2818. const _hoisted_1$5 = { class: "my-box post-wrapper" };
  2819. const _hoisted_2$4 = { class: "toolbar-wrapper" };
  2820. const _hoisted_3$3 = {
  2821. key: 0,
  2822. class: "my-box"
  2823. };
  2824. const _hoisted_4$2 = { class: "my-cell flex" };
  2825. const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "gray" }, "高赞回复", -1));
  2826. const _hoisted_6$2 = { class: "top-reply" };
  2827. const _hoisted_7$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-times" }, null, -1));
  2828. const _hoisted_8$1 = { ref: "topReply" };
  2829. const _hoisted_9 = { class: "my-box comment-wrapper" };
  2830. const _hoisted_10 = {
  2831. key: 0,
  2832. class: "my-cell flex"
  2833. };
  2834. const _hoisted_11 = {
  2835. key: 0,
  2836. class: "read-notice"
  2837. };
  2838. const _hoisted_12 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", null, "上次打开:", -1));
  2839. const _hoisted_13 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-long-arrow-down" }, null, -1));
  2840. const _hoisted_14 = [
  2841. _hoisted_13
  2842. ];
  2843. const _hoisted_15 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-long-arrow-down" }, null, -1));
  2844. const _hoisted_16 = [
  2845. _hoisted_15
  2846. ];
  2847. const _hoisted_17 = { class: "my-cell flex" };
  2848. const _hoisted_18 = { class: "gray" };
  2849. const _hoisted_19 = { key: 0 };
  2850. const _hoisted_20 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("strong", { class: "snow" }, "•", -1));
  2851. const _hoisted_21 = ["innerHTML"];
  2852. const _hoisted_22 = {
  2853. key: 0,
  2854. class: "loading-wrapper"
  2855. };
  2856. const _hoisted_23 = {
  2857. key: 1,
  2858. class: "comments"
  2859. };
  2860. const _hoisted_24 = {
  2861. key: 1,
  2862. id: "no-comments-yet"
  2863. };
  2864. const _hoisted_25 = { class: "my-cell flex" };
  2865. const _hoisted_26 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", null, "添加一条新回复", -1));
  2866. const _hoisted_27 = { class: "notice-right" };
  2867. const _hoisted_28 = { class: "w" };
  2868. const _hoisted_29 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "gray" }, "上下文", -1));
  2869. const _hoisted_30 = { class: "top-reply" };
  2870. const _hoisted_31 = ["onClick"];
  2871. const _hoisted_32 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", {
  2872. class: "fa fa-times",
  2873. "aria-hidden": "true"
  2874. }, null, -1));
  2875. const _hoisted_33 = [
  2876. _hoisted_32
  2877. ];
  2878. const _hoisted_34 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", {
  2879. class: "fa fa-long-arrow-up",
  2880. "aria-hidden": "true"
  2881. }, null, -1));
  2882. const _hoisted_35 = [
  2883. _hoisted_34
  2884. ];
  2885. const _hoisted_36 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-long-arrow-down" }, null, -1));
  2886. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  2887. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  2888. const _component_Point = vue.resolveComponent("Point");
  2889. const _component_Toolbar = vue.resolveComponent("Toolbar");
  2890. const _component_Tooltip = vue.resolveComponent("Tooltip");
  2891. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  2892. const _component_Comment = vue.resolveComponent("Comment");
  2893. const _component_PostEditor = vue.resolveComponent("PostEditor");
  2894. const _component_SingleComment = vue.resolveComponent("SingleComment");
  2895. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  2896. class: vue.normalizeClass(["post-detail", [$options.isNight ? "isNight" : "", $options.pageType]]),
  2897. ref: "detail",
  2898. onKeydown: _cache[25] || (_cache[25] = vue.withKeys(($event) => $options.close(), ["esc"])),
  2899. onScroll: _cache[26] || (_cache[26] = (...args) => $data.debounceScroll && $data.debounceScroll(...args)),
  2900. onClick: _cache[27] || (_cache[27] = ($event) => $options.close("space"))
  2901. }, [
  2902. vue.createElementVNode("div", {
  2903. ref: "main",
  2904. class: "main",
  2905. tabindex: "1",
  2906. onClick: _cache[24] || (_cache[24] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  2907. }, [
  2908. vue.createElementVNode("div", {
  2909. class: "main-wrapper",
  2910. ref: "mainWrapper",
  2911. style: vue.normalizeStyle({ width: $options.config.postWidth })
  2912. }, [
  2913. vue.createElementVNode("div", _hoisted_1$5, [
  2914. vue.createVNode(_component_BaseHtmlRender, {
  2915. html: $options.post.headerTemplate
  2916. }, null, 8, ["html"]),
  2917. vue.createElementVNode("div", _hoisted_2$4, [
  2918. vue.createVNode(_component_Point, {
  2919. onAddThank: $options.addThank,
  2920. onRecallThank: $options.recallThank,
  2921. full: false,
  2922. item: {
  2923. isThanked: $options.post.isThanked,
  2924. thankCount: $options.post.thankCount,
  2925. username: $options.post.username
  2926. },
  2927. "api-url": "topic/" + $options.post.id
  2928. }, null, 8, ["onAddThank", "onRecallThank", "item", "api-url"]),
  2929. vue.createVNode(_component_Toolbar, {
  2930. onReply: _cache[0] || (_cache[0] = ($event) => $data.isSticky = !$data.isSticky)
  2931. })
  2932. ])
  2933. ]),
  2934. $options.topReply.length && $options.config.showTopReply ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
  2935. vue.createElementVNode("div", _hoisted_4$2, [
  2936. _hoisted_5$2,
  2937. vue.createElementVNode("div", _hoisted_6$2, [
  2938. vue.createVNode(_component_Tooltip, {
  2939. title: `统计点赞数大于等于${$options.config.topReplyLoveMinCount}个的回复,可在设置中调整`
  2940. }, {
  2941. default: vue.withCtx(() => [
  2942. vue.createElementVNode("i", {
  2943. class: "fa fa-info",
  2944. onClick: _cache[1] || (_cache[1] = ($event) => $options.showConfig())
  2945. })
  2946. ]),
  2947. _: 1
  2948. }, 8, ["title"]),
  2949. vue.createVNode(_component_PopConfirm, {
  2950. title: "关闭后不再默认显示,可在设置里重新打开,确认关闭?",
  2951. onConfirm: _cache[2] || (_cache[2] = ($event) => $options.config.showTopReply = false)
  2952. }, {
  2953. default: vue.withCtx(() => [
  2954. _hoisted_7$1
  2955. ]),
  2956. _: 1
  2957. }),
  2958. vue.createVNode(_component_Tooltip, { title: "收起高赞回复" }, {
  2959. default: vue.withCtx(() => [
  2960. vue.createElementVNode("i", {
  2961. class: "fa fa-compress",
  2962. onClick: _cache[3] || (_cache[3] = (...args) => $options.collapseTopReplyList && $options.collapseTopReplyList(...args))
  2963. })
  2964. ]),
  2965. _: 1
  2966. })
  2967. ])
  2968. ]),
  2969. vue.createElementVNode("div", _hoisted_8$1, [
  2970. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.topReply, (item, index2) => {
  2971. return vue.openBlock(), vue.createBlock(_component_Comment, {
  2972. key: item.floor,
  2973. type: "top",
  2974. modelValue: $options.topReply[index2],
  2975. "onUpdate:modelValue": ($event) => $options.topReply[index2] = $event
  2976. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  2977. }), 128))
  2978. ], 512)
  2979. ])) : vue.createCommentVNode("", true),
  2980. vue.createElementVNode("div", _hoisted_9, [
  2981. $options.post.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  2982. $options.config.showToolbar ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
  2983. vue.createElementVNode("div", {
  2984. class: vue.normalizeClass(["radio-group2", { isNight: $options.isNight }])
  2985. }, [
  2986. vue.createVNode(_component_Tooltip, { title: "不隐藏@用户" }, {
  2987. default: vue.withCtx(() => [
  2988. vue.createElementVNode("div", {
  2989. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.FloorInFloor ? "active" : ""]),
  2990. onClick: _cache[4] || (_cache[4] = ($event) => $options.changeOption($options.CommentDisplayType.FloorInFloor))
  2991. }, "楼中楼(@) ", 2)
  2992. ]),
  2993. _: 1
  2994. }),
  2995. vue.createVNode(_component_Tooltip, { title: "隐藏第一个@用户,双击内容可显示原文" }, {
  2996. default: vue.withCtx(() => [
  2997. vue.createElementVNode("div", {
  2998. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.FloorInFloorNoCallUser ? "active" : ""]),
  2999. onClick: _cache[5] || (_cache[5] = ($event) => $options.changeOption($options.CommentDisplayType.FloorInFloorNoCallUser))
  3000. }, "楼中楼 ", 2)
  3001. ]),
  3002. _: 1
  3003. }),
  3004. vue.createVNode(_component_Tooltip, { title: "重复显示楼中楼的回复" }, {
  3005. default: vue.withCtx(() => [
  3006. vue.createElementVNode("div", {
  3007. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.FloorInFloorNested ? "active" : ""]),
  3008. onClick: _cache[6] || (_cache[6] = ($event) => $options.changeOption($options.CommentDisplayType.FloorInFloorNested))
  3009. }, "冗余楼中楼 ", 2)
  3010. ]),
  3011. _: 1
  3012. }),
  3013. vue.createElementVNode("div", {
  3014. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.Like ? "active" : ""]),
  3015. onClick: _cache[7] || (_cache[7] = ($event) => $options.changeOption($options.CommentDisplayType.Like))
  3016. }, "感谢 ", 2),
  3017. vue.createElementVNode("div", {
  3018. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.OnlyOp ? "active" : ""]),
  3019. onClick: _cache[8] || (_cache[8] = ($event) => $options.changeOption($options.CommentDisplayType.OnlyOp))
  3020. }, "只看楼主 ", 2),
  3021. vue.createElementVNode("div", {
  3022. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.V2exOrigin ? "active" : ""]),
  3023. onClick: _cache[9] || (_cache[9] = ($event) => $options.changeOption($options.CommentDisplayType.V2exOrigin))
  3024. }, "V2原版 ", 2)
  3025. ], 2),
  3026. $data.read.floor || $data.read.total ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
  3027. _hoisted_12,
  3028. $data.read.floor ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  3029. vue.createElementVNode("span", null, [
  3030. vue.createTextVNode("阅读到"),
  3031. vue.createElementVNode("b", null, vue.toDisplayString($data.read.floor), 1),
  3032. vue.createTextVNode("楼")
  3033. ]),
  3034. vue.createElementVNode("div", {
  3035. class: "jump jump1",
  3036. onClick: _cache[10] || (_cache[10] = ($event) => $options.jump($data.read.floor))
  3037. }, _hoisted_14)
  3038. ], 64)) : vue.createCommentVNode("", true),
  3039. vue.createElementVNode("span", null, [
  3040. vue.createTextVNode("总楼层"),
  3041. vue.createElementVNode("b", null, vue.toDisplayString($data.read.total), 1)
  3042. ]),
  3043. vue.createElementVNode("div", {
  3044. class: "jump",
  3045. onClick: _cache[11] || (_cache[11] = ($event) => $options.jump($data.read.total))
  3046. }, _hoisted_16)
  3047. ])) : vue.createCommentVNode("", true)
  3048. ])) : vue.createCommentVNode("", true),
  3049. vue.createElementVNode("div", _hoisted_17, [
  3050. vue.createElementVNode("span", _hoisted_18, [
  3051. vue.createTextVNode(vue.toDisplayString($options.post.replyCount) + " 条回复 ", 1),
  3052. $options.post.createDate ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_19, [
  3053. vue.createTextVNode("  "),
  3054. _hoisted_20,
  3055. vue.createTextVNode("  " + vue.toDisplayString($options.post.createDate), 1)
  3056. ])) : vue.createCommentVNode("", true)
  3057. ]),
  3058. vue.createElementVNode("div", {
  3059. class: "fr",
  3060. innerHTML: $options.post.fr
  3061. }, null, 8, _hoisted_21)
  3062. ])
  3063. ], 64)) : vue.createCommentVNode("", true),
  3064. $options.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  3065. $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_22, [
  3066. vue.createElementVNode("div", {
  3067. class: vue.normalizeClass([$options.isNight ? "loading-b" : "loading-c"])
  3068. }, null, 2)
  3069. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_23, [
  3070. $props.modelValue ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList($options.replyList, (item, index2) => {
  3071. return vue.openBlock(), vue.createBlock(_component_Comment, {
  3072. key: item.floor,
  3073. modelValue: $options.replyList[index2],
  3074. "onUpdate:modelValue": ($event) => $options.replyList[index2] = $event
  3075. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  3076. }), 128)) : vue.createCommentVNode("", true)
  3077. ]))
  3078. ], 64)) : vue.createCommentVNode("", true)
  3079. ]),
  3080. !($options.replyList.length || $props.loading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_24, "目前尚无回复")) : vue.createCommentVNode("", true),
  3081. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  3082. key: 2,
  3083. class: vue.normalizeClass(["my-box editor-wrapper", { "sticky": $data.isSticky }]),
  3084. ref: "replyBox"
  3085. }, [
  3086. vue.createElementVNode("div", _hoisted_25, [
  3087. _hoisted_26,
  3088. vue.createElementVNode("div", _hoisted_27, [
  3089. $data.isSticky ? (vue.openBlock(), vue.createElementBlock("a", {
  3090. key: 0,
  3091. class: "float",
  3092. onClick: _cache[12] || (_cache[12] = ($event) => $data.isSticky = false)
  3093. }, "取消回复框停靠")) : vue.createCommentVNode("", true),
  3094. vue.createElementVNode("a", {
  3095. onClick: _cache[13] || (_cache[13] = (...args) => $options.scrollTop && $options.scrollTop(...args))
  3096. }, "回到顶部")
  3097. ])
  3098. ]),
  3099. vue.createElementVNode("div", _hoisted_28, [
  3100. vue.createVNode(_component_PostEditor, {
  3101. onClose: $options.goBottom,
  3102. ref: "post-editor",
  3103. useType: "reply-post",
  3104. onClick: _cache[14] || (_cache[14] = ($event) => $data.isSticky = true)
  3105. }, null, 8, ["onClose"])
  3106. ])
  3107. ], 2)) : vue.createCommentVNode("", true)
  3108. ], 4),
  3109. $data.showRelationReply ? (vue.openBlock(), vue.createElementBlock("div", {
  3110. key: 0,
  3111. class: "relationReply",
  3112. onClick: _cache[18] || (_cache[18] = ($event) => $options.close("space"))
  3113. }, [
  3114. vue.createElementVNode("div", {
  3115. class: "my-cell flex",
  3116. onClick: _cache[16] || (_cache[16] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  3117. }, [
  3118. _hoisted_29,
  3119. vue.createElementVNode("div", _hoisted_30, [
  3120. vue.createElementVNode("i", {
  3121. class: "fa fa-times",
  3122. onClick: _cache[15] || (_cache[15] = ($event) => $data.showRelationReply = false)
  3123. })
  3124. ])
  3125. ]),
  3126. vue.createElementVNode("div", {
  3127. class: "comments",
  3128. onClick: _cache[17] || (_cache[17] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  3129. }, [
  3130. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.relationReply, (item, index2) => {
  3131. return vue.openBlock(), vue.createBlock(_component_SingleComment, {
  3132. "is-right": item.username === $data.targetUser.right,
  3133. key: item.floor,
  3134. comment: item
  3135. }, null, 8, ["is-right", "comment"]);
  3136. }), 128))
  3137. ])
  3138. ])) : vue.createCommentVNode("", true),
  3139. $data.showCallList && $options.filterCallList.length ? (vue.openBlock(), vue.createElementBlock("div", {
  3140. key: 1,
  3141. class: "call-list",
  3142. style: vue.normalizeStyle($data.callStyle)
  3143. }, [
  3144. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.filterCallList.slice(0, 10), (item, index2) => {
  3145. return vue.openBlock(), vue.createElementBlock("div", {
  3146. class: vue.normalizeClass(["call-item", { select: index2 === $data.selectCallIndex }]),
  3147. onClick: ($event) => $options.setCall(item)
  3148. }, [
  3149. vue.createElementVNode("a", null, vue.toDisplayString(item), 1)
  3150. ], 10, _hoisted_31);
  3151. }), 256))
  3152. ], 4)) : vue.createCommentVNode("", true),
  3153. $options.config.closePostDetailBySpace ? (vue.openBlock(), vue.createElementBlock("div", {
  3154. key: 2,
  3155. class: "close-btn",
  3156. onClick: _cache[19] || (_cache[19] = ($event) => $options.close("btn"))
  3157. }, _hoisted_33)) : vue.createCommentVNode("", true),
  3158. vue.createElementVNode("div", {
  3159. class: "scroll-top button",
  3160. onClick: _cache[20] || (_cache[20] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  3161. }, _hoisted_35),
  3162. vue.createElementVNode("div", {
  3163. class: "scroll-to button",
  3164. onClick: _cache[23] || (_cache[23] = vue.withModifiers(($event) => $options.jump($data.currentFloor), ["stop"]))
  3165. }, [
  3166. _hoisted_36,
  3167. vue.withDirectives(vue.createElementVNode("input", {
  3168. type: "text",
  3169. "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.currentFloor = $event),
  3170. onClick: _cache[22] || (_cache[22] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  3171. }, null, 512), [
  3172. [vue.vModelText, $data.currentFloor]
  3173. ])
  3174. ])
  3175. ], 512)
  3176. ], 34)), [
  3177. [vue.vShow, $props.modelValue]
  3178. ]);
  3179. }
  3180. const PostDetail = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$2], ["__scopeId", "data-v-a6010948"]]);
  3181. const _withScopeId$2 = (n2) => (vue.pushScopeId("data-v-19fe372d"), n2 = n2(), vue.popScopeId(), n2);
  3182. const _hoisted_1$4 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  3183. width: "24",
  3184. height: "24",
  3185. viewBox: "0 0 48 48",
  3186. fill: "none",
  3187. xmlns: "http://www.w3.org/2000/svg"
  3188. }, [
  3189. /* @__PURE__ */ vue.createElementVNode("path", {
  3190. d: "M17 32L19.1875 27M31 32L28.8125 27M19.1875 27L24 16L28.8125 27M19.1875 27H28.8125",
  3191. stroke: "#929596",
  3192. "stroke-width": "4",
  3193. "stroke-linecap": "round",
  3194. "stroke-linejoin": "round"
  3195. }),
  3196. /* @__PURE__ */ vue.createElementVNode("path", {
  3197. d: "M43.1999 20C41.3468 10.871 33.2758 4 23.5999 4C13.9241 4 5.85308 10.871 4 20L10 18",
  3198. stroke: "#929596",
  3199. "stroke-width": "4",
  3200. "stroke-linecap": "round",
  3201. "stroke-linejoin": "round"
  3202. }),
  3203. /* @__PURE__ */ vue.createElementVNode("path", {
  3204. d: "M4 28C5.85308 37.129 13.9241 44 23.5999 44C33.2758 44 41.3468 37.129 43.1999 28L38 30",
  3205. stroke: "#929596",
  3206. "stroke-width": "4",
  3207. "stroke-linecap": "round",
  3208. "stroke-linejoin": "round"
  3209. })
  3210. ], -1));
  3211. const _hoisted_2$3 = { key: 1 };
  3212. const _sfc_main$4 = {
  3213. __name: "Base64Tooltip",
  3214. setup(__props) {
  3215. const tooltip = vue.ref(null);
  3216. const show = vue.ref(false);
  3217. const originalText = vue.ref("");
  3218. const decodeText = vue.ref("");
  3219. const styleObject = vue.reactive({
  3220. left: "-100vw",
  3221. top: "-100vh"
  3222. });
  3223. vue.onMounted(() => {
  3224. eventBus.on(CMD.SHOW_TOOLTIP, ({ text, e: e2 }) => {
  3225. setTimeout(() => show.value = true);
  3226. originalText.value = text;
  3227. decodeText.value = "";
  3228. styleObject.left = e2.clientX + "px";
  3229. styleObject.top = e2.clientY + 20 + "px";
  3230. });
  3231. window.addEventListener("click", (e2) => {
  3232. if (!tooltip.value)
  3233. return;
  3234. if (!tooltip.value.contains(e2.target) && show.value) {
  3235. show.value = false;
  3236. }
  3237. }, { capture: true });
  3238. const fn = () => show.value && (show.value = false);
  3239. $(".post-detail", window.win().doc).on("scroll", fn);
  3240. });
  3241. function copy() {
  3242. if (window.win().navigator.clipboard) {
  3243. window.win().navigator.clipboard.writeText(decodeText.value);
  3244. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "复制成功" });
  3245. } else {
  3246. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "复制失败!浏览器不支持!" });
  3247. }
  3248. }
  3249. function base64ToArrayBuffer(base64) {
  3250. let binary_string = window.atob(base64);
  3251. let len = binary_string.length;
  3252. let bytes = new Uint8Array(len);
  3253. for (let i = 0; i < len; i++) {
  3254. bytes[i] = binary_string.charCodeAt(i);
  3255. }
  3256. return bytes.buffer;
  3257. }
  3258. function decode() {
  3259. try {
  3260. new Blob([base64ToArrayBuffer(originalText.value)]).text().then((r2) => {
  3261. decodeText.value = r2;
  3262. });
  3263. } catch (e2) {
  3264. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "Base64解码失败!不是标准数据!" });
  3265. }
  3266. }
  3267. return (_ctx, _cache) => {
  3268. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  3269. class: "base64_tooltip",
  3270. style: vue.normalizeStyle(styleObject),
  3271. onClick: decode,
  3272. ref_key: "tooltip",
  3273. ref: tooltip
  3274. }, [
  3275. !decodeText.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  3276. vue.createTextVNode(" Base64解码:" + vue.toDisplayString(originalText.value) + " ", 1),
  3277. _hoisted_1$4
  3278. ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
  3279. vue.createElementVNode("span", null, vue.toDisplayString(decodeText.value), 1),
  3280. vue.createElementVNode("div", {
  3281. class: "button",
  3282. onClick: copy
  3283. }, "点击复制")
  3284. ]))
  3285. ], 4)), [
  3286. [vue.vShow, show.value]
  3287. ]);
  3288. };
  3289. }
  3290. };
  3291. const Base64Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-19fe372d"]]);
  3292. const _sfc_main$3 = {
  3293. name: "Msg",
  3294. props: {
  3295. type: "",
  3296. text: ""
  3297. },
  3298. created() {
  3299. setTimeout(() => {
  3300. this.$emit("close");
  3301. }, 3e3);
  3302. }
  3303. };
  3304. const _hoisted_1$3 = /* @__PURE__ */ vue.createElementVNode("svg", {
  3305. width: "24",
  3306. height: "24",
  3307. viewBox: "0 0 48 48",
  3308. fill: "none",
  3309. xmlns: "http://www.w3.org/2000/svg"
  3310. }, [
  3311. /* @__PURE__ */ vue.createElementVNode("path", {
  3312. d: "M14 14L34 34",
  3313. stroke: "#ffffff",
  3314. "stroke-width": "4",
  3315. "stroke-linecap": "round",
  3316. "stroke-linejoin": "round"
  3317. }),
  3318. /* @__PURE__ */ vue.createElementVNode("path", {
  3319. d: "M14 34L34 14",
  3320. stroke: "#ffffff",
  3321. "stroke-width": "4",
  3322. "stroke-linecap": "round",
  3323. "stroke-linejoin": "round"
  3324. })
  3325. ], -1);
  3326. const _hoisted_2$2 = [
  3327. _hoisted_1$3
  3328. ];
  3329. const _hoisted_3$2 = { class: "right" };
  3330. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  3331. return vue.openBlock(), vue.createElementBlock("div", {
  3332. class: vue.normalizeClass(["msg", $props.type])
  3333. }, [
  3334. vue.createElementVNode("div", {
  3335. class: "left",
  3336. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  3337. }, _hoisted_2$2),
  3338. vue.createElementVNode("div", _hoisted_3$2, vue.toDisplayString($props.text), 1)
  3339. ], 2);
  3340. }
  3341. const Msg = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$1]]);
  3342. const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-c3dfee35"), n2 = n2(), vue.popScopeId(), n2);
  3343. const _hoisted_1$2 = { class: "wrapper" };
  3344. const _hoisted_2$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 添加标签 ", -1));
  3345. const _hoisted_3$1 = { class: "option" };
  3346. const _hoisted_4$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", null, "用户:", -1));
  3347. const _hoisted_5$1 = ["onKeydown"];
  3348. const _hoisted_6$1 = { class: "btns" };
  3349. const _sfc_main$2 = {
  3350. __name: "TagModal",
  3351. props: ["tags"],
  3352. emits: ["update:tags"],
  3353. setup(__props, { emit }) {
  3354. const props = __props;
  3355. const tagModal = vue.reactive({
  3356. show: false,
  3357. currentUsername: "",
  3358. tag: ""
  3359. });
  3360. const isNight = vue.inject("isNight");
  3361. const inputRef = vue.ref();
  3362. vue.onMounted(() => {
  3363. eventBus.on(CMD.ADD_TAG, (username) => {
  3364. tagModal.currentUsername = username;
  3365. tagModal.show = true;
  3366. vue.nextTick(() => {
  3367. inputRef.value.focus();
  3368. });
  3369. });
  3370. });
  3371. async function addTag() {
  3372. let oldTag = window.clone(props.tags);
  3373. let tempTag = window.clone(props.tags);
  3374. let userTags = tempTag[tagModal.currentUsername] ?? [];
  3375. let rIndex = userTags.findIndex((v) => v === tagModal.tag);
  3376. if (rIndex > -1) {
  3377. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "标签已存在!" });
  3378. return;
  3379. } else {
  3380. userTags.push(tagModal.tag);
  3381. }
  3382. tempTag[tagModal.currentUsername] = userTags;
  3383. emit("update:tags", tempTag);
  3384. tagModal.tag = "";
  3385. tagModal.show = false;
  3386. let res = await window.parse.saveTags(tempTag);
  3387. if (!res) {
  3388. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签添加失败!" });
  3389. emit("update:tags", oldTag);
  3390. }
  3391. }
  3392. return (_ctx, _cache) => {
  3393. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  3394. default: vue.withCtx(() => [
  3395. tagModal.show ? (vue.openBlock(), vue.createElementBlock("div", {
  3396. key: 0,
  3397. class: vue.normalizeClass(["tag-modal modal", { isNight: vue.unref(isNight) }])
  3398. }, [
  3399. vue.createElementVNode("div", {
  3400. class: "mask",
  3401. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => tagModal.show = false, ["stop"]))
  3402. }),
  3403. vue.createElementVNode("div", _hoisted_1$2, [
  3404. _hoisted_2$1,
  3405. vue.createElementVNode("div", _hoisted_3$1, [
  3406. _hoisted_4$1,
  3407. vue.createElementVNode("div", null, vue.toDisplayString(tagModal.currentUsername), 1)
  3408. ]),
  3409. vue.withDirectives(vue.createElementVNode("input", {
  3410. type: "text",
  3411. ref_key: "inputRef",
  3412. ref: inputRef,
  3413. style: { "width": "100%" },
  3414. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tagModal.tag = $event),
  3415. onKeydown: vue.withKeys(addTag, ["enter"])
  3416. }, null, 40, _hoisted_5$1), [
  3417. [vue.vModelText, tagModal.tag]
  3418. ]),
  3419. vue.createElementVNode("div", _hoisted_6$1, [
  3420. vue.createElementVNode("div", {
  3421. class: "white",
  3422. onClick: _cache[2] || (_cache[2] = ($event) => tagModal.show = false)
  3423. }, "取消"),
  3424. vue.createElementVNode("div", {
  3425. class: "main",
  3426. onClick: addTag
  3427. }, "确定")
  3428. ])
  3429. ])
  3430. ], 2)) : vue.createCommentVNode("", true)
  3431. ]),
  3432. _: 1
  3433. });
  3434. };
  3435. }
  3436. };
  3437. const TagModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c3dfee35"]]);
  3438. const _hoisted_1$1 = { class: "msgs" };
  3439. const _sfc_main$1 = {
  3440. __name: "MsgModal",
  3441. setup(__props) {
  3442. const msgList = vue.reactive([
  3443. // {type: 'success', text: '123', id: Date.now()}
  3444. ]);
  3445. vue.onMounted(() => {
  3446. eventBus.on(CMD.SHOW_MSG, (val) => {
  3447. msgList.push({ ...val, id: Date.now() });
  3448. });
  3449. });
  3450. function removeMsg(id) {
  3451. let rIndex = msgList.findIndex((item) => item.id === id);
  3452. if (rIndex > -1) {
  3453. msgList.splice(rIndex, 1);
  3454. }
  3455. }
  3456. return (_ctx, _cache) => {
  3457. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  3458. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(msgList, (v) => {
  3459. return vue.openBlock(), vue.createBlock(Msg, {
  3460. key: v.id,
  3461. type: v.type,
  3462. text: v.text,
  3463. onClose: ($event) => removeMsg(v.id)
  3464. }, null, 8, ["type", "text", "onClose"]);
  3465. }), 128))
  3466. ]);
  3467. };
  3468. }
  3469. };
  3470. const MsgModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-95974c3e"]]);
  3471. let u = ".__cf_email__", f = "data-cfemail", d = document.createElement("div");
  3472. function e(e2) {
  3473. console.error(e2);
  3474. }
  3475. function r(e2, t) {
  3476. let r2 = e2.substr(t, 2);
  3477. return parseInt(r2, 16);
  3478. }
  3479. function n(href, index2) {
  3480. let o = "", a = r(href, index2);
  3481. for (let i = index2 + 2; i < href.length; i += 2) {
  3482. let l = r(href, i) ^ a;
  3483. o += String.fromCharCode(l);
  3484. }
  3485. try {
  3486. o = decodeURIComponent(escape(o));
  3487. } catch (u2) {
  3488. e(u2);
  3489. }
  3490. d.innerHTML = '<a href="' + o.replace(/"/g, "&quot;") + '"></a>';
  3491. return d.childNodes[0].getAttribute("href") || "";
  3492. }
  3493. function decodeEmail(body) {
  3494. try {
  3495. let as = body.find(u);
  3496. as.each(function() {
  3497. try {
  3498. let o = this, a = o.parentNode, i = o.getAttribute(f);
  3499. if (i) {
  3500. let l = n(i, 0), d2 = document.createTextNode(l);
  3501. a.replaceChild(d2, o);
  3502. }
  3503. } catch (h) {
  3504. e(h);
  3505. }
  3506. });
  3507. } catch (s) {
  3508. e(s);
  3509. }
  3510. }
  3511. const _sfc_main = {
  3512. components: { MsgModal, TagModal, Tooltip, Setting, PostDetail, Base64Tooltip, Msg },
  3513. provide() {
  3514. return {
  3515. isLogin: vue.computed(() => this.isLogin),
  3516. isNight: vue.computed(() => this.isNight),
  3517. pageType: vue.computed(() => this.pageType),
  3518. tags: vue.computed(() => this.tags),
  3519. show: vue.computed(() => this.show),
  3520. post: vue.computed(() => this.current),
  3521. config: vue.computed(() => this.config),
  3522. allReplyUsers: vue.computed(() => {
  3523. var _a, _b, _c;
  3524. if ((_a = this.current) == null ? void 0 : _a.replyList) {
  3525. return Array.from(new Set(((_c = (_b = this.current) == null ? void 0 : _b.replyList) == null ? void 0 : _c.map((v) => v.username)) ?? []));
  3526. }
  3527. return [];
  3528. }),
  3529. showConfig: this.showConfig
  3530. };
  3531. },
  3532. data() {
  3533. return {
  3534. loading: window.pageType === PageType.Post,
  3535. loadMore: false,
  3536. isLogin: !!window.user.username,
  3537. pageType: window.pageType,
  3538. isNight: window.isNight,
  3539. stopMe: false,
  3540. //停止使用脚本
  3541. show: false,
  3542. current: window.clone(window.initPost),
  3543. list: [],
  3544. config: window.clone(window.config),
  3545. tags: window.user.tags,
  3546. readList: window.user.readList,
  3547. configModal: {
  3548. show: false
  3549. },
  3550. tagModal: {
  3551. show: false,
  3552. currentUsername: "",
  3553. tag: ""
  3554. }
  3555. };
  3556. },
  3557. computed: {
  3558. targetUserTags() {
  3559. return this.tags[window.targetUserName] ?? [];
  3560. },
  3561. isList() {
  3562. return [PageType.Home, PageType.Node].includes(this.pageType);
  3563. },
  3564. isPost() {
  3565. return this.pageType === PageType.Post;
  3566. },
  3567. isMember() {
  3568. return this.pageType === PageType.Member;
  3569. }
  3570. },
  3571. watch: {
  3572. "current.replyList": {
  3573. handler(newVal, oldVal) {
  3574. if (newVal.length) {
  3575. this.current.replyCount = newVal.length;
  3576. let res = window.parse.createNestedList(newVal, this.current.allReplyUsers);
  3577. if (res) {
  3578. this.current.nestedReplies = res;
  3579. }
  3580. let dup_res = window.parse.createNestedRedundantList(newVal, this.current.allReplyUsers);
  3581. if (dup_res) {
  3582. this.current.nestedRedundReplies = dup_res;
  3583. }
  3584. } else {
  3585. this.current.replyCount = 0;
  3586. this.current.nestedReplies = [];
  3587. this.current.nestedRedundReplies = [];
  3588. }
  3589. if (this.list) {
  3590. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  3591. if (rIndex > -1) {
  3592. this.list[rIndex].replyCount = newVal.length;
  3593. }
  3594. }
  3595. },
  3596. deep: true
  3597. },
  3598. config: {
  3599. handler(newVal) {
  3600. let config2 = { [window.user.username ?? "default"]: newVal };
  3601. localStorage.setItem("v2ex-config", JSON.stringify(config2));
  3602. window.config = newVal;
  3603. },
  3604. deep: true
  3605. },
  3606. tags(newVal) {
  3607. window.user.tags = newVal;
  3608. },
  3609. "config.viewType"(newVal) {
  3610. if (!newVal)
  3611. return;
  3612. if (newVal === "card") {
  3613. $(".post-item").each(function() {
  3614. $(this).addClass("preview");
  3615. });
  3616. } else {
  3617. $(".post-item").each(function() {
  3618. $(this).removeClass("preview");
  3619. });
  3620. }
  3621. }
  3622. },
  3623. created() {
  3624. window.cb = this.winCb;
  3625. if (window.win().canParseV2exPage) {
  3626. if (this.isList)
  3627. ;
  3628. }
  3629. $(document).on("click", "a", (e2) => {
  3630. if (this.stopMe)
  3631. return true;
  3632. let { href, id, title } = window.parse.parseA(e2.currentTarget);
  3633. if (this.clickPost(e2, id, href, title)) {
  3634. return false;
  3635. }
  3636. });
  3637. let that = this;
  3638. $(document).on("click", ".post-item", function(e2) {
  3639. if (this.classList.contains("preview")) {
  3640. if (e2.target.tagName !== "A" && e2.target.tagName !== "IMG" && !e2.target.classList.contains("toggle")) {
  3641. console.log("点空白处");
  3642. let id = this.dataset["id"];
  3643. let href = this.dataset["href"];
  3644. if (that.clickPost(e2, id, href)) {
  3645. return false;
  3646. } else {
  3647. location.href = href;
  3648. }
  3649. }
  3650. }
  3651. });
  3652. $(document).on("click", ".toggle", (e2) => {
  3653. let id = e2.currentTarget.dataset["id"];
  3654. let itemDom = window.win().query(`.id_${id}`);
  3655. if (itemDom.classList.contains("preview")) {
  3656. itemDom.classList.remove("preview");
  3657. } else {
  3658. itemDom.classList.add("preview");
  3659. }
  3660. });
  3661. window.onpopstate = (event) => {
  3662. if (event.state) {
  3663. if (!this.show)
  3664. this.show = true;
  3665. } else {
  3666. if (this.show)
  3667. this.show = false;
  3668. }
  3669. };
  3670. window.onbeforeunload = () => {
  3671. this.saveReadList();
  3672. };
  3673. this.initEvent();
  3674. },
  3675. beforeUnmount() {
  3676. eventBus.clear();
  3677. },
  3678. methods: {
  3679. saveReadList() {
  3680. window.parse.saveReadList(this.readList);
  3681. },
  3682. clickPost(e2, id, href, title = "") {
  3683. var _a, _b, _c, _d, _e, _f;
  3684. if (id) {
  3685. if (this.config.clickPostItemOpenDetail) {
  3686. let index2 = this.list.findIndex((v) => v.id == id);
  3687. let postItem = this.clone(window.initPost);
  3688. if (index2 > -1) {
  3689. postItem = this.list[index2];
  3690. } else {
  3691. postItem.title = title ?? "加载中";
  3692. }
  3693. postItem.id = id;
  3694. postItem.href = href;
  3695. if (!postItem.headerTemplate) {
  3696. let template = `
  3697. <div class="header">
  3698. <div class="fr">
  3699. <a href="/member/${((_a = postItem == null ? void 0 : postItem.member) == null ? void 0 : _a.username) ?? ""}">
  3700. <img src="${((_b = postItem == null ? void 0 : postItem.member) == null ? void 0 : _b.avatar_large) ?? ""}" class="avatar"
  3701. border="0"
  3702. align="default" width="73" style="width: 73px; max-height: 73px;" alt="${((_c = postItem == null ? void 0 : postItem.member) == null ? void 0 : _c.username) ?? ""}">
  3703. </a>
  3704. </div>
  3705. <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>
  3706. <div class="sep10"></div>
  3707. <h1>${(postItem == null ? void 0 : postItem.title) || "加载中..."}</h1>
  3708. <div id="topic_930514_votes" class="votes">
  3709. <a href="javascript:" onclick="null" class="vote">
  3710. <li class="fa fa-chevron-up"></li>
  3711. &nbsp;
  3712. </a> &nbsp;
  3713. <a href="javascript:" onclick="null" class="vote">
  3714. <li class="fa fa-chevron-down"></li>
  3715. </a>
  3716. </div> &nbsp;
  3717. <small class="gray">
  3718. <a href="/member/zyronon">${((_f = postItem == null ? void 0 : postItem.member) == null ? void 0 : _f.username) ?? ""}</a> ·
  3719. <span title="2023-04-07 11:32:28 +08:00">1 天前</span> · 0 次点击
  3720. </small>
  3721. </div>
  3722. <div class="cell">
  3723. <div class="topic_content">
  3724. <div class="markdown_body">
  3725. ${(postItem == null ? void 0 : postItem.content_rendered) ?? ""}
  3726. </div>
  3727. </div>
  3728. </div>
  3729. `;
  3730. postItem.headerTemplate = template;
  3731. }
  3732. this.getPostDetail(postItem);
  3733. e2.preventDefault();
  3734. return true;
  3735. }
  3736. if (this.config.newTabOpen) {
  3737. let tempId = "a_blank_" + Date.now();
  3738. let a = win().doc.createElement("a");
  3739. a.setAttribute("href", href);
  3740. a.setAttribute("target", "_blank");
  3741. a.setAttribute("id", tempId);
  3742. if (!win().doc.getElementById(tempId)) {
  3743. win().doc.body.appendChild(a);
  3744. }
  3745. a.click();
  3746. return true;
  3747. }
  3748. }
  3749. },
  3750. showPost() {
  3751. this.show = true;
  3752. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  3753. $(this).hide();
  3754. });
  3755. },
  3756. showConfig() {
  3757. this.configModal.show = true;
  3758. },
  3759. async winCb({ type, value }) {
  3760. if (type === "openSetting") {
  3761. this.configModal.show = true;
  3762. }
  3763. if (type === "restorePost") {
  3764. if (this.stopMe)
  3765. return;
  3766. this.stopMe = true;
  3767. this.show = false;
  3768. this.loading = false;
  3769. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "脚本无法查看此页面!" });
  3770. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  3771. $(this).show();
  3772. });
  3773. }
  3774. if (type === "postContent") {
  3775. if (this.stopMe)
  3776. return;
  3777. this.current = Object.assign(this.clone(this.current), this.clone(value));
  3778. if (this.config.autoOpenDetail) {
  3779. this.showPost();
  3780. }
  3781. }
  3782. if (type === "postReplies") {
  3783. if (this.stopMe)
  3784. return;
  3785. this.current = Object.assign(this.clone(this.current), this.clone(value));
  3786. console.log("当前帖子", this.current);
  3787. this.loading = false;
  3788. }
  3789. if (type === "syncData") {
  3790. this.list = window.postList;
  3791. this.config = window.config;
  3792. this.tags = window.user.tags;
  3793. this.readList = window.user.readList;
  3794. this.current.read = this.readList[this.current.id] ?? {};
  3795. if (this.show && this.isPost && this.current.read.floor) {
  3796. this.$refs.postDetail.read = this.current.read;
  3797. }
  3798. console.log("this.readList", this.readList);
  3799. }
  3800. },
  3801. clone(val) {
  3802. return window.clone(val);
  3803. },
  3804. initEvent() {
  3805. eventBus.on(CMD.CHANGE_COMMENT_THANK, (val) => {
  3806. console.log("CHANGE_COMMENT_THANK", val);
  3807. const { id, type } = val;
  3808. let currentI = this.current.replyList.findIndex((i) => i.id === id);
  3809. if (currentI > -1) {
  3810. this.current.replyList[currentI].isThanked = type === "add";
  3811. if (type === "add") {
  3812. this.current.replyList[currentI].thankCount++;
  3813. } else {
  3814. this.current.replyList[currentI].thankCount--;
  3815. }
  3816. }
  3817. });
  3818. eventBus.on(CMD.CHANGE_POST_THANK, (val) => {
  3819. const { id, type } = val;
  3820. this.current.isThanked = type === "add";
  3821. if (type === "add") {
  3822. this.current.thankCount++;
  3823. } else {
  3824. this.current.thankCount--;
  3825. }
  3826. let currentI = this.list.findIndex((i) => i.id === id);
  3827. if (currentI > -1) {
  3828. this.list[currentI].isThanked = type === "add";
  3829. if (type === "add") {
  3830. this.list[currentI].thankCount++;
  3831. } else {
  3832. this.list[currentI].thankCount++;
  3833. }
  3834. }
  3835. });
  3836. eventBus.on(CMD.REMOVE, (val) => {
  3837. let removeIndex = this.current.replyList.findIndex((i) => i.floor === val);
  3838. if (removeIndex > -1) {
  3839. this.current.replyList.splice(removeIndex, 1);
  3840. }
  3841. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  3842. if (rIndex > -1) {
  3843. this.list[rIndex] = Object.assign(this.list[rIndex], val);
  3844. }
  3845. });
  3846. eventBus.on(CMD.IGNORE, () => {
  3847. this.show = false;
  3848. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  3849. if (rIndex > -1) {
  3850. this.list.splice(rIndex, 1);
  3851. }
  3852. this.current = this.clone(window.initPost);
  3853. });
  3854. eventBus.on(CMD.MERGE, (val) => {
  3855. this.current = Object.assign(this.current, val);
  3856. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  3857. if (rIndex > -1) {
  3858. this.list[rIndex] = Object.assign(this.list[rIndex], val);
  3859. }
  3860. });
  3861. eventBus.on(CMD.ADD_READ, (val) => {
  3862. this.readList[this.current.id] = val;
  3863. });
  3864. eventBus.on(CMD.ADD_REPLY, (item) => {
  3865. this.current.replyList.push(item);
  3866. });
  3867. eventBus.on(CMD.REFRESH_ONCE, async (once) => {
  3868. if (once) {
  3869. if (typeof once === "string") {
  3870. let res = once.match(/var once = "([\d]+)";/);
  3871. if (res && res[1]) {
  3872. this.current.once = Number(res[1]);
  3873. return;
  3874. }
  3875. }
  3876. if (typeof once === "number") {
  3877. this.current.once = once;
  3878. return;
  3879. }
  3880. }
  3881. window.fetchOnce().then((r2) => {
  3882. this.current.once = r2;
  3883. });
  3884. });
  3885. eventBus.on(CMD.REMOVE_TAG, async ({ username, tag }) => {
  3886. let oldTag = this.clone(this.tags);
  3887. let tags = this.tags[username] ?? [];
  3888. let rIndex = tags.findIndex((v) => v === tag);
  3889. if (rIndex > -1) {
  3890. tags.splice(rIndex, 1);
  3891. }
  3892. this.tags[username] = tags;
  3893. let res = await window.parse.saveTags(this.tags);
  3894. if (!res) {
  3895. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签删除失败!" });
  3896. this.tags = oldTag;
  3897. }
  3898. });
  3899. },
  3900. async getPostDetail(post, event) {
  3901. this.current = Object.assign({}, window.initPost, post);
  3902. this.current.read = this.readList[this.current.id] ?? { floor: 0, total: 0 };
  3903. this.show = true;
  3904. let url = window.baseUrl + "/t/" + post.id;
  3905. document.body.style.overflow = "hidden";
  3906. window.history.pushState({}, 0, post.href ?? url);
  3907. window.document.title = post.title ?? "V2EX";
  3908. let alreadyHasReply = this.current.replyList.length;
  3909. if (alreadyHasReply) {
  3910. this.$refs.postDetail.jumpLastRead(this.current.read.floor);
  3911. } else {
  3912. this.loading = true;
  3913. }
  3914. let apiRes = await window.fetch(url + "?p=1");
  3915. if (apiRes.status === 404) {
  3916. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "主题未找到" });
  3917. return this.loading = false;
  3918. }
  3919. if (apiRes.status === 403) {
  3920. this.loading = false;
  3921. this.show = false;
  3922. window.open(`https://www.v2ex.com/t/${post.id}?p=1&script=0`, "_black");
  3923. return;
  3924. }
  3925. if (apiRes.redirected) {
  3926. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有权限" });
  3927. return this.loading = false;
  3928. }
  3929. let htmlText = await apiRes.text();
  3930. let hasPermission = htmlText.search("你要查看的页面需要先登录(不可用)");
  3931. if (hasPermission > -1) {
  3932. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你要查看的页面需要先登录(不可用)" });
  3933. return this.loading = false;
  3934. }
  3935. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  3936. let body = $(bodyText[0]);
  3937. decodeEmail(body);
  3938. this.current = await window.parse.getPostDetail(this.current, body, htmlText);
  3939. if (this.current.replyList.length) {
  3940. let index2 = this.list.findIndex((v) => v.id == post.id);
  3941. if (index2 > -1) {
  3942. this.list[index2].replyList = this.current.replyList;
  3943. this.list[index2].nestedReplies = this.current.nestedReplies;
  3944. this.list[index2].once = this.current.once;
  3945. this.list[index2].createDate = this.current.createDate;
  3946. } else {
  3947. this.list.push(this.clone(this.current));
  3948. }
  3949. }
  3950. this.loading = false;
  3951. if (!alreadyHasReply) {
  3952. vue.nextTick(() => {
  3953. this.$refs.postDetail.jumpLastRead(this.current.read.floor);
  3954. });
  3955. }
  3956. console.log("当前帖子", this.current);
  3957. },
  3958. addTargetUserTag() {
  3959. eventBus.emit(CMD.ADD_TAG, window.targetUserName);
  3960. },
  3961. removeTargetUserTag(tag) {
  3962. eventBus.emit(CMD.REMOVE_TAG, { username: window.targetUserName, tag });
  3963. }
  3964. }
  3965. };
  3966. const _withScopeId = (n2) => (vue.pushScopeId("data-v-98d8cde8"), n2 = n2(), vue.popScopeId(), n2);
  3967. const _hoisted_1 = {
  3968. key: 0,
  3969. class: "nav flex flex-end"
  3970. };
  3971. const _hoisted_2 = {
  3972. key: 1,
  3973. class: "target-user-tags"
  3974. };
  3975. const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "标签:", -1));
  3976. const _hoisted_4 = { class: "my-tag" };
  3977. const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  3978. const _hoisted_6 = ["onClick"];
  3979. const _hoisted_7 = {
  3980. key: 2,
  3981. class: "my-box flex f14 open-post",
  3982. style: { "margin": "2rem 0 0 0", "padding": "1rem" }
  3983. };
  3984. const _hoisted_8 = { class: "flex" };
  3985. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  3986. const _component_Setting = vue.resolveComponent("Setting");
  3987. const _component_TagModal = vue.resolveComponent("TagModal");
  3988. const _component_PostDetail = vue.resolveComponent("PostDetail");
  3989. const _component_Base64Tooltip = vue.resolveComponent("Base64Tooltip");
  3990. const _component_MsgModal = vue.resolveComponent("MsgModal");
  3991. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  3992. vue.createVNode(_component_Setting, {
  3993. modelValue: $data.config,
  3994. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.config = $event),
  3995. show: $data.configModal.show,
  3996. "onUpdate:show": _cache[1] || (_cache[1] = ($event) => $data.configModal.show = $event)
  3997. }, null, 8, ["modelValue", "show"]),
  3998. vue.createVNode(_component_TagModal, {
  3999. tags: $data.tags,
  4000. "onUpdate:tags": _cache[2] || (_cache[2] = ($event) => $data.tags = $event)
  4001. }, null, 8, ["tags"]),
  4002. vue.createVNode(_component_PostDetail, {
  4003. modelValue: $data.show,
  4004. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.show = $event),
  4005. ref: "postDetail",
  4006. displayType: $data.config.commentDisplayType,
  4007. "onUpdate:displayType": _cache[4] || (_cache[4] = ($event) => $data.config.commentDisplayType = $event),
  4008. onSaveReadList: $options.saveReadList,
  4009. loading: $data.loading
  4010. }, null, 8, ["modelValue", "displayType", "onSaveReadList", "loading"]),
  4011. vue.createVNode(_component_Base64Tooltip),
  4012. vue.createVNode(_component_MsgModal),
  4013. !$data.stopMe && $data.config.showToolbar ? (vue.openBlock(), vue.createElementBlock("div", {
  4014. key: 0,
  4015. class: vue.normalizeClass(["toolbar", [$data.isNight ? "isNight" : "", $data.config["viewType"]]])
  4016. }, [
  4017. $options.isList ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
  4018. vue.createElementVNode("div", {
  4019. class: vue.normalizeClass(["radio-group2", { isNight: $data.isNight }])
  4020. }, [
  4021. vue.createElementVNode("div", {
  4022. class: vue.normalizeClass(["radio", $data.config.viewType === "table" ? "active" : ""]),
  4023. onClick: _cache[5] || (_cache[5] = ($event) => $data.config.viewType = "table")
  4024. }, "表格 ", 2),
  4025. vue.createElementVNode("div", {
  4026. class: vue.normalizeClass(["radio", $data.config.viewType === "card" ? "active" : ""]),
  4027. onClick: _cache[6] || (_cache[6] = ($event) => $data.config.viewType = "card")
  4028. }, "卡片 ", 2)
  4029. ], 2)
  4030. ])) : vue.createCommentVNode("", true),
  4031. $options.isMember && $data.isLogin && $data.config.openTag ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
  4032. _hoisted_3,
  4033. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.targetUserTags, (i) => {
  4034. return vue.openBlock(), vue.createElementBlock("span", _hoisted_4, [
  4035. _hoisted_5,
  4036. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  4037. vue.createElementVNode("i", {
  4038. class: "fa fa-trash-o remove",
  4039. onClick: ($event) => $options.removeTargetUserTag(i)
  4040. }, null, 8, _hoisted_6)
  4041. ]);
  4042. }), 256)),
  4043. vue.createElementVNode("span", {
  4044. class: "add-tag ago",
  4045. onClick: _cache[7] || (_cache[7] = (...args) => $options.addTargetUserTag && $options.addTargetUserTag(...args)),
  4046. title: "添加标签"
  4047. }, "+")
  4048. ])) : vue.createCommentVNode("", true),
  4049. $options.isPost && !$data.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
  4050. vue.createElementVNode("div", _hoisted_8, [
  4051. vue.createTextVNode(" 默认显示楼中楼 : "),
  4052. vue.createElementVNode("div", {
  4053. class: vue.normalizeClass(["switch light", { active: $data.config.autoOpenDetail }]),
  4054. onClick: _cache[8] || (_cache[8] = ($event) => $data.config.autoOpenDetail = !$data.config.autoOpenDetail)
  4055. }, null, 2)
  4056. ]),
  4057. vue.createElementVNode("div", {
  4058. class: vue.normalizeClass(["button light", { loading: $data.loading, isNight: $data.isNight }]),
  4059. onClick: _cache[9] || (_cache[9] = (...args) => $options.showPost && $options.showPost(...args))
  4060. }, " 点击显示楼中楼 ", 2)
  4061. ])) : vue.createCommentVNode("", true)
  4062. ], 2)) : vue.createCommentVNode("", true)
  4063. ], 64);
  4064. }
  4065. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-98d8cde8"]]);
  4066. var _GM_notification = /* @__PURE__ */ (() => typeof GM_notification != "undefined" ? GM_notification : void 0)();
  4067. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  4068. var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
  4069. let $section = document.createElement("section");
  4070. $section.id = "app";
  4071. function run() {
  4072. window.baseUrl = location.origin;
  4073. window.initPost = {
  4074. allReplyUsers: [],
  4075. content_rendered: "",
  4076. createDate: "",
  4077. fr: "",
  4078. replyList: [],
  4079. nestedReplies: [],
  4080. nestedRedundReplies: [],
  4081. username: "",
  4082. member: {},
  4083. node: {},
  4084. headerTemplate: "",
  4085. title: "",
  4086. id: "",
  4087. type: "post",
  4088. once: "",
  4089. replyCount: 0,
  4090. clickCount: 0,
  4091. thankCount: 0,
  4092. collectCount: 0,
  4093. lastReadFloor: 0,
  4094. isFavorite: false,
  4095. isIgnore: false,
  4096. isThanked: false,
  4097. isReport: false
  4098. };
  4099. window.win = function() {
  4100. return window;
  4101. };
  4102. window.win().doc = window.win().document;
  4103. window.win().query = (v) => window.win().document.querySelector(v);
  4104. window.query = (v) => window.win().document.querySelector(v);
  4105. window.clone = (val) => JSON.parse(JSON.stringify(val));
  4106. window.user = {
  4107. tagPrefix: "--用户标签--",
  4108. tags: {},
  4109. tagsId: "",
  4110. username: "",
  4111. avatar: "",
  4112. readPrefix: "--已读楼层--",
  4113. readNoteItemId: "",
  4114. readList: {},
  4115. imgurPrefix: "--imgur图片删除hash--",
  4116. imgurList: {},
  4117. imgurNoteId: ""
  4118. };
  4119. window.targetUserName = "";
  4120. window.pageType = void 0;
  4121. window.pageData = { pageNo: 1 };
  4122. window.config = {
  4123. showToolbar: true,
  4124. showPreviewBtn: true,
  4125. autoOpenDetail: true,
  4126. openTag: true,
  4127. //给用户打标签
  4128. clickPostItemOpenDetail: true,
  4129. closePostDetailBySpace: true,
  4130. //点击空白处关闭详情
  4131. contentAutoCollapse: true,
  4132. //正文超长自动折叠
  4133. viewType: "table",
  4134. commentDisplayType: CommentDisplayType.FloorInFloorNoCallUser,
  4135. newTabOpen: false,
  4136. //新标签打开
  4137. base64: true,
  4138. //base功能
  4139. sov2ex: false,
  4140. postWidth: "",
  4141. showTopReply: true,
  4142. topReplyLoveMinCount: 3,
  4143. topReplyCount: 3,
  4144. autoJumpLastReadFloor: false,
  4145. rememberLastReadFloor: true,
  4146. autoSignin: true,
  4147. customBgColor: "",
  4148. version: 1,
  4149. collectBrowserNotice: false,
  4150. simple: false
  4151. };
  4152. window.currentVersion = 1;
  4153. window.isNight = $(".Night").length === 1;
  4154. window.cb = null;
  4155. window.postList = [];
  4156. window.parse = {
  4157. //解析帖子内容
  4158. async parsePostContent(post, body, htmlText) {
  4159. let once = htmlText.match(/var once = "([\d]+)";/);
  4160. if (once && once[1]) {
  4161. post.once = once[1];
  4162. }
  4163. post.isReport = htmlText.includes("你已对本主题进行了报告");
  4164. if (!post.title || !post.content_rendered) {
  4165. let main = body.find("#Main");
  4166. let aName = main.find(".header small.gray a:nth-child(1)");
  4167. if (aName) {
  4168. post.member.username = aName[0].innerText;
  4169. }
  4170. }
  4171. let topic_buttons = body.find(".topic_buttons");
  4172. if (topic_buttons.length) {
  4173. let favoriteNode = topic_buttons.find(".tb:first");
  4174. if (favoriteNode.length) {
  4175. post.isFavorite = favoriteNode[0].innerText === "取消收藏";
  4176. }
  4177. let ignoreNode = topic_buttons.find(".tb:nth-child(3)");
  4178. if (ignoreNode.length) {
  4179. post.isIgnore = ignoreNode[0].innerText === "取消忽略";
  4180. }
  4181. let thankNode = topic_buttons.find("#topic_thank .tb");
  4182. if (!thankNode.length) {
  4183. post.isThanked = true;
  4184. }
  4185. let topic_stats = topic_buttons.find(".topic_stats");
  4186. if (topic_stats.length) {
  4187. let text = topic_stats[0].innerText;
  4188. let reg1 = text.matchAll(/([\d]+)[\s]*人收藏/g);
  4189. let collectCountReg = [...reg1];
  4190. if (collectCountReg.length) {
  4191. post.collectCount = Number(collectCountReg[0][1]);
  4192. }
  4193. reg1 = text.matchAll(/([\d]+)[\s]*likes/g);
  4194. collectCountReg = [...reg1];
  4195. if (collectCountReg.length) {
  4196. post.collectCount = Number(collectCountReg[0][1]);
  4197. }
  4198. let reg2 = text.matchAll(/([\d]+)[\s]*人感谢/g);
  4199. let thankCountReg = [...reg2];
  4200. if (thankCountReg.length) {
  4201. post.thankCount = Number(thankCountReg[0][1]);
  4202. }
  4203. let reg3 = text.matchAll(/([\d]+)[\s]*次点击/g);
  4204. let clickCountReg = [...reg3];
  4205. if (clickCountReg.length) {
  4206. post.clickCount = Number(clickCountReg[0][1]);
  4207. }
  4208. reg3 = text.matchAll(/([\d]+)[\s]*views/g);
  4209. clickCountReg = [...reg3];
  4210. if (clickCountReg.length) {
  4211. post.clickCount = Number(clickCountReg[0][1]);
  4212. }
  4213. }
  4214. }
  4215. let header = body.find("#Main .box").first();
  4216. let temp = header.clone();
  4217. temp.find(".topic_buttons").remove();
  4218. let html = temp.html();
  4219. html = this.checkPhotoLink2Img(html);
  4220. post.headerTemplate = html;
  4221. return post;
  4222. },
  4223. //获取帖子所有回复
  4224. async getPostAllReplies(post, body, htmlText, pageNo = 1) {
  4225. var _a, _b;
  4226. if (body.find("#no-comments-yet").length) {
  4227. return post;
  4228. }
  4229. let box = body.find("#Main > .box")[1];
  4230. let cells = box.querySelectorAll(".cell");
  4231. if (cells && cells.length) {
  4232. post.fr = cells[0].querySelector(".cell .fr").innerHTML;
  4233. cells = Array.from(cells);
  4234. }
  4235. let snow = cells[0].querySelector(".snow");
  4236. post.createDate = ((_b = (_a = snow == null ? void 0 : snow.nextSibling) == null ? void 0 : _a.nodeValue) == null ? void 0 : _b.trim()) || "";
  4237. let repliesMap = [];
  4238. if (cells[1].id) {
  4239. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(1)) });
  4240. let replyList = this.getAllReply(repliesMap);
  4241. post.replyList = replyList;
  4242. post.replyCount = replyList.length;
  4243. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  4244. let nestedList = this.createNestedList(replyList, post.allReplyUsers);
  4245. let nestedRedundantList = this.createNestedRedundantList(replyList, post.allReplyUsers);
  4246. if (nestedList)
  4247. post.nestedReplies = nestedList;
  4248. if (nestedRedundantList)
  4249. post.nestedRedundReplies = nestedRedundantList;
  4250. return post;
  4251. } else {
  4252. let promiseList = [];
  4253. return new Promise((resolve, reject) => {
  4254. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  4255. let pages = cells[1].querySelectorAll("a");
  4256. pages = Array.from(pages);
  4257. let url = window.baseUrl + "/t/" + post.id;
  4258. for (let i = 0; i < pages.length; i++) {
  4259. let currentPageNo = Number(pages[i].innerText);
  4260. if (currentPageNo == pageNo)
  4261. continue;
  4262. promiseList.push(this.fetchPostOtherPageReplies(url + "?p=" + currentPageNo, currentPageNo));
  4263. }
  4264. Promise.allSettled(promiseList).then(
  4265. (results) => {
  4266. results.filter((result) => result.status === "fulfilled").map((v) => repliesMap.push(v.value));
  4267. let replyList = this.getAllReply(repliesMap);
  4268. post.replyList = replyList;
  4269. post.replyCount = replyList.length;
  4270. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  4271. let nestedList = this.createNestedList(replyList, post.allReplyUsers);
  4272. let nestedRedundantList = this.createNestedRedundantList(replyList, post.allReplyUsers);
  4273. if (nestedList)
  4274. post.nestedReplies = nestedList;
  4275. if (nestedRedundantList)
  4276. post.nestedRedundReplies = nestedRedundantList;
  4277. resolve(post);
  4278. }
  4279. );
  4280. });
  4281. }
  4282. },
  4283. //请求帖子其他页的回复
  4284. fetchPostOtherPageReplies(href, pageNo) {
  4285. return new Promise((resolve) => {
  4286. $.get(href).then((res) => {
  4287. let s = res.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4288. let box = $(s[0]).find("#Main .box")[1];
  4289. let cells = box.querySelectorAll(".cell");
  4290. cells = Array.from(cells);
  4291. resolve({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  4292. }).catch((r2) => {
  4293. if (r2.status === 403) {
  4294. cbChecker({ type: "restorePost", value: null });
  4295. }
  4296. });
  4297. });
  4298. },
  4299. //解析页面的回复
  4300. parsePageReplies(nodes) {
  4301. let replyList = [];
  4302. nodes.forEach((node, index2) => {
  4303. if (!node.id)
  4304. return;
  4305. let item = {
  4306. level: 0,
  4307. thankCount: 0,
  4308. isThanked: false,
  4309. isOp: false,
  4310. isDup: false,
  4311. id: node.id.replace("r_", "")
  4312. };
  4313. let reply_content = node.querySelector(".reply_content");
  4314. item.reply_content = this.checkPhotoLink2Img(reply_content.innerHTML);
  4315. item.reply_text = reply_content.textContent;
  4316. let { users, floor } = this.parseReplyContent(item.reply_content);
  4317. item.hideCallUserReplyContent = item.reply_content;
  4318. if (users.length === 1) {
  4319. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  4320. }
  4321. item.replyUsers = users;
  4322. item.replyFloor = floor;
  4323. let ago = node.querySelector(".ago");
  4324. item.date = ago.textContent;
  4325. let userNode = node.querySelector("strong a");
  4326. item.username = userNode.textContent;
  4327. let avatar = node.querySelector("td img");
  4328. item.avatar = avatar.src;
  4329. let no = node.querySelector(".no");
  4330. item.floor = Number(no.textContent);
  4331. let thank_area = node.querySelector(".thank_area");
  4332. if (thank_area) {
  4333. item.isThanked = thank_area.classList.contains("thanked");
  4334. }
  4335. let small = node.querySelector(".small");
  4336. if (small) {
  4337. item.thankCount = Number(small.textContent);
  4338. }
  4339. let op = node.querySelector(".op");
  4340. if (op) {
  4341. item.isOp = true;
  4342. }
  4343. let mod = node.querySelector(".mod");
  4344. if (mod) {
  4345. item.isMod = true;
  4346. }
  4347. replyList.push(item);
  4348. });
  4349. return replyList;
  4350. },
  4351. //解析回复内容,解析出@用户,回复楼层。用于后续生成嵌套楼层
  4352. parseReplyContent(str) {
  4353. if (!str)
  4354. return;
  4355. let users = [];
  4356. let getUsername = (userStr) => {
  4357. let endIndex = userStr.indexOf('">');
  4358. if (endIndex > -1) {
  4359. let user = userStr.substring(0, endIndex);
  4360. if (!users.find((i) => i === user)) {
  4361. users.push(user);
  4362. }
  4363. }
  4364. };
  4365. let userReg = /@<a href="\/member\/([\s\S]+?)<\/a>/g;
  4366. let has = str.matchAll(userReg);
  4367. let res2 = [...has];
  4368. if (res2.length > 1) {
  4369. res2.map((item) => {
  4370. getUsername(item[1]);
  4371. });
  4372. }
  4373. if (res2.length === 1) {
  4374. getUsername(res2[0][1]);
  4375. }
  4376. let floor = -1;
  4377. if (users.length === 1) {
  4378. let floorReg = /@<a href="\/member\/[\s\S]+?<\/a>[\s]+#([\d]+)/g;
  4379. let hasFloor = str.matchAll(floorReg);
  4380. let res = [...hasFloor];
  4381. if (res.length) {
  4382. floor = Number(res[0][1]);
  4383. }
  4384. }
  4385. return { users, floor };
  4386. },
  4387. //获取帖子详情
  4388. async getPostDetail(post, body, htmlText, pageNo = 1) {
  4389. post = await this.parsePostContent(post, body, htmlText);
  4390. return await this.getPostAllReplies(post, body, htmlText, pageNo);
  4391. },
  4392. getAllReply(repliesMap = []) {
  4393. return repliesMap.sort((a, b) => a.i - b.i).reduce((pre, i) => {
  4394. pre = pre.concat(i.replyList);
  4395. return pre;
  4396. }, []);
  4397. },
  4398. //生成嵌套回复
  4399. createNestedList(allList = []) {
  4400. if (!allList.length)
  4401. return [];
  4402. if (Date.now() - window.win().lastCallDate < 1e3) {
  4403. return false;
  4404. }
  4405. let list = window.clone(allList);
  4406. let nestedList = [];
  4407. list.map((item, index2) => {
  4408. let startList = list.slice(0, index2);
  4409. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  4410. let endList = list.slice(index2 + 1);
  4411. if (index2 === 0) {
  4412. nestedList.push(this.findChildren(item, endList, list));
  4413. } else {
  4414. if (!item.isUse) {
  4415. let isOneLevelReply = false;
  4416. if (item.replyUsers.length) {
  4417. if (item.replyUsers.length > 1) {
  4418. isOneLevelReply = true;
  4419. } else {
  4420. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  4421. }
  4422. } else {
  4423. isOneLevelReply = true;
  4424. }
  4425. if (isOneLevelReply) {
  4426. item.level === 0;
  4427. nestedList.push(this.findChildren(item, endList, list));
  4428. }
  4429. }
  4430. }
  4431. });
  4432. return nestedList;
  4433. },
  4434. //生成嵌套冗余回复
  4435. createNestedRedundantList(allList = []) {
  4436. if (!allList.length)
  4437. return [];
  4438. if (Date.now() - window.win().lastCallDate < 1e3) {
  4439. return false;
  4440. }
  4441. let list = window.clone(allList);
  4442. let nestedList = [];
  4443. list.map((item, index2) => {
  4444. let startList = list.slice(0, index2);
  4445. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  4446. let endList = list.slice(index2 + 1);
  4447. if (index2 === 0) {
  4448. nestedList.push(this.findChildren(item, endList, list));
  4449. } else {
  4450. if (!item.isUse) {
  4451. let isOneLevelReply = false;
  4452. if (item.replyUsers.length) {
  4453. if (item.replyUsers.length > 1) {
  4454. isOneLevelReply = true;
  4455. } else {
  4456. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  4457. }
  4458. } else {
  4459. isOneLevelReply = true;
  4460. }
  4461. if (isOneLevelReply) {
  4462. item.level === 0;
  4463. nestedList.push(this.findChildren(item, endList, list));
  4464. }
  4465. } else {
  4466. let newItem = window.clone(item);
  4467. newItem.children = [];
  4468. newItem.level = 0;
  4469. newItem.isDup = true;
  4470. nestedList.push(newItem);
  4471. }
  4472. }
  4473. });
  4474. window.win().lastCallDate = Date.now();
  4475. return nestedList;
  4476. },
  4477. //查找子回复
  4478. findChildren(item, endList, all) {
  4479. var _a;
  4480. const fn = (child, endList2, parent) => {
  4481. child.level = parent.level + 1;
  4482. let rIndex = all.findIndex((v) => v.floor === child.floor);
  4483. if (rIndex > -1) {
  4484. all[rIndex].isUse = true;
  4485. }
  4486. parent.children.push(this.findChildren(child, endList2, all));
  4487. };
  4488. item.children = [];
  4489. let floorReplyList = [];
  4490. for (let i = 0; i < endList.length; i++) {
  4491. let currentItem = endList[i];
  4492. if (currentItem.isUse)
  4493. continue;
  4494. if (currentItem.replyFloor === item.floor) {
  4495. if (currentItem.replyUsers.length === 1 && currentItem.replyUsers[0] === item.username) {
  4496. currentItem.isUse = true;
  4497. floorReplyList.push({ endList: endList.slice(i + 1), currentItem });
  4498. } else {
  4499. currentItem.isWrong = true;
  4500. }
  4501. }
  4502. }
  4503. floorReplyList.reverse().map(({ currentItem, endList: endList2 }) => {
  4504. fn(currentItem, endList2, item);
  4505. });
  4506. let nextMeIndex = endList.findIndex((v) => {
  4507. var _a2;
  4508. return v.username === item.username && ((_a2 = v.replyUsers) == null ? void 0 : _a2[0]) !== item.username;
  4509. });
  4510. let findList = nextMeIndex > -1 ? endList.slice(0, nextMeIndex) : endList;
  4511. for (let i = 0; i < findList.length; i++) {
  4512. let currentItem = findList[i];
  4513. if (currentItem.isUse)
  4514. continue;
  4515. if (currentItem.replyUsers.length === 1) {
  4516. if (currentItem.replyFloor !== -1) {
  4517. if (((_a = all[currentItem.replyFloor - 1]) == null ? void 0 : _a.username) === currentItem.replyUsers[0]) {
  4518. continue;
  4519. }
  4520. }
  4521. let endList2 = endList.slice(i + 1);
  4522. if (currentItem.username === item.username) {
  4523. if (currentItem.replyUsers[0] === item.username) {
  4524. fn(currentItem, endList2, item);
  4525. }
  4526. break;
  4527. } else {
  4528. if (currentItem.replyUsers[0] === item.username) {
  4529. fn(currentItem, endList2, item);
  4530. }
  4531. }
  4532. } else {
  4533. if (currentItem.username === item.username)
  4534. break;
  4535. }
  4536. }
  4537. item.children = item.children.sort((a, b) => a.floor - b.floor);
  4538. return item;
  4539. },
  4540. //解析页面帖子列表
  4541. parsePagePostList(list, box) {
  4542. list.forEach((itemDom) => {
  4543. let item = window.clone(window.initPost);
  4544. let item_title = itemDom.querySelector(".item_title a");
  4545. let { href, id } = window.parse.parseA(item_title);
  4546. item.id = id;
  4547. item.href = href;
  4548. item.url = location.origin + "/api/topics/show.json?id=" + item.id;
  4549. itemDom.classList.add("post-item");
  4550. itemDom.classList.add(`id_${id}`);
  4551. itemDom.dataset["href"] = href;
  4552. itemDom.dataset["id"] = id;
  4553. window.postList.push(item);
  4554. });
  4555. Promise.allSettled(window.postList.map((item) => $.get(item.url))).then((res) => {
  4556. let ok = res.filter((r2) => r2.status === "fulfilled").map((v) => v.value[0]);
  4557. box.style.boxShadow = "unset";
  4558. box.style.background = "unset";
  4559. if (window.config.viewType === "card") {
  4560. list.forEach((itemDom) => itemDom.classList.add("preview"));
  4561. }
  4562. ok.map((postItem) => {
  4563. var _a;
  4564. if (postItem == null ? void 0 : postItem.id) {
  4565. let itemDom = box.querySelector(`.id_${postItem.id}`);
  4566. if (window.config.showPreviewBtn) {
  4567. let td = itemDom.querySelector("td:nth-child(4)");
  4568. td.style.position = "relative";
  4569. let toggle = document.createElement("div");
  4570. toggle.dataset["id"] = postItem.id;
  4571. toggle.classList.add("toggle");
  4572. toggle.innerText = "点击展开/收起";
  4573. td.append(toggle);
  4574. }
  4575. let index2 = window.postList.findIndex((v) => v.id == postItem.id);
  4576. if (index2 > -1) {
  4577. let obj = window.postList[index2];
  4578. window.postList[index2] = Object.assign({}, obj, postItem);
  4579. if (postItem.content_rendered) {
  4580. let a = document.createElement("a");
  4581. a.href = obj.href;
  4582. a.classList.add("post-content");
  4583. let div = document.createElement("div");
  4584. div.innerHTML = postItem.content_rendered;
  4585. a.append(div);
  4586. itemDom.append(a);
  4587. if (div.clientHeight < 172) {
  4588. a.classList.add("show-all");
  4589. } else {
  4590. let showMore = document.createElement("div");
  4591. showMore.classList.add("show-more");
  4592. showMore.innerHTML = "显示更多/收起";
  4593. showMore.onclick = function(e2) {
  4594. e2.stopPropagation();
  4595. a.classList.toggle("show-all");
  4596. };
  4597. (_a = a.parentNode) == null ? void 0 : _a.append(showMore);
  4598. }
  4599. }
  4600. }
  4601. }
  4602. });
  4603. cbChecker({ type: "syncData" });
  4604. });
  4605. },
  4606. parseA(a) {
  4607. let href = a.href;
  4608. let id;
  4609. if (href.includes("/t/")) {
  4610. id = href.substring(href.indexOf("/t/") + 3, href.indexOf("/t/") + 9);
  4611. }
  4612. return { href, id, title: a.innerText };
  4613. },
  4614. //创建记事本子条目
  4615. async createNoteItem(itemName) {
  4616. return new Promise(async (resolve) => {
  4617. let data = new FormData();
  4618. data.append("content", itemName);
  4619. data.append("parent_id", 0);
  4620. data.append("syntax", 0);
  4621. let apiRes = await window.win().fetch(`${window.baseUrl}/notes/new`, { method: "post", body: data });
  4622. console.log(apiRes);
  4623. if (apiRes.redirected && apiRes.status === 200) {
  4624. resolve(apiRes.url.substr(-5));
  4625. return;
  4626. }
  4627. resolve(null);
  4628. });
  4629. },
  4630. //编辑记事本子条目
  4631. async editNoteItem(val, id) {
  4632. let data = new FormData();
  4633. data.append("content", val);
  4634. data.append("syntax", 0);
  4635. let apiRes = await window.fetch(`${window.baseUrl}/notes/edit/${id}`, {
  4636. method: "post",
  4637. body: data
  4638. });
  4639. return apiRes.redirected && apiRes.status === 200;
  4640. },
  4641. //标签操作
  4642. async saveTags(val) {
  4643. for (const [key, value] of Object.entries(val)) {
  4644. if (!value.length)
  4645. delete val[key];
  4646. }
  4647. return await this.editNoteItem(window.user.tagPrefix + JSON.stringify(val), window.user.tagsId);
  4648. },
  4649. //已读楼层操作
  4650. async saveReadList(val) {
  4651. return await this.editNoteItem(window.user.readPrefix + JSON.stringify(val), window.user.readNoteItemId);
  4652. },
  4653. //imgur图片删除hash操作
  4654. async saveImgurList(val) {
  4655. return await this.editNoteItem(window.user.imgurPrefix + JSON.stringify(val), window.user.imgurNoteId);
  4656. },
  4657. //图片链接转Img标签
  4658. checkPhotoLink2Img(str) {
  4659. if (!str)
  4660. return;
  4661. try {
  4662. let imgWebs = [
  4663. /<a((?!<a).)*href="https?:\/\/((?!<a).)*imgur.com((?!<a).)*>(((?!<a).)*)<\/a>/g,
  4664. /<a((?!<a).)*href="https?:\/\/((?!<a).)*\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG) ((?!<a).)*>(((?!<a).)*)<\/a>/g
  4665. ];
  4666. imgWebs.map((v, i) => {
  4667. let has = str.matchAll(v);
  4668. let res2 = [...has];
  4669. res2.map((r2) => {
  4670. let p = i === 0 ? r2[4] : r2[5];
  4671. if (p) {
  4672. let link = p.toLowerCase();
  4673. let src = p;
  4674. if (link.includes(".png") || link.includes(".jpg") || link.includes(".jpeg") || link.includes(".gif")) {
  4675. } else {
  4676. src = p + ".png";
  4677. }
  4678. str = str.replace(r2[0], `<img src="${src}" data-originUrl="${p}" data-notice="这个img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`);
  4679. }
  4680. });
  4681. });
  4682. } catch (e2) {
  4683. console.log("正则解析html里面的a标签的图片链接出错了");
  4684. }
  4685. return str;
  4686. }
  4687. };
  4688. async function sleep(time) {
  4689. return new Promise((resolve) => {
  4690. setTimeout(resolve, time);
  4691. });
  4692. }
  4693. async function cbChecker(val, count = 0) {
  4694. if (window.cb) {
  4695. window.cb(val);
  4696. } else {
  4697. while (!window.cb && count < 20) {
  4698. await sleep(500);
  4699. count++;
  4700. }
  4701. window.cb && window.cb(val);
  4702. }
  4703. }
  4704. function feedback() {
  4705. _GM_openInTab("https://github.com/zyronon/v2ex-script/issues", {
  4706. active: true,
  4707. insert: true,
  4708. setParent: true
  4709. });
  4710. }
  4711. function initMonkeyMenu() {
  4712. try {
  4713. _GM_registerMenuCommand("脚本设置", function(event) {
  4714. cbChecker({ type: "openSetting" });
  4715. });
  4716. _GM_registerMenuCommand("💬 反馈 & 建议", feedback);
  4717. } catch (e2) {
  4718. console.error("无法使用Tampermonkey");
  4719. }
  4720. }
  4721. function initStyle() {
  4722. let style2 = `
  4723. html, body {
  4724. font-size: 62.5%;
  4725. }
  4726.  
  4727. #Wrapper {
  4728. height: unset !important;
  4729. width: unset !important;
  4730. }
  4731.  
  4732. #Wrapper > .content {
  4733. height: unset !important;
  4734. width: unset !important;
  4735. }
  4736.  
  4737. .post-item {
  4738. background: white;
  4739. }
  4740.  
  4741. .post-item > .post-content {
  4742. height: 0;
  4743. margin-top: 0;
  4744. }
  4745.  
  4746. .post-item:hover .toggle {
  4747. display: flex;
  4748. }
  4749.  
  4750. .toggle {
  4751. position: absolute;
  4752. right: ${window.config.simple ? "5rem" : 0};
  4753. top: 0.5rem;
  4754. width: 9rem;
  4755. height: 100%;
  4756. display: flex;
  4757. justify-content: flex-end;
  4758. align-items: flex-end;
  4759. cursor: pointer;
  4760. font-size: 1.2rem;
  4761. color: #ccc;
  4762. display: none;
  4763. }
  4764.  
  4765. .preview {
  4766. margin: 1rem 0;
  4767. border: 1px solid #c8c8c8;
  4768. border-radius: 0.4rem;
  4769. cursor: pointer;
  4770. }
  4771.  
  4772. .preview:hover {
  4773. border: 1px solid #968b8b;
  4774. }
  4775.  
  4776. .preview > .post-content {
  4777. height: unset !important;
  4778. margin-top: 0.5rem !important;
  4779. }
  4780.  
  4781. .preview > .post-content.show-all {
  4782. max-height: unset;
  4783. -webkit-mask-image:none;
  4784. }
  4785.  
  4786. .preview .topic-link:link {
  4787. color: black !important;
  4788. }
  4789.  
  4790. .post-content {
  4791. margin-top: 0.5rem;
  4792. display: block;
  4793. max-height: 20rem;
  4794. overflow: hidden;
  4795. text-decoration: unset !important;
  4796. line-break: anywhere;
  4797. -webkit-mask-image: linear-gradient(180deg,#000 60%,transparent);
  4798. }
  4799.  
  4800. .show-more {
  4801. display: none;
  4802. }
  4803.  
  4804. .preview > .show-more {
  4805. font-size: 1.3rem;
  4806. text-align: right;
  4807. height: 3rem;
  4808. display: flex;
  4809. align-items: center;
  4810. justify-content: center;
  4811. position: relative;
  4812. z-index: 9;
  4813. }
  4814.  
  4815. .post-content:visited {
  4816. color: #afb9c1 !important;
  4817. }
  4818.  
  4819. .post-content:link {
  4820. color: #494949;
  4821. }
  4822.  
  4823.  
  4824. .Night .post-item {
  4825. background: #18222d !important;
  4826. }
  4827.  
  4828. .Night .preview {
  4829. border: 1px solid #3b536e;
  4830. }
  4831.  
  4832. .Night .preview > .post-content:link {
  4833. color: #d1d5d9;
  4834. }
  4835.  
  4836. .Night .preview > .post-content:visited {
  4837. color: #393f4e !important;
  4838. }
  4839. .Night .preview .topic-link:link {
  4840. color: #c0dbff !important;
  4841. }
  4842. ${window.config.simple ? `
  4843. ${window.pageType !== PageType.Member ? `
  4844. .item table tr td:first-child{display:none;}
  4845. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  4846. .item table tr td .sep5{display:none;}
  4847. .item table tr td .topic_info{display:none;}
  4848. .item {border-bottom:none;}
  4849. .avatar,#avatar{display:none;}
  4850. ` : ""}
  4851. #Logo {background-image:url('https://i.imgur.com/i9VgUtM.png');}
  4852. .bigger a, .top:nth-last-child(5){color: transparent!important;text-shadow: #b0b0b0 0 0 6px;user-select: none;}
  4853. // .bigger a:before,.top:nth-last-child(5):before{content:'Mona Lisa';position: absolute;background: white;}
  4854. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  4855. ` : ""}
  4856.  
  4857. ${window.config.customBgColor ? `#Wrapper {
  4858. background-color: ${window.config.customBgColor} !important;
  4859. background-image: unset !important;
  4860. }` : ""}
  4861. .top{
  4862. position:relative;
  4863. }
  4864. .new:before{
  4865. content:'new';
  4866. position: absolute;
  4867. background: red;
  4868. font-size: 10px;
  4869. border-radius: 4px;
  4870. padding: 0px 2px;
  4871. color: white;
  4872. right: -9px;
  4873. top: -3px;
  4874. }
  4875. }
  4876.  
  4877. `;
  4878. let addStyle2 = document.createElement("style");
  4879. addStyle2.rel = "stylesheet";
  4880. addStyle2.type = "text/css";
  4881. addStyle2.innerHTML = style2;
  4882. $(window.win().doc.head).append(addStyle2);
  4883. }
  4884. function qianDao() {
  4885. let timeNow = (/* @__PURE__ */ new Date()).getUTCFullYear() + "/" + ((/* @__PURE__ */ new Date()).getUTCMonth() + 1) + "/" + (/* @__PURE__ */ new Date()).getUTCDate();
  4886. if (window.pageType === PageType.Home) {
  4887. let qiandao = window.query('.box .inner a[href="/mission/daily"]');
  4888. if (qiandao) {
  4889. qianDao_(qiandao, timeNow);
  4890. } else if (window.win().doc.getElementById("gift_v2excellent")) {
  4891. window.win().doc.getElementById("gift_v2excellent").click();
  4892. localStorage.setItem("menu_clockInTime", timeNow);
  4893. console.info("[V2EX - 超级增强] 自动签到完成!");
  4894. } else {
  4895. console.info("[V2EX - 超级增强] 自动签到完成!");
  4896. }
  4897. } else {
  4898. let timeOld = localStorage.getItem("menu_clockInTime");
  4899. if (!timeOld || timeOld != timeNow) {
  4900. qianDaoStatus_(timeNow);
  4901. } else {
  4902. console.info("[V2EX - 超级增强] 自动签到完成!");
  4903. }
  4904. }
  4905. }
  4906. function qianDao_(qiandao, timeNow) {
  4907. let url = window.baseUrl + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector("div#Top .tools, #menu-body").innerHTML)[0];
  4908. console.log("url", url);
  4909. $.get(url).then((r2) => {
  4910. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4911. let html = $(bodyText[0]);
  4912. if (html.find("li.fa.fa-ok-sign").length) {
  4913. html = html.find("#Main").text().match(/已连续登录(不可用) (\d+?) 天/)[0];
  4914. localStorage.setItem("menu_clockInTime", timeNow);
  4915. console.info("[V2EX - 超级增强] 自动签到完成!");
  4916. if (qiandao) {
  4917. qiandao.textContent = `自动签到完成!${html}`;
  4918. qiandao.href = "javascript:void(0);";
  4919. }
  4920. } else {
  4921. _GM_notification({
  4922. text: "自动签到失败!请关闭其他插件或脚本。\n如果连续几天都签到失败,请联系作者解决!",
  4923. timeout: 4e3,
  4924. onclick() {
  4925. feedback();
  4926. }
  4927. });
  4928. console.warn("[V2EX 增强] 自动签到失败!请关闭其他插件或脚本。如果连续几天都签到失败,请联系作者解决!");
  4929. if (qiandao)
  4930. qiandao.textContent = "自动签到失败!请尝试手动签到!";
  4931. }
  4932. });
  4933. }
  4934. function qianDaoStatus_(timeNow) {
  4935. $.get(window.baseUrl + "/mission/daily").then((r2) => {
  4936. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4937. let html = $(bodyText[0]);
  4938. if (html.find('input[value^="领取"]').length) {
  4939. qianDao_(null, timeNow);
  4940. } else {
  4941. console.info("[V2EX 增强] 已经签过到了。");
  4942. localStorage.setItem("menu_clockInTime", timeNow);
  4943. }
  4944. });
  4945. }
  4946. function checkPageType() {
  4947. let location2 = window.win().location;
  4948. if (location2.pathname === "/") {
  4949. window.pageType = PageType.Home;
  4950. } else if (location2.href.match(/.com\/?tab=/)) {
  4951. window.pageType = PageType.Home;
  4952. } else if (location2.href.match(/.com\/go\//)) {
  4953. if (!location2.href.includes("/links")) {
  4954. window.pageType = PageType.Node;
  4955. }
  4956. } else if (location2.href.match(/.com\/recent/)) {
  4957. window.pageType = PageType.Home;
  4958. } else if (location2.href.match(/.com\/member/)) {
  4959. window.pageType = PageType.Member;
  4960. } else {
  4961. let r2 = location2.href.match(/.com\/t\/([\d]+)/);
  4962. if (r2) {
  4963. window.pageType = PageType.Post;
  4964. window.pageData.id = r2[1];
  4965. if (location2.search) {
  4966. let pr = location2.href.match(/\?p=([\d]+)/);
  4967. if (pr)
  4968. window.pageData.pageNo = Number(pr[1]);
  4969. }
  4970. }
  4971. }
  4972. }
  4973. function getNoteItemContent(id, prefix) {
  4974. return new Promise((resolve, reject) => {
  4975. $.get(window.baseUrl + "/notes/edit/" + id).then((r2) => {
  4976. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4977. let body = $(bodyText[0]);
  4978. let text = body.find(".note_editor").text();
  4979. if (text === prefix) {
  4980. resolve({});
  4981. } else {
  4982. let tagJson = text.substring(prefix.length);
  4983. try {
  4984. resolve(JSON.parse(tagJson));
  4985. } catch (e2) {
  4986. console.log("tage", tagJson);
  4987. resolve({});
  4988. }
  4989. }
  4990. });
  4991. });
  4992. }
  4993. async function initNoteData() {
  4994. $.get(window.baseUrl + "/notes").then(async (r2) => {
  4995. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4996. let body = $(bodyText[0]);
  4997. let items = body.find("#Main .box .note_item_title a");
  4998. let tagItem = Array.from(items).find((v) => v.innerText.includes(window.user.tagPrefix));
  4999. if (tagItem) {
  5000. window.user.tagsId = tagItem.href.substr(-5);
  5001. window.user.tags = await getNoteItemContent(window.user.tagsId, window.user.tagPrefix);
  5002. } else {
  5003. let r22 = await window.parse.createNoteItem(window.user.tagPrefix);
  5004. r22 && (window.user.tagsId = r22);
  5005. }
  5006. let readItem = Array.from(items).find((v) => v.innerText.includes(window.user.readPrefix));
  5007. if (readItem) {
  5008. window.user.readNoteItemId = readItem.href.substr(-5);
  5009. window.user.readList = await getNoteItemContent(window.user.readNoteItemId, window.user.readPrefix);
  5010. } else {
  5011. let r22 = await window.parse.createNoteItem(window.user.readPrefix);
  5012. r22 && (window.user.readNoteItemId = r22);
  5013. }
  5014. let imgurItem = Array.from(items).find((v) => v.innerText.includes(window.user.imgurPrefix));
  5015. if (imgurItem) {
  5016. window.user.imgurNoteId = imgurItem.href.substr(-5);
  5017. window.user.imgurList = await getNoteItemContent(window.user.imgurNoteId, window.user.imgurPrefix);
  5018. } else {
  5019. let r22 = await window.parse.createNoteItem(window.user.imgurPrefix);
  5020. r22 && (window.user.imgurNoteId = r22);
  5021. }
  5022. cbChecker({ type: "syncData" });
  5023. });
  5024. }
  5025. function initConfig() {
  5026. return new Promise((resolve) => {
  5027. let configStr = window.win().localStorage.getItem("v2ex-config");
  5028. if (configStr) {
  5029. let configObj = JSON.parse(configStr);
  5030. configObj = configObj[window.user.username ?? "default"];
  5031. if (configObj) {
  5032. window.config = Object.assign(window.config, configObj);
  5033. }
  5034. }
  5035. resolve(window.config);
  5036. });
  5037. }
  5038. function initSoV2ex() {
  5039. var $search = $("#search");
  5040. var searchEvents = $._data($search[0], "events");
  5041. console.log($search, searchEvents);
  5042. var oKeydownEvent = searchEvents["keydown"][0]["handler"];
  5043. var oInputEvent = searchEvents["input"][0]["handler"];
  5044. $search.attr("placeholder", "sov2ex");
  5045. $search.unbind("keydown", oKeydownEvent);
  5046. $search.unbind("input", oInputEvent);
  5047. $search.on("input", function(e2) {
  5048. oInputEvent(e2);
  5049. $(".search-item:last").attr("href", "https://www.sov2ex.com/?q=" + $search.val()).text("sov2ex " + $search.val());
  5050. });
  5051. $search.keydown(function(e2) {
  5052. if (e2.code == "Enter" || e2.code == "NumpadEnter" || e2.keyCode === 13) {
  5053. if ($(".search-item:last").is(".active")) {
  5054. $(this).val($(this).val().replace(/[#%&]/g, ""));
  5055. window.open("https://www.sov2ex.com/?q=" + $(this).val());
  5056. return 0;
  5057. }
  5058. }
  5059. oKeydownEvent(e2);
  5060. });
  5061. }
  5062. function addSettingText() {
  5063. let setting = $(`<a href="javascript:void 0;" class="top ${window.config.version < window.currentVersion ? "new" : ""}">脚本设置</a>`);
  5064. setting.on("click", function() {
  5065. this.classList.remove("new");
  5066. cbChecker({ type: "openSetting" });
  5067. });
  5068. $(".tools").prepend(setting);
  5069. }
  5070. function init() {
  5071. checkPageType();
  5072. initMonkeyMenu();
  5073. let top2 = document.querySelector(".tools .top:nth-child(2)");
  5074. if (top2 && top2.textContent !== "注册(不可用)") {
  5075. window.user.username = top2.textContent;
  5076. window.user.avatar = $("#Rightbar .box .avatar").attr("src");
  5077. initNoteData();
  5078. }
  5079. initConfig().then((r2) => {
  5080. addSettingText();
  5081. initStyle();
  5082. if (window.config.sov2ex) {
  5083. setTimeout(initSoV2ex, 1e3);
  5084. }
  5085. try {
  5086. if (window.config.autoSignin && window.user.username) {
  5087. qianDao();
  5088. }
  5089. } catch (e2) {
  5090. console.log("签到失败");
  5091. }
  5092. });
  5093. let box;
  5094. let list;
  5095. console.log(window.pageType);
  5096. switch (window.pageType) {
  5097. case PageType.Node:
  5098. box = window.win().doc.querySelectorAll("#Wrapper #Main .box");
  5099. let topics = box[1].querySelector("#TopicsNode");
  5100. list = topics.querySelectorAll(".cell");
  5101. list[0].before($section);
  5102. window.parse.parsePagePostList(list, box[1]);
  5103. break;
  5104. case PageType.Home:
  5105. box = document.querySelector("#Wrapper #Main .box");
  5106. list = box.querySelectorAll(".item");
  5107. list[0].before($section);
  5108. window.parse.parsePagePostList(list, box);
  5109. break;
  5110. case PageType.Post:
  5111. if (window.config.postWidth) {
  5112. let Main = $("#Main");
  5113. Main.css({
  5114. "width": window.config.postWidth,
  5115. margin: "unset"
  5116. });
  5117. $("#Wrapper > .content").css({
  5118. "max-width": "unset",
  5119. display: "flex",
  5120. "justify-content": "center",
  5121. gap: "20px"
  5122. });
  5123. Main.after($("#Rightbar"));
  5124. }
  5125. box = document.querySelector("#Wrapper #Main .box");
  5126. box.after($section);
  5127. let post = Object.assign({}, window.clone(window.initPost), { id: window.pageData.id });
  5128. let body = $(window.win().doc.body);
  5129. let htmlText = window.win().doc.documentElement.outerHTML;
  5130. window.parse.parsePostContent(
  5131. post,
  5132. body,
  5133. htmlText
  5134. ).then(async (res) => {
  5135. await cbChecker({ type: "postContent", value: res }, 0);
  5136. });
  5137. window.parse.getPostAllReplies(
  5138. post,
  5139. body,
  5140. htmlText,
  5141. window.pageData.pageNo
  5142. ).then(async (res) => {
  5143. await cbChecker({ type: "postReplies", value: res }, 0);
  5144. });
  5145. break;
  5146. case PageType.Member:
  5147. box = document.querySelector("#Wrapper #Main .box");
  5148. if (box) {
  5149. window.targetUserName = box.querySelector("h1").textContent;
  5150. box.after($section);
  5151. if (window.config.openTag) {
  5152. box.style.borderBottom = "none";
  5153. box.style["border-bottom-left-radius"] = "0";
  5154. box.style["border-bottom-right-radius"] = "0";
  5155. }
  5156. }
  5157. break;
  5158. default:
  5159. console.error("未知页面");
  5160. break;
  5161. }
  5162. }
  5163. window.canParseV2exPage = !window.location.href.includes("script=0");
  5164. if (window.canParseV2exPage) {
  5165. init();
  5166. } else {
  5167. alert("脚本无法查看此主题,已为您单独打开此主题");
  5168. }
  5169. }
  5170. run();
  5171. let vueApp = vue.createApp(App);
  5172. vueApp.config.unwrapInjectedRef = true;
  5173. vueApp.mount($section);
  5174.  
  5175. })(Vue);

QingJ © 2025

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