eligius 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -436,7 +436,11 @@ function prepareValueForSerialization(value) {
436
436
  return value.map(prepareValueForSerialization);
437
437
  } else if (value instanceof $__default["default"]) {
438
438
  return 'jQuery object';
439
- } else if (typeof value === 'object') {
439
+ } else if (value !== null && typeof value === 'object') {
440
+ if (value.constructor.toString().substring(0, 5) === 'class') {
441
+ return 'Complex object';
442
+ }
443
+
440
444
  return Object.fromEntries(Object.entries(value).map(function (_ref) {
441
445
  var propName = _ref[0],
442
446
  propValue = _ref[1];
@@ -1252,6 +1256,7 @@ var LabelController = /*#__PURE__*/function () {
1252
1256
  this.operationData = null;
1253
1257
  this.labelData = {};
1254
1258
  this.name = 'LabelController';
1259
+ this.requestLabelDataBound = void 0;
1255
1260
  }
1256
1261
 
1257
1262
  var _proto = LabelController.prototype;
@@ -1260,6 +1265,13 @@ var LabelController = /*#__PURE__*/function () {
1260
1265
  this.operationData = Object.assign({}, operationData);
1261
1266
  };
1262
1267
 
1268
+ _proto.setLabelId = function setLabelId(newLabelId) {
1269
+ if (this.requestLabelDataBound) {
1270
+ this.requestLabelDataBound(newLabelId);
1271
+ this.setLabel();
1272
+ }
1273
+ };
1274
+
1263
1275
  _proto.attach = function attach(eventbus) {
1264
1276
  var _this = this;
1265
1277
 
@@ -1270,13 +1282,20 @@ var LabelController = /*#__PURE__*/function () {
1270
1282
  eventbus.broadcast(TimelineEventNames.REQUEST_CURRENT_LANGUAGE, [function (language) {
1271
1283
  _this.currentLanguage = language;
1272
1284
  }]);
1273
- eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTION, [this.operationData.labelId, function (labelCollection) {
1274
- _this.createTextDataLookup(labelCollection);
1275
- }]);
1285
+ this.requestLabelDataBound = this.requestLabelData.bind(this, eventbus);
1286
+ this.requestLabelDataBound(this.operationData.labelId);
1276
1287
  this.setLabel();
1277
1288
  this.listeners.push(eventbus.on(TimelineEventNames.LANGUAGE_CHANGE, this.handleLanguageChange.bind(this)));
1278
1289
  };
1279
1290
 
1291
+ _proto.requestLabelData = function requestLabelData(eventbus, labelId) {
1292
+ var _this2 = this;
1293
+
1294
+ eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTION, [labelId, function (labelCollection) {
1295
+ _this2.createTextDataLookup(labelCollection);
1296
+ }]);
1297
+ };
1298
+
1280
1299
  _proto.setLabel = function setLabel() {
1281
1300
  if (this.currentLanguage) {
1282
1301
  var _this$operationData;
@@ -1287,8 +1306,9 @@ var LabelController = /*#__PURE__*/function () {
1287
1306
 
1288
1307
  _proto.detach = function detach(_eventbus) {
1289
1308
  this.listeners.forEach(function (func) {
1290
- func();
1309
+ return func();
1291
1310
  });
1311
+ this.requestLabelDataBound = undefined;
1292
1312
  };
1293
1313
 
1294
1314
  _proto.handleLanguageChange = function handleLanguageChange(code) {
@@ -1297,10 +1317,10 @@ var LabelController = /*#__PURE__*/function () {
1297
1317
  };
1298
1318
 
1299
1319
  _proto.createTextDataLookup = function createTextDataLookup(data) {
1300
- var _this2 = this;
1320
+ var _this3 = this;
1301
1321
 
1302
1322
  data.forEach(function (d) {
1303
- _this2.labelData[d.languageCode] = d.label;
1323
+ _this3.labelData[d.languageCode] = d.label;
1304
1324
  });
1305
1325
  };
1306
1326
 
@@ -1729,6 +1749,7 @@ var ProgressbarController = /*#__PURE__*/function () {
1729
1749
  this.selectedElement = null;
1730
1750
  this.textElement = null;
1731
1751
  this.detachers = [];
1752
+ this.duration = 0;
1732
1753
  }
1733
1754
 
1734
1755
  var _proto = ProgressbarController.prototype;
@@ -1739,17 +1760,20 @@ var ProgressbarController = /*#__PURE__*/function () {
1739
1760
  };
1740
1761
 
1741
1762
  _proto.attach = function attach(eventbus) {
1742
- var _this$selectedElement,
1743
- _this = this;
1763
+ var _this = this,
1764
+ _this$selectedElement;
1744
1765
 
1745
1766
  this.detachers.push(eventbus.on(TimelineEventNames.POSITION_UPDATE, this.positionUpdateHandler.bind(this)));
1746
- var clickHandler = this.clickHandler.bind(this);
1767
+ eventbus.broadcast(TimelineEventNames.DURATION_REQUEST, [function (duration) {
1768
+ return _this.duration = duration;
1769
+ }]);
1770
+ var clickHandler = this.clickHandler.bind(this, eventbus);
1747
1771
  (_this$selectedElement = this.selectedElement) == null ? void 0 : _this$selectedElement.on('click', clickHandler);
1748
1772
  this.detachers.push(function () {
1749
1773
  var _this$selectedElement2;
1750
1774
 
1751
- return (_this$selectedElement2 = _this.selectedElement) == null ? void 0 : _this$selectedElement2.off('click');
1752
- }, clickHandler);
1775
+ return (_this$selectedElement2 = _this.selectedElement) == null ? void 0 : _this$selectedElement2.off('click', clickHandler);
1776
+ });
1753
1777
  };
1754
1778
 
1755
1779
  _proto.detach = function detach(_eventbus) {
@@ -1768,7 +1792,14 @@ var ProgressbarController = /*#__PURE__*/function () {
1768
1792
  (_this$textElement = this.textElement) == null ? void 0 : _this$textElement.text(Math.floor(percentage) + "%");
1769
1793
  };
1770
1794
 
1771
- _proto.clickHandler = function clickHandler() {};
1795
+ _proto.clickHandler = function clickHandler(eventbus, event) {
1796
+ var element = event.target;
1797
+ var rect = element.getBoundingClientRect();
1798
+ var x = event.clientX - rect.left; //x position within the element.
1799
+
1800
+ var percentage = 100 / rect.width * x;
1801
+ eventbus.broadcast(TimelineEventNames.SEEK_REQUEST, [Math.floor(this.duration / 100 * percentage)]);
1802
+ };
1772
1803
 
1773
1804
  return ProgressbarController;
1774
1805
  }();
@@ -2054,9 +2085,8 @@ var ctrls = {
2054
2085
  };
2055
2086
 
2056
2087
  /**
2057
- * EligiusEngine, this is where the magic happens. The engine is responsible for starting and stopping
2058
- * the given timeline provider and triggering the actions associated with it.
2059
- * ...
2088
+ * This is where the magic happens. The engine is responsible for starting and stopping
2089
+ * the given timeline provider and triggering the actions associated with the positions along the timeline.
2060
2090
  */
2061
2091
 
2062
2092
  var EligiusEngine = /*#__PURE__*/function () {
@@ -2075,6 +2105,11 @@ var EligiusEngine = /*#__PURE__*/function () {
2075
2105
  this.timelineProviders = timelineProviders;
2076
2106
  this.languageManager = languageManager;
2077
2107
  }
2108
+ /**
2109
+ * Initializes the engine by creating the HTML layout and the first time line
2110
+ * by executing its initActions.
2111
+ */
2112
+
2078
2113
 
2079
2114
  var _proto = EligiusEngine.prototype;
2080
2115
 
@@ -2194,9 +2229,20 @@ var EligiusEngine = /*#__PURE__*/function () {
2194
2229
  }
2195
2230
 
2196
2231
  return _cleanUp;
2197
- }();
2198
-
2199
- _proto.destroy = /*#__PURE__*/function () {
2232
+ }()
2233
+ /**
2234
+ * Cleans up all the necessary parts that the engine initialized.
2235
+ * - It ends the currently active operations and the init actions.
2236
+ * - It removes all its eventbus listeners, handlers and interceptors.
2237
+ * - It destroys all of its timeline providers
2238
+ * - It empties the HTML element indicated by the containerSelector configuration property.
2239
+ *
2240
+ */
2241
+ ;
2242
+
2243
+ _proto.destroy =
2244
+ /*#__PURE__*/
2245
+ function () {
2200
2246
  var _destroy = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
2201
2247
  var containerSelector, container;
2202
2248
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
@@ -2297,13 +2343,11 @@ var EligiusEngine = /*#__PURE__*/function () {
2297
2343
  }
2298
2344
 
2299
2345
  if (isFinite(end)) {
2300
- var _timeLineAction$id2;
2301
-
2302
2346
  var timelineEndPositions = this._initializeTimelinePosition(this._timeLineActionsLookup[uri], end);
2303
2347
 
2304
2348
  var endMethod = timeLineAction.end.bind(timeLineAction);
2305
2349
 
2306
- if ((_timeLineAction$id2 = timeLineAction.id) != null && _timeLineAction$id2.length) {
2350
+ if (!timeLineAction.id) {
2307
2351
  endMethod.id = timeLineAction.id;
2308
2352
  }
2309
2353
 
@@ -3393,10 +3437,8 @@ var calc$1 = function calc(operationData) {
3393
3437
  var _operationData = operationData,
3394
3438
  left = _operationData.left,
3395
3439
  right = _operationData.right,
3396
- operator = _operationData.operator,
3397
- _operationData$proper = _operationData.propertyName,
3398
- propertyName = _operationData$proper === void 0 ? 'calculationResult' : _operationData$proper;
3399
- operationData[propertyName] = calcFunctions[operator](+left, +right);
3440
+ operator = _operationData.operator;
3441
+ operationData.calculationResult = calcFunctions[operator](+left, +right);
3400
3442
  return operationData;
3401
3443
  };
3402
3444
 
@@ -3441,17 +3483,14 @@ var createElement$1 = function createElement(operationData) {
3441
3483
  var _operationData = operationData,
3442
3484
  elementName = _operationData.elementName,
3443
3485
  attributes = _operationData.attributes,
3444
- text = _operationData.text,
3445
- _operationData$proper = _operationData.propertyName,
3446
- propertyName = _operationData$proper === void 0 ? 'template' : _operationData$proper;
3486
+ text = _operationData.text;
3447
3487
  var serializedAttrs = attributes ? ' ' + Object.entries(attributes).map(function (_ref) {
3448
3488
  var key = _ref[0],
3449
3489
  value = _ref[1];
3450
3490
  return key + "=\"" + value + "\"";
3451
3491
  }).join(' ') : '';
3452
3492
  var template = text ? $__default["default"]("<" + elementName + serializedAttrs + ">" + text + "</" + elementName + ">") : $__default["default"]("<" + elementName + serializedAttrs + "/>");
3453
- operationData[propertyName] = template;
3454
- delete operationData.propertyName;
3493
+ operationData.template = template;
3455
3494
  return operationData;
3456
3495
  };
3457
3496
 
@@ -3565,25 +3604,21 @@ var getControllerFromElement$1 = function getControllerFromElement(operationData
3565
3604
 
3566
3605
  /**
3567
3606
  * This operation retrieves an instance of the given controller name.
3568
- * It assigns this instance to the property on the current operation data
3569
- * defined by the propertyName property which defaults to 'controllerInstance'.
3607
+ * It assigns this instance to the `controllerInstance` property on the current operation data
3570
3608
  *
3571
3609
  * @param operationData
3572
3610
  * @returns
3573
3611
  */
3574
3612
 
3575
3613
  var getControllerInstance$1 = function getControllerInstance(operationData) {
3576
- var systemName = operationData.systemName,
3577
- _operationData$proper = operationData.propertyName,
3578
- propertyName = _operationData$proper === void 0 ? 'controllerInstance' : _operationData$proper;
3579
- operationData[propertyName] = null;
3614
+ var systemName = operationData.systemName;
3615
+ operationData.controllerInstance = undefined;
3580
3616
 
3581
3617
  var resultCallback = function resultCallback(instance) {
3582
- operationData[propertyName] = instance;
3618
+ operationData.controllerInstance = instance;
3583
3619
  };
3584
3620
 
3585
3621
  this.eventbus.broadcast(TimelineEventNames.REQUEST_INSTANCE, [systemName, resultCallback]);
3586
- delete operationData.propertyName;
3587
3622
  return operationData;
3588
3623
  };
3589
3624
 
@@ -3823,13 +3858,58 @@ var getImport$1 = function getImport(operationData) {
3823
3858
  return operationData;
3824
3859
  };
3825
3860
 
3861
+ /**
3862
+ * This operation retrieves the current query parameters from the browser's address bar and places
3863
+ * them on the returned operation data.
3864
+ *
3865
+ * @param operationData
3866
+ * @returns
3867
+ */
3868
+ var getQueryParams$1 = function getQueryParams(operationData) {
3869
+ var searchParams = new URLSearchParams(window.location.search);
3870
+ var queryParams = Object.fromEntries(searchParams.entries());
3871
+ var defaultValues = operationData.defaultValues;
3872
+
3873
+ if (defaultValues) {
3874
+ var defaultEntries = Object.entries(defaultValues).filter(function (_ref) {
3875
+ var name = _ref[0];
3876
+ return !(name in queryParams);
3877
+ });
3878
+ defaultEntries.forEach(function (_ref2) {
3879
+ var name = _ref2[0],
3880
+ value = _ref2[1];
3881
+ return queryParams[name] = value;
3882
+ });
3883
+ delete operationData.defaultValues;
3884
+ }
3885
+
3886
+ operationData.queryParams = queryParams;
3887
+ return operationData;
3888
+ };
3889
+
3890
+ /**
3891
+ * This operation invokes the specified method on the given object with the optional specified arguments
3892
+ * and assigns the result to the `methodResult` property.
3893
+ *
3894
+ * @param operationData
3895
+ * @returns
3896
+ */
3897
+ var invokeObjectMethod$1 = function invokeObjectMethod(operationData) {
3898
+ var methodName = operationData.methodName,
3899
+ methodArguments = operationData.methodArguments;
3900
+ delete operationData.methodName;
3901
+ delete operationData.methodArguments;
3902
+ operationData.methodResult = operationData.instance[methodName].apply(operationData.instance, methodArguments != null ? methodArguments : []);
3903
+ return operationData;
3904
+ };
3905
+
3826
3906
  var jsonCache = {};
3827
3907
  var addToCache = function addToCache(key, value) {
3828
3908
  jsonCache[key] = value;
3829
3909
  };
3830
3910
  /**
3831
- * This operation loads a JSON file from the specified url and assigns it to the specified
3832
- * property name on the current operation data. The property name defaults to 'json'.
3911
+ * This operation loads a JSON file from the specified url and assigns it to the json
3912
+ * property on the current operation data.
3833
3913
  *
3834
3914
  * If the cache property is set to true and a cached value already exists, this is assigned
3835
3915
  * instead of re-retrieving it from the url.
@@ -3840,47 +3920,41 @@ var addToCache = function addToCache(key, value) {
3840
3920
 
3841
3921
  var loadJSON$1 = function loadJSON(operationData) {
3842
3922
  var url = operationData.url,
3843
- cache = operationData.cache,
3844
- _operationData$proper = operationData.propertyName,
3845
- propertyName = _operationData$proper === void 0 ? 'json' : _operationData$proper;
3923
+ cache = operationData.cache;
3846
3924
 
3847
3925
  if (cache && jsonCache[url]) {
3848
- operationData[propertyName] = jsonCache[url];
3849
- delete operationData.propertyName;
3926
+ operationData.json = jsonCache[url];
3850
3927
  return operationData;
3851
3928
  }
3852
3929
 
3853
- return new Promise(function (resolve, reject) {
3854
- fetch(url).then( /*#__PURE__*/function () {
3855
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {
3856
- var json, cacheValue;
3857
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3858
- while (1) {
3859
- switch (_context.prev = _context.next) {
3860
- case 0:
3861
- _context.next = 2;
3862
- return response.json();
3930
+ return fetch(url).then( /*#__PURE__*/function () {
3931
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {
3932
+ var json, cacheValue;
3933
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3934
+ while (1) {
3935
+ switch (_context.prev = _context.next) {
3936
+ case 0:
3937
+ _context.next = 2;
3938
+ return response.json();
3863
3939
 
3864
- case 2:
3865
- json = _context.sent;
3866
- cacheValue = operationData[propertyName] = json;
3867
- delete operationData.propertyName;
3868
- addToCache(url, cacheValue);
3869
- resolve(operationData);
3940
+ case 2:
3941
+ json = _context.sent;
3942
+ cacheValue = operationData.json = json;
3943
+ addToCache(url, cacheValue);
3944
+ return _context.abrupt("return", operationData);
3870
3945
 
3871
- case 7:
3872
- case "end":
3873
- return _context.stop();
3874
- }
3946
+ case 6:
3947
+ case "end":
3948
+ return _context.stop();
3875
3949
  }
3876
- }, _callee);
3877
- }));
3950
+ }
3951
+ }, _callee);
3952
+ }));
3878
3953
 
3879
- return function (_x) {
3880
- return _ref.apply(this, arguments);
3881
- };
3882
- }())["catch"](reject);
3883
- });
3954
+ return function (_x) {
3955
+ return _ref.apply(this, arguments);
3956
+ };
3957
+ }());
3884
3958
  };
3885
3959
 
3886
3960
  /**
@@ -3912,10 +3986,8 @@ var math$1 = function math(operationData) {
3912
3986
  operationData.args = resolveMathConstants(operationData.args);
3913
3987
  var _operationData = operationData,
3914
3988
  args = _operationData.args,
3915
- functionName = _operationData.functionName,
3916
- _operationData$proper = _operationData.propertyName,
3917
- propertyName = _operationData$proper === void 0 ? 'mathResult' : _operationData$proper;
3918
- operationData[propertyName] = Math[functionName].apply(null, args);
3989
+ functionName = _operationData.functionName;
3990
+ operationData.mathResult = Math[functionName].apply(null, args);
3919
3991
  return operationData;
3920
3992
  };
3921
3993
 
@@ -3984,17 +4056,22 @@ var removeElement$1 = function removeElement(operationData) {
3984
4056
 
3985
4057
  /**
3986
4058
  * This operation removes the given list of properties from the current operation data.
4059
+ * It will also omit the property 'propertyNames' from the result.
3987
4060
  *
3988
4061
  * @param operationData
3989
4062
  * @returns
3990
4063
  */
3991
4064
  var removePropertiesFromOperationData$1 = function removePropertiesFromOperationData(operationData) {
3992
4065
  var propertyNames = operationData.propertyNames;
3993
- propertyNames.forEach(function (name) {
3994
- delete operationData[name];
3995
- });
3996
- delete operationData.propertyNames;
3997
- return operationData;
4066
+
4067
+ if (propertyNames.indexOf('propertyNames') < 0) {
4068
+ propertyNames.push('propertyNames');
4069
+ }
4070
+
4071
+ return Object.fromEntries(Object.entries(operationData).filter(function (_ref) {
4072
+ var name = _ref[0];
4073
+ return !propertyNames.includes(name);
4074
+ }));
3998
4075
  };
3999
4076
 
4000
4077
  /**
@@ -4050,25 +4127,21 @@ var resizeAction$1 = function resizeAction(operationData) {
4050
4127
  return operationData;
4051
4128
  };
4052
4129
 
4053
- function findElementBySelector(root, selector, operationData, propertyName) {
4130
+ function findElementBySelector(root, selector) {
4054
4131
  var element = root.find(selector);
4055
4132
 
4056
4133
  if (!element.length) {
4057
4134
  console.warn("selector '" + selector + "' wasn't found!");
4058
4135
  }
4059
4136
 
4060
- operationData[propertyName] = element;
4061
-
4062
- if (operationData.hasOwnProperty('propertyName')) {
4063
- delete operationData.propertyName;
4064
- }
4137
+ return element;
4065
4138
  }
4066
4139
  /**
4067
4140
  * This operation selects one or more elements using the specified selector.
4068
4141
  *
4069
4142
  * If useSelectedElementAsRoot is set to true and a valid DOM element is assigned
4070
- * to the current operation data defined by the given property name (defaults to 'selectedElement')
4071
- * then the element will be looked for only in the child elements of this DOM element.
4143
+ * to the current operation data's `selectedElement` property
4144
+ * then the element will be looked for only in the descendant elements of this DOM element.
4072
4145
  *
4073
4146
  * @param operationData
4074
4147
  * @returns
@@ -4077,23 +4150,21 @@ function findElementBySelector(root, selector, operationData, propertyName) {
4077
4150
 
4078
4151
  var selectElement$1 = function selectElement(operationData) {
4079
4152
  var selector = operationData.selector,
4080
- _operationData$proper = operationData.propertyName,
4081
- propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper,
4082
4153
  _operationData$useSel = operationData.useSelectedElementAsRoot,
4083
4154
  useSelectedElementAsRoot = _operationData$useSel === void 0 ? false : _operationData$useSel;
4084
4155
 
4085
4156
  if (!selector) {
4086
- throw new Error('selector is undefined!');
4157
+ throw new Error('selectElement: selector is either empty or not defined.');
4087
4158
  }
4088
4159
 
4089
- if (useSelectedElementAsRoot && operationData[propertyName]) {
4090
- var currentRoot = operationData[propertyName];
4091
- findElementBySelector(currentRoot, selector, operationData, propertyName);
4160
+ if (useSelectedElementAsRoot && operationData.selectedElement) {
4161
+ var currentRoot = operationData.selectedElement;
4162
+ operationData.selectedElement = findElementBySelector(currentRoot, selector);
4092
4163
  return operationData;
4093
4164
  }
4094
4165
 
4095
4166
  var rootCallback = function rootCallback(root) {
4096
- findElementBySelector(root, selector, operationData, propertyName);
4167
+ operationData.selectedElement = findElementBySelector(root, selector);
4097
4168
  };
4098
4169
 
4099
4170
  this.eventbus.broadcast(TimelineEventNames.REQUEST_ENGINE_ROOT, [rootCallback]);
@@ -4182,19 +4253,15 @@ var setOperationData$1 = function setOperationData(operationData) {
4182
4253
  /**
4183
4254
  * This operation assigns the specified CSS style properties to the
4184
4255
  * specified selected element. The selected element is assigned to
4185
- * the property defined by the propertyName property which defaults
4186
- * to 'selectedElement'.
4256
+ * the `selectedElement` property.
4187
4257
  *
4188
4258
  * @param operationData
4189
4259
  * @returns
4190
4260
  */
4191
4261
 
4192
4262
  var setStyle$1 = function setStyle(operationData) {
4193
- var _operationData$proper = operationData.propertyName,
4194
- propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper;
4195
4263
  var properties = resolvePropertyValues(operationData, operationData.properties);
4196
- operationData[propertyName].css(properties);
4197
- delete operationData.propertyName;
4264
+ operationData.selectedElement.css(properties);
4198
4265
  return operationData;
4199
4266
  };
4200
4267
 
@@ -4229,19 +4296,16 @@ var startAction$1 = function startAction(operationData) {
4229
4296
  * This operation starts a loop using the given collection.
4230
4297
  *
4231
4298
  * Each iteration the current item from the specified collection is
4232
- * assigned to the property on the current operation data specified
4233
- * by the propertyName property which defaults to 'currentItem'.
4299
+ * assigned to the `currentItem` property on the current operation data.
4234
4300
  *
4235
4301
  * @param operationData
4236
4302
  * @returns
4237
4303
  */
4238
4304
  var startLoop$1 = function startLoop(operationData) {
4239
4305
  var context = this;
4240
- var collection = operationData.collection,
4241
- _operationData$proper = operationData.propertyName,
4242
- propertyName = _operationData$proper === void 0 ? 'currentItem' : _operationData$proper;
4306
+ var collection = operationData.collection;
4243
4307
 
4244
- if (typeof collection === 'string') {
4308
+ if (collection !== null && !Array.isArray(collection)) {
4245
4309
  throw new Error('Expected collection to be array type, string value was probably not resolved correctly');
4246
4310
  }
4247
4311
 
@@ -4256,10 +4320,9 @@ var startLoop$1 = function startLoop(operationData) {
4256
4320
  }
4257
4321
 
4258
4322
  if (collection != null && collection.length && context.loopIndex !== undefined) {
4259
- operationData[propertyName] = collection[context.loopIndex];
4323
+ operationData.currentItem = collection[context.loopIndex];
4260
4324
  }
4261
4325
 
4262
- delete operationData.propertyName;
4263
4326
  return operationData;
4264
4327
  };
4265
4328
 
@@ -4322,6 +4385,8 @@ var ops = {
4322
4385
  getControllerInstance: getControllerInstance$1,
4323
4386
  getElementDimensions: getElementDimensions$1,
4324
4387
  getImport: getImport$1,
4388
+ getQueryParams: getQueryParams$1,
4389
+ invokeObjectMethod: invokeObjectMethod$1,
4325
4390
  loadJSON: loadJSON$1,
4326
4391
  log: log$1,
4327
4392
  math: math$1,
@@ -4944,7 +5009,7 @@ function animate() {
4944
5009
  required: true
4945
5010
  },
4946
5011
  animationDuration: {
4947
- type: 'ParameterType:integer',
5012
+ type: 'ParameterType:number',
4948
5013
  required: true
4949
5014
  }
4950
5015
  }
@@ -4981,15 +5046,15 @@ function broadcastEvent() {
4981
5046
 
4982
5047
  function calc() {
4983
5048
  return {
4984
- description: 'clears the given element',
5049
+ description: 'Calculates the given left and right hand sides using the specified operator',
4985
5050
  properties: {
4986
5051
  left: {
4987
- type: 'ParameterType:integer',
5052
+ type: 'ParameterType:number',
4988
5053
  description: 'The left operand',
4989
5054
  required: true
4990
5055
  },
4991
5056
  right: {
4992
- type: 'ParameterType:integer',
5057
+ type: 'ParameterType:number',
4993
5058
  description: 'The right operand',
4994
5059
  required: true
4995
5060
  },
@@ -5011,18 +5076,11 @@ function calc() {
5011
5076
  }, {
5012
5077
  value: '**',
5013
5078
  description: 'Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times.'
5014
- }],
5015
- propertyName: {
5016
- type: 'ParameterType:string',
5017
- defaultValue: 'calculationResult'
5018
- }
5079
+ }]
5080
+ },
5081
+ outputProperties: {
5082
+ calculationResult: 'ParameterType:number'
5019
5083
  }
5020
- /*outputProperties: {
5021
- propertyName: {
5022
- type: 'ParameterType:integer',
5023
- },
5024
- },*/
5025
-
5026
5084
  };
5027
5085
  }
5028
5086
 
@@ -5120,10 +5178,6 @@ function getControllerInstance() {
5120
5178
  systemName: {
5121
5179
  type: 'ParameterType:controllerName',
5122
5180
  required: true
5123
- },
5124
- propertyName: {
5125
- type: 'ParameterType:string',
5126
- defaultValue: 'controllerInstance'
5127
5181
  }
5128
5182
  },
5129
5183
  outputProperties: {
@@ -5160,6 +5214,35 @@ function getImport() {
5160
5214
  };
5161
5215
  }
5162
5216
 
5217
+ function getQueryParams() {
5218
+ return {
5219
+ description: "Retrieves the current query parameters from the browser's address bar",
5220
+ outputProperties: {
5221
+ queryParams: 'ParameterType:object'
5222
+ }
5223
+ };
5224
+ }
5225
+
5226
+ function invokeObjectMethod() {
5227
+ return {
5228
+ description: 'Invokes the specified method on the given object with the optional specified arguments',
5229
+ properties: {
5230
+ instance: {
5231
+ type: 'ParameterType:object',
5232
+ required: true
5233
+ },
5234
+ methodName: {
5235
+ type: 'ParameterType:string',
5236
+ required: true
5237
+ },
5238
+ methodArguments: 'ParameterType:array'
5239
+ },
5240
+ outputProperties: {
5241
+ methodResult: 'ParameterType:object'
5242
+ }
5243
+ };
5244
+ }
5245
+
5163
5246
  function loadJSON() {
5164
5247
  return {
5165
5248
  description: 'Load JSON from the given url',
@@ -5168,11 +5251,7 @@ function loadJSON() {
5168
5251
  type: 'ParameterType:url',
5169
5252
  required: true
5170
5253
  },
5171
- cache: 'ParameterType:boolean',
5172
- propertyName: {
5173
- type: 'ParameterType:string',
5174
- defaultValue: 'json'
5175
- }
5254
+ cache: 'ParameterType:boolean'
5176
5255
  },
5177
5256
  outputProperties: {
5178
5257
  json: 'ParameterType:object'
@@ -5195,10 +5274,7 @@ function math() {
5195
5274
  required: true
5196
5275
  },
5197
5276
  functionName: createMathFunctionNames(),
5198
- propertyName: {
5199
- type: 'ParameterType:string',
5200
- defaultValue: 'mathResult'
5201
- }
5277
+ mathResult: 'ParameterType:number'
5202
5278
  }
5203
5279
  };
5204
5280
  }
@@ -5301,11 +5377,10 @@ function selectElement() {
5301
5377
  type: 'ParameterType:selector',
5302
5378
  required: true
5303
5379
  },
5304
- propertyName: 'ParameterType:string',
5305
5380
  useSelectedElementAsRoot: 'ParameterType:boolean'
5306
5381
  },
5307
5382
  outputProperties: {
5308
- selectedElement: 'ParameterType:object'
5383
+ selectedElement: 'ParameterType:jQuery'
5309
5384
  }
5310
5385
  };
5311
5386
  }
@@ -5326,7 +5401,7 @@ function setElementAttributes() {
5326
5401
  function setElementContent() {
5327
5402
  return {
5328
5403
  description: 'Sets the given HTML content in the selected element',
5329
- dependentProperties: ['selectedElement'],
5404
+ dependentProperties: ['selectedElement', 'template'],
5330
5405
  properties: {
5331
5406
  insertionType: [{
5332
5407
  value: 'overwrite',
@@ -5338,11 +5413,7 @@ function setElementContent() {
5338
5413
  }, {
5339
5414
  value: 'prepend',
5340
5415
  description: 'the new content will be inserted before the current content'
5341
- }],
5342
- template: {
5343
- type: 'ParameterType:htmlContent',
5344
- required: true
5345
- }
5416
+ }]
5346
5417
  }
5347
5418
  };
5348
5419
  }
@@ -5368,10 +5439,7 @@ function setStyle() {
5368
5439
  type: 'ParameterType:object',
5369
5440
  required: true
5370
5441
  },
5371
- propertyName: {
5372
- type: 'ParameterType:string',
5373
- required: false
5374
- }
5442
+ selectedElement: 'ParameterType:jQuery'
5375
5443
  }
5376
5444
  };
5377
5445
  }
@@ -5394,10 +5462,7 @@ function startLoop() {
5394
5462
  type: 'ParameterType:array',
5395
5463
  required: true
5396
5464
  },
5397
- propertyName: {
5398
- type: 'ParameterType:string',
5399
- defaultValue: 'currentItem'
5400
- }
5465
+ currentItem: 'ParameterType:object'
5401
5466
  }
5402
5467
  };
5403
5468
  }
@@ -5427,7 +5492,7 @@ function wait() {
5427
5492
  description: 'Waits the given amount of milliseconds before the action continues',
5428
5493
  properties: {
5429
5494
  milliseconds: {
5430
- type: 'ParameterType:integer',
5495
+ type: 'ParameterType:number',
5431
5496
  required: true
5432
5497
  }
5433
5498
  }
@@ -5453,6 +5518,8 @@ var index = {
5453
5518
  getControllerInstance: getControllerInstance,
5454
5519
  getElementDimensions: getElementDimensions,
5455
5520
  getImport: getImport,
5521
+ getQueryParams: getQueryParams,
5522
+ invokeObjectMethod: invokeObjectMethod,
5456
5523
  loadJSON: loadJSON,
5457
5524
  log: log,
5458
5525
  math: math,
@@ -5517,6 +5584,8 @@ exports.getControllerFromElement = getControllerFromElement$1;
5517
5584
  exports.getControllerInstance = getControllerInstance$1;
5518
5585
  exports.getElementDimensions = getElementDimensions$1;
5519
5586
  exports.getImport = getImport$1;
5587
+ exports.getQueryParams = getQueryParams$1;
5588
+ exports.invokeObjectMethod = invokeObjectMethod$1;
5520
5589
  exports.loadJSON = loadJSON$1;
5521
5590
  exports.log = log$1;
5522
5591
  exports.math = math$1;