index.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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/en/longclick/" />
  7. <link rel="stylesheet" href="../style.css#" type="text/css" />
  8. <title>Long pressed link menu</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#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
  32. <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
  33. <nav>
  34. </nav>
  35. </header>
  36. <br />
  37. <div class="container">
  38. <h1 class="title">Long pressed link menu
  39. <br>
  40. <span class="subtitle"></span>
  41. </h1>
  42. <ul class="tags">
  43. <li><a href="../tags/javascript/index.html#">javascript</a> </li>
  44. </ul>
  45. <h4 id="to-run-commands">To run commands</h4>
  46. <p>Each line of file &quot;<a href="file:///data/data/info.torapp.uweb/files/default.longclick">default.longclick</a>&quot; has the following format: (same as <a href="../cmds/index.html#">default.cmds</a>)<br>
  47. [Name]:[mimetype]:[command line]<br>
  48. in which [command line] can have <a href="../cmds/index.html#">&quot;%c&quot; (cookie), &quot;%u&quot; (current url), &quot;%t&quot; (title)</a> etc.</p>
  49. <h4 id="to-visit-url-and-load-javascript-file">To visit url and load javascript file</h4>
  50. <p>All &quot;.js&quot; files under the folder &quot;<a href="file:///data/data/info.torapp.uweb/files/longclick/">longclick</a>&quot; are part of the popup menu.<br>
  51. These javascript files are in the following format:</p>
  52. <ul>
  53. <li>The very first line can begin with &quot;//&quot; followed by website url that can have <a href="../cmds/index.html#">&quot;%u&quot; (current url), &quot;%t&quot; (title)</a> etc. included. In this case, the website is visited, then the javascript file is loaded on the new loaded site.</li>
  54. <li>In the &quot;.js&quot; file, variable &quot;arguments&quot; can be used to get parameters. in which arguments[1] is the long-pressed link url, argument[2] is the text description and arguments[0] is the &quot;.js&quot; file name.</li>
  55. </ul>
  56. </div>
  57. <p>Last Modified: 2 April 2024<br>
  58. add js function in README<br>
  59. <pre></pre>
  60. </p>
  61. <script id='jsgiscus'
  62. src='https://giscus.app/client.js'
  63. data-repo="torappinfo/uweb"
  64. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  65. data-category="Announcements"
  66. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  67. data-mapping="title"
  68. data-strict="0"
  69. data-reactions-enabled="1"
  70. data-emit-metadata="0"
  71. data-input-position="top"
  72. data-theme="light"
  73. data-lang="en"
  74. data-loading="lazy"
  75. crossorigin="anonymous" async>
  76. </script>
  77. <footer class="site-footer">
  78. <div class="container">
  79. &copy; 2018-2024 Richard H. Cao
  80. </div>
  81. </footer>
  82. <!-- 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/>. -->
  83. </body>
  84. </html>