Skip to content

Commit

Permalink
Cleanup 201811 (#2)
Browse files Browse the repository at this point in the history
* Remove background.js

* Cleanup storage access

* Cleanup GUI elements

* Remove jQuery

* Update default settings

* Tabs permission no longer needed

* Cleanup and lint

* Cleanup menu management

* Cleanup settings
  • Loading branch information
chingc authored Nov 23, 2018
1 parent c842a9a commit 01b6337
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 305 deletions.
10 changes: 0 additions & 10 deletions background.js

This file was deleted.

4 changes: 0 additions & 4 deletions jquery-1.7.2.min.js

This file was deleted.

15 changes: 9 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"name": "Lookup Assistant",
"version": "2.0",
"manifest_version": 2,

"name": "Lookup Assistant",
"version": "2.1.0",

"description": "Lookup highlighted text.",
"icons": {
"16": "assets/icon_16.png",
"128": "assets/icon_128.png",
"48": "assets/icon_48.png",
"128": "assets/icon_128.png"
"16": "assets/icon_16.png"
},

"background": {
"scripts": ["scripts.js", "background.js"]
"scripts": ["scripts.js"]
},

"options_page": "options.html",
"permissions": ["contextMenus", "tabs"]

"permissions": ["contextMenus"]
}
35 changes: 10 additions & 25 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,19 @@
<head>
<meta charset="UTF-8" />
<title>Lookup Assistant Menu Editor</title>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="scripts.js"></script>
</head>

<body>
<h1>Lookup Assistant Menu Editor</h1>

<textarea id="editor" cols="120" rows="30"></textarea>
<textarea id="editor" cols="150" rows="30"></textarea>
<br />
<button id="save">Save</button>
<button id="load">Load</button>
<button id="exec">Exec</button>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<button id="wipe">Wipe</button>
<button id="default">Default</button>
<br /><br />
<span id="status"></span>

<hr />
<br /><br />

<h1>Help</h1>

Expand All @@ -33,10 +27,6 @@ <h2>I. Buttons</h2>

<li><b>Load:</b> Load settings from local storage.<br />&nbsp;</li>

<li><b>Exec:</b> Execute the settings shown in the editor without saving.<br />&nbsp;</li>

<li><b>Wipe:</b> Delete settings from local storage.<br />&nbsp;</li>

<li><b>Default:</b> Restore default settings.<br />&nbsp;</li>
</ol>

Expand Down Expand Up @@ -67,7 +57,6 @@ <h2>II. Editing</h2>
<pre>
{
"type": "link",
"open": "tab",
"title": "Google",
"address": "http://www.google.com/search?q=%s"
}
Expand All @@ -82,10 +71,6 @@ <h2>II. Editing</h2>
of course, use "link" for links. However, this key is optional. The default behavior
is "link" if it's omitted.
<br /><br />
"open": This determines how Lookup Assistant behaves when one of its links is clicked.
It can be one of three values: "tab", "window", or "incognito". This key is optional.
The default type is "tab" if it's omitted.
<br /><br />
"title": The name for this link.
<br /><br />
"address": The URL with a search token (%s). The search token will ultimately be replaced
Expand All @@ -103,14 +88,14 @@ <h2>II. Editing</h2>
{
"type": "menu",
"title": "Additional Links",
"entry": []
"entries": []
}
</pre>
Regarding braces, quotes, and commas, the same rules apply here as they did with the link
type. The "type" and "title" keys also work the same way as they did for links, except
"type" is not optional here.
<br /><br />
The new key is "entry", and the value is a pair of brackets. What's placed between them
The new key is "entries", and the value is a pair of brackets. What's placed between them
will determine what appears in this menu. Links, separators, and even additional menus
are all valid. See the link and separator section for proper formatting.<br />&nbsp;</li>

Expand All @@ -129,7 +114,7 @@ <h2>III. Examples</h2>
<li><b>One Link:</b>
<pre>
[
{ "type": "link", "open": "tab", "title": "Google", "address": "http://www.google.com/search?q=%s" }
{ "type": "link", "title": "Google", "address": "http://www.google.com/search?q=%s" }
]
</pre></li>

Expand All @@ -151,7 +136,7 @@ <h2>III. Examples</h2>
{ "title": "Google", "address": "http://www.google.com/search?q=%s" },
{ "title": "Google Images", "address": "http://www.google.com/search?tbm=isch&amp;q=%s" },
{ "type": "separator" },
{ "type": "menu", "title": "Menu 1", "entry":
{ "type": "menu", "title": "Menu 1", "entries":
[
{ "title": "Amazon", "address": "http://www.amazon.com/s/field-keywords=%s" },
{ "title": "eBay", "address": "http://www.ebay.com/sch/i.html?_nkw=%s" }
Expand All @@ -163,9 +148,9 @@ <h2>III. Examples</h2>
<li><b>One Link + Menu with a Menu, Each with One Link:</b>
<pre>
[
{ "type": "menu", "title": "Menu 1", "entry":
{ "type": "menu", "title": "Menu 1", "entries":
[
{ "type": "menu", "title": "Menu 2", "entry":
{ "type": "menu", "title": "Menu 2", "entries":
[
{ "title": "Amazon", "address": "http://www.amazon.com/s/field-keywords=%s" }
]
Expand Down Expand Up @@ -203,7 +188,7 @@ <h2>IV. Errors</h2>
<li>Types are also separated by a comma.</li>
<li>No comma after the last key-value pair.</li>
<li>No comma after the last type.</li>
<li>Menu entry uses brackets [], not braces {} and not parentheses ().</li>
<li>Menu entries uses brackets [], not braces {} and not parentheses ().</li>
</ul>
<br />
A good way to avoid these errors is to make small incremental changes and test them with
Expand All @@ -220,7 +205,7 @@ <h2>IV. Errors</h2>

<hr />

<p>Copyright (c) 2012, <a href="http://smwst.tumblr.com/tagged/lookup-assistant" target="_blank">Ching Chow</a></p>
<p>Copyright (c) 2018, <a href="https://github.com/chingc/Lookup-Assistant" target="_blank">Ching Chow</a></p>
</body>

</html>
Loading

0 comments on commit 01b6337

Please sign in to comment.