Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan McQuen <[email protected]>
  • Loading branch information
ryanpcmcquen committed Dec 19, 2020
0 parents commit a4183b8
Show file tree
Hide file tree
Showing 10 changed files with 490 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
npm-debug.log
node_modules
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"arrowParens": "always",
"semi": true,
"tabWidth": 4
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 0.1.0 - First Release

- Every feature added
- Every bug fixed
373 changes: 373 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions keymaps/wiki_links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"body": {
"ctrl-alt-o": "wiki_links:toggle"
}
}
18 changes: 18 additions & 0 deletions lib/wiki_links.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use babel";

import WikiLinksMessageDialog from "./wiki_links_message_dialog";

module.exports = {
activate() {
inkdrop.components.registerClass(WikiLinksMessageDialog);
inkdrop.layouts.addComponentToLayout("modal", "WikiLinksMessageDialog");
},

deactivate() {
inkdrop.layouts.removeComponentFromLayout(
"modal",
"WikiLinksMessageDialog"
);
inkdrop.components.deleteClass(WikiLinksMessageDialog);
},
};
41 changes: 41 additions & 0 deletions lib/wiki_links_message_dialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"use babel";

import * as React from "react";
import { CompositeDisposable } from "event-kit";

export default class WikiLinksMessageDialog extends React.Component {
componentWillMount() {
// Events subscribed to in Inkdrop's system can be easily cleaned up with a CompositeDisposable
this.subscriptions = new CompositeDisposable();

// Register command that toggles this dialog
this.subscriptions.add(
inkdrop.commands.add(document.body, {
"wiki_links:toggle": () => this.toggle(),
})
);
}

componentWillUnmount() {
this.subscriptions.dispose();
}

render() {
const { MessageDialog } = inkdrop.components.classes;
return (
<MessageDialog ref="dialog" title="WikiLinks">
WikiLinks was toggled!
</MessageDialog>
);
}

toggle() {
console.log("WikiLinks was toggled!");
const { dialog } = this.refs;
if (!dialog.isShown) {
dialog.showDialog();
} else {
dialog.dismissDialog();
}
}
}
26 changes: 26 additions & 0 deletions menus/wiki_links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"context-menu": {
".CodeMirror": [
{
"label": "Toggle wiki_links",
"command": "wiki_links:toggle"
}
]
},
"menu": [
{
"label": "Plugins",
"submenu": [
{
"label": "wiki_links",
"submenu": [
{
"label": "Toggle",
"command": "wiki_links:toggle"
}
]
}
]
}
]
}
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "wiki_links",
"main": "./lib/wiki_links",
"version": "0.1.0",
"description": "Bring wiki style links to Inkdrop.",
"keywords": [],
"repository": "https://github.com/ryanpcmcquen/inkdrop_wiki_links",
"license": "MPL-2.0",
"engines": {
"inkdrop": "^5.x"
},
"dependencies": {}
}
2 changes: 2 additions & 0 deletions styles/wiki_links.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.wiki_links {
}

0 comments on commit a4183b8

Please sign in to comment.