index.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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="stylesheet" href="../style.css#" type="text/css" />
  7. <title>Text selection/processing</title>
  8. <script>
  9. function findLang(){
  10. let href = location.href;
  11. for(let i=href.length-1;i>0;i--){
  12. if('/'==href.charAt(i) && '/'==href.charAt(i-3))
  13. return i;
  14. }
  15. return 0;
  16. }
  17. function nav2(page){
  18. let i = findLang();
  19. location.href = location.href.substring(0,i+1)+page;
  20. }
  21. function nav2Lang(lang){
  22. let i = findLang();
  23. let href = location.href;
  24. location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
  25. }
  26. </script>
  27. </head>
  28. <body>
  29. <header class='header'>
  30. <a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
  31. <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
  32. <nav>
  33. </nav>
  34. </header>
  35. <br />
  36. <div class="container">
  37. <h1 class="title">Text selection/processing
  38. <br>
  39. <span class="subtitle"></span>
  40. </h1>
  41. <ul class="tags">
  42. <li><a href="../tags/termux/index.html#">termux</a> </li>
  43. <li><a href="../tags/ssh/index.html#">ssh</a> </li>
  44. <li><a href="../tags/clipboard/index.html#">clipboard</a> </li>
  45. <li><a href="../tags/windows/index.html#">windows</a> </li>
  46. </ul>
  47. <p>Click the following links to install menus for long pressing the button &quot;link&quot;:<br>
  48. <a href="i:0gdefault.select::notems:/uwebA:printf i:0/js/hash2textarea.js:https://note.ms/ric#;cat%0A">note.ms: cloud text sharing, please replace &quot;ric&quot; with your favorite ID</a></p>
  49. <p><a href="i:0gdefault.select::copyHtml:html/clip:%0A">Copy selected text with html format to clipboard</a></p>
  50. <p><a href="i:0gdefault.select::Home:/uweb:printf file://data/data/info.torapp.uweb/files/home5.search%5C location.href=%5C%22i:15;cat;printf %5C%22%0A">Search with home screen</a></p>
  51. <p><a href="i:0gdefault.select::google Translate:/uweb:printf 'https://translate.google.com/?sl=auto&tl=en&op=translate&text=';cat|tr ' ' '%2B'%0A">google Translate</a></p>
  52. <p><a href="i:0gdefault.select::bing Translate:/uweb:printf 'https://cn.bing.com/translator/?from=&to=en&text=';cat|tr ' ' '%2B'%0A">bing translate</a></p>
  53. <p><a href="i:0gdefault.select::deepL:/uweb:printf https://www.deepl.com/translator-mobile#auto/en/;cat|sed 's/ /%2520/g'%0A">deepL</a></p>
  54. <p>The file &quot;default.select&quot; defines text processing menus for selected text. If no text is selected, the menu item operates on the whole page. Each line of the file has the following format:<br>
  55. [Name]:[mimetype]:[command line]</p>
  56. <p>[mimetype] specifies input/output for [command line].<br>
  57. It formats as &quot;[input mimetype]/[output mimetype]&quot;.<br>
  58. [input mimetype] can be the following:</p>
  59. <ul>
  60. <li>&quot;html&quot;: rich text</li>
  61. <li>&quot;&quot; (empty): text</li>
  62. <li>&quot;.js&quot; file name under configuration folder. The js file is evaluated and its return value is passed to [command line] as standard input.</li>
  63. </ul>
  64. <p>[output mimetype] is same as the one defined in &quot;<a href="../cmds/index.html#">Commands</a>&quot;.</p>
  65. <ul>
  66. <li>regular mimetype such as &quot;text/html&quot;: output as the mimetype</li>
  67. <li>&quot;uweb&quot;: output as links</li>
  68. <li>&quot;uwebA&quot;: output as &quot;A&quot; link, all characters including newlines are part of the link.</li>
  69. <li>&quot;clip&quot;: output to clipboard</li>
  70. <li>&quot;termux&quot;: output as termux command</li>
  71. </ul>
  72. <p><a target="_self" href="i:0hcheck.js:../../zh/searchurl/txt/check.js">checked.js</a>: Evaluate checked.js and return value as standard input for the command line. For any file url ending with &quot;/&quot;, optionally append &quot;?[prefix][<em>[postfix]]&quot;. For example, &quot;file:///sdcard/?</em>.png&quot; lists all .png files under the folder &quot;/sdcard&quot;. Select files and process them with checked.js(such as &quot;copy to PC&quot; as the later example).</p>
  73. <p>default.select sample file:<br>
  74. copy2addressbar:/uweb:printf i:15;cat<br>
  75. copy2PCClipboard::ssh [user:password]@192.168.2.102 &quot;DISPLAY=:0 xsel -i&quot;<br>
  76. richtext2PCClipboard:html:ssh [user:password]@192.168.2.102 &quot;DISPLAY=:0 xsel -i&quot;<br>
  77. copyFiles:checked.js:while read fname;do scp $fname [user:password]@192.168.2.102:Downloads/.; done</p>
  78. <p>Here we assume that the user PC has IP address as &quot;192.168.2.102&quot;.<br>
  79. To use ssh or scp, users need to install uweb compatible Termux provided on the <a href="../index.html#">uweb apk download page</a>, and install openssl under termux (apt install openssl).<br>
  80. PCs need command &quot;xsel&quot; available to operate on copy/paste.</p>
  81. </div>
  82. <p>Last Modified: 24 May 2024<br>
  83. add thinkany ai search<br>
  84. <pre></pre>
  85. </p>
  86. <script id='jsgiscus'
  87. src='https://giscus.app/client.js'
  88. data-repo="torappinfo/uweb"
  89. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  90. data-category="Announcements"
  91. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  92. data-mapping="title"
  93. data-strict="0"
  94. data-reactions-enabled="1"
  95. data-emit-metadata="0"
  96. data-input-position="top"
  97. data-theme="light"
  98. data-lang="en"
  99. data-loading="lazy"
  100. crossorigin="anonymous" async>
  101. </script>
  102. <footer class="site-footer">
  103. <div class="container">
  104. &copy; 2018-2024 Richard H. Cao
  105. </div>
  106. </footer>
  107. <!-- 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/>. -->
  108. </body>
  109. </html>