anshuwap / mollify

Automatically exported from code.google.com/p/mollify
0 stars 0 forks source link

Twitter #323

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, it's not a problem, i'd like to add a twitter button for followers but i 
don't really know how because moliffy doesn't use a strictly html code or does 
it? thanks

Original issue reported on code.google.com by bhts...@gmail.com on 18 Nov 2011 at 5:47

GoogleCodeExporter commented 9 years ago
Mollify sure does use HTML, but it's dynamic so the DOM is injected runtime.

Adding your own content must be done using client plugins, for example adding 
your own action into the popup  would be something like this:

function MyPlugin() {
    var that = this;

    this.getPluginInfo = function() { return { id: "myplugin" }; }

    this.initialize = function(env) {
        that.env = env;

        env.addItemContextProvider(function(item, details) {
            return {
                components : [],
                actions : {
                    primary : [
                        {
                            title: "My action",
                            callback: that.onMyAction
                        }
                    ],
                secondary: []
            }
        }
        });
    }

    this.onMyAction = function(id, item, details) {
        // do whatever your action
    }
}

Of course you need to register this plugin in the mollify init.

Original comment by samuli.j...@gmail.com on 21 Nov 2011 at 5:04

GoogleCodeExporter commented 9 years ago
One note, in the example you can see primary actions and secondary actions 
(they should be in same level, badly indented). The difference is that primary 
actions are rendered with buttons, secondary actions are listed in the actions 
dropdown.

Original comment by samuli.j...@gmail.com on 21 Nov 2011 at 5:09

GoogleCodeExporter commented 9 years ago

Original comment by samuli.j...@gmail.com on 21 Nov 2011 at 5:09