[JS] Old Opera. How to open popup window(It's linked to toolbar button) from context menu item?

  • Greetings!

    I wrote code:
    window.addEventListener("load", function ()
    {
    //Tool bar button
    var btn;
    var btnProps =
    {
    title : "MENU ACTION CONTEXT",
    icon : "images/png/icon32.png",
    popup :
    {
    href : "addWindow.html",
    height : 420,
    width : 920
    }
    }
    btn = opera.contexts.toolbar.createItem(btnProps);
    opera.contexts.toolbar.addItem(btn);

    //Context menu item
    if (opera.contexts.menu)
    {
    	var menu = opera.contexts.menu;
    	var itemProps =
    	{
    		title : 'MENU ACTION CONTEXT',
    		contexts: ['all'],
    		icon: 'images/png/icon16.png',
    		onclick : function (event)
    		{
    		 /*
    

    I'm need Open this:
    var btnProps =
    {
    title : "MENU ACTION CONTEXT",
    icon : "images/png/icon32.png",
    popup :
    {
    href : "addWindow.html",
    height : 420,
    width : 920
    }
    }

    FROM HERE. How to do that?
    */
    }
    }
    var item = menu.createItem(itemProps);
    menu.addItem(item);
    }
    else
    {
    console.error('Context Menu API not supported.');
    }
    }, false);

    The same code on pastebin: http://pastebin.com/v3Szi44U

    ToolBar button linked with my popup window(named AddWindow.html), by click on it, works great. Bum I'm need do the same from context menu item(open that popup window).

    How to do that?

    I already have plugins for newest Opera editions, but still need support Opera 12.16, that uses many users.

    Please, help me!

    With best regards, Alexandr.

    P.S. Sorry for unformatted post, I don't see any formatting tags.

  • The system uses "markdown", though I haven't got it all down yet. Sorry, can't help with code.

  • @sgunhouse: He's talking about extension code not the forum. No markdown there.

Log in to reply
 

Looks like your connection to Opera forums was lost, please wait while we try to reconnect.