index.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <link rel="canonical" href="https://jamesfengcao.gitlab.io/uweb/zh/textprocess/" />
  7. <link rel="stylesheet" href="../style.css#" type="text/css" />
  8. <title>操作选中(富)文本/元素</title>
  9. <script>
  10. function findLang(){
  11. let href = location.href;
  12. for(let i=href.length-1;i>0;i--){
  13. if('/'==href.charAt(i) && '/'==href.charAt(i-3))
  14. return i;
  15. }
  16. return 0;
  17. }
  18. function nav2(page){
  19. let i = findLang();
  20. location.href = location.href.substring(0,i+1)+page;
  21. }
  22. function nav2Lang(lang){
  23. let i = findLang();
  24. let href = location.href;
  25. location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
  26. }
  27. </script>
  28. </head>
  29. <body>
  30. <header class='header'>
  31. <a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">首页</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">标签</a>
  32. <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('en')">English</a>
  33. <nav>
  34. </nav>
  35. </header>
  36. <br />
  37. <div class="container">
  38. <h1 class="title">操作选中(富)文本/元素
  39. <br>
  40. <span class="subtitle"></span>
  41. </h1>
  42. <ul class="tags">
  43. <li><a href="../tags/termux/index.html#">termux</a> </li>
  44. <li><a href="../tags/ssh/index.html#">ssh</a> </li>
  45. <li><a href="../tags/%e5%89%aa%e8%b4%b4%e6%9d%bf/index.html#">剪贴板</a> </li>
  46. <li><a href="../tags/windows/index.html#">windows</a> </li>
  47. </ul>
  48. <p>点击以下链接可安装长按“链接”按钮菜单:<br>
  49. <a href="i:0gdefault.select::网络剪贴板:/uwebA:echo -n i:0/js/uweb2ta.js:https://netcut.cn/ric?A00uweb=%250A;cat%0A">网络剪贴板:更改ric为其它未使用标识</a><br>
  50. <a href="i:0gdefault.select::notems:/uwebA:echo -n i:0/js/uweb2ta.js:https://note.ms/ric?A00uweb=%250A;cat%0A">note.ms:更改ric为其它未使用标识</a></p>
  51. <p><a href="i:0gdefault.select::bing翻译:/uweb:printf 'https://cn.bing.com/translator/?from=&to=zh-Hans&text=';cat|tr ' ' '%2B'%0A">bing翻译</a><br>
  52. <a href="i:0gdefault.select::papago翻译:/uweb:printf 'https://papago.naver.com/?sk=auto&tk=zh-CN&st=';cat|tr ' ' '%2B'%0A">papago翻译</a></p>
  53. <p><a href="i:0gdefault.select::iciba:/uweb:printf 'https://m.iciba.com/';cat|tr ' ' '%2B'%0A">iciba</a><br>
  54. <a href="i:0gdefault.select::百度翻译:/uweb:printf 'https://fanyi.baidu.com/#auto/zh/';cat|tr ' ' '%2B'%0A">百度翻译</a><br>
  55. <a href="i:0gdefault.select::有道翻译:/uweb:printf 'https://m.youdao.com/translate?type=AUTO&inputtext=';cat|tr ' ' '%2B'%0A">有道翻译</a><br>
  56. <a href="i:0gdefault.select::搜狗翻译:/uweb:printf 'https://translate.sogou.com/text?transfrom=auto&transto=zh-CHS&model=general&keyword=';cat|tr ' ' '%2B'%0A">搜狗翻译</a></p>
  57. <p><a href="i:0gdefault.select::彩云小译:/uweb:print 'https://fanyi.caiyunapp.com/#/ {function tE(el,t){var e=new Event(t);el.dispatchEvent(e);}let s=document.querySelector(%22textarea%22);s.value=%60';cat;print '%60;tE(s,%22input%22);tE(s,%22keyup%22)}'%0A">彩云小译</a><br>
  58. <a href="i:0gdefault.select::deepL:/uweb:print 'https://www.deepl.com/translator {function tE(el,t){var e=new InputEvent(t);el.dispatchEvent(e);}let s=document.querySelector(%22textarea%22);s.value=%60';cat;print '%60;tE(s,%22input%22)}'%0A">deepL</a></p>
  59. <p><a target="_self" href="i:0gdefault.select:../searchurl/txt/select.cfg">点击安装&quot;保存文本&quot;等</a></p>
  60. <p>重启浏览器,长按“链接”按钮,将弹出菜单。若用户当前窗口并无选中文本,则选取整个页面作相应操作,否则以选中文本为准。</p>
  61. <p>配置文件&quot;default.select&quot;定义了<a href="..">超微浏览器</a>对选中(富)文本/元素进行的操作。没有任何选中元素则以整个网页为操作对象。每行格式如下:<br>
  62. [菜单名]:[mimetype]:[命令行]</p>
  63. <p>选中(富)文本作为命令行的标准输入,而标准输出根据mimetype进行相应处理。<br>
  64. mimetype用来表示命令的输入输出类型。格式为&quot;[输入mimetype]/[输出mimetype]&quot;,&quot;[输入mimetype]&quot;可为&quot;html&quot;或空(txt格式)或为以超微配置目录为基准的相对路径.js文件名; 输出可为标准的mimetype或超微特殊扩充。如:<br>
  65. html/text/html: 选中富文本为html格式, 输出mimetype为text/html。<br>
  66. /uweb: 选中文本为txt格式, 输出mimetype为<a href="../cmd">特殊扩充uweb</a>,超微将把输出作为<a href="../links">链接</a>来处理。<br>
  67. /uwebA: 超微将把输出作为&quot;单一&quot;链接来处理。<br>
  68. /termux: 命令运行结果将作为termux下命令运行。<br>
  69. <a target="_self" href="i:0hcheck.js:../searchurl/txt/check.js">checked.js</a>: 运行配置目录下checked.js,其返回值作为命令行标准输入。对任何目录型(以“/”结尾)文件url,后面可附&quot;?[文件前缀][<em>[文件后缀]]&quot;。譬如&quot;file:///sdcard/?</em>.png&quot;会列举出&quot;/sdcard&quot;目录下所有.png文件。此时选择选定文件,则可利用checked.js复制文件至PC。(参看下面具体配置)</p>
  70. <p>配置default.select如下:<br>
  71. 复制文本到地址栏:/uweb:printf i:15;cat<br>
  72. 复制至PC剪贴板::ssh [user:password]@192.168.2.102 &quot;DISPLAY=:0 xsel -i&quot;<br>
  73. 复制富文本至PC剪贴板:html:ssh [user:password]@192.168.2.102 &quot;DISPLAY=:0 xsel -i&quot;<br>
  74. 复制文件至PC:checked.js:while read fname;do scp $fname [user:password]@192.168.2.102:Downloads/.; done</p>
  75. <p>如使用剪贴板功能手机需安装uweb定制<a href="../pcdown">Termux</a>,并在termux下安装openssl。<br>
  76. 此处假定远程PC的IP地址为192.168.2.102,PC已经开通了ssh服务。建议用户配置ssh服务为免密码登录,此时用户无需将密码写入文件default.select。用户PC上安装有xsel剪贴板工具。使用其它工具请酌情修改。</p>
  77. <p>采用以上配置,笔记将储存在应用内部目录下文件note.txt或note.html中(富文本)。命名笔记储存文件则由用户在地址栏输入框内指定。</p>
  78. <p>手机其它应用中的文本可选中后分享给超微浏览器,再由超微浏览器作笔记或进一步分享给PC。如果其它应用无法分享选中文本,这种情况可以先复制文本至剪贴板。长按链接按钮选择适当功能即可复制至PC剪贴板。</p>
  79. <h4 id="windows-pc">Windows PC</h4>
  80. <p>对Windows PC而言,vista及以后自带clip.exe,此时配置如下:<br>
  81. 复制文本至PC剪贴板::ssh [user:password]@192.168.2.102 clip.exe</code></p>
  82. <p>其它推荐工具(读取PC剪贴板):<br>
  83. <a href="http://unxutils.sourceforge.net/">pclip</a></p>
  84. </div>
  85. <p>Last Modified: 12 December 2024<br>
  86. remove typos<br>
  87. <pre></pre>
  88. </p>
  89. <script id='jsgiscus'
  90. src='https://giscus.app/client.js'
  91. data-repo="torappinfo/uweb"
  92. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  93. data-category="Announcements"
  94. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  95. data-mapping="title"
  96. data-strict="0"
  97. data-reactions-enabled="1"
  98. data-emit-metadata="0"
  99. data-input-position="top"
  100. data-theme="light"
  101. data-lang="en"
  102. data-loading="lazy"
  103. crossorigin="anonymous" async>
  104. </script>
  105. <footer class="site-footer">
  106. <div class="container">
  107. &copy; 2018-2024 Richard H. Cao
  108. </div>
  109. </footer>
  110. <!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->
  111. </body>
  112. </html>