PoweredByUtil.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. * This file must not be changed or exchanged.
  3. *
  4. * @see http://bpmn.io/license for more information.
  5. */
  6. import {
  7. domify,
  8. delegate as domDelegate
  9. } from 'min-dom';
  10. // inlined ../../resources/logo.svg
  11. var BPMNIO_LOGO_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960"><path fill="#fff" d="M960 60v839c0 33-27 61-60 61H60c-33 0-60-27-60-60V60C0 27 27 0 60 0h839c34 0 61 27 61 60z"/><path fill="#52b415" d="M217 548a205 205 0 0 0-144 58 202 202 0 0 0-4 286 202 202 0 0 0 285 3 200 200 0 0 0 48-219 203 203 0 0 0-185-128zM752 6a206 206 0 0 0-192 285 206 206 0 0 0 269 111 207 207 0 0 0 111-260A204 204 0 0 0 752 6zM62 0A62 62 0 0 0 0 62v398l60 46a259 259 0 0 1 89-36c5-28 10-57 14-85l99 2 12 85a246 246 0 0 1 88 38l70-52 69 71-52 68c17 30 29 58 35 90l86 14-2 100-86 12a240 240 0 0 1-38 89l43 58h413c37 0 60-27 60-61V407a220 220 0 0 1-44 40l21 85-93 39-45-76a258 258 0 0 1-98 1l-45 76-94-39 22-85a298 298 0 0 1-70-69l-86 22-38-94 76-45a258 258 0 0 1-1-98l-76-45 40-94 85 22a271 271 0 0 1 41-47z"/></svg>';
  12. var BPMNIO_LOGO_URL = 'data:image/svg+xml,' + encodeURIComponent(BPMNIO_LOGO_SVG);
  13. export var BPMNIO_IMG = '<img width="52" height="52" src="' + BPMNIO_LOGO_URL + '" />';
  14. function css(attrs) {
  15. return attrs.join(';');
  16. }
  17. var LIGHTBOX_STYLES = css([
  18. 'z-index: 1001',
  19. 'position: fixed',
  20. 'top: 0',
  21. 'left: 0',
  22. 'right: 0',
  23. 'bottom: 0'
  24. ]);
  25. var BACKDROP_STYLES = css([
  26. 'width: 100%',
  27. 'height: 100%',
  28. 'background: rgba(0,0,0,0.2)'
  29. ]);
  30. var NOTICE_STYLES = css([
  31. 'position: absolute',
  32. 'left: 50%',
  33. 'top: 40%',
  34. 'margin: 0 -130px',
  35. 'width: 260px',
  36. 'padding: 10px',
  37. 'background: white',
  38. 'border: solid 1px #AAA',
  39. 'border-radius: 3px',
  40. 'font-family: Helvetica, Arial, sans-serif',
  41. 'font-size: 14px',
  42. 'line-height: 1.2em'
  43. ]);
  44. var LIGHTBOX_MARKUP =
  45. '<div class="bjs-powered-by-lightbox" style="' + LIGHTBOX_STYLES + '">' +
  46. '<div class="backdrop" style="' + BACKDROP_STYLES + '"></div>' +
  47. '<div class="notice" style="' + NOTICE_STYLES + '">' +
  48. '<a href="http://bpmn.io" target="_blank" style="float: left; margin-right: 10px">' +
  49. BPMNIO_IMG +
  50. '</a>' +
  51. 'Web-based tooling for BPMN, DMN and CMMN diagrams ' +
  52. 'powered by <a href="http://bpmn.io" target="_blank">bpmn.io</a>.' +
  53. '</div>' +
  54. '</div>';
  55. var lightbox;
  56. export function open() {
  57. if (!lightbox) {
  58. lightbox = domify(LIGHTBOX_MARKUP);
  59. domDelegate.bind(lightbox, '.backdrop', 'click', function(event) {
  60. document.body.removeChild(lightbox);
  61. });
  62. }
  63. document.body.appendChild(lightbox);
  64. }