uweb/en/textprocess/index.html

5.7 KiB

<html> <head> </head> Home Tags 简体中文

Text selection/processing

Click the following links to install menus for long pressing the button "link":
Copy selected text with html format to clipboard

Search with home screen

google Translate

bing translate

deepL

The file "default.select" 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:
[Name]:[mimetype]:[command line]

[mimetype] specifies input/output for [command line].
It formats as "[input mimetype]/[output mimetype]".
[input mimetype] can be the following:

  • "html": rich text
  • "" (empty): text
  • ".js" file name under configuration folder. The js file is evaluated and its return value is passed to [command line] as standard input.

[output mimetype] is same as the one defined in "Commands".

  • regular mimetype such as "text/html": output as the mimetype
  • "uweb": output as links
  • "uwebA": output as "A" link, all characters including newlines are part of the link.
  • "clip": output to clipboard
  • "termux": output as termux command

checked.js: Evaluate checked.js and return value as standard input for the command line. For any file url ending with "/", optionally append "?[prefix][[postfix]]". For example, "file:///sdcard/?.png" lists all .png files under the folder "/sdcard". Select files and process them with checked.js(such as "copy to PC" as the later example).

default.select sample file:
copy2addressbar:/uweb:printf i:15;cat
copy2PCClipboard::ssh [user:password]@192.168.2.102 "DISPLAY=:0 xsel -i"
richtext2PCClipboard:html:ssh [user:password]@192.168.2.102 "DISPLAY=:0 xsel -i"
copyFiles:checked.js:while read fname;do scp $fname [user:password]@192.168.2.102:Downloads/.; done

Here we assume that the user PC has IP address as "192.168.2.102".
To use ssh or scp, users need to install uweb compatible Termux provided on the uweb apk download page, and install openssl under termux (apt install openssl).
PCs need command "xsel" available to operate on copy/paste.

Last Modified: 2 April 2024
add js function in README


© 2018-2024 Richard H. Cao
</html>