[...document.querySelectorAll("trix-toolbar [data-trix-key]")].map(e => `${e.title}: command+${e.dataset.trixKey}`).join("\n")
Bold: command+b
Italic: command+i
Link: command+k
Undo: command+z
Redo: command+shift+z
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<div style="margin: 20px;"> | |
<p> | |
<webview> visibilityState: <strong id="visibility-state"></strong> | |
<button id="update-visibility-state">Update</button> |
BC.registerElement "bc-require", | |
createdCallback: -> | |
@setAttribute("pending", "") | |
attachedCallback: -> | |
BC.ready => | |
if Loader.find(@script)?.loaded | |
@activate() | |
else | |
@deactivate() |
[...document.querySelectorAll("trix-toolbar [data-trix-key]")].map(e => `${e.title}: command+${e.dataset.trixKey}`).join("\n")
Bold: command+b
Italic: command+i
Link: command+k
Undo: command+z
Redo: command+shift+z
require "levenshtein" | |
class Object | |
def kinda?(klass) | |
Levenshtein.normalized_distance(self.class.to_s, klass.to_s) < 0.85 | |
end | |
end | |
>> "foo".class | |
=> String |
--- a/action_cable.js | |
+++ b/action_cable.js | |
@@ -1,590 +1,599 @@ | |
(function() { | |
- var slice = [].slice; | |
- | |
- this.ActionCable = { | |
- INTERNAL: { | |
- "message_types": { | |
- "welcome": "welcome", |
addEventListener("trix-initialize", function(event) { | |
event.target.toolbarElement.querySelector("button[data-trix-attribute=bullet]").dataset.trixKey = "l"; | |
}) |
addEventListener "trix-initialize", (event) -> | |
new TrixAutoLinker event.target | |
class TrixAutoLinker | |
constructor: (@element) -> | |
{@editor} = @element | |
@element.addEventListener("trix-render", @autoLink) | |
@autoLink() | |
autoLink: => |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
<ul> | |
<li>appUserModelId: "<script>document.write(require("electron").remote.getGlobal("appUserModelId"))</script>"</li> | |
<li>Electron version: <script>document.write(process.versions.electron)</script></li> |
I hereby claim:
To claim this, I am signing this object:
Trix.config.textAttributes.red = { | |
style: { backgroundColor: "red" } | |
} | |
element.editor.activateAttribute("red") | |
// See available attribute options in: | |
// https://github.com/basecamp/trix/blob/master/src/trix/config/text_attributes.coffee | |
// https://github.com/basecamp/trix/blob/master/src/trix/config/block_attributes.coffee |