Skip to content

Commit

Permalink
[#1965] manually convert line endings from CRLF to LF
Browse files Browse the repository at this point in the history
  • Loading branch information
remkop committed Feb 24, 2023
1 parent 6a99e2a commit db4f602
Show file tree
Hide file tree
Showing 14 changed files with 1,650 additions and 1,050 deletions.
225 changes: 150 additions & 75 deletions docs/A-Whirlwind-Tour-of-Picocli.html
Original file line number Diff line number Diff line change
Expand Up @@ -1564,81 +1564,156 @@
});
});
</script>
<style>
.hidden {
display: none;
}

.switch {
border-width: 1px 1px 0 1px;
border-style: solid;
border-color: #7a2518;
display: inline-block;
}

.switch--item {
padding: 10px;
background-color: #ffffff;
color: #7a2518;
display: inline-block;
cursor: pointer;
}

.switch--item.selected {
background-color: #7a2519;
color: #ffffff;
}

</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>
<script type="text/javascript">
function addBlockSwitches() {
$('.primary').each(function() {
primary = $(this);
createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");
primary.children('.title').remove();
});
$('.secondary').each(function(idx, node) {
secondary = $(node);
primary = findPrimary(secondary);
switchItem = createSwitchItem(secondary, primary.children('.switch'));
switchItem.content.addClass('hidden');
findPrimary(secondary).append(switchItem.content);
secondary.remove();
});
}

function createBlockSwitch(primary) {
blockSwitch = $('<div class="switch"></div>');
primary.prepend(blockSwitch);
return blockSwitch;
}

function findPrimary(secondary) {
candidate = secondary.prev();
while (!candidate.is('.primary')) {
candidate = candidate.prev();
}
return candidate;
}

function createSwitchItem(block, blockSwitch) {
blockName = block.children('.title').text();
content = block.children('.content').first().append(block.next('.colist'));
item = $('<div class="switch--item">' + blockName + '</div>');
item.on('click', '', content, function(e) {
$(this).addClass('selected');
$(this).siblings().removeClass('selected');
e.data.siblings('.content').addClass('hidden');
e.data.removeClass('hidden');
});
blockSwitch.append(item);
return {'item': item, 'content': content};
}

$(addBlockSwitches);

</script>
<style>

.hidden {

display: none;

}



.switch {

border-width: 1px 1px 0 1px;

border-style: solid;

border-color: #7a2518;

display: inline-block;

}



.switch--item {

padding: 10px;

background-color: #ffffff;

color: #7a2518;

display: inline-block;

cursor: pointer;

}



.switch--item.selected {

background-color: #7a2519;

color: #ffffff;

}



</style>

<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>

<script type="text/javascript">

function addBlockSwitches() {

$('.primary').each(function() {

primary = $(this);

createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");

primary.children('.title').remove();

});

$('.secondary').each(function(idx, node) {

secondary = $(node);

primary = findPrimary(secondary);

switchItem = createSwitchItem(secondary, primary.children('.switch'));

switchItem.content.addClass('hidden');

findPrimary(secondary).append(switchItem.content);

secondary.remove();

});

}



function createBlockSwitch(primary) {

blockSwitch = $('<div class="switch"></div>');

primary.prepend(blockSwitch);

return blockSwitch;

}



function findPrimary(secondary) {

candidate = secondary.prev();

while (!candidate.is('.primary')) {

candidate = candidate.prev();

}

return candidate;

}



function createSwitchItem(block, blockSwitch) {

blockName = block.children('.title').text();

content = block.children('.content').first().append(block.next('.colist'));

item = $('<div class="switch--item">' + blockName + '</div>');

item.on('click', '', content, function(e) {

$(this).addClass('selected');

$(this).siblings().removeClass('selected');

e.data.siblings('.content').addClass('hidden');

e.data.removeClass('hidden');

});

blockSwitch.append(item);

return {'item': item, 'content': content};

}



$(addBlockSwitches);



</script>


</head>
<body class="article">
Expand Down
Loading

0 comments on commit db4f602

Please sign in to comment.