네이버 스마트에디터 ONE 뷰포트

네이버 스마트에디터 ONE에서 다양한 단말기 해상도에 맞게 글을 작성하게 도와줍니다.

  1. // ==UserScript==
  2. // @namespace https://tampermonkey.myso.kr/
  3. // @name 네이버 스마트에디터 ONE 뷰포트
  4. // @description 네이버 스마트에디터 ONE에서 다양한 단말기 해상도에 맞게 글을 작성하게 도와줍니다.
  5. // @copyright 2021, myso (https://tampermonkey.myso.kr)
  6. // @license Apache-2.0
  7. // @version 1.0.10
  8. // @author Won Choi
  9. // @connect naver.com
  10. // @match *://blog.naver.com/PostWriteForm*
  11. // @match *://blog.naver.com/PostUpdateForm*
  12. // @match *://blog.naver.com/*/postwrite*
  13. // @match *://blog.editor.naver.com/editor*
  14. // @grant GM_addStyle
  15. // @require https://cdn.jsdelivr.net/npm/kr.myso.tampermonkey@1.0.25/assets/vendor/gm-app.js
  16. // @require https://cdn.jsdelivr.net/npm/kr.myso.tampermonkey@1.0.25/assets/vendor/gm-add-style.js
  17. // @require https://cdn.jsdelivr.net/npm/kr.myso.tampermonkey@1.0.25/assets/vendor/gm-add-script.js
  18. // @require https://cdn.jsdelivr.net/npm/kr.myso.tampermonkey@1.0.25/assets/donation.js
  19. // ==/UserScript==
  20.  
  21. // ==OpenUserJS==
  22. // @author myso
  23. // ==/OpenUserJS==
  24. GM_App(async function main() {
  25. GM_donation('#viewTypeSelector, #postListBody, #wrap_blog_rabbit, #writeTopArea, #editor_frame', 0);
  26. GM_addStyle(`
  27. #root { position: relative !important; }
  28. .device_group { position: absolute; left:0; right:0; top:5px; bottom: auto; margin: auto; width: 200px; z-index: 1000000; display: block; }
  29. .device_group > a { display:inline-block; float: left; text-align: center; width: 52px; height: 34px; background-image: url(https://ssl.pstatic.net/static.editor/static/dist/editor/1608280975560/img/sp_editor.png); background-repeat: no-repeat; }
  30. .device_group > a.device_mobile { background-position: -653px -731px; margin-right: 7px; }
  31. .device_group > a.device_mobile.is-active { background-position: -963px -731px; }
  32. .device_group > a.device_tablet { background-position: -777px -731px; margin-right: 7px; }
  33. .device_group > a.device_tablet.is-active { background-position: -715px -731px; }
  34. .device_group > a.device_desktop { background-position: -901px -731px; }
  35. .device_group > a.device_desktop.is-active { background-position: -839px -731px; }
  36. .se-cover-attach-button-container { padding: 0 15px !important; }
  37. .viewport-mobile .se-title-text span { font-size: 26px !important; }
  38. .viewport-mobile .se-canvas > * { min-width: 425px !important; max-width: 425px !important; width: 425px !important; margin: auto !important; }
  39. .viewport-tablet .se-canvas > * { min-width: 750px !important; max-width: 750px !important; width: 750px !important; margin: auto !important; }
  40.  
  41. `);
  42. function handler(e) {
  43. const container = document.querySelector('#root');
  44. const group = document.querySelector('.device_group') || document.createElement('div'); group.classList.add('device_group');
  45. const mobile = document.querySelector('.device_mobile') || document.createElement('a'); mobile.classList.add('device_mobile');
  46. const tablet = document.querySelector('.device_tablet') || document.createElement('a'); tablet.classList.add('device_tablet');
  47. const desktop = document.querySelector('.device_desktop') || document.createElement('a'); desktop.classList.add('device_desktop', 'is-active');
  48.  
  49. mobile.onclick = () => {
  50. mobile.classList.add('is-active');
  51. tablet.classList.remove('is-active');
  52. desktop.classList.remove('is-active');
  53. container.classList.remove('viewport-tablet', 'viewport-desktop');
  54. container.classList.add('viewport-mobile');
  55. };
  56. tablet.onclick = () => {
  57. mobile.classList.remove('is-active');
  58. tablet.classList.add('is-active');
  59. desktop.classList.remove('is-active');
  60. container.classList.remove('viewport-mobile', 'viewport-desktop');
  61. container.classList.add('viewport-tablet');
  62. };
  63. desktop.onclick = () => {
  64. mobile.classList.remove('is-active');
  65. tablet.classList.remove('is-active');
  66. desktop.classList.add('is-active');
  67. container.classList.remove('viewport-mobile', 'viewport-tablet');
  68. container.classList.add('viewport-desktop');
  69. };
  70.  
  71. group.appendChild(mobile);
  72. group.appendChild(tablet);
  73. group.appendChild(desktop);
  74. container.appendChild(group);
  75. }
  76. handler();
  77. });

QingJ © 2025

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