Adjusted indentation.

Signed-off-by: retep998 <retep998@verizon.net>
This commit is contained in:
retep998 2013-03-05 11:27:30 -05:00
parent 9f008297ef
commit 4acd95d5b4
2 changed files with 232 additions and 256 deletions

View File

@ -2,7 +2,8 @@
* To change this template, choose Tools | Templates * To change this template, choose Tools | Templates
* and open the template in the editor. * and open the template in the editor.
*/ */
FBL.ns(function() { with (FBL) { FBL.ns(function () {
with (FBL) {
// Panel // Panel
var panelName = "firerecord"; var panelName = "firerecord";
@ -21,8 +22,7 @@ FireRecordPanel.prototype = extend(Firebug.Panel,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Initialization // Initialization
initialize: function() initialize: function () {
{
Firebug.Panel.initialize.apply(this, arguments); Firebug.Panel.initialize.apply(this, arguments);
if (FBTrace.DBG_ACTIVABLEPANEL) if (FBTrace.DBG_ACTIVABLEPANEL)
FBTrace.sysout("ActivablePanel.initialize;"); FBTrace.sysout("ActivablePanel.initialize;");
@ -30,29 +30,25 @@ FireRecordPanel.prototype = extend(Firebug.Panel,
}, },
destroy: function(state) destroy: function (state) {
{
Firebug.Panel.destroy.apply(this, arguments); Firebug.Panel.destroy.apply(this, arguments);
Firebug.Inspector.removeListener(this); Firebug.Inspector.removeListener(this);
}, },
show: function(state) show: function (state) {
{
Firebug.Panel.show.apply(this, arguments); Firebug.Panel.show.apply(this, arguments);
this.showToolbarButtons("panelButtons", true); this.showToolbarButtons("panelButtons", true);
FireRecordPlate.tag.replace({ array: inputArray }, this.panelNode); FireRecordPlate.tag.replace({ array: inputArray }, this.panelNode);
//FireRecordPlate.defaultContent.replace({}, this.panelNode); //FireRecordPlate.defaultContent.replace({}, this.panelNode);
}, },
getOptionsMenuItems: function(context) getOptionsMenuItems: function (context) {
{
return [ return [
// Will be resolved to "extensions.firebug.myoptionprefname" // Will be resolved to "extensions.firebug.myoptionprefname"
optionMenu("Custom Scripts", "myoptionprefname", "Allow Custom Script") optionMenu("Custom Scripts", "myoptionprefname", "Allow Custom Script")
]; ];
}, },
onActivationChanged: function(enable) onActivationChanged: function (enable) {
{
if (FBTrace.DBG_ACTIVABLEPANEL) if (FBTrace.DBG_ACTIVABLEPANEL)
FBTrace.sysout("ActivablePanel.onActivationChanged; " + enable); FBTrace.sysout("ActivablePanel.onActivationChanged; " + enable);
@ -64,22 +60,19 @@ FireRecordPanel.prototype = extend(Firebug.Panel,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Inspector API implementation // Inspector API implementation
startInspecting: function() startInspecting: function () {
{
if (FBTrace.DBG_FIRERECORD) if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; startInspecting()"); FBTrace.sysout("fire_record; startInspecting()");
}, },
inspectNode: function(node) inspectNode: function (node) {
{
if (FBTrace.DBG_FIRERECORD) if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; inspectNode(node: " + node.tagName + ")"); FBTrace.sysout("fire_record; inspectNode(node: " + node.tagName + ")");
FireRecordPlate.tName.replace({ object: node }, this.panelNode); FireRecordPlate.tName.replace({ object: node }, this.panelNode);
}, },
stopInspecting: function(node, canceled) stopInspecting: function (node, canceled) {
{
if (FBTrace.DBG_FIRERECORD) if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; stopInspecting(node: " + node.tagName + FBTrace.sysout("fire_record; stopInspecting(node: " + node.tagName +
", canceled: " + canceled + ")"); ", canceled: " + canceled + ")");
@ -93,10 +86,8 @@ FireRecordPanel.prototype = extend(Firebug.Panel,
FireRecordPlate.linkPreview.replace({ object: node }, this.panelNode); FireRecordPlate.linkPreview.replace({ object: node }, this.panelNode);
}, },
supportsObject: function(object, type) supportsObject: function (object, type) {
{ if (object instanceof Element) {
if (object instanceof Element)
{
if (object.tagName.toLowerCase() == "a") { if (object.tagName.toLowerCase() == "a") {
return 1; return 1;
} }
@ -117,22 +108,19 @@ FireRecordPanel.prototype = extend(Firebug.Panel,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Inspector Listener // Inspector Listener
onStartInspecting: function(context) onStartInspecting: function (context) {
{
if (FBTrace.DBG_FIRERECORD) if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; Listener.onStartInspecting(context: " + FBTrace.sysout("fire_record; Listener.onStartInspecting(context: " +
context.getTitle() + ")"); context.getTitle() + ")");
}, },
onInspectNode: function(context, node) onInspectNode: function (context, node) {
{
if (FBTrace.DBG_FIRERECORD) if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; Listener.onInspectNode(context: " + FBTrace.sysout("fire_record; Listener.onInspectNode(context: " +
context.getTitle() + ", node: " + node.tagName + ")"); context.getTitle() + ", node: " + node.tagName + ")");
}, },
onStopInspecting: function(context, node, canceled) onStopInspecting: function (context, node, canceled) {
{
if (FBTrace.DBG_FIRERECORD) if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; Listener.onStopInspecting(context: " + FBTrace.sysout("fire_record; Listener.onStopInspecting(context: " +
context.getTitle() + ", node: " + node.tagName + ", canceled: " + context.getTitle() + ", node: " + node.tagName + ", canceled: " +
@ -153,8 +141,7 @@ var FireRecordPlate = domplate(
) )
), ),
handleClick: function(event) handleClick: function (event) {
{
alert(event.target.innerHTML); alert(event.target.innerHTML);
} }
@ -190,71 +177,59 @@ var FireRecordPlate = domplate(
Firebug.FireRecordModule = extend(Firebug.ActivableModule, Firebug.FireRecordModule = extend(Firebug.ActivableModule,
/** @lends Firebug.FireRecordModule */ /** @lends Firebug.FireRecordModule */
{ {
initialize: function() initialize: function () {
{
Firebug.ActivableModule.initialize.apply(this, arguments); Firebug.ActivableModule.initialize.apply(this, arguments);
if (Firebug.TraceModule) if (Firebug.TraceModule)
Firebug.TraceModule.addListener(this); Firebug.TraceModule.addListener(this);
}, },
onMyButton: function() onMyButton: function () {
{
alert("hi"); alert("hi");
}, },
shutdown: function() shutdown: function () {
{
Firebug.ActivableModule.shutdown.apply(this, arguments); Firebug.ActivableModule.shutdown.apply(this, arguments);
if (Firebug.TraceModule) if (Firebug.TraceModule)
Firebug.TraceModule.removeListener(this); Firebug.TraceModule.removeListener(this);
}, },
onObserverChange: function(observer) onObserverChange: function (observer) {
{
if (FBTrace.DBG_ACTIVABLEPANEL) if (FBTrace.DBG_ACTIVABLEPANEL)
FBTrace.sysout("ActivableModule.onObserverChange;"); FBTrace.sysout("ActivableModule.onObserverChange;");
if (this.hasObservers()) if (this.hasObservers()) {
{
// There are observers (panels) using this model, let's activate necessary hooks. // There are observers (panels) using this model, let's activate necessary hooks.
} }
else else {
{
// There are no observer using this model, let's clean up registered hooks. // There are no observer using this model, let's clean up registered hooks.
} }
}, },
onSuspendFirebug: function(context) onSuspendFirebug: function (context) {
{
if (FBTrace.DBG_ACTIVABLEPANEL) if (FBTrace.DBG_ACTIVABLEPANEL)
FBTrace.sysout("ActivableModule.onSuspendFirebug;"); FBTrace.sysout("ActivableModule.onSuspendFirebug;");
}, },
// Called before any suspend actions. Firest caller to return true aborts suspend. // Called before any suspend actions. Firest caller to return true aborts suspend.
onSuspendingFirebug: function() onSuspendingFirebug: function () {
{
if (FBTrace.DBG_ACTIVABLEPANEL) if (FBTrace.DBG_ACTIVABLEPANEL)
FBTrace.sysout("ActivableModule.onSuspendingFirebug;"); FBTrace.sysout("ActivableModule.onSuspendingFirebug;");
}, },
onResumeFirebug: function(context) onResumeFirebug: function (context) {
{
if (FBTrace.DBG_ACTIVABLEPANEL) if (FBTrace.DBG_ACTIVABLEPANEL)
FBTrace.sysout("ActivableModule.onResumeFirebug;"); FBTrace.sysout("ActivableModule.onResumeFirebug;");
}, },
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Trace Listener // Trace Listener
onLoadConsole: function(win, rootNode) onLoadConsole: function (win, rootNode) {
{
appendStylesheet(rootNode.ownerDocument, "chrome://firerecord/skin/inspector.css"); appendStylesheet(rootNode.ownerDocument, "chrome://firerecord/skin/inspector.css");
}, },
onDump: function(message) onDump: function (message) {
{
var index = message.text.indexOf("fire_record;"); var index = message.text.indexOf("fire_record;");
if (index == 0) if (index == 0) {
{
message.text = message.text.substr("fire_record;".length); message.text = message.text.substr("fire_record;".length);
message.text = trim(message.text); message.text = trim(message.text);
message.type = "DBG_FIRERECORD"; message.type = "DBG_FIRERECORD";
@ -270,4 +245,5 @@ Firebug.registerModule(Firebug.FireRecordModule);
Firebug.registerStylesheet("chrome://firerecord/skin/inspector.css"); Firebug.registerStylesheet("chrome://firerecord/skin/inspector.css");
}}); }
});