Commit 5cacc20a authored by Akari Labs's avatar Akari Labs

rocket.chat port, standalone now uses kwm

parent 99d67e93
const _gltchrr = require('gltchrr');
const kwm = require('kwm');
const Window = kwm.Window;
const { Window } = kwm;
function GltchrrWindow(attr) {
......@@ -26,7 +26,7 @@ function GltchrrWindow(attr) {
me.onupdate();
}
return <Window x={options.x || 32} y={options.y || 128} height="348" title="gltchrr">
return <Window title="gltchrr config" x={options.x || 32} y={options.y || 128} height="348">
<label>enabled? <input type="checkbox" checked={gltchrr.state.enabled} onchange={e => { gltchrr.state.enabled = e.target.checked; me.onupdate(); }} /></label><br />
<br />
<label>intensity {controls.intesity_echo = <span style="float: right;">1</span>}
......
......@@ -120,7 +120,7 @@
"from": "git+https://git.agiri.ninja/lp0/cascade-webpack.git"
},
"nanopack_kwm": {
"version": "git+https://git.agiri.ninja/lp0/kwm.git#34aca9b3c8fe597575619eb4125607ec34e22de3",
"version": "git+https://git.agiri.ninja/lp0/kwm.git#15be6d06fe480a9101ef80136acd0a1700ba3429",
"from": "git+https://git.agiri.ninja/lp0/kwm.git"
},
"nanopack_tsundiscord": {
......
const ui = new (require('gltchrr!ui'))();
const gltchrr = ui.gltchrr;
// expose the control functions through window.gltchrr
window.gltchrr = ui.gltchrr.control;
window.onload = () => {
ui.show();
const __send = Meteor.connection._send;
Meteor.connection._send = e => {
if (e.msg === 'method')
switch (e.method) {
case 'sendMessage':
e.params[0].msg = gltchrr.processText(e.params[0].msg);
break;
}
__send.apply(Meteor.connection, [e]);
}
};
\ No newline at end of file
{
"friendly_name": "gltchrr_rocketchat",
"depends": [
"../.."
],
"modules": {
"@index": {
"filename": "hook.js"
}
},
"main": [
"gltchrr_rocketchat"
]
}
\ No newline at end of file
.s_box {
outline: none;
resize: none;
width: 512px;
height: 256px;
word-wrap: break-word;
display: block;
margin-bottom: 4px;
}
\ No newline at end of file
const inject = require('kwm!inject');
const kwm = require('kwm');
const { Window } = kwm;
const ui = new (require('gltchrr!ui'))({
y: 544
x: 512 + 8 * 2,
y: 8
});
const gltchrr = ui.gltchrr;
window.onload = () => {
inject.css(require('index.css'));
var input, result;
ui.onupdate = e => result.value = gltchrr.processText(input.value);
const input = <textarea class="s_box" placeholder="put text in" oninput={ui.onupdate}></textarea>
const result = <textarea class="s_box" placeholder="g̨̰̓̅̽et gçgglitch ou̜̬̞̓̒t" readonly/>
document.body.appendChild(input);
document.body.appendChild(<br />);
document.body.appendChild(result);
const win = <Window title="gltchrr" width="512" height="512" x="8" y="8" resizable>
{input = <textarea style="word-wrap: break-word; display: block; margin-bottom: 4px;" placeholder="put text in" oninput={ui.onupdate} />}
{result = <textarea style="word-wrap: break-word; display: block;" placeholder="g̨̰̓̅̽et gçgglitch ou̜̬̞̓̒t" readonly />}
</Window>
kwm.append(win);
// css is too hard
(win.onresize = () => Array.prototype.forEach.call(
win.kwm.parts.body.children,
x => x.style.height = (win.offsetHeight - win.kwm.parts.header.offsetHeight - 16) / 2 + 'px'
))();
gltchrr.state.enabled = true;
ui.show();
......
module.exports = {
finalize: true,
minify: true,
header: `// ==UserScript==
// @name gltchrr for rocket.chat
// @namespace http://akari.vii/
// @version 1.2.5
// @description g̴̐͋litcc̣̟̭̿cch
// @author lp0 and nocebo
// @match https://meow.natalie.ee/*
// @grant none
// @run-at document-start
// ==/UserScript==
`,
packages: [
'./packages/rocketchat'
],
output: 'gltchrr_rocketchat.userscript.js'
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment