Skip to content

Commit

Permalink
0.1.0.27 emoji/unicode icons
Browse files Browse the repository at this point in the history
  • Loading branch information
rostok committed Dec 9, 2020
1 parent e4e5c77 commit 8f53513
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
17 changes: 13 additions & 4 deletions commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "⮽",
name: "close",
takes: {},
description: "Close the current tab",
author: {},
icon: "",
homepage: "",
license: "",
preview: "Close the current tab",
Expand Down Expand Up @@ -567,10 +567,10 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "🗔",
name: "new-tab",
description: "Open a new tab (or window) with the specified URL",
author: {},
icon: "",
homepage: "",
license: "",
preview: "Open a new tab (or window) with the specified URL",
Expand All @@ -581,6 +581,7 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "🖨️",
name: "print",
description: "Print the current page",
preview: "Print the current page",
Expand Down Expand Up @@ -977,7 +978,7 @@ CmdUtils.CreateCommand({
CmdUtils.CreateCommand({
name: "calc",
description: desc = "evals math expressions",
icon: "https://png.icons8.com/metro/50/000000/calculator.png",
icon: "",
require: "https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.20.1/math.min.js",
preview: pr = function preview(previewBlock, {text:text}) {
if (text.trim()!='') {
Expand Down Expand Up @@ -1098,6 +1099,7 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "🔣",
names: ["urldecode"],
description: "urldecode",
author: {
Expand All @@ -1113,6 +1115,7 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "🔣",
names: ["urlencode"],
description: "urlencode",
author: {
Expand All @@ -1128,8 +1131,9 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "🙾",
name: "invert",
description: "Inverts all colors on current page<br><br>Based on <a target=_blank href=https://stackoverflow.com/questions/4766201/javascript-invert-color-on-all-elements-of-a-page>this</a>.",
description: "Inverts all colors on current page. Based on <a target=_blank href=https://stackoverflow.com/questions/4766201/javascript-invert-color-on-all-elements-of-a-page>this</a>.",
execute: function execute(){
chrome.tabs.executeScript({code:`
javascript: (
Expand Down Expand Up @@ -1408,6 +1412,7 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "🔌",
name: "extensions-chrome",
description: "opens chrome extensions tab",
execute: function execute(args) {
Expand Down Expand Up @@ -1470,6 +1475,7 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "🍪",
name: "cookies",
description: "gets cookies, press Enter to save file, filter by domain or * for all",
author: "Genuinous/rostok",
Expand Down Expand Up @@ -1573,6 +1579,7 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "🔑",
name: "pwd-chrome",
description: "opens chrome passwords tab",
execute: function execute(args) {
Expand All @@ -1591,6 +1598,7 @@ CmdUtils.CreateCommand({
});

CmdUtils.makeSearchCommand({
icon: "http://www.google.com/favicon.ico",
name: "site-search",
url: "https://google.com/search?q={QUERY}",
description: "searches current site with google and 'site:'",
Expand Down Expand Up @@ -1784,6 +1792,7 @@ CmdUtils.CreateCommand({
});

CmdUtils.CreateCommand({
icon: "💀",
name: "killcookies",
description: "kills cookies on current page",
author: { name: "rostok" },
Expand Down
7 changes: 5 additions & 2 deletions help.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ function showHelp(type) {
html += CmdUtils.CommandList.filter((c)=>{return (c.builtIn==true) == type}).map((c)=>{
var r = "<tr>";
r += "<!-- "+c.name+" -->";
var i = "";
if (c.icon) i = "<img height=16 src='"+c.icon+"'/>";
var i = c.icon || "";
if (i.length>3)
i = "<img height='16px' src='"+c.icon+"'/>";
else
i = "<span style='font-size:1em; height:16px;vertical-align:middle;margin:0px'>"+i+"</span>"
r += "<td>"+i+"</td>";
r += "<td>"+(c.builtIn?"":"<b>")+c.names.join(", ")+(c.builtIn?"":"</b>")+"</td>";
r += "<td>"+c.description+"</td>";
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"short_name": "UbiChr",
"homepage_url": "https://github.com/rostok/ubichr",
"author": "rostok",
"version": "0.1.0.26",
"version": "0.1.0.27",
"description": "Revived Ubiquity for Chrome",
"content_security_policy": "script-src 'self' 'unsafe-eval' https://maps.googleapis.com https://cdnjs.cloudflare.com; object-src 'self'",
"manifest_version": 2,
Expand Down
10 changes: 5 additions & 5 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ function ubiq_match_first_command(text) {

function _ubiq_image_error(elm) {
elm.src = 'res/spacer.png';
};
}

function ubiq_command_icon(c) {
var icon = CmdUtils.CommandList[c].icon;
if (!icon) {
icon = 'res/spacer.png';
}
var icon = CmdUtils.CommandList[c].icon || "";
if (icon.length>0 && icon.length < 3) return icon; // emojis/unicode
if (icon=="") icon = 'res/spacer.png';
icon = '<img src="' + icon + '" border="0" alt="" onerror="_ubiq_image_error(this);" align="absmiddle"> ';
return icon;
}
Expand Down

0 comments on commit 8f53513

Please sign in to comment.