diff --git a/.gitignore b/.gitignore
index 00cbbdf..75da508 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,3 +57,4 @@ typings/
# dotenv environment variables file
.env
+/nbproject/
\ No newline at end of file
diff --git a/client/PropertyInfoPlugin.js b/client/PropertyInfoPlugin.js
index 33b1d05..ce03c48 100644
--- a/client/PropertyInfoPlugin.js
+++ b/client/PropertyInfoPlugin.js
@@ -1,11 +1,22 @@
'use strict';
+var validUrl = require('valid-url');
var _ = require('lodash');
+var $ = require('jquery');
+const shell = window.require('electron').shell;
var elementOverlays = [];
var overlaysVisible = true;
-function PropertyInfoPlugin(eventBus, overlays, elementRegistry, editorActions) {
+function PropertyInfoPlugin(keyboard, eventBus, overlays, elementRegistry, editorActions) {
+
+ keyboard.addListener(function (key, modifiers) {
+ if (key === 27 && $('div.doc-val-hover.showingPopup').length !== 0) {
+ var element = $('div.doc-val-hover.showingPopup');
+ element.removeClass('showingPopup');
+ element.hide();
+ }
+ });
eventBus.on('shape.changed', function (event) {
_.defer(function () {
@@ -93,6 +104,33 @@ function PropertyInfoPlugin(eventBus, overlays, elementRegistry, editorActions)
var text = element.businessObject.documentation[0].text;
text = text.replace(/(?:\r\n|\r|\n)/g, '
');
+ var overlayHtml;
+ if (validUrl.isUri(text)) {
+ overlayHtml = $('
');
+
+ overlayHtml.click(function(e) {
+ shell.openExternal(text);
+ });
+ } else {
+ var overlayHtml = $('');
+
+ overlayHtml.click(function (e) {
+ var badge = $(this).siblings('.doc-val-hover');
+ if (badge.length == 0) {
+ $(this).after('' + text + '
');
+ badge = $(this).siblings('.doc-val-hover');
+ }
+ if ($(badge).is(":visible")) {
+ $(badge).hide();
+ $(badge).removeClass('showingPopup');
+ keyboard.unbind();
+ } else {
+ $(badge).show();
+ $(badge).addClass('showingPopup');
+ keyboard.bind(document);
+ }
+ });
+ }
elementOverlays[element.id].push(
overlays.add(element, 'badge', {
@@ -100,7 +138,7 @@ function PropertyInfoPlugin(eventBus, overlays, elementRegistry, editorActions)
top: 4,
right: 4
},
- html: ''+text+'
'
+ html: overlayHtml
}));
}
@@ -319,7 +357,7 @@ function PropertyInfoPlugin(eventBus, overlays, elementRegistry, editorActions)
}
-PropertyInfoPlugin.$inject = ['eventBus', 'overlays', 'elementRegistry', 'editorActions'];
+PropertyInfoPlugin.$inject = ['keyboard', 'eventBus', 'overlays', 'elementRegistry', 'editorActions'];
module.exports = {
__init__: ['clientPlugin'],
diff --git a/client/client-bundle.js b/client/client-bundle.js
index b496224..7796181 100644
--- a/client/client-bundle.js
+++ b/client/client-bundle.js
@@ -1,382 +1,10786 @@
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 &&
+ element.businessObject.documentation[0].text.trim() !== "" &&
+ element.type !== "label"){
+
+ var text = element.businessObject.documentation[0].text;
+ text = text.replace(/(?:\r\n|\r|\n)/g, '
');
+
+ var overlayHtml;
+ if (validUrl.isUri(text)) {
+ overlayHtml = $('');
+
+ overlayHtml.click(function(e) {
+ shell.openExternal(text);
+ });
+ } else {
+ var overlayHtml = $('');
+
+ overlayHtml.click(function (e) {
+ var badge = $(this).siblings('.doc-val-hover');
+ if (badge.length == 0) {
+ $(this).after('' + text + '
');
+ badge = $(this).siblings('.doc-val-hover');
+ }
+ if ($(badge).is(":visible")) {
+ $(badge).hide();
+ $(badge).removeClass('showingPopup');
+ keyboard.unbind();
+ } else {
+ $(badge).show();
+ $(badge).addClass('showingPopup');
+ keyboard.bind(document);
+ }
+ });
+ }
+
+ elementOverlays[element.id].push(
+ overlays.add(element, 'badge', {
+ position: {
+ top: 4,
+ right: 4
+ },
+ html: overlayHtml
+ }));
+ }
+
+ if (element.businessObject.extensionElements === undefined && element.businessObject.$instanceOf('bpmn:FlowNode')) {
+ return;
+ }
+
+ //Do not process the label of an element
+ if (element.type === "label") {
+ return;
+ }
+
+ if (!overlaysVisible) {
+ return;
+ }
+
+ var badges = [];
+
+ if(element.businessObject.$instanceOf('bpmn:Participant')) {
+ var extensionElements = element.businessObject.processRef.extensionElements;
+ var extensions = (extensionElements === undefined ? [] : extensionElements.values);
+
+ var type = '▶';
+ var background = 'badge-green';
+ if(element.businessObject.processRef.isExecutable === false) {
+ type = '❚❚';
+ background = 'badge-red';
+ }
+ badges.push({
+ badgeKey: 'isExecutable',
+ badgeSort: 0,
+ badgeType: type,
+ badgeBackground: background,
+ badgeLocation: 'left'
+ });
+ }
+ else {
+ var extensions = element.businessObject.extensionElements.values;
+ }
+
+
+ for (var extension in extensions) {
+ var type = '';
+ var background = '';
+ var location = 'right';
+ var sort = 0;
+ var key = '';
+
+ switch (extensions[extension].$type) {
+ case 'camunda:ExecutionListener':
+ if (extensions[extension].event === 'start') {
+ location = 'left';
+ key = 'camunda:ExecutionListener-start';
+ sort = 20;
+ } else {
+ location = 'right';
+ key = 'camunda:ExecutionListener-end';
+ sort = 70;
+ }
+ type = 'L';
+ background = 'badge-green';
+ break;
+ case 'camunda:Properties':
+ key = 'camunda:Properties';
+ sort = 80;
+ type = 'E';
+ background = 'badge-violet';
+ break;
+ case 'camunda:TaskListener':
+ if (extensions[extension].event === 'create' || extensions[extension].event === 'assignment') {
+ location = 'left';
+ key = 'camunda:TaskListener-start';
+ sort = 21;
+ } else {
+ location = 'right';
+ key = 'camunda:TaskListener-end';
+ sort = 71;
+ }
+ type = 'T';
+ background = 'badge-green';
+ break;
+ case 'camunda:InputOutput':
+ background = 'badge-blue';
+ break;
+ case 'camunda:In':
+ type = 'V';
+ key = 'camunda:In';
+ location = 'left';
+ sort = 10;
+ background = 'badge-blue';
+ break;
+ case 'camunda:Out':
+ type = 'V';
+ key = 'camunda:Out';
+ location = 'right';
+ sort = 60;
+ background = 'badge-blue';
+ break;
+ case 'camunda:Field':
+ key = 'camunda:Field';
+ sort = 90;
+ type = 'F';
+ background = 'badge-red';
+ break;
+ }
+
+ if (extensions[extension].$type === 'camunda:InputOutput') {
+ if (extensions[extension].hasOwnProperty('inputParameters') &&
+ extensions[extension].inputParameters.length > 0) {
+ location = 'left';
+ type = 'I';
+ key = 'camunda:InputOutput-input';
+ sort = 10;
+
+ badges.push({
+ badgeKey: key,
+ badgeSort: sort,
+ badgeType: type,
+ badgeBackground: background,
+ badgeLocation: location
+ });
+ }
+
+ if (extensions[extension].hasOwnProperty('outputParameters') &&
+ extensions[extension].outputParameters.length > 0) {
+ location = 'right';
+ type = 'O';
+ key = 'camunda:InputOutput-output';
+ sort = 60;
+
+ badges.push({
+ badgeKey: key,
+ badgeSort: sort,
+ badgeType: type,
+ badgeBackground: background,
+ badgeLocation: location
+ });
+ }
+ } else {
+ if (key !== '') {
+ badges.push({
+ badgeKey: key,
+ badgeSort: sort,
+ badgeType: type,
+ badgeBackground: background,
+ badgeLocation: location
+ });
+ }
+ }
+
+
+ }
+
+ addOverlays(badges, element);
+ }
+
+ function addOverlays(badgeList, element) {
+ var badges = [];
+
+ var leftCounter = 0;
+ var rightCounter = 0;
+
+
+ var sortedBadgeList = uniqBy(badgeList, function (item) {
+ return item.badgeKey
+ });
+
+ sortedBadgeList.sort(function (a, b) {
+ return a.badgeSort - b.badgeSort;
+ });
+
+ for (var overlayCounter in sortedBadgeList) {
+ var overlayObject = sortedBadgeList[overlayCounter];
+
+ if (overlayObject.badgeLocation === 'left') {
+ badges.push(overlays.add(element, 'badge', {
+ position: {
+ bottom: 0,
+ left: leftCounter
+ },
+ html: ''
+ }));
+ leftCounter = leftCounter + 16;
+ } else {
+ badges.push(overlays.add(element, 'badge', {
+ position: {
+ bottom: 0,
+ right: rightCounter
+ },
+ html: ''
+ }));
+ rightCounter = rightCounter + 16;
+ }
+
+ }
+
+ pushArray(elementOverlays[element.id],badges);
+ }
+
+ function uniqBy(a, key) {
+ var seen = {};
+ return a.filter(function (item) {
+ var k = key(item);
+ return seen.hasOwnProperty(k) ? false : (seen[k] = true);
+ })
+ }
+
+ function pushArray(list, other) {
+ var len = other.length;
+ var start = list.length;
+ list.length = start + len;
+ for (var i = 0; i < len; i++ , start++) {
+ list[start] = other[i];
+ }
+ }
+
+}
+
+PropertyInfoPlugin.$inject = ['keyboard', 'eventBus', 'overlays', 'elementRegistry', 'editorActions'];
+
+module.exports = {
+ __init__: ['clientPlugin'],
+ clientPlugin: ['type', PropertyInfoPlugin]
+};
+
+},{"jquery":4,"lodash":5,"valid-url":6}],2:[function(require,module,exports){
+var registerBpmnJSPlugin = require('camunda-modeler-plugin-helpers').registerBpmnJSPlugin;
+var plugin = require('./PropertyInfoPlugin');
+
+registerBpmnJSPlugin(plugin);
+
+},{"./PropertyInfoPlugin":1,"camunda-modeler-plugin-helpers":3}],3:[function(require,module,exports){
+/**
+ * Validate and register a client plugin.
+ *
+ * @param {Object} plugin
+ * @param {String} type
+ */
+function registerClientPlugin(plugin, type) {
+ var plugins = window.plugins || [];
+ window.plugins = plugins;
+
+ if (!plugin) {
+ throw new Error('plugin not specified');
+ }
+
+ if (!type) {
+ throw new Error('type not specified');
+ }
+
+ plugins.push({
+ plugin: plugin,
+ type: type
+ });
+}
+
+/**
+ * Validate and register a bpmn-js plugin.
+ *
+ * Example use:
+ *
+ * var registerBpmnJSPlugin = require('./camundaModelerPluginHelpers').registerBpmnJSPlugin;
+ * var module = require('./index');
+ *
+ * registerBpmnJSPlugin(module);
+ *
+ * @param {Object} plugin
+ */
+function registerBpmnJSPlugin(plugin) {
+ registerClientPlugin(plugin, 'bpmn.modeler.additionalModules');
+}
+
+module.exports.registerBpmnJSPlugin = registerBpmnJSPlugin;
+
+},{}],4:[function(require,module,exports){
+/*!
+ * jQuery JavaScript Library v3.3.1
+ * https://jquery.com/
+ *
+ * Includes Sizzle.js
+ * https://sizzlejs.com/
+ *
+ * Copyright JS Foundation and other contributors
+ * Released under the MIT license
+ * https://jquery.org/license
+ *
+ * Date: 2018-01-20T17:24Z
+ */
+( function( global, factory ) {
+
+ "use strict";
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+
+ // For CommonJS and CommonJS-like environments where a proper `window`
+ // is present, execute the factory and get jQuery.
+ // For environments that do not have a `window` with a `document`
+ // (such as Node.js), expose a factory as module.exports.
+ // This accentuates the need for the creation of a real `window`.
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info.
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
+// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
+// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
+// enough that all such attempts are guarded in a try block.
+"use strict";
+
+var arr = [];
+
+var document = window.document;
+
+var getProto = Object.getPrototypeOf;
+
+var slice = arr.slice;
+
+var concat = arr.concat;
+
+var push = arr.push;
+
+var indexOf = arr.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var fnToString = hasOwn.toString;
+
+var ObjectFunctionString = fnToString.call( Object );
+
+var support = {};
+
+var isFunction = function isFunction( obj ) {
+
+ // Support: Chrome <=57, Firefox <=52
+ // In some browsers, typeof returns "function" for HTML