From f15407d95bc8360b2e8b1f195beb156cc99e4fe8 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Tue, 2 Jan 2018 13:33:45 +0100 Subject: [PATCH] chore(Viewer): inline logo as SVG Make logo retina friendly and save 30 bytes. Closes #119 --- lib/Viewer.js | 4 ++-- lib/util/PoweredByUtil.js | 14 ++++++++------ resources/bpmnjs.png | Bin 633 -> 0 bytes resources/logo.svg | 1 + 4 files changed, 11 insertions(+), 8 deletions(-) delete mode 100644 resources/bpmnjs.png create mode 100644 resources/logo.svg diff --git a/lib/Viewer.js b/lib/Viewer.js index 4ad8e1d5..ffe26b67 100644 --- a/lib/Viewer.js +++ b/lib/Viewer.js @@ -483,7 +483,7 @@ var PoweredBy = require('./util/PoweredByUtil'), * @param {Element} container */ function addProjectLogo(container) { - var logoData = PoweredBy.BPMNIO_LOGO; + var img = PoweredBy.BPMNIO_IMG; var linkMarkup = '' + - '' + + img + ''; var linkElement = domify(linkMarkup); diff --git a/lib/util/PoweredByUtil.js b/lib/util/PoweredByUtil.js index 4dce5389..e443889f 100644 --- a/lib/util/PoweredByUtil.js +++ b/lib/util/PoweredByUtil.js @@ -10,13 +10,13 @@ var domify = require('min-dom/lib/domify'); var domDelegate = require('min-dom/lib/delegate'); -/* jshint -W101 */ -// inlined ../resources/bpmnjs.png -var logoData = module.exports.BPMNIO_LOGO = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC'; +// inlined ../../resources/logo.svg +var BPMNIO_LOGO_SVG = ''; -/* jshint +W101 */ +var BPMNIO_LOGO_URL = 'data:image/svg+xml;utf8,' + encodeURIComponent(BPMNIO_LOGO_SVG); +var BPMNIO_IMG = ''; function css(attrs) { return attrs.join(';'); @@ -57,7 +57,7 @@ var LIGHTBOX_MARKUP = '
' + '
' + '' + - '' + + BPMNIO_IMG + '' + 'Web-based tooling for BPMN, DMN and CMMN diagrams ' + 'powered by bpmn.io.' + @@ -80,4 +80,6 @@ function open() { document.body.appendChild(lightbox); } -module.exports.open = open; \ No newline at end of file +module.exports.open = open; + +module.exports.BPMNIO_IMG = BPMNIO_IMG; \ No newline at end of file diff --git a/resources/bpmnjs.png b/resources/bpmnjs.png deleted file mode 100644 index 2bc56c71356bfe52d511af3f1823acc0525f8a39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 633 zcmV-<0*3vGP)77oy)x5IpCcamQNK}kELzneAekfULbVKjUH7noRNu*s>6G}85DduQ zHM06ddNdeC1&4vU#|bRuE(2wiE|8;ChK0_vP-F`60g{wLZlJO~`!CR&?b*l$La`9m znlO|qGLYB3BL0%xT^Sj+BEp~~VUL5ht-(RL3Bgnn3+WK##eo4u}1z3s{%fRyr5R5p|#*AV<|W*ew(+*-mN;5!0gtH|!wbI@fO? z!*{OM$Utg0Su_KY#^eJe-azE`#2cs$BJH?9kokz*kuj1h>AMGPD?(HAnmMGef<-b6 z$3tsSR~i0CCsgSB_9p6Jicd|L`}CUEZka15caIozrOj*eHB0G(HA64tM}PqUQhJF6 TCyMw$00000NkvXXu0mjfYwjZS diff --git a/resources/logo.svg b/resources/logo.svg new file mode 100644 index 00000000..47f2492d --- /dev/null +++ b/resources/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file