Hi Tobias,

The widgets are gather in a list in the initialization of widgets, ie (see 
widget.js)

    // Hashmap of the widget classes
    if(!this.widgetClasses) {
        Widget.prototype.widgetClasses = $tw.modules.applyMethods("widget");
    }

here is a macro to list them


(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

/*
Information about this macro

*/

exports.name = "widgets";

exports.params = [

];
/*
Run the macro
*/


exports.run = function() {



var returns = "----\n";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var widget = new Widget();
for  (var widgets in widget.widgetClasses) {
returns = returns + "widget "  +widgets +"\n\n";
}

return returns;
}
})();

all the best BJ

On Monday, October 24, 2016 at 7:26:48 AM UTC+1, Tobias Beer wrote:
>
> Hi everyone,
>
> If I do
>
> console.log(widget)
>
> the console shows me the name of the widget as it was assigned at the 
> bottom of each widget as *NameOfWidget*:
>
> exports.*widgetname* = *NameOfWidget*;
>
> How can I get either *NameOfWidget* or *widgetname* via js?
>
> Best wishes,
>
> Tobias.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/41432b1d-ef00-47e3-be34-0e75fc36ae92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to