Website Structure

This commit is contained in:
supalerk-ar66 2026-01-13 10:46:40 +07:00
parent 62812f2090
commit 71f0676a62
22365 changed files with 4265753 additions and 791 deletions

View file

@ -0,0 +1,9 @@
exports.copy = { command: "termux-clipboard-set", args: [] };
exports.paste = { command: "termux-clipboard-get", args: [] };
exports.paste.full_command = exports.paste.command;
exports.encode = (str) => Buffer.from(str, "utf8");
exports.decode = (chunks) => {
const data = Array.isArray(chunks) ? chunks : [chunks];
return Buffer.concat(data).toString("utf8");
};

View file

@ -0,0 +1,9 @@
exports.copy = { command: "pbcopy", args: [], env: { LANG: "en_US.UTF-8" } };
exports.paste = { command: "pbpaste", args: [] };
exports.paste.full_command = exports.paste.command;
exports.encode = (str) => Buffer.from(str, "utf8");
exports.decode = (chunks) => {
const data = Array.isArray(chunks) ? chunks : [chunks];
return Buffer.concat(data).toString("utf8");
};

View file

@ -0,0 +1,52 @@
Function Base64Encode(sText)
Dim oXML, oNode
Set oXML = CreateObject("Msxml2.DOMDocument.3.0")
Set oNode = oXML.CreateElement("base64")
oNode.dataType = "bin.base64"
oNode.nodeTypedValue =Stream_StringToBinary(sText)
Base64Encode = oNode.text
Set oNode = Nothing
Set oXML = Nothing
End Function
'Stream_StringToBinary Function
'2003 Antonin Foller, http://www.motobit.com
'Text - string parameter To convert To binary data
Function Stream_StringToBinary(Text)
Const adTypeText = 2
Const adTypeBinary = 1
'Create Stream object
Dim BinaryStream 'As New Stream
Set BinaryStream = CreateObject("ADODB.Stream")
'Specify stream type - we want To save text/string data.
BinaryStream.Type = adTypeText
'Specify charset For the source text (unicode) data.
BinaryStream.CharSet = "utf-8"
'Open the stream And write text/string data To the object
BinaryStream.Open
BinaryStream.WriteText Text
'Change stream type To binary
BinaryStream.Position = 0
BinaryStream.Type = adTypeBinary
'Ignore first two bytes - sign of
BinaryStream.Position = 0
'Open the stream And get binary data from the object
Stream_StringToBinary = BinaryStream.Read
Set BinaryStream = Nothing
End Function
Dim objHTML
Set objHTML = CreateObject("htmlfile")
text = objHTML.ParentWindow.ClipboardData.GetData("Text")
Wscript.Echo Base64Encode(text)

View file

@ -0,0 +1,12 @@
exports.copy = process.env.WSL_DISTRO_NAME
? { command: "clip.exe", args: [] }
: { command: "wl-copy", args: [] };
exports.paste = { command: "wl-paste", args: [] };
exports.paste.full_command = [exports.paste.command].concat(exports.paste.args).join(" ");
exports.encode = (str) => Buffer.from(str, "utf8");
exports.decode = (chunks) => {
const data = Array.isArray(chunks) ? chunks : [chunks];
return Buffer.concat(data).toString("utf8");
};

View file

@ -0,0 +1,23 @@
exports.copy = process.env.WSL_DISTRO_NAME
? { command: "clip.exe", args: [] }
: { command: "xclip", args: ["-selection", "clipboard"] };
exports.paste = process.env.WSL_DISTRO_NAME
? {
command: "powershell.exe",
args: ["-noprofile", "-command", "Get-Clipboard"],
}
: { command: "xclip", args: ["-selection", "clipboard", "-o"] };
exports.paste.full_command = [exports.paste.command].concat(exports.paste.args).join(" ");
exports.encode = (str) => Buffer.from(str, "utf8");
exports.decode = (chunks) => {
const data = Array.isArray(chunks) ? chunks : [chunks];
let output = Buffer.concat(data).toString("utf8");
// Check if running under WSL and strip the last two characters added by powershell.exe
if (process.env.WSL_DISTRO_NAME) output = output.slice(0, -2);
return output;
};

View file

@ -0,0 +1,21 @@
const iconv = require("iconv-lite");
const path = require("node:path");
const vbsPath = path.join(__dirname, ".\\fallbacks\\paste.vbs");
const paste = { command: "cscript", args: ["/Nologo", vbsPath] };
paste.full_command = [paste.command, paste.args[0], `"${vbsPath}"`].join(" ");
exports.copy = { command: "clip", args: [] };
exports.paste = paste;
exports.encode = (str) => iconv.encode(str, "utf16le");
exports.decode = (chunks) => {
const data = Array.isArray(chunks) ? chunks : [chunks];
let b64 = iconv.decode(Buffer.concat(data), "cp437");
b64 = b64.substring(0, b64.length - 2); // Chops off extra "\r\n"
// remove bom and decode
return Buffer.from(b64, "base64").subarray(3).toString("utf-8");
};