Commit graph

48 commits

Author SHA1 Message Date
GnoxNahte
b987461c8e Fix #15. Embed Twitter profile timelines
Note: It doesn't work with non-verified accounts
2024-09-19 23:26:20 +08:00
GnoxNahte
0aa7b19d35 Fix #14. Don't embed web images 2024-09-19 23:24:42 +08:00
GnoxNahte
bac75210b3 Fix #10, Fix #11. Changed how the plugin embeds it, where the embed is placed.
Also changed and cleaned up some css for the alt img
2024-09-19 23:23:40 +08:00
GnoxNahte
5f6a947bd4 Don't embed x.com on Obsidian versions 1.7.0 and above
Obsidian changelog 1.7.0: https://obsidian.md/changelog/2024-08-08-desktop-v1.7.0/
2024-09-18 08:53:07 +08:00
GnoxNahte
46378a81b2 Fix #8 and other small changes to fallback embed
- If it's an error embed, just return the element without adding the placeholder.
- Add loading spinning animation.
- Fix opacity animation not working for fallback embed
2024-09-16 08:44:18 +08:00
GnoxNahte
ccc3e720c4 Update to version 1.2.0
This update fixes: https://github.com/GnoxNahte/obsidian-auto-embed/issues/7

This commit also fixes some minor bugs:
- enable twitter by default.
- limits embed width, mostly for small screens.
2024-09-07 15:35:09 +08:00
GnoxNahte
e9104a0d47 Add an option for suggesting to embed when pasting links. 2024-09-07 13:52:34 +08:00
GnoxNahte
c3cfd70668 Redo setting classes for embeds container and embeds
Clean up classes made from 87225856d6. It had duplicate classes on the container and embed.
This commit cleans up that. Now only the container has the class that identifies the type of embed

Also fix various css bugs caused by the container being the embed's parent
2024-09-07 13:51:04 +08:00
GnoxNahte
87225856d6 Add placeholder when loading and a click to load option 2024-09-05 23:27:14 +08:00
GnoxNahte
e0cae5611b Some foundation for preload options
Switching computers
2024-08-25 21:13:21 +08:00
GnoxNahte
04a21a21b3 Add options to disable selected websites and other minor bugs
Minor bugs & additions:
- When the user is on the line to edit the embed and presses down, it'll go straight to the next line instead of the side of the embed. (Changed display to inline). However, if the user presses right when they are on the last character of the line, it'll still go to the side of the embed (still not fixed)
- Add Imgur album support
2024-08-25 21:12:48 +08:00
GnoxNahte
4e27bb0e05 Fix #6
Also add a default height for tiktok to prevent cumulative layout shift
2024-07-18 20:32:48 +08:00
GnoxNahte
d0e18dd8bd Minor fix
Remove console output
2024-07-17 20:06:31 +08:00
GnoxNahte
7c9d25c9e9 Fix #5. Now the plugin will not embed any internal links/images 2024-07-17 20:05:45 +08:00
GnoxNahte
ca12faa75d Cache the size for embeds that have dynamic sizes (Imgur, Reddit, TikTok, Twitter/X)
Hopefully it should improve [Cumulative Layout Shift](https://web.dev/articles/cls) for embeds that were loaded previously.

Also fixes https://github.com/GnoxNahte/obsidian-auto-embed/issues/4#issuecomment-2226989583 which was caused by TikTok not sending the resize message sometimes, especially if the time between each request is very short.
2024-07-14 12:03:21 +08:00
GnoxNahte
b55a7c4a8e Add SoundCloud songs embeds #3 2024-07-13 19:49:36 +08:00
GnoxNahte
57224373f6 Fix reddit not resizing properly
- Remove auto size setting since it's not needed.
- Modify README to remove the reddit resizing warning and also other minor changes
- Added comments to separate the different websites in styles.css.
- Slightly clean up TikTok's embed code, following cleanup in Reddit's code
2024-07-13 19:21:38 +08:00
GnoxNahte
b47ca410b4 Add TikTok embeds. #4 2024-07-13 13:07:19 +08:00
GnoxNahte
ab264df823 Change setting for "Adding default embed link" to "Setting default embed link text"
Allows the user to set default text for the link.
2024-07-07 10:48:06 +08:00
GnoxNahte
fa2bb8a0ca Add alt text to default fallback bottom link 2024-06-28 23:31:27 +08:00
GnoxNahte
7e8c663fae Fix resizing bug for fallback embed 2024-06-28 20:08:45 +08:00
GnoxNahte
5c7a19baeb Adds an option to have a link below the default fallback embed 2024-06-08 20:38:53 +08:00
GnoxNahte
dbb55022e0 Add support for embedding Google Docs 2024-06-08 17:22:31 +08:00
GnoxNahte
cf2db1ee02 Remove unused code and add a catch when reddit can't be embedded 2024-06-08 15:56:51 +08:00
GnoxNahte
ad30a9b302 Don't override embeds when embedding image urls (urls ending with an image extension like .png or .jpg) 2024-06-08 15:21:40 +08:00
GnoxNahte
6a5cb910da Add size options for fallback embed 2024-05-04 17:47:28 +08:00
GnoxNahte
53f676a769 Add commands "Add embed" and "Mark to embed"
- Add Embed: Adds the markdown "![]()" and places the cursor inside the brackets. Similar to Obsidian's "Insert Markdown Link".
- Mark to embed: Add the markdown on the link the cursor is on to be embedded.
2024-04-12 12:53:51 +08:00
GnoxNahte
5e3cf5af35 Fix bug when options don't apply when embedding unsupported links 2024-04-05 22:56:36 +08:00
GnoxNahte
459399cb3a Update README.md 2024-04-05 22:55:56 +08:00
GnoxNahte
a5973be23e Minor changes 2024-03-31 21:17:32 +08:00
GnoxNahte
cc55a05899 Prevent normal links from embedding (links without "!")
Don't embed: [](link)
Embed: ![](link)
2024-03-29 18:28:52 +08:00
GnoxNahte
d08ec55a06 Fix issues from code review
https://github.com/obsidianmd/obsidian-releases/pull/3271#issuecomment-2023944561
2024-03-28 08:21:36 +08:00
GnoxNahte
ed887e9b50 Minor changes
- Remove isLiveViewSupported() because minAppVersion is 0.15.0 and legacy editor is removed.
- Spotify: Treat artists as playlists / albums
- Codepen: Allow hyphens in usernames
2024-03-26 21:13:51 +08:00
GnoxNahte
7c556c1e76 Remove unused console.log 2024-03-25 16:42:47 +08:00
GnoxNahte
c1886d8268 Shift preview-embed-modal.ts to src folder 2024-03-25 16:40:05 +08:00
GnoxNahte
de1a7faf7e Fix preview embed in setting not working. 2024-03-25 16:39:25 +08:00
GnoxNahte
58363e7aa3 Code Cleanup
Remove unused comments & code
2024-03-25 15:40:03 +08:00
GnoxNahte
d5520fd511 Update README.md with SupportedWebsiteList.md for all the embeds with examples. 2024-03-24 23:10:21 +08:00
GnoxNahte
d0ff3c66d8 Cleaning up code
- Add common iframe attributes in embedBase, avoiding duplicate code
- Partially fix reddit resizing bug by lazy loading it. Still occurs when there are multiple reddit embeds in the user's view
- support more imgur urls
- remove min-height from css to allow user-set heights
2024-03-21 15:23:41 +08:00
GnoxNahte
6acfe1cab2 Support more Imgur links
Previously, Imgur has 2 types, albums and posts. Need the correct embed url for imgur to show the content correctly.
2024-03-20 23:50:42 +08:00
GnoxNahte
428ee62aed Add support for getting options through alt text (Need code cleanup)
Users can put options in like
[w:75%, h:200px](https://example.com)
Also allows ignoring embeds (need some work to make it totally ignore though)
2024-03-20 23:49:34 +08:00
GnoxNahte
5e2167b131 add ignoring domains like youtube and twitter, so as to not conflict with Obsidian's embeds 2024-03-20 14:51:47 +08:00
GnoxNahte
f8f182128c Add a few fallback options when the plugin can't parse the url
Also add a setting for it.
2024-03-18 22:14:25 +08:00
GnoxNahte
80bc8bab5b Clean up some live preview code 2024-03-18 22:12:06 +08:00
GnoxNahte
b6269927f9 Change iframe CSS id to class
Since the HTML appears in both reading and preview mode, it interferes with the height adjustment. Users might also place multiple identical urls.
2024-03-18 22:09:53 +08:00
GnoxNahte
d636913110 Added base for live preview support. Need cleanup and testing 2024-03-17 21:00:38 +08:00
GnoxNahte
a9f862a1a2 Testing Live preview. (Not working yet, moving to another computer)
Mostly follows the code from https://docs.obsidian.md/Plugins/Editor/Decorations#State+fields
2024-03-15 21:34:22 +08:00
GnoxNahte
563a14a5d1 Shift files into the "src" folder for easier management 2024-03-11 22:36:22 +08:00