Skip to content

Commit 07432db

Browse files
Merge pull request #40 from mendix/fix/warnings
Removing deprecated APIs, fixing misspelling words and aligning version
2 parents 693c304 + de2dfd3 commit 07432db

File tree

5 files changed

+23
-25
lines changed

5 files changed

+23
-25
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "formatstring",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "",
55
"license": "",
66
"author": "",

src/formatstring/widget/formatstring.js

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ define([
1212
], function(declare, _WidgetBase, dom, lang, dojo, dojoArray, domClass, on, dojoLocale, languagePack) {
1313
"use strict";
1414

15-
// var debug = logger.debug;
16-
1715
return declare("formatstring.widget.formatstring", [_WidgetBase], {
1816

1917
_contextObj: null,
@@ -23,7 +21,7 @@ define([
2321
onclicknf: {}, // Nanoflows are not strings, so need to make sure its always an object
2422

2523
postCreate: function() {
26-
logger.debug(this.id + ".postCreate");
24+
mx.logger.debug(this.id + ".postCreate");
2725

2826
this._timeData = languagePack;
2927

@@ -35,15 +33,15 @@ define([
3533
},
3634

3735
update: function(obj, callback) {
38-
logger.debug(this.id + ".update");
36+
mx.logger.debug(this.id + ".update");
3937
this._contextObj = obj;
4038
this._resetSubscriptions();
4139

4240
this._loadData(callback);
4341
},
4442

4543
_setupEvents: function() {
46-
logger.debug(this.id + "._setupEvents");
44+
mx.logger.debug(this.id + "._setupEvents");
4745
on(this.domNode, "click", lang.hitch(this, function(e) {
4846
this.execOnclick();
4947
if (this.stopClickPropagation) {
@@ -60,7 +58,7 @@ define([
6058
},
6159

6260
_loadData: function(callback) {
63-
logger.debug(this.id + "._loadData");
61+
mx.logger.debug(this.id + "._loadData");
6462
this._replaceAttr = [];
6563

6664
if (!this._contextObj) {
@@ -82,7 +80,7 @@ define([
8280
value: value
8381
});
8482
} else {
85-
logger.warn(this.id + "._loadData: You have an empty variable name, skipping! Please check Data source -> Attributes -> Variable Name");
83+
mx.logger.warn(this.id + "._loadData: You have an empty variable name, skipping! Please check Data source -> Attributes -> Variable Name");
8684
}
8785
cb();
8886
};
@@ -95,8 +93,8 @@ define([
9593
},
9694

9795
_fetchRef: function(attrObj) {
98-
logger.debug(this.id + "._fetchRef");
99-
96+
mx.logger.debug(this.id + "._fetchRef");
97+
10098
return function(cb) {
10199
this._contextObj.fetch(attrObj.attrs, lang.hitch(this, function (value) {
102100
this._replaceAttr.push({
@@ -109,8 +107,8 @@ define([
109107
},
110108

111109
_fetchAttr: function(obj, attr, attrObj) {
112-
logger.debug(this.id + "._fetchAttr");
113-
110+
mx.logger.debug(this.id + "._fetchAttr");
111+
114112
// Referenced object might be empty, can"t fetch an attr on empty
115113
if (!obj) {
116114
return attrObj.emptyReplacement;
@@ -153,7 +151,7 @@ define([
153151

154152
// _buildString also does _renderString because of callback from fetchReferences is async.
155153
_buildString: function(callback) {
156-
logger.debug(this.id + "._buildString");
154+
mx.logger.debug(this.id + "._buildString");
157155

158156
var str = this.displaystr,
159157
classStr = this.classstr;
@@ -166,7 +164,7 @@ define([
166164
},
167165

168166
_renderString: function(msg, classStr, callback) {
169-
logger.debug(this.id + "._renderString");
167+
mx.logger.debug(this.id + "._renderString");
170168

171169
dojo.empty(this.domNode);
172170
var div = dom.create("div", {
@@ -179,15 +177,15 @@ define([
179177
},
180178

181179
_checkString: function(string, renderAsHTML) {
182-
logger.debug(this.id + "._checkString");
180+
mx.logger.debug(this.id + "._checkString");
183181
if (string.indexOf("<script") > -1 || !renderAsHTML) {
184182
string = dom.escapeString(string);
185183
}
186184
return string;
187185
},
188186

189187
_parseDate: function(format, options, value) {
190-
logger.debug(this.id + "._parseDate");
188+
mx.logger.debug(this.id + "._parseDate");
191189
var datevalue = value;
192190

193191
if (value === "") {
@@ -204,7 +202,7 @@ define([
204202
},
205203

206204
_parseTimeAgo: function(value, data) {
207-
logger.debug(this.id + "._parseTimeAgo");
205+
mx.logger.debug(this.id + "._parseTimeAgo");
208206
var date = new Date(value),
209207
now = new Date(),
210208
appendStr = null,
@@ -269,7 +267,7 @@ define([
269267
},
270268

271269
execOnclick: function() {
272-
logger.debug(this.id + ".execOnclick");
270+
mx.logger.debug(this.id + ".execOnclick");
273271
if (!this._contextObj) {
274272
return;
275273
}
@@ -282,7 +280,7 @@ define([
282280
guids: [this._contextObj.getGuid()]
283281
},
284282
error: function(error) {
285-
logger.error(this.id + ": An error ocurred while executing microflow: ", error);
283+
mx.logger.error(this.id + ": An error occurred while executing microflow: ", error);
286284
}
287285
};
288286
if (!mx.version || mx.version && parseInt(mx.version.split(".")[0]) < 7) {
@@ -302,14 +300,14 @@ define([
302300
origin: this.mxform,
303301
context: this.mxcontext,
304302
error: function(error) {
305-
logger.error(this.id + ": An error ocurred while executing nanflow: ", error);
303+
mx.logger.error(this.id + ": An error occurred while executing nanoflow: ", error);
306304
}
307305
});
308306
}
309307
},
310308

311309
_resetSubscriptions: function() {
312-
logger.debug(this.id + "._resetSubscriptions");
310+
mx.logger.debug(this.id + "._resetSubscriptions");
313311
this.unsubscribeAll();
314312

315313
if (this._contextObj) {
@@ -329,7 +327,7 @@ define([
329327
},
330328

331329
_executeCallback: function(cb, from) {
332-
logger.debug(this.id + "._executeCallback" + (from ? " from " + from : ""));
330+
mx.logger.debug(this.id + "._executeCallback" + (from ? " from " + from : ""));
333331
if (cb && typeof cb === "function") {
334332
cb();
335333
}

src/package.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="formatstring" version="5.8.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="formatstring" version="6.0.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="formatstring/formatstring.xml"/>
66
</widgetFiles>
77
<files>
88
<file path="formatstring/widget/"/>
99
</files>
1010
</clientModule>
11-
</package>
11+
</package>

test/widgets/FormatString.mpk

-34 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)