Compare commits
10 Commits
8fe91573a7
...
64fa5f63ff
Author | SHA1 | Date |
---|---|---|
Isaiah Odhner | 64fa5f63ff | |
Isaiah Odhner | 8ea4743f7f | |
Isaiah Odhner | 7d9e37c02d | |
Isaiah Odhner | 69540a07ca | |
Isaiah Odhner | 12b49631ac | |
Isaiah Odhner | ebe236ae19 | |
Isaiah Odhner | 925d078d05 | |
Isaiah Odhner | 0a47395bd8 | |
Isaiah Odhner | fa9e4167d5 | |
Isaiah Odhner | 32dc2e3432 |
|
@ -1,3 +1,20 @@
|
|||
; This script runs on AutoHotkey v2.
|
||||
;
|
||||
; I tried the VS Code extension "Command on All Files" first: https://marketplace.visualstudio.com/items?itemName=rioj7.commandOnAllFiles
|
||||
; but it didn't work with the "cSpell.addIssuesToDictionary" command.
|
||||
; I think it was too fast, and the spell checker didn't have time to run.
|
||||
;
|
||||
; A better solution would be to:
|
||||
; - Improve the "Command on All Files" extension:
|
||||
; - add delay options
|
||||
; - add a dry run mode, which I had to work around by setting it to a near-no-op command
|
||||
; - just listing the files would be a lot nicer than opening them all one by one
|
||||
; - unify file matching; you shouldn't have to specify a list of file extensions to include, it should be a glob like the exclusions
|
||||
; Or:
|
||||
; - Add a command to the cspell-cli to accept spellings
|
||||
; Or:
|
||||
; - Implement an external Node.js script using cspell's API (but that's less helpful than making a PR)
|
||||
|
||||
root := A_ScriptDir "\..\*"
|
||||
ignoreFolders := [
|
||||
".git",
|
||||
|
@ -5,14 +22,41 @@ ignoreFolders := [
|
|||
"node_modules",
|
||||
"lib",
|
||||
"out",
|
||||
"images",
|
||||
"localization",
|
||||
"cypress",
|
||||
"help",
|
||||
]
|
||||
ignoreExtensions := [
|
||||
"png",
|
||||
"gif",
|
||||
"jpg",
|
||||
"jpeg",
|
||||
"svg",
|
||||
"cur",
|
||||
"ico",
|
||||
"icns",
|
||||
"wav",
|
||||
]
|
||||
command := "cSpell.addIssuesToDictionary"
|
||||
beforeRunInfo := "This script is designed to add all spelling issues to the dictionary.`nTo use it to prune the dictionary of no-longer-needed words, you must empty the dictionary first.`n`nThis script will run the VS Code command '" command "' on all files in the directory '" root "'.`n`n"
|
||||
delayBeforeCommand := 2000 ; Give enough time for spell checker to run
|
||||
delayAfterCommand := 2000 ; Give enough time for CSpell to update the dictionary
|
||||
closeFileAfterCommand := false
|
||||
appName := "VS Code Automation"
|
||||
|
||||
popup := Gui(, appName)
|
||||
popup.Opt("+AlwaysOnTop +Disabled -SysMenu +Owner") ; +Owner avoids a taskbar button.
|
||||
popup.Add("Text", , "`nPress Esc to stop the script.`n`n")
|
||||
statusBar := popup.Add("StatusBar")
|
||||
|
||||
windowId := WinExist("ahk_exe Code.exe")
|
||||
|
||||
IsIgnoredPath(path) {
|
||||
SplitPath path, &name, &dir, &ext, &nameNoExt, &drive
|
||||
for _, ignoreExtension in ignoreExtensions {
|
||||
if (StrLower(ext) = ignoreExtension) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
parts := StrSplit(path, "\")
|
||||
for index, part in parts {
|
||||
for _, ignoreFolder in ignoreFolders {
|
||||
|
@ -21,54 +65,94 @@ IsIgnoredPath(path) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
RunCommandOnFiles() {
|
||||
; Focus VS Code
|
||||
WinActivate "ahk_exe Code.exe"
|
||||
Automate() {
|
||||
targets := []
|
||||
; Loop through files (F) recursively (R)
|
||||
processed := []
|
||||
Loop Files, root, "FR"
|
||||
loop files, root, "FR"
|
||||
{
|
||||
; Skip if the file should be ignored
|
||||
if (IsIgnoredPath(A_LoopFileFullPath)) {
|
||||
continue
|
||||
}
|
||||
|
||||
; Open file in VS Code using Ctrl+P file switcher
|
||||
Send "^p"
|
||||
Sleep 100
|
||||
Send A_LoopFileFullPath
|
||||
Sleep 100
|
||||
Send "{Enter}"
|
||||
Sleep 1000
|
||||
|
||||
; Run command via F1 command palette
|
||||
Send "{F1}"
|
||||
Sleep 100
|
||||
Send command
|
||||
Sleep 100
|
||||
Send "{Enter}"
|
||||
Sleep 1000
|
||||
|
||||
; Close the file
|
||||
Send "^w"
|
||||
Sleep 100
|
||||
|
||||
processed.Push(A_LoopFileFullPath)
|
||||
targets.Push(A_LoopFileFullPath)
|
||||
}
|
||||
|
||||
if (processed.Length = 0) {
|
||||
if (targets.Length = 0) {
|
||||
MsgBox "No files found for pattern: " root
|
||||
return
|
||||
}
|
||||
MsgBox "Processed " processed.Length " files."
|
||||
; MsgBox "Processed " processed.Length " files:`n" Join("`n", processed)
|
||||
; A_Clipboard := Join("`n", processed)
|
||||
|
||||
; Focus VS Code before confirmation to avoid confusion between multiple VS Code windows
|
||||
try {
|
||||
WinActivate { Hwnd: windowId }
|
||||
} catch TargetError as e {
|
||||
MsgBox "Could not find VS Code window. Please open it and try again.", appName, 0x10
|
||||
return
|
||||
}
|
||||
|
||||
; Ask for confirmation
|
||||
if MsgBox(beforeRunInfo "Found " targets.Length " files. Continue?", appName, 4) = "No" {
|
||||
if MsgBox("Copy file paths to clipboard?", appName, 4) = "Yes" {
|
||||
A_Clipboard := Join("`n", targets)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
RunCommandOnFiles(targets)
|
||||
}
|
||||
|
||||
RunCommandOnFiles(targets) {
|
||||
popup.Show("NoActivate") ; NoActivate avoids deactivating the currently active window.
|
||||
|
||||
for index, target in targets {
|
||||
statusBar.SetText(index "/" targets.Length)
|
||||
try {
|
||||
RunCommandOnFile(target)
|
||||
} catch TargetError as e {
|
||||
popup.Destroy()
|
||||
MsgBox "Lost VS Code window. Please open it and try again.`n`n" index " out of " targets.Length " files were processed.", appName, 0x10
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
popup.Destroy()
|
||||
MsgBox "Processed " targets.Length " files."
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
SendToVSCode(keys) {
|
||||
; ControlSend(keys, , { Hwnd: windowId })
|
||||
WinActivate { Hwnd: windowId }
|
||||
Send keys
|
||||
}
|
||||
|
||||
RunCommandOnFile(target) {
|
||||
; Open file in VS Code using Ctrl+P file switcher
|
||||
SendToVSCode "^p"
|
||||
Sleep 100
|
||||
SendToVSCode target
|
||||
Sleep 100
|
||||
SendToVSCode "{Enter}"
|
||||
Sleep delayBeforeCommand
|
||||
|
||||
; Run command via F1 command palette
|
||||
SendToVSCode "{F1}"
|
||||
Sleep 100
|
||||
SendToVSCode command
|
||||
Sleep 100
|
||||
SendToVSCode "{Enter}"
|
||||
Sleep delayAfterCommand
|
||||
|
||||
; Close the file (optional)
|
||||
if closeFileAfterCommand {
|
||||
SendToVSCode "^w"
|
||||
}
|
||||
}
|
||||
|
||||
Join(sep, items) {
|
||||
str := ""
|
||||
for index, item in items {
|
||||
|
@ -82,4 +166,5 @@ Esc:: {
|
|||
ExitApp
|
||||
}
|
||||
|
||||
RunCommandOnFiles()
|
||||
Automate()
|
||||
ExitApp()
|
351
cspell.json
351
cspell.json
|
@ -15,407 +15,197 @@
|
|||
"*.wav",
|
||||
"localization"
|
||||
],
|
||||
// @TODO: is there a way to prune this spelling list? I didn't know about the comment directives for a while,
|
||||
// and accepted a lot of strings for the language names, in languages that I don't understand,
|
||||
// and even with partial strings when it was buggy with Unicode.
|
||||
"words": [
|
||||
"Adlm",
|
||||
"Æвзаг",
|
||||
"Afaan",
|
||||
"Afaraf",
|
||||
"airb",
|
||||
"ajeļ",
|
||||
"airbrushbrush",
|
||||
"Allaire",
|
||||
"allowfullscreen",
|
||||
"anypalette",
|
||||
"apng",
|
||||
"APNGs",
|
||||
"appinstalled",
|
||||
"Aragonés",
|
||||
"Asụsụ",
|
||||
"autosave",
|
||||
"autosaves",
|
||||
"atombgwht",
|
||||
"autoupdating",
|
||||
"Avañe'ẽ",
|
||||
"Avaric",
|
||||
"Ayisyen",
|
||||
"Aymar",
|
||||
"Azərbaycan",
|
||||
"Bahasa",
|
||||
"Bamanankan",
|
||||
"Basa",
|
||||
"beforeinstallprompt",
|
||||
"bepis",
|
||||
"Bgau",
|
||||
"bgcolor",
|
||||
"Bislama",
|
||||
"Bizaad",
|
||||
"BMPs",
|
||||
"Bokmål",
|
||||
"bigfix",
|
||||
"blackwhite",
|
||||
"Bopo",
|
||||
"Bosanski",
|
||||
"Brasileiro",
|
||||
"Bresenham",
|
||||
"Bresenham's",
|
||||
"Brezhoneg",
|
||||
"Català",
|
||||
"Český",
|
||||
"Čeština",
|
||||
"Chamoru",
|
||||
"Chewa",
|
||||
"Chichewa",
|
||||
"Chinyanja",
|
||||
"Chuang",
|
||||
"classid",
|
||||
"browserconfig",
|
||||
"clipart",
|
||||
"Clippy",
|
||||
"clsid",
|
||||
"cmaps",
|
||||
"colorbar",
|
||||
"colorbox",
|
||||
"colorstr",
|
||||
"contenteditable",
|
||||
"Corel",
|
||||
"Corsa",
|
||||
"Corsu",
|
||||
"Cpath",
|
||||
"Crect",
|
||||
"Csvg",
|
||||
"ctype",
|
||||
"Cue",
|
||||
"Cuengh",
|
||||
"Cueŋƅ",
|
||||
"Cymraeg",
|
||||
"Cyrl",
|
||||
"d'Òc",
|
||||
"Dansk",
|
||||
"Darude",
|
||||
"datetime",
|
||||
"Davvis",
|
||||
"Davvisámegiella",
|
||||
"dectree",
|
||||
"desaturated",
|
||||
"Deutsch",
|
||||
"Dhivehi",
|
||||
"DIALOGEX",
|
||||
"Dili",
|
||||
"Divehi",
|
||||
"divs",
|
||||
"djvu",
|
||||
"documentedly",
|
||||
"Dorerin",
|
||||
"draggable",
|
||||
"Dzongkha",
|
||||
"Eesti",
|
||||
"egbe",
|
||||
"ellipticals",
|
||||
"endonym",
|
||||
"eqeqeq",
|
||||
"equivalize",
|
||||
"ertical",
|
||||
"esque",
|
||||
"Euskara",
|
||||
"Euskera",
|
||||
"Eʋegbe",
|
||||
"Excelsi",
|
||||
"eyedrop",
|
||||
"Fa'a",
|
||||
"Faka",
|
||||
"farbling",
|
||||
"Faroese",
|
||||
"fieldset",
|
||||
"fieldsets",
|
||||
"firebaseapp",
|
||||
"firebaseio",
|
||||
"Fiteny",
|
||||
"fliph",
|
||||
"flippable",
|
||||
"flipv",
|
||||
"floodfill",
|
||||
"floodfilling",
|
||||
"focusables",
|
||||
"focusring",
|
||||
"fontbox",
|
||||
"Føroyskt",
|
||||
"Fran",
|
||||
"Français",
|
||||
"Française",
|
||||
"frowny",
|
||||
"Frysk",
|
||||
"Fsvg",
|
||||
"fudgedness",
|
||||
"Fulah",
|
||||
"Fulfulde",
|
||||
"fullscreen",
|
||||
"Fwww",
|
||||
"Gaeilge",
|
||||
"Gaelg",
|
||||
"Gagana",
|
||||
"Gàidhlig",
|
||||
"Gailck",
|
||||
"Galego",
|
||||
"gazemouse",
|
||||
"ghostwhite",
|
||||
"GIFs",
|
||||
"Gikuyu",
|
||||
"Glag",
|
||||
"gons",
|
||||
"grayscale",
|
||||
"greyscale",
|
||||
"gridlines",
|
||||
"Grischun",
|
||||
"hackily",
|
||||
"hacky",
|
||||
"haha",
|
||||
"Hanb",
|
||||
"Hant",
|
||||
"hcanvas",
|
||||
"hctx",
|
||||
"headmouse",
|
||||
"hilight",
|
||||
"Hiri",
|
||||
"HKEY",
|
||||
"homescreen",
|
||||
"hostnames",
|
||||
"Hrvatski",
|
||||
"hslrgb",
|
||||
"hsrgb",
|
||||
"humbnail",
|
||||
"Icci",
|
||||
"icns",
|
||||
"ICNS",
|
||||
"iconify",
|
||||
"idhlig",
|
||||
"IFDs",
|
||||
"iframe",
|
||||
"iframe's",
|
||||
"iframes",
|
||||
"IIFE",
|
||||
"Ikinyarwanda",
|
||||
"Ikirundi",
|
||||
"Imgur",
|
||||
"Inkscape",
|
||||
"Interlingue",
|
||||
"Iñupiatun",
|
||||
"IPFS",
|
||||
"isaiahodhner",
|
||||
"isded",
|
||||
"Íslenska",
|
||||
"Italiano",
|
||||
"Jasc",
|
||||
"Jawa",
|
||||
"Jazyk",
|
||||
"Jezik",
|
||||
"Język",
|
||||
"jfif",
|
||||
"jnordberg",
|
||||
"JSGF",
|
||||
"jspaint",
|
||||
"jsperf",
|
||||
"Junkbot",
|
||||
"Kajin",
|
||||
"Kalaallisut",
|
||||
"Kalaallit",
|
||||
"Kalba",
|
||||
"Kanuri",
|
||||
"Kernewek",
|
||||
"keyframes",
|
||||
"keyshortcuts",
|
||||
"Khoj",
|
||||
"Kichwa",
|
||||
"Kieli",
|
||||
"Kikongo",
|
||||
"Kiluba",
|
||||
"Kinyarwanda",
|
||||
"Kiswahili",
|
||||
"Kolour",
|
||||
"Konami",
|
||||
"Kreyòl",
|
||||
"Krita",
|
||||
"Kuanyama",
|
||||
"Kurdî",
|
||||
"Kwanyama",
|
||||
"Latine",
|
||||
"Latn",
|
||||
"Latvie",
|
||||
"Latviešu",
|
||||
"Lenga",
|
||||
"lerp",
|
||||
"Lëtzebuergesch",
|
||||
"Letzeburgesch",
|
||||
"libgconf",
|
||||
"libtess",
|
||||
"Lietuvių",
|
||||
"Limburgan",
|
||||
"Limburgish",
|
||||
"Limburgs",
|
||||
"Linb",
|
||||
"Lingála",
|
||||
"liveweb",
|
||||
"llpaper",
|
||||
"localdomain",
|
||||
"localforage",
|
||||
"localizable",
|
||||
"lookpath",
|
||||
"lors",
|
||||
"Lospec",
|
||||
"lrgb",
|
||||
"lsid",
|
||||
"ltres",
|
||||
"Luba",
|
||||
"Luciferi",
|
||||
"Luxembourgish",
|
||||
"Macromedia",
|
||||
"Malti",
|
||||
"mediump",
|
||||
"megiella",
|
||||
"Melayu",
|
||||
"mimg",
|
||||
"minifig",
|
||||
"mobipaint",
|
||||
"monospace",
|
||||
"Mopaint",
|
||||
"Motu",
|
||||
"mouseleave",
|
||||
"Mousewheel",
|
||||
"msapplication",
|
||||
"MSIE",
|
||||
"mspaint",
|
||||
"MSPaint",
|
||||
"multitools",
|
||||
"multitouch",
|
||||
"multiuser",
|
||||
"murl",
|
||||
"Naoero",
|
||||
"Nbat",
|
||||
"Ndebele",
|
||||
"Ndonga",
|
||||
"Nederlands",
|
||||
"nesw",
|
||||
"nevermind",
|
||||
"Nkoo",
|
||||
"nomine",
|
||||
"Norsk",
|
||||
"nostri",
|
||||
"nowrap",
|
||||
"numberofcolors",
|
||||
"numpad",
|
||||
"Nuosu",
|
||||
"Nuosuhxop",
|
||||
"nwse",
|
||||
"Nyanja",
|
||||
"Occitan",
|
||||
"occluder",
|
||||
"octree",
|
||||
"Odhner",
|
||||
"Oʻzbek",
|
||||
"oleobject",
|
||||
"onwriteend",
|
||||
"onestep",
|
||||
"Optikey",
|
||||
"Oqaasii",
|
||||
"orizontal",
|
||||
"Oromo",
|
||||
"Oromoo",
|
||||
"Ossetian",
|
||||
"Otjiherero",
|
||||
"ovaloid",
|
||||
"ovaloids",
|
||||
"oviforms",
|
||||
"Owambo",
|
||||
"paintbucket",
|
||||
"pako",
|
||||
"palettized",
|
||||
"paypal",
|
||||
"PDFs",
|
||||
"peggys",
|
||||
"Peggys",
|
||||
"Phlp",
|
||||
"Photoshop",
|
||||
"pixeling",
|
||||
"PLTE",
|
||||
"PNGs",
|
||||
"pointerenter",
|
||||
"pointerleave",
|
||||
"pointermove",
|
||||
"pointerup",
|
||||
"Polski",
|
||||
"Polszczyzna",
|
||||
"Português",
|
||||
"postimg",
|
||||
"proxied",
|
||||
"proch",
|
||||
"proclabel",
|
||||
"pseudorandomly",
|
||||
"psppalette",
|
||||
"Pulaar",
|
||||
"Pular",
|
||||
"Pushto",
|
||||
"qtres",
|
||||
"rbaycan",
|
||||
"redoable",
|
||||
"reenable",
|
||||
"Rege",
|
||||
"reimplement",
|
||||
"relh",
|
||||
"reltopics",
|
||||
"repurposable",
|
||||
"rerender",
|
||||
"rerendered",
|
||||
"resizer",
|
||||
"retarget",
|
||||
"retargeted",
|
||||
"rgba",
|
||||
"RGBA",
|
||||
"RGBAs",
|
||||
"rightclick",
|
||||
"rk",
|
||||
"Română",
|
||||
"rotologo",
|
||||
"roundrect",
|
||||
"roundrects",
|
||||
"royskt",
|
||||
"rrect",
|
||||
"RTLCSS",
|
||||
"Rumantsch",
|
||||
"Runa",
|
||||
"Rundi",
|
||||
"Sami",
|
||||
"sandboxed",
|
||||
"sandboxing",
|
||||
"Sango",
|
||||
"Sardu",
|
||||
"Satana",
|
||||
"Satanas",
|
||||
"Scribus",
|
||||
"scrollable",
|
||||
"scrollbars",
|
||||
"Sesotho",
|
||||
"Setswana",
|
||||
"shader's",
|
||||
"Shft",
|
||||
"Shona",
|
||||
"Shqip",
|
||||
"Simi",
|
||||
"Sinhala",
|
||||
"Skencil",
|
||||
"sketchpalette",
|
||||
"skeuomorphic",
|
||||
"slenska",
|
||||
"Slovenčina",
|
||||
"Slovenščina",
|
||||
"Slovenski",
|
||||
"Slovenský",
|
||||
"Soomaali",
|
||||
"Soomaaliga",
|
||||
"sorthweast",
|
||||
"Sotho",
|
||||
"soundcloud",
|
||||
"SoundCloud",
|
||||
"spacebar",
|
||||
"spirobrush",
|
||||
"spraycan",
|
||||
"spraypaint",
|
||||
"spraypainting",
|
||||
"STRINGTABLE",
|
||||
"spritesheet",
|
||||
"styl",
|
||||
"stylable",
|
||||
"submenu",
|
||||
"submenus",
|
||||
"subh",
|
||||
"subrepo",
|
||||
"subwindows",
|
||||
"Suomen",
|
||||
"Svenska",
|
||||
"Swati",
|
||||
"tabbable",
|
||||
"tabindex",
|
||||
"Tahoma",
|
||||
"tbody",
|
||||
"tesselator",
|
||||
"tessy",
|
||||
"textareas",
|
||||
|
@ -424,21 +214,15 @@
|
|||
"themeable",
|
||||
"themepack",
|
||||
"throwie",
|
||||
"Tiếng",
|
||||
"tileable",
|
||||
"timespan",
|
||||
"tina",
|
||||
"titlebar",
|
||||
"Toçikī",
|
||||
"togglable",
|
||||
"topich",
|
||||
"tracedata",
|
||||
"tracky",
|
||||
"Tshivenḓa",
|
||||
"Tsonga",
|
||||
"Türkçe",
|
||||
"Tracky",
|
||||
"Tvcy",
|
||||
"tzebuergesch",
|
||||
"ufeff",
|
||||
"typestyles",
|
||||
"undecagons",
|
||||
"undoable",
|
||||
"undoables",
|
||||
|
@ -448,111 +232,28 @@
|
|||
"unfocusing",
|
||||
"uniquify",
|
||||
"unmaximize",
|
||||
"unminimize",
|
||||
"unpremultiplied",
|
||||
"untrusted",
|
||||
"upiatun",
|
||||
"UPNG",
|
||||
"ustom",
|
||||
"UTIF",
|
||||
"Uyghur",
|
||||
"Uyghurche",
|
||||
"Vakaviti",
|
||||
"Valencian",
|
||||
"Valoda",
|
||||
"vaporwave",
|
||||
"Venda",
|
||||
"Verdana",
|
||||
"verts",
|
||||
"Viacam",
|
||||
"Việt",
|
||||
"viewports",
|
||||
"Vlaams",
|
||||
"Volapük",
|
||||
"Vosa",
|
||||
"VSNs",
|
||||
"Walon",
|
||||
"Wayback",
|
||||
"Webamp",
|
||||
"webglcontextlost",
|
||||
"webglcontextrestored",
|
||||
"webp",
|
||||
"Wikang",
|
||||
"Winamp",
|
||||
"WINTRAP",
|
||||
"woah",
|
||||
"Wollof",
|
||||
"xfce",
|
||||
"xfconf",
|
||||
"Xitsonga",
|
||||
"xtras",
|
||||
"Yângâ",
|
||||
"youtube",
|
||||
"zbek",
|
||||
"Zhōngwén",
|
||||
"Zhuang",
|
||||
"zoomable",
|
||||
"zoomer",
|
||||
"zyk",
|
||||
"Ελληνικά",
|
||||
"Авар",
|
||||
"Аҧсуа",
|
||||
"Аҧсшәа",
|
||||
"Башҡорт",
|
||||
"Беларуская",
|
||||
"Български",
|
||||
"Бызшәа",
|
||||
"Език",
|
||||
"Ирон",
|
||||
"Јазик",
|
||||
"Језик",
|
||||
"Коми",
|
||||
"Кыргыз",
|
||||
"Кыргызча",
|
||||
"Қазақ",
|
||||
"Македонски",
|
||||
"Мова",
|
||||
"Монгол",
|
||||
"Мотт",
|
||||
"Нохчийн",
|
||||
"Русский",
|
||||
"Словѣньскъ",
|
||||
"Српски",
|
||||
"Татар",
|
||||
"Теле",
|
||||
"Тили",
|
||||
"Тілі",
|
||||
"Тоҷикӣ",
|
||||
"Түркмен",
|
||||
"Ўзбек",
|
||||
"Українська",
|
||||
"Чӑваш",
|
||||
"Чӗлхи",
|
||||
"Ѩзыкъ",
|
||||
"Ӏарул",
|
||||
"ქართული",
|
||||
"Հայերեն",
|
||||
"עברית",
|
||||
"أۇزبېك",
|
||||
"ئۇيغۇرچە",
|
||||
"اردو",
|
||||
"العربية",
|
||||
"بهاس",
|
||||
"پښتو",
|
||||
"پنجابی",
|
||||
"تاجیکی",
|
||||
"سندھی",
|
||||
"سنڌي",
|
||||
"فارسی",
|
||||
"كشميري",
|
||||
"کوردی",
|
||||
"ملايو",
|
||||
"ትግርኛ",
|
||||
"አማርኛ",
|
||||
"ພາສາລາວ",
|
||||
"ꦧꦱꦗꦮ",
|
||||
"ᐃᓄᒃᑎᑐᑦ",
|
||||
"ᐊᓂᔑᓈᐯᒧᐎᓐ",
|
||||
"ᓀᐦᐃᔭᐍᐏᐣ"
|
||||
"العربية"
|
||||
]
|
||||
}
|
|
@ -1035,8 +1035,8 @@ async function confirm_overwrite_capability() {
|
|||
<p>JS Paint can now save over existing files.</p>
|
||||
<p>Do you want to overwrite the file?</p>
|
||||
<p>
|
||||
<input type="checkbox" id="dont-ask-me-again-checkbox"/>
|
||||
<label for="dont-ask-me-again-checkbox">Don't ask me again</label>
|
||||
<input type="checkbox" id="do-not-ask-me-again-checkbox"/>
|
||||
<label for="do-not-ask-me-again-checkbox">Don't ask me again</label>
|
||||
</p>
|
||||
`,
|
||||
buttons: [
|
||||
|
@ -1046,7 +1046,7 @@ async function confirm_overwrite_capability() {
|
|||
});
|
||||
const result = await promise;
|
||||
if (result === "overwrite") {
|
||||
acknowledged_overwrite_capability = $window.$content.find("#dont-ask-me-again-checkbox").prop("checked");
|
||||
acknowledged_overwrite_capability = $window.$content.find("#do-not-ask-me-again-checkbox").prop("checked");
|
||||
try {
|
||||
localStorage[confirmed_overwrite_key] = acknowledged_overwrite_capability;
|
||||
} catch (error) {
|
||||
|
|
|
@ -96,16 +96,16 @@
|
|||
class LocalSession {
|
||||
constructor(session_id) {
|
||||
this.id = session_id;
|
||||
const lsid = `image#${session_id}`;
|
||||
log(`Local storage ID: ${lsid}`);
|
||||
const ls_key = `image#${session_id}`;
|
||||
log(`Local storage key: ${ls_key}`);
|
||||
// save image to storage
|
||||
this.save_image_to_storage_immediately = () => {
|
||||
const save_paused = handle_data_loss();
|
||||
if (save_paused) {
|
||||
return;
|
||||
}
|
||||
log(`Saving image to storage: ${lsid}`);
|
||||
storage.set(lsid, main_canvas.toDataURL("image/png"), err => {
|
||||
log(`Saving image to storage: ${ls_key}`);
|
||||
storage.set(ls_key, main_canvas.toDataURL("image/png"), err => {
|
||||
if (err) {
|
||||
if (err.quotaExceeded) {
|
||||
storage_quota_exceeded();
|
||||
|
@ -119,7 +119,7 @@
|
|||
});
|
||||
};
|
||||
this.save_image_to_storage_soon = debounce(this.save_image_to_storage_immediately, 100);
|
||||
storage.get(lsid, (err, uri) => {
|
||||
storage.get(ls_key, (err, uri) => {
|
||||
if (err) {
|
||||
if (localStorageAvailable) {
|
||||
show_error_message("Failed to retrieve image from local storage.", err);
|
||||
|
|
|
@ -487,7 +487,9 @@ select.inset-deep {
|
|||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
/* spell-checker: disable */
|
||||
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 0H0v16h1V1h14V0z' fill='%23DFDFDF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 1H1v14h1V2h12V1H2z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M16 17H0v-1h15V0h1v17z' fill='%23000'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 1h-1v14H1v1h14V1z' fill='gray'/%3E%3Cpath fill='silver' d='M2 2h12v13H2z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11 6H4v1h1v1h1v1h1v1h1V9h1V8h1V7h1V6z' fill='%23000'/%3E%3C/svg%3E");
|
||||
/* spell-checker: enable */
|
||||
background-repeat: no-repeat;
|
||||
border-radius: 0;
|
||||
box-sizing: border-box;
|
||||
|
|
|
@ -219,6 +219,7 @@ body {
|
|||
|
||||
/* Menu item SVG for checkboxes and submenu indicators, copy pasted from OS-GUI's CSS */
|
||||
/* Note: viewBox is needed for scaling the SVG, used in Eye Gaze Mode */
|
||||
/* spell-checker: disable */
|
||||
.menu-item-checkbox-area::after {
|
||||
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' style='fill:currentColor;display:inline-block;vertical-align:middle' %3E%3Cpath d='M5 7v3l2 2 5-5V4L7 9Z'/%3E%3C/svg%3E");
|
||||
mask-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' style='fill:currentColor;display:inline-block;vertical-align:middle' %3E%3Cpath d='M5 7v3l2 2 5-5V4L7 9Z'/%3E%3C/svg%3E");
|
||||
|
@ -231,6 +232,7 @@ body {
|
|||
-webkit-mask-image: url("data:image/svg+xml, %3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' style='fill:currentColor;display:inline-block;vertical-align:middle' %3E%3Cpath d='m6 4 4 4-4 4z'/%3E%3C/svg%3E");
|
||||
mask-image: url("data:image/svg+xml, %3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' style='fill:currentColor;display:inline-block;vertical-align:middle' %3E%3Cpath d='m6 4 4 4-4 4z'/%3E%3C/svg%3E");
|
||||
}
|
||||
/* spell-checker: ensable */
|
||||
.has-submenu .menu-item-submenu-area.point-right::after {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* This is a generated file. */
|
||||
/* spell-checker: disable */
|
||||
:root {
|
||||
--checker: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAGklEQVQYV2M84GDxf9mZCwyMaTwc/6NMDBgASCgGs4uut0wAAAAASUVORK5CYII=");
|
||||
--button-active-border-image: url("data:image/svg+xml,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22256px%22%20height%3D%22256px%22%20viewBox%3D%220%200%20256%20256%22%3E%0A%09%09%09%0A%09%09%3Cpath%20d%3D%22M0%200h256v256h-256v-256z%22%20fill%3D%22rgb(64%2C%2032%2C%2032)%22%2F%3E%0A%09%09%3Cpath%20d%3D%22M32%2032h192v192h-192v-192z%22%20fill%3D%22rgb(67%2C%209%2C%205)%22%2F%3E%0A%09%09%3Cpath%20d%3D%22M64%2064h128v128h-128v-128z%22%20fill%3D%22rgb(102%2C%2012%2C%208)%22%2F%3E%0A%09%0A%09%09%3C%2Fsvg%3E") 64 / 2px;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* Source: https://www.deviantart.com/tpenguinltg/art/Vista-esque-Midnight-Green-563591910 */
|
||||
/* License: https://creativecommons.org/licenses/by-sa/3.0/ */
|
||||
/* This is a generated file. */
|
||||
/* spell-checker: disable */
|
||||
:root {
|
||||
--checker: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAGklEQVQYV2NsaGj4v2DBAgZGBQWF/wkJCQwAR5oG4S4rhtYAAAAASUVORK5CYII=");
|
||||
--button-active-border-image: url("data:image/svg+xml,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22256px%22%20height%3D%22256px%22%20viewBox%3D%220%200%20256%20256%22%3E%0A%09%09%09%0A%09%09%3Cpath%20d%3D%22M0%200h256v256h-256v-256z%22%20fill%3D%22rgb(0%2C%200%2C%200)%22%2F%3E%0A%09%09%3Cpath%20d%3D%22M32%2032h192v192h-192v-192z%22%20fill%3D%22rgb(21%2C%2021%2C%2021)%22%2F%3E%0A%09%09%3Cpath%20d%3D%22M64%2064h128v128h-128v-128z%22%20fill%3D%22rgb(32%2C%2032%2C%2032)%22%2F%3E%0A%09%0A%09%09%3C%2Fsvg%3E") 64 / 2px;
|
||||
|
|
|
@ -107,7 +107,9 @@
|
|||
height: 1em;
|
||||
/* Noto Color Emoji snowflake, brightened a bit. Original fill: #95c7ec */
|
||||
/* Source: https://github.com/googlefonts/noto-emoji/blob/9a5261d871451f9b5183c93483cbd68ed916b1e9/svg/emoji_u2744.svg */
|
||||
/* spell-checker: disable */
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E%3Cpath style='fill:%23aad1ef' d='m70 51-1-19s10-5 12-8 1-9-1-10c-2 0-11 7-12 6s4-6 4-8l-7-7-8 8s3 7 2 8-10-6-12-6c-3 1-2 5-1 7s15 9 15 9l-1 20h-3l-2 3-15-9-1-18c0-2-4-3-5-3l-4 16-6-10-9 2 3 12 10 2-12 14s3 3 6 2l11-8 16 8v3l1 1-16 9c-1 0-10-7-13-7s-5 4-5 4l12 9-10 5-4 9 11 3c2 0 4-8 5-9l1 2s3 11 5 11 4-3 5-4-1-15-1-15l15-8 2 2 4 1v17s-16 7-17 9l1 7 14-5v9s6 9 8 8l6-8-5-9c1 0 10 7 12 6 2 0 3-2 3-4S70 96 70 96V78l3-1 3-4 15 11 1 18 6 2 1-16 7 6 10-2-3-9c-1-2-8-1-8-1-1-1 11-5 11-7s-4-5-5-6l-15 7-17-10 1-2-1-2 17-10s15 6 16 5l3-3-12-7h9l5-10-12-3-5 6-1-13h-6l-2 18-16 9-2-3h-3z'/%3E%3Cpath style='fill:%23afe3ff' d='m76 56 19-10V26l-5 3-1 14-16 9 3 4zM99 44l8-8c2-1 9 2 9 2l1-3c-1-1-10-5-12-4s-5 7-5 7l-1 6zM99 51l-4 2s10 6 13 6 6-3 6-3h-5l-10-5zM77 70l-2 5 14 9s-1 15 1 17l4 2 1-22-18-11zM95 75s9-7 12-7 5 2 5 2l-13 7-4-2zM100 85l-1 4s3 8 6 8c2 1 10-2 11-3v-4s-7 3-9 2c-3 0-7-7-7-7zM59 55l-5 8c0 1 4 9 6 10h10l4-9-4-9H59zM63 22l-2-9 6-6-3-3c-2 0-9 6-9 8l4 9 4 1zM45 19s0 4 2 6c1 2 11 7 11 7l1 19h4V29l-10-5-8-5zM40 48l13 8 2-3-15-9zM30 40l3 3c2-1 2-19 2-19s-3-1-4 0l-1 16zM29 44c2 1 2 3 1 4L17 61s-3-1-3-3l11-11s-8 2-10 0l-4-14 5-1 2 11 11 1zM50 66l-16 9 4 3 14-9zM31 81l-6 4h-6l-4 10-3-1c-1-1 3-11 4-13h9l-10-7c-1-2 3-4 3-4s14 9 13 11zM33 86l-3 3 2 13h4l-3-16zM59 78v15l-14 9-1 5 19-10V78h-4zM83 109l-13-9v-6l12 10 1 5zM60 114l8 8-4 2c-1 0-9-7-9-9l4-9 3-1-2 9z'/%3E%3Cpath style='fill:%23fefefe' d='m71 62-2 4-1 4h-7c-2 0-3 4 0 4l10-1 5-10c0-2-4-7-6-8-1-2-4 0-2 3l3 4zM93 30c-2 0-2 3-2 6s1 6 3 6 1-5 1-7 1-5-2-5zM64 8c1 1-1 3-1 4-1 0-3 2-5 0s1-3 2-4h4zM63 28c-2 0-2 5-2 11 0 8 0 12 2 12s1-4 1-13c0-4 1-10-1-10zM15 33c-3 1-2 4-1 7 1 1 2 6 5 5 2-1 1-5 0-7 0-2-2-6-4-5zM92 90l-1 5 1 5c2 0 2-4 2-5 0-2 0-5-2-5zM63 78l-1 9c0 6-1 10 1 10 2-1 2-7 2-11s0-8-2-8zM37 78c1 1 5-2 8-3 4-2 8-4 7-6s-5 1-8 3c-3 1-8 4-7 6zM25 86l-5 1-2 4c-2 1-3-1-2-3 0-3 1-4 2-5l5-1c2 0 3 3 2 4z'/%3E%3C/svg%3E");
|
||||
/* spell-checker: enable */
|
||||
background-repeat: no-repeat;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
|
|
Loading…
Reference in New Issue