Firerecord
A few buttons to stop and start the system, the start of a menu.
This commit is contained in:
parent
d1f61241f9
commit
73c2b32aca
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +0,0 @@
|
||||
*.xpi
|
||||
*.suo
|
||||
*.sln
|
11
.project
Normal file
11
.project
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>FireRecord</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -1,5 +0,0 @@
|
||||
FireRecord
|
||||
============
|
||||
|
||||
A firebug plugin which provides web automation to do automated testing or mundane tasks.
|
||||
Developers: Peter Atechian, Rylan Doherty, David Westgate
|
@ -1,55 +0,0 @@
|
||||
<html>
|
||||
<head name="headName" id="headId">
|
||||
<script type="text/javascript" src="analyze.js"></script>
|
||||
<script type="text/javascript" src="listener.js"></script>
|
||||
</head>
|
||||
<body name="bodyName" id="bodyId">
|
||||
<title name="titleName" id="titleId">This is the title of the document</title>
|
||||
<br />
|
||||
<header name="headerName" id="headerId">
|
||||
This is the header<br />
|
||||
<nav name="navName" id="navId">This is the navigational menu</nav>
|
||||
<br />
|
||||
</header>
|
||||
<table name="tableName" id="tableId">
|
||||
<br />
|
||||
<th name="tableHeadName" id="tableHeadId">table heading</th>
|
||||
<br />
|
||||
<td>Table Cell</td>
|
||||
<br />
|
||||
</table>
|
||||
<h1 name="headingName" id="headingId">Level 1 Heading</h1>
|
||||
<br />
|
||||
<a href="#" id="anchorId" name="anchorName">Anchor</a><br />
|
||||
<object name="objectName" id="objectId">This is an object that normally holds a video but I'm too lazy to find one</object><br />
|
||||
<menu name="menuName" id="menuId">This is a menu</menu>
|
||||
<br />
|
||||
<img src="http://www.natural-environment.com/images/banners/banner_7_glasshouse_mountains.jpg" name="imageName" id="imageId"><br />
|
||||
<p name="paraName" id="paraId">This is a paragraph</p>
|
||||
<br />
|
||||
<q name="quoteName" id="quoteId">This is a quotation</q><br />
|
||||
<summary name="summaryName" id="summaryId">This is a summary</summary><br />
|
||||
<time name="timeName" id="timeId">This is a timestamp</time><br />
|
||||
<button value="button" type="button" name="buttonName" id="buttonId" onclick="analyze()">Analyze Javascript</button>
|
||||
<br />
|
||||
<hr name="horizontalRuleName" id="horizontalRuleId">
|
||||
<br />
|
||||
<form name="formName" id="formId">
|
||||
<br />
|
||||
<label name="labelName" id="labelId">This is a label</label><br />
|
||||
<select>
|
||||
<option value="volvo" name="volvoName" id="volvoId">Volvo</option>
|
||||
<option value="saab" name="saabName" id="saabId">Saab</option>
|
||||
<option value="mercedes" name="mercedesName" id="mercedesId">Mercedes</option>
|
||||
<option value="audi" name="audiName" id="audiId">Audi</option>
|
||||
</select>
|
||||
<input type="submit" value="Submit" name="submitButton" id="submitId"><br />
|
||||
</form>
|
||||
<ol name="orderedListName" id="orderListId">
|
||||
<li name="listItemName" id="listItemId">list item</li>
|
||||
</ol>
|
||||
<div name="divName" id="divId">div</div>
|
||||
<iframe src="http://www.google.com" name="iframeName" id="iframeId">This is an iframe</iframe>
|
||||
<footer name="footerName" id="footerId">This is the footer</footer>
|
||||
</body>
|
||||
</html>
|
120
analyze.js
120
analyze.js
@ -1,120 +0,0 @@
|
||||
function analyze() {
|
||||
var all = document.getElementsByTagName("*");
|
||||
for (var i = 0; i < all.length; ++i) {
|
||||
var info = new Array();
|
||||
var validtags = ["A", "BUTTON", "FORM", "IMG", "INPUT", "LINK", "OPTION", "SELECT", "TABLE", "TEXTAREA"];
|
||||
if (validtags.indexOf(all[i].tagName) < 0) continue;
|
||||
info[0] = all[i].tagName;
|
||||
switch (info[0]) {
|
||||
case "INPUT":
|
||||
info[1] = all[i].getAttribute("type");
|
||||
break;
|
||||
case "A":
|
||||
info[1] = all[i].getAttribute("href");
|
||||
break;
|
||||
case "BUTTON":
|
||||
info[1] = all[i].getAttribute("name");
|
||||
info[2] = all[i].getAttribute("type");
|
||||
info[3] = all[i].getAttribute("value");
|
||||
info[4] = all[i].getAttribute("form");
|
||||
break;
|
||||
case "FORM":
|
||||
info[1] = all[i].getAttribute("name");
|
||||
info[2] = all[i].getAttribute("length");
|
||||
info[3] = all[i].getAttribute("target");
|
||||
info[4] = all[i].getAttribute("action");
|
||||
break;
|
||||
case "IMG":
|
||||
info[1] = all[i].getAttribute("name");
|
||||
info[2] = all[i].getAttribute("src");
|
||||
info[3] = all[i].getAttribute("align");
|
||||
break;
|
||||
case "INPUT":
|
||||
info[1] = all[i].getAttribute("name");
|
||||
info[2] = all[i].getAttribute("type");
|
||||
info[3] = all[i].getAttribute("value");
|
||||
break;
|
||||
case "LINK":
|
||||
info[1] = all[i].getAttribute("href");
|
||||
info[2] = all[i].getAttribute("type");
|
||||
info[3] = all[i].getAttribute("charset");
|
||||
break;
|
||||
case "OPTION":
|
||||
info[1] = all[i].getAttribute("text");
|
||||
info[2] = all[i].getAttribute("value");
|
||||
info[3] = all[i].getAttribute("index");
|
||||
break;
|
||||
case "SELECT":
|
||||
info[1] = all[i].getAttribute("type");
|
||||
info[2] = all[i].getAttribute("name");
|
||||
info[3] = all[i].getAttribute("size");
|
||||
break;
|
||||
case "TABLE":
|
||||
info[1] = all[i].getAttribute("summmary");
|
||||
info[2] = all[i].getAttribute("caption");
|
||||
break;
|
||||
case "TEXTAREA":
|
||||
info[1] = all[i].getAttribute("name");
|
||||
info[2] = all[i].getAttribute("type");
|
||||
info[3] = all[i].getAttribute("value");
|
||||
break;
|
||||
|
||||
}
|
||||
generatescript(info);
|
||||
}
|
||||
}
|
||||
function generatescript(info) {
|
||||
var command;
|
||||
switch (info[0]) {
|
||||
case "A":
|
||||
command = "window.location.href = '" + info[1] + "';"
|
||||
break;
|
||||
case "BUTTON":
|
||||
command = "button.name = '" + info[1] + "';"
|
||||
+ "button.type = '" + info[2] + "';"
|
||||
+ "button.value = '" + info[3] + "';"
|
||||
+ "button.form = '" + info[4] + "';";
|
||||
break;
|
||||
case "FORM":
|
||||
command = "form.name = '" + info[1] + "';"
|
||||
+ "form.length = '" + info[2] + "';"
|
||||
+ "form.target = '" + info[3] + "';"
|
||||
+ "form.action = '" + info[4] + "';";
|
||||
break;
|
||||
case "IMG":
|
||||
command = "img.name = '" + info[1] + "';"
|
||||
+ "img.src = '" + info[2] + "';"
|
||||
+ "img.align = '" + info[3] + "';";
|
||||
break;
|
||||
case "INPUT":
|
||||
command = "input.name = '" + info[1] + "';"
|
||||
+ "input.type = '" + info[2] + "';"
|
||||
+ "input.value = '" + info[3] + "';";
|
||||
break;
|
||||
case "LINK":
|
||||
command = "link.href = '" + info[1] + "';"
|
||||
+ "link.type = '" + info[2] + "';"
|
||||
+ "link.charset = '" + info[3] + "';";
|
||||
break;
|
||||
case "OPTION":
|
||||
command = "option.text = '" + info[1] + "';"
|
||||
+ "option.value = '" + info[2] + "';"
|
||||
+ "option.index = '" + info[3] + "';";
|
||||
break;
|
||||
case "SELECT":
|
||||
command = "select.type = '" + info[1] + "';"
|
||||
+ "select.name = '" + info[2] + "';"
|
||||
+ "select.size = '" + info[3] + "';";
|
||||
break;
|
||||
case "TABLE":
|
||||
command = "table.summary = '" + info[1] + "';"
|
||||
+ "table.caption = '" + info[2] + "';";
|
||||
break;
|
||||
case "TEXTAREA":
|
||||
command = "window.location.name = '" + info[1] + "';"
|
||||
+ "table.type = '" + info[2] + "';"
|
||||
+ "table.value = '" + info[3] + "';";
|
||||
break;
|
||||
}
|
||||
alert(command);
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
if exist "C:\Program Files\7-Zip\7z.exe" (
|
||||
"C:\Program Files\7-Zip\7z.exe" a FireRecord.zip chrome defaults chrome.manifest install.rdf
|
||||
) else if exist "C:\Program Files (x86)\7-Zip\7z.exe" (
|
||||
"C:\Program Files (x86)\7-Zip\7z.exe" a FireRecord.zip chrome defaults chrome.manifest install.rdf
|
||||
) else (
|
||||
"C:\Program Files\WinRAR\rar.exe" a FireRecord.zip chrome defaults chrome.manifest install.rdf
|
||||
)
|
||||
move FireRecord.zip FireRecord.xpi
|
||||
start "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" FireRecord.xpi
|
@ -1,3 +1,8 @@
|
||||
content firerecord chrome/content/
|
||||
skin firerecord classic/1.0 chrome/skin/classic/
|
||||
overlay chrome://firebug/content/firebugOverlay.xul chrome://firerecord/content/firerecord.xul
|
||||
content firerecord chrome/content/ contentaccessible=yes
|
||||
overlay chrome://browser/content/browser.xul chrome://firerecord/content/browserx.xul
|
||||
|
||||
locale firerecord en-US locale/en-US/
|
||||
|
||||
skin firerecord classic/1.0 skin/
|
||||
style chrome://global/content/customizeToolbar.xul chrome://firerecord/skin/skin.css
|
43
chrome/content/browserx.xul
Normal file
43
chrome/content/browserx.xul
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://linktargetfinder/skin/skin.css" type="text/css"?>
|
||||
<!DOCTYPE firerecord SYSTEM "chrome://firerecord/locale/translations.dtd">
|
||||
<overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script src="firerecord.js" />
|
||||
|
||||
<menupopup id="menu_ToolsPopup">
|
||||
<menuitem label="&runlinktargetfinder;" key="link-target-finder-run-key" oncommand="firerecord.run()"/>
|
||||
</menupopup>
|
||||
<toolbox>
|
||||
<menubar id="xulschoolhello-menubar">
|
||||
<menu id="xulschoolhello-greeting-menu" label="testing">
|
||||
<menupopup>
|
||||
<menuitem label="Nothing Yet"
|
||||
oncommand ="firerecord.file()"/>
|
||||
|
||||
</menupopup>
|
||||
|
||||
|
||||
|
||||
</menu>
|
||||
</menubar>
|
||||
</toolbox>
|
||||
<keyset>
|
||||
<key id="link-target-finder-run-key" modifiers="accel alt shift" key="L" oncommand="firerecord.run()"/>
|
||||
</keyset>
|
||||
|
||||
<toolbar id="status-bar">
|
||||
<statusbarpanel id="link-target-finder-status-bar-icon" label="Record" class="statusbarpanel-iconic" src="chrome://firerecord/skin/toolbar-large.png" tooltiptext="&runlinktargetfinder;" onclick="firerecord.run()" />
|
||||
|
||||
</toolbar>
|
||||
<toolbar id="status-bar">
|
||||
<statusbarpanel id="Recording" type="menu" role="button" label="Record" class="statusbarpanel-iconic" src="chrome://firerecord/skin/toolbar-large.png" tooltiptext="Page to Page Recording" onclick="firerecord.running()" />
|
||||
|
||||
</toolbar>
|
||||
|
||||
<toolbarpalette id="BrowserToolbarPalette">
|
||||
<toolbarbutton id="link-target-finder-toolbar-button" label="firerecord:" class="statusbarpanel-iconic" src="chrome://firerecord/skin/toolbar-large.png" tooltiptext="&runlinktargetfinder;" oncommand="firerecord.run()"/>
|
||||
</toolbarpalette>
|
||||
|
||||
<input type="file" id="upload" name="upload"/>
|
||||
|
||||
</overlay>
|
@ -1,249 +1,258 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
FBL.ns(function () {
|
||||
with (FBL) {
|
||||
// Panel
|
||||
var panelName = "firerecord";
|
||||
var recordingx = false;
|
||||
|
||||
/**
|
||||
* @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 */
|
||||
{
|
||||
name: panelName,
|
||||
title: "FireRecord",
|
||||
window.addEventListener("load", function load(event) {
|
||||
window.removeEventListener("load", load, false); //remove listener, no longer needed
|
||||
firerecord.init();
|
||||
}, false);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Initialization
|
||||
|
||||
initialize: function () {
|
||||
Firebug.Panel.initialize.apply(this, arguments);
|
||||
if (FBTrace.DBG_ACTIVABLEPANEL)
|
||||
FBTrace.sysout("ActivablePanel.initialize;");
|
||||
Firebug.Inspector.addListener(this);
|
||||
|
||||
},
|
||||
|
||||
destroy: function (state) {
|
||||
Firebug.Panel.destroy.apply(this, arguments);
|
||||
|
||||
Firebug.Inspector.removeListener(this);
|
||||
},
|
||||
|
||||
show: function (state) {
|
||||
Firebug.Panel.show.apply(this, arguments);
|
||||
this.showToolbarButtons("panelButtons", true);
|
||||
FireRecordPlate.tag.replace({ array: inputArray }, this.panelNode);
|
||||
//FireRecordPlate.defaultContent.replace({}, this.panelNode);
|
||||
},
|
||||
getOptionsMenuItems: function (context) {
|
||||
return [
|
||||
// Will be resolved to "extensions.firebug.myoptionprefname"
|
||||
optionMenu("Custom Scripts", "myoptionprefname", "Allow Custom Script")
|
||||
];
|
||||
},
|
||||
onActivationChanged: function (enable) {
|
||||
if (FBTrace.DBG_ACTIVABLEPANEL)
|
||||
FBTrace.sysout("ActivablePanel.onActivationChanged; " + enable);
|
||||
|
||||
if (enable)
|
||||
Firebug.MyActivableModule.addObserver(this);
|
||||
else
|
||||
Firebug.MyActivableModule.removeObserver(this);
|
||||
},
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Inspector API implementation
|
||||
|
||||
startInspecting: function () {
|
||||
if (FBTrace.DBG_FIRERECORD)
|
||||
FBTrace.sysout("fire_record; startInspecting()");
|
||||
},
|
||||
|
||||
inspectNode: function (node) {
|
||||
if (FBTrace.DBG_FIRERECORD)
|
||||
FBTrace.sysout("fire_record; inspectNode(node: " + node.tagName + ")");
|
||||
|
||||
FireRecordPlate.tName.replace({ object: node }, this.panelNode);
|
||||
},
|
||||
|
||||
stopInspecting: function (node, canceled) {
|
||||
if (FBTrace.DBG_FIRERECORD)
|
||||
FBTrace.sysout("fire_record; stopInspecting(node: " + node.tagName +
|
||||
", canceled: " + canceled + ")");
|
||||
|
||||
if (canceled)
|
||||
return;
|
||||
|
||||
if (node.href.indexOf("http") != 0)
|
||||
return;
|
||||
|
||||
FireRecordPlate.linkPreview.replace({ object: node }, this.panelNode);
|
||||
},
|
||||
|
||||
supportsObject: function (object, type) {
|
||||
if (object instanceof Element) {
|
||||
if (object.tagName.toLowerCase() == "a") {
|
||||
return 1;
|
||||
var firerecord = function () {
|
||||
var prefManager = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
||||
return {
|
||||
init: function () {
|
||||
var appcontent = document.getElementById("appcontent"); // browser
|
||||
if (appcontent) {
|
||||
appcontent.addEventListener("DOMContentLoaded", firerecord.run, true);
|
||||
}
|
||||
if (object.tagName.toLowerCase() == "button") {
|
||||
return 1;
|
||||
},
|
||||
running: function (){
|
||||
if(recordingx){
|
||||
recordingx = false;
|
||||
alert("Stop Listen");
|
||||
//document.location.reload();
|
||||
//closes all tabs on firefox.
|
||||
}
|
||||
if (object.tagName.toLowerCase() == "img") {
|
||||
return 1;
|
||||
else{
|
||||
recordingx = true;
|
||||
alert("Start Listen");
|
||||
firerecord.run();
|
||||
}
|
||||
if (object.tagName.toLowerCase() == "input") {
|
||||
return 1;
|
||||
|
||||
},
|
||||
file: function(){
|
||||
|
||||
|
||||
},
|
||||
run : function () {
|
||||
var head = content.document.getElementsByTagName("head")[0],
|
||||
style = content.document.getElementById("link-target-finder-style"),
|
||||
all = content.document.getElementsByTagName("*"),
|
||||
foundElements = 0;
|
||||
|
||||
var info = new Array(); // Made this global
|
||||
var Recording = true; // Just need this until we finish with the the buttons.
|
||||
|
||||
if (!style) {
|
||||
style = content.document.createElement("link");
|
||||
style.id = "link-target-finder-style";
|
||||
style.type = "text/css";
|
||||
style.rel = "stylesheet";
|
||||
style.href = "chrome://firerecord/skin/skin.css";
|
||||
head.appendChild(style);
|
||||
}
|
||||
|
||||
// Find all elements attributes and add a listener
|
||||
//-----------------------------------------------------------
|
||||
// Add author(s) to this section. Who did this? David and Peter?
|
||||
for (var i = 0; i < all.length; ++i) {
|
||||
//Define the classname variable
|
||||
elm = all[i];
|
||||
//deleted local call to new array info
|
||||
var validtags = ["A", "BUTTON", "FORM", "IMG", "INPUT", "LINK", "OPTION", "SELECT", "TABLE", "TEXTAREA"];
|
||||
//Add a click event listener to all the valid tags.
|
||||
if (validtags.indexOf(all[i].tagName) < 0) continue;
|
||||
|
||||
info[0] = all[i].tagName;
|
||||
|
||||
//Feel free to change this to a for each...
|
||||
if(recordingx){
|
||||
switch (info[0]) {
|
||||
//All of these cases need null checks for each attribute.
|
||||
case "INPUT":
|
||||
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleType, false);
|
||||
break;
|
||||
case "A":
|
||||
|
||||
elm.addEventListener("click", handleEvent);
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
case "BUTTON":
|
||||
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
case "FORM":
|
||||
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
case "IMG":
|
||||
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
case "INPUT":
|
||||
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
case "LINK":
|
||||
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
case "OPTION":
|
||||
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
case "SELECT":
|
||||
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
case "TABLE":
|
||||
info[1] = all[i].getAttribute("summmary");
|
||||
info[2] = all[i].getAttribute("caption");
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
case "TEXTAREA":
|
||||
elm.className += ((elm.className.length > 0) ? " " : "") + "link-target-finder-selected";
|
||||
elm.addEventListener("click", handleEvent, false);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
},
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Inspector Listener
|
||||
|
||||
onStartInspecting: function (context) {
|
||||
if (FBTrace.DBG_FIRERECORD)
|
||||
FBTrace.sysout("fire_record; Listener.onStartInspecting(context: " +
|
||||
context.getTitle() + ")");
|
||||
},
|
||||
|
||||
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) {
|
||||
if (FBTrace.DBG_FIRERECORD)
|
||||
FBTrace.sysout("fire_record; Listener.onStopInspecting(context: " +
|
||||
context.getTitle() + ", node: " + node.tagName + ", canceled: " +
|
||||
canceled + ")");
|
||||
}
|
||||
});
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
var inputArray = ["red", "green", "blue", "white"];
|
||||
|
||||
var FireRecordPlate = domplate(
|
||||
{
|
||||
tag:
|
||||
FOR("item", "$array",
|
||||
DIV({ onclick: "$handleClick" },
|
||||
|
||||
"$item"
|
||||
)
|
||||
),
|
||||
|
||||
handleClick: function (event) {
|
||||
|
||||
alert(event.target.innerHTML);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/*var FireRecordPlate = domplate(
|
||||
{
|
||||
|
||||
|
||||
tName:
|
||||
DIV({"class": "tName"}, "$object.id" ),
|
||||
|
||||
linkPreview:
|
||||
IFRAME({"class": "linkPreview", "src": "$object.href"}),
|
||||
|
||||
defaultContent:
|
||||
DIV({"class": "defaultContent"},
|
||||
"Use Trial by Fire to record DOM events for later playback."
|
||||
)
|
||||
});*/
|
||||
|
||||
// ********************************************************************************************* //
|
||||
// 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.ActivableModule,
|
||||
/** @lends Firebug.FireRecordModule */
|
||||
{
|
||||
initialize: function () {
|
||||
Firebug.ActivableModule.initialize.apply(this, arguments);
|
||||
|
||||
if (Firebug.TraceModule)
|
||||
Firebug.TraceModule.addListener(this);
|
||||
},
|
||||
|
||||
onMyButton: function () {
|
||||
alert("hi");
|
||||
},
|
||||
shutdown: function () {
|
||||
Firebug.ActivableModule.shutdown.apply(this, arguments);
|
||||
|
||||
if (Firebug.TraceModule)
|
||||
Firebug.TraceModule.removeListener(this);
|
||||
},
|
||||
onObserverChange: function (observer) {
|
||||
if (FBTrace.DBG_ACTIVABLEPANEL)
|
||||
FBTrace.sysout("ActivableModule.onObserverChange;");
|
||||
|
||||
if (this.hasObservers()) {
|
||||
// There are observers (panels) using this model, let's activate necessary hooks.
|
||||
}
|
||||
else {
|
||||
// There are no observer using this model, let's clean up registered hooks.
|
||||
}
|
||||
},
|
||||
|
||||
onSuspendFirebug: function (context) {
|
||||
if (FBTrace.DBG_ACTIVABLEPANEL)
|
||||
FBTrace.sysout("ActivableModule.onSuspendFirebug;");
|
||||
},
|
||||
|
||||
// Called before any suspend actions. Firest caller to return true aborts suspend.
|
||||
onSuspendingFirebug: function () {
|
||||
if (FBTrace.DBG_ACTIVABLEPANEL)
|
||||
FBTrace.sysout("ActivableModule.onSuspendingFirebug;");
|
||||
},
|
||||
|
||||
onResumeFirebug: function (context) {
|
||||
if (FBTrace.DBG_ACTIVABLEPANEL)
|
||||
FBTrace.sysout("ActivableModule.onResumeFirebug;");
|
||||
},
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Trace Listener
|
||||
|
||||
onLoadConsole: function (win, rootNode) {
|
||||
appendStylesheet(rootNode.ownerDocument, "chrome://firerecord/skin/inspector.css");
|
||||
},
|
||||
|
||||
onDump: function (message) {
|
||||
var index = message.text.indexOf("fire_record;");
|
||||
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");
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
//Need to add author to this part...
|
||||
//Need to add author to this part...
|
||||
function handleEvent(e) {
|
||||
var targ;
|
||||
if (!e) {
|
||||
var e = window.event;
|
||||
}
|
||||
if (e.target) {
|
||||
targ = e.target;
|
||||
}
|
||||
else if (e.srcElement) {
|
||||
targ = e.srcElement;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
//_____________________________________________________________________
|
||||
var tname;
|
||||
var taginfo = new Array();
|
||||
tname = targ.tagName;
|
||||
taginfo[0] = tname;
|
||||
|
||||
//Feel free to change this to a for each...
|
||||
switch (tname) {
|
||||
//All of these cases need null checks for each attribute.
|
||||
|
||||
case "A":
|
||||
taginfo[1] = targ.href;
|
||||
|
||||
break;
|
||||
case "BUTTON":
|
||||
taginfo[1] = targ.name;
|
||||
taginfo[2] = targ.type;
|
||||
taginfo[3] = targ.value;
|
||||
taginfo[4] = targ.form;
|
||||
|
||||
break;
|
||||
case "FORM":
|
||||
taginfo[1] = targ.name;
|
||||
taginfo[2] = targ.length;
|
||||
taginfo[3] = targ.target;
|
||||
taginfo[4] = targ.action;
|
||||
|
||||
break;
|
||||
case "IMG":
|
||||
taginfo[1] = targ.name;
|
||||
taginfo[2] = targ.src;
|
||||
|
||||
break;
|
||||
case "INPUT":
|
||||
taginfo[1] = targ.name;
|
||||
taginfo[2] = targ.type;
|
||||
taginfo[3] = targ.value;
|
||||
|
||||
break;
|
||||
case "LINK":
|
||||
taginfo[1] = targ.href;
|
||||
taginfo[2] = targ.type;
|
||||
taginfo[3] = targ.charset;
|
||||
|
||||
break;
|
||||
case "OPTION":
|
||||
taginfo[1] = targ.text;
|
||||
taginfo[2] = targ.value;
|
||||
taginfo[3] = targ.index;
|
||||
|
||||
break;
|
||||
case "SELECT":
|
||||
taginfo[1] = targ.type;
|
||||
taginfo[2] = targ.name;
|
||||
taginfo[3] = targ.size;
|
||||
|
||||
break;
|
||||
case "TABLE":
|
||||
taginfo[1] = targ.summmary;
|
||||
taginfo[2] = targ.caption;
|
||||
|
||||
break;
|
||||
case "TEXTAREA":
|
||||
taginfo[1] = targ.name;
|
||||
taginfo[2] = targ.type;
|
||||
taginfo[3] = targ.value;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
alert(window.content.location.href);
|
||||
if(!taginfo[1]){
|
||||
taginfo[1]= "null";
|
||||
}
|
||||
if(!taginfo[2]){
|
||||
taginfo[2]= "null";
|
||||
}
|
||||
if(!taginfo[3]){
|
||||
taginfo[3]= "null";
|
||||
}
|
||||
if(!taginfo[4]){
|
||||
taginfo[4]= "null";
|
||||
}
|
||||
alert("You clicked on a " + tname + " with info \n " + taginfo[1] + "\n"+ taginfo[2]+"\n"+taginfo[3]+"\n"+" saving... " + taginfo.join('::'));
|
||||
|
||||
e.cancelBubble = true;
|
||||
|
||||
};
|
||||
|
||||
}();
|
||||
function handleType(e) {
|
||||
var targ;
|
||||
if (!e) {
|
||||
var e = window.event;
|
||||
}
|
||||
if (e.target) {
|
||||
targ = e.target;
|
||||
}
|
||||
else if (e.srcElement) {
|
||||
targ = e.srcElement;
|
||||
}
|
||||
alert("Type Changed");
|
||||
e.cancelBubble = true;
|
||||
}
|
||||
|
@ -1,29 +0,0 @@
|
||||
<?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"/>
|
||||
|
||||
|
||||
<commandset id="mainCommandSet">
|
||||
<command id="cmd_activablePanelAction" oncommand="Firebug.FireRecordModule.onMyButton(FirebugContext)"/>
|
||||
</commandset>
|
||||
|
||||
<toolbar id="fbToolbar" align="center">
|
||||
<hbox id="fbToolbarInner" insertbefore="fbDetachButton" flex="1" align="center">
|
||||
<hbox id="panelButtons" insertafter="fbNetButtons">
|
||||
<toolbarbutton id="activablePanelButton"
|
||||
|
||||
command="cmd_activablePanelAction"
|
||||
image ="http://www.veryicon.com/icon/png/System/Developpers/Record%20Button.png"/>
|
||||
<toolbarbutton id="activablePanelButton2"
|
||||
|
||||
command="cmd_activablePanelAction"
|
||||
image ="http://img404.imageshack.us/img404/8438/playva.png" />
|
||||
<toolbarbutton id="activablePanelButton3"
|
||||
|
||||
command="cmd_activablePanelAction"
|
||||
image = "http://img201.imageshack.us/img201/6639/editksz.png"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</toolbar>
|
||||
</overlay>
|
31
chrome/content/options.xul
Normal file
31
chrome/content/options.xul
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<prefwindow
|
||||
title="FireRecord Preferences"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<prefpane label="FireRecord Preferences">
|
||||
<preferences>
|
||||
<preference id="link-target-finder-autorun" name="extensions.firerecord.autorun" type="bool"/>
|
||||
</preferences>
|
||||
|
||||
<groupbox>
|
||||
<caption label="Settings"/>
|
||||
<grid>
|
||||
<columns>
|
||||
<column flex="4"/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label control="autorun" value="Autorun"/>
|
||||
<checkbox id="autorun" preference="link-target-finder-autorun"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
</prefpane>
|
||||
|
||||
</prefwindow>
|
@ -1,34 +0,0 @@
|
||||
/* See license.txt for terms of usage */
|
||||
|
||||
/*************************************************************************************************/
|
||||
|
||||
/* Style applied on the panel node. */
|
||||
.panelNode-firerecord {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.defaultContent {
|
||||
text-align: center;
|
||||
padding-top: 30px;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.linkUrl {
|
||||
text-align: center;
|
||||
padding-top: 30px;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.linkPreview {
|
||||
border: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/*************************************************************************************************/
|
||||
|
||||
/* Firebug Tracing Console customization. All messages from this example use this color.
|
||||
This helps to distinguish logs from those coming from Firebug */
|
||||
.DBG_FIRERECORD {
|
||||
color: rgb(0, 101, 114);
|
||||
}
|
@ -1 +1 @@
|
||||
pref("extensions.firebug.DBG_FIRERECORD", true);
|
||||
pref("extensions.firerecord.autorun", true);
|
26
install.rdf
26
install.rdf
@ -1,25 +1,23 @@
|
||||
<?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#">
|
||||
<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>
|
||||
<em:version>0.0.2</em:version>
|
||||
<em:id>csc207qc@gmail.com</em:id>
|
||||
<em:name>Fire Record</em:name>
|
||||
<em:version>.8</em:version>
|
||||
<em:type>2</em:type>
|
||||
<em:creator>Quinsigamond Community College CS207</em:creator>
|
||||
<em:description>Records Browsing</em:description>
|
||||
<em:homepageURL>http://www.qcc.edu/</em:homepageURL>
|
||||
<em:optionsURL>chrome://firerecord/content/options.xul</em:optionsURL>
|
||||
|
||||
<!-- Firefox -->
|
||||
<em:targetApplication>
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>1.5</em:minVersion>
|
||||
<em:maxVersion>18.*</em:maxVersion>
|
||||
<em:minVersion>4.0</em:minVersion>
|
||||
<em:maxVersion>20.0.1</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
<!-- Extension -->
|
||||
<em:name>FireRecord</em:name>
|
||||
<em:description>Firebug Record Extension</em:description>
|
||||
<em:creator>Quinsigamond Community College CSC 207</em:creator>
|
||||
<em:homepageURL>http://qcccs.github.com/</em:homepageURL>
|
||||
</Description>
|
||||
</RDF>
|
||||
|
||||
|
||||
|
@ -1,82 +0,0 @@
|
||||
<html>
|
||||
<head name="headName" id="headId">
|
||||
</head>
|
||||
<script>
|
||||
var spans = document.getElementsByTagName("*");
|
||||
if (window.attachEvent) { window.attachEvent('onload', your_function); }
|
||||
else if (window.addEventListener) { window.addEventListener('load', your_function, false); }
|
||||
else { document.addEventListener('load', your_function, false); }
|
||||
for (i = 0; i < spans.length; i++)
|
||||
spans[i].addEventListener("click", this.doSomething);
|
||||
function your_function() {
|
||||
alert("Done Loading!");
|
||||
}
|
||||
function doSomething(e) {
|
||||
var targ;
|
||||
if (!e) {
|
||||
var e = window.event;
|
||||
}
|
||||
if (e.target) {
|
||||
targ = e.target;
|
||||
}
|
||||
else if (e.srcElement) {
|
||||
targ = e.srcElement;
|
||||
}
|
||||
var tname;
|
||||
var idname;
|
||||
|
||||
idname = targ.id;
|
||||
tname = targ.tagName;
|
||||
alert("You clicked on a " + tname + " element. Named " + idname + ".");
|
||||
}
|
||||
</script>
|
||||
<body name="bodyName" id="bodyId">
|
||||
<title name="titleName" id="titleId">This is the title of the document</title>
|
||||
<br />
|
||||
<header name="headerName" id="headerId">
|
||||
This is the header<br />
|
||||
<nav name="navName" id="navId">This is the navigational menu</nav>
|
||||
<br />
|
||||
</header>
|
||||
<table name="tableName" id="tableId">
|
||||
<br />
|
||||
<th name="tableHeadName" id="tableHeadId">table heading</th>
|
||||
<br />
|
||||
<td>Table Cell</td>
|
||||
<br />
|
||||
</table>
|
||||
<h1 name="headingName" id="headingId">Level 1 Heading</h1>
|
||||
<br />
|
||||
<a href="#" id="anchorId" name="anchorName">Anchor</a><br />
|
||||
<object name="objectName" id="objectId">This is an object that normally holds a video but I'm too lazy to find one</object><br />
|
||||
<menu name="menuName" id="menuId">This is a menu</menu>
|
||||
<br />
|
||||
<img src="http://www.natural-environment.com/images/banners/banner_7_glasshouse_mountains.jpg" name="imageName" id="imageId"><br />
|
||||
<p name="paraName" id="paraId">This is a paragraph</p>
|
||||
<br />
|
||||
<q name="quoteName" id="quoteId">This is a quotation</q><br />
|
||||
<summary name="summaryName" id="summaryId">This is a summary</summary><br />
|
||||
<time name="timeName" id="timeId">This is a timestamp</time><br />
|
||||
<button value="button" type="button" name="buttonName" id="buttonId">Click Me!</button>
|
||||
<br />
|
||||
<hr name="horizontalRuleName" id="horizontalRuleId">
|
||||
<br />
|
||||
<form name="formName" id="formId">
|
||||
<br />
|
||||
<label name="labelName" id="labelId">This is a label</label><br />
|
||||
<select>
|
||||
<option value="volvo" name="volvoName" id="volvoId">Volvo</option>
|
||||
<option value="saab" name="saabName" id="saabId">Saab</option>
|
||||
<option value="mercedes" name="mercedesName" id="mercedesId">Mercedes</option>
|
||||
<option value="audi" name="audiName" id="audiId">Audi</option>
|
||||
</select>
|
||||
<input type="submit" value="Submit" name="submitButton" id="submitId"><br />
|
||||
</form>
|
||||
<ol name="orderedListName" id="orderListId">
|
||||
<li name="listItemName" id="listItemId">list item</li>
|
||||
</ol>
|
||||
<div name="divName" id="divId">div</div>
|
||||
<iframe src="http://www.google.com" name="iframeName" id="iframeId">This is an iframe</iframe>
|
||||
<footer name="footerName" id="footerId">This is the footer</footer>
|
||||
</body>
|
||||
</html>
|
27
listener.js
27
listener.js
@ -1,27 +0,0 @@
|
||||
var spans = document.getElementsByTagName("*");
|
||||
if (window.attachEvent) { window.attachEvent('onload', your_function); }
|
||||
else if (window.addEventListener) { window.addEventListener('load', your_function, false); }
|
||||
else { document.addEventListener('load', your_function, false); }
|
||||
for (i = 0; i < spans.length; i++)
|
||||
spans[i].addEventListener("click", this.doSomething);
|
||||
function your_function() {
|
||||
alert("Done Loading!");
|
||||
}
|
||||
function doSomething(e) {
|
||||
var targ;
|
||||
if (!e) {
|
||||
var e = window.event;
|
||||
}
|
||||
if (e.target) {
|
||||
targ = e.target;
|
||||
}
|
||||
else if (e.srcElement) {
|
||||
targ = e.srcElement;
|
||||
}
|
||||
var tname;
|
||||
var idname;
|
||||
|
||||
idname = targ.id;
|
||||
tname = targ.tagName;
|
||||
alert("You clicked on a " + tname + " element. Named " + idname + ".");
|
||||
}
|
BIN
locale.xpi
Normal file
BIN
locale.xpi
Normal file
Binary file not shown.
1
locale/en-US/translations.dtd
Normal file
1
locale/en-US/translations.dtd
Normal file
@ -0,0 +1 @@
|
||||
<!ENTITY runlinktargetfinder "Run Link Target Finder">
|
14
scriptapi.js
14
scriptapi.js
@ -1,14 +0,0 @@
|
||||
function script_fire_event(element, type) {
|
||||
//Todo - https://developer.mozilla.org/en-US/docs/DOM/document.createEvent
|
||||
if (element.fireEvent) {
|
||||
element.fireEvent('on' + type);
|
||||
} else {
|
||||
var obj = document.createEvent('Event');
|
||||
obj.initEvent(type, true, true);
|
||||
element.dispatchEvent(obj);
|
||||
}
|
||||
}
|
||||
function script_find_element(id) {
|
||||
//Todo - Add parameters for rest of stuff
|
||||
return document.getElementById(id);
|
||||
}
|
12
skin/skin.css
Normal file
12
skin/skin.css
Normal file
@ -0,0 +1,12 @@
|
||||
#link-target-finder-toolbar-button {
|
||||
list-style-image: url("chrome://firerecord/skin/toolbar-large.png");
|
||||
}
|
||||
|
||||
#link-target-finder-status-bar-icon {
|
||||
width: 83px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.link-target-finder-selected {
|
||||
outline: 2px solid CadetBlue !important;
|
||||
}
|
BIN
skin/status-bar.png
Normal file
BIN
skin/status-bar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 199 B |
BIN
skin/toolbar-large.png
Normal file
BIN
skin/toolbar-large.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@ -1,14 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<script type="text/javascript" src="scriptapi.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a id="foo" onclick="javascript:alert('Success!');">This will be clicked by the script</a></p>
|
||||
<p><a id="bar" onclick="javascript:script_fire_event(script_find_element('foo'), 'click');">Test the script</a></p>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user