1 /* See license.txt for terms of usage */
  2 
  3 define([
  4     "firebug/lib/object",
  5     "firebug/lib/xpcom",
  6     "firebug/lib/locale",
  7     "firebug/lib/events",
  8     "firebug/lib/options",
  9     "firebug/lib/deprecated",
 10     "firebug/lib/wrapper",
 11     "firebug/lib/url",
 12     "firebug/js/sourceLink",
 13     "firebug/js/stackFrame",
 14     "firebug/lib/css",
 15     "firebug/lib/dom",
 16     "firebug/lib/http",
 17     "firebug/chrome/window",
 18     "firebug/lib/search",
 19     "firebug/lib/xpath",
 20     "firebug/lib/string",
 21     "firebug/lib/xml",
 22     "firebug/lib/persist",
 23     "firebug/lib/array",
 24     "firebug/lib/system",
 25     "firebug/lib/json",
 26     "firebug/lib/fonts",
 27     "firebug/chrome/menu",
 28     "firebug/dom/toggleBranch",
 29     "firebug/trace/debug",
 30     "firebug/lib/keywords",
 31     "firebug/lib/domplate",
 32     "firebug/chrome/firefox"
 33 ],
 34 function(Obj, Xpcom, Locale, Events, Options, Deprecated, Wrapper, Url, SourceLink,
 35     StackFrame, Css, Dom, Http, Win, Search, Xpath, Str, Xml, Persist, Arr, System, Json,
 36     Fonts, Menu, ToggleBranch, Debug, Keywords, Domplate, Firefox) {
 37 // xxxFlorent: Check with  JSHint
 38 "use strict";
 39 // ********************************************************************************************* //
 40 
 41 var FBL = window.FBL || {};  // legacy.js adds top.FBL, FIXME, remove after iframe version 
 42 
 43 // ********************************************************************************************* //
 44 // xxxHonza: all deprecated API should be removed from 1.9+
 45 // All properties and methods of FBL namespace are deprecated.
 46 
 47 // Backward compatibility with extensions
 48 // deprecated
 49 
 50 // xxxFlorent: add a page in the wiki explaining how to use AMD in Firebug-related projects
 51 const deprecationMessage = "Don't use FBL anymore. Please, use AMD instead";
 52 
 53 var libs = [Obj, Xpcom, Locale, Events, Wrapper, Url, StackFrame, Css, Dom, Http, Win, Search,
 54 Xpath, Str, Xml, Persist, Arr, System, Json, Fonts, Menu, ToggleBranch, Debug, Keywords, Firefox, 
 55 Deprecated ,Domplate];
 56 
 57 libs.forEach(function(lib)
 58 {
 59     for (var p in lib)
 60         FBL[p] = Deprecated.deprecated(deprecationMessage, lib[p]);
 61 });
 62 
 63 Deprecated.deprecatedROProp(FBL, "SourceLink", deprecationMessage, SourceLink.SourceLink);
 64 
 65 // deprecated
 66 FBL.$ = Deprecated.deprecated("Use document.getElementById(id) instead", function(id, doc)
 67 {
 68     if (doc)
 69         return doc.getElementById(id);
 70     else
 71         return document.getElementById(id);
 72 });
 73 
 74 // xxxFlorent: it appears likely that this $break function is not used anywhere...
 75 //             StopIteration was private to domplate.js
 76 function StopIteration() {}
 77 
 78 FBL.$break = Deprecated.deprecated("Use the break statement instead", function()
 79 {
 80     throw StopIteration;
 81 });
 82 
 83 // deprecated
 84 var jsd = Components.classes["@mozilla.org/js/jsd/debugger-service;1"].
 85     getService(Components.interfaces.jsdIDebuggerService);
 86 
 87 Deprecated.deprecatedROProp(FBL, "jsd", "Access to JSD through Components.classes", jsd);
 88 
 89 // ********************************************************************************************* //
 90 // Constants
 91 
 92 try
 93 {
 94     Components.utils["import"]("resource://gre/modules/PluralForm.jsm");
 95     Components.utils["import"]("resource://firebug/firebug-service.js");
 96 
 97     // deprecated
 98 
 99     Deprecated.deprecatedROProp(FBL, "fbs", "Access to Firebug Service (FBS) through "+
100         "Components.utils", fbs);
101 }
102 catch (err)
103 {
104 }
105 
106 // deprecated
107 // FBL.reUpperCase = /[A-Z]/;
108 Deprecated.deprecatedROProp(FBL, "reUpperCase", "Use the following RegExp instead: /[A-Z]/",
109     /[A-Z]/);
110 
111 // ********************************************************************************************* //
112 // Registration
113 
114 return FBL;
115 
116 // ********************************************************************************************* //
117 });
118