Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Commit 74365d4

Browse files
committed
validate JSON form dynamically, better resizing, add ignore options
1 parent 8f08497 commit 74365d4

File tree

4 files changed

+149
-91
lines changed

4 files changed

+149
-91
lines changed

index.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ <h3>Addon creation</h3>
5757
<input id="addon_dir_folder" class="real_select" type="file" webkitdirectory />
5858
<p id="addonDir"><b></b></p>
5959
<div class="next_prompt">
60-
<button id="addonDirCheck" class="transition_button" data-divtoshow="#addonjsonPrompt" data-divtohide="#addonDirPrompt" disabled>Next</button>
60+
<button id="addonDirCheck" class="transition_button" data-divtoshow="#addonjsonPrompt" data-divtohide="#addonDirPrompt" data-resize="500, 175" disabled>Next</button>
6161
</div>
6262
</div>
6363
<div id="addonjsonPrompt">
6464
<p>Do you already have a addon.json?</p>
6565
<div>
66-
<button class="button_normal transition_button removeBackOption" data-divtoshow="#jsonCreator" data-divtohide="#addonjsonPrompt" data-resize="500, 300">No</button>
66+
<button class="button_normal transition_button removeBackOption" data-divtoshow="#jsonCreator" data-divtohide="#addonjsonPrompt" data-resize="500, 350">No</button>
6767
<button class="button_normal transition_button removeBackOption" data-divtoshow="#gmaPrep" data-divtohide="#addonjsonPrompt">Yes</button>
6868
</div>
6969
</div>
@@ -72,6 +72,7 @@ <h3>Addon creation</h3>
7272
<div id="jsonTitle">
7373
<p class="jsonSectionHeader">Title</p>
7474
<input name="addonTitle" type="text" placeholder="Crazy cool addon" maxlength="128">
75+
<p><span style="font-size: .7em; color: grey;">(required)</span></p>
7576
</div>
7677
<div id="jsonType">
7778
<p class="jsonSectionHeader">Type</p>
@@ -87,6 +88,7 @@ <h3>Addon creation</h3>
8788
<option value="effects">Effects</option>
8889
<option value="model">Model</option>
8990
</select>
91+
<p><span style="font-size: .7em; color: grey;">(required)</span></p>
9092
</div>
9193
<div id="jsonTags">
9294
<div class="col">
@@ -130,11 +132,19 @@ <h3>Addon creation</h3>
130132
<input type="checkbox" name="cartoon" class="typeCheckbox">
131133
<p>Cartoon</p>
132134
</div>
135+
<div class="type">
136+
<p><span style="font-size: .7em; color: grey;">(max 2)</span></p>
137+
</div>
133138
</div>
134139
</div>
135140
</div>
141+
<div id="jsonIgnore">
142+
<p class="jsonSectionHeader">Ignore</p>
143+
<input name="addonIgnore" type="text" placeholder="*.html, README.md, etc">
144+
<p><span style="font-size: .7em; color: grey; font-weight:500;">(folder/file names seprated by a comma)</span></p>
145+
</div>
136146
<div class="next_prompt">
137-
<button id="jsonAddonValidate" class="transition_button" style="background-color: #56bd56; color: white;" data-divtoshow="#gmaPrep" data-divtohide="#jsonCreator" data-resize="500, 250">Next</button>
147+
<button id="jsonAddonValidate" class="transition_button" data-divtoshow="#gmaPrep" data-divtohide="#jsonCreator" data-resize="500, 250" disabled>Next</button>
138148
</div>
139149
</div>
140150
</div>

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function createWindow() {
2424
// Create the browser window.
2525
mainWindow = new BrowserWindow({
2626
width: 500,
27-
height: 250,
27+
height: 175,
2828
resizable: false,
2929
fullscreenable: false,
3030
backgroundColor: "#262626",
@@ -108,4 +108,6 @@ ipcMain.on('createJsonFile', (event, json, dir) => {
108108
})
109109
})
110110

111+
// ipcMain.on('createGmaFile', (addonDir))
112+
111113
// function

src/css/style.css

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,15 @@ header {
244244
display: inline-block;
245245
}
246246

247-
#jsonTitle input[type='text'] {
247+
#jsonTitle input[type="text"], #jsonIgnore input[type="text"] {
248248
border-radius: 5px;
249249
display: inline-block;
250250
width: 350px;
251251
border: none;
252252
padding: 5px;
253253
}
254254

255-
#jsonTags, #jsonTitle, #jsonType {
256-
padding: 0 10px;
255+
#jsonTags, #jsonTitle, #jsonType, #jsonIgnore {
257256
}
258257

259258
#jsonTags .type > * {
@@ -280,26 +279,38 @@ header {
280279
cursor: pointer;
281280
}
282281

282+
#jsonIgnore > * {
283+
display: inline-block;
284+
}
285+
286+
#jsonIgnore p {
287+
font-weight: 700;
288+
/* padding-right: 9px; */
289+
}
290+
291+
#jsonIgnore input[type="text"] {
292+
width: 150px;
293+
}
294+
295+
.typeCheckbox {
296+
cursor: pointer;
297+
}
298+
283299
.jsonSectionHeader {
284300
font-weight: 700;
301+
width: 55px;
285302
/* margin-top: 0; */
286-
padding-right: 15px;
303+
padding-left: 15px;
287304
letter-spacing: 1px;
288305
/* white-space: nowrap; */
289306
}
290307

291308
.jsonGrid {
292309
display: grid;
293-
margin-left: 7px;
310+
/* margin-left: 10px; */
294311
grid-template-columns: auto auto auto auto auto;
295312
}
296313

297-
.next_prompt {
298-
position: absolute;
299-
bottom: 0;
300-
width: 100%;
301-
}
302-
303314
.next_prompt {
304315
text-align: center;
305316
position: absolute;

0 commit comments

Comments
 (0)