|
@@ -130,7 +130,7 @@ Here's an example of the plugin shown above wrapped inside a UMD module:
|
|
(function (root, factory) {
|
|
(function (root, factory) {
|
|
if (typeof define === 'function' && define.amd) {
|
|
if (typeof define === 'function' && define.amd) {
|
|
// AMD. Register as a module called "myplugin"
|
|
// AMD. Register as a module called "myplugin"
|
|
- define("myplugin", ["converse"], factory);
|
|
|
|
|
|
+ define(["converse"], factory);
|
|
} else {
|
|
} else {
|
|
// Browser globals. If you're not using a module loader such as require.js,
|
|
// Browser globals. If you're not using a module loader such as require.js,
|
|
// then this line below executes. Make sure that your plugin's <script> tag
|
|
// then this line below executes. Make sure that your plugin's <script> tag
|
|
@@ -346,7 +346,7 @@ generated by `generator-conversejs <https://github.com/jcbrand/generator-convers
|
|
(function (root, factory) {
|
|
(function (root, factory) {
|
|
if (typeof define === 'function' && define.amd) {
|
|
if (typeof define === 'function' && define.amd) {
|
|
// AMD. Register as a module called "myplugin"
|
|
// AMD. Register as a module called "myplugin"
|
|
- define("<%= name %>", ["converse"], factory);
|
|
|
|
|
|
+ define(["converse"], factory);
|
|
} else {
|
|
} else {
|
|
// Browser globals. If you're not using a module loader such as require.js,
|
|
// Browser globals. If you're not using a module loader such as require.js,
|
|
// then this line below executes. Make sure that your plugin's <script> tag
|
|
// then this line below executes. Make sure that your plugin's <script> tag
|
|
@@ -368,7 +368,7 @@ generated by `generator-conversejs <https://github.com/jcbrand/generator-convers
|
|
moment = converse.env.moment;
|
|
moment = converse.env.moment;
|
|
|
|
|
|
// The following line registers your plugin.
|
|
// The following line registers your plugin.
|
|
- converse.plugins.add("<%= name %>", {
|
|
|
|
|
|
+ converse.plugins.add("myplugin", {
|
|
|
|
|
|
/* Optional dependencies are other plugins which might be
|
|
/* Optional dependencies are other plugins which might be
|
|
* overridden or relied upon, and therefore need to be loaded before
|
|
* overridden or relied upon, and therefore need to be loaded before
|
|
@@ -393,7 +393,7 @@ generated by `generator-conversejs <https://github.com/jcbrand/generator-convers
|
|
* `_converse` object.
|
|
* `_converse` object.
|
|
*/
|
|
*/
|
|
var _converse = this._converse;
|
|
var _converse = this._converse;
|
|
- _converse.log("The <%= name %> plugin is being initialized");
|
|
|
|
|
|
+ _converse.log("The \"myplugin\" plugin is being initialized");
|
|
|
|
|
|
/* From the `_converse` object you can get any configuration
|
|
/* From the `_converse` object you can get any configuration
|
|
* options that the user might have passed in via
|
|
* options that the user might have passed in via
|
|
@@ -405,7 +405,7 @@ generated by `generator-conversejs <https://github.com/jcbrand/generator-convers
|
|
* configuration settings. This is done like so:
|
|
* configuration settings. This is done like so:
|
|
*/
|
|
*/
|
|
_converse.api.settings.update({
|
|
_converse.api.settings.update({
|
|
- 'initialize_message': 'Initializing <%= name %>!'
|
|
|
|
|
|
+ 'initialize_message': 'Initializing myplugin!'
|
|
});
|
|
});
|
|
|
|
|
|
/* The user can then pass in values for the configuration
|
|
/* The user can then pass in values for the configuration
|