-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use scss to keep style sources clean - Add freefair scss gradle plugin - Inject "including" section - Make including section use tabs for code - Make featurelist render properly for kt-fuzzy - Apply dokka only to modules that need it (not common-test) - Random misc. style changes Signed-off-by: solonovamax <[email protected]>
- Loading branch information
1 parent
29747f6
commit a3e3a39
Showing
12 changed files
with
645 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
You can include ${project.module} in your project by adding the following: | ||
|
||
<div class="tabbed-set tabbed-alternate" data-tabs="1:4"> | ||
<input id="__tabbed_1_1" name="__tabbed_1" type="radio"/> | ||
<input id="__tabbed_1_2" name="__tabbed_1" type="radio"/> | ||
<input checked="checked" id="__tabbed_1_3" name="__tabbed_1" type="radio"/> | ||
<input id="__tabbed_1_4" name="__tabbed_1" type="radio"/> | ||
<div class="tabbed-labels"> | ||
<label for="__tabbed_1_1">Maven</label> | ||
<label for="__tabbed_1_2">Gradle Groovy</label> | ||
<label for="__tabbed_1_3">Gradle Kotlin</label> | ||
<label for="__tabbed_1_4">Gradle Version Catalog</label> | ||
</div> | ||
<div class="tabbed-content"> | ||
<div class="tabbed-block"> | ||
|
||
```xml | ||
<dependencies> | ||
<dependency> | ||
<groupId>${project.group}</groupId> | ||
<artifactId>${project.module}</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
``` | ||
|
||
</div> | ||
<div class="tabbed-block"> | ||
|
||
```gradle | ||
dependencies { | ||
implementation '${project.group}:${project.module}:${project.version}' | ||
} | ||
``` | ||
|
||
</div> | ||
<div class="tabbed-block"> | ||
|
||
```kotlin | ||
dependencies { | ||
implementation("${project.group}:${project.module}:${project.version}") | ||
} | ||
``` | ||
|
||
</div> | ||
<div class="tabbed-block"> | ||
|
||
```toml | ||
[libraries] | ||
${project.module} = { group = "${project.group}", name = "${project.module}", version = "${project.version}" } | ||
``` | ||
|
||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/* | ||
* kt-fuzzy - A Kotlin library for fuzzy string matching | ||
* Copyright (c) 2023 solonovamax <[email protected]> | ||
* | ||
* The file tabbed.js is part of kotlin-fuzzy | ||
* Last modified on 30-09-2023 08:41 p.m. | ||
* | ||
* MIT License | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* KT-FUZZY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
|
||
/** | ||
* Link all tabs with same content | ||
*/ | ||
function tabSync() { | ||
const tabs = document.querySelectorAll(".tabbed-set > input") | ||
for (const tab of tabs) { | ||
tab.addEventListener("click", () => { | ||
saveTabSelection(tab) | ||
|
||
const current = document.querySelector(`label[for=${tab.id}]`) | ||
const pos = current.getBoundingClientRect().top | ||
|
||
syncTabsByName(current) | ||
|
||
// Preserve scroll position | ||
const delta = (current.getBoundingClientRect().top) - pos | ||
window.scrollBy(0, delta) | ||
}) | ||
} | ||
} | ||
|
||
/** | ||
* Load previously selected tabs | ||
*/ | ||
function loadSavedTabs() { | ||
let allTabs = document.querySelectorAll(".tabbed-set > input"); | ||
let tabGroups = Array.from(allTabs).map((element) => { | ||
return element.getAttribute("name") | ||
}) | ||
tabGroups = unique(tabGroups); | ||
|
||
for (const tabGroup of tabGroups) { | ||
let tabId = loadTabIdsFromStorage(tabGroup); | ||
|
||
if (tabId == null) | ||
continue; | ||
|
||
let tab = document.querySelector(`input[id="${tabId}"][name="${tabGroup}"]`) | ||
tab.checked = true | ||
|
||
const label = document.querySelector(`label[for=${tab.id}]`) | ||
syncTabsByName(label) | ||
} | ||
} | ||
|
||
/** @param {Element} localLabel */ | ||
function syncTabsByName(localLabel) { | ||
const labelContent = localLabel.innerHTML | ||
const labels = document.querySelectorAll('.tabbed-set > label, .tabbed-alternate > .tabbed-labels > label') | ||
for (const label of labels) { | ||
if (label.innerHTML === labelContent) { | ||
let input = document.querySelector(`input[id=${label.getAttribute('for')}]`); | ||
input.checked = true | ||
if (label !== localLabel) | ||
clearTabSelection(input) | ||
} | ||
} | ||
} | ||
|
||
/** @param {Element} tab */ | ||
function saveTabSelection(tab) { | ||
const tabGroupId = tab.getAttribute("name") | ||
const tabId = tab.id | ||
localStorage.setItem(`${location.pathname}.${tabGroupId}`, tabId) | ||
} | ||
|
||
function clearTabSelection(tab) { | ||
const tabGroupId = tab.getAttribute("name") | ||
localStorage.removeItem(`${location.pathname}.${tabGroupId}`) | ||
} | ||
|
||
/** @param {String} tabGroupId */ | ||
function loadTabIdsFromStorage(tabGroupId) { | ||
return localStorage.getItem(`${location.pathname}.${tabGroupId}`) | ||
} | ||
|
||
/** @param {any[]} array */ | ||
function unique(array) { | ||
return Array.from(new Set(array)); | ||
} | ||
|
||
window.addEventListener('DOMContentLoaded', () => { | ||
// Load shit | ||
loadSavedTabs() | ||
tabSync() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*! | ||
* kt-fuzzy - A Kotlin library for fuzzy string matching | ||
* Copyright (c) 2023 solonovamax <[email protected]> | ||
* | ||
* The file _mixins.scss is part of kotlin-fuzzy | ||
* Last modified on 02-10-2023 01:08 p.m. | ||
* | ||
* MIT License | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* KT-FUZZY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
$default-prefixes: ( | ||
'webkit', | ||
'moz', | ||
'ms', | ||
); | ||
|
||
/// Mixin to prefix a property | ||
/// @author Kitty Giraudel | ||
/// @param {String} $property - Property name | ||
/// @param {*} $value - Property value | ||
/// @param {List} $prefixes (()) - List of prefixes to print | ||
@mixin vendor-prefix($property, $value, $prefixes: $default-prefixes) { | ||
@each $prefix in $prefixes { | ||
#{'-' + $prefix + '-' + $property}: $value; | ||
} | ||
|
||
// Output standard non-prefixed declaration | ||
#{$property}: $value; | ||
} |
Oops, something went wrong.