Skip to content

Commit

Permalink
Support Mobile Dyslexic Add-on (fixes #145)
Browse files Browse the repository at this point in the history
  • Loading branch information
OctoNezd committed May 2, 2024
1 parent 0413670 commit 099c28c
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 98 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@
},
"homepage": "https://github.com/OctoNezd/old-reddit-mobile#readme",
"dependencies": {
"@fontsource/roboto": "^5.0.12",
"@fontsource/roboto": "^5.0.13",
"@types/webextension-polyfill": "^0.10.7",
"crx3": "^1.1.3",
"dashjs": "^4.7.4",
"immutable": "^5.0.0-beta.5",
"lightgallery": "^2.7.2",
"localforage": "^1.10.0",
"material-symbols": "^0.17.1",
"swiped-events": "^1.1.9",
"material-symbols": "^0.17.4",
"swiped-events": "^1.2.0",
"web-ext": "^7.11.0"
},
"devDependencies": {
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.10.0",
"css-loader": "^7.1.1",
"dotenv": "^16.4.5",
"dotenv-cli": "^7.4.1",
"generate-json-webpack-plugin": "^2.0.0",
Expand All @@ -58,11 +58,11 @@
"npm-run-all": "^4.1.5",
"sass": "^1.72.0",
"sass-loader": "^14.1.1",
"style-loader": "^3.3.4",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
"typescript": "^5.4.3",
"video.js": "^8.11.8",
"webextension-polyfill": "^0.10.0",
"typescript": "^5.4.5",
"video.js": "^8.12.0",
"webextension-polyfill": "^0.11.0",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
Expand Down
4 changes: 2 additions & 2 deletions src/features/iconRegulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class IconSizePreview extends SettingOption {
<p class="ol-set-title ol-setting">Preview: </p>
<ul class="flat-list buttons">
<li class="ol-vote-container">
<a class="ol-upvote" href="javascript:void(0)">arrow_circle_up</a
><p class="ol-votecount">42</p><a class="ol-downvote" href="javascript:void(0)">arrow_circle_down</a>
<a class="ol-upvote ol-icon" href="javascript:void(0)">arrow_circle_up</a
><p class="ol-votecount">42</p><a class="ol-downvote ol-icon" href="javascript:void(0)">arrow_circle_down</a>
</li>
<li class="first">
<a
Expand Down
4 changes: 2 additions & 2 deletions src/features/posts/reimplementVotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class ReimplementVotes extends OLFeature {
voteContainer.className = "ol-vote-container";

const upVote = document.createElement("a");
upVote.classList.add("ol-upvote");
upVote.classList.add("ol-upvote", "ol-icon");
upVote.innerText = "arrow_circle_up";
upVote.href = "javascript:void(0)";
upVote.addEventListener("click", (e) => {
Expand All @@ -109,7 +109,7 @@ export default class ReimplementVotes extends OLFeature {
voteCount.classList.add("ol-votecount");

const downVote = document.createElement("a");
downVote.classList.add("ol-downvote");
downVote.classList.add("ol-downvote", "ol-icon");
downVote.innerText = "arrow_circle_down";
downVote.href = "javascript:void(0)";
downVote.addEventListener("click", (e) => {
Expand Down
31 changes: 14 additions & 17 deletions src/features/sidebar/userSidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function createSidebarItem(
item.prepend(img);
} else {
const iconEl = document.createElement("span");
iconEl.classList.add("material-symbols-outlined");
iconEl.classList.add("material-symbols-outlined", "ol-icon");
iconEl.innerText = icon || "forum";
item.appendChild(iconEl);
}
Expand Down Expand Up @@ -78,11 +78,14 @@ async function setupMultireddits(parentContainer: HTMLDivElement) {
}
}

async function setupSubreddits(parentContainer: HTMLDivElement, force?: boolean) {
async function setupSubreddits(
parentContainer: HTMLDivElement,
force?: boolean
) {
const container = document.createElement("span");
container.id = "oldlander-subredditlist";
const refreshButton = document.createElement("button");
refreshButton.classList.add("material-symbols-outlined");
refreshButton.classList.add("material-symbols-outlined", "ol-icon");
refreshButton.innerText = "refresh";
const refreshHandler = () => {
refreshButton.removeEventListener("click", refreshHandler);
Expand All @@ -95,22 +98,16 @@ async function setupSubreddits(parentContainer: HTMLDivElement, force?: boolean)
container.appendChild(document.createElement("hr"));
container.appendChild(createSidebarSubheading("Subreddits", refreshButton));
container.appendChild(
createSidebarItem(
"Random",
"/r/random",
"shuffle",
false,
["oldlander-subreddit", "oldlander-random"]
)
createSidebarItem("Random", "/r/random", "shuffle", false, [
"oldlander-subreddit",
"oldlander-random",
])
);
container.appendChild(
createSidebarItem(
"Random NSFW",
"/r/randnsfw",
"18_up_rating",
false,
["oldlander-subreddit", "oldlander-randNsfw"]
)
createSidebarItem("Random NSFW", "/r/randnsfw", "18_up_rating", false, [
"oldlander-subreddit",
"oldlander-randNsfw",
])
);
const subs = await getSubreddits(!!force);
for (const subreddit of subs) {
Expand Down
6 changes: 3 additions & 3 deletions src/header/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function makeSortSelector(header: HTMLDivElement) {
}
const btn = document.createElement("button");
btn.id = "sortsel";
btn.classList.add("material-symbols-outlined");
btn.classList.add("material-symbols-outlined", "ol-icon");
btn.innerText = "sort";
header.querySelector(".aux-buttons")!.appendChild(btn);
btn.onclick = () => {
Expand All @@ -106,7 +106,7 @@ async function addSubSidebarButton(header: HTMLDivElement) {

const btn = document.createElement("button");
btn.innerText = "info";
btn.classList.add("material-symbols-outlined");
btn.classList.add("material-symbols-outlined", "ol-icon");
btn.onclick = () => {
const evt = new Event("toggleSub");
document.body.dispatchEvent(evt);
Expand All @@ -117,7 +117,7 @@ async function addSubSidebarButton(header: HTMLDivElement) {
function addUserSidebarButton(header: HTMLDivElement) {
const btn = document.createElement("button");
btn.innerText = "menu";
btn.classList.add("material-symbols-outlined");
btn.classList.add("material-symbols-outlined", "ol-icon");
btn.id = "user-sidebar-open";
btn.onclick = () => {
const evt = new Event("toggleUser");
Expand Down
Loading

0 comments on commit 099c28c

Please sign in to comment.