index.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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="/uwebzh/style.css" type="text/css" />
  7. <title>Long pressed link menu</title>
  8. <script type="text/javascript">
  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">Long pressed link menu
  38. <br>
  39. <span class="subtitle"></span>
  40. </h1>
  41. <ul class="tags">
  42. <li><a href="../tags/javascript">javascript</a> </li>
  43. </ul>
  44. <h4 id="to-run-commands">To run commands</h4>
  45. <p>Each line of file &quot;<a href="file:///data/data/info.torinfo.uweb/files/default.longclick">default.longclick</a>&quot; has the following format: (same as <a href="../cmds/index.html">default.cmds</a>)<br>
  46. [Name]:[mimetype]:[command line]<br>
  47. 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>
  48. <h4 id="to-visit-url-and-load-javascript-file">To visit url and load javascript file</h4>
  49. <p>All &quot;.js&quot; files under the folder &quot;<a href="file:///data/data/info.torinfo.uweb/files/longclick/">longclick</a>&quot; are part of the popup menu.<br>
  50. These javascript files are in the following format:</p>
  51. <ul>
  52. <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>
  53. <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>
  54. </ul>
  55. </div>
  56. </body>
  57. </html>