Skip to content

Commit

Permalink
Make addendum auto open if hash matches
Browse files Browse the repository at this point in the history
  • Loading branch information
Chalarangelo committed Dec 21, 2024
1 parent 5904540 commit 6606cd0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ listed: true
dateModified: 2024-12-12
---

<script>
document.addEventListener('DOMContentLoaded', () => {
if (location.hash === '#addendum-code-summary')
document.querySelector('main > article > details').open = true;
});
</script>

> [!IMPORTANT]
>
> This is the second article in a series about a recent project I implemented, inspired by Ruby on Rails' ActiveRecord pattern. It's more of an advanced **show & tell**, aiming to <strong class="sparkles">inspire</strong> readers to use more advanced JavaScript features and patterns. If you haven't read the first article, I recommend you start there: [Modeling complex JavaScript object collections in memory](/js/s/complex-object-collections-in-memory).
Expand Down
7 changes: 7 additions & 0 deletions content/snippets/js/s/complex-object-collections-in-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ listed: true
dateModified: 2024-12-05
---

<script>
document.addEventListener('DOMContentLoaded', () => {
if (location.hash === '#addendum-code-summary')
document.querySelector('main > article > details').open = true;
});
</script>

I've been working with [Ruby on Rails](https://rubyonrails.org/) quite a lot lately. What I've come to like about it the most may be its [ActiveRecord](https://guides.rubyonrails.org/active_record_basics.html#what-is-active-record-questionmark) ORM (Object-Relational Mapping). I won't go into detail about here, but I wanted to share a similar sort of concept I put together for this very website using JavaScript.

> [!IMPORTANT]
Expand Down
7 changes: 7 additions & 0 deletions content/snippets/js/s/complex-object-scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ listed: true
dateModified: 2024-12-19
---

<script>
document.addEventListener('DOMContentLoaded', () => {
if (location.hash === '#addendum-code-summary')
document.querySelector('main > article > details').open = true;
});
</script>

> [!IMPORTANT]
>
> This article is part of a series and picks up where the previous article, [Modeling complex JavaScript object attributes & relationships](/js/s/complex-object-attributes-relationships), left off. If you haven't read it yet, I recommend you do so before continuing. The entire series is more of a **show & tell**, aiming to <strong class="sparkles">inspire</strong> you to use more advanced JavaScript features and patterns.
Expand Down
7 changes: 7 additions & 0 deletions content/snippets/js/s/complex-object-serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ listed: true
dateModified: 2024-12-26
---

<script>
document.addEventListener('DOMContentLoaded', () => {
if (location.hash === '#addendum-code-summary')
document.querySelector('main > article > details').open = true;
});
</script>

> [!IMPORTANT]
>
> This article is part of a series, picking up where [Modeling complex JavaScript object scopes](/js/s/complex-object-scopes) left off. Make sure to read previous articles in the series before continuing. The entire series is more of a **show & tell**, aiming to <strong class="sparkles">inspire</strong> you to use more advanced JavaScript features and patterns in your projects.
Expand Down

0 comments on commit 6606cd0

Please sign in to comment.