Skip to content

Commit

Permalink
Performance & Feature Update II
Browse files Browse the repository at this point in the history
Added Z-Editor to parts tab, allowing for easy, sorted mass-editing of zLevels for all parts.
Added setting to make preview tab load all entries again, allowing for CTRL+F search. This loading happens dynamically to not block the main thread.
Fixed minor bugs.
  • Loading branch information
ErinaSugino committed Dec 9, 2023
1 parent 6a10220 commit 9d77661
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 31 deletions.
3 changes: 2 additions & 1 deletion animator.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ button.modern:hover, button.modern:active {background-color: var(--bg_color_hove
div.sidebar button.modern:hover, div.sidebar button.modern:active {background-color: var(--bg_color_menu_hover);}
button.modern:active {box-shadow: inset 0 0 4px white;}
button.modern:disabled {color: var(--bg_color_disab); pointer-events: none; font-style: italic;}
button.tiny {width: 24px; height: 24px; font-size: 14px; /*line-height: 20px;*/}
button.tiny {width: 24px; height: 24px; font-size: 14px;}
button.tiny:nth-of-type(n+2) {margin-left: 15px;}
button.small {height: 24px; width: 75px; font-size: 14px;}
button.normal {width: 150px; height: 30px; margin: 0px 5px;}
button.large {width: 100%; height: 30px;}
button.large:nth-child(n+2) {border-top: none;}
Expand Down
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@
<option value="0" title="Human readable&#10;pretty print">Pretty</option>
<option value="1" title="Human readable with&#10;minified parts">Optimized</option>
<option value="2" title="Minified JSON without&#10;white-spaces">Production</option>
</select><br>
<label class="title">Preview Mode</label>
<select class="modern large" id="previewLoadMode" title="Way the preview&#10;tab renders results">
<option value="0" title="Only loads elements&#10;that are visible">Performance</option>
<option value="1" title="Loads all elements&#10;For CTRL+F search">Full (Search)</option>
</select>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion jsonpatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
_operationRequired = {
add: ['value'],
replace: ['value'],
test: ['value'],
test: [],
remove: [],
move: ['from'],
copy: ['from']
Expand Down
13 changes: 9 additions & 4 deletions misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ var downloadFile = null;
function startup() {
animator = new Animator();
ui = new UI();
ui.setSetting('fullPreview', false);

if(document.getElementById('main').classList.contains('dark')) document.getElementById('darkmode').checked = true;
document.getElementById('darkmode').addEventListener('change', switchDarkMode);
Expand Down Expand Up @@ -526,9 +527,6 @@ function startup() {
false
);
});
document.getElementById('compressionLevel').addEventListener('change', function(e) {
animator.compressionLevel = this.value;
});
document.getElementById('patchImportButton').addEventListener('click', (e) => {
if(!animator.hasElements()) {
ToastModal.open("Nothing to patch", true);
Expand All @@ -545,5 +543,12 @@ function startup() {
"small",
false
);
})
});
document.getElementById('compressionLevel').addEventListener('change', function(e) {
animator.compressionLevel = this.value;
});
document.getElementById('previewLoadMode').addEventListener('change', function(e) {
ui.setSetting('fullPreview', !!(parseInt(this.value)||0));
ui._tabs.preview.softUpdatePreview();
});
}
Loading

0 comments on commit 9d77661

Please sign in to comment.