diff --git a/package.json b/package.json index 30fe1a5..073fc12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "HTMLSnippet", - "version": "3.9.5", + "version": "3.9.6", "description": "", "license": "", "author": "", diff --git a/src/HTMLSnippet/widget/HTMLSnippet.js b/src/HTMLSnippet/widget/HTMLSnippet.js index a8d8d39..255d550 100644 --- a/src/HTMLSnippet/widget/HTMLSnippet.js +++ b/src/HTMLSnippet/widget/HTMLSnippet.js @@ -174,9 +174,9 @@ define([ (function (snippetCode) { /** * user's are get used to or might expect to have jQuery available globally - * and they will write their code according to that, and since we, in this widget, don't expose - * jQuery globally, we'll check user's code snippet if there is any attempt to access jQuery - * from the global scope ( window ). + * and they will write their code according to that, and since we, in this widget, don't expose + * jQuery globally, we'll check user's code snippet if there is any attempt to access jQuery + * from the global scope ( window ). */ var jqueryIdRegex1 = /window.\jQuery/g; var jqueryIdRegex2 = /window.\$/g; @@ -188,7 +188,8 @@ define([ "console.debug('your code snippet is evaluated and executed against JQuery version:'+ this.jquery.fn.jquery);"; eval(snippetCode); }).call({ - jquery: jQuery // pass JQuery as the context of the immediate function which will wrap the code snippet + jquery: jQuery, // pass JQuery as the context of the immediate function which will wrap the code snippet + widget: this // pass the HTMLSnippet widget context itself, so the code could use listen/addOnDestroy }, this.contents); // pass the code snippet as an arg } catch (error) { this._handleError(error); diff --git a/src/package.xml b/src/package.xml index e063445..73239e0 100644 --- a/src/package.xml +++ b/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/webpack.config.js b/webpack.config.js index 15f1fbe..f0cd37b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,7 +19,7 @@ const widgetVersion = package.version; filename: `${widgetName}/widget/[name].js`, chunkFilename: `${widgetName}/widget/${widgetName}[id].js`, libraryTarget: "amd", - publicPath: "widgets/" + publicPath: "/widgets/" }, devtool: false, mode: "production",