Added a .gitignore and unified formatting.

Signed-off-by: retep998 <retep998@verizon.net>
This commit is contained in:
retep998 2013-02-26 11:53:38 -05:00
parent de90691234
commit 96a4d2d32f
5 changed files with 196 additions and 209 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.xpi
*.bat

View File

@ -2,19 +2,20 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
FBL.ns(function() { with (FBL) {
// Panel
var panelName = "firerecord";
FBL.ns(function () {
with (FBL) {
// Panel
var panelName = "firerecord";
/**
/**
* @panel This panel integrates with Firebug Inspector API and provides own logic
* and display of custom information for links. This code serves as an example of
* how to properly use and implement Inspector.
*/
function FireRecordPanel() {}
FireRecordPanel.prototype = extend(Firebug.Panel,
/** @lends LinkInspectorPanel */
{
function FireRecordPanel() { }
FireRecordPanel.prototype = extend(Firebug.Panel,
/** @lends LinkInspectorPanel */
{
name: panelName,
title: "Trial by Fire",
inspectable: true,
@ -23,22 +24,19 @@ FireRecordPanel.prototype = extend(Firebug.Panel,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Initialization
initialize: function()
{
initialize: function () {
Firebug.Panel.initialize.apply(this, arguments);
Firebug.Inspector.addListener(this);
},
destroy: function(state)
{
destroy: function (state) {
Firebug.Panel.destroy.apply(this, arguments);
Firebug.Inspector.removeListener(this);
},
show: function(state)
{
show: function (state) {
Firebug.Panel.show.apply(this, arguments);
FireRecordPlate.defaultContent.replace({}, this.panelNode);
@ -47,22 +45,19 @@ FireRecordPanel.prototype = extend(Firebug.Panel,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Inspector API implementation
startInspecting: function()
{
startInspecting: function () {
if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; startInspecting()");
},
inspectNode: function(node)
{
inspectNode: function (node) {
if (FBTrace.DBG_FIRERECORD)
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)
FBTrace.sysout("fire_record; stopInspecting(node: " + node.tagName +
", canceled: " + canceled + ")");
@ -73,23 +68,21 @@ FireRecordPanel.prototype = extend(Firebug.Panel,
if (node.href.indexOf("http") != 0)
return;
FireRecordPlate.linkPreview.replace({object: node}, this.panelNode);
FireRecordPlate.linkPreview.replace({ object: node }, this.panelNode);
},
supportsObject: function(object, type)
{
if (object instanceof Element)
{
if (object.tagName.toLowerCase() == "a"){
supportsObject: function (object, type) {
if (object instanceof Element) {
if (object.tagName.toLowerCase() == "a") {
return 1;
}
if (object.tagName.toLowerCase() == "button"){
if (object.tagName.toLowerCase() == "button") {
return 1;
}
if (object.tagName.toLowerCase() == "img"){
if (object.tagName.toLowerCase() == "img") {
return 1;
}
if (object.tagName.toLowerCase() == "input"){
if (object.tagName.toLowerCase() == "input") {
return 1;
}
}
@ -100,66 +93,61 @@ FireRecordPanel.prototype = extend(Firebug.Panel,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Inspector Listener
onStartInspecting: function(context)
{
onStartInspecting: function (context) {
if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; Listener.onStartInspecting(context: " +
context.getTitle() + ")");
},
onInspectNode: function(context, node)
{
onInspectNode: function (context, node) {
if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; Listener.onInspectNode(context: " +
context.getTitle() + ", node: " + node.tagName + ")");
},
onStopInspecting: function(context, node, canceled)
{
onStopInspecting: function (context, node, canceled) {
if (FBTrace.DBG_FIRERECORD)
FBTrace.sysout("fire_record; Listener.onStopInspecting(context: " +
context.getTitle() + ", node: " + node.tagName + ", canceled: " +
canceled + ")");
}
});
});
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
var FireRecordPlate = domplate(
{
var FireRecordPlate = domplate(
{
tName:
DIV({"class": "tName"}, "$object.id" ),
DIV({ "class": "tName" }, "$object.id"),
linkPreview:
IFRAME({"class": "linkPreview", "src": "$object.href"}),
IFRAME({ "class": "linkPreview", "src": "$object.href" }),
defaultContent:
DIV({"class": "defaultContent"},
DIV({ "class": "defaultContent" },
"Use Trial by Fire to record DOM events for later playback."
)
});
});
// ********************************************************************************************* //
// Module & Customizing Tracing
// ********************************************************************************************* //
// Module & Customizing Tracing
/**
/**
* @module The module object isn't really neccessary for the Inspector API. It serves
* only to support Firebug tracing console, which is useful when debugging inspector
* features.
*/
Firebug.FireRecordModule = extend(Firebug.Module,
/** @lends Firebug.FireRecordModule */
{
initialize: function()
Firebug.FireRecordModule = extend(Firebug.Module,
/** @lends Firebug.FireRecordModule */
{
initialize: function () {
Firebug.Module.initialize.apply(this, arguments);
if (Firebug.TraceModule)
Firebug.TraceModule.addListener(this);
},
shutdown: function()
{
shutdown: function () {
Firebug.Module.shutdown.apply(this, arguments);
if (Firebug.TraceModule)
@ -169,29 +157,27 @@ Firebug.FireRecordModule = extend(Firebug.Module,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Trace Listener
onLoadConsole: function(win, rootNode)
{
onLoadConsole: function (win, rootNode) {
appendStylesheet(rootNode.ownerDocument, "chrome://firerecord/skin/inspector.css");
},
onDump: function(message)
{
onDump: function (message) {
var index = message.text.indexOf("fire_record;");
if (index == 0)
{
if (index == 0) {
message.text = message.text.substr("fire_record;".length);
message.text = trim(message.text);
message.type = "DBG_FIRERECORD";
}
}
});
// Registration
Firebug.registerPanel(FireRecordPanel);
Firebug.registerModule(Firebug.FireRecordModule);
Firebug.registerStylesheet("chrome://firerecord/skin/inspector.css");
}
});
// Registration
Firebug.registerPanel(FireRecordPanel);
Firebug.registerModule(Firebug.FireRecordModule);
Firebug.registerStylesheet("chrome://firerecord/skin/inspector.css");
}});

View File

@ -1,6 +1,5 @@
<?xml version="1.0"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="chrome://firerecord/content/firerecord.js" type="application/x-javascript"/>
<script src="chrome://firerecord/content/firerecord.js" type="application/x-javascript"/>
</overlay>

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?><RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>firerecord@qcc.mass.edu</em:id>
@ -15,10 +15,10 @@
</em:targetApplication>
<!-- Extension -->
<em:name>Fire Record</em:name>
<em:name>FireRecord</em:name>
<em:description>Firebug Record Extension</em:description>
<em:creator>Csc-207 Quinsigamond Community College </em:creator>
<em:homepageURL>http://www.qcc.edu</em:homepageURL>
<em:creator>Quinsigamond Community College CSC 207</em:creator>
<em:homepageURL>http://qcccs.github.com/</em:homepageURL>
</Description>
</RDF>