Skip to content

Commit

Permalink
[android] Add variables 2.7.0 documents
Browse files Browse the repository at this point in the history
  • Loading branch information
plaid-inc committed May 9, 2024
1 parent 94a3c18 commit 9619cdd
Show file tree
Hide file tree
Showing 100 changed files with 5,129 additions and 154 deletions.
4 changes: 4 additions & 0 deletions docs/android/variables/2.7.0/images/anchor-copy-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/android/variables/2.7.0/images/arrow_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/android/variables/2.7.0/images/copy-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/android/variables/2.7.0/images/copy-successful-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/android/variables/2.7.0/images/docs_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/android/variables/2.7.0/images/footer-go-to-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/android/variables/2.7.0/images/go-to-top-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/android/variables/2.7.0/images/logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions docs/android/variables/2.7.0/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=variables/index.html">
<script type="text/javascript">
window.location.href = "variables/index.html"
</script>
<title>Documentation</title>
</head>
<body>
If you are not redirected automatically, follow <a href="variables/index.html">this link</a>.
</body>
</html>
19 changes: 19 additions & 0 deletions docs/android/variables/2.7.0/navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="sideMenuPart" id="nav-submenu" pageId="////PointingToDeclaration//1901061934">
<div class="overview"><a href="variables/index.html"><span>variables</span></a><span class="navButton pull-right" onclick="document.getElementById(&quot;nav-submenu&quot;).classList.toggle(&quot;hidden&quot;);"><span class="navButtonContent"></span></span></div>
<div class="sideMenuPart" id="nav-submenu-0" pageId="io.karte.android.variables////PointingToDeclaration//-1508386440">
<div class="overview"><a href="variables/io.karte.android.variables/index.html"><span>io.</span><wbr></wbr><span>karte.</span><wbr></wbr><span>android.</span><wbr></wbr><span>variables</span></a><span class="navButton pull-right" onclick="document.getElementById(&quot;nav-submenu-0&quot;).classList.toggle(&quot;hidden&quot;);"><span class="navButtonContent"></span></span></div>
<div class="sideMenuPart" id="nav-submenu-0-0" pageId="io.karte.android.variables/FetchCompletion///PointingToDeclaration//-1508386440">
<div class="overview"><a href="variables/io.karte.android.variables/-fetch-completion/index.html"><span>Fetch</span><wbr></wbr><span>Completion</span></a></div>
</div>
<div class="sideMenuPart" id="nav-submenu-0-1" pageId="io.karte.android.variables/Variable///PointingToDeclaration//-1508386440">
<div class="overview"><a href="variables/io.karte.android.variables/-variable/index.html"><span>Variable</span></a></div>
</div>
<div class="sideMenuPart" id="nav-submenu-0-2" pageId="io.karte.android.variables/Variables///PointingToDeclaration//-1508386440">
<div class="overview"><a href="variables/io.karte.android.variables/-variables/index.html"><span>Variables</span></a></div>
</div>
<div class="sideMenuPart" id="nav-submenu-0-3" pageId="io.karte.android.variables/VariablesPredicate///PointingToDeclaration//-1508386440">
<div class="overview"><a href="variables/io.karte.android.variables/-variables-predicate/index.html"><span>Variables</span><wbr></wbr><span>Predicate</span></a></div>
</div>
</div>
</div>

52 changes: 52 additions & 0 deletions docs/android/variables/2.7.0/scripts/clipboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
window.addEventListener('load', () => {
document.querySelectorAll('span.copy-icon').forEach(element => {
element.addEventListener('click', (el) => copyElementsContentToClipboard(element));
})

document.querySelectorAll('span.anchor-icon').forEach(element => {
element.addEventListener('click', (el) => {
if(element.hasAttribute('pointing-to')){
const location = hrefWithoutCurrentlyUsedAnchor() + '#' + element.getAttribute('pointing-to')
copyTextToClipboard(element, location)
}
});
})
})

const copyElementsContentToClipboard = (element) => {
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(element.parentNode.parentNode);
selection.removeAllRanges();
selection.addRange(range);

copyAndShowPopup(element, () => selection.removeAllRanges())
}

const copyTextToClipboard = (element, text) => {
var textarea = document.createElement("textarea");
textarea.textContent = text;
textarea.style.position = "fixed";
document.body.appendChild(textarea);
textarea.select();

copyAndShowPopup(element, () => document.body.removeChild(textarea))
}

const copyAndShowPopup = (element, after) => {
try {
document.execCommand('copy');
element.nextElementSibling.classList.add('active-popup');
setTimeout(() => {
element.nextElementSibling.classList.remove('active-popup');
}, 1200);
} catch (e) {
console.error('Failed to write to clipboard:', e)
}
finally {
if(after) after()
}
}

const hrefWithoutCurrentlyUsedAnchor = () => window.location.href.split('#')[0]

67 changes: 67 additions & 0 deletions docs/android/variables/2.7.0/scripts/main.js

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions docs/android/variables/2.7.0/scripts/navigation-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
navigationPageText = fetch(pathToRoot + "navigation.html").then(response => response.text())

displayNavigationFromPage = () => {
navigationPageText.then(data => {
document.getElementById("sideMenu").innerHTML = data;
}).then(() => {
document.querySelectorAll(".overview > a").forEach(link => {
link.setAttribute("href", pathToRoot + link.getAttribute("href"));
})
}).then(() => {
document.querySelectorAll(".sideMenuPart").forEach(nav => {
if (!nav.classList.contains("hidden"))
nav.classList.add("hidden")
})
}).then(() => {
revealNavigationForCurrentPage()
})
document.querySelectorAll('.footer a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
}

revealNavigationForCurrentPage = () => {
let pageId = document.getElementById("content").attributes["pageIds"].value.toString();
let parts = document.querySelectorAll(".sideMenuPart");
let found = 0;
do {
parts.forEach(part => {
if (part.attributes['pageId'].value.indexOf(pageId) !== -1 && found === 0) {
found = 1;
if (part.classList.contains("hidden")) {
part.classList.remove("hidden");
part.setAttribute('data-active', "");
}
revealParents(part)
}
});
pageId = pageId.substring(0, pageId.lastIndexOf("/"))
} while (pageId.indexOf("/") !== -1 && found === 0)
};
revealParents = (part) => {
if (part.classList.contains("sideMenuPart")) {
if (part.classList.contains("hidden"))
part.classList.remove("hidden");
revealParents(part.parentNode)
}
};

/*
This is a work-around for safari being IE of our times.
It doesn't fire a DOMContentLoaded, presumabely because eventListener is added after it wants to do it
*/
if (document.readyState == 'loading') {
window.addEventListener('DOMContentLoaded', () => {
displayNavigationFromPage()
})
} else {
displayNavigationFromPage()
}
1 change: 1 addition & 0 deletions docs/android/variables/2.7.0/scripts/navigation-pane.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name":"variables","description":null,"location":"variables/index.html","searchKeys":["variables"]},{"name":"io.karte.android.variables","description":null,"location":"variables/io.karte.android.variables/index.html","searchKeys":["io.karte.android.variables"]},{"name":"FetchCompletion","description":null,"location":"variables/io.karte.android.variables/-fetch-completion/index.html","searchKeys":["FetchCompletion"]},{"name":"Variable","description":null,"location":"variables/io.karte.android.variables/-variable/index.html","searchKeys":["Variable"]},{"name":"Variables","description":null,"location":"variables/io.karte.android.variables/-variables/index.html","searchKeys":["Variables"]},{"name":"VariablesPredicate","description":null,"location":"variables/io.karte.android.variables/-variables-predicate/index.html","searchKeys":["VariablesPredicate"]}]
Loading

0 comments on commit 9619cdd

Please sign in to comment.