|
1 | 1 | {% macro get_backlinks(subject, source, dids, limit) %} |
2 | 2 | <form method="get" action="/xrpc/blue.microcosm.links.getBacklinks"> |
3 | | - <pre class="code"><strong>GET</strong> /links |
| 3 | + <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getBacklinks |
4 | 4 | ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="at-uri, did, uri..." /> |
5 | 5 | &source= <input type="text" name="source" value="{{ source }}" placeholder="app.bsky.feed.like:subject.uri" /> |
6 | 6 | {%- for did in dids %}{% if !did.is_empty() %} |
|
24 | 24 | </script> |
25 | 25 | {% endmacro %} |
26 | 26 |
|
| 27 | +{% macro get_many_to_many_counts(subject, source, pathToOther, dids, otherSubjects, limit) %} |
| 28 | + <form method="get" action="/xrpc/blue.microcosm.links.getManyToManyCounts"> |
| 29 | + <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getManyToManyCounts |
| 30 | + ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="at-uri, did, uri..." /> |
| 31 | + &source= <input type="text" name="source" value="{{ source }}" placeholder="app.bsky.feed.like:subject.uri" /> |
| 32 | + &pathToOther= <input type="text" name="pathToOther" value="{{ pathToOther }}" placeholder="otherThing.uri" /> |
| 33 | + {%- for did in dids %}{% if !did.is_empty() %} |
| 34 | + &did= <input type="text" name="did" value="{{ did }}" placeholder="did:plc:..." />{% endif %}{% endfor %} |
| 35 | + <span id="m2m-subject-placeholder"></span> <button id="m2m-add-subject">+ other subject filter</button> |
| 36 | + {%- for otherSubject in otherSubjects %}{% if !otherSubject.is_empty() %} |
| 37 | + &otherSubject= <input type="text" name="did" value="{{ otherSubject }}" placeholder="at-uri, did, uri..." />{% endif %}{% endfor %} |
| 38 | + <span id="m2m-did-placeholder"></span> <button id="m2m-add-did">+ did filter</button> |
| 39 | + &limit= <input type="number" name="limit" value="{{ limit }}" max="100" placeholder="100" /> <button type="submit">get links</button></pre> |
| 40 | + </form> |
| 41 | + <script> |
| 42 | + const m2mAddDidButton = document.getElementById('m2m-add-did'); |
| 43 | + const m2mDidPlaceholder = document.getElementById('m2m-did-placeholder'); |
| 44 | + m2mAddDidButton.addEventListener('click', e => { |
| 45 | + e.preventDefault(); |
| 46 | + const i = document.createElement('input'); |
| 47 | + i.placeholder = 'did:plc:...'; |
| 48 | + i.name = "did" |
| 49 | + const p = m2mAddDidButton.parentNode; |
| 50 | + p.insertBefore(document.createTextNode('&did= '), m2mDidPlaceholder); |
| 51 | + p.insertBefore(i, m2mDidPlaceholder); |
| 52 | + p.insertBefore(document.createTextNode('\n '), m2mDidPlaceholder); |
| 53 | + }); |
| 54 | + const m2mAddSubjectButton = document.getElementById('m2m-add-subject'); |
| 55 | + const m2mSubjectPlaceholder = document.getElementById('m2m-subject-placeholder'); |
| 56 | + m2mAddSubjectButton.addEventListener('click', e => { |
| 57 | + e.preventDefault(); |
| 58 | + const i = document.createElement('input'); |
| 59 | + i.placeholder = 'at-uri, did, uri...'; |
| 60 | + i.name = "otherSubject" |
| 61 | + const p = m2mAddSubjectButton.parentNode; |
| 62 | + p.insertBefore(document.createTextNode('&otherSubject= '), m2mSubjectPlaceholder); |
| 63 | + p.insertBefore(i, m2mSubjectPlaceholder); |
| 64 | + p.insertBefore(document.createTextNode('\n '), m2mSubjectPlaceholder); |
| 65 | + }); |
| 66 | + </script> |
| 67 | +{% endmacro %} |
| 68 | + |
27 | 69 | {% macro links(target, collection, path, dids, limit) %} |
28 | 70 | <form method="get" action="/links"> |
29 | 71 | <pre class="code"><strong>GET</strong> /links |
|
0 commit comments