Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 23rd, 2012  |  syntax: JavaScript  |  size: 2.44 KB  |  views: 44  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. FBL.ns(function() { with (FBL) {
  3.  
  4.         const CLASS_ID = Components.ID("{5AAEB534-FA57-488d-9A73-20C258FC7BDB}");
  5.         const CLASS_NAME = "Firebug Channel Listener";
  6.         const CONTRACT_ID = "@joehewitt.com/firebug-channel-listener;1";
  7.  
  8.         const Cc = Components.classes;
  9.         const Ci = Components.interfaces;
  10.         const Cr = Components.results;
  11.         var FBTrace = {DBG_FAKE: "fake"};
  12.  
  13.  
  14.        
  15.        
  16. function swiftPanel() {}
  17. var spanel=null;
  18.  
  19. var SwiftConsoleListener =
  20. {
  21.     log: function(context, object, className, sourceLink)
  22.     {
  23.     },
  24.  
  25.     logFormatted: function(context, objects, className, sourceLink)
  26.     {
  27.     },
  28.    
  29.     logRowCreated: function(arr)
  30.     {
  31.         alert("log rwo");
  32.     }
  33. };
  34. swiftPanel.prototype = extend(Firebug.Panel,
  35. {
  36.     name: "swift",
  37.     title: "Swift",
  38.  
  39.     initialize: function() {
  40.  
  41.         spanel=this;
  42.  
  43.         if (FBTrace.DBG_FAKE)  // cause the detrace to remove this statement and check for cached tracer
  44.         {
  45.                 var tracerService=Cc["@joehewitt.com/firebug-trace-service;1"].getService(Ci.nsISupports)
  46.             .wrappedJSObject;
  47.                
  48.             FBTrace = tracerService.getTracer("extensions.firebug");
  49.             FBTrace.sysout("Initialize swift extension !!!");
  50.         }
  51.        
  52.         Firebug.Console.addListener(SwiftConsoleListener);
  53.        
  54.        
  55.         Firebug.Panel.initialize.apply(this, arguments);
  56.        
  57.     }
  58.  
  59. });
  60.  
  61.  
  62.  
  63. Firebug.swiftModel = extend(Firebug.A11yModel,
  64. {
  65.         initialize: function(){
  66.        
  67.                 Firebug.A11yModel.initialize.apply(this, arguments);
  68.        
  69.         },
  70.     showPanel: function(browser, panel) {
  71.        
  72.        
  73.         var isswiftPanel = panel && panel.name == "swift";
  74.         var swiftButtons = browser.chrome.$("fbswiftButtons");
  75.         collapse(swiftButtons, !isswiftPanel);
  76.        
  77.         if (!isswiftPanel) return;
  78.  
  79.         var doc = panel.document;
  80.         var swift_div = panel.panelNode;
  81.         //Firebug.ConsoleBase.log("Logging firebug");
  82.         if (!this.initialized) {
  83.             var t = doc.createTextNode('I am the Swift extension and I approved this message.');
  84.            
  85.             swift_div.appendChild(t);
  86.             this.initialized = true;
  87.         }
  88.     },
  89.     onLogRowCreated:function(panel,row)
  90.     {
  91.         alert('onlogrow');
  92.     },
  93.     onAboutButton: function(context) {
  94.         alert("Swift extension by Ravindra; http://www.snapfish.com");
  95.     }
  96. });
  97.  
  98.  
  99.  
  100. Firebug.registerPanel(swiftPanel);
  101. Firebug.registerModule(Firebug.swiftModel);
  102.  
  103. }});
clone this paste RAW Paste Data