mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-12-21 23:48:08 +00:00
Add files via upload
This commit is contained in:
parent
452f90601c
commit
160d9a8eaf
2 changed files with 44 additions and 0 deletions
10
symbol-buttons/info.json
Normal file
10
symbol-buttons/info.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"name": "Insert symbol buttons",
|
||||||
|
"identifier": "symbol-buttons",
|
||||||
|
"script": "symbol-buttons.qml",
|
||||||
|
"authors": ["@Maboroshy"],
|
||||||
|
"platforms": ["linux", "macos", "windows"],
|
||||||
|
"version": "0.0.1",
|
||||||
|
"minAppVersion": "17.05.8",
|
||||||
|
"description" : "This script adds toolbar buttons to insert characters set in script options"
|
||||||
|
}
|
34
symbol-buttons/symbol-buttons.qml
Normal file
34
symbol-buttons/symbol-buttons.qml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
import QtQml 2.2
|
||||||
|
import QOwnNotesTypes 1.0
|
||||||
|
|
||||||
|
/// This script adds toolbar buttons to insert characters set in script options
|
||||||
|
|
||||||
|
Script {
|
||||||
|
property string symbolString
|
||||||
|
property var symbolList
|
||||||
|
|
||||||
|
property variant settingsVariables: [
|
||||||
|
{
|
||||||
|
"identifier": "symbolString",
|
||||||
|
"name": "Symbols to insert with buttons",
|
||||||
|
"description": "Put any unicode characters separated by spaces. You can group multiple symbols together.",
|
||||||
|
"type": "string",
|
||||||
|
"default": "∑ ∫ ∮",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
if (symbolString) {
|
||||||
|
symbolList = symbolString.split(' ')
|
||||||
|
for (var n = 0; n < symbolList.length; n++)
|
||||||
|
script.registerCustomAction(symbolList[n], symbolList[n], symbolList[n])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function customActionInvoked(symbol) {
|
||||||
|
if (symbolList.indexOf(symbol) != -1) {
|
||||||
|
script.noteTextEditWrite(symbol)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue