Advertisement
Guest User

Old opra

a guest
Mar 4th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.addEventListener("load", function ()
  2. {
  3.     //Tool bar button
  4.     var btn;
  5.     var btnProps =
  6.     {
  7.         title : "MENU ACTION CONTEXT",
  8.         icon : "images/png/icon32.png",
  9.         popup :
  10.         {
  11.             href : "addWindow.html",
  12.             height : 420,
  13.             width : 920
  14.         }
  15.     }
  16.     btn = opera.contexts.toolbar.createItem(btnProps);
  17.     opera.contexts.toolbar.addItem(btn);
  18.  
  19.     //Context menu item
  20.     if (opera.contexts.menu)
  21.     {
  22.         var menu = opera.contexts.menu;
  23.         var itemProps =
  24.         {
  25.             title : 'MENU ACTION CONTEXT',
  26.             contexts: ['all'],
  27.             icon: 'images/png/icon16.png',
  28.             onclick : function (event)
  29.             {
  30.              /*
  31. I'm need Open this:
  32.     var btnProps =
  33.     {
  34.         title : "MENU ACTION CONTEXT",
  35.         icon : "images/png/icon32.png",
  36.         popup :
  37.         {
  38.             href : "addWindow.html",
  39.             height : 420,
  40.             width : 920
  41.         }
  42.     }
  43.  
  44. FROM HERE. How to do that?
  45.                      */
  46.             }
  47.         }
  48.         var item = menu.createItem(itemProps);
  49.         menu.addItem(item);
  50.     }
  51.     else
  52.     {
  53.         console.error('Context Menu API not supported.');
  54.     }
  55. }, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement