Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formatstring",
"version": "6.0.0",
"version": "6.0.1",
"description": "",
"license": "",
"author": "",
Expand Down
40 changes: 19 additions & 21 deletions src/formatstring/widget/formatstring.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ define([
], function(declare, _WidgetBase, dom, lang, dojo, dojoArray, domClass, on, dojoLocale, languagePack) {
"use strict";

// var debug = logger.debug;

return declare("formatstring.widget.formatstring", [_WidgetBase], {

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

postCreate: function() {
logger.debug(this.id + ".postCreate");
mx.logger.debug(this.id + ".postCreate");

this._timeData = languagePack;

Expand All @@ -35,15 +33,15 @@ define([
},

update: function(obj, callback) {
logger.debug(this.id + ".update");
mx.logger.debug(this.id + ".update");
this._contextObj = obj;
this._resetSubscriptions();

this._loadData(callback);
},

_setupEvents: function() {
logger.debug(this.id + "._setupEvents");
mx.logger.debug(this.id + "._setupEvents");
on(this.domNode, "click", lang.hitch(this, function(e) {
this.execOnclick();
if (this.stopClickPropagation) {
Expand All @@ -60,7 +58,7 @@ define([
},

_loadData: function(callback) {
logger.debug(this.id + "._loadData");
mx.logger.debug(this.id + "._loadData");
this._replaceAttr = [];

if (!this._contextObj) {
Expand All @@ -82,7 +80,7 @@ define([
value: value
});
} else {
logger.warn(this.id + "._loadData: You have an empty variable name, skipping! Please check Data source -> Attributes -> Variable Name");
mx.logger.warn(this.id + "._loadData: You have an empty variable name, skipping! Please check Data source -> Attributes -> Variable Name");
}
cb();
};
Expand All @@ -95,8 +93,8 @@ define([
},

_fetchRef: function(attrObj) {
logger.debug(this.id + "._fetchRef");
mx.logger.debug(this.id + "._fetchRef");

return function(cb) {
this._contextObj.fetch(attrObj.attrs, lang.hitch(this, function (value) {
this._replaceAttr.push({
Expand All @@ -109,8 +107,8 @@ define([
},

_fetchAttr: function(obj, attr, attrObj) {
logger.debug(this.id + "._fetchAttr");
mx.logger.debug(this.id + "._fetchAttr");

// Referenced object might be empty, can"t fetch an attr on empty
if (!obj) {
return attrObj.emptyReplacement;
Expand Down Expand Up @@ -153,7 +151,7 @@ define([

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

var str = this.displaystr,
classStr = this.classstr;
Expand All @@ -166,7 +164,7 @@ define([
},

_renderString: function(msg, classStr, callback) {
logger.debug(this.id + "._renderString");
mx.logger.debug(this.id + "._renderString");

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

_checkString: function(string, renderAsHTML) {
logger.debug(this.id + "._checkString");
mx.logger.debug(this.id + "._checkString");
if (string.indexOf("<script") > -1 || !renderAsHTML) {
string = dom.escapeString(string);
}
return string;
},

_parseDate: function(format, options, value) {
logger.debug(this.id + "._parseDate");
mx.logger.debug(this.id + "._parseDate");
var datevalue = value;

if (value === "") {
Expand All @@ -204,7 +202,7 @@ define([
},

_parseTimeAgo: function(value, data) {
logger.debug(this.id + "._parseTimeAgo");
mx.logger.debug(this.id + "._parseTimeAgo");
var date = new Date(value),
now = new Date(),
appendStr = null,
Expand Down Expand Up @@ -269,7 +267,7 @@ define([
},

execOnclick: function() {
logger.debug(this.id + ".execOnclick");
mx.logger.debug(this.id + ".execOnclick");
if (!this._contextObj) {
return;
}
Expand All @@ -282,7 +280,7 @@ define([
guids: [this._contextObj.getGuid()]
},
error: function(error) {
logger.error(this.id + ": An error ocurred while executing microflow: ", error);
mx.logger.error(this.id + ": An error occurred while executing microflow: ", error);
}
};
if (!mx.version || mx.version && parseInt(mx.version.split(".")[0]) < 7) {
Expand All @@ -302,14 +300,14 @@ define([
origin: this.mxform,
context: this.mxcontext,
error: function(error) {
logger.error(this.id + ": An error ocurred while executing nanflow: ", error);
mx.logger.error(this.id + ": An error occurred while executing nanoflow: ", error);
}
});
}
},

_resetSubscriptions: function() {
logger.debug(this.id + "._resetSubscriptions");
mx.logger.debug(this.id + "._resetSubscriptions");
this.unsubscribeAll();

if (this._contextObj) {
Expand All @@ -329,7 +327,7 @@ define([
},

_executeCallback: function(cb, from) {
logger.debug(this.id + "._executeCallback" + (from ? " from " + from : ""));
mx.logger.debug(this.id + "._executeCallback" + (from ? " from " + from : ""));
if (cb && typeof cb === "function") {
cb();
}
Expand Down
4 changes: 2 additions & 2 deletions src/package.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="formatstring" version="5.8.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="formatstring" version="6.0.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="formatstring/formatstring.xml"/>
</widgetFiles>
<files>
<file path="formatstring/widget/"/>
</files>
</clientModule>
</package>
</package>
Binary file modified test/widgets/FormatString.mpk
Binary file not shown.