Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix broken embedded videos and bump to 1.1.5 #293

Merged
merged 8 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,75 @@ commit?=1
newversion?=
no_tag?=0

tag:
help:
@grep -E '^[1-9a-zA-Z_-]+:.*?## .*$$|(^#--)' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m %-43s\033[0m %s\n", $$1, $$2}' \
| sed -e 's/\[32m #-- /[33m/'


tag: ## make a tag, pass tag=some_tag
@echo "making tags: [$(tag)]"
@if [ -n "$(tag)" ] && [ "$(tag)" != "no-tag" ]; then \
git tag "$(tag)"; \
git tag | grep -e "$(tag)"; \
fi

push-tag:
push-tag: ## push a tag from bump.txt to remote, pass tag=different-tag to use a different tag, pass remote=origin to use a different remote
@tag="$$(make read-bump -s)"; \
echo "branch:$(remote) tag:[$${tag}]"; \
git push "$(remote)" "$${tag}"; \

tag-bump:
tag-bump: ## make a tag using the version in bump.txt
@make tag tag="$$(make read-bump -s)"

tag-bump-undo:
tag-bump-undo: ## delete the tag that matches the bump.txt version
@git tag -d "$$(make read-bump -s)"

commit-bump:
commit-bump: ## commit bump.txt if it has changed, pass commit=0 to not commit, commit=1 to commit
@newversion="$$(make read-bump)"; \
lastCommit="$$(make read-last-commit)"; \
if [ "$(commit)" = "1" ] && [ -n "$${newversion}" ]; then \
git add bump.txt; \
git commit -m "Chore(commit-bump): new bump target: $${newversion}"; \
fi

read-last-commit:
read-last-commit: ## output the last commit message if it was a bump commit
@echo "$$(git log --oneline -n1 | grep "commit-bump")"

commit-bump-undo:
commit-bump-undo: ## undo last commit if it was a bump commit else do nothing
@lastCommit="$$(make read-last-commit)"; \
echo "$${lastCommit}"; \
if git log --oneline -n1 | grep -e "commit-bump"; then\
git reset HEAD~1; \
fi

write-version:
write-version: ## write version to bump.txt and commit, pass commit=0 to not commit, commit=1 to commit
@newversion="$(major).$(minor).$(patch)"; \
echo "$${newversion}" > bump.txt; \
make commit-bump newversion="$(newversion)"

bump-patch:
bump-patch: ## bump the patch verison
@version="$$(add_patch=1 make read-version)"; echo "bumping patch $${version}"; \
make write-version $${version}

bump-minor:
bump-minor: ## bump the minor verison
@version="$$(add_min=1 mut_patch=0 make read-version)"; echo "bumping patch $${version}"; \
make write-version $${version}

bump-major:
bump-major: ## bump the major verison
@version="$$(add_maj=1 mut_min=0 mut_patch=0 make read-version)"; echo "bumping patch $${version}"; \
make write-version $${version}

bump:
bump: ## bump patch version with a git tag , input no_tag=1 to not tag, no_tag=0 to tag
@make bump-patch;
@if [ "$(no_tag)" = "0" ]; then \
make tag-bump; \
fi

check-bump:
check-bump: ## output the tag that matches the bump.txt version
@git tag | grep "$$(make read-bump)"

read-version:
read-version: ## read version from bump.txt
@awk -F . '{print "major="($$1 + $(add_maj)) * $(mut_maj) " minor="($$2 + $(add_min)) * $(mut_min) " patch="($$3 + $(add_patch)) * $(mut_patch)}' bump.txt

version:
Expand All @@ -85,5 +91,5 @@ read-bump:
@cat bump.txt


build@latest:
build@latest: ## build latest using version in bump.txt
. action.sh
2 changes: 1 addition & 1 deletion bump.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.4
1.1.5
13 changes: 13 additions & 0 deletions src/contents/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ export const config: PlasmoContentScript = {
run_at: 'document_end',
};

export const getRootContainer = () => {
const rootContainer = document.createElement('div');
document.querySelector('html').appendChild(rootContainer);
['position:absolute', 'bottom:0px', 'left:0px', 'height:0px', 'z-index:5']
.map((style) => style.split(':'))
.forEach(([key, val]) => (rootContainer.style[key] = val));
return createShadowRoot(rootContainer);
};

export const createShadowRoot = (shadowHost) => {
return shadowHost.attachShadow({ mode: 'open' });
};

const { setAttribute, setProperty, setSaccadesStyle, getAttribute } = documentParser.makeHandlers(document);

const contentLogStyle = 'background-color: pink';
Expand Down