Skip to content

Commit

Permalink
Merge pull request #13 from aoout/4-moblie-support
Browse files Browse the repository at this point in the history
Mobile support implemented
  • Loading branch information
aoout authored Sep 6, 2024
2 parents 2caec48 + dc0a25f commit 52fe262
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "aoout",
"authorUrl": "https://github.com/aoout",

"isDesktopOnly": true,
"isDesktopOnly": false,
"minAppVersion": "0.16.0",
"version": "1.2.0"
"version": "1.2.1"
}
12 changes: 9 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "highlighter",
"version": "1.2.0",
"version": "1.2.1",
"description": "manage, display the highlights, and comment them in a elegant way.",
"main": "lib/main.js",
"license": "MIT",
Expand Down Expand Up @@ -39,6 +39,7 @@
"typescript": "^5.0.4"
},
"dependencies": {
"commit-and-tag-version": "^11.0.0"
"commit-and-tag-version": "^11.0.0",
"path-browserify": "^1.0.1"
}
}
4 changes: 3 additions & 1 deletion src/lib/HighlightBox.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { App, TFile } from "obsidian";
import { getHighlights, highlight } from "./getHighlights";

import * as path from "path";
import { PlatformPath } from "path/posix";
// eslint-disable-next-line @typescript-eslint/no-var-requires
export const path = (require("path-browserify").posix) as PlatformPath;
import { HighlightsBuilder } from "./highlightsBuilder";
import { HighlighterSettings } from "../settings/settings";

Expand Down
11 changes: 8 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import { HighlightBox } from "./lib/HighlightBox";
import { HighlighterModal } from "./HighlighterModal";
import { getHighlights, highlight } from "./lib/getHighlights";
import { HighlighterSettingsTab } from "./settings/settingsTab";
import path from "path";
import { PlatformPath } from "path/posix";
// eslint-disable-next-line @typescript-eslint/no-var-requires
export const path = (require("path-browserify").posix) as PlatformPath;
import { HighlightsBuilder } from "./lib/highlightsBuilder";
import { Popover } from "./popover";
import { Platform } from "obsidian";

export default class HighlighterPlugin extends Plugin {
settings: HighlighterSettings;
Expand Down Expand Up @@ -86,8 +89,10 @@ export default class HighlighterPlugin extends Plugin {
this.app.commands.executeCommandById("highlighter:update-highlights-file");
})
);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const popover = new Popover(this, this.getCommentByContent);
if (!Platform.isMobileApp) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const popover = new Popover(this, this.getCommentByContent);
}
}

async loadSettings() {
Expand Down
4 changes: 3 additions & 1 deletion src/popover.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { HoverPopover, MarkdownView } from "obsidian";
import { HighlightBox } from "./lib/HighlightBox";
import HighlighterPlugin from "./main";
import path from "path";
import { PlatformPath } from "path/posix";
// eslint-disable-next-line @typescript-eslint/no-var-requires
export const path = (require("path-browserify").posix) as PlatformPath;

export class Popover {
private plugin: HighlighterPlugin;
Expand Down

0 comments on commit 52fe262

Please sign in to comment.