home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / AIMP2 / aimp_2.61.583.exe / $TEMP / YandexPackSetup.msi / fil6A40BFFD7DA73967FBCE33CA7CA2C650 < prev    next >
Text File  |  2010-07-12  |  1KB  |  36 lines

  1. XB.UI.Behaviour.Url = XB.UI.Behaviour.extend({
  2.     name: "url",
  3.     
  4.     create: function() {
  5.         this.base();
  6.         this.parent.addURL(this);
  7.     },
  8.     
  9.     append: function () {
  10.     },
  11.     
  12.     destroy: function UIURL_Destroy() {
  13.         try {
  14.             this.parent.removeURL(this);
  15.         }
  16.         finally {
  17.             this.base();
  18.         }
  19.     },
  20.     
  21.     navigate: function UIURL_Navigate(eventInfo) {
  22.         var url = this.node.textContent,
  23.             action = this.attribute.action,
  24.             srcWnd = this.node.ownerDocument.defaultView,
  25.             widgetPrototype = this.getWidgetContainer().prototype;
  26.         
  27.         let target = this.attribute.target;
  28.         
  29.         if (eventInfo.keys.ctrl || eventInfo.keys.meta || eventInfo.mouse.button == 1)
  30.             target = "new tab";
  31.         else if (eventInfo.keys.shift)
  32.             target = "new window";
  33.         
  34.         XB._base.application.navigate(srcWnd, url, target, undefined, undefined, action, widgetPrototype);
  35.     }
  36. });