Merge pull request #414 from amiaopensource/kfrn/tweaks

Tweaks: naming, whitespace, collapse all recipes
This commit is contained in:
Ashley 2019-12-17 11:48:57 -05:00 committed by GitHub
commit e4c327bbac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 14 deletions

View File

@ -19,7 +19,7 @@
<nav class="sidebar well">
<h2 class="heading">Table of Contents</h2>
<a href="#about"><div class="contents-list">About this resource</div></a>
<div id="open-all" class="contents-list">Show/hide all recipes</div>
<div id="toggle-expand-collapse-all" class="contents-list">Expand/collapse all recipes</div>
<a href="#basics"><div class="contents-list">FFmpeg basics</div></a>
<a href="#concepts"><div class="contents-list">Advanced FFmpeg concepts</div></a>
<a href="#rewrap"><div class="contents-list">Change container (rewrap)</div></a>
@ -804,13 +804,13 @@
<p>It's also possible to specify the crop position by adding the x and y coordinates representing the top left of your cropped area to your crop filter, as such:</p>
<p><code>ffmpeg -i <em>input_file</em> -vf "crop=<em>width</em>:<em>height</em>[:<em>x_position</em>:<em>y_position</em>]" <em>output_file</em></code></p>
<h5>Examples</h5>
<p>The original frame, a screenshot of the SMPTE colorbars:</p>
<p>The original frame, a screenshot of Maggie Cheung in the film <i>Hero</i>:</p>
<img class="sample-image" src="img/crop_example_orig.png" alt="VLC screenshot of Maggie Cheung">
<p>Result of the command <code>ffmpeg -i <em>smpte_colorsbars.mov</em> -vf "crop=500:500" <em>output_file</em></code>:</p>
<p>Result of the command <code>ffmpeg -i <em>maggie.mov</em> -vf "crop=500:500" <em>output_file</em></code>:</p>
<img class="sample-image-small" src="img/crop_example_aftercrop1.png" alt="VLC screenshot of Maggie Cheung, cropped from original">
<p>Result of the command <code>ffmpeg -i <em>smpte_colorsbars.mov</em> -vf "crop=500:500:0:0" <em>output_file</em></code>, appending <code>:0:0</code> to crop from the top left corner:</p>
<p>Result of the command <code>ffmpeg -i <em>maggie.mov</em> -vf "crop=500:500:0:0" <em>output_file</em></code>, appending <code>:0:0</code> to crop from the top left corner:</p>
<img class="sample-image-small" src="img/crop_example_aftercrop2.png" alt="VLC screenshot of Maggie Cheung, cropped from original">
<p>Result of the command <code>ffmpeg -i <em>smpte_colousbars.mov</em> -vf "crop=500:300:500:30" <em>output_file</em></code>:</p>
<p>Result of the command <code>ffmpeg -i <em>maggie.mov</em> -vf "crop=500:300:500:30" <em>output_file</em></code>:</p>
<img class="sample-image-small" src="img/crop_example_aftercrop3.png" alt="VLC screenshot of Maggie Cheung, cropped from original">
<p class="link"></p>
</div>

View File

@ -32,11 +32,21 @@ $(document).ready(function() {
}
})
// open all windows if button is clicked
$('#open-all').on("click", function(){
$('input[type=checkbox]').each(function(){
this.checked = !this.checked;
})
});
// Collapse all recipes when button is clicked
$('#toggle-expand-collapse-all').on("click", function(){
var checkboxes = $('input[type=checkbox]');
var anyRecipesOpen = $(checkboxes).is(':checked');
if (anyRecipesOpen) {
// Collapse all
$('input[type=checkbox]').each(function() {
this.checked = false;
});
} else new Promise(function(resolve, reject) {
// Expand all
$('input[type=checkbox]').each(function() {
this.checked = true;
});
});
});
});