From 502746fac06d096388322608108047418f33746c Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 19 May 2020 00:34:30 -0400 Subject: [PATCH] more logo work --- scripts/Drawio_Update.ipynb | 13 ++++++++----- src/index.ts | 20 ++++++++++++-------- style/img/drawio.svg | 10 ++++++++++ 3 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 style/img/drawio.svg diff --git a/scripts/Drawio_Update.ipynb b/scripts/Drawio_Update.ipynb index 54db9af..00a9a47 100644 --- a/scripts/Drawio_Update.ipynb +++ b/scripts/Drawio_Update.ipynb @@ -109,7 +109,7 @@ { "data": { "text/markdown": [ - "> ### Packaging 1029 of 3399 files" + "> ### Packaging 1195 of 3399 files" ], "text/plain": [ "" @@ -125,7 +125,10 @@ " DIO_APP / \"js/PostConfig.js\",\n", " *(DIO_APP / \"math\").rglob(\"*.*\"),\n", " *(DIO_APP / \"mxgraph/images\").rglob(\"*.png\"),\n", - " *(DIO_APP / \"mxgraph/images\").rglob(\"*.gif\")\n", + " *(DIO_APP / \"mxgraph/images\").rglob(\"*.gif\"),\n", + " *(DIO_APP / \"images\").rglob(\"*.svg\"),\n", + " *(DIO_APP / \"images\").rglob(\"*.png\"),\n", + " *(DIO_APP / \"images\").rglob(\"*.gif\"),\n", "}\n", "show_files()" ] @@ -147,7 +150,7 @@ { "data": { "text/markdown": [ - "> ### Packaging 1025 of 3399 files" + "> ### Packaging 1191 of 3399 files" ], "text/plain": [ "" @@ -220,7 +223,7 @@ { "data": { "text/plain": [ - "91655" + "101380" ] }, "execution_count": 8, @@ -251,7 +254,7 @@ { "data": { "text/plain": [ - "145880" + "164569" ] }, "execution_count": 10, diff --git a/src/index.ts b/src/index.ts index 4d3c56b..faa411d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { Token } from "@lumino/coreutils"; +import { Contents } from "@jupyterlab/services"; +import { PathExt } from "@jupyterlab/coreutils"; + import { ILayoutRestorer, JupyterLab, @@ -24,24 +28,24 @@ import { ICommandPalette, } from "@jupyterlab/apputils"; -import { IFileBrowserFactory } from "@jupyterlab/filebrowser"; +import { LabIcon } from "@jupyterlab/ui-components"; -import { Contents } from "@jupyterlab/services"; +import { IFileBrowserFactory } from "@jupyterlab/filebrowser"; import { ILauncher } from "@jupyterlab/launcher"; import { IMainMenu } from "@jupyterlab/mainmenu"; -import { Token } from "@lumino/coreutils"; -import { LabIcon } from "@jupyterlab/ui-components"; import { DrawioWidget, DrawioFactory } from "./editor"; -import { PathExt } from "@jupyterlab/coreutils"; -import DRAWIO_ICON_SVG from "!!file-loader!./drawio/src/main/webapp/images/drawlogo-color.svg"; +import DRAWIO_ICON_SVG from "../style/img/drawio.svg"; const drawioIcon = new LabIcon({ name: "drawio:drawio", - svgstr: DRAWIO_ICON_SVG, + svgstr: DRAWIO_ICON_SVG.replace(/xmlns:.+".+?"/g, "").replace( + /viewBox=".*?"/, + 'viewBox="0 0 161.6 161.6"' + ), }); /** @@ -166,7 +170,7 @@ function activate( }); factory.widgetCreated.connect((sender, widget) => { - widget.title.icon = "jp-MaterialIcon jp-ImageIcon"; // TODO change + widget.title.icon = drawioIcon; // Notify the instance tracker if restore data needs to update. widget.context.pathChanged.connect(() => { diff --git a/style/img/drawio.svg b/style/img/drawio.svg new file mode 100644 index 0000000..6275825 --- /dev/null +++ b/style/img/drawio.svg @@ -0,0 +1,10 @@ + + + + + +