Skip to content

Commit

Permalink
Remove JavaScript control for toggling private methods
Browse files Browse the repository at this point in the history
Eliminated the script handling the toggle functionality for private methods in the SVG. This simplifies the HTML by removing the button and associated JavaScript, improving page load performance and maintainability.
  • Loading branch information
koriym committed Aug 29, 2024
1 parent a113f91 commit 0fd0b7a
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions php-class-diagram.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="This is a class diagram for the Ray.Aop project.">
<! -- This image was generated by the https://github.com/smeghead/php-class-diagram/ library -->.
<script>
var svgDoc = null;
window.addEventListener("load", function() {
var svgObject = document.getElementById("svgObject");
svgObject.addEventListener("load", function() {
var svgObject = document.getElementById("svgObject");
svgDoc = svgObject.getSVGDocument();
if (!svgDoc) {
console.error("Failed to load SVG document.");
}
});
});

function togglePrivateMethods() {
var svgObject = document.getElementById("svgObject");
var svgDoc = svgObject.getSVGDocument();
if (svgDoc) {
var privateMethods = svgDoc.querySelectorAll(".private-method");
privateMethods.forEach(method => {
if (method.classList.contains("hidden")) {
method.classList.remove("hidden");
} else {
method.classList.add("hidden");
}
});
} else {
console.error("SVG document not found or not yet loaded.");
}
}
</script>
<style>
object {
width: 100%;
Expand All @@ -43,6 +13,5 @@
</head>
<body>
<object id="svgObject" type="image/svg+xml" data="images/php-class-diagram.svg"></object>
<button onclick="togglePrivateMethods()">Toggle Private Methods</button>
</body>
</html>

0 comments on commit 0fd0b7a

Please sign in to comment.