Adjusted formatting.

Signed-off-by: retep998 <retep998@verizon.net>
This commit is contained in:
retep998 2013-04-22 07:19:09 -04:00
parent afd37fbf8d
commit 0427e0bf8f
6 changed files with 193 additions and 193 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
*.xpi
*.suo
*.sln
*.sln

View File

@ -1,43 +1,43 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://linktargetfinder/skin/skin.css" type="text/css"?>
<?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>
<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"/>
</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>

View File

@ -4,7 +4,7 @@ window.addEventListener("load", function load(event) {
window.removeEventListener("load", load, false); //remove listener, no longer needed
firerecord.init();
}, false);
var firerecord = function () {
var prefManager = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
return {
@ -14,25 +14,25 @@ var firerecord = function () {
appcontent.addEventListener("DOMContentLoaded", firerecord.run, true);
}
},
running: function (){
if(recordingx){
recordingx = false;
alert("Stop Listen");
//document.location.reload();
//closes all tabs on firefox.
}
else{
recordingx = true;
alert("Start Listen");
firerecord.run();
}
},
file: function(){
running: function () {
if (recordingx) {
recordingx = false;
alert("Stop Listen");
//document.location.reload();
//closes all tabs on firefox.
}
else {
recordingx = true;
alert("Start Listen");
firerecord.run();
}
},
run : function () {
},
file: function () {
},
run: function () {
var head = content.document.getElementsByTagName("head")[0],
style = content.document.getElementById("link-target-finder-style"),
all = content.document.getElementsByTagName("*"),
@ -60,83 +60,83 @@ var firerecord = function () {
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;
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;
}
}
}
}
}
//----------------------------------------------------------------
}
};
//Need to add author to this part...
//Need to add author to this part...
//Need to add author to this part...
function handleEvent(e) {
var targ;
if (!e) {
@ -156,87 +156,87 @@ var firerecord = function () {
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[1]) {
taginfo[1] = "null";
}
if(!taginfo[2]){
taginfo[2]= "null";
if (!taginfo[2]) {
taginfo[2] = "null";
}
if(!taginfo[3]){
taginfo[3]= "null";
if (!taginfo[3]) {
taginfo[3] = "null";
}
if(!taginfo[4]){
taginfo[4]= "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('::'));
alert("You clicked on a " + tname + " with info \n " + taginfo[1] + "\n" + taginfo[2] + "\n" + taginfo[3] + "\n" + " saving... " + taginfo.join('::'));
e.cancelBubble = true;
};

View File

@ -1,31 +1,31 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<prefwindow
<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>
<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>

View File

@ -2,22 +2,22 @@
<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>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>
<Description about="urn:mozilla:install-manifest">
<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>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>4.0</em:minVersion>
<em:maxVersion>20.0.1</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>4.0</em:minVersion>
<em:maxVersion>20.0.1</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>

View File

@ -1,12 +1,12 @@
#link-target-finder-toolbar-button {
list-style-image: url("chrome://firerecord/skin/toolbar-large.png");
list-style-image: url("chrome://firerecord/skin/toolbar-large.png");
}
#link-target-finder-status-bar-icon {
width: 83px;
margin: 0 5px;
width: 83px;
margin: 0 5px;
}
.link-target-finder-selected {
outline: 2px solid CadetBlue !important;
}
outline: 2px solid CadetBlue !important;
}