|
1 | 1 | <details id="markdownDropdown" class="ml-3 group relative z-10 inline-block" data-heap-id="markdown-dropdown">
|
2 | 2 | <summary
|
3 |
| - class="inline-flex cursor-pointer items-center gap-0 rounded-sm border border-gray-600 bg-white py-1 pl-2 |
4 |
| - text-base font-semibold text-gray-600 transition-colors hover:bg-gray-50 dark:border-gray-50 dark:bg-gray-950 dark:text-gray-100 dark:hover:bg-gray-900" |
| 3 | + class="dropdown-base hover:bg-gray-50 dark:hover:bg-gray-900 inline-flex cursor-pointer items-center gap-0 py-1 pl-2 text-sm font-semibold transition-colors" |
5 | 4 | data-heap-id="markdown-dropdown-toggle"
|
6 | 5 | >
|
7 | 6 | <span class="font-normal">Page options</span>
|
|
14 | 13 |
|
15 | 14 | <!-- Dropdown menu -->
|
16 | 15 | <div
|
17 |
| - class="absolute right-0 z-50 mt-1 w-56 origin-top-right rounded-sm border border-gray-300 bg-white p-2 text-sm text-black shadow-md [display:none] group-open:[display:block] dark:border-gray-100 dark:text-gray-100 dark:bg-gray-950" |
| 16 | + class="dropdown-base absolute right-0 z-50 mt-1 w-65 origin-top-right p-2 text-sm shadow-md [display:none] group-open:[display:block]" |
18 | 17 | data-heap-id="markdown-dropdown-menu"
|
19 | 18 | >
|
20 | 19 | <button
|
|
58 | 57 | <div class="text-base">Ask questions with Docs AI</div>
|
59 | 58 | </div>
|
60 | 59 | </button>
|
| 60 | + <button |
| 61 | + onclick="openInChatGPT()" |
| 62 | + data-heap-id="search-docs-ai-button" |
| 63 | + class="sub-button" |
| 64 | + > |
| 65 | + <span class="icon-svg mt-[2px] text-base leading-none"> |
| 66 | + {{ partial "icon" "/icons/openai.svg" }} |
| 67 | + </span> |
| 68 | + <div class="leading-tight"> |
| 69 | + <div class="text-base">Open in ChatGPT</div> |
| 70 | + </div> |
| 71 | + </button> |
| 72 | + |
| 73 | + <button |
| 74 | + onclick="openInClaude()" |
| 75 | + data-heap-id="search-docs-ai-button" |
| 76 | + class="sub-button" |
| 77 | + > |
| 78 | + <span class="icon-svg mt-[2px] text-base leading-none"> |
| 79 | + {{ partial "icon" "/icons/claude.svg" }} |
| 80 | + </span> |
| 81 | + <div class="leading-tight"> |
| 82 | + <div class="text-base">Open in Claude</div> |
| 83 | + </div> |
| 84 | + </button> |
| 85 | + |
61 | 86 | </div>
|
62 | 87 | </details>
|
63 | 88 |
|
|
106 | 131 | }
|
107 | 132 | }
|
108 | 133 |
|
| 134 | + function openInChatGPT() { |
| 135 | + fetch(getCurrentPlaintextUrl()) |
| 136 | + .then((response) => response.text()) |
| 137 | + .then((text) => { |
| 138 | + const encodedText = encodeURIComponent(text); |
| 139 | + const chatGPTUrl = `https://chat.openai.com/?q=${encodedText}`; |
| 140 | + window.open(chatGPTUrl, "_blank"); |
| 141 | + }) |
| 142 | + .catch((err) => { |
| 143 | + console.error("Error opening in ChatGPT:", err); |
| 144 | + }); |
| 145 | + } |
| 146 | + |
| 147 | + function openInClaude() { |
| 148 | + fetch(getCurrentPlaintextUrl()) |
| 149 | + .then((response) => response.text()) |
| 150 | + .then((text) => { |
| 151 | + const encodedText = encodeURIComponent(text); |
| 152 | + const claudeUrl = `https://claude.ai/new?q=${encodedText}`;https://claude.ai/new?q=%22hey%22 |
| 153 | + window.open(claudeUrl, '_blank'); |
| 154 | + }) |
| 155 | + .catch((err) => { |
| 156 | + console.error("Error opening in Claude:", err); |
| 157 | + }); |
| 158 | + } |
| 159 | + |
109 | 160 | document.addEventListener("click", function (event) {
|
110 | 161 | const dropdown = document.getElementById("markdownDropdown");
|
111 | 162 |
|
|
0 commit comments