Skip to content

Commit cfe74c3

Browse files
Merge pull request #48 from mendix/fix/warnings
Removing deprecated APIs and updating jQuery
2 parents 27a4af5 + 6198bb0 commit cfe74c3

File tree

4 files changed

+40
-60
lines changed

4 files changed

+40
-60
lines changed

package-lock.json

Lines changed: 15 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "HTMLSnippet",
3-
"version": "3.9.6",
3+
"version": "3.9.7",
44
"description": "",
55
"license": "",
66
"author": "",
77
"private": true,
88
"dependencies": {
99
"core-js": "^3.2.1",
10-
"jquery": "^3.5.0"
10+
"jquery": "~3.5.1"
1111
},
1212
"devDependencies": {
1313
"clean-webpack-plugin": "^3.0.0",

src/HTMLSnippet/widget/HTMLSnippet.js

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ define([
3535
contextObj: null,
3636

3737
postCreate: function () {
38-
logger.debug(this.id + ".postCreate");
38+
mx.logger.debug(this.id + ".postCreate");
3939
this._setupEvents();
4040

4141
if (!this.refreshOnContextChange) {
@@ -44,7 +44,7 @@ define([
4444
},
4545

4646
executeCode: function () {
47-
logger.debug(this.id + ".executeCode");
47+
mx.logger.debug(this.id + ".executeCode");
4848
var external = this.contentsPath !== "" ? true : false;
4949
switch (this.contenttype) {
5050
case "html":
@@ -99,7 +99,7 @@ define([
9999
},
100100

101101
update: function (obj, callback) {
102-
logger.debug(this.id + ".update");
102+
mx.logger.debug(this.id + ".update");
103103
this.contextObj = obj;
104104
if (this.refreshOnContextChange) {
105105
this.executeCode();
@@ -123,7 +123,7 @@ define([
123123
},
124124

125125
_setupEvents: function () {
126-
logger.debug(this.id + "._setupEvents");
126+
mx.logger.debug(this.id + "._setupEvents");
127127
if (this.onclickmf) {
128128
this.connect(
129129
this.domNode,
@@ -134,32 +134,31 @@ define([
134134
},
135135

136136
_executeMicroflow: function () {
137-
logger.debug(this.id + "._executeMicroflow");
137+
mx.logger.debug(this.id + "._executeMicroflow");
138138
if (this.onclickmf) {
139-
var params = {};
139+
var params = {
140+
actionname: this.onclickmf
141+
};
140142
if (this.contextObj !== null) {
141143
params.applyto = "selection";
142144
params.guids = [this.contextObj.getGuid()];
143145
}
144-
mx.ui.action(
145-
this.onclickmf, {
146-
params: params,
147-
callback: function (obj) {
148-
logger.debug(
149-
this.id + " (executed microflow successfully)."
150-
);
151-
},
152-
error: function (error) {
153-
logger.error(this.id + error);
154-
}
146+
mx.data.action({
147+
params: params,
148+
callback: function (obj) {
149+
mx.logger.debug(
150+
this.id + " (executed microflow successfully)."
151+
);
155152
},
156-
this
157-
);
153+
error: function (error) {
154+
mx.logger.error(this.id + error);
155+
}
156+
});
158157
}
159158
},
160159

161160
evalJs: function () {
162-
logger.debug(this.id + ".evalJS");
161+
mx.logger.debug(this.id + ".evalJS");
163162
try {
164163
eval(this.contents + "\r\n//# sourceURL=" + this.id + ".js");
165164
} catch (error) {
@@ -168,7 +167,7 @@ define([
168167
},
169168

170169
_evalJQueryCode: function () {
171-
logger.debug(this.id + "._evalJQueryCode");
170+
mx.logger.debug(this.id + "._evalJQueryCode");
172171
require(["jquery"], lang.hitch(this, function(jQuery){
173172
try {
174173
(function (snippetCode) {
@@ -198,7 +197,7 @@ define([
198197
},
199198

200199
_handleError: function (error) {
201-
logger.debug(this.id + "._handleError");
200+
mx.logger.debug(this.id + "._handleError");
202201
domConstruct.place(
203202
'<div class="alert alert-danger">Error while evaluating javascript input: ' +
204203
error +
@@ -209,7 +208,7 @@ define([
209208
},
210209

211210
_executeCallback: function (cb, from) {
212-
logger.debug(this.id + "._executeCallback" + (from ? " from " + from : ""));
211+
mx.logger.debug(this.id + "._executeCallback" + (from ? " from " + from : ""));
213212
if (cb && typeof cb === "function") {
214213
cb();
215214
}

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="HTMLSnippet" version="3.9.6" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="HTMLSnippet" version="3.9.7" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="HTMLSnippet/HTMLSnippet.xml"/>
66
<widgetFile path="HTMLSnippet/HTMLSnippetContext.xml"/>

0 commit comments

Comments
 (0)