@@ -24,75 +24,174 @@ app.whenReady().then(() => {
2424
2525 const contextMenu = Menu . buildFromTemplate ( [
2626 {
27- label : "Base64 Encode" ,
28- click : ( ) => actions . encDec . base64Encode ( ) ,
29- } ,
30- {
31- label : "Base64 Decode" ,
32- click : ( ) => actions . encDec . base64Decode ( ) ,
33- } ,
34- { type : "separator" } ,
35- {
36- label : "URL Encode" ,
37- click : ( ) => actions . encDec . urlEncode ( ) ,
27+ label : "Encode" ,
28+ submenu : [
29+ {
30+ label : "Hex" ,
31+ click : ( ) => actions . encDec . hexEncode ( ) ,
32+ } ,
33+ {
34+ label : "Base64" ,
35+ click : ( ) => actions . encDec . base64Encode ( ) ,
36+ } ,
37+ { type : "separator" } ,
38+ {
39+ label : "HTML Entities" ,
40+ click : ( ) => actions . encDec . htmlEntities ( ) ,
41+ } ,
42+ { type : "separator" } ,
43+ {
44+ label : "URL Encode" ,
45+ click : ( ) => actions . encDec . urlEncode ( ) ,
46+ } ,
47+ ] ,
3848 } ,
3949 {
40- label : "URL Decode" ,
41- click : ( ) => actions . encDec . urlDecode ( ) ,
50+ label : "Decode" ,
51+ submenu : [
52+ {
53+ label : "Hex" ,
54+ click : ( ) => actions . encDec . hexDecode ( ) ,
55+ } ,
56+ {
57+ label : "Base64" ,
58+ click : ( ) => actions . encDec . base64Decode ( ) ,
59+ } ,
60+ { type : "separator" } ,
61+ {
62+ label : "HTML Entities" ,
63+ click : ( ) => actions . encDec . htmlEntitiesDecode ( ) ,
64+ } ,
65+ { type : "separator" } ,
66+ {
67+ label : "URL Decode" ,
68+ click : ( ) => actions . encDec . urlDecode ( ) ,
69+ } ,
70+ ] ,
4271 } ,
4372 { type : "separator" } ,
4473 {
4574 label : "JSON" ,
4675 submenu : [
76+ { type : "separator" } ,
77+ {
78+ label : "Beautify (2 spaces)" ,
79+ click : ( ) => actions . json . beautifyTwoSpaces ( ) ,
80+ } ,
4781 {
48- label : "Beautify" ,
49- click : ( ) => actions . json . beautify ( ) ,
82+ label : "Beautify (tabs) " ,
83+ click : ( ) => actions . json . beautifyTabs ( ) ,
5084 } ,
5185 {
5286 label : "Minify" ,
5387 click : ( ) => actions . json . minify ( ) ,
5488 } ,
89+ { type : "separator" } ,
5590 {
56- label : "Encode " ,
57- click : ( ) => actions . json . encode ( ) ,
91+ label : "Escape " ,
92+ click : ( ) => actions . json . escape ( ) ,
5893 } ,
5994 {
60- label : "Decode" ,
61- click : ( ) => actions . json . decode ( ) ,
95+ label : "Unescape" ,
96+ click : ( ) => actions . json . unescape ( ) ,
97+ } ,
98+ { type : "separator" } ,
99+ {
100+ label : "Validate" ,
101+ click : ( ) => actions . json . validate ( ) ,
62102 } ,
63103 ] ,
64104 } ,
65105 { type : "separator" } ,
66106 {
67- label : "Sort ASC " ,
68- click : ( ) => actions . sort . asc ( ) ,
107+ label : "Trim " ,
108+ click : ( ) => actions . trim . basic ( ) ,
69109 } ,
70110 {
71- label : "Sort DESC" ,
72- click : ( ) => actions . sort . desc ( ) ,
111+ label : "Slug" ,
112+ submenu : [
113+ {
114+ label : "Replacement: dash (-)" ,
115+ click : ( ) => actions . slug . slugify ( "-" ) ,
116+ } ,
117+ {
118+ label : "Replacement: underscore (_)" ,
119+ click : ( ) => actions . slug . slugify ( "_" ) ,
120+ } ,
121+ ]
73122 } ,
74- { type : "separator" } ,
75123 {
76- label : "Trim " ,
124+ label : "Case " ,
77125 submenu : [
78126 {
79- label : "Beginning and ending" ,
80- click : ( ) => actions . trim . basic ( ) ,
127+ label : "lowercase" ,
128+ click : ( ) => actions . case . lowercase ( ) ,
129+ } ,
130+ {
131+ label : "UPPERCASE" ,
132+ click : ( ) => actions . case . uppercase ( ) ,
133+ } ,
134+ {
135+ label : "Capitalize first word" ,
136+ click : ( ) => actions . case . sentenceCase ( ) ,
137+ } ,
138+ {
139+ label : "Capitalize each word" ,
140+ click : ( ) => actions . case . capitalize ( ) ,
141+ } ,
142+ {
143+ label : "CamelCase" ,
144+ click : ( ) => actions . case . camelCase ( ) ,
81145 } ,
82146 {
83- label : "Beginning and ending of each line" ,
84- click : ( ) => actions . trim . lines ( ) ,
147+ label : "snake_case" ,
148+ click : ( ) => actions . case . snakeCase ( ) ,
149+ } ,
150+ {
151+ label : "kebab-case" ,
152+ click : ( ) => actions . case . kebabCase ( ) ,
85153 }
86- ] ,
154+ ]
87155 } ,
88- { type : "separator" } ,
89156 {
90- label : "UUID " ,
157+ label : "Line " ,
91158 submenu : [
92159 {
93- label : "Validate " ,
94- click : ( ) => actions . uuid . validate ( ) ,
160+ label : "Sort ascending " ,
161+ click : ( ) => actions . line . asc ( ) ,
95162 } ,
163+ {
164+ label : "Sort descending" ,
165+ click : ( ) => actions . line . desc ( ) ,
166+ } ,
167+ { type : "separator" } ,
168+ {
169+ label : "Trim" ,
170+ click : ( ) => actions . line . trim ( ) ,
171+ } ,
172+ {
173+ label : "Reverse" ,
174+ click : ( ) => actions . line . reverse ( ) ,
175+ } ,
176+ {
177+ label : "Count" ,
178+ click : ( ) => actions . line . count ( ) ,
179+ } ,
180+ { type : "separator" } ,
181+ {
182+ label : "Remove empty" ,
183+ click : ( ) => actions . line . removeEmpty ( ) ,
184+ } ,
185+ {
186+ label : "Remove duplicates" ,
187+ click : ( ) => actions . line . removeDuplicates ( ) ,
188+ }
189+ ]
190+ } ,
191+ { type : "separator" } ,
192+ {
193+ label : "UUID" ,
194+ submenu : [
96195 {
97196 label : "Detect version" ,
98197 click : ( ) => actions . uuid . detect ( ) ,
@@ -127,7 +226,7 @@ app.whenReady().then(() => {
127226 } ,
128227 { type : "separator" } ,
129228 {
130- label : "Hashing " ,
229+ label : "Hash " ,
131230 submenu : [
132231 {
133232 label : "MD5" ,
@@ -150,8 +249,16 @@ app.whenReady().then(() => {
150249 click : ( ) => actions . hash . sha512 ( ) ,
151250 } ,
152251 {
153- label : "SHA3" ,
154- click : ( ) => actions . hash . sha3 ( ) ,
252+ label : "SHA3-256" ,
253+ click : ( ) => actions . hash . sha3 ( 256 ) ,
254+ } ,
255+ {
256+ label : "SHA3-384" ,
257+ click : ( ) => actions . hash . sha3 ( 384 ) ,
258+ } ,
259+ {
260+ label : "SHA3-512" ,
261+ click : ( ) => actions . hash . sha3 ( 512 ) ,
155262 } ,
156263 {
157264 label : "Blake" ,
@@ -174,6 +281,5 @@ app.whenReady().then(() => {
174281 tray . setToolTip ( "DMTool" ) ;
175282} ) ;
176283
177- app . on ( "window-all-closed" , ( ) => {
178- if ( process . platform !== "darwin" ) app . quit ( ) ;
179- } ) ;
284+ // Override default behavior of closing all windows when the last one is closed, so the app will continue running in the tray
285+ app . on ( "window-all-closed" , ( ) => { } ) ;
0 commit comments